/external/tpm2-tss/test/integration/ |
D | sapi-asymmetric-encrypt-decrypt.int.c | 67 in_public.publicArea.type = TPM2_ALG_RSA; in test_invoke() 68 in_public.publicArea.nameAlg = TPM2_ALG_SHA256; in test_invoke() 69 *(UINT32 *)&(in_public.publicArea.objectAttributes) = 0; in test_invoke() 70 in_public.publicArea.objectAttributes |= TPMA_OBJECT_RESTRICTED; in test_invoke() 71 in_public.publicArea.objectAttributes |= TPMA_OBJECT_USERWITHAUTH; in test_invoke() 72 in_public.publicArea.objectAttributes |= TPMA_OBJECT_DECRYPT; in test_invoke() 73 in_public.publicArea.objectAttributes |= TPMA_OBJECT_FIXEDTPM; in test_invoke() 74 in_public.publicArea.objectAttributes |= TPMA_OBJECT_FIXEDPARENT; in test_invoke() 75 in_public.publicArea.objectAttributes |= TPMA_OBJECT_SENSITIVEDATAORIGIN; in test_invoke() 77 in_public.publicArea.authPolicy.size = 0; in test_invoke() [all …]
|
D | sapi-command-cancel.int.c | 48 in_public.publicArea.type = TPM2_ALG_RSA; in test_invoke() 49 in_public.publicArea.nameAlg = TPM2_ALG_SHA256; in test_invoke() 50 in_public.publicArea.objectAttributes |= TPMA_OBJECT_RESTRICTED; in test_invoke() 51 in_public.publicArea.objectAttributes |= TPMA_OBJECT_USERWITHAUTH; in test_invoke() 52 in_public.publicArea.objectAttributes |= TPMA_OBJECT_DECRYPT; in test_invoke() 53 in_public.publicArea.objectAttributes |= TPMA_OBJECT_FIXEDTPM; in test_invoke() 54 in_public.publicArea.objectAttributes |= TPMA_OBJECT_FIXEDPARENT; in test_invoke() 55 in_public.publicArea.objectAttributes |= TPMA_OBJECT_SENSITIVEDATAORIGIN; in test_invoke() 56 in_public.publicArea.parameters.rsaDetail.symmetric.algorithm = TPM2_ALG_AES; in test_invoke() 57 in_public.publicArea.parameters.rsaDetail.symmetric.keyBits.aes = 128; in test_invoke() [all …]
|
D | sapi-policy-template.int.c | 81 in_public.publicArea.type = TPM2_ALG_RSA; in test_invoke() 82 in_public.publicArea.nameAlg = TPM2_ALG_SHA256; in test_invoke() 83 in_public.publicArea.objectAttributes = TPMA_OBJECT_RESTRICTED; in test_invoke() 84 in_public.publicArea.objectAttributes |= TPMA_OBJECT_USERWITHAUTH; in test_invoke() 85 in_public.publicArea.objectAttributes |= TPMA_OBJECT_DECRYPT; in test_invoke() 86 in_public.publicArea.objectAttributes |= TPMA_OBJECT_FIXEDTPM; in test_invoke() 87 in_public.publicArea.objectAttributes |= TPMA_OBJECT_FIXEDPARENT; in test_invoke() 88 in_public.publicArea.objectAttributes |= TPMA_OBJECT_SENSITIVEDATAORIGIN; in test_invoke() 89 in_public.publicArea.parameters.rsaDetail.symmetric.algorithm = TPM2_ALG_AES; in test_invoke() 90 in_public.publicArea.parameters.rsaDetail.symmetric.keyBits.aes = 128; in test_invoke() [all …]
|
D | sapi-util.c | 60 in_public.publicArea.type = TPM2_ALG_RSA; in create_primary_rsa_2048_aes_128_cfb() 61 in_public.publicArea.nameAlg = TPM2_ALG_SHA256; in create_primary_rsa_2048_aes_128_cfb() 62 in_public.publicArea.objectAttributes |= TPMA_OBJECT_RESTRICTED; in create_primary_rsa_2048_aes_128_cfb() 63 in_public.publicArea.objectAttributes |= TPMA_OBJECT_USERWITHAUTH; in create_primary_rsa_2048_aes_128_cfb() 64 in_public.publicArea.objectAttributes |= TPMA_OBJECT_DECRYPT; in create_primary_rsa_2048_aes_128_cfb() 65 in_public.publicArea.objectAttributes |= TPMA_OBJECT_FIXEDTPM; in create_primary_rsa_2048_aes_128_cfb() 66 in_public.publicArea.objectAttributes |= TPMA_OBJECT_FIXEDPARENT; in create_primary_rsa_2048_aes_128_cfb() 67 in_public.publicArea.objectAttributes |= TPMA_OBJECT_SENSITIVEDATAORIGIN; in create_primary_rsa_2048_aes_128_cfb() 68 in_public.publicArea.parameters.rsaDetail.symmetric.algorithm = TPM2_ALG_AES; in create_primary_rsa_2048_aes_128_cfb() 69 in_public.publicArea.parameters.rsaDetail.symmetric.keyBits.aes = 128; in create_primary_rsa_2048_aes_128_cfb() [all …]
|
D | esys-hmac.int.c | 78 inPublic.publicArea.nameAlg = TPM2_ALG_SHA1; in test_esys_hmac() 79 inPublic.publicArea.type = TPM2_ALG_KEYEDHASH; in test_esys_hmac() 80 inPublic.publicArea.objectAttributes |= TPMA_OBJECT_SIGN_ENCRYPT; in test_esys_hmac() 81 inPublic.publicArea.objectAttributes |= TPMA_OBJECT_USERWITHAUTH; in test_esys_hmac() 82 inPublic.publicArea.objectAttributes |= TPMA_OBJECT_SENSITIVEDATAORIGIN; in test_esys_hmac() 83 inPublic.publicArea.parameters.keyedHashDetail.scheme.scheme = TPM2_ALG_HMAC; in test_esys_hmac() 84 inPublic.publicArea.parameters.keyedHashDetail.scheme.details.hmac.hashAlg = TPM2_ALG_SHA1; in test_esys_hmac()
|
D | sapi-create-keyedhash-sha1-hmac.int.c | 57 inPublic.publicArea.nameAlg = TPM2_ALG_SHA1; in test_invoke() 58 inPublic.publicArea.type = TPM2_ALG_KEYEDHASH; in test_invoke() 59 inPublic.publicArea.objectAttributes |= TPMA_OBJECT_SIGN_ENCRYPT; in test_invoke() 60 inPublic.publicArea.objectAttributes |= TPMA_OBJECT_SENSITIVEDATAORIGIN; in test_invoke() 61 inPublic.publicArea.parameters.keyedHashDetail.scheme.scheme = TPM2_ALG_HMAC; in test_invoke() 62 inPublic.publicArea.parameters.keyedHashDetail.scheme.details.hmac.hashAlg = TPM2_ALG_SHA1; in test_invoke()
|
/external/ms-tpm-20-ref/TPMCmd/tpm/src/crypt/ |
D | CryptUtil.c | 88 &signKey->publicArea.parameters.keyedHashDetail.scheme; in CryptHMACVerifySignature() 125 TPMT_PUBLIC *publicArea, // IN/OUT: the public area template in CryptGenerateKeyedHash() argument 136 scheme = &publicArea->parameters.keyedHashDetail.scheme; in CryptGenerateKeyedHash() 138 if(publicArea->type != TPM_ALG_KEYEDHASH) in CryptGenerateKeyedHash() 143 hashAlg = publicArea->nameAlg; in CryptGenerateKeyedHash() 158 if(IS_ATTRIBUTE(publicArea->objectAttributes, TPMA_OBJECT, decrypt) in CryptGenerateKeyedHash() 159 || IS_ATTRIBUTE(publicArea->objectAttributes, TPMA_OBJECT, sign)) in CryptGenerateKeyedHash() 311 TPMT_PUBLIC *publicArea, // IN/OUT: The public area template in CryptGenerateKeySymmetric() argument 318 UINT16 keyBits = publicArea->parameters.symDetail.sym.keyBits.sym; in CryptGenerateKeySymmetric() 327 result = CryptSymKeyValidate(&publicArea->parameters.symDetail.sym, in CryptGenerateKeySymmetric() [all …]
|
D | RsaKeyCache.c | 128 TPMT_PUBLIC *publicArea, in InitializeKeyCache() argument 135 TPM_KEY_BITS keySave = publicArea->parameters.rsaDetail.keyBits; in InitializeKeyCache() 141 publicArea->parameters.rsaDetail.keyBits in InitializeKeyCache() 143 OK = (CryptRsaGenerateKey(publicArea, sensitive, rand) == TPM_RC_SUCCESS); in InitializeKeyCache() 146 s_rsaKeyCache[index].publicModulus = publicArea->unique.rsa; in InitializeKeyCache() 150 publicArea->parameters.rsaDetail.keyBits = keySave; in InitializeKeyCache() 190 TPMT_PUBLIC *publicArea, in KeyCacheLoaded() argument 221 s_rsaKeyCacheEnabled = InitializeKeyCache(publicArea, sensitive, rand); in KeyCacheLoaded() 231 TPMT_PUBLIC *publicArea, in GetCachedRsaKey() argument 237 int keyBits = publicArea->parameters.rsaDetail.keyBits; in GetCachedRsaKey() [all …]
|
D | CryptRsa.c | 259 UINT32 e = key->publicArea.parameters.rsaDetail.exponent; in RSAEP() 266 e2B.t.size, e2B.t.buffer, key->publicArea.unique.rsa.t.size, in RSAEP() 267 key->publicArea.unique.rsa.t.buffer); in RSAEP() 291 key->publicArea.unique.rsa.t.size, in RSADP() 292 key->publicArea.unique.rsa.t.buffer) >= 0) in RSADP() 300 if(CryptRsaLoadPrivateExponent(&key->publicArea, &key->sensitive) in RSADP() 962 keyScheme = &rsaObject->publicArea.parameters.asymDetail.scheme; in CryptRsaSelectScheme() 997 TPMT_PUBLIC *publicArea, in CryptRsaLoadPrivateExponent() argument 1004 if((sensitive->sensitive.rsa.t.size * 2) == publicArea->unique.rsa.t.size) in CryptRsaLoadPrivateExponent() 1007 BN_RSA_INITIALIZED(bnN, &publicArea->unique.rsa); in CryptRsaLoadPrivateExponent() [all …]
|
/external/ms-tpm-20-ref/TPMCmd/tpm/src/command/Object/ |
D | Create.c | 96 TPMT_PUBLIC *publicArea; in TPM2_Create() local 114 publicArea = &newObject->publicArea; in TPM2_Create() 117 *publicArea = in->inPublic.publicArea; in TPM2_Create() 122 result = CreateChecks(parentObject, publicArea, in TPM2_Create() 127 if(!AdjustAuthSize(&in->inSensitive.sensitive.userAuth, publicArea->nameAlg)) in TPM2_Create() 136 FillInCreationData(in->parentHandle, publicArea->nameAlg, in TPM2_Create() 146 publicArea->nameAlg, in TPM2_Create() 150 out->outPublic.publicArea = newObject->publicArea; in TPM2_Create()
|
D | CreateLoaded.c | 85 TPMT_PUBLIC *publicArea; in TPM2_CreateLoaded() local 107 publicArea = &newObject->publicArea; in TPM2_CreateLoaded() 117 result = UnmarshalToPublic(publicArea, &in->inPublic, derivation, in TPM2_CreateLoaded() 123 if(!AdjustAuthSize(&in->inSensitive.sensitive.userAuth, publicArea->nameAlg)) in TPM2_CreateLoaded() 130 scheme = &parent->publicArea.parameters.keyedHashDetail.scheme; in TPM2_CreateLoaded() 137 if(publicArea->type == TPM_ALG_RSA) in TPM2_CreateLoaded() 141 if(IS_ATTRIBUTE(publicArea->objectAttributes, TPMA_OBJECT, in TPM2_CreateLoaded() 145 result = PublicAttributesValidation(parent, publicArea); in TPM2_CreateLoaded() 170 result = CreateChecks(parent, publicArea, in TPM2_CreateLoaded() 186 (TPM2B *)PublicMarshalAndComputeName(publicArea, in TPM2_CreateLoaded() [all …]
|
D | Object_spt.c | 61 symAlg = protector->publicArea.parameters.asymDetail.symmetric.algorithm; in GetIV2BSize() 62 keyBits = protector->publicArea.parameters.asymDetail.symmetric.keyBits.sym; in GetIV2BSize() 123 symDef = &protector->publicArea.parameters.asymDetail.symmetric; in ComputeProtectionKeyParms() 364 TPMT_PUBLIC *publicArea, in CreateChecks() argument 368 TPMA_OBJECT attributes = publicArea->objectAttributes; in CreateChecks() 382 switch(publicArea->type) in CreateChecks() 411 result = PublicAttributesValidation(parentObject, publicArea); in CreateChecks() 432 TPMT_PUBLIC *publicArea // IN: public area of the object in SchemeChecks() argument 437 TPMA_OBJECT attributes = publicArea->objectAttributes; in SchemeChecks() 438 TPMU_PUBLIC_PARMS *parms = &publicArea->parameters; in SchemeChecks() [all …]
|
D | LoadExternal.c | 102 if(IS_ATTRIBUTE(in->inPublic.publicArea.objectAttributes, TPMA_OBJECT, in TPM2_LoadExternal() 104 || IS_ATTRIBUTE(in->inPublic.publicArea.objectAttributes, TPMA_OBJECT, in TPM2_LoadExternal() 106 || IS_ATTRIBUTE(in->inPublic.publicArea.objectAttributes, TPMA_OBJECT, in TPM2_LoadExternal() 116 PublicMarshalAndComputeName(&in->inPublic.publicArea, &out->name); in TPM2_LoadExternal() 120 &in->inPublic.publicArea, sensitive, in TPM2_LoadExternal()
|
/external/ms-tpm-20-ref/TPMCmd/tpm/src/command/Hierarchy/ |
D | CreatePrimary.c | 74 TPMT_PUBLIC *publicArea; in TPM2_CreatePrimary() local 86 publicArea = &newObject->publicArea; in TPM2_CreatePrimary() 88 *publicArea = in->inPublic.publicArea; in TPM2_CreatePrimary() 93 result = CreateChecks(NULL, publicArea, in TPM2_CreatePrimary() 99 publicArea->nameAlg)) in TPM2_CreatePrimary() 110 (TPM2B *)PublicMarshalAndComputeName(publicArea, &name), in TPM2_CreatePrimary() 126 out->outPublic.publicArea = newObject->publicArea; in TPM2_CreatePrimary() 130 FillInCreationData(in->primaryHandle, publicArea->nameAlg, in TPM2_CreatePrimary()
|
/external/ms-tpm-20-ref/TPMCmd/tpm/src/subsystem/ |
D | Object.c | 202 if(object == NULL || object->publicArea.nameAlg == TPM_ALG_NULL) in GetQualifiedName() 313 TPMA_OBJECT objectAttributes = object->publicArea.objectAttributes; in ObjectSetLoadedAttributes() 365 && object->publicArea.nameAlg != TPM_ALG_NULL) in ObjectSetLoadedAttributes() 369 if(object->publicArea.type == TPM_ALG_KEYEDHASH) in ObjectSetLoadedAttributes() 374 ComputeQualifiedName(parentHandle, object->publicArea.nameAlg, in ObjectSetLoadedAttributes() 393 TPMT_PUBLIC *publicArea, // IN: public area to be installed in the object in ObjectLoad() argument 406 pAssert(publicArea != NULL); in ObjectLoad() 409 if(sensitive == NULL || publicArea->nameAlg == TPM_ALG_NULL) in ObjectLoad() 413 result = SchemeChecks(NULL, publicArea); in ObjectLoad() 419 if(sensitive->seedValue.t.size > CryptHashGetDigestSize(publicArea->nameAlg)) in ObjectLoad() [all …]
|
D | NvDynamic.c | 680 locator + offsetof(NV_INDEX, publicArea.attributes), in NvReadNvIndexAttributes() 712 locator + offsetof(NV_INDEX, publicArea.attributes), in NvWriteNvIndexAttributes() 791 if(!IS_ATTRIBUTE(nvIndex->publicArea.attributes, TPMA_NV, PLATFORMCREATE)) in NvIndexIsAccessible() 803 if(IS_ATTRIBUTE(nvIndex->publicArea.attributes, TPMA_NV, WRITELOCKED) in NvIndexIsAccessible() 814 if(IS_ATTRIBUTE(nvIndex->publicArea.attributes, TPMA_NV, READLOCKED) in NvIndexIsAccessible() 863 s_cachedNvIndex.publicArea.nvIndex = TPM_RH_UNASSIGNED; in NvIndexCacheInit() 888 nvAttributes = nvIndex->publicArea.attributes; in NvGetIndexData() 895 NV_RAM_REF ramAddr = NvRamGetIndex(nvIndex->publicArea.nvIndex); in NvGetIndexData() 903 pAssert(offset <= nvIndex->publicArea.dataSize in NvGetIndexData() 904 && size <= (nvIndex->publicArea.dataSize - offset)); in NvGetIndexData() [all …]
|
/external/ms-tpm-20-ref/TPMCmd/tpm/src/command/HashHMAC/ |
D | HMAC_Start.c | 57 TPMT_PUBLIC *publicArea; in TPM2_HMAC_Start() local 64 publicArea = &keyObject->publicArea; in TPM2_HMAC_Start() 67 if(publicArea->type != TPM_ALG_KEYEDHASH) in TPM2_HMAC_Start() 71 if(IS_ATTRIBUTE(publicArea->objectAttributes, TPMA_OBJECT, restricted)) in TPM2_HMAC_Start() 75 if(!IS_ATTRIBUTE(publicArea->objectAttributes, TPMA_OBJECT, sign)) in TPM2_HMAC_Start() 79 if(publicArea->parameters.keyedHashDetail.scheme.scheme == TPM_ALG_NULL) in TPM2_HMAC_Start() 86 = publicArea->parameters.keyedHashDetail.scheme.details.hmac.hashAlg; in TPM2_HMAC_Start()
|
D | MAC_Start.c | 57 TPMT_PUBLIC *publicArea; in TPM2_MAC_Start() local 64 publicArea = &keyObject->publicArea; in TPM2_MAC_Start() 67 result = CryptSelectMac(publicArea, &in->inScheme); in TPM2_MAC_Start() 77 if(IS_ATTRIBUTE(publicArea->objectAttributes, TPMA_OBJECT, restricted)) in TPM2_MAC_Start() 80 if(!IS_ATTRIBUTE(publicArea->objectAttributes, TPMA_OBJECT, sign)) in TPM2_MAC_Start()
|
/external/ms-tpm-20-ref/TPMCmd/tpm/src/command/Symmetric/ |
D | HMAC.c | 58 TPMT_PUBLIC *publicArea; in TPM2_HMAC() local 64 publicArea = &hmacObject->publicArea; in TPM2_HMAC() 66 if(publicArea->type != TPM_ALG_KEYEDHASH) in TPM2_HMAC() 70 if(IS_ATTRIBUTE(publicArea->objectAttributes, TPMA_OBJECT, restricted)) in TPM2_HMAC() 74 if(!IS_ATTRIBUTE(publicArea->objectAttributes, TPMA_OBJECT, sign)) in TPM2_HMAC() 78 if(publicArea->parameters.keyedHashDetail.scheme.scheme == TPM_ALG_NULL) in TPM2_HMAC() 85 = publicArea->parameters.keyedHashDetail.scheme.details.hmac.hashAlg; in TPM2_HMAC()
|
D | MAC.c | 57 TPMT_PUBLIC *publicArea; in TPM2_MAC() local 63 publicArea = &keyObject->publicArea; in TPM2_MAC() 67 result = CryptSelectMac(publicArea, &in->inScheme); in TPM2_MAC() 75 if(IS_ATTRIBUTE(publicArea->objectAttributes, TPMA_OBJECT, restricted)) in TPM2_MAC() 78 if(!IS_ATTRIBUTE(publicArea->objectAttributes, TPMA_OBJECT, sign)) in TPM2_MAC() 81 out->outMAC.t.size = CryptMacStart(&state, &publicArea->parameters, in TPM2_MAC()
|
D | EncryptDecrypt_spt.c | 72 mode = symKey->publicArea.parameters.symDetail.sym.mode.sym; in EncryptDecryptShared() 75 if(symKey->publicArea.type != TPM_ALG_SYMCIPHER) in EncryptDecryptShared() 78 OK = !IS_ATTRIBUTE(symKey->publicArea.objectAttributes, in EncryptDecryptShared() 81 OK = OK && IS_ATTRIBUTE(symKey->publicArea.objectAttributes, in EncryptDecryptShared() 84 OK = OK && IS_ATTRIBUTE(symKey->publicArea.objectAttributes, in EncryptDecryptShared() 110 keySize = symKey->publicArea.parameters.symDetail.sym.keyBits.sym; in EncryptDecryptShared() 111 alg = symKey->publicArea.parameters.symDetail.sym.algorithm; in EncryptDecryptShared()
|
/external/ms-tpm-20-ref/TPMCmd/tpm/src/command/Asymmetric/ |
D | ZGen_2Phase.c | 67 if(eccKey->publicArea.type != TPM_ALG_ECC) in TPM2_ZGen_2Phase() 71 if(IS_ATTRIBUTE(eccKey->publicArea.objectAttributes, TPMA_OBJECT, restricted) in TPM2_ZGen_2Phase() 72 || !IS_ATTRIBUTE(eccKey->publicArea.objectAttributes, TPMA_OBJECT, decrypt)) in TPM2_ZGen_2Phase() 77 scheme = eccKey->publicArea.parameters.asymDetail.scheme.scheme; in TPM2_ZGen_2Phase() 89 if(!CryptEccIsPointOnCurve(eccKey->publicArea.parameters.eccDetail.curveID, in TPM2_ZGen_2Phase() 93 if(!CryptEccIsPointOnCurve(eccKey->publicArea.parameters.eccDetail.curveID, in TPM2_ZGen_2Phase() 98 eccKey->publicArea.parameters.eccDetail.curveID, in TPM2_ZGen_2Phase() 107 eccKey->publicArea.parameters.eccDetail.curveID, in TPM2_ZGen_2Phase()
|
D | ECDH_ZGen.c | 64 if(eccKey->publicArea.type != TPM_ALG_ECC) in TPM2_ECDH_ZGen() 67 if(IS_ATTRIBUTE(eccKey->publicArea.objectAttributes, TPMA_OBJECT, restricted) in TPM2_ECDH_ZGen() 68 || !IS_ATTRIBUTE(eccKey->publicArea.objectAttributes, TPMA_OBJECT, decrypt)) in TPM2_ECDH_ZGen() 71 if(eccKey->publicArea.parameters.eccDetail.scheme.scheme != TPM_ALG_ECDH in TPM2_ECDH_ZGen() 72 && eccKey->publicArea.parameters.eccDetail.scheme.scheme != TPM_ALG_NULL) in TPM2_ECDH_ZGen() 77 eccKey->publicArea.parameters.eccDetail.curveID, in TPM2_ECDH_ZGen()
|
/external/ms-tpm-20-ref/TPMCmd/tpm/src/command/Duplication/ |
D | Import.c | 119 attributes = in->objectPublic.publicArea.objectAttributes; in TPM2_Import() 155 if(parentObject->publicArea.type == TPM_ALG_SYMCIPHER) in TPM2_Import() 176 PublicMarshalAndComputeName(&(in->objectPublic.publicArea), &name); in TPM2_Import() 183 in->objectPublic.publicArea.nameAlg, in TPM2_Import() 192 if(IS_ATTRIBUTE(parentObject->publicArea.objectAttributes, TPMA_OBJECT, fixedTPM)) in TPM2_Import() 194 result = ObjectLoad(NULL, NULL, &in->objectPublic.publicArea, in TPM2_Import() 203 in->objectPublic.publicArea.nameAlg, in TPM2_Import()
|
/external/ms-tpm-20-ref/TPMCmd/tpm/src/command/NVStorage/ |
D | NV_Extend.c | 71 nvIndex->publicArea.attributes); in TPM2_NV_Extend() 76 if(!IsNvExtendIndex(nvIndex->publicArea.attributes)) in TPM2_NV_Extend() 82 oldDigest.t.size = CryptHashGetDigestSize(nvIndex->publicArea.nameAlg); in TPM2_NV_Extend() 84 if(IS_ATTRIBUTE(nvIndex->publicArea.attributes, TPMA_NV, WRITTEN)) in TPM2_NV_Extend() 93 newDigest.t.size = CryptHashStart(&hashState, nvIndex->publicArea.nameAlg); in TPM2_NV_Extend()
|