Home | History | Annotate | Download | only in hmac
      1 HMAC = MD5
      2 # Note: The empty key results in passing NULL to HMAC_Init_ex, so this tests
      3 # that HMAC_CTX and HMAC treat NULL as the empty key initially.
      4 Key =
      5 Input = "More text test vectors to stuff up EBCDIC machines :-)"
      6 Output = e9139d1e6ee064ef8cf514fc7dc83e86
      7 
      8 # HMAC tests from RFC2104
      9 HMAC = MD5
     10 Key = 0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b
     11 Input = "Hi There"
     12 Output = 9294727a3638bb1c13f48ef8158bfc9d
     13 
     14 HMAC = MD5
     15 Key = "Jefe"
     16 Input = "what do ya want for nothing?"
     17 Output = 750c783e6ab0b503eaa86e310a5db738
     18 
     19 HMAC = MD5
     20 Key = AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
     21 Input = DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD
     22 Output = 56be34521d144c88dbb8c733f0e8b3f6
     23 
     24 # HMAC tests from NIST test data
     25 
     26 HMAC = SHA1
     27 Input = "Sample message for keylen=blocklen"
     28 Key = 000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F202122232425262728292A2B2C2D2E2F303132333435363738393A3B3C3D3E3F
     29 Output = 5FD596EE78D5553C8FF4E72D266DFD192366DA29
     30 
     31 HMAC = SHA1
     32 Input = "Sample message for keylen<blocklen"
     33 Key = 000102030405060708090A0B0C0D0E0F10111213
     34 Output = 4C99FF0CB1B31BD33F8431DBAF4D17FCD356A807
     35 
     36 HMAC = SHA1
     37 Input = "Sample message for keylen=blocklen"
     38 Key = 000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F202122232425262728292A2B2C2D2E2F303132333435363738393A3B3C3D3E3F404142434445464748494A4B4C4D4E4F505152535455565758595A5B5C5D5E5F60616263
     39 Output = 2D51B2F7750E410584662E38F133435F4C4FD42A
     40 
     41 HMAC = SHA224
     42 Input = "Sample message for keylen=blocklen"
     43 Key = 000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F202122232425262728292A2B2C2D2E2F303132333435363738393A3B3C3D3E3F
     44 Output = C7405E3AE058E8CD30B08B4140248581ED174CB34E1224BCC1EFC81B
     45 
     46 HMAC = SHA224
     47 Input = "Sample message for keylen<blocklen"
     48 Key = 000102030405060708090A0B0C0D0E0F101112131415161718191A1B
     49 Output = E3D249A8CFB67EF8B7A169E9A0A599714A2CECBA65999A51BEB8FBBE
     50 
     51 HMAC = SHA224
     52 Input = "Sample message for keylen=blocklen"
     53 Key = 000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F202122232425262728292A2B2C2D2E2F303132333435363738393A3B3C3D3E3F404142434445464748494A4B4C4D4E4F505152535455565758595A5B5C5D5E5F60616263
     54 Output = 91C52509E5AF8531601AE6230099D90BEF88AAEFB961F4080ABC014D
     55 
     56 HMAC = SHA256
     57 Input = "Sample message for keylen=blocklen"
     58 Key = 000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F202122232425262728292A2B2C2D2E2F303132333435363738393A3B3C3D3E3F
     59 Output = 8BB9A1DB9806F20DF7F77B82138C7914D174D59E13DC4D0169C9057B133E1D62
     60 
     61 HMAC = SHA256
     62 Input = "Sample message for keylen<blocklen"
     63 Key = 000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F
     64 Output = A28CF43130EE696A98F14A37678B56BCFCBDD9E5CF69717FECF5480F0EBDF790
     65 
     66 HMAC = SHA256
     67 Input = "Sample message for keylen=blocklen"
     68 Key = 000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F202122232425262728292A2B2C2D2E2F303132333435363738393A3B3C3D3E3F404142434445464748494A4B4C4D4E4F505152535455565758595A5B5C5D5E5F60616263
     69 Output = BDCCB6C72DDEADB500AE768386CB38CC41C63DBB0878DDB9C7A38A431B78378D
     70 
     71 HMAC = SHA384
     72 Input = "Sample message for keylen=blocklen"
     73 Key = 000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F202122232425262728292A2B2C2D2E2F303132333435363738393A3B3C3D3E3F404142434445464748494A4B4C4D4E4F505152535455565758595A5B5C5D5E5F606162636465666768696A6B6C6D6E6F707172737475767778797A7B7C7D7E7F
     74 Output = 63C5DAA5E651847CA897C95814AB830BEDEDC7D25E83EEF9195CD45857A37F448947858F5AF50CC2B1B730DDF29671A9
     75 
     76 HMAC = SHA384
     77 Input = "Sample message for keylen<blocklen"
     78 Key = 000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F202122232425262728292A2B2C2D2E2F
     79 Output = 6EB242BDBB582CA17BEBFA481B1E23211464D2B7F8C20B9FF2201637B93646AF5AE9AC316E98DB45D9CAE773675EEED0
     80 
     81 HMAC = SHA384
     82 Input = "Sample message for keylen=blocklen"
     83 Key = 000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F202122232425262728292A2B2C2D2E2F303132333435363738393A3B3C3D3E3F404142434445464748494A4B4C4D4E4F505152535455565758595A5B5C5D5E5F606162636465666768696A6B6C6D6E6F707172737475767778797A7B7C7D7E7F808182838485868788898A8B8C8D8E8F909192939495969798999A9B9C9D9E9FA0A1A2A3A4A5A6A7A8A9AAABACADAEAFB0B1B2B3B4B5B6B7B8B9BABBBCBDBEBFC0C1C2C3C4C5C6C7
     84 Output = 5B664436DF69B0CA22551231A3F0A3D5B4F97991713CFA84BFF4D0792EFF96C27DCCBBB6F79B65D548B40E8564CEF594
     85 
     86 HMAC = SHA512
     87 Input = "Sample message for keylen=blocklen"
     88 Key = 000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F202122232425262728292A2B2C2D2E2F303132333435363738393A3B3C3D3E3F404142434445464748494A4B4C4D4E4F505152535455565758595A5B5C5D5E5F606162636465666768696A6B6C6D6E6F707172737475767778797A7B7C7D7E7F
     89 Output = FC25E240658CA785B7A811A8D3F7B4CA48CFA26A8A366BF2CD1F836B05FCB024BD36853081811D6CEA4216EBAD79DA1CFCB95EA4586B8A0CE356596A55FB1347
     90 
     91 HMAC = SHA512
     92 Input = "Sample message for keylen<blocklen"
     93 Key = 000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F202122232425262728292A2B2C2D2E2F303132333435363738393A3B3C3D3E3F
     94 Output = FD44C18BDA0BB0A6CE0E82B031BF2818F6539BD56EC00BDC10A8A2D730B3634DE2545D639B0F2CF710D0692C72A1896F1F211C2B922D1A96C392E07E7EA9FEDC
     95 
     96 HMAC = SHA512
     97 Input = "Sample message for keylen=blocklen"
     98 Key = 000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F202122232425262728292A2B2C2D2E2F303132333435363738393A3B3C3D3E3F404142434445464748494A4B4C4D4E4F505152535455565758595A5B5C5D5E5F606162636465666768696A6B6C6D6E6F707172737475767778797A7B7C7D7E7F808182838485868788898A8B8C8D8E8F909192939495969798999A9B9C9D9E9FA0A1A2A3A4A5A6A7A8A9AAABACADAEAFB0B1B2B3B4B5B6B7B8B9BABBBCBDBEBFC0C1C2C3C4C5C6C7
     99 Output = D93EC8D2DE1AD2A9957CB9B83F14E76AD6B5E0CCE285079A127D3B14BCCB7AA7286D4AC0D4CE64215F2BC9E6870B33D97438BE4AAA20CDA5C5A912B48B8E27F3
    100 
    101 # Additional HMAC tests from OpenSSL.
    102 HMAC = SHA1
    103 Input = "My test data"
    104 Key =
    105 Output = 61afdecb95429ef494d61fdee15990cabf0826fc
    106 
    107 HMAC = SHA256
    108 Input = "My test data"
    109 Key =
    110 Output = 2274b195d90ce8e03406f4b526a47e0787a88a65479938f1a5baa3ce0f079776
    111 
    112 HMAC = SHA256
    113 Input = "My test data"
    114 Key = "123456"
    115 Output = bab53058ae861a7f191abe2d0145cbb123776a6369ee3f9d79ce455667e411dd
    116 
    117 HMAC = SHA1
    118 Input = "My test data"
    119 Key = "12345"
    120 Output = 7dbe8c764c068e3bcd6e6b0fbcd5e6fc197b15bb
    121