summaryrefslogtreecommitdiff
path: root/include/linux/crypto.h
diff options
context:
space:
mode:
authorJames Morris <jmorris@intercode.com.au>2002-11-03 10:13:19 -0800
committerDavid S. Miller <davem@nuts.ninka.net>2002-11-03 10:13:19 -0800
commit464ff46093bd6ed4da11037edda18378b6804c1a (patch)
tree1b3f983799bb2249759c43c4ace3eb4bf6a55d12 /include/linux/crypto.h
parent03d4a1cd25137f70857cc524548cb6b34371cce6 (diff)
[CRYPTO]: Rework HMAC interface.
Diffstat (limited to 'include/linux/crypto.h')
-rw-r--r--include/linux/crypto.h28
1 files changed, 15 insertions, 13 deletions
diff --git a/include/linux/crypto.h b/include/linux/crypto.h
index 4ef4d5dbba5e..846b6b2018b0 100644
--- a/include/linux/crypto.h
+++ b/include/linux/crypto.h
@@ -20,6 +20,7 @@
#include <linux/types.h>
#include <linux/list.h>
#include <linux/string.h>
+#include <asm/page.h>
/*
* Algorithm masks and types.
@@ -141,9 +142,6 @@ struct digest_tfm {
void (*dit_final)(struct crypto_tfm *tfm, u8 *out);
void (*dit_digest)(struct crypto_tfm *tfm, struct scatterlist *sg,
unsigned int nsg, u8 *out);
- void (*dit_hmac)(struct crypto_tfm *tfm, u8 *key,
- unsigned int keylen, struct scatterlist *sg,
- unsigned int nsg, u8 *out);
};
struct compress_tfm {
@@ -259,16 +257,6 @@ static inline void crypto_digest_digest(struct crypto_tfm *tfm,
tfm->crt_digest.dit_digest(tfm, sg, nsg, out);
}
-static inline void crypto_digest_hmac(struct crypto_tfm *tfm,
- u8 *key, unsigned int keylen,
- struct scatterlist *sg,
- unsigned int nsg, u8 *out)
-
-{
- BUG_ON(crypto_tfm_alg_type(tfm) != CRYPTO_ALG_TYPE_DIGEST);
- tfm->crt_digest.dit_hmac(tfm, key, keylen, sg, nsg, out);
-}
-
static inline int crypto_cipher_setkey(struct crypto_tfm *tfm,
const u8 *key, unsigned int keylen)
{
@@ -318,4 +306,18 @@ static inline void crypto_comp_decompress(struct crypto_tfm *tfm)
tfm->crt_compress.cot_decompress(tfm);
}
+/*
+ * HMAC support.
+ */
+#ifdef CONFIG_CRYPTO_HMAC
+void crypto_hmac_init(struct crypto_tfm *tfm, u8 *key, unsigned int *keylen);
+void crypto_hmac_update(struct crypto_tfm *tfm,
+ struct scatterlist *sg, unsigned int nsg);
+void crypto_hmac_final(struct crypto_tfm *tfm, u8 *key,
+ unsigned int *keylen, u8 *out);
+void crypto_hmac(struct crypto_tfm *tfm, u8 *key, unsigned int *keylen,
+ struct scatterlist *sg, unsigned int nsg, u8 *out);
+#endif /* CONFIG_CRYPTO_HMAC */
+
#endif /* _LINUX_CRYPTO_H */
+