Re: [PATCH 3/9] crypto: Add a generic Poly1305 authenticator implementation

2015-06-04 Thread Martin Willi
Herbert, > I just realised that this doesn't quite work. The key is shared > by all users of the tfm, yet in your case you need it to be local I agree, as Poly1305 uses a different key for each tag the current approach doesn't work. > I think the simplest solution is to make the key the beginni

Re: [PATCH 3/9] crypto: Add a generic Poly1305 authenticator implementation

2015-06-04 Thread Herbert Xu
On Mon, Jun 01, 2015 at 01:43:58PM +0200, Martin Willi wrote: > > +static int poly1305_setkey(struct crypto_shash *tfm, > +const u8 *key, unsigned int keylen) > +{ > + struct poly1305_ctx *ctx = crypto_shash_ctx(tfm); > + > + if (keylen != POLY1305_KEY_SIZE) { > +

[PATCH 3/9] crypto: Add a generic Poly1305 authenticator implementation

2015-06-01 Thread Martin Willi
Poly1305 is a fast message authenticator designed by Daniel J. Bernstein. It is further defined in RFC7539 as a building block for the ChaCha20-Poly1305 AEAD for use in IETF protocols. This is a portable C implementation of the algorithm without architecture specific optimizations, based on public