Lines Matching full:hash

14 #include <crypto/hash.h>
22 * ubifs_node_calc_hash - calculate the hash of a UBIFS node
24 * @node: the node to calculate a hash for
25 * @hash: the returned hash
30 u8 *hash) in __ubifs_node_calc_hash() argument
35 hash); in __ubifs_node_calc_hash()
39 * ubifs_hash_calc_hmac - calculate a HMAC from a hash
41 * @hash: the node to calculate a HMAC for
46 static int ubifs_hash_calc_hmac(const struct ubifs_info *c, const u8 *hash, in ubifs_hash_calc_hmac() argument
49 return crypto_shash_tfm_digest(c->hmac_tfm, hash, c->hash_len, hmac); in ubifs_hash_calc_hmac()
55 * @node: the node to calculate a hash for
56 * @inhash: input hash of previous nodes
59 * It creates a HMAC from the given input hash and writes it to the node.
67 u8 hash[UBIFS_HASH_ARR_SZ]; in ubifs_prepare_auth_node() local
76 err = crypto_shash_final(hash_desc, hash); in ubifs_prepare_auth_node()
81 err = ubifs_hash_calc_hmac(c, hash, auth->hmac); in ubifs_prepare_auth_node()
127 * ubifs_bad_hash - Report hash mismatches
130 * @hash: the expected hash
134 * This function reports a hash mismatch when a node has a different hash than
137 void ubifs_bad_hash(const struct ubifs_info *c, const void *node, const u8 *hash, in ubifs_bad_hash() argument
148 ubifs_err(c, "hash mismatch on node at LEB %d:%d", lnum, offs); in ubifs_bad_hash()
149 ubifs_err(c, "hash expected: %*ph%s", len, hash, cont); in ubifs_bad_hash()
150 ubifs_err(c, "hash calculated: %*ph%s", len, calc, cont); in ubifs_bad_hash()
154 * __ubifs_node_check_hash - check the hash of a node against given hash
157 * @expected: the expected hash
159 * This function calculates a hash over a node and compares it to the given hash.
264 ubifs_err(c, "authentication hash name needed with authentication"); in ubifs_init_authentication()
271 ubifs_err(c, "Unknown hash algo %s specified", in ubifs_init_authentication()
312 ubifs_err(c, "hash %s is bigger than maximum allowed hash size (%d > %d)", in ubifs_init_authentication()