Lines Matching full: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) in __ubifs_node_calc_hash() argument
36 hash); in __ubifs_node_calc_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, in ubifs_hash_calc_hmac() argument
50 return crypto_shash_tfm_digest(c->hmac_tfm, hash, c->hash_len, hmac); in ubifs_hash_calc_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]; in ubifs_prepare_auth_node() local
77 err = crypto_shash_final(hash_desc, hash); in ubifs_prepare_auth_node()
82 err = ubifs_hash_calc_hmac(c, hash, auth->hmac); in ubifs_prepare_auth_node()
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, in ubifs_bad_hash() argument
149 ubifs_err(c, "hash mismatch on node at LEB %d:%d", lnum, offs); in ubifs_bad_hash()
150 ubifs_err(c, "hash expected: %*ph%s", len, hash, cont); in ubifs_bad_hash()
151 ubifs_err(c, "hash calculated: %*ph%s", len, calc, cont); in ubifs_bad_hash()
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"); in ubifs_init_authentication()
272 ubifs_err(c, "Unknown hash algo %s specified", in ubifs_init_authentication()
313 ubifs_err(c, "hash %s is bigger than maximum allowed hash size (%d > %d)", in ubifs_init_authentication()