Lines Matching defs: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)
35 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,
49 return crypto_shash_tfm_digest(c->hmac_tfm, hash, c->hash_len, 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];
76 err = crypto_shash_final(hash_desc, hash);
81 err = ubifs_hash_calc_hmac(c, hash, auth->hmac);
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,
148 ubifs_err(c, "hash mismatch on node at LEB %d:%d", lnum, offs);
149 ubifs_err(c, "hash expected: %*ph%s", len, hash, cont);
150 ubifs_err(c, "hash calculated: %*ph%s", len, calc, cont);
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");
271 ubifs_err(c, "Unknown hash algo %s specified",
312 ubifs_err(c, "hash %s is bigger than maximum allowed hash size (%d > %d)",