Lines Matching defs:hash
14 #include <crypto/hash.h>
23 * ubifs_node_calc_hash - calculate the hash of a UBIFS node
25 * @node: the node to calculate a hash for
26 * @hash: the returned hash
31 u8 *hash)
36 hash);
40 * ubifs_hash_calc_hmac - calculate a HMAC from a hash
42 * @hash: the node to calculate a HMAC for
47 static int ubifs_hash_calc_hmac(const struct ubifs_info *c, const u8 *hash,
50 return crypto_shash_tfm_digest(c->hmac_tfm, hash, c->hash_len, hmac);
56 * @node: the node to calculate a hash for
57 * @inhash: input hash of previous nodes
60 * It creates a HMAC from the given input hash and writes it to the node.
68 u8 hash[UBIFS_HASH_ARR_SZ];
77 err = crypto_shash_final(hash_desc, hash);
82 err = ubifs_hash_calc_hmac(c, hash, auth->hmac);
128 * ubifs_bad_hash - Report hash mismatches
131 * @hash: the expected hash
135 * This function reports a hash mismatch when a node has a different hash than
138 void ubifs_bad_hash(const struct ubifs_info *c, const void *node, const u8 *hash,
149 ubifs_err(c, "hash mismatch on node at LEB %d:%d", lnum, offs);
150 ubifs_err(c, "hash expected: %*ph%s", len, hash, cont);
151 ubifs_err(c, "hash calculated: %*ph%s", len, calc, cont);
155 * __ubifs_node_check_hash - check the hash of a node against given hash
158 * @expected: the expected hash
160 * This function calculates a hash over a node and compares it to the given hash.
265 ubifs_err(c, "authentication hash name needed with authentication");
272 ubifs_err(c, "Unknown hash algo %s specified",
313 ubifs_err(c, "hash %s is bigger than maximum allowed hash size (%d > %d)",