/system/core/gatekeeperd/ |
D | SoftGateKeeper.h | 38 uint64_t salt; member 83 uint32_t password_length, salt_t salt) const { in ComputePasswordSignature() argument 85 crypto_scrypt(password, password_length, reinterpret_cast<uint8_t *>(&salt), in ComputePasswordSignature() 86 sizeof(salt), N, r, p, signature, signature_length); in ComputePasswordSignature() 136 fast_hash_t ComputeFastHash(const SizedBuffer &password, uint64_t salt) { in ComputeFastHash() argument 138 size_t digest_size = password.length + sizeof(salt); in ComputeFastHash() 140 memcpy(digest.get(), &salt, sizeof(salt)); in ComputeFastHash() 141 memcpy(digest.get() + sizeof(salt), password.buffer.get(), password.length); in ComputeFastHash() 145 fast_hash.salt = salt; in ComputeFastHash() 150 fast_hash_t computed = ComputeFastHash(password, fast_hash.salt); in VerifyFast() [all …]
|
/system/keymaster/ |
D | kdf_test.cpp | 34 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()
|
D | hkdf.h | 35 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()
|
D | kdf.cpp | 24 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()
|
D | hkdf_test.cpp | 63 const string salt = hex2str(test.salt_hex); in TEST() local 70 reinterpret_cast<const uint8_t*>(salt.data()), salt.size())); in TEST()
|
D | kdf.h | 36 const uint8_t* salt, size_t salt_len);
|
/system/extras/verity/ |
D | build_verity_tree.cpp | 23 const unsigned char *salt; member 55 const unsigned char *salt, size_t salt_len, in hash_block() argument 65 ret &= EVP_DigestUpdate(mdctx, salt, salt_len); in hash_block() 79 const unsigned char *salt, size_t salt_size, in hash_blocks() argument 85 hash_block(md, in + i, block_size, salt, salt_size, out, &s); in hash_blocks() 101 ctx->salt, ctx->salt_size, ctx->block_size); in hash_chunk() 129 unsigned char *salt = NULL; in main() local 154 salt = new unsigned char[salt_size](); in main() 155 if (salt == NULL) { in main() 158 memcpy(salt, optarg, salt_size); in main() [all …]
|
D | build_verity_metadata.py | 40 def build_verity_table(block_device, data_blocks, root_hash, salt): argument 49 salt) 53 salt, block_device, signer_path, signing_key): argument 55 verity_table = build_verity_table(block_device, data_blocks, root_hash, salt) 71 salt = sys.argv[4] variable 76 salt, block_device, signer_path, signing_key)
|
D | VerityVerifier.java | 44 private byte[] salt; field in VerityVerifier 251 salt = DatatypeConverter.parseHexBinary(fields[9]); in readHashTree() 312 digest.update(salt); in checkBlock()
|
/system/tpm/trunks/ |
D | session_manager_impl.cc | 82 std::string salt(SHA256_DIGEST_SIZE, 0); in StartSession() local 84 reinterpret_cast<unsigned char*>(string_as_array(&salt)); in StartSession() 85 CHECK_EQ(RAND_bytes(salt_buffer, salt.size()), 1) in StartSession() 91 TPM_RC salt_result = EncryptSalt(salt, &encrypted_salt); in StartSession() 141 salt, in StartSession() 151 TPM_RC SessionManagerImpl::EncryptSalt(const std::string& salt, in EncryptSalt() argument 209 &out_length, reinterpret_cast<const uint8_t*>(salt.data()), in EncryptSalt() 210 salt.size())) { in EncryptSalt()
|
D | session_manager_impl.h | 53 TPM_RC EncryptSalt(const std::string& salt, std::string* encrypted_salt);
|
D | hmac_authorization_delegate.cc | 214 const std::string& salt, in InitSession() argument 227 if (salt.length() == 0 && bind_auth_value.length() == 0) { in InitSession() 232 session_key_ = CreateKey(bind_auth_value + salt, in InitSession()
|
D | hmac_authorization_delegate_test.cc | 71 std::string salt("salt"); in TEST() local 72 ASSERT_TRUE(delegate.InitSession(dummy_handle, nonce, nonce, salt, in TEST() 79 ASSERT_TRUE(delegate.InitSession(dummy_handle, nonce, nonce, salt, in TEST()
|
D | hmac_authorization_delegate.h | 86 const std::string& salt,
|
/system/security/keystore/ |
D | user_state.cpp | 156 uint8_t* salt; in readMasterKey() local 158 salt = (uint8_t*)&rawBlob + length - SALT_SIZE; in readMasterKey() 160 salt = NULL; in readMasterKey() 163 generateKeyFromPassword(passwordKey, MASTER_KEY_SIZE_BYTES, pw, salt); in readMasterKey() 173 if (salt == NULL) { in readMasterKey() 229 uint8_t* salt) { in generateKeyFromPassword() argument 231 if (salt != NULL) { in generateKeyFromPassword() 235 salt = (uint8_t*)"keystore"; in generateKeyFromPassword() 240 PKCS5_PBKDF2_HMAC_SHA1(reinterpret_cast<const char*>(pw.string()), pw.length(), salt, saltSize, in generateKeyFromPassword()
|
D | user_state.h | 70 uint8_t* salt);
|
/system/vold/ |
D | KeyStorage.cpp | 205 const std::string& salt, std::string* stretched) { in stretchSecret() argument 224 reinterpret_cast<const uint8_t*>(salt.data()), salt.size(), in stretchSecret() 238 const std::string& salt, const std::string& secdiscardable, in generateAppId() argument 241 if (!stretchSecret(stretching, auth.secret, salt, &stretched)) return false; in generateAppId() 261 std::string salt; in storeKey() local 263 if (ReadRandomBytes(SALT_BYTES, salt) != OK) { in storeKey() 267 if (!writeStringToFile(salt, dir + "/" + kFn_salt)) return false; in storeKey() 270 if (!generateAppId(auth, stretching, salt, secdiscardable, &appId)) return false; in storeKey() 293 std::string salt; in retrieveKey() local 295 if (!readFileToString(dir + "/" + kFn_salt, &salt)) return false; in retrieveKey() [all …]
|
D | cryptfs.c | 1256 static int pbkdf2(const char *passwd, const unsigned char *salt, argument 1262 return PKCS5_PBKDF2_HMAC_SHA1(passwd, strlen(passwd), salt, SALT_LEN, 1267 static int scrypt(const char *passwd, const unsigned char *salt, argument 1281 salt, SALT_LEN, N, r, p, ikey, 1287 static int scrypt_keymaster(const char *passwd, const unsigned char *salt, argument 1302 salt, SALT_LEN, N, r, p, ikey, 1316 rc = crypto_scrypt(signature, signature_size, salt, SALT_LEN, 1328 static int encrypt_master_key(const char *passwd, const unsigned char *salt, argument 1348 if (scrypt_keymaster(passwd, salt, ikey, crypt_ftr)) { 1355 if (scrypt(passwd, salt, ikey, crypt_ftr)) { [all …]
|
D | cryptfs.h | 112 unsigned char salt[SALT_LEN]; /* The salt used for this encryption */ member 227 typedef int (*kdf_func)(const char *passwd, const unsigned char *salt,
|
/system/gatekeeper/ |
D | gatekeeper.cpp | 90 salt_t salt; in Enroll() local 91 GetRandom(&salt, sizeof(salt)); in Enroll() 95 salt, user_id, flags, HANDLE_VERSION, request.provided_password.buffer.get(), in Enroll() 169 bool GateKeeper::CreatePasswordHandle(SizedBuffer *password_handle_buffer, salt_t salt, in CreatePasswordHandle() argument 178 password_handle->salt = salt; in CreatePasswordHandle() 197 password_key, password_key_length, to_sign, sizeof(to_sign), salt); in CreatePasswordHandle() 205 if (!CreatePasswordHandle(&provided_handle, expected_handle->salt, expected_handle->user_id, in DoVerify()
|
/system/extras/libfec/ |
D | fec_verity.cpp | 127 check(f->verity.salt); in verity_hash() 128 SHA256_Update(&ctx, f->verity.salt, f->verity.salt_size); in verity_hash() 347 std::unique_ptr<uint8_t[]> salt; in parse_table() local 402 salt.reset(new (std::nothrow) uint8_t[v->salt_size]); in parse_table() 404 if (!salt) { in parse_table() 409 if (parse_hex(salt.get(), v->salt_size, token.c_str()) == -1) { in parse_table() 433 v->salt = salt.release(); in parse_table()
|
D | fec_private.h | 86 uint8_t *salt; member
|
D | fec_open.cpp | 430 if (f->verity.salt) { in fec_close() 431 delete[] f->verity.salt; in fec_close()
|
/system/gatekeeper/include/gatekeeper/ |
D | gatekeeper.h | 91 uint32_t password_length, salt_t salt) const = 0; 185 bool CreatePasswordHandle(SizedBuffer *password_handle, salt_t salt,
|
D | password_handle.h | 40 salt_t salt; member
|