Loading crypto/tcrypt.c +407 −173 Original line number Diff line number Diff line Loading @@ -12,8 +12,9 @@ * Software Foundation; either version 2 of the License, or (at your option) * any later version. * * 14 - 09 - 2003 * Rewritten by Kartikey Mahendra Bhatt * 2004-08-09 Added cipher speed tests (Reyk Floeter <reyk@vantronix.net>) * 2003-09-14 Rewritten by Kartikey Mahendra Bhatt * */ #include <linux/init.h> Loading @@ -25,12 +26,15 @@ #include <linux/crypto.h> #include <linux/highmem.h> #include <linux/moduleparam.h> #include <linux/jiffies.h> #include <linux/timex.h> #include <linux/interrupt.h> #include "tcrypt.h" /* * Need to kmalloc() memory for testing kmap(). */ #define TVMEMSIZE 4096 #define TVMEMSIZE 16384 #define XBUFSIZE 32768 /* Loading @@ -55,6 +59,11 @@ static unsigned int IDX[8] = { IDX1, IDX2, IDX3, IDX4, IDX5, IDX6, IDX7, IDX8 }; /* * Used by test_cipher_speed() */ static unsigned int sec; static int mode; static char *xbuf; static char *tvmem; Loading @@ -66,8 +75,7 @@ static char *check[] = { "khazad", "wp512", "wp384", "wp256", "tnepres", NULL }; static void hexdump(unsigned char *buf, unsigned int len) static void hexdump(unsigned char *buf, unsigned int len) { while (len--) printk("%02x", *buf++); Loading @@ -75,8 +83,8 @@ hexdump(unsigned char *buf, unsigned int len) printk("\n"); } static void test_hash (char * algo, struct hash_testvec * template, unsigned int tcount) static void test_hash(char *algo, struct hash_testvec *template, unsigned int tcount) { char *p; unsigned int i, j, k, temp; Loading Loading @@ -124,8 +132,8 @@ test_hash (char * algo, struct hash_testvec * template, unsigned int tcount) hexdump(result, crypto_tfm_alg_digestsize(tfm)); printk("%s\n", memcmp(result, hash_tv[i].digest, crypto_tfm_alg_digestsize(tfm)) ? "fail" : "pass"); crypto_tfm_alg_digestsize(tfm)) ? "fail" : "pass"); } printk("testing %s across pages\n", algo); Loading @@ -142,7 +150,8 @@ test_hash (char * algo, struct hash_testvec * template, unsigned int tcount) temp = 0; for (k = 0; k < hash_tv[i].np; k++) { memcpy (&xbuf[IDX[k]], hash_tv[i].plaintext + temp, memcpy(&xbuf[IDX[k]], hash_tv[i].plaintext + temp, hash_tv[i].tap[k]); temp += hash_tv[i].tap[k]; p = &xbuf[IDX[k]]; Loading @@ -156,8 +165,8 @@ test_hash (char * algo, struct hash_testvec * template, unsigned int tcount) hexdump(result, crypto_tfm_alg_digestsize(tfm)); printk("%s\n", memcmp(result, hash_tv[i].digest, crypto_tfm_alg_digestsize(tfm)) ? "fail" : "pass"); crypto_tfm_alg_digestsize(tfm)) ? "fail" : "pass"); } } Loading @@ -167,8 +176,8 @@ test_hash (char * algo, struct hash_testvec * template, unsigned int tcount) #ifdef CONFIG_CRYPTO_HMAC static void test_hmac(char *algo, struct hmac_testvec * template, unsigned int tcount) static void test_hmac(char *algo, struct hmac_testvec *template, unsigned int tcount) { char *p; unsigned int i, j, k, temp; Loading Loading @@ -230,7 +239,8 @@ test_hmac(char *algo, struct hmac_testvec * template, unsigned int tcount) temp = 0; klen = hmac_tv[i].ksize; for (k = 0; k < hmac_tv[i].np; k++) { memcpy (&xbuf[IDX[k]], hmac_tv[i].plaintext + temp, memcpy(&xbuf[IDX[k]], hmac_tv[i].plaintext + temp, hmac_tv[i].tap[k]); temp += hmac_tv[i].tap[k]; p = &xbuf[IDX[k]]; Loading @@ -239,14 +249,14 @@ test_hmac(char *algo, struct hmac_testvec * template, unsigned int tcount) sg[k].length = hmac_tv[i].tap[k]; } crypto_hmac(tfm, hmac_tv[i].key, &klen, sg, hmac_tv[i].np, result); crypto_hmac(tfm, hmac_tv[i].key, &klen, sg, hmac_tv[i].np, result); hexdump(result, crypto_tfm_alg_digestsize(tfm)); printk("%s\n", memcmp(result, hmac_tv[i].digest, crypto_tfm_alg_digestsize(tfm)) ? "fail" : "pass"); crypto_tfm_alg_digestsize(tfm)) ? "fail" : "pass"); } } out: Loading @@ -255,8 +265,8 @@ test_hmac(char *algo, struct hmac_testvec * template, unsigned int tcount) #endif /* CONFIG_CRYPTO_HMAC */ static void test_cipher(char * algo, int mode, int enc, struct cipher_testvec * template, unsigned int tcount) static void test_cipher(char *algo, int mode, int enc, struct cipher_testvec *template, unsigned int tcount) { unsigned int ret, i, j, k, temp; unsigned int tsize; Loading @@ -265,16 +275,16 @@ test_cipher(char * algo, int mode, int enc, struct cipher_testvec * template, un char *key; struct cipher_testvec *cipher_tv; struct scatterlist sg[8]; char e[11], m[4]; const char *e, *m; if (enc == ENCRYPT) strncpy(e, "encryption", 11); e = "encryption"; else strncpy(e, "decryption", 11); e = "decryption"; if (mode == MODE_ECB) strncpy(m, "ECB", 4); m = "ECB"; else strncpy(m, "CBC", 4); m = "CBC"; printk("\ntesting %s %s %s\n", algo, m, e); Loading Loading @@ -345,8 +355,8 @@ test_cipher(char * algo, int mode, int enc, struct cipher_testvec * template, un hexdump(q, cipher_tv[i].rlen); printk("%s\n", memcmp(q, cipher_tv[i].result, cipher_tv[i].rlen) ? "fail" : "pass"); memcmp(q, cipher_tv[i].result, cipher_tv[i].rlen) ? "fail" : "pass"); } } Loading Loading @@ -375,7 +385,8 @@ test_cipher(char * algo, int mode, int enc, struct cipher_testvec * template, un temp = 0; for (k = 0; k < cipher_tv[i].np; k++) { memcpy (&xbuf[IDX[k]], cipher_tv[i].input + temp, memcpy(&xbuf[IDX[k]], cipher_tv[i].input + temp, cipher_tv[i].tap[k]); temp += cipher_tv[i].tap[k]; p = &xbuf[IDX[k]]; Loading Loading @@ -417,8 +428,169 @@ test_cipher(char * algo, int mode, int enc, struct cipher_testvec * template, un crypto_free_tfm(tfm); } static void test_deflate(void) static int test_cipher_jiffies(struct crypto_tfm *tfm, int enc, char *p, int blen, int sec) { struct scatterlist sg[8]; unsigned long start, end; int bcount; int ret; sg[0].page = virt_to_page(p); sg[0].offset = offset_in_page(p); sg[0].length = blen; for (start = jiffies, end = start + sec * HZ, bcount = 0; time_before(jiffies, end); bcount++) { if (enc) ret = crypto_cipher_encrypt(tfm, sg, sg, blen); else ret = crypto_cipher_decrypt(tfm, sg, sg, blen); if (ret) return ret; } printk("%d operations in %d seconds (%ld bytes)\n", bcount, sec, (long)bcount * blen); return 0; } static int test_cipher_cycles(struct crypto_tfm *tfm, int enc, char *p, int blen) { struct scatterlist sg[8]; unsigned long cycles = 0; int ret = 0; int i; sg[0].page = virt_to_page(p); sg[0].offset = offset_in_page(p); sg[0].length = blen; local_bh_disable(); local_irq_disable(); /* Warm-up run. */ for (i = 0; i < 4; i++) { if (enc) ret = crypto_cipher_encrypt(tfm, sg, sg, blen); else ret = crypto_cipher_decrypt(tfm, sg, sg, blen); if (ret) goto out; } /* The real thing. */ for (i = 0; i < 8; i++) { cycles_t start, end; start = get_cycles(); if (enc) ret = crypto_cipher_encrypt(tfm, sg, sg, blen); else ret = crypto_cipher_decrypt(tfm, sg, sg, blen); end = get_cycles(); if (ret) goto out; cycles += end - start; } out: local_irq_enable(); local_bh_enable(); if (ret == 0) printk("1 operation in %lu cycles (%d bytes)\n", (cycles + 4) / 8, blen); return ret; } static void test_cipher_speed(char *algo, int mode, int enc, unsigned int sec, struct cipher_testvec *template, unsigned int tcount, struct cipher_speed *speed) { unsigned int ret, i, j, iv_len; unsigned char *key, *p, iv[128]; struct crypto_tfm *tfm; const char *e, *m; if (enc == ENCRYPT) e = "encryption"; else e = "decryption"; if (mode == MODE_ECB) m = "ECB"; else m = "CBC"; printk("\ntesting speed of %s %s %s\n", algo, m, e); if (mode) tfm = crypto_alloc_tfm(algo, 0); else tfm = crypto_alloc_tfm(algo, CRYPTO_TFM_MODE_CBC); if (tfm == NULL) { printk("failed to load transform for %s %s\n", algo, m); return; } for (i = 0; speed[i].klen != 0; i++) { if ((speed[i].blen + speed[i].klen) > TVMEMSIZE) { printk("template (%u) too big for tvmem (%u)\n", speed[i].blen + speed[i].klen, TVMEMSIZE); goto out; } printk("test %u (%d bit key, %d byte blocks): ", i, speed[i].klen * 8, speed[i].blen); memset(tvmem, 0xff, speed[i].klen + speed[i].blen); /* set key, plain text and IV */ key = (unsigned char *)tvmem; for (j = 0; j < tcount; j++) { if (template[j].klen == speed[i].klen) { key = template[j].key; break; } } p = (unsigned char *)tvmem + speed[i].klen; ret = crypto_cipher_setkey(tfm, key, speed[i].klen); if (ret) { printk("setkey() failed flags=%x\n", tfm->crt_flags); goto out; } if (!mode) { iv_len = crypto_tfm_alg_ivsize(tfm); memset(&iv, 0xff, iv_len); crypto_cipher_set_iv(tfm, iv, iv_len); } if (sec) ret = test_cipher_jiffies(tfm, enc, p, speed[i].blen, sec); else ret = test_cipher_cycles(tfm, enc, p, speed[i].blen); if (ret) { printk("%s() failed flags=%x\n", e, tfm->crt_flags); break; } } out: crypto_free_tfm(tfm); } static void test_deflate(void) { unsigned int i; char result[COMP_BUF_SIZE]; Loading Loading @@ -497,8 +669,7 @@ test_deflate(void) crypto_free_tfm(tfm); } static void test_crc32c(void) static void test_crc32c(void) { #define NUMVEC 6 #define VECSIZE 40 Loading Loading @@ -598,8 +769,7 @@ test_crc32c(void) printk("crc32c test complete\n"); } static void test_available(void) static void test_available(void) { char **name = check; Loading @@ -611,8 +781,7 @@ test_available(void) } } static void do_test(void) static void do_test(void) { switch (mode) { Loading Loading @@ -863,6 +1032,69 @@ do_test(void) #endif case 200: test_cipher_speed("aes", MODE_ECB, ENCRYPT, sec, NULL, 0, aes_speed_template); test_cipher_speed("aes", MODE_ECB, DECRYPT, sec, NULL, 0, aes_speed_template); test_cipher_speed("aes", MODE_CBC, ENCRYPT, sec, NULL, 0, aes_speed_template); test_cipher_speed("aes", MODE_CBC, DECRYPT, sec, NULL, 0, aes_speed_template); break; case 201: test_cipher_speed("des3_ede", MODE_ECB, ENCRYPT, sec, des3_ede_enc_tv_template, DES3_EDE_ENC_TEST_VECTORS, des3_ede_speed_template); test_cipher_speed("des3_ede", MODE_ECB, DECRYPT, sec, des3_ede_dec_tv_template, DES3_EDE_DEC_TEST_VECTORS, des3_ede_speed_template); test_cipher_speed("des3_ede", MODE_CBC, ENCRYPT, sec, des3_ede_enc_tv_template, DES3_EDE_ENC_TEST_VECTORS, des3_ede_speed_template); test_cipher_speed("des3_ede", MODE_CBC, DECRYPT, sec, des3_ede_dec_tv_template, DES3_EDE_DEC_TEST_VECTORS, des3_ede_speed_template); break; case 202: test_cipher_speed("twofish", MODE_ECB, ENCRYPT, sec, NULL, 0, twofish_speed_template); test_cipher_speed("twofish", MODE_ECB, DECRYPT, sec, NULL, 0, twofish_speed_template); test_cipher_speed("twofish", MODE_CBC, ENCRYPT, sec, NULL, 0, twofish_speed_template); test_cipher_speed("twofish", MODE_CBC, DECRYPT, sec, NULL, 0, twofish_speed_template); break; case 203: test_cipher_speed("blowfish", MODE_ECB, ENCRYPT, sec, NULL, 0, blowfish_speed_template); test_cipher_speed("blowfish", MODE_ECB, DECRYPT, sec, NULL, 0, blowfish_speed_template); test_cipher_speed("blowfish", MODE_CBC, ENCRYPT, sec, NULL, 0, blowfish_speed_template); test_cipher_speed("blowfish", MODE_CBC, DECRYPT, sec, NULL, 0, blowfish_speed_template); break; case 204: test_cipher_speed("des", MODE_ECB, ENCRYPT, sec, NULL, 0, des_speed_template); test_cipher_speed("des", MODE_ECB, DECRYPT, sec, NULL, 0, des_speed_template); test_cipher_speed("des", MODE_CBC, ENCRYPT, sec, NULL, 0, des_speed_template); test_cipher_speed("des", MODE_CBC, DECRYPT, sec, NULL, 0, des_speed_template); break; case 1000: test_available(); break; Loading @@ -874,8 +1106,7 @@ do_test(void) } } static int __init init(void) static int __init init(void) { tvmem = kmalloc(TVMEMSIZE, GFP_KERNEL); if (tvmem == NULL) Loading Loading @@ -904,6 +1135,9 @@ module_init(init); module_exit(fini); module_param(mode, int, 0); module_param(sec, uint, 0); MODULE_PARM_DESC(sec, "Length in seconds of speed tests " "(defaults to zero which uses CPU cycles instead)"); MODULE_LICENSE("GPL"); MODULE_DESCRIPTION("Quick & dirty crypto testing module"); Loading crypto/tcrypt.h +262 −187 Original line number Diff line number Diff line Loading @@ -12,7 +12,8 @@ * Software Foundation; either version 2 of the License, or (at your option) * any later version. * * 14 - 09 - 2003 Changes by Kartikey Mahendra Bhatt * 2004-08-09 Cipher speed tests by Reyk Floeter <reyk@vantronix.net> * 2003-09-14 Changes by Kartikey Mahendra Bhatt * */ #ifndef _CRYPTO_TCRYPT_H Loading Loading @@ -58,6 +59,11 @@ struct cipher_testvec { unsigned char tap[MAX_TAP]; }; struct cipher_speed { unsigned char klen; unsigned int blen; }; /* * MD4 test vectors from RFC1320 */ Loading Loading @@ -1578,8 +1584,7 @@ static struct cipher_testvec tf_cbc_dec_tv_template[] = { #define TNEPRES_ENC_TEST_VECTORS 4 #define TNEPRES_DEC_TEST_VECTORS 4 static struct cipher_testvec serpent_enc_tv_template[] = { static struct cipher_testvec serpent_enc_tv_template[] = { { .input = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f }, Loading Loading @@ -1620,8 +1625,7 @@ static struct cipher_testvec serpent_enc_tv_template[] = }, }; static struct cipher_testvec tnepres_enc_tv_template[] = { static struct cipher_testvec tnepres_enc_tv_template[] = { { /* KeySize=128, PT=0, I=1 */ .input = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, Loading Loading @@ -1671,8 +1675,7 @@ static struct cipher_testvec tnepres_enc_tv_template[] = }; static struct cipher_testvec serpent_dec_tv_template[] = { static struct cipher_testvec serpent_dec_tv_template[] = { { .input = { 0x12, 0x07, 0xfc, 0xce, 0x9b, 0xd0, 0xd6, 0x47, 0x6a, 0xe9, 0x8f, 0xbe, 0xd1, 0x43, 0xa0, 0xe2 }, Loading Loading @@ -1713,8 +1716,7 @@ static struct cipher_testvec serpent_dec_tv_template[] = }, }; static struct cipher_testvec tnepres_dec_tv_template[] = { static struct cipher_testvec tnepres_dec_tv_template[] = { { .input = { 0x41, 0xcc, 0x6b, 0x31, 0x59, 0x31, 0x45, 0x97, 0x6d, 0x6f, 0xbb, 0x38, 0x4b, 0x37, 0x21, 0x28 }, Loading Loading @@ -1760,8 +1762,7 @@ static struct cipher_testvec tnepres_dec_tv_template[] = #define CAST6_ENC_TEST_VECTORS 3 #define CAST6_DEC_TEST_VECTORS 3 static struct cipher_testvec cast6_enc_tv_template[] = { static struct cipher_testvec cast6_enc_tv_template[] = { { .key = { 0x23, 0x42, 0xbb, 0x9e, 0xfa, 0x38, 0x54, 0x2c, 0x0a, 0xf7, 0x56, 0x47, 0xf2, 0x9f, 0x61, 0x5d }, Loading Loading @@ -1795,8 +1796,7 @@ static struct cipher_testvec cast6_enc_tv_template[] = }, }; static struct cipher_testvec cast6_dec_tv_template[] = { static struct cipher_testvec cast6_dec_tv_template[] = { { .key = { 0x23, 0x42, 0xbb, 0x9e, 0xfa, 0x38, 0x54, 0x2c, 0x0a, 0xf7, 0x56, 0x47, 0xf2, 0x9f, 0x61, 0x5d }, Loading Loading @@ -1915,8 +1915,7 @@ static struct cipher_testvec aes_dec_tv_template[] = { #define CAST5_ENC_TEST_VECTORS 3 #define CAST5_DEC_TEST_VECTORS 3 static struct cipher_testvec cast5_enc_tv_template[] = { static struct cipher_testvec cast5_enc_tv_template[] = { { .key = { 0x01, 0x23, 0x45, 0x67, 0x12, 0x34, 0x56, 0x78, 0x23, 0x45, 0x67, 0x89, 0x34, 0x56, 0x78, 0x9a }, Loading @@ -1943,8 +1942,7 @@ static struct cipher_testvec cast5_enc_tv_template[] = }, }; static struct cipher_testvec cast5_dec_tv_template[] = { static struct cipher_testvec cast5_dec_tv_template[] = { { .key = { 0x01, 0x23, 0x45, 0x67, 0x12, 0x34, 0x56, 0x78, 0x23, 0x45, 0x67, 0x89, 0x34, 0x56, 0x78, 0x9a }, Loading Loading @@ -1977,8 +1975,7 @@ static struct cipher_testvec cast5_dec_tv_template[] = #define ARC4_ENC_TEST_VECTORS 7 #define ARC4_DEC_TEST_VECTORS 7 static struct cipher_testvec arc4_enc_tv_template[] = { static struct cipher_testvec arc4_enc_tv_template[] = { { .key = { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }, .klen = 8, Loading Loading @@ -2044,8 +2041,7 @@ static struct cipher_testvec arc4_enc_tv_template[] = }, }; static struct cipher_testvec arc4_dec_tv_template[] = { static struct cipher_testvec arc4_dec_tv_template[] = { { .key = { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }, .klen = 8, Loading Loading @@ -2117,8 +2113,7 @@ static struct cipher_testvec arc4_dec_tv_template[] = #define TEA_ENC_TEST_VECTORS 4 #define TEA_DEC_TEST_VECTORS 4 static struct cipher_testvec tea_enc_tv_template[] = { static struct cipher_testvec tea_enc_tv_template[] = { { .key = { [0 ... 15] = 0x00 }, .klen = 16, Loading Loading @@ -2161,8 +2156,7 @@ static struct cipher_testvec tea_enc_tv_template[] = } }; static struct cipher_testvec tea_dec_tv_template[] = { static struct cipher_testvec tea_dec_tv_template[] = { { .key = { [0 ... 15] = 0x00 }, .klen = 16, Loading Loading @@ -2211,8 +2205,7 @@ static struct cipher_testvec tea_dec_tv_template[] = #define XTEA_ENC_TEST_VECTORS 4 #define XTEA_DEC_TEST_VECTORS 4 static struct cipher_testvec xtea_enc_tv_template[] = { static struct cipher_testvec xtea_enc_tv_template[] = { { .key = { [0 ... 15] = 0x00 }, .klen = 16, Loading Loading @@ -2255,8 +2248,7 @@ static struct cipher_testvec xtea_enc_tv_template[] = } }; static struct cipher_testvec xtea_dec_tv_template[] = { static struct cipher_testvec xtea_dec_tv_template[] = { { .key = { [0 ... 15] = 0x00 }, .klen = 16, Loading Loading @@ -2697,8 +2689,7 @@ static struct comp_testvec deflate_decomp_tv_template[] = { */ #define MICHAEL_MIC_TEST_VECTORS 6 static struct hash_testvec michael_mic_tv_template[] = { static struct hash_testvec michael_mic_tv_template[] = { { .key = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, .ksize = 8, Loading Loading @@ -2743,4 +2734,88 @@ static struct hash_testvec michael_mic_tv_template[] = } }; /* * Cipher speed tests */ static struct cipher_speed aes_speed_template[] = { { .klen = 16, .blen = 16, }, { .klen = 16, .blen = 64, }, { .klen = 16, .blen = 256, }, { .klen = 16, .blen = 1024, }, { .klen = 16, .blen = 8192, }, { .klen = 24, .blen = 16, }, { .klen = 24, .blen = 64, }, { .klen = 24, .blen = 256, }, { .klen = 24, .blen = 1024, }, { .klen = 24, .blen = 8192, }, { .klen = 32, .blen = 16, }, { .klen = 32, .blen = 64, }, { .klen = 32, .blen = 256, }, { .klen = 32, .blen = 1024, }, { .klen = 32, .blen = 8192, }, /* End marker */ { .klen = 0, .blen = 0, } }; static struct cipher_speed des3_ede_speed_template[] = { { .klen = 24, .blen = 16, }, { .klen = 24, .blen = 64, }, { .klen = 24, .blen = 256, }, { .klen = 24, .blen = 1024, }, { .klen = 24, .blen = 8192, }, /* End marker */ { .klen = 0, .blen = 0, } }; static struct cipher_speed twofish_speed_template[] = { { .klen = 16, .blen = 16, }, { .klen = 16, .blen = 64, }, { .klen = 16, .blen = 256, }, { .klen = 16, .blen = 1024, }, { .klen = 16, .blen = 8192, }, { .klen = 24, .blen = 16, }, { .klen = 24, .blen = 64, }, { .klen = 24, .blen = 256, }, { .klen = 24, .blen = 1024, }, { .klen = 24, .blen = 8192, }, { .klen = 32, .blen = 16, }, { .klen = 32, .blen = 64, }, { .klen = 32, .blen = 256, }, { .klen = 32, .blen = 1024, }, { .klen = 32, .blen = 8192, }, /* End marker */ { .klen = 0, .blen = 0, } }; static struct cipher_speed blowfish_speed_template[] = { /* Don't support blowfish keys > 256 bit in this test */ { .klen = 8, .blen = 16, }, { .klen = 8, .blen = 64, }, { .klen = 8, .blen = 256, }, { .klen = 8, .blen = 1024, }, { .klen = 8, .blen = 8192, }, { .klen = 32, .blen = 16, }, { .klen = 32, .blen = 64, }, { .klen = 32, .blen = 256, }, { .klen = 32, .blen = 1024, }, { .klen = 32, .blen = 8192, }, /* End marker */ { .klen = 0, .blen = 0, } }; static struct cipher_speed des_speed_template[] = { { .klen = 8, .blen = 16, }, { .klen = 8, .blen = 64, }, { .klen = 8, .blen = 256, }, { .klen = 8, .blen = 1024, }, { .klen = 8, .blen = 8192, }, /* End marker */ { .klen = 0, .blen = 0, } }; #endif /* _CRYPTO_TCRYPT_H */ drivers/net/appletalk/ltpc.c +2 −4 Original line number Diff line number Diff line Loading @@ -1109,8 +1109,7 @@ struct net_device * __init ltpc_probe(void) inb_p(io+1); inb_p(io+3); set_current_state(TASK_UNINTERRUPTIBLE); schedule_timeout(2*HZ/100); msleep(20); inb_p(io+0); inb_p(io+2); Loading @@ -1120,8 +1119,7 @@ struct net_device * __init ltpc_probe(void) inb_p(io+5); /* enable dma */ inb_p(io+6); /* tri-state interrupt line */ set_current_state(TASK_UNINTERRUPTIBLE); schedule_timeout(HZ); ssleep(1); /* now, figure out which dma channel we're using, unless it's already been specified */ Loading include/linux/netdevice.h +2 −2 Original line number Diff line number Diff line Loading @@ -41,7 +41,7 @@ struct divert_blk; struct vlan_group; struct ethtool_ops; struct netpoll; struct netpoll_info; /* source back-compat hooks */ #define SET_ETHTOOL_OPS(netdev,ops) \ ( (netdev)->ethtool_ops = (ops) ) Loading Loading @@ -468,7 +468,7 @@ struct net_device unsigned char *haddr); int (*neigh_setup)(struct net_device *dev, struct neigh_parms *); #ifdef CONFIG_NETPOLL struct netpoll *np; struct netpoll_info *npinfo; #endif #ifdef CONFIG_NET_POLL_CONTROLLER void (*poll_controller)(struct net_device *dev); Loading include/linux/netfilter_ipv4/ipt_CLUSTERIP.h +2 −1 Original line number Diff line number Diff line Loading @@ -18,7 +18,6 @@ struct clusterip_config; struct ipt_clusterip_tgt_info { u_int32_t flags; struct clusterip_config *config; /* only relevant for new ones */ u_int8_t clustermac[6]; Loading @@ -27,6 +26,8 @@ struct ipt_clusterip_tgt_info { u_int16_t local_nodes[CLUSTERIP_MAX_NODES]; enum clusterip_hashmode hash_mode; u_int32_t hash_initval; struct clusterip_config *config; }; #endif /*_IPT_CLUSTERIP_H_target*/ Loading
crypto/tcrypt.c +407 −173 Original line number Diff line number Diff line Loading @@ -12,8 +12,9 @@ * Software Foundation; either version 2 of the License, or (at your option) * any later version. * * 14 - 09 - 2003 * Rewritten by Kartikey Mahendra Bhatt * 2004-08-09 Added cipher speed tests (Reyk Floeter <reyk@vantronix.net>) * 2003-09-14 Rewritten by Kartikey Mahendra Bhatt * */ #include <linux/init.h> Loading @@ -25,12 +26,15 @@ #include <linux/crypto.h> #include <linux/highmem.h> #include <linux/moduleparam.h> #include <linux/jiffies.h> #include <linux/timex.h> #include <linux/interrupt.h> #include "tcrypt.h" /* * Need to kmalloc() memory for testing kmap(). */ #define TVMEMSIZE 4096 #define TVMEMSIZE 16384 #define XBUFSIZE 32768 /* Loading @@ -55,6 +59,11 @@ static unsigned int IDX[8] = { IDX1, IDX2, IDX3, IDX4, IDX5, IDX6, IDX7, IDX8 }; /* * Used by test_cipher_speed() */ static unsigned int sec; static int mode; static char *xbuf; static char *tvmem; Loading @@ -66,8 +75,7 @@ static char *check[] = { "khazad", "wp512", "wp384", "wp256", "tnepres", NULL }; static void hexdump(unsigned char *buf, unsigned int len) static void hexdump(unsigned char *buf, unsigned int len) { while (len--) printk("%02x", *buf++); Loading @@ -75,8 +83,8 @@ hexdump(unsigned char *buf, unsigned int len) printk("\n"); } static void test_hash (char * algo, struct hash_testvec * template, unsigned int tcount) static void test_hash(char *algo, struct hash_testvec *template, unsigned int tcount) { char *p; unsigned int i, j, k, temp; Loading Loading @@ -124,8 +132,8 @@ test_hash (char * algo, struct hash_testvec * template, unsigned int tcount) hexdump(result, crypto_tfm_alg_digestsize(tfm)); printk("%s\n", memcmp(result, hash_tv[i].digest, crypto_tfm_alg_digestsize(tfm)) ? "fail" : "pass"); crypto_tfm_alg_digestsize(tfm)) ? "fail" : "pass"); } printk("testing %s across pages\n", algo); Loading @@ -142,7 +150,8 @@ test_hash (char * algo, struct hash_testvec * template, unsigned int tcount) temp = 0; for (k = 0; k < hash_tv[i].np; k++) { memcpy (&xbuf[IDX[k]], hash_tv[i].plaintext + temp, memcpy(&xbuf[IDX[k]], hash_tv[i].plaintext + temp, hash_tv[i].tap[k]); temp += hash_tv[i].tap[k]; p = &xbuf[IDX[k]]; Loading @@ -156,8 +165,8 @@ test_hash (char * algo, struct hash_testvec * template, unsigned int tcount) hexdump(result, crypto_tfm_alg_digestsize(tfm)); printk("%s\n", memcmp(result, hash_tv[i].digest, crypto_tfm_alg_digestsize(tfm)) ? "fail" : "pass"); crypto_tfm_alg_digestsize(tfm)) ? "fail" : "pass"); } } Loading @@ -167,8 +176,8 @@ test_hash (char * algo, struct hash_testvec * template, unsigned int tcount) #ifdef CONFIG_CRYPTO_HMAC static void test_hmac(char *algo, struct hmac_testvec * template, unsigned int tcount) static void test_hmac(char *algo, struct hmac_testvec *template, unsigned int tcount) { char *p; unsigned int i, j, k, temp; Loading Loading @@ -230,7 +239,8 @@ test_hmac(char *algo, struct hmac_testvec * template, unsigned int tcount) temp = 0; klen = hmac_tv[i].ksize; for (k = 0; k < hmac_tv[i].np; k++) { memcpy (&xbuf[IDX[k]], hmac_tv[i].plaintext + temp, memcpy(&xbuf[IDX[k]], hmac_tv[i].plaintext + temp, hmac_tv[i].tap[k]); temp += hmac_tv[i].tap[k]; p = &xbuf[IDX[k]]; Loading @@ -239,14 +249,14 @@ test_hmac(char *algo, struct hmac_testvec * template, unsigned int tcount) sg[k].length = hmac_tv[i].tap[k]; } crypto_hmac(tfm, hmac_tv[i].key, &klen, sg, hmac_tv[i].np, result); crypto_hmac(tfm, hmac_tv[i].key, &klen, sg, hmac_tv[i].np, result); hexdump(result, crypto_tfm_alg_digestsize(tfm)); printk("%s\n", memcmp(result, hmac_tv[i].digest, crypto_tfm_alg_digestsize(tfm)) ? "fail" : "pass"); crypto_tfm_alg_digestsize(tfm)) ? "fail" : "pass"); } } out: Loading @@ -255,8 +265,8 @@ test_hmac(char *algo, struct hmac_testvec * template, unsigned int tcount) #endif /* CONFIG_CRYPTO_HMAC */ static void test_cipher(char * algo, int mode, int enc, struct cipher_testvec * template, unsigned int tcount) static void test_cipher(char *algo, int mode, int enc, struct cipher_testvec *template, unsigned int tcount) { unsigned int ret, i, j, k, temp; unsigned int tsize; Loading @@ -265,16 +275,16 @@ test_cipher(char * algo, int mode, int enc, struct cipher_testvec * template, un char *key; struct cipher_testvec *cipher_tv; struct scatterlist sg[8]; char e[11], m[4]; const char *e, *m; if (enc == ENCRYPT) strncpy(e, "encryption", 11); e = "encryption"; else strncpy(e, "decryption", 11); e = "decryption"; if (mode == MODE_ECB) strncpy(m, "ECB", 4); m = "ECB"; else strncpy(m, "CBC", 4); m = "CBC"; printk("\ntesting %s %s %s\n", algo, m, e); Loading Loading @@ -345,8 +355,8 @@ test_cipher(char * algo, int mode, int enc, struct cipher_testvec * template, un hexdump(q, cipher_tv[i].rlen); printk("%s\n", memcmp(q, cipher_tv[i].result, cipher_tv[i].rlen) ? "fail" : "pass"); memcmp(q, cipher_tv[i].result, cipher_tv[i].rlen) ? "fail" : "pass"); } } Loading Loading @@ -375,7 +385,8 @@ test_cipher(char * algo, int mode, int enc, struct cipher_testvec * template, un temp = 0; for (k = 0; k < cipher_tv[i].np; k++) { memcpy (&xbuf[IDX[k]], cipher_tv[i].input + temp, memcpy(&xbuf[IDX[k]], cipher_tv[i].input + temp, cipher_tv[i].tap[k]); temp += cipher_tv[i].tap[k]; p = &xbuf[IDX[k]]; Loading Loading @@ -417,8 +428,169 @@ test_cipher(char * algo, int mode, int enc, struct cipher_testvec * template, un crypto_free_tfm(tfm); } static void test_deflate(void) static int test_cipher_jiffies(struct crypto_tfm *tfm, int enc, char *p, int blen, int sec) { struct scatterlist sg[8]; unsigned long start, end; int bcount; int ret; sg[0].page = virt_to_page(p); sg[0].offset = offset_in_page(p); sg[0].length = blen; for (start = jiffies, end = start + sec * HZ, bcount = 0; time_before(jiffies, end); bcount++) { if (enc) ret = crypto_cipher_encrypt(tfm, sg, sg, blen); else ret = crypto_cipher_decrypt(tfm, sg, sg, blen); if (ret) return ret; } printk("%d operations in %d seconds (%ld bytes)\n", bcount, sec, (long)bcount * blen); return 0; } static int test_cipher_cycles(struct crypto_tfm *tfm, int enc, char *p, int blen) { struct scatterlist sg[8]; unsigned long cycles = 0; int ret = 0; int i; sg[0].page = virt_to_page(p); sg[0].offset = offset_in_page(p); sg[0].length = blen; local_bh_disable(); local_irq_disable(); /* Warm-up run. */ for (i = 0; i < 4; i++) { if (enc) ret = crypto_cipher_encrypt(tfm, sg, sg, blen); else ret = crypto_cipher_decrypt(tfm, sg, sg, blen); if (ret) goto out; } /* The real thing. */ for (i = 0; i < 8; i++) { cycles_t start, end; start = get_cycles(); if (enc) ret = crypto_cipher_encrypt(tfm, sg, sg, blen); else ret = crypto_cipher_decrypt(tfm, sg, sg, blen); end = get_cycles(); if (ret) goto out; cycles += end - start; } out: local_irq_enable(); local_bh_enable(); if (ret == 0) printk("1 operation in %lu cycles (%d bytes)\n", (cycles + 4) / 8, blen); return ret; } static void test_cipher_speed(char *algo, int mode, int enc, unsigned int sec, struct cipher_testvec *template, unsigned int tcount, struct cipher_speed *speed) { unsigned int ret, i, j, iv_len; unsigned char *key, *p, iv[128]; struct crypto_tfm *tfm; const char *e, *m; if (enc == ENCRYPT) e = "encryption"; else e = "decryption"; if (mode == MODE_ECB) m = "ECB"; else m = "CBC"; printk("\ntesting speed of %s %s %s\n", algo, m, e); if (mode) tfm = crypto_alloc_tfm(algo, 0); else tfm = crypto_alloc_tfm(algo, CRYPTO_TFM_MODE_CBC); if (tfm == NULL) { printk("failed to load transform for %s %s\n", algo, m); return; } for (i = 0; speed[i].klen != 0; i++) { if ((speed[i].blen + speed[i].klen) > TVMEMSIZE) { printk("template (%u) too big for tvmem (%u)\n", speed[i].blen + speed[i].klen, TVMEMSIZE); goto out; } printk("test %u (%d bit key, %d byte blocks): ", i, speed[i].klen * 8, speed[i].blen); memset(tvmem, 0xff, speed[i].klen + speed[i].blen); /* set key, plain text and IV */ key = (unsigned char *)tvmem; for (j = 0; j < tcount; j++) { if (template[j].klen == speed[i].klen) { key = template[j].key; break; } } p = (unsigned char *)tvmem + speed[i].klen; ret = crypto_cipher_setkey(tfm, key, speed[i].klen); if (ret) { printk("setkey() failed flags=%x\n", tfm->crt_flags); goto out; } if (!mode) { iv_len = crypto_tfm_alg_ivsize(tfm); memset(&iv, 0xff, iv_len); crypto_cipher_set_iv(tfm, iv, iv_len); } if (sec) ret = test_cipher_jiffies(tfm, enc, p, speed[i].blen, sec); else ret = test_cipher_cycles(tfm, enc, p, speed[i].blen); if (ret) { printk("%s() failed flags=%x\n", e, tfm->crt_flags); break; } } out: crypto_free_tfm(tfm); } static void test_deflate(void) { unsigned int i; char result[COMP_BUF_SIZE]; Loading Loading @@ -497,8 +669,7 @@ test_deflate(void) crypto_free_tfm(tfm); } static void test_crc32c(void) static void test_crc32c(void) { #define NUMVEC 6 #define VECSIZE 40 Loading Loading @@ -598,8 +769,7 @@ test_crc32c(void) printk("crc32c test complete\n"); } static void test_available(void) static void test_available(void) { char **name = check; Loading @@ -611,8 +781,7 @@ test_available(void) } } static void do_test(void) static void do_test(void) { switch (mode) { Loading Loading @@ -863,6 +1032,69 @@ do_test(void) #endif case 200: test_cipher_speed("aes", MODE_ECB, ENCRYPT, sec, NULL, 0, aes_speed_template); test_cipher_speed("aes", MODE_ECB, DECRYPT, sec, NULL, 0, aes_speed_template); test_cipher_speed("aes", MODE_CBC, ENCRYPT, sec, NULL, 0, aes_speed_template); test_cipher_speed("aes", MODE_CBC, DECRYPT, sec, NULL, 0, aes_speed_template); break; case 201: test_cipher_speed("des3_ede", MODE_ECB, ENCRYPT, sec, des3_ede_enc_tv_template, DES3_EDE_ENC_TEST_VECTORS, des3_ede_speed_template); test_cipher_speed("des3_ede", MODE_ECB, DECRYPT, sec, des3_ede_dec_tv_template, DES3_EDE_DEC_TEST_VECTORS, des3_ede_speed_template); test_cipher_speed("des3_ede", MODE_CBC, ENCRYPT, sec, des3_ede_enc_tv_template, DES3_EDE_ENC_TEST_VECTORS, des3_ede_speed_template); test_cipher_speed("des3_ede", MODE_CBC, DECRYPT, sec, des3_ede_dec_tv_template, DES3_EDE_DEC_TEST_VECTORS, des3_ede_speed_template); break; case 202: test_cipher_speed("twofish", MODE_ECB, ENCRYPT, sec, NULL, 0, twofish_speed_template); test_cipher_speed("twofish", MODE_ECB, DECRYPT, sec, NULL, 0, twofish_speed_template); test_cipher_speed("twofish", MODE_CBC, ENCRYPT, sec, NULL, 0, twofish_speed_template); test_cipher_speed("twofish", MODE_CBC, DECRYPT, sec, NULL, 0, twofish_speed_template); break; case 203: test_cipher_speed("blowfish", MODE_ECB, ENCRYPT, sec, NULL, 0, blowfish_speed_template); test_cipher_speed("blowfish", MODE_ECB, DECRYPT, sec, NULL, 0, blowfish_speed_template); test_cipher_speed("blowfish", MODE_CBC, ENCRYPT, sec, NULL, 0, blowfish_speed_template); test_cipher_speed("blowfish", MODE_CBC, DECRYPT, sec, NULL, 0, blowfish_speed_template); break; case 204: test_cipher_speed("des", MODE_ECB, ENCRYPT, sec, NULL, 0, des_speed_template); test_cipher_speed("des", MODE_ECB, DECRYPT, sec, NULL, 0, des_speed_template); test_cipher_speed("des", MODE_CBC, ENCRYPT, sec, NULL, 0, des_speed_template); test_cipher_speed("des", MODE_CBC, DECRYPT, sec, NULL, 0, des_speed_template); break; case 1000: test_available(); break; Loading @@ -874,8 +1106,7 @@ do_test(void) } } static int __init init(void) static int __init init(void) { tvmem = kmalloc(TVMEMSIZE, GFP_KERNEL); if (tvmem == NULL) Loading Loading @@ -904,6 +1135,9 @@ module_init(init); module_exit(fini); module_param(mode, int, 0); module_param(sec, uint, 0); MODULE_PARM_DESC(sec, "Length in seconds of speed tests " "(defaults to zero which uses CPU cycles instead)"); MODULE_LICENSE("GPL"); MODULE_DESCRIPTION("Quick & dirty crypto testing module"); Loading
crypto/tcrypt.h +262 −187 Original line number Diff line number Diff line Loading @@ -12,7 +12,8 @@ * Software Foundation; either version 2 of the License, or (at your option) * any later version. * * 14 - 09 - 2003 Changes by Kartikey Mahendra Bhatt * 2004-08-09 Cipher speed tests by Reyk Floeter <reyk@vantronix.net> * 2003-09-14 Changes by Kartikey Mahendra Bhatt * */ #ifndef _CRYPTO_TCRYPT_H Loading Loading @@ -58,6 +59,11 @@ struct cipher_testvec { unsigned char tap[MAX_TAP]; }; struct cipher_speed { unsigned char klen; unsigned int blen; }; /* * MD4 test vectors from RFC1320 */ Loading Loading @@ -1578,8 +1584,7 @@ static struct cipher_testvec tf_cbc_dec_tv_template[] = { #define TNEPRES_ENC_TEST_VECTORS 4 #define TNEPRES_DEC_TEST_VECTORS 4 static struct cipher_testvec serpent_enc_tv_template[] = { static struct cipher_testvec serpent_enc_tv_template[] = { { .input = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f }, Loading Loading @@ -1620,8 +1625,7 @@ static struct cipher_testvec serpent_enc_tv_template[] = }, }; static struct cipher_testvec tnepres_enc_tv_template[] = { static struct cipher_testvec tnepres_enc_tv_template[] = { { /* KeySize=128, PT=0, I=1 */ .input = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, Loading Loading @@ -1671,8 +1675,7 @@ static struct cipher_testvec tnepres_enc_tv_template[] = }; static struct cipher_testvec serpent_dec_tv_template[] = { static struct cipher_testvec serpent_dec_tv_template[] = { { .input = { 0x12, 0x07, 0xfc, 0xce, 0x9b, 0xd0, 0xd6, 0x47, 0x6a, 0xe9, 0x8f, 0xbe, 0xd1, 0x43, 0xa0, 0xe2 }, Loading Loading @@ -1713,8 +1716,7 @@ static struct cipher_testvec serpent_dec_tv_template[] = }, }; static struct cipher_testvec tnepres_dec_tv_template[] = { static struct cipher_testvec tnepres_dec_tv_template[] = { { .input = { 0x41, 0xcc, 0x6b, 0x31, 0x59, 0x31, 0x45, 0x97, 0x6d, 0x6f, 0xbb, 0x38, 0x4b, 0x37, 0x21, 0x28 }, Loading Loading @@ -1760,8 +1762,7 @@ static struct cipher_testvec tnepres_dec_tv_template[] = #define CAST6_ENC_TEST_VECTORS 3 #define CAST6_DEC_TEST_VECTORS 3 static struct cipher_testvec cast6_enc_tv_template[] = { static struct cipher_testvec cast6_enc_tv_template[] = { { .key = { 0x23, 0x42, 0xbb, 0x9e, 0xfa, 0x38, 0x54, 0x2c, 0x0a, 0xf7, 0x56, 0x47, 0xf2, 0x9f, 0x61, 0x5d }, Loading Loading @@ -1795,8 +1796,7 @@ static struct cipher_testvec cast6_enc_tv_template[] = }, }; static struct cipher_testvec cast6_dec_tv_template[] = { static struct cipher_testvec cast6_dec_tv_template[] = { { .key = { 0x23, 0x42, 0xbb, 0x9e, 0xfa, 0x38, 0x54, 0x2c, 0x0a, 0xf7, 0x56, 0x47, 0xf2, 0x9f, 0x61, 0x5d }, Loading Loading @@ -1915,8 +1915,7 @@ static struct cipher_testvec aes_dec_tv_template[] = { #define CAST5_ENC_TEST_VECTORS 3 #define CAST5_DEC_TEST_VECTORS 3 static struct cipher_testvec cast5_enc_tv_template[] = { static struct cipher_testvec cast5_enc_tv_template[] = { { .key = { 0x01, 0x23, 0x45, 0x67, 0x12, 0x34, 0x56, 0x78, 0x23, 0x45, 0x67, 0x89, 0x34, 0x56, 0x78, 0x9a }, Loading @@ -1943,8 +1942,7 @@ static struct cipher_testvec cast5_enc_tv_template[] = }, }; static struct cipher_testvec cast5_dec_tv_template[] = { static struct cipher_testvec cast5_dec_tv_template[] = { { .key = { 0x01, 0x23, 0x45, 0x67, 0x12, 0x34, 0x56, 0x78, 0x23, 0x45, 0x67, 0x89, 0x34, 0x56, 0x78, 0x9a }, Loading Loading @@ -1977,8 +1975,7 @@ static struct cipher_testvec cast5_dec_tv_template[] = #define ARC4_ENC_TEST_VECTORS 7 #define ARC4_DEC_TEST_VECTORS 7 static struct cipher_testvec arc4_enc_tv_template[] = { static struct cipher_testvec arc4_enc_tv_template[] = { { .key = { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }, .klen = 8, Loading Loading @@ -2044,8 +2041,7 @@ static struct cipher_testvec arc4_enc_tv_template[] = }, }; static struct cipher_testvec arc4_dec_tv_template[] = { static struct cipher_testvec arc4_dec_tv_template[] = { { .key = { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }, .klen = 8, Loading Loading @@ -2117,8 +2113,7 @@ static struct cipher_testvec arc4_dec_tv_template[] = #define TEA_ENC_TEST_VECTORS 4 #define TEA_DEC_TEST_VECTORS 4 static struct cipher_testvec tea_enc_tv_template[] = { static struct cipher_testvec tea_enc_tv_template[] = { { .key = { [0 ... 15] = 0x00 }, .klen = 16, Loading Loading @@ -2161,8 +2156,7 @@ static struct cipher_testvec tea_enc_tv_template[] = } }; static struct cipher_testvec tea_dec_tv_template[] = { static struct cipher_testvec tea_dec_tv_template[] = { { .key = { [0 ... 15] = 0x00 }, .klen = 16, Loading Loading @@ -2211,8 +2205,7 @@ static struct cipher_testvec tea_dec_tv_template[] = #define XTEA_ENC_TEST_VECTORS 4 #define XTEA_DEC_TEST_VECTORS 4 static struct cipher_testvec xtea_enc_tv_template[] = { static struct cipher_testvec xtea_enc_tv_template[] = { { .key = { [0 ... 15] = 0x00 }, .klen = 16, Loading Loading @@ -2255,8 +2248,7 @@ static struct cipher_testvec xtea_enc_tv_template[] = } }; static struct cipher_testvec xtea_dec_tv_template[] = { static struct cipher_testvec xtea_dec_tv_template[] = { { .key = { [0 ... 15] = 0x00 }, .klen = 16, Loading Loading @@ -2697,8 +2689,7 @@ static struct comp_testvec deflate_decomp_tv_template[] = { */ #define MICHAEL_MIC_TEST_VECTORS 6 static struct hash_testvec michael_mic_tv_template[] = { static struct hash_testvec michael_mic_tv_template[] = { { .key = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, .ksize = 8, Loading Loading @@ -2743,4 +2734,88 @@ static struct hash_testvec michael_mic_tv_template[] = } }; /* * Cipher speed tests */ static struct cipher_speed aes_speed_template[] = { { .klen = 16, .blen = 16, }, { .klen = 16, .blen = 64, }, { .klen = 16, .blen = 256, }, { .klen = 16, .blen = 1024, }, { .klen = 16, .blen = 8192, }, { .klen = 24, .blen = 16, }, { .klen = 24, .blen = 64, }, { .klen = 24, .blen = 256, }, { .klen = 24, .blen = 1024, }, { .klen = 24, .blen = 8192, }, { .klen = 32, .blen = 16, }, { .klen = 32, .blen = 64, }, { .klen = 32, .blen = 256, }, { .klen = 32, .blen = 1024, }, { .klen = 32, .blen = 8192, }, /* End marker */ { .klen = 0, .blen = 0, } }; static struct cipher_speed des3_ede_speed_template[] = { { .klen = 24, .blen = 16, }, { .klen = 24, .blen = 64, }, { .klen = 24, .blen = 256, }, { .klen = 24, .blen = 1024, }, { .klen = 24, .blen = 8192, }, /* End marker */ { .klen = 0, .blen = 0, } }; static struct cipher_speed twofish_speed_template[] = { { .klen = 16, .blen = 16, }, { .klen = 16, .blen = 64, }, { .klen = 16, .blen = 256, }, { .klen = 16, .blen = 1024, }, { .klen = 16, .blen = 8192, }, { .klen = 24, .blen = 16, }, { .klen = 24, .blen = 64, }, { .klen = 24, .blen = 256, }, { .klen = 24, .blen = 1024, }, { .klen = 24, .blen = 8192, }, { .klen = 32, .blen = 16, }, { .klen = 32, .blen = 64, }, { .klen = 32, .blen = 256, }, { .klen = 32, .blen = 1024, }, { .klen = 32, .blen = 8192, }, /* End marker */ { .klen = 0, .blen = 0, } }; static struct cipher_speed blowfish_speed_template[] = { /* Don't support blowfish keys > 256 bit in this test */ { .klen = 8, .blen = 16, }, { .klen = 8, .blen = 64, }, { .klen = 8, .blen = 256, }, { .klen = 8, .blen = 1024, }, { .klen = 8, .blen = 8192, }, { .klen = 32, .blen = 16, }, { .klen = 32, .blen = 64, }, { .klen = 32, .blen = 256, }, { .klen = 32, .blen = 1024, }, { .klen = 32, .blen = 8192, }, /* End marker */ { .klen = 0, .blen = 0, } }; static struct cipher_speed des_speed_template[] = { { .klen = 8, .blen = 16, }, { .klen = 8, .blen = 64, }, { .klen = 8, .blen = 256, }, { .klen = 8, .blen = 1024, }, { .klen = 8, .blen = 8192, }, /* End marker */ { .klen = 0, .blen = 0, } }; #endif /* _CRYPTO_TCRYPT_H */
drivers/net/appletalk/ltpc.c +2 −4 Original line number Diff line number Diff line Loading @@ -1109,8 +1109,7 @@ struct net_device * __init ltpc_probe(void) inb_p(io+1); inb_p(io+3); set_current_state(TASK_UNINTERRUPTIBLE); schedule_timeout(2*HZ/100); msleep(20); inb_p(io+0); inb_p(io+2); Loading @@ -1120,8 +1119,7 @@ struct net_device * __init ltpc_probe(void) inb_p(io+5); /* enable dma */ inb_p(io+6); /* tri-state interrupt line */ set_current_state(TASK_UNINTERRUPTIBLE); schedule_timeout(HZ); ssleep(1); /* now, figure out which dma channel we're using, unless it's already been specified */ Loading
include/linux/netdevice.h +2 −2 Original line number Diff line number Diff line Loading @@ -41,7 +41,7 @@ struct divert_blk; struct vlan_group; struct ethtool_ops; struct netpoll; struct netpoll_info; /* source back-compat hooks */ #define SET_ETHTOOL_OPS(netdev,ops) \ ( (netdev)->ethtool_ops = (ops) ) Loading Loading @@ -468,7 +468,7 @@ struct net_device unsigned char *haddr); int (*neigh_setup)(struct net_device *dev, struct neigh_parms *); #ifdef CONFIG_NETPOLL struct netpoll *np; struct netpoll_info *npinfo; #endif #ifdef CONFIG_NET_POLL_CONTROLLER void (*poll_controller)(struct net_device *dev); Loading
include/linux/netfilter_ipv4/ipt_CLUSTERIP.h +2 −1 Original line number Diff line number Diff line Loading @@ -18,7 +18,6 @@ struct clusterip_config; struct ipt_clusterip_tgt_info { u_int32_t flags; struct clusterip_config *config; /* only relevant for new ones */ u_int8_t clustermac[6]; Loading @@ -27,6 +26,8 @@ struct ipt_clusterip_tgt_info { u_int16_t local_nodes[CLUSTERIP_MAX_NODES]; enum clusterip_hashmode hash_mode; u_int32_t hash_initval; struct clusterip_config *config; }; #endif /*_IPT_CLUSTERIP_H_target*/