evpmac_siphash.txt 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193
  1. #
  2. # Copyright 2001-2021 The OpenSSL Project Authors. All Rights Reserved.
  3. #
  4. # Licensed under the Apache License 2.0 (the "License"). You may not use
  5. # this file except in compliance with the License. You can obtain a copy
  6. # in the file LICENSE in the source distribution or at
  7. # https://www.openssl.org/source/license.html
  8. # Tests start with one of these keywords
  9. # Cipher Decrypt Derive Digest Encoding KDF MAC PBE
  10. # PrivPubKeyPair Sign Verify VerifyRecover
  11. # and continue until a blank line. Lines starting with a pound sign are ignored.
  12. # SIPHASH tests - default values: 2,4 rounds, 16-byte mac
  13. # There are no official test vectors, they are simple vectors 1, 2, 3, etc
  14. Title = SIPHASH tests
  15. MAC = SipHash
  16. Key = 000102030405060708090A0B0C0D0E0F
  17. Input =
  18. Output = a3817f04ba25a8e66df67214c7550293
  19. MAC = SipHash
  20. Key = 000102030405060708090A0B0C0D0E0F
  21. Input = 00
  22. Output = da87c1d86b99af44347659119b22fc45
  23. MAC = SipHash
  24. Key = 000102030405060708090A0B0C0D0E0F
  25. Input = 0001
  26. Output = 8177228da4a45dc7fca38bdef60affe4
  27. MAC = SipHash
  28. Key = 000102030405060708090A0B0C0D0E0F
  29. Input = 000102
  30. Output = 9c70b60c5267a94e5f33b6b02985ed51
  31. MAC = SipHash
  32. Key = 000102030405060708090A0B0C0D0E0F
  33. Input = 00010203
  34. Output = f88164c12d9c8faf7d0f6e7c7bcd5579
  35. MAC = SipHash
  36. Key = 000102030405060708090A0B0C0D0E0F
  37. Input = 0001020304
  38. Output = 1368875980776f8854527a07690e9627
  39. MAC = SipHash
  40. Key = 000102030405060708090A0B0C0D0E0F
  41. Input = 000102030405
  42. Output = 14eeca338b208613485ea0308fd7a15e
  43. MAC = SipHash
  44. Key = 000102030405060708090A0B0C0D0E0F
  45. Input = 00010203040506
  46. Output = a1f1ebbed8dbc153c0b84aa61ff08239
  47. MAC = SipHash
  48. Key = 000102030405060708090A0B0C0D0E0F
  49. Input = 0001020304050607
  50. Output = 3b62a9ba6258f5610f83e264f31497b4
  51. MAC = SipHash
  52. Key = 000102030405060708090A0B0C0D0E0F
  53. Input = 000102030405060708
  54. Output = 264499060ad9baabc47f8b02bb6d71ed
  55. MAC = SipHash
  56. Key = 000102030405060708090A0B0C0D0E0F
  57. Input = 000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F202122232425262728292A2B2C2D2E2F303132333435363738393A3B3C3D3E
  58. Output = 5150d1772f50834a503e069a973fbd7c
  59. MAC = SipHash
  60. Key = 000102030405060708090A0B0C0D0E0F
  61. Input =
  62. Output = a3817f04ba25a8e66df67214c7550293
  63. MAC = SipHash
  64. Key = 000102030405060708090A0B0C0D0E0F
  65. Input = 00
  66. Output = da87c1d86b99af44347659119b22fc45
  67. MAC = SipHash
  68. Key = 000102030405060708090A0B0C0D0E0F
  69. Input = 0001
  70. Output = 8177228da4a45dc7fca38bdef60affe4
  71. MAC = SipHash
  72. Key = 000102030405060708090A0B0C0D0E0F
  73. Input = 000102
  74. Output = 9c70b60c5267a94e5f33b6b02985ed51
  75. MAC = SipHash
  76. Key = 000102030405060708090A0B0C0D0E0F
  77. Input = 00010203
  78. Output = f88164c12d9c8faf7d0f6e7c7bcd5579
  79. MAC = SipHash
  80. Key = 000102030405060708090A0B0C0D0E0F
  81. Input = 0001020304
  82. Output = 1368875980776f8854527a07690e9627
  83. MAC = SipHash
  84. Key = 000102030405060708090A0B0C0D0E0F
  85. Input = 000102030405
  86. Output = 14eeca338b208613485ea0308fd7a15e
  87. MAC = SipHash
  88. Key = 000102030405060708090A0B0C0D0E0F
  89. Input = 00010203040506
  90. Output = a1f1ebbed8dbc153c0b84aa61ff08239
  91. MAC = SipHash
  92. Key = 000102030405060708090A0B0C0D0E0F
  93. Input = 0001020304050607
  94. Output = 3b62a9ba6258f5610f83e264f31497b4
  95. MAC = SipHash by EVP_PKEY
  96. Key = 000102030405060708090A0B0C0D0E0F
  97. Input = 000102030405060708
  98. Output = 264499060ad9baabc47f8b02bb6d71ed
  99. MAC = SipHash
  100. Key = 000102030405060708090A0B0C0D0E0F
  101. Input = 000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F202122232425262728292A2B2C2D2E2F303132333435363738393A3B3C3D3E
  102. Output = 5150d1772f50834a503e069a973fbd7c
  103. # SIPHASH - default values: 2,4 rounds, explicit 8-byte mac
  104. MAC = SipHash
  105. Ctrl = size:8
  106. Key = 000102030405060708090A0B0C0D0E0F
  107. Input = 000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F202122232425262728292A2B2C2D2E2F303132333435363738393A3B3C3D3E
  108. Output = 724506EB4C328A95
  109. MAC = SipHash by EVP_PKEY
  110. Ctrl = digestsize:8
  111. Key = 000102030405060708090A0B0C0D0E0F
  112. Input = 000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F202122232425262728292A2B2C2D2E2F303132333435363738393A3B3C3D3E
  113. Output = 724506EB4C328A95
  114. # SIPHASH - default values: 2,4 rounds, explicit 16-byte mac
  115. MAC = SipHash
  116. Ctrl = size:16
  117. Key = 000102030405060708090A0B0C0D0E0F
  118. Input = 000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F202122232425262728292A2B2C2D2E2F303132333435363738393A3B3C3D3E
  119. Output = 5150d1772f50834a503e069a973fbd7c
  120. # SIPHASH - default values: 2,4 rounds, explicit 16-byte mac (set as 0)
  121. MAC = SipHash
  122. Ctrl = size:0
  123. Key = 000102030405060708090A0B0C0D0E0F
  124. Input = 000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F202122232425262728292A2B2C2D2E2F303132333435363738393A3B3C3D3E
  125. Output = 5150d1772f50834a503e069a973fbd7c
  126. # SIPHASH - default values: 2,4 rounds, explicit 13-byte mac (invalid size)
  127. MAC = SipHash
  128. Ctrl = size:13
  129. Key = 000102030405060708090A0B0C0D0E0F
  130. Result = MAC_INIT_ERROR
  131. # SIPHASH - default values: 2,4 rounds, explicit 13-byte mac (invalid size)
  132. # by EVP_PKEY this time
  133. MAC = SipHash by EVP_PKEY
  134. Ctrl = digestsize:13
  135. Key = 000102030405060708090A0B0C0D0E0F
  136. Result = EVPPKEYCTXCTRL_ERROR
  137. Title = SIPHASH - explicit rounds
  138. MAC = SipHash
  139. Ctrl = size:0
  140. Ctrl = c-rounds:2
  141. Ctrl = d-rounds:4
  142. Key = 000102030405060708090A0B0C0D0E0F
  143. Input = 000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F202122232425262728292A2B2C2D2E2F303132333435363738393A3B3C3D3E
  144. Output = 5150d1772f50834a503e069a973fbd7c
  145. # Generated by the reference implementation
  146. Title = SIPHASH - non-default values: 4,8 rounds
  147. MAC = SipHash
  148. Ctrl = size:8
  149. Ctrl = c-rounds:4
  150. Ctrl = d-rounds:8
  151. Key = 000102030405060708090A0B0C0D0E0F
  152. Input = 000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F202122232425262728292A2B2C2D2E2F303132333435363738393A3B3C3D3E
  153. Output = E67784BC5503DE23