Home
last modified time | relevance | path

Searched refs:salt (Results 1 – 25 of 45) sorted by relevance

12

/system/extras/verity/
Dbuild_verity_tree_main.cpp50 std::vector<unsigned char> salt; in main() local
74 salt.clear(); in main()
75 salt.insert(salt.end(), optarg, &optarg[strlen(optarg)]); in main()
78 if (!HashTreeBuilder::ParseBytesArrayFromString(optarg, &salt)) { in main()
140 if (salt.empty()) { in main()
141 salt.resize(builder.hash_size()); in main()
149 ssize_t ret = read(random_fd, salt.data(), salt.size()); in main()
150 if (ret != static_cast<ssize_t>(salt.size())) { in main()
151 PLOG(ERROR) << "failed to read " << salt.size() in main()
157 if (!generate_verity_tree(argv[0], argv[1], &builder, salt, kBlockSize, in main()
[all …]
Dbuild_verity_metadata.py63 def build_verity_table(block_device, data_blocks, root_hash, salt): argument
72 salt)
75 def build_verity_metadata(data_blocks, metadata_image, root_hash, salt, argument
79 verity_table = build_verity_table(block_device, data_blocks, root_hash, salt)
115 args.root_hash, args.salt, args.block_device,
/system/keymaster/tests/
Dkdf_test.cpp34 uint8_t salt[128]; in TEST() local
35 ASSERT_TRUE(kdf.Init(KM_DIGEST_SHA1, key, 128, salt, 128)); in TEST()
36 ASSERT_TRUE(kdf.Init(KM_DIGEST_SHA_2_256, key, 128, salt, 128)); in TEST()
38 ASSERT_FALSE(kdf.Init(KM_DIGEST_MD5, key, 128, salt, 128)); in TEST()
39 ASSERT_FALSE(kdf.Init(KM_DIGEST_SHA1, nullptr, 0, salt, 128)); in TEST()
40 ASSERT_FALSE(kdf.Init(KM_DIGEST_SHA1, nullptr, 128, salt, 128)); in TEST()
41 ASSERT_FALSE(kdf.Init(KM_DIGEST_SHA1, key, 0, salt, 128)); in TEST()
Dhkdf_test.cpp63 const string salt = hex2str(test.salt_hex); in TEST() local
70 reinterpret_cast<const uint8_t*>(salt.data()), salt.size())); in TEST()
/system/keymaster/include/keymaster/km_openssl/
Dhkdf.h35 bool Init(Buffer& secret, Buffer& salt) { in Init() argument
36 return Init(secret.peek_read(), secret.available_read(), salt.peek_read(), in Init()
37 salt.available_read()); in Init()
40 bool Init(const uint8_t* secret, size_t secret_len, const uint8_t* salt, size_t salt_len) { in Init() argument
41 return Kdf::Init(KM_DIGEST_SHA_2_256, secret, secret_len, salt, salt_len); in Init()
Dkdf.h36 const uint8_t* salt, size_t salt_len);
/system/keymaster/km_openssl/
Dkdf.cpp24 const uint8_t* salt, size_t salt_len) { in Init() argument
49 if (salt && salt_len > 0) { in Init()
50 salt_.reset(dup_buffer(salt, salt_len)); in Init()
/system/gatekeeper/
Dgatekeeper.cpp90 salt_t salt; in Enroll() local
91 GetRandom(&salt, sizeof(salt)); in Enroll()
95 salt, user_id, flags, HANDLE_VERSION, request.provided_password)) { in Enroll()
166 bool GateKeeper::CreatePasswordHandle(SizedBuffer *password_handle_buffer, salt_t salt, in CreatePasswordHandle() argument
173 password_handle.salt = salt; in CreatePasswordHandle()
181 static_assert(offsetof(password_handle_t, salt) == metadata_length, in CreatePasswordHandle()
201 password_key, password_key_length, to_sign.get(), to_sign_size, salt); in CreatePasswordHandle()
216 if (!CreatePasswordHandle(&provided_handle, expected_handle->salt, expected_handle->user_id, in DoVerify()
/system/security/keystore/
Duser_state.cpp168 uint8_t* salt; in readMasterKey() local
170 salt = (uint8_t*)&rawBlob + length - SALT_SIZE; in readMasterKey()
172 salt = nullptr; in readMasterKey()
181 generateKeyFromPassword(passwordKey, pw, salt); in readMasterKey()
194 if (salt == nullptr) { in readMasterKey()
238 uint8_t* salt) { in generateKeyFromPassword() argument
240 if (salt != nullptr) { in generateKeyFromPassword()
244 salt = (uint8_t*)"keystore"; in generateKeyFromPassword()
256 PKCS5_PBKDF2_HMAC(reinterpret_cast<const char*>(pw.string()), pw.length(), salt, saltSize, 8192, in generateKeyFromPassword()
/system/bt/stack/crypto_toolbox/
Dcrypto_toolbox.cc33 Octet16 h7(const Octet16& salt, const Octet16& w) { in h7() argument
34 return aes_cmac(salt, w.data(), w.size()); in h7()
83 const Octet16 salt{0xBE, 0x83, 0x60, 0x5A, 0xDB, 0x0B, 0x37, 0x60, in f5() local
85 Octet16 t = aes_cmac(salt, w, BT_OCTET32_LEN); in f5()
157 constexpr Octet16 salt{0x31, 0x70, 0x6D, 0x74, 0x00, 0x00, 0x00, 0x00, in ltk_to_link_key() local
159 ilk = h7(salt, ltk); in ltk_to_link_key()
174 constexpr Octet16 salt{0x32, 0x70, 0x6D, 0x74, 0x00, 0x00, 0x00, 0x00, in link_key_to_ltk() local
176 iltk = h7(salt, link_key); in link_key_to_ltk()
/system/bt/gd/crypto_toolbox/
Dcrypto_toolbox.cc34 Octet16 h7(const Octet16& salt, const Octet16& w) { in h7() argument
35 return aes_cmac(salt, w.data(), w.size()); in h7()
83 …const Octet16 salt{0xBE, 0x83, 0x60, 0x5A, 0xDB, 0x0B, 0x37, 0x60, 0x38, 0xA5, 0xF5, 0xAA, 0x91, 0… in f5() local
84 Octet16 t = aes_cmac(salt, w, OCTET32_LEN); in f5()
142 constexpr Octet16 salt{ in ltk_to_link_key() local
144 ilk = h7(salt, ltk); in ltk_to_link_key()
159 constexpr Octet16 salt{ in link_key_to_ltk() local
161 iltk = h7(salt, link_key); in link_key_to_ltk()
/system/update_engine/payload_generator/
Dpayload_generation_config_android_unittest.cc156 brillo::Blob salt(kHashTreeSalt, std::end(kHashTreeSalt)); in TEST_F() local
157 EXPECT_EQ(salt, verity.hash_tree_salt); in TEST_F()
175 brillo::Blob salt(kHashTreeSalt, std::end(kHashTreeSalt)); in TEST_F() local
176 EXPECT_EQ(salt, verity.hash_tree_salt); in TEST_F()
Dpayload_generation_config_android.cc51 const uint8_t* salt = reinterpret_cast<const uint8_t*>(descriptor) + in AvbDescriptorCallback() local
54 part->verity.hash_tree_salt.assign(salt, salt + hashtree.salt_len); in AvbDescriptorCallback()
/system/vold/
DKeyStorage.cpp332 const std::string& salt, std::string* stretched) { in stretchSecret() argument
351 reinterpret_cast<const uint8_t*>(salt.data()), salt.size(), 1 << Nf, in stretchSecret()
365 const std::string& salt, const std::string& secdiscardable_hash, in generateAppId() argument
368 if (!stretchSecret(stretching, auth.secret, salt, &stretched)) return false; in generateAppId()
493 std::string salt; in storeKey() local
495 if (ReadRandomBytes(SALT_BYTES, salt) != OK) { in storeKey()
499 if (!writeStringToFile(salt, dir + "/" + kFn_salt)) return false; in storeKey()
502 if (!generateAppId(auth, stretching, salt, secdiscardable_hash, &appId)) return false; in storeKey()
555 std::string salt; in retrieveKey() local
557 if (!readFileToString(dir + "/" + kFn_salt, &salt)) return false; in retrieveKey()
[all …]
Dcryptfs.cpp181 unsigned char salt[SALT_LEN]; /* The salt used for this encryption */ member
260 typedef int (*kdf_func)(const char* passwd, const unsigned char* salt, unsigned char* ikey,
1142 static int pbkdf2(const char* passwd, const unsigned char* salt, unsigned char* ikey, in pbkdf2() argument
1147 return PKCS5_PBKDF2_HMAC_SHA1(passwd, strlen(passwd), salt, SALT_LEN, HASH_COUNT, in pbkdf2()
1151 static int scrypt(const char* passwd, const unsigned char* salt, unsigned char* ikey, void* params)… in scrypt() argument
1161 crypto_scrypt((const uint8_t*)passwd, strlen(passwd), salt, SALT_LEN, N, r, p, ikey, in scrypt()
1167 static int scrypt_keymaster(const char* passwd, const unsigned char* salt, unsigned char* ikey, in scrypt_keymaster() argument
1180 rc = crypto_scrypt((const uint8_t*)passwd, strlen(passwd), salt, SALT_LEN, N, r, p, ikey, in scrypt_keymaster()
1193 rc = crypto_scrypt(signature, signature_size, salt, SALT_LEN, N, r, p, ikey, in scrypt_keymaster()
1205 static int encrypt_master_key(const char* passwd, const unsigned char* salt, in encrypt_master_key() argument
[all …]
/system/extras/libfec/
Dfec_verity.cpp131 EVP_DigestUpdate(mdctx, salt.data(), salt.size()); in get_hash()
142 const std::vector<uint8_t> &salt, int nid) { in initialize() argument
147 this->salt = salt; in initialize()
366 std::vector<uint8_t> salt; in parse_table() local
424 salt.resize(salt_size, 0); in parse_table()
426 if (parse_hex(salt.data(), salt_size, token.c_str()) == -1) { in parse_table()
454 v->hashtree.initialize(hash_start, data_blocks, salt, NID_sha256); in parse_table()
Davb_utils.cpp109 std::vector<uint8_t> salt( in parse_avb_image() local
148 hashtree_descriptor.tree_offset / FEC_BLOCKSIZE, salt, in parse_avb_image()
Dfec_private.h86 std::vector<uint8_t> salt; member
91 const std::vector<uint8_t> &salt, int nid);
/system/gatekeeper/include/gatekeeper/
Dgatekeeper.h91 uint32_t password_length, salt_t salt) const = 0;
185 bool CreatePasswordHandle(SizedBuffer *password_handle, salt_t salt,
Dpassword_handle.h40 salt_t salt; member
/system/core/fs_mgr/libfs_avb/include/fs_avb/
Dtypes.h60 std::string salt; member
66 std::string salt; member
/system/bt/stack/smp/
Dcrypto_toolbox.h36 extern Octet16 smp_calculate_h7(const Octet16& salt, const Octet16& w);
/system/apex/apexd/
Dapexd_verity.cpp78 if (!builder->Initialize(image_size, HexToBin(verity_data.salt))) { in GenerateHashTree()
137 if (!builder->Initialize(image_size, HexToBin(verity_data.salt))) { in CalculateRootDigest()
/system/core/fs_mgr/libfs_avb/tests/
Dfs_avb_util_test.cpp95 EXPECT_EQ(hashtree_desc->salt, "d00df00d"); in TEST_F()
/system/extras/verity/include/verity/
Dhash_tree_builder.h41 const std::vector<unsigned char>& salt);

12