Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

crypto: testmgr - Add test vectors for authenc(hmac(sha1),rfc3686(ctr(aes)))

Test vectors were generated starting from existing RFC3686(CTR(AES)) test
vectors and adding HMAC(SHA1) computed with software implementation.
Then, the results were double-checked on Mediatek MT7986 (safexcel).
Platform pass self-tests.

Signed-off-by: Aleksander Jan Bajkowski <olek2@wp.pl>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

authored by

Aleksander Jan Bajkowski and committed by
Herbert Xu
b45b4314 68095ad9

+226 -1
+5 -1
crypto/testmgr.c
··· 4135 4135 } 4136 4136 }, { 4137 4137 .alg = "authenc(hmac(sha1),rfc3686(ctr(aes)))", 4138 - .test = alg_test_null, 4138 + .generic_driver = "authenc(hmac-sha1-lib,rfc3686(ctr(aes-lib)))", 4139 + .test = alg_test_aead, 4139 4140 .fips_allowed = 1, 4141 + .suite = { 4142 + .aead = __VECS(hmac_sha1_aes_ctr_rfc3686_tv_temp) 4143 + } 4140 4144 }, { 4141 4145 .alg = "authenc(hmac(sha224),cbc(aes))", 4142 4146 .generic_driver = "authenc(hmac-sha224-lib,cbc(aes-generic))",
+221
crypto/testmgr.h
··· 14873 14873 }, 14874 14874 }; 14875 14875 14876 + static const struct aead_testvec hmac_sha1_aes_ctr_rfc3686_tv_temp[] = { 14877 + { /* RFC 3686 Case 1 */ 14878 + #ifdef __LITTLE_ENDIAN 14879 + .key = "\x08\x00" /* rta length */ 14880 + "\x01\x00" /* rta type */ 14881 + #else 14882 + .key = "\x00\x08" /* rta length */ 14883 + "\x00\x01" /* rta type */ 14884 + #endif 14885 + "\x00\x00\x00\x14" /* enc key length */ 14886 + "\x00\x00\x00\x00\x00\x00\x00\x00" 14887 + "\x00\x00\x00\x00\x00\x00\x00\x00" 14888 + "\x00\x00\x00\x00" 14889 + "\xae\x68\x52\xf8\x12\x10\x67\xcc" 14890 + "\x4b\xf7\xa5\x76\x55\x77\xf3\x9e" 14891 + "\x00\x00\x00\x30", 14892 + .klen = 8 + 20 + 20, 14893 + .iv = "\x00\x00\x00\x00\x00\x00\x00\x00", 14894 + .assoc = "\x00\x00\x00\x00\x00\x00\x00\x00", 14895 + .alen = 8, 14896 + .ptext = "Single block msg", 14897 + .plen = 16, 14898 + .ctext = "\xe4\x09\x5d\x4f\xb7\xa7\xb3\x79" 14899 + "\x2d\x61\x75\xa3\x26\x13\x11\xb8" 14900 + "\x70\xdc\x6b\x62\x43\xa1\x2f\x08" 14901 + "\xf1\xec\x93\x7d\x69\xb2\x8e\x1f" 14902 + "\x0a\x97\x39\x86", 14903 + .clen = 16 + 20, 14904 + }, { /* RFC 3686 Case 2 */ 14905 + #ifdef __LITTLE_ENDIAN 14906 + .key = "\x08\x00" /* rta length */ 14907 + "\x01\x00" /* rta type */ 14908 + #else 14909 + .key = "\x00\x08" /* rta length */ 14910 + "\x00\x01" /* rta type */ 14911 + #endif 14912 + "\x00\x00\x00\x14" /* enc key length */ 14913 + "\x20\x21\x22\x23\x24\x25\x26\x27" 14914 + "\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f" 14915 + "\x30\x31\x32\x33" 14916 + "\x7e\x24\x06\x78\x17\xfa\xe0\xd7" 14917 + "\x43\xd6\xce\x1f\x32\x53\x91\x63" 14918 + "\x00\x6c\xb6\xdb", 14919 + .klen = 8 + 20 + 20, 14920 + .iv = "\xc0\x54\x3b\x59\xda\x48\xd9\x0b", 14921 + .assoc = "\xc0\x54\x3b\x59\xda\x48\xd9\x0b", 14922 + .alen = 8, 14923 + .ptext = "\x00\x01\x02\x03\x04\x05\x06\x07" 14924 + "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f" 14925 + "\x10\x11\x12\x13\x14\x15\x16\x17" 14926 + "\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", 14927 + .plen = 32, 14928 + .ctext = "\x51\x04\xa1\x06\x16\x8a\x72\xd9" 14929 + "\x79\x0d\x41\xee\x8e\xda\xd3\x88" 14930 + "\xeb\x2e\x1e\xfc\x46\xda\x57\xc8" 14931 + "\xfc\xe6\x30\xdf\x91\x41\xbe\x28" 14932 + "\x6b\x7b\x4d\x39\x36\x1c\x12\x5f" 14933 + "\x72\xd2\x88\xb2\x26\xa6\xa6\xb5" 14934 + "\x1d\x3a\x49\xa6", 14935 + .clen = 32 + 20, 14936 + }, { /* RFC 3686 Case 3 */ 14937 + #ifdef __LITTLE_ENDIAN 14938 + .key = "\x08\x00" /* rta length */ 14939 + "\x01\x00" /* rta type */ 14940 + #else 14941 + .key = "\x00\x08" /* rta length */ 14942 + "\x00\x01" /* rta type */ 14943 + #endif 14944 + "\x00\x00\x00\x14" /* enc key length */ 14945 + "\x11\x22\x33\x44\x55\x66\x77\x88" 14946 + "\x99\xaa\xbb\xcc\xdd\xee\xff\x11" 14947 + "\x22\x33\x44\x55" 14948 + "\x76\x91\xbe\x03\x5e\x50\x20\xa8" 14949 + "\xac\x6e\x61\x85\x29\xf9\xa0\xdc" 14950 + "\x00\xe0\x01\x7b", 14951 + .klen = 8 + 20 + 20, 14952 + .iv = "\x27\x77\x7f\x3f\x4a\x17\x86\xf0", 14953 + .assoc = "\x27\x77\x7f\x3f\x4a\x17\x86\xf0", 14954 + .alen = 8, 14955 + .ptext = "\x00\x01\x02\x03\x04\x05\x06\x07" 14956 + "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f" 14957 + "\x10\x11\x12\x13\x14\x15\x16\x17" 14958 + "\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f" 14959 + "\x20\x21\x22\x23", 14960 + .plen = 36, 14961 + .ctext = "\xc1\xcf\x48\xa8\x9f\x2f\xfd\xd9" 14962 + "\xcf\x46\x52\xe9\xef\xdb\x72\xd7" 14963 + "\x45\x40\xa4\x2b\xde\x6d\x78\x36" 14964 + "\xd5\x9a\x5c\xea\xae\xf3\x10\x53" 14965 + "\x25\xb2\x07\x2f" 14966 + "\x2c\x86\xa0\x90\x8e\xc1\x02\x1d" 14967 + "\x51\xdc\xd6\x21\xc7\x30\xcc\x32" 14968 + "\x38\x55\x47\x64", 14969 + .clen = 36 + 20, 14970 + }, { /* RFC 3686 Case 4 */ 14971 + #ifdef __LITTLE_ENDIAN 14972 + .key = "\x08\x00" /* rta length */ 14973 + "\x01\x00" /* rta type */ 14974 + #else 14975 + .key = "\x00\x08" /* rta length */ 14976 + "\x00\x01" /* rta type */ 14977 + #endif 14978 + "\x00\x00\x00\x1c" /* enc key length */ 14979 + "\x00\x00\x00\x00\x00\x00\x00\x00" 14980 + "\x00\x00\x00\x00\x00\x00\x00\x00" 14981 + "\x00\x00\x00\x00" 14982 + "\x16\xaf\x5b\x14\x5f\xc9\xf5\x79" 14983 + "\xc1\x75\xf9\x3e\x3b\xfb\x0e\xed" 14984 + "\x86\x3d\x06\xcc\xfd\xb7\x85\x15" 14985 + "\x00\x00\x00\x48", 14986 + .klen = 8 + 20 + 28, 14987 + .iv = "\x36\x73\x3c\x14\x7d\x6d\x93\xcb", 14988 + .assoc = "\x36\x73\x3c\x14\x7d\x6d\x93\xcb", 14989 + .alen = 8, 14990 + .ptext = "Single block msg", 14991 + .plen = 16, 14992 + .ctext = "\x4b\x55\x38\x4f\xe2\x59\xc9\xc8" 14993 + "\x4e\x79\x35\xa0\x03\xcb\xe9\x28" 14994 + "\xe9\x4e\x49\xf0\x6b\x8d\x58\x2b" 14995 + "\x26\x7f\xf3\xab\xeb\x2f\x74\x2f" 14996 + "\x45\x43\x64\xc1", 14997 + .clen = 16 + 20, 14998 + }, { /* RFC 3686 Case 5 */ 14999 + #ifdef __LITTLE_ENDIAN 15000 + .key = "\x08\x00" /* rta length */ 15001 + "\x01\x00" /* rta type */ 15002 + #else 15003 + .key = "\x00\x08" /* rta length */ 15004 + "\x00\x01" /* rta type */ 15005 + #endif 15006 + "\x00\x00\x00\x1c" /* enc key length */ 15007 + "\x20\x21\x22\x23\x24\x25\x26\x27" 15008 + "\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f" 15009 + "\x30\x31\x32\x33" 15010 + "\x7c\x5c\xb2\x40\x1b\x3d\xc3\x3c" 15011 + "\x19\xe7\x34\x08\x19\xe0\xf6\x9c" 15012 + "\x67\x8c\x3d\xb8\xe6\xf6\xa9\x1a" 15013 + "\x00\x96\xb0\x3b", 15014 + .klen = 8 + 20 + 28, 15015 + .iv = "\x02\x0c\x6e\xad\xc2\xcb\x50\x0d", 15016 + .assoc = "\x02\x0c\x6e\xad\xc2\xcb\x50\x0d", 15017 + .alen = 8, 15018 + .ptext = "\x00\x01\x02\x03\x04\x05\x06\x07" 15019 + "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f" 15020 + "\x10\x11\x12\x13\x14\x15\x16\x17" 15021 + "\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", 15022 + .plen = 32, 15023 + .ctext = "\x45\x32\x43\xfc\x60\x9b\x23\x32" 15024 + "\x7e\xdf\xaa\xfa\x71\x31\xcd\x9f" 15025 + "\x84\x90\x70\x1c\x5a\xd4\xa7\x9c" 15026 + "\xfc\x1f\xe0\xff\x42\xf4\xfb\x00" 15027 + "\xab\xc4\xfa\x6d\x20\xe1\xce\x72" 15028 + "\x0e\x92\x4e\x97\xaa\x4d\x30\x84" 15029 + "\xb6\xd8\x4d\x3b", 15030 + .clen = 32 + 20, 15031 + }, { /* RFC 3686 Case 7 */ 15032 + #ifdef __LITTLE_ENDIAN 15033 + .key = "\x08\x00" /* rta length */ 15034 + "\x01\x00" /* rta type */ 15035 + #else 15036 + .key = "\x00\x08" /* rta length */ 15037 + "\x00\x01" /* rta type */ 15038 + #endif 15039 + "\x00\x00\x00\x24" /* enc key length */ 15040 + "\x00\x00\x00\x00\x00\x00\x00\x00" 15041 + "\x00\x00\x00\x00\x00\x00\x00\x00" 15042 + "\x00\x00\x00\x00" 15043 + "\x77\x6b\xef\xf2\x85\x1d\xb0\x6f" 15044 + "\x4c\x8a\x05\x42\xc8\x69\x6f\x6c" 15045 + "\x6a\x81\xaf\x1e\xec\x96\xb4\xd3" 15046 + "\x7f\xc1\xd6\x89\xe6\xc1\xc1\x04" 15047 + "\x00\x00\x00\x60", 15048 + .klen = 8 + 20 + 36, 15049 + .iv = "\xdb\x56\x72\xc9\x7a\xa8\xf0\xb2", 15050 + .assoc = "\xdb\x56\x72\xc9\x7a\xa8\xf0\xb2", 15051 + .alen = 8, 15052 + .ptext = "Single block msg", 15053 + .plen = 16, 15054 + .ctext = "\x14\x5a\xd0\x1d\xbf\x82\x4e\xc7" 15055 + "\x56\x08\x63\xdc\x71\xe3\xe0\xc0" 15056 + "\x3d\x6c\x23\x27\xda\x0e\x7f\x29" 15057 + "\xfd\x8d\x3c\x1b\xf7\x7a\x63\xd9" 15058 + "\x7e\x0f\xe9\xf6", 15059 + .clen = 16 + 20, 15060 + }, { /* RFC 3686 Case 8 */ 15061 + #ifdef __LITTLE_ENDIAN 15062 + .key = "\x08\x00" /* rta length */ 15063 + "\x01\x00" /* rta type */ 15064 + #else 15065 + .key = "\x00\x08" /* rta length */ 15066 + "\x00\x01" /* rta type */ 15067 + #endif 15068 + "\x00\x00\x00\x24" /* enc key length */ 15069 + "\x20\x21\x22\x23\x24\x25\x26\x27" 15070 + "\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f" 15071 + "\x30\x31\x32\x33" 15072 + "\xf6\xd6\x6d\x6b\xd5\x2d\x59\xbb" 15073 + "\x07\x96\x36\x58\x79\xef\xf8\x86" 15074 + "\xc6\x6d\xd5\x1a\x5b\x6a\x99\x74" 15075 + "\x4b\x50\x59\x0c\x87\xa2\x38\x84" 15076 + "\x00\xfa\xac\x24", 15077 + .klen = 8 + 20 + 36, 15078 + .iv = "\xc1\x58\x5e\xf1\x5a\x43\xd8\x75", 15079 + .assoc = "\xc1\x58\x5e\xf1\x5a\x43\xd8\x75", 15080 + .alen = 8, 15081 + .ptext = "\x00\x01\x02\x03\x04\x05\x06\x07" 15082 + "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f" 15083 + "\x10\x11\x12\x13\x14\x15\x16\x17" 15084 + "\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", 15085 + .plen = 32, 15086 + .ctext = "\xf0\x5e\x23\x1b\x38\x94\x61\x2c" 15087 + "\x49\xee\x00\x0b\x80\x4e\xb2\xa9" 15088 + "\xb8\x30\x6b\x50\x8f\x83\x9d\x6a" 15089 + "\x55\x30\x83\x1d\x93\x44\xaf\x1c" 15090 + "\xe7\xee\x22\xa4\xdd\xbf\x5d\x44" 15091 + "\x3b\x43\x1c\x69\x55\x11\xd5\xad" 15092 + "\x14\x5f\x44\xa6", 15093 + .clen = 32 + 20, 15094 + }, 15095 + }; 15096 + 14876 15097 static const struct aead_testvec hmac_sha1_ecb_cipher_null_tv_temp[] = { 14877 15098 { /* Input data from RFC 2410 Case 1 */ 14878 15099 #ifdef __LITTLE_ENDIAN