]> git.baikalelectronics.ru Git - kernel.git/commit
crypto: des/3des_ede - add new helpers to verify keys
authorArd Biesheuvel <ard.biesheuvel@linaro.org>
Thu, 15 Aug 2019 09:00:43 +0000 (12:00 +0300)
committerHerbert Xu <herbert@gondor.apana.org.au>
Thu, 22 Aug 2019 04:39:37 +0000 (14:39 +1000)
commitda8c7c296c3963a5707a6b3a101d672fe4447fd5
treeadaf9488cfc99fde2a383fdb077c1fb55a3a4bc0
parent4ea930bc42e6855f450498e812a72ec2bf5de097
crypto: des/3des_ede - add new helpers to verify keys

The recently added helper routine to perform key strength validation
of triple DES keys is slightly inadequate, since it comes in two versions,
neither of which are highly useful for anything other than skciphers (and
many drivers still use the older blkcipher interfaces).

So let's add a new helper and, considering that this is a helper function
that is only intended to be used by crypto code itself, put it in a new
des.h header under crypto/internal.

While at it, implement a similar helper for single DES, so that we can
start replacing the pattern of calling des_ekey() into a temp buffer
that occurs in many drivers in drivers/crypto.

Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
crypto/des_generic.c
include/crypto/internal/des.h [new file with mode: 0644]