Lines Matching defs:hash
194 * do_shash() - Do a synchronous hash operation in software
195 * @name: The name of the hash algorithm
197 * @data1: First part of data to hash. May be NULL.
199 * @data2: Second part of data to hash. May be NULL.
201 * @key: Key (if keyed hash)
202 * @key_len: Length of key, in bytes (or 0 if non-keyed hash)
207 * Return: 0 if hash successfully stored in result
217 struct crypto_shash *hash;
220 hash = crypto_alloc_shash(name, 0, 0);
221 if (IS_ERR(hash)) {
222 rc = PTR_ERR(hash);
227 size = sizeof(struct shash_desc) + crypto_shash_descsize(hash);
233 sdesc->shash.tfm = hash;
236 rc = crypto_shash_setkey(hash, key, key_len);
262 pr_err("%s: Could not generate %s hash\n", __func__, name);
265 crypto_free_shash(hash);