Message ID | 20230424184726.2091-1-dtsen@linux.ibm.com |
---|---|
Headers | show |
Series | crypto: Accelerated Chacha20/Poly1305 implementation | expand |
> +# Copyright 2023- IBM Inc. All rights reserved
I don't think any such entity exists - you probably mean IBM Corporation.
On Mon, Apr 24, 2023 at 02:47:23PM -0400, Danny Tsen wrote: > > +static int __init chacha_p10_init(void) > +{ > + static_branch_enable(&have_p10); > + > + return IS_REACHABLE(CONFIG_CRYPTO_SKCIPHER) ? > + crypto_register_skciphers(algs, ARRAY_SIZE(algs)) : 0; What is this for? The usual way is to select CRYPTO_SKCIPHER rather than have a mysterious failure at run-time. Thanks,
On Mon, Apr 24, 2023 at 02:47:23PM -0400, Danny Tsen wrote: > > +static int chacha_p10_stream_xor(struct skcipher_request *req, > + const struct chacha_ctx *ctx, const u8 *iv) > +{ > + struct skcipher_walk walk; > + u32 state[16]; > + int err; > + > + err = skcipher_walk_virt(&walk, req, false); > + if (err) > + return err; > + > + chacha_init_generic(state, ctx->key, iv); > + > + while (walk.nbytes > 0) { > + unsigned int nbytes = walk.nbytes; > + > + if (nbytes < walk.total) > + nbytes = rounddown(nbytes, walk.stride); > + > + if (!static_branch_likely(&have_p10) || You don't need the static branch in the Crypto API code since the registration is already conditional. Cheers,
Got it. Will fix it. Thanks. -Danny On 4/25/23 12:41 AM, Herbert Xu wrote: > On Mon, Apr 24, 2023 at 02:47:23PM -0400, Danny Tsen wrote: >> +static int chacha_p10_stream_xor(struct skcipher_request *req, >> + const struct chacha_ctx *ctx, const u8 *iv) >> +{ >> + struct skcipher_walk walk; >> + u32 state[16]; >> + int err; >> + >> + err = skcipher_walk_virt(&walk, req, false); >> + if (err) >> + return err; >> + >> + chacha_init_generic(state, ctx->key, iv); >> + >> + while (walk.nbytes > 0) { >> + unsigned int nbytes = walk.nbytes; >> + >> + if (nbytes < walk.total) >> + nbytes = rounddown(nbytes, walk.stride); >> + >> + if (!static_branch_likely(&have_p10) || > You don't need the static branch in the Crypto API code since > the registration is already conditional. > > Cheers,
Danny Tsen <dtsen@linux.ibm.com> writes:
> This is recommended template to use for IBM copyright.
According to who?
The documentation I've seen specifies "IBM Corp." or "IBM Corporation".
cheers
Hi Michael, It's in IBM repo. Thanks. -Danny On 4/25/23 7:02 AM, Michael Ellerman wrote: > Danny Tsen <dtsen@linux.ibm.com> writes: >> This is recommended template to use for IBM copyright. > According to who? > > The documentation I've seen specifies "IBM Corp." or "IBM Corporation". > > cheers