diff options
Diffstat (limited to 'crypto/tcrypt.c')
-rw-r--r-- | crypto/tcrypt.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/crypto/tcrypt.c b/crypto/tcrypt.c index e52f56c5bd5e..bed225e83231 100644 --- a/crypto/tcrypt.c +++ b/crypto/tcrypt.c | |||
@@ -810,6 +810,7 @@ static void test_crc32c(void) | |||
810 | 810 | ||
811 | seed = SEEDTESTVAL; | 811 | seed = SEEDTESTVAL; |
812 | (void)crypto_digest_setkey(tfm, (const u8*)&seed, sizeof(u32)); | 812 | (void)crypto_digest_setkey(tfm, (const u8*)&seed, sizeof(u32)); |
813 | crypto_digest_init(tfm); | ||
813 | crypto_digest_final(tfm, (u8*)&crc); | 814 | crypto_digest_final(tfm, (u8*)&crc); |
814 | printk("testing crc32c setkey returns %08x : %s\n", crc, (crc == (SEEDTESTVAL ^ ~(u32)0)) ? | 815 | printk("testing crc32c setkey returns %08x : %s\n", crc, (crc == (SEEDTESTVAL ^ ~(u32)0)) ? |
815 | "pass" : "ERROR"); | 816 | "pass" : "ERROR"); |
@@ -821,6 +822,7 @@ static void test_crc32c(void) | |||
821 | for (i = 0; i < NUMVEC; i++) { | 822 | for (i = 0; i < NUMVEC; i++) { |
822 | seed = ~(u32)0; | 823 | seed = ~(u32)0; |
823 | (void)crypto_digest_setkey(tfm, (const u8*)&seed, sizeof(u32)); | 824 | (void)crypto_digest_setkey(tfm, (const u8*)&seed, sizeof(u32)); |
825 | crypto_digest_init(tfm); | ||
824 | crypto_digest_update(tfm, &sg[i], 1); | 826 | crypto_digest_update(tfm, &sg[i], 1); |
825 | crypto_digest_final(tfm, (u8*)&crc); | 827 | crypto_digest_final(tfm, (u8*)&crc); |
826 | if (crc == vec_results[i]) { | 828 | if (crc == vec_results[i]) { |
@@ -836,6 +838,7 @@ static void test_crc32c(void) | |||
836 | for (i = 0; i < NUMVEC; i++) { | 838 | for (i = 0; i < NUMVEC; i++) { |
837 | seed = (crc ^ ~(u32)0); | 839 | seed = (crc ^ ~(u32)0); |
838 | (void)crypto_digest_setkey(tfm, (const u8*)&seed, sizeof(u32)); | 840 | (void)crypto_digest_setkey(tfm, (const u8*)&seed, sizeof(u32)); |
841 | crypto_digest_init(tfm); | ||
839 | crypto_digest_update(tfm, &sg[i], 1); | 842 | crypto_digest_update(tfm, &sg[i], 1); |
840 | crypto_digest_final(tfm, (u8*)&crc); | 843 | crypto_digest_final(tfm, (u8*)&crc); |
841 | } | 844 | } |
@@ -849,6 +852,7 @@ static void test_crc32c(void) | |||
849 | printk("\ntesting crc32c using digest:\n"); | 852 | printk("\ntesting crc32c using digest:\n"); |
850 | seed = ~(u32)0; | 853 | seed = ~(u32)0; |
851 | (void)crypto_digest_setkey(tfm, (const u8*)&seed, sizeof(u32)); | 854 | (void)crypto_digest_setkey(tfm, (const u8*)&seed, sizeof(u32)); |
855 | crypto_digest_init(tfm); | ||
852 | crypto_digest_digest(tfm, sg, NUMVEC, (u8*)&crc); | 856 | crypto_digest_digest(tfm, sg, NUMVEC, (u8*)&crc); |
853 | if (crc == tot_vec_results) { | 857 | if (crc == tot_vec_results) { |
854 | printk(" %08x:OK", crc); | 858 | printk(" %08x:OK", crc); |