Add PCBC crypto template support
PATCH 1/2 Add PCBC crypto template support
Add PCBC crypto template support as used by RxRPC.
Signed-off-by David Howells <[email protected]>
---
crypto/Kconfig | 9 + crypto/Makefile | 1 crypto/pcbc.c | 348 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 358 insertions(+), 0 deletions(-)
crypto/Kconfig +9 -0
@@ -168,6 +168,15 @@ config CRYPTO_CBC CBC: Cipher Block Chaining mode This block cipher algorithm is required for IPSec. +config CRYPTO_PCBC + tristate "PCBC support" + select CRYPTO_BLKCIPHER + select CRYPTO_MANAGER + default m + help + PCBC: Propagating Cipher Block Chaining mode + This block cipher algorithm is required for RxRPC. + config CRYPTO_LRW tristate "LRW support (EXPERIMENTAL)" depends on EXPERIMENTAL
crypto/Makefile +1 -0
@@ -27,6 +27,7 @@ obj-$(CONFIG_CRYPTO_TGR192) += tgr192.o obj-$(CONFIG_CRYPTO_GF128MUL) += gf128mul.o obj-$(CONFIG_CRYPTO_ECB) += ecb.o obj-$(CONFIG_CRYPTO_CBC) += cbc.o +obj-$(CONFIG_CRYPTO_PCBC) += pcbc.o obj-$(CONFIG_CRYPTO_LRW) += lrw.o obj-$(CONFIG_CRYPTO_DES) += des.o obj-$(CONFIG_CRYPTO_BLOWFISH) += blowfish.o
crypto/pcbc.c new file +348 -0
348 lines not on this page · raw message
PATCH 2/2 FCrypt encryption module
Add a crypto module to provide FCrypt encryption as used by RxRPC.
Signed-off-by David Howells <[email protected]>
---
crypto/Kconfig | 7 + crypto/Makefile | 1 crypto/fcrypt.c | 423 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ crypto/tcrypt.c | 16 ++ crypto/tcrypt.h | 128 +++++++++++++++++ 5 files changed, 574 insertions(+), 1 deletions(-)
crypto/Kconfig +7 -0
@@ -204,6 +204,13 @@ config CRYPTO_DES_S390 help DES cipher algorithm (FIPS 46-2), and Triple DES EDE (FIPS 46-3). +config CRYPTO_FCRYPT + tristate "FCrypt cipher algorithm" + select CRYPTO_ALGAPI + select CRYPTO_BLKCIPHER + help + FCrypt algorithm used by RxRPC. + config CRYPTO_BLOWFISH tristate "Blowfish cipher algorithm" select CRYPTO_ALGAPI
crypto/Makefile +1 -0
@@ -30,6 +30,7 @@ obj-$(CONFIG_CRYPTO_CBC) += cbc.o obj-$(CONFIG_CRYPTO_PCBC) += pcbc.o obj-$(CONFIG_CRYPTO_LRW) += lrw.o obj-$(CONFIG_CRYPTO_DES) += des.o +obj-$(CONFIG_CRYPTO_FCRYPT) += fcrypt.o obj-$(CONFIG_CRYPTO_BLOWFISH) += blowfish.o obj-$(CONFIG_CRYPTO_TWOFISH) += twofish.o obj-$(CONFIG_CRYPTO_TWOFISH_COMMON) += twofish_common.o
crypto/fcrypt.c new file +423 -0
423 lines not on this page · raw message
crypto/tcrypt.c +15 -1
@@ -71,7 +71,8 @@ static char *check[] = {"des" ,"md5" ,"des3_ede" ,"rot13" ,"sha1" ,"sha256" ,"blowfish" ,"twofish" ,"serpent" ,"sha384" ,"sha512" ,"md4" ,"aes" ,"cast6" ,"arc4" ,"michael_mic" ,"deflate" ,"crc32c" ,"tea" ,"xtea" , -"khazad" ,"wp512" ,"wp384" ,"wp256" ,"tnepres" ,"xeta" ,NULL +"khazad" ,"wp512" ,"wp384" ,"wp256" ,"tnepres" ,"xeta" ,"fcrypt" , +NULL };static void hexdump (unsigned char *buf,unsigned int len)
@@ -964,6 +965,12 @@ static void do_test(void)test_cipher ("ecb(xeta)" ,DECRYPT , xeta_dec_tv_template,XETA_DEC_TEST_VECTORS ); +//FCrypt +test_cipher ("pcbc(fcrypt)" ,ENCRYPT , fcrypt_pcbc_enc_tv_template, +FCRYPT_ENC_TEST_VECTORS ); +test_cipher ("pcbc(fcrypt)" ,DECRYPT , fcrypt_pcbc_dec_tv_template, +FCRYPT_DEC_TEST_VECTORS ); +test_hash ("sha384" , sha384_tv_template,SHA384_TEST_VECTORS );test_hash ("sha512" , sha512_tv_template,SHA512_TEST_VECTORS );test_hash ("wp512" , wp512_tv_template,WP512_TEST_VECTORS );
@@ -1177,6 +1184,13 @@ static void do_test(void) XETA_DEC_TEST_VECTORS);break ; +case 31 : +test_cipher ("pcbc(fcrypt)" ,ENCRYPT , fcrypt_pcbc_enc_tv_template, +FCRYPT_ENC_TEST_VECTORS ); +test_cipher ("pcbc(fcrypt)" ,DECRYPT , fcrypt_pcbc_dec_tv_template, +FCRYPT_DEC_TEST_VECTORS ); +break ; +case 100 :test_hash ("hmac(md5)" , hmac_md5_tv_template,HMAC_MD5_TEST_VECTORS );
crypto/tcrypt.h +128 -0
134 lines not on this page · raw message
Quoted 3 lines · David Howells
Add PCBC crypto template support as used by RxRPC.
Signed-off-by David Howells <[email protected]>
Thanks David! I'll push this to mm via cryptodev.
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.txt