RE: [PATCH 1/2] crypto: inside-secure - Added support for the CHACHA20 skcipher

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> -----Original Message-----
> From: Antoine Tenart <antoine.tenart@xxxxxxxxxxx>
> Sent: Wednesday, September 11, 2019 5:21 PM
> To: Pascal Van Leeuwen <pvanleeuwen@xxxxxxxxxxxxxx>
> Cc: Antoine Tenart <antoine.tenart@xxxxxxxxxxx>; Pascal van Leeuwen
> <pascalvanl@xxxxxxxxx>; linux-crypto@xxxxxxxxxxxxxxx; herbert@xxxxxxxxxxxxxxxxxxx;
> davem@xxxxxxxxxxxxx
> Subject: Re: [PATCH 1/2] crypto: inside-secure - Added support for the CHACHA20 skcipher
> 
> Hello Pascal,
> 
> On Tue, Sep 10, 2019 at 06:58:18PM +0000, Pascal Van Leeuwen wrote:
> > > On Tue, Sep 10, 2019 at 04:38:12PM +0200, Pascal van Leeuwen wrote:
> > > > @@ -112,7 +123,7 @@ static void safexcel_cipher_token(struct safexcel_cipher_ctx
> *ctx, u8
> > > *iv,
> > > >  			block_sz = DES3_EDE_BLOCK_SIZE;
> > > >  			cdesc->control_data.options |= EIP197_OPTION_2_TOKEN_IV_CMD;
> > > >  			break;
> > > > -		case SAFEXCEL_AES:
> > > > +		default: /* case SAFEXCEL_AES */
> > >
> > > Can't you keep an explicit case here?
> > >
> > If I do that, the compiler will complain about SAFEXCEL_CHACHA20 not
> > being covered. And Chacha20 won't even make it this far, so it doesn't
> > make much sense to add that to the switch.
> >
> > I suppose an explicit case plus an empty default would be an alternative?
> > But I figured the comment should suffice to remind anyone working on that
> > switch statement what it should really do. I'm fine with either approach.
> 
> Yes, please use an explicit case and an empty default.
> 
OK, will do

> Thanks,
> Antoine
> 
> --
> Antoine Ténart, Bootlin
> Embedded Linux and Kernel engineering
> https://bootlin.com

Thanks,
Pascal van Leeuwen
Silicon IP Architect, Multi-Protocol Engines @ Verimatrix
www.insidesecure.com





[Index of Archives]     [Kernel]     [Gnu Classpath]     [Gnu Crypto]     [DM Crypt]     [Netfilter]     [Bugtraq]

  Powered by Linux