Searched defs:salt (Results 1 - 21 of 21) sorted by relevance

/system/keymaster/tests/
H A Dkdf_test.cpp34 uint8_t salt[128]; local
35 ASSERT_TRUE(kdf.Init(KM_DIGEST_SHA1, key, 128, salt, 128));
36 ASSERT_TRUE(kdf.Init(KM_DIGEST_SHA_2_256, key, 128, salt, 128));
38 ASSERT_FALSE(kdf.Init(KM_DIGEST_MD5, key, 128, salt, 128));
39 ASSERT_FALSE(kdf.Init(KM_DIGEST_SHA1, nullptr, 0, salt, 128));
40 ASSERT_FALSE(kdf.Init(KM_DIGEST_SHA1, nullptr, 128, salt, 128));
41 ASSERT_FALSE(kdf.Init(KM_DIGEST_SHA1, key, 0, salt, 128));
H A Dhkdf_test.cpp63 const string salt = hex2str(test.salt_hex); local
70 reinterpret_cast<const uint8_t*>(salt.data()), salt.size()));
/system/gatekeeper/include/gatekeeper/
H A Dpassword_handle.h40 salt_t salt; member in struct:gatekeeper::password_handle_t
/system/keymaster/include/keymaster/km_openssl/
H A Dhkdf.h35 bool Init(Buffer& secret, Buffer& salt) { argument
36 return Init(secret.peek_read(), secret.available_read(), salt.peek_read(),
37 salt.available_read());
40 bool Init(const uint8_t* secret, size_t secret_len, const uint8_t* salt, size_t salt_len) { argument
41 return Kdf::Init(KM_DIGEST_SHA_2_256, secret, secret_len, salt, salt_len);
/system/keymaster/km_openssl/
H A Dkdf.cpp24 const uint8_t* salt, size_t salt_len) {
49 if (salt && salt_len > 0) {
50 salt_.reset(dup_buffer(salt, salt_len));
23 Init(keymaster_digest_t digest_type, const uint8_t* secret, size_t secret_len, const uint8_t* salt, size_t salt_len) argument
/system/security/keystore/
H A Duser_state.cpp105 * password so we cannot generate a new file with a new salt.
146 // We read the raw blob to just to get the salt to generate the AES key, then we create the Blob
153 // find salt at EOF if present, otherwise we have an old file
154 uint8_t* salt; local
156 salt = (uint8_t*)&rawBlob + length - SALT_SIZE;
158 salt = NULL;
161 generateKeyFromPassword(passwordKey, MASTER_KEY_SIZE_BYTES, pw, salt);
168 // If salt was missing, generate one and write a new master key file with the salt.
169 if (salt
224 generateKeyFromPassword(uint8_t* key, ssize_t keySize, const android::String8& pw, uint8_t* salt) argument
236 PKCS5_PBKDF2_HMAC_SHA1(reinterpret_cast<const char*>(pw.string()), pw.length(), salt, saltSize, local
[all...]
/system/tpm/trunks/
H A Dsession_manager_impl.cc84 std::string salt(SHA256_DIGEST_SIZE, 0);
86 reinterpret_cast<unsigned char*>(base::string_as_array(&salt));
87 CHECK_EQ(RAND_bytes(salt_buffer, salt.size()), 1)
88 << "Error generating a cryptographically random salt.";
89 // First we encrypt the cryptographically secure salt using PKCS1_OAEP
93 TPM_RC salt_result = EncryptSalt(salt, &encrypted_salt);
95 LOG(ERROR) << "Error encrypting salt: " << GetErrorString(salt_result);
136 delegate->InitSession(session_handle_, nonce_tpm, nonce_caller, salt,
145 TPM_RC SessionManagerImpl::EncryptSalt(const std::string& salt, argument
199 LOG(ERROR) << "Error setting up salt encryp
[all...]
H A Dhmac_authorization_delegate.cc213 const std::string& salt,
226 if (salt.length() == 0 && bind_auth_value.length() == 0) {
231 session_key_ = CreateKey(bind_auth_value + salt, session_key_label,
210 InitSession(TPM_HANDLE session_handle, const TPM2B_NONCE& tpm_nonce, const TPM2B_NONCE& caller_nonce, const std::string& salt, const std::string& bind_auth_value, bool enable_parameter_encryption) argument
/system/core/gatekeeperd/
H A DSoftGateKeeper.h38 uint64_t salt; member in struct:gatekeeper::fast_hash_t
83 uint32_t password_length, salt_t salt) const {
85 crypto_scrypt(password, password_length, reinterpret_cast<uint8_t *>(&salt),
86 sizeof(salt), N, r, p, signature, signature_length);
136 fast_hash_t ComputeFastHash(const SizedBuffer &password, uint64_t salt) { argument
138 size_t digest_size = password.length + sizeof(salt);
140 memcpy(digest.get(), &salt, sizeof(salt));
141 memcpy(digest.get() + sizeof(salt), password.buffer.get(), password.length);
145 fast_hash.salt
161 uint64_t salt; local
[all...]
/system/extras/libfec/
H A Dfec_private.h86 uint8_t *salt; member in struct:verity_info
H A Dfec_verity.cpp118 /* computes a SHA-256 salted with `f->verity.salt' from a FEC_BLOCKSIZE byte
127 check(f->verity.salt);
128 SHA256_Update(&ctx, f->verity.salt, f->verity.salt_size);
357 std::unique_ptr<uint8_t[]> salt; local
407 case 9: /* salt */
412 salt.reset(new (std::nothrow) uint8_t[v->salt_size]);
414 if (!salt) {
419 if (parse_hex(salt.get(), v->salt_size, token.c_str()) == -1) {
420 error("invalid verity salt: %s", token.c_str());
443 if (v->salt) {
[all...]
/system/extras/verity/
H A Dbuild_verity_tree.cpp23 const unsigned char *salt; member in struct:sparse_hash_ctx
55 const unsigned char *salt, size_t salt_len,
65 ret &= EVP_DigestUpdate(mdctx, salt, salt_len);
79 const unsigned char *salt, size_t salt_size,
85 hash_block(md, in + i, block_size, salt, salt_size, out, &s);
101 ctx->salt, ctx->salt_size, ctx->block_size);
116 " -a,--salt-str=<string> set salt to <string>\n"
117 " -A,--salt-hex=<hex digits> set salt t
53 hash_block(const EVP_MD *md, const unsigned char *block, size_t len, const unsigned char *salt, size_t salt_len, unsigned char *out, size_t *out_size) argument
76 hash_blocks(const EVP_MD *md, const unsigned char *in, size_t in_size, unsigned char *out, size_t *out_size, const unsigned char *salt, size_t salt_size, size_t block_size) argument
129 std::vector<unsigned char> salt; local
[all...]
/system/gatekeeper/
H A Dgatekeeper.cpp90 salt_t salt; local
91 GetRandom(&salt, sizeof(salt));
95 salt, user_id, flags, HANDLE_VERSION, request.provided_password.buffer.get(),
169 bool GateKeeper::CreatePasswordHandle(SizedBuffer *password_handle_buffer, salt_t salt, argument
178 password_handle->salt = salt;
203 password_key, password_key_length, to_sign.get(), to_sign_size, salt);
211 if (!CreatePasswordHandle(&provided_handle, expected_handle->salt, expected_handle->user_id,
/system/iot/attestation/atap/libatap/
H A Datap_util.c338 uint8_t salt[2 * ATAP_ECDH_KEY_LEN]; local
340 atap_memcpy(salt, ca_pubkey, ATAP_ECDH_KEY_LEN);
341 atap_memcpy(salt + ATAP_ECDH_KEY_LEN, device_pubkey, ATAP_ECDH_KEY_LEN);
344 salt,
345 sizeof(salt),
/system/iot/attestation/atap/ops/
H A Datap_ops_provider.cpp146 const uint8_t* salt,
155 salt, salt_len, ikm, ikm_len, info, info_len, okm, okm_len);
145 forward_hkdf_sha256(AtapOps* ops, const uint8_t* salt, uint32_t salt_len, const uint8_t* ikm, uint32_t ikm_len, const uint8_t* info, uint32_t info_len, uint8_t* okm, uint32_t okm_len) argument
H A Dopenssl_ops.cpp234 AtapResult OpensslOps::hkdf_sha256(const uint8_t* salt, argument
247 salt,
/system/core/fs_mgr/
H A Dfs_mgr_avb.cpp235 const std::string& salt, const std::string& root_digest,
258 // <algorithm> <digest> <salt>
265 << hashtree_desc.hash_algorithm << " " << root_digest << " " << salt;
349 const std::string& salt, const std::string& root_digest,
375 construct_verity_table(hashtree_desc, salt, root_digest, fstab_entry->blk_device);
596 std::string salt; local
598 if (!get_hashtree_descriptor(partition_name, *avb_slot_data_, &hashtree_descriptor, &salt,
604 if (!hashtree_dm_verity_setup(fstab_entry, hashtree_descriptor, salt, root_digest,
234 construct_verity_table(const AvbHashtreeDescriptor& hashtree_desc, const std::string& salt, const std::string& root_digest, const std::string& blk_device) argument
347 hashtree_dm_verity_setup(struct fstab_rec* fstab_entry, const AvbHashtreeDescriptor& hashtree_desc, const std::string& salt, const std::string& root_digest, bool wait_for_verity_dev) argument
/system/vold/
H A DKeyStorage.cpp76 static const char* kFn_salt = "salt";
296 const std::string& salt, std::string* stretched) {
315 reinterpret_cast<const uint8_t*>(salt.data()), salt.size(), 1 << Nf,
329 const std::string& salt, const std::string& secdiscardable_hash,
332 if (!stretchSecret(stretching, auth.secret, salt, &stretched)) return false;
457 std::string salt;
459 if (ReadRandomBytes(SALT_BYTES, salt) != OK) {
463 if (!writeStringToFile(salt, dir + "/" + kFn_salt)) return false;
466 if (!generateAppId(auth, stretching, salt, secdiscardable_has
295 stretchSecret(const std::string& stretching, const std::string& secret, const std::string& salt, std::string* stretched) argument
328 generateAppId(const KeyAuthentication& auth, const std::string& stretching, const std::string& salt, const std::string& secdiscardable_hash, std::string* appId) argument
[all...]
H A Dcryptfs.h26 * The fields after salt are only valid in rev 1.1 and later stuctures.
116 unsigned char salt[SALT_LEN]; /* The salt used for this encryption */ member in struct:crypt_mnt_ftr
228 typedef int (*kdf_func)(const char* passwd, const unsigned char* salt, unsigned char* ikey,
H A Dcryptfs.cpp506 /* key or salt can be NULL, in which case just skip writing that value. Useful to
1180 static int pbkdf2(const char *passwd, const unsigned char *salt, argument
1186 return PKCS5_PBKDF2_HMAC_SHA1(passwd, strlen(passwd), salt, SALT_LEN,
1191 static int scrypt(const char *passwd, const unsigned char *salt, argument
1204 salt, SALT_LEN, N, r, p, ikey,
1210 static int scrypt_keymaster(const char *passwd, const unsigned char *salt, argument
1225 salt, SALT_LEN, N, r, p, ikey,
1239 rc = crypto_scrypt(signature, signature_size, salt, SALT_LEN,
1251 static int encrypt_master_key(const char *passwd, const unsigned char *salt, argument
1271 if (scrypt_keymaster(passwd, salt, ike
1337 decrypt_master_key_aux(const char *passwd, unsigned char *salt, const unsigned char *encrypted_master_key, size_t keysize, unsigned char *decrypted_master_key, kdf_func kdf, void *kdf_params, unsigned char** intermediate_key, size_t* intermediate_key_size) argument
1424 create_encrypted_random_key(const char *passwd, unsigned char *master_key, unsigned char *salt, struct crypt_mnt_ftr *crypt_ftr) argument
[all...]
/system/bt/stack/smp/
H A Dsmp_keys.cc1195 * salt
1196 * where salt is internal parameter of
1421 * salt
1423 * Internal: salt is 128 bit.
1437 salt: 6C88 8391 AAF5 A538 6037 0BDB 5A60 83BE
1439 BT_OCTET16 salt = {0xBE, 0x83, 0x60, 0x5A, 0xDB, 0x0B, 0x37, 0x60, local
1447 p_prnt = salt;
1448 smp_debug_print_nbyte_little_endian(p_prnt, "salt", BT_OCTET16_LEN);
1457 ARRAY_TO_STREAM(p, salt, BT_OCTET16_LEN);
1665 BT_OCTET16 salt local
1760 BT_OCTET16 salt = {0x32, 0x70, 0x6D, 0x74, 0x00, 0x00, 0x00, 0x00, local
1910 smp_calculate_h7(uint8_t* salt, uint8_t* w, uint8_t* c) argument
[all...]

Completed in 570 milliseconds