hc
2024-05-10 23fa18eaa71266feff7ba8d83022d9e1cc83c65a
kernel/lib/crypto/blake2s-selftest.c
....@@ -15,7 +15,6 @@
1515 * #include <stdio.h>
1616 *
1717 * #include <openssl/evp.h>
18
- * #include <openssl/hmac.h>
1918 *
2019 * #define BLAKE2S_TESTVEC_COUNT 256
2120 *
....@@ -57,16 +56,6 @@
5756 * print_vec(hash, outlen);
5857 * }
5958 * printf("};\n\n");
60
- *
61
- * printf("static const u8 blake2s_hmac_testvecs[][BLAKE2S_HASH_SIZE] __initconst = {\n");
62
- *
63
- * HMAC(EVP_blake2s256(), key, sizeof(key), buf, sizeof(buf), hash, NULL);
64
- * print_vec(hash, BLAKE2S_OUTBYTES);
65
- *
66
- * HMAC(EVP_blake2s256(), buf, sizeof(buf), key, sizeof(key), hash, NULL);
67
- * print_vec(hash, BLAKE2S_OUTBYTES);
68
- *
69
- * printf("};\n");
7059 *
7160 * return 0;
7261 *}
....@@ -554,15 +543,6 @@
554543 0xd6, 0x98, 0x6b, 0x07, 0x10, 0x65, 0x52, 0x65, },
555544 };
556545
557
-static const u8 blake2s_hmac_testvecs[][BLAKE2S_HASH_SIZE] __initconst = {
558
- { 0xce, 0xe1, 0x57, 0x69, 0x82, 0xdc, 0xbf, 0x43, 0xad, 0x56, 0x4c, 0x70,
559
- 0xed, 0x68, 0x16, 0x96, 0xcf, 0xa4, 0x73, 0xe8, 0xe8, 0xfc, 0x32, 0x79,
560
- 0x08, 0x0a, 0x75, 0x82, 0xda, 0x3f, 0x05, 0x11, },
561
- { 0x77, 0x2f, 0x0c, 0x71, 0x41, 0xf4, 0x4b, 0x2b, 0xb3, 0xc6, 0xb6, 0xf9,
562
- 0x60, 0xde, 0xe4, 0x52, 0x38, 0x66, 0xe8, 0xbf, 0x9b, 0x96, 0xc4, 0x9f,
563
- 0x60, 0xd9, 0x24, 0x37, 0x99, 0xd6, 0xec, 0x31, },
564
-};
565
-
566546 bool __init blake2s_selftest(void)
567547 {
568548 u8 key[BLAKE2S_KEY_SIZE];
....@@ -605,17 +585,6 @@
605585 i + 1);
606586 success = false;
607587 }
608
- }
609
-
610
- if (success) {
611
- blake2s256_hmac(hash, buf, key, sizeof(buf), sizeof(key));
612
- success &= !memcmp(hash, blake2s_hmac_testvecs[0], BLAKE2S_HASH_SIZE);
613
-
614
- blake2s256_hmac(hash, key, buf, sizeof(key), sizeof(buf));
615
- success &= !memcmp(hash, blake2s_hmac_testvecs[1], BLAKE2S_HASH_SIZE);
616
-
617
- if (!success)
618
- pr_err("blake2s256_hmac self-test: FAIL\n");
619588 }
620589
621590 return success;