/system/keymaster/ |
H A D | hkdf.h | 35 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);
|
H A D | kdf_test.cpp | 34 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 D | hkdf_test.cpp | 63 const string salt = hex2str(test.salt_hex); local 70 reinterpret_cast<const uint8_t*>(salt.data()), salt.size()));
|
H A D | kdf.cpp | 24 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
|
H A D | kdf.h | 36 const uint8_t* salt, size_t salt_len);
|
/system/extras/verity/ |
H A D | build_verity_metadata.py | 40 def build_verity_table(block_device, data_blocks, root_hash, salt): 49 salt) 53 salt, block_device, signer_path, signing_key): 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)
|
H A D | build_verity_tree.cpp | 23 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 unsigned char *salt = NULL; local [all...] |
H A D | VerityVerifier.java | 44 private byte[] salt; field in class:VerityVerifier 251 salt = DatatypeConverter.parseHexBinary(fields[9]); 306 * Hashes a block of data using a salt and checks of the results are expected 312 digest.update(salt);
|
/system/core/gatekeeperd/ |
H A D | SoftGateKeeper.h | 38 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/gatekeeper/include/gatekeeper/ |
H A D | password_handle.h | 40 salt_t salt; member in struct:gatekeeper::password_handle_t
|
H A D | gatekeeper.h | 91 uint32_t password_length, salt_t salt) const = 0; 185 bool CreatePasswordHandle(SizedBuffer *password_handle, salt_t salt,
|
/system/security/keystore/ |
H A D | user_state.cpp | 105 * password so we cannot generate a new file with a new salt. 148 // We read the raw blob to just to get the salt to generate the AES key, then we create the Blob 155 // find salt at EOF if present, otherwise we have an old file 156 uint8_t* salt; local 158 salt = (uint8_t*)&rawBlob + length - SALT_SIZE; 160 salt = NULL; 163 generateKeyFromPassword(passwordKey, MASTER_KEY_SIZE_BYTES, pw, salt); 172 // If salt was missing, generate one and write a new master key file with the salt. 173 if (salt 228 generateKeyFromPassword(uint8_t* key, ssize_t keySize, const android::String8& pw, uint8_t* salt) argument 240 PKCS5_PBKDF2_HMAC_SHA1(reinterpret_cast<const char*>(pw.string()), pw.length(), salt, saltSize, local [all...] |
H A D | user_state.h | 70 uint8_t* salt);
|
/system/tpm/trunks/ |
H A D | session_manager_impl.cc | 82 std::string salt(SHA256_DIGEST_SIZE, 0); 84 reinterpret_cast<unsigned char*>(string_as_array(&salt)); 85 CHECK_EQ(RAND_bytes(salt_buffer, salt.size()), 1) 86 << "Error generating a cryptographically random salt."; 87 // First we encrypt the cryptographically secure salt using PKCS1_OAEP 91 TPM_RC salt_result = EncryptSalt(salt, &encrypted_salt); 93 LOG(ERROR) << "Error encrypting salt: " << GetErrorString(salt_result); 141 salt, 151 TPM_RC SessionManagerImpl::EncryptSalt(const std::string& salt, argument 200 LOG(ERROR) << "Error setting up salt encryp [all...] |
H A D | session_manager_impl.h | 49 // This function is used to encrypt a plaintext salt |salt|, using RSA 52 // The encrypted salt is stored in the out parameter |encrypted_salt|. 53 TPM_RC EncryptSalt(const std::string& salt, std::string* encrypted_salt);
|
H A D | hmac_authorization_delegate.h | 46 // caller_nonce, salt and auth_value of the bound entity we fed into 81 // |salt| and |bind_auth_value| specify the injected auth values into this 86 const std::string& salt,
|
H A D | hmac_authorization_delegate.cc | 214 const std::string& salt, 227 if (salt.length() == 0 && bind_auth_value.length() == 0) { 232 session_key_ = CreateKey(bind_auth_value + salt, 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
|
H A D | hmac_authorization_delegate_test.cc | 47 std::string dummy_salt = std::string("salt"); 71 std::string salt("salt"); 72 ASSERT_TRUE(delegate.InitSession(dummy_handle, nonce, nonce, salt, 79 ASSERT_TRUE(delegate.InitSession(dummy_handle, nonce, nonce, salt,
|
/system/gatekeeper/ |
H A D | gatekeeper.cpp | 90 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; 197 password_key, password_key_length, to_sign, sizeof(to_sign), salt); 205 if (!CreatePasswordHandle(&provided_handle, expected_handle->salt, expected_handle->user_id,
|
/system/vold/ |
H A D | KeyStorage.cpp | 69 static const char* kFn_salt = "salt"; 205 const std::string& salt, std::string* stretched) { 224 reinterpret_cast<const uint8_t*>(salt.data()), salt.size(), 238 const std::string& salt, const std::string& secdiscardable, 241 if (!stretchSecret(stretching, auth.secret, salt, &stretched)) return false; 261 std::string salt; 263 if (ReadRandomBytes(SALT_BYTES, salt) != OK) { 267 if (!writeStringToFile(salt, dir + "/" + kFn_salt)) return false; 270 if (!generateAppId(auth, stretching, salt, secdiscardabl 204 stretchSecret(const std::string& stretching, const std::string& secret, const std::string& salt, std::string* stretched) argument 237 generateAppId(const KeyAuthentication& auth, const std::string& stretching, const std::string& salt, const std::string& secdiscardable, std::string* appId) argument [all...] |
H A D | cryptfs.h | 23 * The fields after salt are only valid in rev 1.1 and later stuctures. 112 unsigned char salt[SALT_LEN]; /* The salt used for this encryption */ member in struct:crypt_mnt_ftr 227 typedef int (*kdf_func)(const char *passwd, const unsigned char *salt,
|
H A D | cryptfs.c | 596 /* key or salt can be NULL, in which case just skip writing that value. Useful to 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, ike 1411 decrypt_master_key_aux(const char *passwd, unsigned char *salt, unsigned char *encrypted_master_key, unsigned char *decrypted_master_key, kdf_func kdf, void *kdf_params, unsigned char** intermediate_key, size_t* intermediate_key_size) argument 1494 create_encrypted_random_key(char *passwd, unsigned char *master_key, unsigned char *salt, struct crypt_mnt_ftr *crypt_ftr) argument [all...] |
/system/extras/libfec/ |
H A D | fec_verity.cpp | 118 /* 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); 347 std::unique_ptr<uint8_t[]> salt; local 397 case 9: /* salt */ 402 salt.reset(new (std::nothrow) uint8_t[v->salt_size]); 404 if (!salt) { 409 if (parse_hex(salt.get(), v->salt_size, token.c_str()) == -1) { 410 error("invalid verity salt: %s", token.c_str()); 433 v->salt [all...] |
H A D | fec_private.h | 86 uint8_t *salt; member in struct:verity_info
|
H A D | fec_open.cpp | 430 if (f->verity.salt) { 431 delete[] f->verity.salt;
|