Lines Matching full:hash

13 #include <crypto/hash.h>
21 * __ubifs_node_calc_hash - calculate the hash of a UBIFS node
23 * @node: the node to calculate a hash for
24 * @hash: the returned hash
29 u8 *hash) in __ubifs_node_calc_hash() argument
34 hash); in __ubifs_node_calc_hash()
38 * ubifs_hash_calc_hmac - calculate a HMAC from a hash
40 * @hash: the node to calculate a HMAC for
45 static int ubifs_hash_calc_hmac(const struct ubifs_info *c, const u8 *hash, in ubifs_hash_calc_hmac() argument
48 return crypto_shash_tfm_digest(c->hmac_tfm, hash, c->hash_len, hmac); in ubifs_hash_calc_hmac()
54 * @node: the node to calculate a hash for
55 * @inhash: input hash of previous nodes
58 * It creates a HMAC from the given input hash and writes it to the node.
66 u8 hash[UBIFS_HASH_ARR_SZ]; in ubifs_prepare_auth_node() local
75 err = crypto_shash_final(hash_desc, hash); in ubifs_prepare_auth_node()
80 err = ubifs_hash_calc_hmac(c, hash, auth->hmac); in ubifs_prepare_auth_node()
126 * ubifs_bad_hash - Report hash mismatches
129 * @hash: the expected hash
133 * This function reports a hash mismatch when a node has a different hash than
136 void ubifs_bad_hash(const struct ubifs_info *c, const void *node, const u8 *hash, in ubifs_bad_hash() argument
147 ubifs_err(c, "hash mismatch on node at LEB %d:%d", lnum, offs); in ubifs_bad_hash()
148 ubifs_err(c, "hash expected: %*ph%s", len, hash, cont); in ubifs_bad_hash()
149 ubifs_err(c, "hash calculated: %*ph%s", len, calc, cont); in ubifs_bad_hash()
153 * __ubifs_node_check_hash - check the hash of a node against given hash
156 * @expected: the expected hash
158 * This function calculates a hash over a node and compares it to the given hash.
263 ubifs_err(c, "authentication hash name needed with authentication"); in ubifs_init_authentication()
270 ubifs_err(c, "Unknown hash algo %s specified", in ubifs_init_authentication()
311 ubifs_err(c, "hash %s is bigger than maximum allowed hash size (%d > %d)", in ubifs_init_authentication()