You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

1208 lines
43 KiB

  1. /* X25519, X448 test vectors */
  2. template<> const uint8_t Tests<Ristretto>::rfc7748_1[32] = {
  3. 0x42,0x2c,0x8e,0x7a,0x62,0x27,0xd7,0xbc,
  4. 0xa1,0x35,0x0b,0x3e,0x2b,0xb7,0x27,0x9f,
  5. 0x78,0x97,0xb8,0x7b,0xb6,0x85,0x4b,0x78,
  6. 0x3c,0x60,0xe8,0x03,0x11,0xae,0x30,0x79
  7. };
  8. template<> const uint8_t Tests<Ristretto>::rfc7748_1000[32] = {
  9. 0x68,0x4c,0xf5,0x9b,0xa8,0x33,0x09,0x55,
  10. 0x28,0x00,0xef,0x56,0x6f,0x2f,0x4d,0x3c,
  11. 0x1c,0x38,0x87,0xc4,0x93,0x60,0xe3,0x87,
  12. 0x5f,0x2e,0xb9,0x4d,0x99,0x53,0x2c,0x51
  13. };
  14. template<> const uint8_t Tests<Ristretto>::rfc7748_1000000[32] = {
  15. 0x7c,0x39,0x11,0xe0,0xab,0x25,0x86,0xfd,
  16. 0x86,0x44,0x97,0x29,0x7e,0x57,0x5e,0x6f,
  17. 0x3b,0xc6,0x01,0xc0,0x88,0x3c,0x30,0xdf,
  18. 0x5f,0x4d,0xd2,0xd2,0x4f,0x66,0x54,0x24
  19. };
  20. template<> const uint8_t Tests<Ed448Goldilocks>::rfc7748_1[56] = {
  21. 0x3f,0x48,0x2c,0x8a,0x9f,0x19,0xb0,0x1e,
  22. 0x6c,0x46,0xee,0x97,0x11,0xd9,0xdc,0x14,
  23. 0xfd,0x4b,0xf6,0x7a,0xf3,0x07,0x65,0xc2,
  24. 0xae,0x2b,0x84,0x6a,0x4d,0x23,0xa8,0xcd,
  25. 0x0d,0xb8,0x97,0x08,0x62,0x39,0x49,0x2c,
  26. 0xaf,0x35,0x0b,0x51,0xf8,0x33,0x86,0x8b,
  27. 0x9b,0xc2,0xb3,0xbc,0xa9,0xcf,0x41,0x13
  28. };
  29. template<> const uint8_t Tests<Ed448Goldilocks>::rfc7748_1000[56] = {
  30. 0xaa,0x3b,0x47,0x49,0xd5,0x5b,0x9d,0xaf,
  31. 0x1e,0x5b,0x00,0x28,0x88,0x26,0xc4,0x67,
  32. 0x27,0x4c,0xe3,0xeb,0xbd,0xd5,0xc1,0x7b,
  33. 0x97,0x5e,0x09,0xd4,0xaf,0x6c,0x67,0xcf,
  34. 0x10,0xd0,0x87,0x20,0x2d,0xb8,0x82,0x86,
  35. 0xe2,0xb7,0x9f,0xce,0xea,0x3e,0xc3,0x53,
  36. 0xef,0x54,0xfa,0xa2,0x6e,0x21,0x9f,0x38
  37. };
  38. template<> const uint8_t Tests<Ed448Goldilocks>::rfc7748_1000000[56] = {
  39. 0x07,0x7f,0x45,0x36,0x81,0xca,0xca,0x36,
  40. 0x93,0x19,0x84,0x20,0xbb,0xe5,0x15,0xca,
  41. 0xe0,0x00,0x24,0x72,0x51,0x9b,0x3e,0x67,
  42. 0x66,0x1a,0x7e,0x89,0xca,0xb9,0x46,0x95,
  43. 0xc8,0xf4,0xbc,0xd6,0x6e,0x61,0xb9,0xb9,
  44. 0xc9,0x46,0xda,0x8d,0x52,0x4d,0xe3,0xd6,
  45. 0x9b,0xd9,0xd9,0xd6,0x6b,0x99,0x7e,0x37
  46. };
  47. template<> const Block Tests<Ed448Goldilocks>::sqrt_minus_one(NULL,0);
  48. const uint8_t sm1_25519[32] = {
  49. 0xb0,0xa0,0x0e,0x4a,0x27,0x1b,0xee,0xc4,
  50. 0x78,0xe4,0x2f,0xad,0x06,0x18,0x43,0x2f,
  51. 0xa7,0xd7,0xfb,0x3d,0x99,0x00,0x4d,0x2b,
  52. 0x0b,0xdf,0xc1,0x4f,0x80,0x24,0x83,0x2b
  53. };
  54. template<> const Block Tests<Ristretto>::sqrt_minus_one(sm1_25519,32);
  55. template<> const Block Tests<Ed448Goldilocks>::minus_sqrt_minus_one(NULL,0);
  56. const uint8_t msm1_25519[32] = {
  57. 0x3d,0x5f,0xf1,0xb5,0xd8,0xe4,0x11,0x3b,
  58. 0x87,0x1b,0xd0,0x52,0xf9,0xe7,0xbc,0xd0,
  59. 0x58,0x28,0x04,0xc2,0x66,0xff,0xb2,0xd4,
  60. 0xf4,0x20,0x3e,0xb0,0x7f,0xdb,0x7c,0x54
  61. };
  62. template<> const Block Tests<Ristretto>::minus_sqrt_minus_one(msm1_25519,32);
  63. const uint8_t elli_patho_448[56] = {
  64. 0x14,0xf0,0x70,0x58,0x41,0xc7,0xf9,0xa5,
  65. 0xfa,0x2c,0x7d,0x87,0x07,0x89,0xe8,0x61,
  66. 0x63,0xe8,0xc8,0xdc,0x06,0x2d,0x39,0x8f,
  67. 0x18,0x83,0x1e,0xc6,0x8c,0x6d,0x73,0x24,
  68. 0xd4,0xb3,0xd3,0xe1,0xf3,0x51,0x8c,0xee,
  69. 0x65,0x79,0x88,0xc1,0x0b,0xcf,0x8e,0xa5,
  70. 0x86,0xa9,0x2e,0xc9,0x17,0x68,0x9b,0x20
  71. };
  72. template<> const Block Tests<Ed448Goldilocks>::elli_patho(elli_patho_448,56);
  73. template<> const Block Tests<Ristretto>::elli_patho(NULL,0);
  74. /* EdDSA test vectors */
  75. /* EdDSA test vectors */
  76. const uint8_t ed448_eddsa_sk[][57] = {{
  77. // RFC 8032 - test vector 1 - blank
  78. 0x6c,0x82,0xa5,0x62,0xcb,0x80,0x8d,0x10,
  79. 0xd6,0x32,0xbe,0x89,0xc8,0x51,0x3e,0xbf,
  80. 0x6c,0x92,0x9f,0x34,0xdd,0xfa,0x8c,0x9f,
  81. 0x63,0xc9,0x96,0x0e,0xf6,0xe3,0x48,0xa3,
  82. 0x52,0x8c,0x8a,0x3f,0xcc,0x2f,0x04,0x4e,
  83. 0x39,0xa3,0xfc,0x5b,0x94,0x49,0x2f,0x8f,
  84. 0x03,0x2e,0x75,0x49,0xa2,0x00,0x98,0xf9,
  85. 0x5b
  86. }, {
  87. // RFC 8032 - test vector 2/3 - 1 octet
  88. 0xc4,0xea,0xb0,0x5d,0x35,0x70,0x07,0xc6,
  89. 0x32,0xf3,0xdb,0xb4,0x84,0x89,0x92,0x4d,
  90. 0x55,0x2b,0x08,0xfe,0x0c,0x35,0x3a,0x0d,
  91. 0x4a,0x1f,0x00,0xac,0xda,0x2c,0x46,0x3a,
  92. 0xfb,0xea,0x67,0xc5,0xe8,0xd2,0x87,0x7c,
  93. 0x5e,0x3b,0xc3,0x97,0xa6,0x59,0x94,0x9e,
  94. 0xf8,0x02,0x1e,0x95,0x4e,0x0a,0x12,0x27,
  95. 0x4e
  96. }, {
  97. // RFC 8032 - test vector 4 - 11 octet
  98. 0xcd,0x23,0xd2,0x4f,0x71,0x42,0x74,0xe7,
  99. 0x44,0x34,0x32,0x37,0xb9,0x32,0x90,0xf5,
  100. 0x11,0xf6,0x42,0x5f,0x98,0xe6,0x44,0x59,
  101. 0xff,0x20,0x3e,0x89,0x85,0x08,0x3f,0xfd,
  102. 0xf6,0x05,0x00,0x55,0x3a,0xbc,0x0e,0x05,
  103. 0xcd,0x02,0x18,0x4b,0xdb,0x89,0xc4,0xcc,
  104. 0xd6,0x7e,0x18,0x79,0x51,0x26,0x7e,0xb3,
  105. 0x28
  106. }, {
  107. // RFC 8032 - test vector 5 - 12 octet
  108. 0x25,0x8c,0xdd,0x4a,0xda,0x32,0xed,0x9c,
  109. 0x9f,0xf5,0x4e,0x63,0x75,0x6a,0xe5,0x82,
  110. 0xfb,0x8f,0xab,0x2a,0xc7,0x21,0xf2,0xc8,
  111. 0xe6,0x76,0xa7,0x27,0x68,0x51,0x3d,0x93,
  112. 0x9f,0x63,0xdd,0xdb,0x55,0x60,0x91,0x33,
  113. 0xf2,0x9a,0xdf,0x86,0xec,0x99,0x29,0xdc,
  114. 0xcb,0x52,0xc1,0xc5,0xfd,0x2f,0xf7,0xe2,
  115. 0x1b
  116. }, {
  117. // RFC 8032 - test vector 1 - prehash - blank
  118. 0x83,0x3f,0xe6,0x24,0x09,0x23,0x7b,0x9d,
  119. 0x62,0xec,0x77,0x58,0x75,0x20,0x91,0x1e,
  120. 0x9a,0x75,0x9c,0xec,0x1d,0x19,0x75,0x5b,
  121. 0x7d,0xa9,0x01,0xb9,0x6d,0xca,0x3d,0x42,
  122. 0xef,0x78,0x22,0xe0,0xd5,0x10,0x41,0x27,
  123. 0xdc,0x05,0xd6,0xdb,0xef,0xde,0x69,0xe3,
  124. 0xab,0x2c,0xec,0x7c,0x86,0x7c,0x6e,0x2c,
  125. 0x49
  126. }, {
  127. // RFC 8032 - test vector 6 - 13 octet
  128. 0x7e,0xf4,0xe8,0x45,0x44,0x23,0x67,0x52,
  129. 0xfb,0xb5,0x6b,0x8f,0x31,0xa2,0x3a,0x10,
  130. 0xe4,0x28,0x14,0xf5,0xf5,0x5c,0xa0,0x37,
  131. 0xcd,0xcc,0x11,0xc6,0x4c,0x9a,0x3b,0x29,
  132. 0x49,0xc1,0xbb,0x60,0x70,0x03,0x14,0x61,
  133. 0x17,0x32,0xa6,0xc2,0xfe,0xa9,0x8e,0xeb,
  134. 0xc0,0x26,0x6a,0x11,0xa9,0x39,0x70,0x10,
  135. 0x0e,
  136. }, {
  137. // RFC 8032 - test vector 7 - 64 octet
  138. 0xd6,0x5d,0xf3,0x41,0xad,0x13,0xe0,0x08,
  139. 0x56,0x76,0x88,0xba,0xed,0xda,0x8e,0x9d,
  140. 0xcd,0xc1,0x7d,0xc0,0x24,0x97,0x4e,0xa5,
  141. 0xb4,0x22,0x7b,0x65,0x30,0xe3,0x39,0xbf,
  142. 0xf2,0x1f,0x99,0xe6,0x8c,0xa6,0x96,0x8f,
  143. 0x3c,0xca,0x6d,0xfe,0x0f,0xb9,0xf4,0xfa,
  144. 0xb4,0xfa,0x13,0x5d,0x55,0x42,0xea,0x3f,
  145. 0x01,
  146. }, {
  147. // RFC 8032 - test vector 8 - 256 octet
  148. 0x2e,0xc5,0xfe,0x3c,0x17,0x04,0x5a,0xbd,
  149. 0xb1,0x36,0xa5,0xe6,0xa9,0x13,0xe3,0x2a,
  150. 0xb7,0x5a,0xe6,0x8b,0x53,0xd2,0xfc,0x14,
  151. 0x9b,0x77,0xe5,0x04,0x13,0x2d,0x37,0x56,
  152. 0x9b,0x7e,0x76,0x6b,0xa7,0x4a,0x19,0xbd,
  153. 0x61,0x62,0x34,0x3a,0x21,0xc8,0x59,0x0a,
  154. 0xa9,0xce,0xbc,0xa9,0x01,0x4c,0x63,0x6d,
  155. 0xf5,
  156. }, {
  157. // RFC 8032 - test vector 9 - 1023 octet
  158. 0x87,0x2d,0x09,0x37,0x80,0xf5,0xd3,0x73,
  159. 0x0d,0xf7,0xc2,0x12,0x66,0x4b,0x37,0xb8,
  160. 0xa0,0xf2,0x4f,0x56,0x81,0x0d,0xaa,0x83,
  161. 0x82,0xcd,0x4f,0xa3,0xf7,0x76,0x34,0xec,
  162. 0x44,0xdc,0x54,0xf1,0xc2,0xed,0x9b,0xea,
  163. 0x86,0xfa,0xfb,0x76,0x32,0xd8,0xbe,0x19,
  164. 0x9e,0xa1,0x65,0xf5,0xad,0x55,0xdd,0x9c,
  165. 0xe8,
  166. }};
  167. const uint8_t ed448_eddsa_pk[][57] = {{
  168. // RFC 8032 - test vector 1 - blank
  169. 0x5f,0xd7,0x44,0x9b,0x59,0xb4,0x61,0xfd,
  170. 0x2c,0xe7,0x87,0xec,0x61,0x6a,0xd4,0x6a,
  171. 0x1d,0xa1,0x34,0x24,0x85,0xa7,0x0e,0x1f,
  172. 0x8a,0x0e,0xa7,0x5d,0x80,0xe9,0x67,0x78,
  173. 0xed,0xf1,0x24,0x76,0x9b,0x46,0xc7,0x06,
  174. 0x1b,0xd6,0x78,0x3d,0xf1,0xe5,0x0f,0x6c,
  175. 0xd1,0xfa,0x1a,0xbe,0xaf,0xe8,0x25,0x61,
  176. 0x80
  177. }, {
  178. // RFC 8032 - test vector 2/3 - 1 octet
  179. 0x43,0xba,0x28,0xf4,0x30,0xcd,0xff,0x45,
  180. 0x6a,0xe5,0x31,0x54,0x5f,0x7e,0xcd,0x0a,
  181. 0xc8,0x34,0xa5,0x5d,0x93,0x58,0xc0,0x37,
  182. 0x2b,0xfa,0x0c,0x6c,0x67,0x98,0xc0,0x86,
  183. 0x6a,0xea,0x01,0xeb,0x00,0x74,0x28,0x02,
  184. 0xb8,0x43,0x8e,0xa4,0xcb,0x82,0x16,0x9c,
  185. 0x23,0x51,0x60,0x62,0x7b,0x4c,0x3a,0x94,
  186. 0x80
  187. }, {
  188. // RFC 8032 - test vector 4 - 11 octet
  189. 0xdc,0xea,0x9e,0x78,0xf3,0x5a,0x1b,0xf3,
  190. 0x49,0x9a,0x83,0x1b,0x10,0xb8,0x6c,0x90,
  191. 0xaa,0xc0,0x1c,0xd8,0x4b,0x67,0xa0,0x10,
  192. 0x9b,0x55,0xa3,0x6e,0x93,0x28,0xb1,0xe3,
  193. 0x65,0xfc,0xe1,0x61,0xd7,0x1c,0xe7,0x13,
  194. 0x1a,0x54,0x3e,0xa4,0xcb,0x5f,0x7e,0x9f,
  195. 0x1d,0x8b,0x00,0x69,0x64,0x47,0x00,0x14,
  196. 0x00
  197. }, {
  198. // RFC 8032 - test vector 5 - 12 octet
  199. 0x3b,0xa1,0x6d,0xa0,0xc6,0xf2,0xcc,0x1f,
  200. 0x30,0x18,0x77,0x40,0x75,0x6f,0x5e,0x79,
  201. 0x8d,0x6b,0xc5,0xfc,0x01,0x5d,0x7c,0x63,
  202. 0xcc,0x95,0x10,0xee,0x3f,0xd4,0x4a,0xdc,
  203. 0x24,0xd8,0xe9,0x68,0xb6,0xe4,0x6e,0x6f,
  204. 0x94,0xd1,0x9b,0x94,0x53,0x61,0x72,0x6b,
  205. 0xd7,0x5e,0x14,0x9e,0xf0,0x98,0x17,0xf5,
  206. 0x80
  207. }, {
  208. // RFC 8032 - test vector 1 - prehash - abc
  209. 0x25,0x9b,0x71,0xc1,0x9f,0x83,0xef,0x77,
  210. 0xa7,0xab,0xd2,0x65,0x24,0xcb,0xdb,0x31,
  211. 0x61,0xb5,0x90,0xa4,0x8f,0x7d,0x17,0xde,
  212. 0x3e,0xe0,0xba,0x9c,0x52,0xbe,0xb7,0x43,
  213. 0xc0,0x94,0x28,0xa1,0x31,0xd6,0xb1,0xb5,
  214. 0x73,0x03,0xd9,0x0d,0x81,0x32,0xc2,0x76,
  215. 0xd5,0xed,0x3d,0x5d,0x01,0xc0,0xf5,0x38,
  216. 0x80
  217. }, {
  218. // RFC 8032 - test vector 6 - 13 octet
  219. 0xb3,0xda,0x07,0x9b,0x0a,0xa4,0x93,0xa5,
  220. 0x77,0x20,0x29,0xf0,0x46,0x7b,0xae,0xbe,
  221. 0xe5,0xa8,0x11,0x2d,0x9d,0x3a,0x22,0x53,
  222. 0x23,0x61,0xda,0x29,0x4f,0x7b,0xb3,0x81,
  223. 0x5c,0x5d,0xc5,0x9e,0x17,0x6b,0x4d,0x9f,
  224. 0x38,0x1c,0xa0,0x93,0x8e,0x13,0xc6,0xc0,
  225. 0x7b,0x17,0x4b,0xe6,0x5d,0xfa,0x57,0x8e,
  226. 0x80
  227. }, {
  228. // RFC 8032 - test vector 7 - 64 octet
  229. 0xdf,0x97,0x05,0xf5,0x8e,0xdb,0xab,0x80,
  230. 0x2c,0x7f,0x83,0x63,0xcf,0xe5,0x56,0x0a,
  231. 0xb1,0xc6,0x13,0x2c,0x20,0xa9,0xf1,0xdd,
  232. 0x16,0x34,0x83,0xa2,0x6f,0x8a,0xc5,0x3a,
  233. 0x39,0xd6,0x80,0x8b,0xf4,0xa1,0xdf,0xbd,
  234. 0x26,0x1b,0x09,0x9b,0xb0,0x3b,0x3f,0xb5,
  235. 0x09,0x06,0xcb,0x28,0xbd,0x8a,0x08,0x1f,
  236. 0x00
  237. }, {
  238. // RFC 8032 - test vector 8 - 256 octet
  239. 0x79,0x75,0x6f,0x01,0x4d,0xcf,0xe2,0x07,
  240. 0x9f,0x5d,0xd9,0xe7,0x18,0xbe,0x41,0x71,
  241. 0xe2,0xef,0x24,0x86,0xa0,0x8f,0x25,0x18,
  242. 0x6f,0x6b,0xff,0x43,0xa9,0x93,0x6b,0x9b,
  243. 0xfe,0x12,0x40,0x2b,0x08,0xae,0x65,0x79,
  244. 0x8a,0x3d,0x81,0xe2,0x2e,0x9e,0xc8,0x0e,
  245. 0x76,0x90,0x86,0x2e,0xf3,0xd4,0xed,0x3a,
  246. 0x00
  247. }, {
  248. // RFC 8032 - test vector 9 - 1023 octet
  249. 0xa8,0x1b,0x2e,0x8a,0x70,0xa5,0xac,0x94,
  250. 0xff,0xdb,0xcc,0x9b,0xad,0xfc,0x3f,0xeb,
  251. 0x08,0x01,0xf2,0x58,0x57,0x8b,0xb1,0x14,
  252. 0xad,0x44,0xec,0xe1,0xec,0x0e,0x79,0x9d,
  253. 0xa0,0x8e,0xff,0xb8,0x1c,0x5d,0x68,0x5c,
  254. 0x0c,0x56,0xf6,0x4e,0xec,0xae,0xf8,0xcd,
  255. 0xf1,0x1c,0xc3,0x87,0x37,0x83,0x8c,0xf4,
  256. 0x00
  257. }};
  258. const uint8_t ed448_eddsa_message[][1023] = {{
  259. // RFC 8032 - test vector 1 - blank
  260. 0
  261. }, {
  262. // RFC 8032 - test vector 2/3 - 1 octet
  263. 0x03
  264. }, {
  265. // RFC 8032 - test vector 4 - 11 octet
  266. 0x0c,0x3e,0x54,0x40,0x74,0xec,0x63,0xb0,
  267. 0x26,0x5e,0x0c
  268. }, {
  269. // RFC 8032 - test vector 5 - 12 octet
  270. 0x64,0xa6,0x5f,0x3c,0xde,0xdc,0xdd,0x66,
  271. 0x81,0x1e,0x29,0x15
  272. }, {
  273. // RFC 8032 - test vector 1/2 - prehash - abc
  274. 0x61,0x62,0x63
  275. }, {
  276. // RFC 8032 - test vector 6 - 13 octet
  277. 0x64,0xa6,0x5f,0x3c,0xde,0xdc,0xdd,0x66,
  278. 0x81,0x1e,0x29,0x15,0xe7
  279. }, {
  280. // RFC 8032 - test vector 7 - 64 octet
  281. 0xbd,0x0f,0x6a,0x37,0x47,0xcd,0x56,0x1b,
  282. 0xdd,0xdf,0x46,0x40,0xa3,0x32,0x46,0x1a,
  283. 0x4a,0x30,0xa1,0x2a,0x43,0x4c,0xd0,0xbf,
  284. 0x40,0xd7,0x66,0xd9,0xc6,0xd4,0x58,0xe5,
  285. 0x51,0x22,0x04,0xa3,0x0c,0x17,0xd1,0xf5,
  286. 0x0b,0x50,0x79,0x63,0x1f,0x64,0xeb,0x31,
  287. 0x12,0x18,0x2d,0xa3,0x00,0x58,0x35,0x46,
  288. 0x11,0x13,0x71,0x8d,0x1a,0x5e,0xf9,0x44
  289. }, {
  290. // RFC 8032 - test vector 8 - 256 octet
  291. 0x15,0x77,0x75,0x32,0xb0,0xbd,0xd0,0xd1,
  292. 0x38,0x9f,0x63,0x6c,0x5f,0x6b,0x9b,0xa7,
  293. 0x34,0xc9,0x0a,0xf5,0x72,0x87,0x7e,0x2d,
  294. 0x27,0x2d,0xd0,0x78,0xaa,0x1e,0x56,0x7c,
  295. 0xfa,0x80,0xe1,0x29,0x28,0xbb,0x54,0x23,
  296. 0x30,0xe8,0x40,0x9f,0x31,0x74,0x50,0x41,
  297. 0x07,0xec,0xd5,0xef,0xac,0x61,0xae,0x75,
  298. 0x04,0xda,0xbe,0x2a,0x60,0x2e,0xde,0x89,
  299. 0xe5,0xcc,0xa6,0x25,0x7a,0x7c,0x77,0xe2,
  300. 0x7a,0x70,0x2b,0x3a,0xe3,0x9f,0xc7,0x69,
  301. 0xfc,0x54,0xf2,0x39,0x5a,0xe6,0xa1,0x17,
  302. 0x8c,0xab,0x47,0x38,0xe5,0x43,0x07,0x2f,
  303. 0xc1,0xc1,0x77,0xfe,0x71,0xe9,0x2e,0x25,
  304. 0xbf,0x03,0xe4,0xec,0xb7,0x2f,0x47,0xb6,
  305. 0x4d,0x04,0x65,0xaa,0xea,0x4c,0x7f,0xad,
  306. 0x37,0x25,0x36,0xc8,0xba,0x51,0x6a,0x60,
  307. 0x39,0xc3,0xc2,0xa3,0x9f,0x0e,0x4d,0x83,
  308. 0x2b,0xe4,0x32,0xdf,0xa9,0xa7,0x06,0xa6,
  309. 0xe5,0xc7,0xe1,0x9f,0x39,0x79,0x64,0xca,
  310. 0x42,0x58,0x00,0x2f,0x7c,0x05,0x41,0xb5,
  311. 0x90,0x31,0x6d,0xbc,0x56,0x22,0xb6,0xb2,
  312. 0xa6,0xfe,0x7a,0x4a,0xbf,0xfd,0x96,0x10,
  313. 0x5e,0xca,0x76,0xea,0x7b,0x98,0x81,0x6a,
  314. 0xf0,0x74,0x8c,0x10,0xdf,0x04,0x8c,0xe0,
  315. 0x12,0xd9,0x01,0x01,0x5a,0x51,0xf1,0x89,
  316. 0xf3,0x88,0x81,0x45,0xc0,0x36,0x50,0xaa,
  317. 0x23,0xce,0x89,0x4c,0x3b,0xd8,0x89,0xe0,
  318. 0x30,0xd5,0x65,0x07,0x1c,0x59,0xf4,0x09,
  319. 0xa9,0x98,0x1b,0x51,0x87,0x8f,0xd6,0xfc,
  320. 0x11,0x06,0x24,0xdc,0xbc,0xde,0x0b,0xf7,
  321. 0xa6,0x9c,0xcc,0xe3,0x8f,0xab,0xdf,0x86,
  322. 0xf3,0xbe,0xf6,0x04,0x48,0x19,0xde,0x11
  323. }, {
  324. // RFC 8032 - test vector 9 - 1023 octet
  325. 0x6d,0xdf,0x80,0x2e,0x1a,0xae,0x49,0x86,
  326. 0x93,0x5f,0x7f,0x98,0x1b,0xa3,0xf0,0x35,
  327. 0x1d,0x62,0x73,0xc0,0xa0,0xc2,0x2c,0x9c,
  328. 0x0e,0x83,0x39,0x16,0x8e,0x67,0x54,0x12,
  329. 0xa3,0xde,0xbf,0xaf,0x43,0x5e,0xd6,0x51,
  330. 0x55,0x80,0x07,0xdb,0x43,0x84,0xb6,0x50,
  331. 0xfc,0xc0,0x7e,0x3b,0x58,0x6a,0x27,0xa4,
  332. 0xf7,0xa0,0x0a,0xc8,0xa6,0xfe,0xc2,0xcd,
  333. 0x86,0xae,0x4b,0xf1,0x57,0x0c,0x41,0xe6,
  334. 0xa4,0x0c,0x93,0x1d,0xb2,0x7b,0x2f,0xaa,
  335. 0x15,0xa8,0xce,0xdd,0x52,0xcf,0xf7,0x36,
  336. 0x2c,0x4e,0x6e,0x23,0xda,0xec,0x0f,0xbc,
  337. 0x3a,0x79,0xb6,0x80,0x6e,0x31,0x6e,0xfc,
  338. 0xc7,0xb6,0x81,0x19,0xbf,0x46,0xbc,0x76,
  339. 0xa2,0x60,0x67,0xa5,0x3f,0x29,0x6d,0xaf,
  340. 0xdb,0xdc,0x11,0xc7,0x7f,0x77,0x77,0xe9,
  341. 0x72,0x66,0x0c,0xf4,0xb6,0xa9,0xb3,0x69,
  342. 0xa6,0x66,0x5f,0x02,0xe0,0xcc,0x9b,0x6e,
  343. 0xdf,0xad,0x13,0x6b,0x4f,0xab,0xe7,0x23,
  344. 0xd2,0x81,0x3d,0xb3,0x13,0x6c,0xfd,0xe9,
  345. 0xb6,0xd0,0x44,0x32,0x2f,0xee,0x29,0x47,
  346. 0x95,0x2e,0x03,0x1b,0x73,0xab,0x5c,0x60,
  347. 0x33,0x49,0xb3,0x07,0xbd,0xc2,0x7b,0xc6,
  348. 0xcb,0x8b,0x8b,0xbd,0x7b,0xd3,0x23,0x21,
  349. 0x9b,0x80,0x33,0xa5,0x81,0xb5,0x9e,0xad,
  350. 0xeb,0xb0,0x9b,0x3c,0x4f,0x3d,0x22,0x77,
  351. 0xd4,0xf0,0x34,0x36,0x24,0xac,0xc8,0x17,
  352. 0x80,0x47,0x28,0xb2,0x5a,0xb7,0x97,0x17,
  353. 0x2b,0x4c,0x5c,0x21,0xa2,0x2f,0x9c,0x78,
  354. 0x39,0xd6,0x43,0x00,0x23,0x2e,0xb6,0x6e,
  355. 0x53,0xf3,0x1c,0x72,0x3f,0xa3,0x7f,0xe3,
  356. 0x87,0xc7,0xd3,0xe5,0x0b,0xdf,0x98,0x13,
  357. 0xa3,0x0e,0x5b,0xb1,0x2c,0xf4,0xcd,0x93,
  358. 0x0c,0x40,0xcf,0xb4,0xe1,0xfc,0x62,0x25,
  359. 0x92,0xa4,0x95,0x88,0x79,0x44,0x94,0xd5,
  360. 0x6d,0x24,0xea,0x4b,0x40,0xc8,0x9f,0xc0,
  361. 0x59,0x6c,0xc9,0xeb,0xb9,0x61,0xc8,0xcb,
  362. 0x10,0xad,0xde,0x97,0x6a,0x5d,0x60,0x2b,
  363. 0x1c,0x3f,0x85,0xb9,0xb9,0xa0,0x01,0xed,
  364. 0x3c,0x6a,0x4d,0x3b,0x14,0x37,0xf5,0x20,
  365. 0x96,0xcd,0x19,0x56,0xd0,0x42,0xa5,0x97,
  366. 0xd5,0x61,0xa5,0x96,0xec,0xd3,0xd1,0x73,
  367. 0x5a,0x8d,0x57,0x0e,0xa0,0xec,0x27,0x22,
  368. 0x5a,0x2c,0x4a,0xaf,0xf2,0x63,0x06,0xd1,
  369. 0x52,0x6c,0x1a,0xf3,0xca,0x6d,0x9c,0xf5,
  370. 0xa2,0xc9,0x8f,0x47,0xe1,0xc4,0x6d,0xb9,
  371. 0xa3,0x32,0x34,0xcf,0xd4,0xd8,0x1f,0x2c,
  372. 0x98,0x53,0x8a,0x09,0xeb,0xe7,0x69,0x98,
  373. 0xd0,0xd8,0xfd,0x25,0x99,0x7c,0x7d,0x25,
  374. 0x5c,0x6d,0x66,0xec,0xe6,0xfa,0x56,0xf1,
  375. 0x11,0x44,0x95,0x0f,0x02,0x77,0x95,0xe6,
  376. 0x53,0x00,0x8f,0x4b,0xd7,0xca,0x2d,0xee,
  377. 0x85,0xd8,0xe9,0x0f,0x3d,0xc3,0x15,0x13,
  378. 0x0c,0xe2,0xa0,0x03,0x75,0xa3,0x18,0xc7,
  379. 0xc3,0xd9,0x7b,0xe2,0xc8,0xce,0x5b,0x6d,
  380. 0xb4,0x1a,0x62,0x54,0xff,0x26,0x4f,0xa6,
  381. 0x15,0x5b,0xae,0xe3,0xb0,0x77,0x3c,0x0f,
  382. 0x49,0x7c,0x57,0x3f,0x19,0xbb,0x4f,0x42,
  383. 0x40,0x28,0x1f,0x0b,0x1f,0x4f,0x7b,0xe8,
  384. 0x57,0xa4,0xe5,0x9d,0x41,0x6c,0x06,0xb4,
  385. 0xc5,0x0f,0xa0,0x9e,0x18,0x10,0xdd,0xc6,
  386. 0xb1,0x46,0x7b,0xae,0xac,0x5a,0x36,0x68,
  387. 0xd1,0x1b,0x6e,0xca,0xa9,0x01,0x44,0x00,
  388. 0x16,0xf3,0x89,0xf8,0x0a,0xcc,0x4d,0xb9,
  389. 0x77,0x02,0x5e,0x7f,0x59,0x24,0x38,0x8c,
  390. 0x7e,0x34,0x0a,0x73,0x2e,0x55,0x44,0x40,
  391. 0xe7,0x65,0x70,0xf8,0xdd,0x71,0xb7,0xd6,
  392. 0x40,0xb3,0x45,0x0d,0x1f,0xd5,0xf0,0x41,
  393. 0x0a,0x18,0xf9,0xa3,0x49,0x4f,0x70,0x7c,
  394. 0x71,0x7b,0x79,0xb4,0xbf,0x75,0xc9,0x84,
  395. 0x00,0xb0,0x96,0xb2,0x16,0x53,0xb5,0xd2,
  396. 0x17,0xcf,0x35,0x65,0xc9,0x59,0x74,0x56,
  397. 0xf7,0x07,0x03,0x49,0x7a,0x07,0x87,0x63,
  398. 0x82,0x9b,0xc0,0x1b,0xb1,0xcb,0xc8,0xfa,
  399. 0x04,0xea,0xdc,0x9a,0x6e,0x3f,0x66,0x99,
  400. 0x58,0x7a,0x9e,0x75,0xc9,0x4e,0x5b,0xab,
  401. 0x00,0x36,0xe0,0xb2,0xe7,0x11,0x39,0x2c,
  402. 0xff,0x00,0x47,0xd0,0xd6,0xb0,0x5b,0xd2,
  403. 0xa5,0x88,0xbc,0x10,0x97,0x18,0x95,0x42,
  404. 0x59,0xf1,0xd8,0x66,0x78,0xa5,0x79,0xa3,
  405. 0x12,0x0f,0x19,0xcf,0xb2,0x96,0x3f,0x17,
  406. 0x7a,0xeb,0x70,0xf2,0xd4,0x84,0x48,0x26,
  407. 0x26,0x2e,0x51,0xb8,0x02,0x71,0x27,0x20,
  408. 0x68,0xef,0x5b,0x38,0x56,0xfa,0x85,0x35,
  409. 0xaa,0x2a,0x88,0xb2,0xd4,0x1f,0x2a,0x0e,
  410. 0x2f,0xda,0x76,0x24,0xc2,0x85,0x02,0x72,
  411. 0xac,0x4a,0x2f,0x56,0x1f,0x8f,0x2f,0x7a,
  412. 0x31,0x8b,0xfd,0x5c,0xaf,0x96,0x96,0x14,
  413. 0x9e,0x4a,0xc8,0x24,0xad,0x34,0x60,0x53,
  414. 0x8f,0xdc,0x25,0x42,0x1b,0xee,0xc2,0xcc,
  415. 0x68,0x18,0x16,0x2d,0x06,0xbb,0xed,0x0c,
  416. 0x40,0xa3,0x87,0x19,0x23,0x49,0xdb,0x67,
  417. 0xa1,0x18,0xba,0xda,0x6c,0xd5,0xab,0x01,
  418. 0x40,0xee,0x27,0x32,0x04,0xf6,0x28,0xaa,
  419. 0xd1,0xc1,0x35,0xf7,0x70,0x27,0x9a,0x65,
  420. 0x1e,0x24,0xd8,0xc1,0x4d,0x75,0xa6,0x05,
  421. 0x9d,0x76,0xb9,0x6a,0x6f,0xd8,0x57,0xde,
  422. 0xf5,0xe0,0xb3,0x54,0xb2,0x7a,0xb9,0x37,
  423. 0xa5,0x81,0x5d,0x16,0xb5,0xfa,0xe4,0x07,
  424. 0xff,0x18,0x22,0x2c,0x6d,0x1e,0xd2,0x63,
  425. 0xbe,0x68,0xc9,0x5f,0x32,0xd9,0x08,0xbd,
  426. 0x89,0x5c,0xd7,0x62,0x07,0xae,0x72,0x64,
  427. 0x87,0x56,0x7f,0x9a,0x67,0xda,0xd7,0x9a,
  428. 0xbe,0xc3,0x16,0xf6,0x83,0xb1,0x7f,0x2d,
  429. 0x02,0xbf,0x07,0xe0,0xac,0x8b,0x5b,0xc6,
  430. 0x16,0x2c,0xf9,0x46,0x97,0xb3,0xc2,0x7c,
  431. 0xd1,0xfe,0xa4,0x9b,0x27,0xf2,0x3b,0xa2,
  432. 0x90,0x18,0x71,0x96,0x25,0x06,0x52,0x0c,
  433. 0x39,0x2d,0xa8,0xb6,0xad,0x0d,0x99,0xf7,
  434. 0x01,0x3f,0xbc,0x06,0xc2,0xc1,0x7a,0x56,
  435. 0x95,0x00,0xc8,0xa7,0x69,0x64,0x81,0xc1,
  436. 0xcd,0x33,0xe9,0xb1,0x4e,0x40,0xb8,0x2e,
  437. 0x79,0xa5,0xf5,0xdb,0x82,0x57,0x1b,0xa9,
  438. 0x7b,0xae,0x3a,0xd3,0xe0,0x47,0x95,0x15,
  439. 0xbb,0x0e,0x2b,0x0f,0x3b,0xfc,0xd1,0xfd,
  440. 0x33,0x03,0x4e,0xfc,0x62,0x45,0xed,0xdd,
  441. 0x7e,0xe2,0x08,0x6d,0xda,0xe2,0x60,0x0d,
  442. 0x8c,0xa7,0x3e,0x21,0x4e,0x8c,0x2b,0x0b,
  443. 0xdb,0x2b,0x04,0x7c,0x6a,0x46,0x4a,0x56,
  444. 0x2e,0xd7,0x7b,0x73,0xd2,0xd8,0x41,0xc4,
  445. 0xb3,0x49,0x73,0x55,0x12,0x57,0x71,0x3b,
  446. 0x75,0x36,0x32,0xef,0xba,0x34,0x81,0x69,
  447. 0xab,0xc9,0x0a,0x68,0xf4,0x26,0x11,0xa4,
  448. 0x01,0x26,0xd7,0xcb,0x21,0xb5,0x86,0x95,
  449. 0x56,0x81,0x86,0xf7,0xe5,0x69,0xd2,0xff,
  450. 0x0f,0x9e,0x74,0x5d,0x04,0x87,0xdd,0x2e,
  451. 0xb9,0x97,0xca,0xfc,0x5a,0xbf,0x9d,0xd1,
  452. 0x02,0xe6,0x2f,0xf6,0x6c,0xba,0x87
  453. }};
  454. template<> const bool Tests<Ed448Goldilocks>::eddsa_prehashed[] = {
  455. false,
  456. false,
  457. false,
  458. false,
  459. false,
  460. true,
  461. true,
  462. false,
  463. false,
  464. false,
  465. false
  466. };
  467. const uint8_t ed448_eddsa_context[][3] = {{
  468. 0x66,0x6f,0x6f
  469. }};
  470. const uint8_t ed448_eddsa_sig[][114] = {{
  471. // RFC 8032 - test vector 1 - blank
  472. 0x53,0x3a,0x37,0xf6,0xbb,0xe4,0x57,0x25,
  473. 0x1f,0x02,0x3c,0x0d,0x88,0xf9,0x76,0xae,
  474. 0x2d,0xfb,0x50,0x4a,0x84,0x3e,0x34,0xd2,
  475. 0x07,0x4f,0xd8,0x23,0xd4,0x1a,0x59,0x1f,
  476. 0x2b,0x23,0x3f,0x03,0x4f,0x62,0x82,0x81,
  477. 0xf2,0xfd,0x7a,0x22,0xdd,0xd4,0x7d,0x78,
  478. 0x28,0xc5,0x9b,0xd0,0xa2,0x1b,0xfd,0x39,
  479. 0x80,0xff,0x0d,0x20,0x28,0xd4,0xb1,0x8a,
  480. 0x9d,0xf6,0x3e,0x00,0x6c,0x5d,0x1c,0x2d,
  481. 0x34,0x5b,0x92,0x5d,0x8d,0xc0,0x0b,0x41,
  482. 0x04,0x85,0x2d,0xb9,0x9a,0xc5,0xc7,0xcd,
  483. 0xda,0x85,0x30,0xa1,0x13,0xa0,0xf4,0xdb,
  484. 0xb6,0x11,0x49,0xf0,0x5a,0x73,0x63,0x26,
  485. 0x8c,0x71,0xd9,0x58,0x08,0xff,0x2e,0x65,
  486. 0x26,0x00
  487. }, {
  488. // RFC 8032 - test vector 2 - 1 octet
  489. 0x26,0xb8,0xf9,0x17,0x27,0xbd,0x62,0x89,
  490. 0x7a,0xf1,0x5e,0x41,0xeb,0x43,0xc3,0x77,
  491. 0xef,0xb9,0xc6,0x10,0xd4,0x8f,0x23,0x35,
  492. 0xcb,0x0b,0xd0,0x08,0x78,0x10,0xf4,0x35,
  493. 0x25,0x41,0xb1,0x43,0xc4,0xb9,0x81,0xb7,
  494. 0xe1,0x8f,0x62,0xde,0x8c,0xcd,0xf6,0x33,
  495. 0xfc,0x1b,0xf0,0x37,0xab,0x7c,0xd7,0x79,
  496. 0x80,0x5e,0x0d,0xbc,0xc0,0xaa,0xe1,0xcb,
  497. 0xce,0xe1,0xaf,0xb2,0xe0,0x27,0xdf,0x36,
  498. 0xbc,0x04,0xdc,0xec,0xbf,0x15,0x43,0x36,
  499. 0xc1,0x9f,0x0a,0xf7,0xe0,0xa6,0x47,0x29,
  500. 0x05,0xe7,0x99,0xf1,0x95,0x3d,0x2a,0x0f,
  501. 0xf3,0x34,0x8a,0xb2,0x1a,0xa4,0xad,0xaf,
  502. 0xd1,0xd2,0x34,0x44,0x1c,0xf8,0x07,0xc0,
  503. 0x3a,0x00
  504. }, {
  505. // RFC 8032 - test vector 4 - 11 octet
  506. 0x1f,0x0a,0x88,0x88,0xce,0x25,0xe8,0xd4,
  507. 0x58,0xa2,0x11,0x30,0x87,0x9b,0x84,0x0a,
  508. 0x90,0x89,0xd9,0x99,0xaa,0xba,0x03,0x9e,
  509. 0xaf,0x3e,0x3a,0xfa,0x09,0x0a,0x09,0xd3,
  510. 0x89,0xdb,0xa8,0x2c,0x4f,0xf2,0xae,0x8a,
  511. 0xc5,0xcd,0xfb,0x7c,0x55,0xe9,0x4d,0x5d,
  512. 0x96,0x1a,0x29,0xfe,0x01,0x09,0x94,0x1e,
  513. 0x00,0xb8,0xdb,0xde,0xea,0x6d,0x3b,0x05,
  514. 0x10,0x68,0xdf,0x72,0x54,0xc0,0xcd,0xc1,
  515. 0x29,0xcb,0xe6,0x2d,0xb2,0xdc,0x95,0x7d,
  516. 0xbb,0x47,0xb5,0x1f,0xd3,0xf2,0x13,0xfb,
  517. 0x86,0x98,0xf0,0x64,0x77,0x42,0x50,0xa5,
  518. 0x02,0x89,0x61,0xc9,0xbf,0x8f,0xfd,0x97,
  519. 0x3f,0xe5,0xd5,0xc2,0x06,0x49,0x2b,0x14,
  520. 0x0e,0x00
  521. }, {
  522. // RFC 8032 - test vector 5 - 12 octet
  523. 0x7e,0xee,0xab,0x7c,0x4e,0x50,0xfb,0x79,
  524. 0x9b,0x41,0x8e,0xe5,0xe3,0x19,0x7f,0xf6,
  525. 0xbf,0x15,0xd4,0x3a,0x14,0xc3,0x43,0x89,
  526. 0xb5,0x9d,0xd1,0xa7,0xb1,0xb8,0x5b,0x4a,
  527. 0xe9,0x04,0x38,0xac,0xa6,0x34,0xbe,0xa4,
  528. 0x5e,0x3a,0x26,0x95,0xf1,0x27,0x0f,0x07,
  529. 0xfd,0xcd,0xf7,0xc6,0x2b,0x8e,0xfe,0xaf,
  530. 0x00,0xb4,0x5c,0x2c,0x96,0xba,0x45,0x7e,
  531. 0xb1,0xa8,0xbf,0x07,0x5a,0x3d,0xb2,0x8e,
  532. 0x5c,0x24,0xf6,0xb9,0x23,0xed,0x4a,0xd7,
  533. 0x47,0xc3,0xc9,0xe0,0x3c,0x70,0x79,0xef,
  534. 0xb8,0x7c,0xb1,0x10,0xd3,0xa9,0x98,0x61,
  535. 0xe7,0x20,0x03,0xcb,0xae,0x6d,0x6b,0x8b,
  536. 0x82,0x7e,0x4e,0x6c,0x14,0x30,0x64,0xff,
  537. 0x3c,0x00
  538. }, {
  539. // RFC 8032 - test vector 3 - 1 octet - context
  540. 0xd4,0xf8,0xf6,0x13,0x17,0x70,0xdd,0x46,
  541. 0xf4,0x08,0x67,0xd6,0xfd,0x5d,0x50,0x55,
  542. 0xde,0x43,0x54,0x1f,0x8c,0x5e,0x35,0xab,
  543. 0xbc,0xd0,0x01,0xb3,0x2a,0x89,0xf7,0xd2,
  544. 0x15,0x1f,0x76,0x47,0xf1,0x1d,0x8c,0xa2,
  545. 0xae,0x27,0x9f,0xb8,0x42,0xd6,0x07,0x21,
  546. 0x7f,0xce,0x6e,0x04,0x2f,0x68,0x15,0xea,
  547. 0x00,0x0c,0x85,0x74,0x1d,0xe5,0xc8,0xda,
  548. 0x11,0x44,0xa6,0xa1,0xab,0xa7,0xf9,0x6d,
  549. 0xe4,0x25,0x05,0xd7,0xa7,0x29,0x85,0x24,
  550. 0xfd,0xa5,0x38,0xfc,0xcb,0xbb,0x75,0x4f,
  551. 0x57,0x8c,0x1c,0xad,0x10,0xd5,0x4d,0x0d,
  552. 0x54,0x28,0x40,0x7e,0x85,0xdc,0xbc,0x98,
  553. 0xa4,0x91,0x55,0xc1,0x37,0x64,0xe6,0x6c,
  554. 0x3c,0x00
  555. }, {
  556. // RFC 8032 - test vector 1 - prehash - abc
  557. 0x82,0x2f,0x69,0x01,0xf7,0x48,0x0f,0x3d,
  558. 0x5f,0x56,0x2c,0x59,0x29,0x94,0xd9,0x69,
  559. 0x36,0x02,0x87,0x56,0x14,0x48,0x32,0x56,
  560. 0x50,0x56,0x00,0xbb,0xc2,0x81,0xae,0x38,
  561. 0x1f,0x54,0xd6,0xbc,0xe2,0xea,0x91,0x15,
  562. 0x74,0x93,0x2f,0x52,0xa4,0xe6,0xca,0xdd,
  563. 0x78,0x76,0x93,0x75,0xec,0x3f,0xfd,0x1b,
  564. 0x80,0x1a,0x0d,0x9b,0x3f,0x40,0x30,0xcd,
  565. 0x43,0x39,0x64,0xb6,0x45,0x7e,0xa3,0x94,
  566. 0x76,0x51,0x12,0x14,0xf9,0x74,0x69,0xb5,
  567. 0x7d,0xd3,0x2d,0xbc,0x56,0x0a,0x9a,0x94,
  568. 0xd0,0x0b,0xff,0x07,0x62,0x04,0x64,0xa3,
  569. 0xad,0x20,0x3d,0xf7,0xdc,0x7c,0xe3,0x60,
  570. 0xc3,0xcd,0x36,0x96,0xd9,0xd9,0xfa,0xb9,
  571. 0x0f,0x00
  572. }, {
  573. // RFC 8032 - test vector 2 - prehash - abc - context
  574. 0xc3,0x22,0x99,0xd4,0x6e,0xc8,0xff,0x02,
  575. 0xb5,0x45,0x40,0x98,0x28,0x14,0xdc,0xe9,
  576. 0xa0,0x58,0x12,0xf8,0x19,0x62,0xb6,0x49,
  577. 0xd5,0x28,0x09,0x59,0x16,0xa2,0xaa,0x48,
  578. 0x10,0x65,0xb1,0x58,0x04,0x23,0xef,0x92,
  579. 0x7e,0xcf,0x0a,0xf5,0x88,0x8f,0x90,0xda,
  580. 0x0f,0x6a,0x9a,0x85,0xad,0x5d,0xc3,0xf2,
  581. 0x80,0xd9,0x12,0x24,0xba,0x99,0x11,0xa3,
  582. 0x65,0x3d,0x00,0xe4,0x84,0xe2,0xce,0x23,
  583. 0x25,0x21,0x48,0x1c,0x86,0x58,0xdf,0x30,
  584. 0x4b,0xb7,0x74,0x5a,0x73,0x51,0x4c,0xdb,
  585. 0x9b,0xf3,0xe1,0x57,0x84,0xab,0x71,0x28,
  586. 0x4f,0x8d,0x07,0x04,0xa6,0x08,0xc5,0x4a,
  587. 0x6b,0x62,0xd9,0x7b,0xeb,0x51,0x1d,0x13,
  588. 0x21,0x00
  589. }, {
  590. // RFC 8032 - test vector 6 - 13 octet
  591. 0x6a,0x12,0x06,0x6f,0x55,0x33,0x1b,0x6c,
  592. 0x22,0xac,0xd5,0xd5,0xbf,0xc5,0xd7,0x12,
  593. 0x28,0xfb,0xda,0x80,0xae,0x8d,0xec,0x26,
  594. 0xbd,0xd3,0x06,0x74,0x3c,0x50,0x27,0xcb,
  595. 0x48,0x90,0x81,0x0c,0x16,0x2c,0x02,0x74,
  596. 0x68,0x67,0x5e,0xcf,0x64,0x5a,0x83,0x17,
  597. 0x6c,0x0d,0x73,0x23,0xa2,0xcc,0xde,0x2d,
  598. 0x80,0xef,0xe5,0xa1,0x26,0x8e,0x8a,0xca,
  599. 0x1d,0x6f,0xbc,0x19,0x4d,0x3f,0x77,0xc4,
  600. 0x49,0x86,0xeb,0x4a,0xb4,0x17,0x79,0x19,
  601. 0xad,0x8b,0xec,0x33,0xeb,0x47,0xbb,0xb5,
  602. 0xfc,0x6e,0x28,0x19,0x6f,0xd1,0xca,0xf5,
  603. 0x6b,0x4e,0x7e,0x0b,0xa5,0x51,0x92,0x34,
  604. 0xd0,0x47,0x15,0x5a,0xc7,0x27,0xa1,0x05,
  605. 0x31,0x00
  606. }, {
  607. // RFC 8032 - test vector 7 - 64 octet
  608. 0x55,0x4b,0xc2,0x48,0x08,0x60,0xb4,0x9e,
  609. 0xab,0x85,0x32,0xd2,0xa5,0x33,0xb7,0xd5,
  610. 0x78,0xef,0x47,0x3e,0xeb,0x58,0xc9,0x8b,
  611. 0xb2,0xd0,0xe1,0xce,0x48,0x8a,0x98,0xb1,
  612. 0x8d,0xfd,0xe9,0xb9,0xb9,0x07,0x75,0xe6,
  613. 0x7f,0x47,0xd4,0xa1,0xc3,0x48,0x20,0x58,
  614. 0xef,0xc9,0xf4,0x0d,0x2c,0xa0,0x33,0xa0,
  615. 0x80,0x1b,0x63,0xd4,0x5b,0x3b,0x72,0x2e,
  616. 0xf5,0x52,0xba,0xd3,0xb4,0xcc,0xb6,0x67,
  617. 0xda,0x35,0x01,0x92,0xb6,0x1c,0x50,0x8c,
  618. 0xf7,0xb6,0xb5,0xad,0xad,0xc2,0xc8,0xd9,
  619. 0xa4,0x46,0xef,0x00,0x3f,0xb0,0x5c,0xba,
  620. 0x5f,0x30,0xe8,0x8e,0x36,0xec,0x27,0x03,
  621. 0xb3,0x49,0xca,0x22,0x9c,0x26,0x70,0x83,
  622. 0x39,0x00
  623. }, {
  624. // RFC 8032 - test vector 8 - 256 octet
  625. 0xc6,0x50,0xdd,0xbb,0x06,0x01,0xc1,0x9c,
  626. 0xa1,0x14,0x39,0xe1,0x64,0x0d,0xd9,0x31,
  627. 0xf4,0x3c,0x51,0x8e,0xa5,0xbe,0xa7,0x0d,
  628. 0x3d,0xcd,0xe5,0xf4,0x19,0x1f,0xe5,0x3f,
  629. 0x00,0xcf,0x96,0x65,0x46,0xb7,0x2b,0xcc,
  630. 0x7d,0x58,0xbe,0x2b,0x9b,0xad,0xef,0x28,
  631. 0x74,0x39,0x54,0xe3,0xa4,0x4a,0x23,0xf8,
  632. 0x80,0xe8,0xd4,0xf1,0xcf,0xce,0x2d,0x7a,
  633. 0x61,0x45,0x2d,0x26,0xda,0x05,0x89,0x6f,
  634. 0x0a,0x50,0xda,0x66,0xa2,0x39,0xa8,0xa1,
  635. 0x88,0xb6,0xd8,0x25,0xb3,0x30,0x5a,0xd7,
  636. 0x7b,0x73,0xfb,0xac,0x08,0x36,0xec,0xc6,
  637. 0x09,0x87,0xfd,0x08,0x52,0x7c,0x1a,0x8e,
  638. 0x80,0xd5,0x82,0x3e,0x65,0xca,0xfe,0x2a,
  639. 0x3d,0x00
  640. }, {
  641. // RFC 8032 - test vector 9 - 1023 octet
  642. 0xe3,0x01,0x34,0x5a,0x41,0xa3,0x9a,0x4d,
  643. 0x72,0xff,0xf8,0xdf,0x69,0xc9,0x80,0x75,
  644. 0xa0,0xcc,0x08,0x2b,0x80,0x2f,0xc9,0xb2,
  645. 0xb6,0xbc,0x50,0x3f,0x92,0x6b,0x65,0xbd,
  646. 0xdf,0x7f,0x4c,0x8f,0x1c,0xb4,0x9f,0x63,
  647. 0x96,0xaf,0xc8,0xa7,0x0a,0xbe,0x6d,0x8a,
  648. 0xef,0x0d,0xb4,0x78,0xd4,0xc6,0xb2,0x97,
  649. 0x00,0x76,0xc6,0xa0,0x48,0x4f,0xe7,0x6d,
  650. 0x76,0xb3,0xa9,0x76,0x25,0xd7,0x9f,0x1c,
  651. 0xe2,0x40,0xe7,0xc5,0x76,0x75,0x0d,0x29,
  652. 0x55,0x28,0x28,0x6f,0x71,0x9b,0x41,0x3d,
  653. 0xe9,0xad,0xa3,0xe8,0xeb,0x78,0xed,0x57,
  654. 0x36,0x03,0xce,0x30,0xd8,0xbb,0x76,0x17,
  655. 0x85,0xdc,0x30,0xdb,0xc3,0x20,0x86,0x9e,
  656. 0x1a,0x00
  657. }};
  658. template<> const Block Tests<Ed448Goldilocks>::eddsa_sk[] = {
  659. // RFC 8032 - test vector 1 - blank
  660. Block(ed448_eddsa_sk[0],57),
  661. // RFC 8032 - test vector 2/3 - 1 octet
  662. Block(ed448_eddsa_sk[1],57),
  663. // RFC 8032 - test vector 2/3 - 1 octet
  664. Block(ed448_eddsa_sk[1],57),
  665. // RFC 8032 - test vector 4 - 11 octet
  666. Block(ed448_eddsa_sk[2],57),
  667. // RFC 8032 - test vector 5 - 12 octet
  668. Block(ed448_eddsa_sk[3],57),
  669. // RFC 8032 - test vector 1 - prehash - blank
  670. Block(ed448_eddsa_sk[4],57),
  671. // RFC 8032 - test vector 1 - prehash - blank
  672. Block(ed448_eddsa_sk[4],57),
  673. // RFC 8032 - test vector 6 - 13 octet
  674. Block(ed448_eddsa_sk[5],57),
  675. // RFC 8032 - test vector 7 - 64 octet
  676. Block(ed448_eddsa_sk[6],57),
  677. // RFC 8032 - test vector 8 - 256 octet
  678. Block(ed448_eddsa_sk[7],57),
  679. // RFC 8032 - test vector 9 - 1023 octet
  680. Block(ed448_eddsa_sk[8],57)
  681. };
  682. template<> const Block Tests<Ed448Goldilocks>::eddsa_pk[] = {
  683. // RFC 8032 - test vector 1 - blank
  684. Block(ed448_eddsa_pk[0],57),
  685. // RFC 8032 - test vector 2/3 - 1 octet
  686. Block(ed448_eddsa_pk[1],57),
  687. // RFC 8032 - test vector 2/3 - 1 octet
  688. Block(ed448_eddsa_pk[1],57),
  689. // RFC 8032 - test vector 4 - 11 octet
  690. Block(ed448_eddsa_pk[2],57),
  691. // RFC 8032 - test vector 5 - 12 octet
  692. Block(ed448_eddsa_pk[3],57),
  693. // RFC 8032 - test vector 1 - prehash - abc
  694. Block(ed448_eddsa_pk[4],57),
  695. // RFC 8032 - test vector 1 - prehash - abc
  696. Block(ed448_eddsa_pk[4],57),
  697. // RFC 8032 - test vector 6 - 13 octet
  698. Block(ed448_eddsa_pk[5],57),
  699. // RFC 8032 - test vector 7 - 64 octet
  700. Block(ed448_eddsa_pk[6],57),
  701. // RFC 8032 - test vector 8 - 256 octet
  702. Block(ed448_eddsa_pk[7],57),
  703. // RFC 8032 - test vector 9 - 1023 octet
  704. Block(ed448_eddsa_pk[8],57)
  705. };
  706. template<> const Block Tests<Ed448Goldilocks>::eddsa_message[] = {
  707. // RFC 8032 - test vector 1 - blank
  708. Block(ed448_eddsa_message[0],0),
  709. // RFC 8032 - test vector 2/3 - 1 octet
  710. Block(ed448_eddsa_message[1],1),
  711. // RFC 8032 - test vector 2/3 - 1 octet
  712. Block(ed448_eddsa_message[1],1),
  713. // RFC 8032 - test vector 4 - 11 octet
  714. Block(ed448_eddsa_message[2],11),
  715. // RFC 8032 - test vector 5 - 12 octet
  716. Block(ed448_eddsa_message[3],12),
  717. // RFC 8032 - test vector 1/2 - prehash - abc
  718. Block(ed448_eddsa_message[4],3),
  719. // RFC 8032 - test vector 1/2 - prehash - abc
  720. Block(ed448_eddsa_message[4],3),
  721. // RFC 8032 - test vector 6 - 13 octet
  722. Block(ed448_eddsa_message[5],13),
  723. // RFC 8032 - test vector 7 - 64 octet
  724. Block(ed448_eddsa_message[6],64),
  725. // RFC 8032 - test vector 8 - 256 octet
  726. Block(ed448_eddsa_message[7],256),
  727. // RFC 8032 - test vector 9 - 1023 octet
  728. Block(ed448_eddsa_message[8],1023)
  729. };
  730. template<> const Block Tests<Ed448Goldilocks>::eddsa_context[] = {
  731. // RFC 8032 - test vector 1 - blank
  732. Block(NULL,0),
  733. // RFC 8032 - test vector 2 - 1 octet
  734. Block(NULL,0),
  735. // RFC 8032 - test vector 3 - 1 octet
  736. Block(ed448_eddsa_context[0],3),
  737. // RFC 8032 - test vector 4 - 11 octet
  738. Block(NULL,0),
  739. // RFC 8032 - test vector 5 - 12 octet
  740. Block(NULL,0),
  741. // RFC 8032 - test vector 1 - prehash - abc
  742. Block(NULL,0),
  743. // RFC 8032 - test vector 2 - prehash - abc - context
  744. Block(ed448_eddsa_context[0],3),
  745. // RFC 8032 - test vector 6 - 13 octet
  746. Block(NULL,0),
  747. // RFC 8032 - test vector 7 - 64 octet
  748. Block(NULL,0),
  749. // RFC 8032 - test vector 8 - 256 octet
  750. Block(NULL,0),
  751. // RFC 8032 - test vector 9 - 1023 octet
  752. Block(NULL,0)
  753. };
  754. template<> const Block Tests<Ed448Goldilocks>::eddsa_sig[] = {
  755. // RFC 8032 - test vector 1 - blank
  756. Block(ed448_eddsa_sig[0],114),
  757. // RFC 8032 - test vector 2 - 1 octet
  758. Block(ed448_eddsa_sig[1],114),
  759. // RFC 8032 - test vector 3 - 1 octet - context
  760. Block(ed448_eddsa_sig[4],114),
  761. // RFC 8032 - test vector 4 - 11 octet
  762. Block(ed448_eddsa_sig[2],114),
  763. // RFC 8032 - test vector 5 - 12 octet
  764. Block(ed448_eddsa_sig[3],114),
  765. // RFC 8032 - test vector 1 - prehash - abc
  766. Block(ed448_eddsa_sig[5],114),
  767. // RFC 8032 - test vector 2 - prehash - abc - context
  768. Block(ed448_eddsa_sig[6],114),
  769. // RFC 8032 - test vector 6 - 13 octet
  770. Block(ed448_eddsa_sig[7],114),
  771. // RFC 8032 - test vector 7 - 64 octet
  772. Block(ed448_eddsa_sig[8],114),
  773. // RFC 8032 - test vector 8 - 256 octet
  774. Block(ed448_eddsa_sig[9],114),
  775. // RFC 8032 - test vector 9 - 1023 octet
  776. Block(ed448_eddsa_sig[10],114)
  777. };
  778. template<> const bool Tests<Ed448Goldilocks>::eddsa_verify_should_succeed[] = {
  779. true,
  780. true,
  781. true,
  782. true,
  783. true,
  784. true,
  785. true,
  786. true,
  787. true,
  788. true,
  789. true
  790. };
  791. const uint8_t ed25519_eddsa_sk[][32] = {{
  792. 0x9d,0x61,0xb1,0x9d,0xef,0xfd,0x5a,0x60,
  793. 0xba,0x84,0x4a,0xf4,0x92,0xec,0x2c,0xc4,
  794. 0x44,0x49,0xc5,0x69,0x7b,0x32,0x69,0x19,
  795. 0x70,0x3b,0xac,0x03,0x1c,0xae,0x7f,0x60
  796. }, {
  797. 0x4c,0xcd,0x08,0x9b,0x28,0xff,0x96,0xda,
  798. 0x9d,0xb6,0xc3,0x46,0xec,0x11,0x4e,0x0f,
  799. 0x5b,0x8a,0x31,0x9f,0x35,0xab,0xa6,0x24,
  800. 0xda,0x8c,0xf6,0xed,0x4f,0xb8,0xa6,0xfb
  801. }, {
  802. 0xc5,0xaa,0x8d,0xf4,0x3f,0x9f,0x83,0x7b,
  803. 0xed,0xb7,0x44,0x2f,0x31,0xdc,0xb7,0xb1,
  804. 0x66,0xd3,0x85,0x35,0x07,0x6f,0x09,0x4b,
  805. 0x85,0xce,0x3a,0x2e,0x0b,0x44,0x58,0xf7
  806. }, {
  807. 0x83,0x3f,0xe6,0x24,0x09,0x23,0x7b,0x9d,
  808. 0x62,0xec,0x77,0x58,0x75,0x20,0x91,0x1e,
  809. 0x9a,0x75,0x9c,0xec,0x1d,0x19,0x75,0x5b,
  810. 0x7d,0xa9,0x01,0xb9,0x6d,0xca,0x3d,0x42
  811. }, {
  812. 0x03,0x05,0x33,0x4e,0x38,0x1a,0xf7,0x8f,
  813. 0x14,0x1c,0xb6,0x66,0xf6,0x19,0x9f,0x57,
  814. 0xbc,0x34,0x95,0x33,0x5a,0x25,0x6a,0x95,
  815. 0xbd,0x2a,0x55,0xbf,0x54,0x66,0x63,0xf6
  816. }};
  817. const uint8_t ed25519_eddsa_pk[][32] = {{
  818. 0xd7,0x5a,0x98,0x01,0x82,0xb1,0x0a,0xb7,
  819. 0xd5,0x4b,0xfe,0xd3,0xc9,0x64,0x07,0x3a,
  820. 0x0e,0xe1,0x72,0xf3,0xda,0xa6,0x23,0x25,
  821. 0xaf,0x02,0x1a,0x68,0xf7,0x07,0x51,0x1a
  822. }, {
  823. 0x3d,0x40,0x17,0xc3,0xe8,0x43,0x89,0x5a,
  824. 0x92,0xb7,0x0a,0xa7,0x4d,0x1b,0x7e,0xbc,
  825. 0x9c,0x98,0x2c,0xcf,0x2e,0xc4,0x96,0x8c,
  826. 0xc0,0xcd,0x55,0xf1,0x2a,0xf4,0x66,0x0c
  827. }, {
  828. 0xfc,0x51,0xcd,0x8e,0x62,0x18,0xa1,0xa3,
  829. 0x8d,0xa4,0x7e,0xd0,0x02,0x30,0xf0,0x58,
  830. 0x08,0x16,0xed,0x13,0xba,0x33,0x03,0xac,
  831. 0x5d,0xeb,0x91,0x15,0x48,0x90,0x80,0x25
  832. }, {
  833. 0xec,0x17,0x2b,0x93,0xad,0x5e,0x56,0x3b,
  834. 0xf4,0x93,0x2c,0x70,0xe1,0x24,0x50,0x34,
  835. 0xc3,0x54,0x67,0xef,0x2e,0xfd,0x4d,0x64,
  836. 0xeb,0xf8,0x19,0x68,0x34,0x67,0xe2,0xbf
  837. }, {
  838. 0xdf,0xc9,0x42,0x5e,0x4f,0x96,0x8f,0x7f,
  839. 0x0c,0x29,0xf0,0x25,0x9c,0xf5,0xf9,0xae,
  840. 0xd6,0x85,0x1c,0x2b,0xb4,0xad,0x8b,0xfb,
  841. 0x86,0x0c,0xfe,0xe0,0xab,0x24,0x82,0x92
  842. }, {
  843. 0xc7,0x17,0x6a,0x70,0x3d,0x4d,0xd8,0x4f,
  844. 0xba,0x3c,0x0b,0x76,0x0d,0x10,0x67,0x0f,
  845. 0x2a,0x20,0x53,0xfa,0x2c,0x39,0xcc,0xc6,
  846. 0x4e,0xc7,0xfd,0x77,0x92,0xac,0x03,0xfa
  847. }, {
  848. 0xf7,0xba,0xde,0xc5,0xb8,0xab,0xea,0xf6,
  849. 0x99,0x58,0x39,0x92,0x21,0x9b,0x7b,0x22,
  850. 0x3f,0x1d,0xf3,0xfb,0xbe,0xa9,0x19,0x84,
  851. 0x4e,0x3f,0x7c,0x55,0x4a,0x43,0xdd,0x43
  852. }, {
  853. 0xcd,0xb2,0x67,0xce,0x40,0xc5,0xcd,0x45,
  854. 0x30,0x6f,0xa5,0xd2,0xf2,0x97,0x31,0x45,
  855. 0x93,0x87,0xdb,0xf9,0xeb,0x93,0x3b,0x7b,
  856. 0xd5,0xae,0xd9,0xa7,0x65,0xb8,0x8d,0x4d
  857. }, {
  858. 0x44,0x2a,0xad,0x9f,0x08,0x9a,0xd9,0xe1,
  859. 0x46,0x47,0xb1,0xef,0x90,0x99,0xa1,0xff,
  860. 0x47,0x98,0xd7,0x85,0x89,0xe6,0x6f,0x28,
  861. 0xec,0xa6,0x9c,0x11,0xf5,0x82,0xa6,0x23
  862. }};
  863. const uint8_t ed25519_eddsa_message[][32] = {{
  864. 0
  865. }, {
  866. 0x72
  867. }, {
  868. 0xaf,0x82
  869. }, {
  870. 0x61,0x62,0x63
  871. }, {
  872. 0xf7,0x26,0x93,0x6d,0x19,0xc8,0x00,0x49,
  873. 0x4e,0x3f,0xda,0xff,0x20,0xb2,0x76,0xa8
  874. }, { // https://eprint.iacr.org/2020/1244.pdf
  875. 0x8c,0x93,0x25,0x5d,0x71,0xdc,0xab,0x10,
  876. 0xe8,0xf3,0x79,0xc2,0x62,0x00,0xf3,0xc7,
  877. 0xbd,0x5f,0x09,0xd9,0xbc,0x30,0x68,0xd3,
  878. 0xef,0x4e,0xde,0xb4,0x85,0x30,0x22,0xb6
  879. }, {
  880. 0x9b,0xd9,0xf4,0x4f,0x4d,0xcc,0x75,0xbd,
  881. 0x53,0x1b,0x56,0xb2,0xcd,0x28,0x0b,0x0b,
  882. 0xb3,0x8f,0xc1,0xcd,0x6d,0x12,0x30,0xe1,
  883. 0x48,0x61,0xd8,0x61,0xde,0x09,0x2e,0x79
  884. }, {
  885. 0xae,0xbf,0x3f,0x26,0x01,0xa0,0xc8,0xc5,
  886. 0xd3,0x9c,0xc7,0xd8,0x91,0x16,0x42,0xf7,
  887. 0x40,0xb7,0x81,0x68,0x21,0x8d,0xa8,0x47,
  888. 0x17,0x72,0xb3,0x5f,0x9d,0x35,0xb9,0xab
  889. }, {
  890. 0xe4,0x7d,0x62,0xc6,0x3f,0x83,0x0d,0xc7,
  891. 0xa6,0x85,0x1a,0x0b,0x1f,0x33,0xae,0x4b,
  892. 0xb2,0xf5,0x07,0xfb,0x6c,0xff,0xec,0x40,
  893. 0x11,0xea,0xcc,0xd5,0x5b,0x53,0xf5,0x6c
  894. }, {
  895. 0x85,0xe2,0x41,0xa0,0x7d,0x14,0x8b,0x41,
  896. 0xe4,0x7d,0x62,0xc6,0x3f,0x83,0x0d,0xc7,
  897. 0xa6,0x85,0x1a,0x0b,0x1f,0x33,0xae,0x4b,
  898. 0xb2,0xf5,0x07,0xfb,0x6c,0xff,0xec,0x40
  899. }, {
  900. 0xfd,0xae,0xbc,0x42,0x9f,0x4a,0x73,0x59,
  901. 0x32,0xa1,0x60,0xda,0x13,0x01,0x08,0x0c,
  902. 0x13,0x28,0x0e,0xea,0x8b,0xc2,0x80,0xd1,
  903. 0xb3,0x92,0xc6,0xb9,0xe6,0xba,0x3a,0x5a
  904. }, {
  905. 0x84,0xb6,0x98,0xd3,0x9b,0xe1,0x26,0xff,
  906. 0x55,0xfe,0x45,0x07,0x9e,0x6c,0x8b,0xf6,
  907. 0x4a,0x0d,0x7d,0xb6,0x99,0x45,0x60,0xb4,
  908. 0xe9,0x6b,0x70,0x21,0xeb,0x39,0xc1,0xa1
  909. }};
  910. const uint8_t ed25519_eddsa_context[][3] = {{
  911. 0x66,0x6f,0x6f
  912. }, {
  913. 0x62,0x61,0x72
  914. }};
  915. const uint8_t ed25519_eddsa_sig[][64] = {{
  916. 0xe5,0x56,0x43,0x00,0xc3,0x60,0xac,0x72,
  917. 0x90,0x86,0xe2,0xcc,0x80,0x6e,0x82,0x8a,
  918. 0x84,0x87,0x7f,0x1e,0xb8,0xe5,0xd9,0x74,
  919. 0xd8,0x73,0xe0,0x65,0x22,0x49,0x01,0x55,
  920. 0x5f,0xb8,0x82,0x15,0x90,0xa3,0x3b,0xac,
  921. 0xc6,0x1e,0x39,0x70,0x1c,0xf9,0xb4,0x6b,
  922. 0xd2,0x5b,0xf5,0xf0,0x59,0x5b,0xbe,0x24,
  923. 0x65,0x51,0x41,0x43,0x8e,0x7a,0x10,0x0b
  924. } , {
  925. 0x92,0xa0,0x09,0xa9,0xf0,0xd4,0xca,0xb8,
  926. 0x72,0x0e,0x82,0x0b,0x5f,0x64,0x25,0x40,
  927. 0xa2,0xb2,0x7b,0x54,0x16,0x50,0x3f,0x8f,
  928. 0xb3,0x76,0x22,0x23,0xeb,0xdb,0x69,0xda,
  929. 0x08,0x5a,0xc1,0xe4,0x3e,0x15,0x99,0x6e,
  930. 0x45,0x8f,0x36,0x13,0xd0,0xf1,0x1d,0x8c,
  931. 0x38,0x7b,0x2e,0xae,0xb4,0x30,0x2a,0xee,
  932. 0xb0,0x0d,0x29,0x16,0x12,0xbb,0x0c,0x00
  933. }, {
  934. 0x62,0x91,0xd6,0x57,0xde,0xec,0x24,0x02,
  935. 0x48,0x27,0xe6,0x9c,0x3a,0xbe,0x01,0xa3,
  936. 0x0c,0xe5,0x48,0xa2,0x84,0x74,0x3a,0x44,
  937. 0x5e,0x36,0x80,0xd7,0xdb,0x5a,0xc3,0xac,
  938. 0x18,0xff,0x9b,0x53,0x8d,0x16,0xf2,0x90,
  939. 0xae,0x67,0xf7,0x60,0x98,0x4d,0xc6,0x59,
  940. 0x4a,0x7c,0x15,0xe9,0x71,0x6e,0xd2,0x8d,
  941. 0xc0,0x27,0xbe,0xce,0xea,0x1e,0xc4,0x0a
  942. }, {
  943. 0x98,0xa7,0x02,0x22,0xf0,0xb8,0x12,0x1a,
  944. 0xa9,0xd3,0x0f,0x81,0x3d,0x68,0x3f,0x80,
  945. 0x9e,0x46,0x2b,0x46,0x9c,0x7f,0xf8,0x76,
  946. 0x39,0x49,0x9b,0xb9,0x4e,0x6d,0xae,0x41,
  947. 0x31,0xf8,0x50,0x42,0x46,0x3c,0x2a,0x35,
  948. 0x5a,0x20,0x03,0xd0,0x62,0xad,0xf5,0xaa,
  949. 0xa1,0x0b,0x8c,0x61,0xe6,0x36,0x06,0x2a,
  950. 0xaa,0xd1,0x1c,0x2a,0x26,0x08,0x34,0x06
  951. }, {
  952. 0x55,0xa4,0xcc,0x2f,0x70,0xa5,0x4e,0x04,
  953. 0x28,0x8c,0x5f,0x4c,0xd1,0xe4,0x5a,0x7b,
  954. 0xb5,0x20,0xb3,0x62,0x92,0x91,0x18,0x76,
  955. 0xca,0xda,0x73,0x23,0x19,0x8d,0xd8,0x7a,
  956. 0x8b,0x36,0x95,0x0b,0x95,0x13,0x00,0x22,
  957. 0x90,0x7a,0x7f,0xb7,0xc4,0xe9,0xb2,0xd5,
  958. 0xf6,0xcc,0xa6,0x85,0xa5,0x87,0xb4,0xb2,
  959. 0x1f,0x4b,0x88,0x8e,0x4e,0x7e,0xdb,0x0d
  960. }, {
  961. 0xfc,0x60,0xd5,0x87,0x2f,0xc4,0x6b,0x3a,
  962. 0xa6,0x9f,0x8b,0x5b,0x43,0x51,0xd5,0x80,
  963. 0x8f,0x92,0xbc,0xc0,0x44,0x60,0x6d,0xb0,
  964. 0x97,0xab,0xab,0x6d,0xbc,0xb1,0xae,0xe3,
  965. 0x21,0x6c,0x48,0xe8,0xb3,0xb6,0x64,0x31,
  966. 0xb5,0xb1,0x86,0xd1,0xd2,0x8f,0x8e,0xe1,
  967. 0x5a,0x5c,0xa2,0xdf,0x66,0x68,0x34,0x62,
  968. 0x91,0xc2,0x04,0x3d,0x4e,0xb3,0xe9,0x0d
  969. }, {
  970. 0xc7,0x17,0x6a,0x70,0x3d,0x4d,0xd8,0x4f,
  971. 0xba,0x3c,0x0b,0x76,0x0d,0x10,0x67,0x0f,
  972. 0x2a,0x20,0x53,0xfa,0x2c,0x39,0xcc,0xc6,
  973. 0x4e,0xc7,0xfd,0x77,0x92,0xac,0x03,0x7a,
  974. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  975. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  976. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  977. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
  978. }, {
  979. 0xf7,0xba,0xde,0xc5,0xb8,0xab,0xea,0xf6,
  980. 0x99,0x58,0x39,0x92,0x21,0x9b,0x7b,0x22,
  981. 0x3f,0x1d,0xf3,0xfb,0xbe,0xa9,0x19,0x84,
  982. 0x4e,0x3f,0x7c,0x55,0x4a,0x43,0xdd,0x43,
  983. 0xa5,0xbb,0x70,0x47,0x86,0xbe,0x79,0xfc,
  984. 0x47,0x6f,0x91,0xd3,0xf3,0xf8,0x9b,0x03,
  985. 0x98,0x4d,0x80,0x68,0xdc,0xf1,0xbb,0x7d,
  986. 0xfc,0x66,0x37,0xb4,0x54,0x50,0xac,0x04
  987. }, {
  988. 0xc7,0x17,0x6a,0x70,0x3d,0x4d,0xd8,0x4f,
  989. 0xba,0x3c,0x0b,0x76,0x0d,0x10,0x67,0x0f,
  990. 0x2a,0x20,0x53,0xfa,0x2c,0x39,0xcc,0xc6,
  991. 0x4e,0xc7,0xfd,0x77,0x92,0xac,0x03,0xfa,
  992. 0x8c,0x4b,0xd4,0x5a,0xec,0xac,0xa5,0xb2,
  993. 0x4f,0xb9,0x7b,0xc1,0x0a,0xc2,0x7a,0xc8,
  994. 0x75,0x1a,0x7d,0xfe,0x1b,0xaf,0xf8,0xb9,
  995. 0x53,0xec,0x9f,0x58,0x33,0xca,0x26,0x0e
  996. }, {
  997. 0x90,0x46,0xa6,0x47,0x50,0x44,0x49,0x38,
  998. 0xde,0x19,0xf2,0x27,0xbb,0x80,0x48,0x5e,
  999. 0x92,0xb8,0x3f,0xdb,0x4b,0x65,0x06,0xc1,
  1000. 0x60,0x48,0x4c,0x01,0x6c,0xc1,0x85,0x2f,
  1001. 0x87,0x90,0x9e,0x14,0x42,0x8a,0x7a,0x1d,
  1002. 0x62,0xe9,0xf2,0x2f,0x3d,0x3a,0xd7,0x80,
  1003. 0x2d,0xb0,0x2e,0xb2,0xe6,0x88,0xb6,0xc5,
  1004. 0x2f,0xcd,0x66,0x48,0xa9,0x8b,0xd0,0x09
  1005. }, {
  1006. 0x16,0x0a,0x1c,0xb0,0xdc,0x9c,0x02,0x58,
  1007. 0xcd,0x0a,0x7d,0x23,0xe9,0x4d,0x8f,0xa8,
  1008. 0x78,0xbc,0xb1,0x92,0x5f,0x2c,0x64,0x24,
  1009. 0x6b,0x2d,0xee,0x17,0x96,0xbe,0xd5,0x12,
  1010. 0x5e,0xc6,0xbc,0x98,0x2a,0x26,0x9b,0x72,
  1011. 0x3e,0x06,0x68,0xe5,0x40,0x91,0x1a,0x9a,
  1012. 0x6a,0x58,0x92,0x1d,0x69,0x25,0xe4,0x34,
  1013. 0xab,0x10,0xaa,0x79,0x40,0x55,0x1a,0x09
  1014. }, {
  1015. 0x21,0x12,0x2a,0x84,0xe0,0xb5,0xfc,0xa4,
  1016. 0x05,0x2f,0x5b,0x12,0x35,0xc8,0x0a,0x53,
  1017. 0x78,0x78,0xb3,0x8f,0x31,0x42,0x35,0x6b,
  1018. 0x2c,0x23,0x84,0xeb,0xad,0x46,0x68,0xb7,
  1019. 0xe4,0x0b,0xc8,0x36,0xda,0xc0,0xf7,0x10,
  1020. 0x76,0xf9,0xab,0xe3,0xa5,0x3f,0x9c,0x03,
  1021. 0xc1,0xce,0xee,0xdd,0xb6,0x58,0xd0,0x03,
  1022. 0x04,0x94,0xac,0xe5,0x86,0x68,0x74,0x05
  1023. }, {
  1024. 0xe9,0x6f,0x66,0xbe,0x97,0x6d,0x82,0xe6,
  1025. 0x01,0x50,0xba,0xec,0xff,0x99,0x06,0x68,
  1026. 0x4a,0xeb,0xb1,0xef,0x18,0x1f,0x67,0xa7,
  1027. 0x18,0x9a,0xc7,0x8e,0xa2,0x3b,0x6c,0x0e,
  1028. 0x54,0x7f,0x76,0x90,0xa0,0xe2,0xdd,0xcd,
  1029. 0x04,0xd8,0x7d,0xbc,0x34,0x90,0xdc,0x19,
  1030. 0xb3,0xb3,0x05,0x2f,0x7f,0xf0,0x53,0x8c,
  1031. 0xb6,0x8a,0xfb,0x36,0x9b,0xa3,0xa5,0x14
  1032. }, {
  1033. 0x8c,0xe5,0xb9,0x6c,0x8f,0x26,0xd0,0xab,
  1034. 0x6c,0x47,0x95,0x8c,0x9e,0x68,0xb9,0x37,
  1035. 0x10,0x4c,0xd3,0x6e,0x13,0xc3,0x35,0x66,
  1036. 0xac,0xd2,0xfe,0x8d,0x38,0xaa,0x19,0x42,
  1037. 0x7e,0x71,0xf9,0x8a,0x47,0x34,0x74,0xf2,
  1038. 0xf1,0x3f,0x06,0xf9,0x7c,0x20,0xd5,0x8c,
  1039. 0xc3,0xf5,0x4b,0x8b,0xd0,0xd2,0x72,0xf4,
  1040. 0x2b,0x69,0x5d,0xd7,0xe8,0x9a,0x8c,0x22
  1041. }, {
  1042. 0xed,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
  1043. 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
  1044. 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
  1045. 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x7f,
  1046. 0x45,0x4d,0x37,0x0c,0x8d,0x9f,0xc3,0x23,
  1047. 0xa4,0x14,0x50,0xf8,0xd5,0x13,0xea,0xfe,
  1048. 0xb5,0xb0,0x69,0x73,0x90,0xc1,0xe5,0x05,
  1049. 0xa0,0xd4,0xdd,0xc7,0x1f,0x56,0x66,0x07
  1050. }, {
  1051. 0xed,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
  1052. 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
  1053. 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
  1054. 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x7f,
  1055. 0x08,0x4d,0x5b,0x99,0xc2,0xa9,0x46,0x3d,
  1056. 0x9c,0x8b,0xd5,0x02,0x69,0x16,0x99,0x69,
  1057. 0x84,0xee,0xec,0x87,0xdd,0xf1,0xd3,0xbe,
  1058. 0x32,0x90,0x06,0xac,0xe1,0xb3,0x7b,0x09
  1059. }};
  1060. template<> const bool Tests<Ristretto>::eddsa_prehashed[] = {
  1061. false,
  1062. false,
  1063. false,
  1064. true,
  1065. false,
  1066. false,
  1067. false,
  1068. false,
  1069. false,
  1070. false,
  1071. false,
  1072. false,
  1073. false,
  1074. false,
  1075. false,
  1076. false
  1077. };
  1078. template<> const Block Tests<Ristretto>::eddsa_sk[] = {
  1079. Block(ed25519_eddsa_sk[0],32),
  1080. Block(ed25519_eddsa_sk[1],32),
  1081. Block(ed25519_eddsa_sk[2],32),
  1082. Block(ed25519_eddsa_sk[3],32),
  1083. Block(ed25519_eddsa_sk[4],32),
  1084. Block(ed25519_eddsa_sk[4],32),
  1085. // https://eprint.iacr.org/2020/1244.pdf
  1086. // These tests don't have an associated private key
  1087. // In many cases the public key is malformed
  1088. Block(NULL,0),
  1089. Block(NULL,0),
  1090. Block(NULL,0),
  1091. Block(NULL,0),
  1092. Block(NULL,0),
  1093. Block(NULL,0),
  1094. Block(NULL,0),
  1095. Block(NULL,0),
  1096. Block(NULL,0),
  1097. Block(NULL,0),
  1098. };
  1099. template<> const Block Tests<Ristretto>::eddsa_pk[] = {
  1100. Block(ed25519_eddsa_pk[0],32),
  1101. Block(ed25519_eddsa_pk[1],32),
  1102. Block(ed25519_eddsa_pk[2],32),
  1103. Block(ed25519_eddsa_pk[3],32),
  1104. Block(ed25519_eddsa_pk[4],32),
  1105. Block(ed25519_eddsa_pk[4],32),
  1106. // https://eprint.iacr.org/2020/1244.pdf
  1107. Block(ed25519_eddsa_pk[5],32),
  1108. Block(ed25519_eddsa_pk[5],32),
  1109. Block(ed25519_eddsa_pk[6],32),
  1110. Block(ed25519_eddsa_pk[7],32),
  1111. Block(ed25519_eddsa_pk[7],32),
  1112. Block(ed25519_eddsa_pk[7],32),
  1113. Block(ed25519_eddsa_pk[8],32),
  1114. Block(ed25519_eddsa_pk[8],32),
  1115. Block(ed25519_eddsa_pk[6],32),
  1116. Block(ed25519_eddsa_pk[6],32)
  1117. };
  1118. template<> const Block Tests<Ristretto>::eddsa_context[] = {
  1119. EdDSA<Ristretto>::NO_CONTEXT(),
  1120. EdDSA<Ristretto>::NO_CONTEXT(),
  1121. EdDSA<Ristretto>::NO_CONTEXT(),
  1122. Block(NULL,0),
  1123. Block(ed25519_eddsa_context[0],3),
  1124. Block(ed25519_eddsa_context[1],3),
  1125. // https://eprint.iacr.org/2020/1244.pdf
  1126. EdDSA<Ristretto>::NO_CONTEXT(),
  1127. EdDSA<Ristretto>::NO_CONTEXT(),
  1128. EdDSA<Ristretto>::NO_CONTEXT(),
  1129. EdDSA<Ristretto>::NO_CONTEXT(),
  1130. EdDSA<Ristretto>::NO_CONTEXT(),
  1131. EdDSA<Ristretto>::NO_CONTEXT(),
  1132. EdDSA<Ristretto>::NO_CONTEXT(),
  1133. EdDSA<Ristretto>::NO_CONTEXT(),
  1134. EdDSA<Ristretto>::NO_CONTEXT(),
  1135. EdDSA<Ristretto>::NO_CONTEXT()
  1136. };
  1137. template<> const Block Tests<Ristretto>::eddsa_message[] = {
  1138. Block(ed25519_eddsa_message[0],0),
  1139. Block(ed25519_eddsa_message[1],1),
  1140. Block(ed25519_eddsa_message[2],2),
  1141. Block(ed25519_eddsa_message[3],3),
  1142. Block(ed25519_eddsa_message[4],16),
  1143. Block(ed25519_eddsa_message[4],16),
  1144. // https://eprint.iacr.org/2020/1244.pdf
  1145. Block(ed25519_eddsa_message[5],32),
  1146. Block(ed25519_eddsa_message[6],32),
  1147. Block(ed25519_eddsa_message[7],32),
  1148. Block(ed25519_eddsa_message[6],32),
  1149. Block(ed25519_eddsa_message[8],32),
  1150. Block(ed25519_eddsa_message[8],32),
  1151. Block(ed25519_eddsa_message[9],32),
  1152. Block(ed25519_eddsa_message[9],32),
  1153. Block(ed25519_eddsa_message[10],32),
  1154. Block(ed25519_eddsa_message[11],32)
  1155. };
  1156. template<> const Block Tests<Ristretto>::eddsa_sig[] = {
  1157. Block(ed25519_eddsa_sig[0],64),
  1158. Block(ed25519_eddsa_sig[1],64),
  1159. Block(ed25519_eddsa_sig[2],64),
  1160. Block(ed25519_eddsa_sig[3],64),
  1161. Block(ed25519_eddsa_sig[4],64),
  1162. Block(ed25519_eddsa_sig[5],64),
  1163. // https://eprint.iacr.org/2020/1244.pdf
  1164. Block(ed25519_eddsa_sig[6],64),
  1165. Block(ed25519_eddsa_sig[7],64),
  1166. Block(ed25519_eddsa_sig[8],64),
  1167. Block(ed25519_eddsa_sig[9],64),
  1168. Block(ed25519_eddsa_sig[10],64),
  1169. Block(ed25519_eddsa_sig[11],64),
  1170. Block(ed25519_eddsa_sig[12],64),
  1171. Block(ed25519_eddsa_sig[13],64),
  1172. Block(ed25519_eddsa_sig[14],64),
  1173. Block(ed25519_eddsa_sig[15],64)
  1174. };
  1175. template<> const bool Tests<Ristretto>::eddsa_verify_should_succeed[] = {
  1176. true,
  1177. true,
  1178. true,
  1179. true,
  1180. true,
  1181. true,
  1182. // https://eprint.iacr.org/2020/1244.pdf
  1183. // Note that passing the first two means we conform
  1184. // to RFC 8032, but sigs are malleable for the zero-key
  1185. true,
  1186. true,
  1187. true,
  1188. true,
  1189. true,
  1190. true,
  1191. false,
  1192. false,
  1193. false,
  1194. false
  1195. };