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

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

 



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?

Ciao
Stephan





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

  Powered by Linux