hash.h (762f99f4f3cb41a775b5157dd761217beba65873) hash.h (c060e16ddb51a92b1f7fa84c628d287ea5799864)
1/* SPDX-License-Identifier: GPL-2.0-or-later */
2/*
3 * Hash algorithms.
4 *
5 * Copyright (c) 2008 Herbert Xu <herbert@gondor.apana.org.au>
6 */
7
8#ifndef _CRYPTO_INTERNAL_HASH_H

--- 61 unchanged lines hidden (view full) ---

70
71int crypto_register_ahash(struct ahash_alg *alg);
72void crypto_unregister_ahash(struct ahash_alg *alg);
73int crypto_register_ahashes(struct ahash_alg *algs, int count);
74void crypto_unregister_ahashes(struct ahash_alg *algs, int count);
75int ahash_register_instance(struct crypto_template *tmpl,
76 struct ahash_instance *inst);
77
1/* SPDX-License-Identifier: GPL-2.0-or-later */
2/*
3 * Hash algorithms.
4 *
5 * Copyright (c) 2008 Herbert Xu <herbert@gondor.apana.org.au>
6 */
7
8#ifndef _CRYPTO_INTERNAL_HASH_H

--- 61 unchanged lines hidden (view full) ---

70
71int crypto_register_ahash(struct ahash_alg *alg);
72void crypto_unregister_ahash(struct ahash_alg *alg);
73int crypto_register_ahashes(struct ahash_alg *algs, int count);
74void crypto_unregister_ahashes(struct ahash_alg *algs, int count);
75int ahash_register_instance(struct crypto_template *tmpl,
76 struct ahash_instance *inst);
77
78bool crypto_shash_alg_has_setkey(struct shash_alg *alg);
78int shash_no_setkey(struct crypto_shash *tfm, const u8 *key,
79 unsigned int keylen);
79
80
81static inline bool crypto_shash_alg_has_setkey(struct shash_alg *alg)
82{
83 return alg->setkey != shash_no_setkey;
84}
85
80static inline bool crypto_shash_alg_needs_key(struct shash_alg *alg)
81{
82 return crypto_shash_alg_has_setkey(alg) &&
83 !(alg->base.cra_flags & CRYPTO_ALG_OPTIONAL_KEY);
84}
85
86bool crypto_hash_alg_has_setkey(struct hash_alg_common *halg);
87

--- 158 unchanged lines hidden ---
86static inline bool crypto_shash_alg_needs_key(struct shash_alg *alg)
87{
88 return crypto_shash_alg_has_setkey(alg) &&
89 !(alg->base.cra_flags & CRYPTO_ALG_OPTIONAL_KEY);
90}
91
92bool crypto_hash_alg_has_setkey(struct hash_alg_common *halg);
93

--- 158 unchanged lines hidden ---