/system/keymaster/ |
H A D | auth_encrypted_key_blob.cpp | 33 const Buffer& nonce, const Buffer& tag, 35 size_t size = 1 /* version byte */ + nonce.SerializedSize() + 46 buf = nonce.Serialize(buf, end); 60 AuthorizationSet* sw_enforced, Buffer* nonce, 66 if (!nonce->reserve(OCB_NONCE_LENGTH) || !tag->reserve(OCB_TAG_LENGTH)) 69 if (!copy_from_buf(buf_ptr, end, nonce->peek_write(), OCB_NONCE_LENGTH) || 77 if (!nonce->advance_write(OCB_NONCE_LENGTH) || !tag->advance_write(OCB_TAG_LENGTH)) 85 AuthorizationSet* sw_enforced, Buffer* nonce, 99 !nonce->Deserialize(buf_ptr, end) || nonce 29 SerializeAuthEncryptedBlob(const KeymasterKeyBlob& encrypted_key_material, const AuthorizationSet& hw_enforced, const AuthorizationSet& sw_enforced, const Buffer& nonce, const Buffer& tag, KeymasterKeyBlob* key_blob) argument 57 DeserializeUnversionedBlob(const KeymasterKeyBlob& key_blob, KeymasterKeyBlob* encrypted_key_material, AuthorizationSet* hw_enforced, AuthorizationSet* sw_enforced, Buffer* nonce, Buffer* tag) argument 82 DeserializeAuthEncryptedBlob(const KeymasterKeyBlob& key_blob, KeymasterKeyBlob* encrypted_key_material, AuthorizationSet* hw_enforced, AuthorizationSet* sw_enforced, Buffer* nonce, Buffer* tag) argument [all...] |
H A D | ocb_utils.cpp | 121 const KeymasterKeyBlob& plaintext, const Buffer& nonce, 125 if (nonce.available_read() != OCB_NONCE_LENGTH) 140 int ae_err = ae_encrypt(ctx.get(), nonce.peek_read(), plaintext.key_material, 157 const KeymasterKeyBlob& ciphertext, const Buffer& nonce, 161 if (nonce.available_read() != OCB_NONCE_LENGTH || tag.available_read() != OCB_TAG_LENGTH) 176 int ae_err = ae_decrypt(ctx.get(), nonce.peek_read(), ciphertext.key_material, 118 OcbEncryptKey(const AuthorizationSet& hw_enforced, const AuthorizationSet& sw_enforced, const AuthorizationSet& hidden, const KeymasterKeyBlob& master_key, const KeymasterKeyBlob& plaintext, const Buffer& nonce, KeymasterKeyBlob* ciphertext, Buffer* tag) argument 154 OcbDecryptKey(const AuthorizationSet& hw_enforced, const AuthorizationSet& sw_enforced, const AuthorizationSet& hidden, const KeymasterKeyBlob& master_key, const KeymasterKeyBlob& ciphertext, const Buffer& nonce, const Buffer& tag, KeymasterKeyBlob* plaintext) argument
|
H A D | soft_keymaster_context.cpp | 531 Buffer nonce, tag; local 534 hw_enforced, sw_enforced, &nonce, &tag); 538 if (nonce.available_read() != OCB_NONCE_LENGTH || tag.available_read() != OCB_TAG_LENGTH) 542 nonce, tag, key_material);
|
H A D | android_keymaster_test.cpp | 2478 const char* nonce; member in struct:keymaster::test::AesCtrSp80038aTestVector 2517 const string nonce = hex2str(test.nonce); local 2520 CheckAesCtrTestVector(key, nonce, plaintext, ciphertext); 2588 // Don't specify nonce, should get a random one. 2596 // Now specify a nonce, should also work. 2606 // Decrypt with correct nonce. 2611 // Now try with wrong nonce. 2631 // Don't specify nonce, should get a random one. 2639 // Now specify a nonce, shoul 2821 uint8_t nonce[] = { local [all...] |
H A D | android_keymaster_test_utils.cpp | 566 keymaster_padding_t padding, const string& nonce) { 571 begin_params.push_back(TAG_NONCE, nonce.data(), nonce.size()); 577 keymaster_padding_t padding, const string& nonce) { 582 begin_params.push_back(TAG_NONCE, nonce.data(), nonce.size()); 589 keymaster_padding_t padding, const string& nonce) { 594 begin_params.push_back(TAG_NONCE, nonce.data(), nonce.size()); 629 void Keymaster2Test::CheckAesCtrTestVector(const string& key, const string& nonce, argument 565 DecryptMessage(const string& ciphertext, keymaster_digest_t digest, keymaster_padding_t padding, const string& nonce) argument 576 DecryptMessage(const string& ciphertext, keymaster_block_mode_t block_mode, keymaster_padding_t padding, const string& nonce) argument 587 DecryptMessage(const AuthorizationSet& update_params, const string& ciphertext, keymaster_digest_t digest, keymaster_padding_t padding, const string& nonce) argument [all...] |
H A D | ocb.c | 748 static block gen_offset_from_nonce(ae_ctx* ctx, const void* nonce) { argument 760 /* Replace cached nonce Top if needed */ 772 tmp.u32[1] = ((uint32_t*)nonce)[0]; 773 tmp.u32[2] = ((uint32_t*)nonce)[1]; 774 tmp.u32[3] = ((uint32_t*)nonce)[2]; 775 idx = (unsigned)(tmp.u8[15] & 0x3f); /* Get low 6 bits of nonce */ 776 tmp.u8[15] = tmp.u8[15] & 0xc0; /* Zero low 6 bits of nonce */ 918 int ae_encrypt(ae_ctx* ctx, const void* nonce, const void* pt, int pt_len, const void* ad, argument 930 /* Non-null nonce means start of new message, init per-message values */ 931 if (nonce) { 1129 ae_decrypt(ae_ctx* ctx, const void* nonce, const void* ct, int ct_len, const void* ad, int ad_len, void* pt, const void* tag, int final) argument [all...] |
/system/tpm/trunks/ |
H A D | session_manager_test.cc | 109 TPM2B_NONCE nonce; local 110 nonce.size = 20; 113 .WillOnce(DoAll(SetArgPointee<8>(nonce), Return(TPM_RC_SUCCESS))); 158 TPM2B_NONCE nonce; local 159 nonce.size = 0; 162 .WillOnce(DoAll(SetArgPointee<8>(nonce), Return(TPM_RC_SUCCESS)));
|
H A D | hmac_authorization_delegate_test.cc | 38 TPM2B_NONCE nonce; local 39 nonce.size = kAesKeySize; 40 memset(nonce.buffer, 0, nonce.size); 42 EXPECT_TRUE(delegate.InitSession(dummy_handle, nonce, nonce, std::string(), 48 EXPECT_TRUE(delegate.InitSession(dummy_handle, nonce, nonce, dummy_salt, 70 TPM2B_NONCE nonce; local 71 nonce [all...] |
H A D | resource_manager.cc | 542 TPM2B_NONCE nonce; local 543 result = Parse_TPM2B_NONCE(&buffer, &nonce, nullptr); 616 TPM2B_NONCE nonce; local 617 result = Parse_TPM2B_NONCE(&buffer, &nonce, nullptr);
|
H A D | tpm_generated.h | 1247 TPM2B_NONCE nonce; member in struct:trunks::TPMS_AUTH_COMMAND 1253 TPM2B_NONCE nonce; member in struct:trunks::TPMS_AUTH_RESPONSE
|
/system/tpm/attestation/server/ |
H A D | attestation_service.cc | 677 std::string nonce; local 678 if (!crypto_utility_->GetRandom(kNonceSize, &nonce)) { 679 LOG(ERROR) << __func__ << ": GetRandom(nonce) failed."; 690 nonce, &key_blob, &public_key, &public_key_tpm_format, &key_info,
|
/system/vold/ |
H A D | KeyStorage.cpp | 205 LOG(ERROR) << "GCM encryption but no nonce generated"; 209 std::string nonce(reinterpret_cast<const char*>(&nonceBlob.value()[0]), nonceBlob.value().size()); 210 if (!checkSize("nonce", nonce.size(), GCM_NONCE_BYTES)) return false; 217 *ciphertext = nonce + body + mac; 224 auto nonce = ciphertext.substr(0, GCM_NONCE_BYTES); local 227 .Authorization(TAG_NONCE, blob2hidlVec(nonce));
|