Re: [PATCH 2/3] crypto: hisilicon SEC security accelerator driver

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

 



On Fri, 20 Jul 2018 20:17:22 +0200
Stephan Müller <smueller@xxxxxxxxxx> wrote:

> Am Montag, 16. Juli 2018, 12:43:41 CEST schrieb Jonathan Cameron:
> 
> Hi Jonathan,
> 
> > +static int sec_alg_skcipher_setkey_aes_xts(struct crypto_skcipher *tfm,
> > +                                          const u8 *key, unsigned int
> > keylen) +{
> > +       enum sec_cipher_alg alg;
> > +
> > +       switch (keylen) {
> > +       case AES_KEYSIZE_128 * 2:
> > +               alg = SEC_C_AES_XTS_128;
> > +               break;
> > +       case AES_KEYSIZE_256 * 2:
> > +               alg = SEC_C_AES_XTS_256;
> > +               break;
> > +       default:
> > +               return -EINVAL;
> > +       }
> > +
> > +       return sec_alg_skcipher_setkey(tfm, key, keylen, alg);
> > +}  
> 
> Can you please call the function xts_check_key or xts_verify_key before 
> setting the key?
> 
Will do.

Thanks,

Jonathan

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux