summaryrefslogtreecommitdiff
path: root/crypto/nhpoly1305.c
diff options
context:
space:
mode:
authorArd Biesheuvel <ardb@kernel.org>2019-11-08 15:22:19 +0300
committerHerbert Xu <herbert@gondor.apana.org.au>2019-11-17 04:02:41 +0300
commit48ea8c6ebc96bc0990e12ee1c43d0832c23576bb (patch)
tree2344893a15adb14df257f4375a306353cf0dfdab /crypto/nhpoly1305.c
parent22cf705360707ced15f9fe5423938f313c7df536 (diff)
downloadlinux-48ea8c6ebc96bc0990e12ee1c43d0832c23576bb.tar.xz
crypto: poly1305 - move core routines into a separate library
Move the core Poly1305 routines shared between the generic Poly1305 shash driver and the Adiantum and NHPoly1305 drivers into a separate library so that using just this pieces does not pull in the crypto API pieces of the generic Poly1305 routine. In a subsequent patch, we will augment this generic library with init/update/final routines so that Poyl1305 algorithm can be used directly without the need for using the crypto API's shash abstraction. Signed-off-by: Ard Biesheuvel <ardb@kernel.org> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'crypto/nhpoly1305.c')
-rw-r--r--crypto/nhpoly1305.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/crypto/nhpoly1305.c b/crypto/nhpoly1305.c
index 9ab4e07cde4d..f6b6a52092b4 100644
--- a/crypto/nhpoly1305.c
+++ b/crypto/nhpoly1305.c
@@ -33,6 +33,7 @@
#include <asm/unaligned.h>
#include <crypto/algapi.h>
#include <crypto/internal/hash.h>
+#include <crypto/internal/poly1305.h>
#include <crypto/nhpoly1305.h>
#include <linux/crypto.h>
#include <linux/kernel.h>
@@ -78,7 +79,7 @@ static void process_nh_hash_value(struct nhpoly1305_state *state,
BUILD_BUG_ON(NH_HASH_BYTES % POLY1305_BLOCK_SIZE != 0);
poly1305_core_blocks(&state->poly_state, &key->poly_key, state->nh_hash,
- NH_HASH_BYTES / POLY1305_BLOCK_SIZE);
+ NH_HASH_BYTES / POLY1305_BLOCK_SIZE, 1);
}
/*