Where has CRYPTO_TFM_MODE_nnn gone?
Hi all,
I'm porting a security engine driver from 2.6.18 to 2.6.21/22. I've found that although 'cit_mode' is still in struct cipher_tfm, the definitions for CRYPTO_TFM_MODE_ECB and CRYPTO_TFM_MODE_CBC are gone!
Our HW needs to know what mode to set up some SA flags. Any advice on how to best find this mode from a common cipher function which can handle AES, DES and 3DES?
Advance thanks,
Marc
Herbert Xu
maintainerQuoted 4 lines · Marc St-Jean
I'm porting a security engine driver from 2.6.18 to 2.6.21/22. I've found that although '
cit_mode' is still in structcipher_tfm, the definitions forCRYPTO_TFM_MODE_ECBandCRYPTO_TFM_MODE_CBCare gone!
Thanks for noticing it, I'll make sure that cit_mode disappears :)
Quoted 3 lines
Our HW needs to know what mode to set up some SA flags. Any advice on how to best find this mode from a common cipher function which can handle AES, DES and 3DES?
The block algorithm is now part of the name just like the cipher algorithm itself. So if you're providing a block cipher you should register it as "cbc(aes)" (for example) instead of "aes" as you would've done previously.
Check out drivers/crypto/padlock* for a good example.
Cheers,
Signature · 4 lines
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txtHerbert Xu
maintainerQuoted 7 lines · Herbert Xu
Quoted 4 lines · Marc St-Jean
I'm porting a security engine driver from 2.6.18 to 2.6.21/22. I've found that although '
cit_mode' is still in structcipher_tfm, the definitions forCRYPTO_TFM_MODE_ECBandCRYPTO_TFM_MODE_CBCare gone!Thanks for noticing it, I'll make sure that
cit_modedisappears :)
Here is the patch.
[CRYPTO] cipher: Remove obsolete fields from cipher_tfm
This removes all the unused block cipher fields from cipher_tfm.
Cheers,
Signature · 5 lines
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
--include/linux/crypto.h +0 -20
@@ -295,28 +295,8 @@ struct blkcipher_tfm { };struct cipher_tfm { -void *cit_iv; -unsigned int cit_ivsize; -u32 cit_mode;int (*cit_setkey)(struct crypto_tfm *tfm,const u8 *key,unsigned int keylen); -int (*cit_encrypt)(struct crypto_tfm *tfm, -struct scatterlist *dst, -struct scatterlist *src, -unsigned int nbytes); -int (*cit_encrypt_iv)(struct crypto_tfm *tfm, -struct scatterlist *dst, -struct scatterlist *src, -unsigned int nbytes,u8 *iv); -int (*cit_decrypt)(struct crypto_tfm *tfm, -struct scatterlist *dst, -struct scatterlist *src, -unsigned int nbytes); -int (*cit_decrypt_iv)(struct crypto_tfm *tfm, -struct scatterlist *dst, -struct scatterlist *src, -unsigned int nbytes,u8 *iv); -void (*cit_xor_block)(u8 *dst,const u8 *src);void (*cit_encrypt_one)(struct crypto_tfm *tfm,u8 *dst,const u8 *src);void (*cit_decrypt_one)(struct crypto_tfm *tfm,u8 *dst,const u8 *src); };