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.
 
 
 
 
 

533 lines
19 KiB

  1. /* X25519, X448 test vectors */
  2. template<> const uint8_t Tests<IsoEd25519>::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<IsoEd25519>::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<IsoEd25519>::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<IsoEd25519>::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<IsoEd25519>::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<IsoEd25519>::elli_patho(NULL,0);
  74. /* EdDSA test vectors */
  75. const uint8_t ed448_eddsa_sk[][57] = {{
  76. 0x6c,0x82,0xa5,0x62,0xcb,0x80,0x8d,0x10,
  77. 0xd6,0x32,0xbe,0x89,0xc8,0x51,0x3e,0xbf,
  78. 0x6c,0x92,0x9f,0x34,0xdd,0xfa,0x8c,0x9f,
  79. 0x63,0xc9,0x96,0x0e,0xf6,0xe3,0x48,0xa3,
  80. 0x52,0x8c,0x8a,0x3f,0xcc,0x2f,0x04,0x4e,
  81. 0x39,0xa3,0xfc,0x5b,0x94,0x49,0x2f,0x8f,
  82. 0x03,0x2e,0x75,0x49,0xa2,0x00,0x98,0xf9,
  83. 0x5b
  84. }, {
  85. 0xc4,0xea,0xb0,0x5d,0x35,0x70,0x07,0xc6,
  86. 0x32,0xf3,0xdb,0xb4,0x84,0x89,0x92,0x4d,
  87. 0x55,0x2b,0x08,0xfe,0x0c,0x35,0x3a,0x0d,
  88. 0x4a,0x1f,0x00,0xac,0xda,0x2c,0x46,0x3a,
  89. 0xfb,0xea,0x67,0xc5,0xe8,0xd2,0x87,0x7c,
  90. 0x5e,0x3b,0xc3,0x97,0xa6,0x59,0x94,0x9e,
  91. 0xf8,0x02,0x1e,0x95,0x4e,0x0a,0x12,0x27,
  92. 0x4e
  93. }, {
  94. 0xcd,0x23,0xd2,0x4f,0x71,0x42,0x74,0xe7,
  95. 0x44,0x34,0x32,0x37,0xb9,0x32,0x90,0xf5,
  96. 0x11,0xf6,0x42,0x5f,0x98,0xe6,0x44,0x59,
  97. 0xff,0x20,0x3e,0x89,0x85,0x08,0x3f,0xfd,
  98. 0xf6,0x05,0x00,0x55,0x3a,0xbc,0x0e,0x05,
  99. 0xcd,0x02,0x18,0x4b,0xdb,0x89,0xc4,0xcc,
  100. 0xd6,0x7e,0x18,0x79,0x51,0x26,0x7e,0xb3,
  101. 0x28
  102. }, {
  103. 0x25,0x8c,0xdd,0x4a,0xda,0x32,0xed,0x9c,
  104. 0x9f,0xf5,0x4e,0x63,0x75,0x6a,0xe5,0x82,
  105. 0xfb,0x8f,0xab,0x2a,0xc7,0x21,0xf2,0xc8,
  106. 0xe6,0x76,0xa7,0x27,0x68,0x51,0x3d,0x93,
  107. 0x9f,0x63,0xdd,0xdb,0x55,0x60,0x91,0x33,
  108. 0xf2,0x9a,0xdf,0x86,0xec,0x99,0x29,0xdc,
  109. 0xcb,0x52,0xc1,0xc5,0xfd,0x2f,0xf7,0xe2,
  110. 0x1b
  111. }, {
  112. 0x83,0x3f,0xe6,0x24,0x09,0x23,0x7b,0x9d,
  113. 0x62,0xec,0x77,0x58,0x75,0x20,0x91,0x1e,
  114. 0x9a,0x75,0x9c,0xec,0x1d,0x19,0x75,0x5b,
  115. 0x7d,0xa9,0x01,0xb9,0x6d,0xca,0x3d,0x42,
  116. 0xef,0x78,0x22,0xe0,0xd5,0x10,0x41,0x27,
  117. 0xdc,0x05,0xd6,0xdb,0xef,0xde,0x69,0xe3,
  118. 0xab,0x2c,0xec,0x7c,0x86,0x7c,0x6e,0x2c,
  119. 0x49
  120. }};
  121. const uint8_t ed448_eddsa_pk[][57] = {{
  122. 0x5f,0xd7,0x44,0x9b,0x59,0xb4,0x61,0xfd,
  123. 0x2c,0xe7,0x87,0xec,0x61,0x6a,0xd4,0x6a,
  124. 0x1d,0xa1,0x34,0x24,0x85,0xa7,0x0e,0x1f,
  125. 0x8a,0x0e,0xa7,0x5d,0x80,0xe9,0x67,0x78,
  126. 0xed,0xf1,0x24,0x76,0x9b,0x46,0xc7,0x06,
  127. 0x1b,0xd6,0x78,0x3d,0xf1,0xe5,0x0f,0x6c,
  128. 0xd1,0xfa,0x1a,0xbe,0xaf,0xe8,0x25,0x61,
  129. 0x80
  130. }, {
  131. 0x43,0xba,0x28,0xf4,0x30,0xcd,0xff,0x45,
  132. 0x6a,0xe5,0x31,0x54,0x5f,0x7e,0xcd,0x0a,
  133. 0xc8,0x34,0xa5,0x5d,0x93,0x58,0xc0,0x37,
  134. 0x2b,0xfa,0x0c,0x6c,0x67,0x98,0xc0,0x86,
  135. 0x6a,0xea,0x01,0xeb,0x00,0x74,0x28,0x02,
  136. 0xb8,0x43,0x8e,0xa4,0xcb,0x82,0x16,0x9c,
  137. 0x23,0x51,0x60,0x62,0x7b,0x4c,0x3a,0x94,
  138. 0x80
  139. }, {
  140. 0xdc,0xea,0x9e,0x78,0xf3,0x5a,0x1b,0xf3,
  141. 0x49,0x9a,0x83,0x1b,0x10,0xb8,0x6c,0x90,
  142. 0xaa,0xc0,0x1c,0xd8,0x4b,0x67,0xa0,0x10,
  143. 0x9b,0x55,0xa3,0x6e,0x93,0x28,0xb1,0xe3,
  144. 0x65,0xfc,0xe1,0x61,0xd7,0x1c,0xe7,0x13,
  145. 0x1a,0x54,0x3e,0xa4,0xcb,0x5f,0x7e,0x9f,
  146. 0x1d,0x8b,0x00,0x69,0x64,0x47,0x00,0x14,
  147. 0x00
  148. }, {
  149. 0x3b,0xa1,0x6d,0xa0,0xc6,0xf2,0xcc,0x1f,
  150. 0x30,0x18,0x77,0x40,0x75,0x6f,0x5e,0x79,
  151. 0x8d,0x6b,0xc5,0xfc,0x01,0x5d,0x7c,0x63,
  152. 0xcc,0x95,0x10,0xee,0x3f,0xd4,0x4a,0xdc,
  153. 0x24,0xd8,0xe9,0x68,0xb6,0xe4,0x6e,0x6f,
  154. 0x94,0xd1,0x9b,0x94,0x53,0x61,0x72,0x6b,
  155. 0xd7,0x5e,0x14,0x9e,0xf0,0x98,0x17,0xf5,
  156. 0x80
  157. }, {
  158. 0x25,0x9b,0x71,0xc1,0x9f,0x83,0xef,0x77,
  159. 0xa7,0xab,0xd2,0x65,0x24,0xcb,0xdb,0x31,
  160. 0x61,0xb5,0x90,0xa4,0x8f,0x7d,0x17,0xde,
  161. 0x3e,0xe0,0xba,0x9c,0x52,0xbe,0xb7,0x43,
  162. 0xc0,0x94,0x28,0xa1,0x31,0xd6,0xb1,0xb5,
  163. 0x73,0x03,0xd9,0x0d,0x81,0x32,0xc2,0x76,
  164. 0xd5,0xed,0x3d,0x5d,0x01,0xc0,0xf5,0x38,
  165. 0x80
  166. }};
  167. const uint8_t ed448_eddsa_message[][12] = {{
  168. 0
  169. }, {
  170. 0x03
  171. }, {
  172. 0x0c,0x3e,0x54,0x40,0x74,0xec,0x63,0xb0,
  173. 0x26,0x5e,0x0c
  174. }, {
  175. 0x64,0xa6,0x5f,0x3c,0xde,0xdc,0xdd,0x66,
  176. 0x81,0x1e,0x29,0x15
  177. }, {
  178. 0x61,0x62,0x63
  179. }};
  180. template<> const bool Tests<Ed448Goldilocks>::eddsa_prehashed[] = {
  181. false,
  182. false,
  183. false,
  184. false,
  185. false,
  186. true,
  187. true
  188. };
  189. const uint8_t ed448_eddsa_context[][3] = {{
  190. 0x66,0x6f,0x6f
  191. }};
  192. const uint8_t ed448_eddsa_sig[][114] = {{
  193. 0x53,0x3a,0x37,0xf6,0xbb,0xe4,0x57,0x25,
  194. 0x1f,0x02,0x3c,0x0d,0x88,0xf9,0x76,0xae,
  195. 0x2d,0xfb,0x50,0x4a,0x84,0x3e,0x34,0xd2,
  196. 0x07,0x4f,0xd8,0x23,0xd4,0x1a,0x59,0x1f,
  197. 0x2b,0x23,0x3f,0x03,0x4f,0x62,0x82,0x81,
  198. 0xf2,0xfd,0x7a,0x22,0xdd,0xd4,0x7d,0x78,
  199. 0x28,0xc5,0x9b,0xd0,0xa2,0x1b,0xfd,0x39,
  200. 0x80,0xff,0x0d,0x20,0x28,0xd4,0xb1,0x8a,
  201. 0x9d,0xf6,0x3e,0x00,0x6c,0x5d,0x1c,0x2d,
  202. 0x34,0x5b,0x92,0x5d,0x8d,0xc0,0x0b,0x41,
  203. 0x04,0x85,0x2d,0xb9,0x9a,0xc5,0xc7,0xcd,
  204. 0xda,0x85,0x30,0xa1,0x13,0xa0,0xf4,0xdb,
  205. 0xb6,0x11,0x49,0xf0,0x5a,0x73,0x63,0x26,
  206. 0x8c,0x71,0xd9,0x58,0x08,0xff,0x2e,0x65,
  207. 0x26,0x00
  208. }, {
  209. 0x26,0xb8,0xf9,0x17,0x27,0xbd,0x62,0x89,
  210. 0x7a,0xf1,0x5e,0x41,0xeb,0x43,0xc3,0x77,
  211. 0xef,0xb9,0xc6,0x10,0xd4,0x8f,0x23,0x35,
  212. 0xcb,0x0b,0xd0,0x08,0x78,0x10,0xf4,0x35,
  213. 0x25,0x41,0xb1,0x43,0xc4,0xb9,0x81,0xb7,
  214. 0xe1,0x8f,0x62,0xde,0x8c,0xcd,0xf6,0x33,
  215. 0xfc,0x1b,0xf0,0x37,0xab,0x7c,0xd7,0x79,
  216. 0x80,0x5e,0x0d,0xbc,0xc0,0xaa,0xe1,0xcb,
  217. 0xce,0xe1,0xaf,0xb2,0xe0,0x27,0xdf,0x36,
  218. 0xbc,0x04,0xdc,0xec,0xbf,0x15,0x43,0x36,
  219. 0xc1,0x9f,0x0a,0xf7,0xe0,0xa6,0x47,0x29,
  220. 0x05,0xe7,0x99,0xf1,0x95,0x3d,0x2a,0x0f,
  221. 0xf3,0x34,0x8a,0xb2,0x1a,0xa4,0xad,0xaf,
  222. 0xd1,0xd2,0x34,0x44,0x1c,0xf8,0x07,0xc0,
  223. 0x3a,0x00
  224. }, {
  225. 0x1f,0x0a,0x88,0x88,0xce,0x25,0xe8,0xd4,
  226. 0x58,0xa2,0x11,0x30,0x87,0x9b,0x84,0x0a,
  227. 0x90,0x89,0xd9,0x99,0xaa,0xba,0x03,0x9e,
  228. 0xaf,0x3e,0x3a,0xfa,0x09,0x0a,0x09,0xd3,
  229. 0x89,0xdb,0xa8,0x2c,0x4f,0xf2,0xae,0x8a,
  230. 0xc5,0xcd,0xfb,0x7c,0x55,0xe9,0x4d,0x5d,
  231. 0x96,0x1a,0x29,0xfe,0x01,0x09,0x94,0x1e,
  232. 0x00,0xb8,0xdb,0xde,0xea,0x6d,0x3b,0x05,
  233. 0x10,0x68,0xdf,0x72,0x54,0xc0,0xcd,0xc1,
  234. 0x29,0xcb,0xe6,0x2d,0xb2,0xdc,0x95,0x7d,
  235. 0xbb,0x47,0xb5,0x1f,0xd3,0xf2,0x13,0xfb,
  236. 0x86,0x98,0xf0,0x64,0x77,0x42,0x50,0xa5,
  237. 0x02,0x89,0x61,0xc9,0xbf,0x8f,0xfd,0x97,
  238. 0x3f,0xe5,0xd5,0xc2,0x06,0x49,0x2b,0x14,
  239. 0x0e,0x00
  240. }, {
  241. 0x7e,0xee,0xab,0x7c,0x4e,0x50,0xfb,0x79,
  242. 0x9b,0x41,0x8e,0xe5,0xe3,0x19,0x7f,0xf6,
  243. 0xbf,0x15,0xd4,0x3a,0x14,0xc3,0x43,0x89,
  244. 0xb5,0x9d,0xd1,0xa7,0xb1,0xb8,0x5b,0x4a,
  245. 0xe9,0x04,0x38,0xac,0xa6,0x34,0xbe,0xa4,
  246. 0x5e,0x3a,0x26,0x95,0xf1,0x27,0x0f,0x07,
  247. 0xfd,0xcd,0xf7,0xc6,0x2b,0x8e,0xfe,0xaf,
  248. 0x00,0xb4,0x5c,0x2c,0x96,0xba,0x45,0x7e,
  249. 0xb1,0xa8,0xbf,0x07,0x5a,0x3d,0xb2,0x8e,
  250. 0x5c,0x24,0xf6,0xb9,0x23,0xed,0x4a,0xd7,
  251. 0x47,0xc3,0xc9,0xe0,0x3c,0x70,0x79,0xef,
  252. 0xb8,0x7c,0xb1,0x10,0xd3,0xa9,0x98,0x61,
  253. 0xe7,0x20,0x03,0xcb,0xae,0x6d,0x6b,0x8b,
  254. 0x82,0x7e,0x4e,0x6c,0x14,0x30,0x64,0xff,
  255. 0x3c,0x00
  256. }, {
  257. 0xd4,0xf8,0xf6,0x13,0x17,0x70,0xdd,0x46,
  258. 0xf4,0x08,0x67,0xd6,0xfd,0x5d,0x50,0x55,
  259. 0xde,0x43,0x54,0x1f,0x8c,0x5e,0x35,0xab,
  260. 0xbc,0xd0,0x01,0xb3,0x2a,0x89,0xf7,0xd2,
  261. 0x15,0x1f,0x76,0x47,0xf1,0x1d,0x8c,0xa2,
  262. 0xae,0x27,0x9f,0xb8,0x42,0xd6,0x07,0x21,
  263. 0x7f,0xce,0x6e,0x04,0x2f,0x68,0x15,0xea,
  264. 0x00,0x0c,0x85,0x74,0x1d,0xe5,0xc8,0xda,
  265. 0x11,0x44,0xa6,0xa1,0xab,0xa7,0xf9,0x6d,
  266. 0xe4,0x25,0x05,0xd7,0xa7,0x29,0x85,0x24,
  267. 0xfd,0xa5,0x38,0xfc,0xcb,0xbb,0x75,0x4f,
  268. 0x57,0x8c,0x1c,0xad,0x10,0xd5,0x4d,0x0d,
  269. 0x54,0x28,0x40,0x7e,0x85,0xdc,0xbc,0x98,
  270. 0xa4,0x91,0x55,0xc1,0x37,0x64,0xe6,0x6c,
  271. 0x3c,0x00
  272. }, {
  273. 0x82,0x2f,0x69,0x01,0xf7,0x48,0x0f,0x3d,
  274. 0x5f,0x56,0x2c,0x59,0x29,0x94,0xd9,0x69,
  275. 0x36,0x02,0x87,0x56,0x14,0x48,0x32,0x56,
  276. 0x50,0x56,0x00,0xbb,0xc2,0x81,0xae,0x38,
  277. 0x1f,0x54,0xd6,0xbc,0xe2,0xea,0x91,0x15,
  278. 0x74,0x93,0x2f,0x52,0xa4,0xe6,0xca,0xdd,
  279. 0x78,0x76,0x93,0x75,0xec,0x3f,0xfd,0x1b,
  280. 0x80,0x1a,0x0d,0x9b,0x3f,0x40,0x30,0xcd,
  281. 0x43,0x39,0x64,0xb6,0x45,0x7e,0xa3,0x94,
  282. 0x76,0x51,0x12,0x14,0xf9,0x74,0x69,0xb5,
  283. 0x7d,0xd3,0x2d,0xbc,0x56,0x0a,0x9a,0x94,
  284. 0xd0,0x0b,0xff,0x07,0x62,0x04,0x64,0xa3,
  285. 0xad,0x20,0x3d,0xf7,0xdc,0x7c,0xe3,0x60,
  286. 0xc3,0xcd,0x36,0x96,0xd9,0xd9,0xfa,0xb9,
  287. 0x0f,0x00
  288. }, {
  289. 0xc3,0x22,0x99,0xd4,0x6e,0xc8,0xff,0x02,
  290. 0xb5,0x45,0x40,0x98,0x28,0x14,0xdc,0xe9,
  291. 0xa0,0x58,0x12,0xf8,0x19,0x62,0xb6,0x49,
  292. 0xd5,0x28,0x09,0x59,0x16,0xa2,0xaa,0x48,
  293. 0x10,0x65,0xb1,0x58,0x04,0x23,0xef,0x92,
  294. 0x7e,0xcf,0x0a,0xf5,0x88,0x8f,0x90,0xda,
  295. 0x0f,0x6a,0x9a,0x85,0xad,0x5d,0xc3,0xf2,
  296. 0x80,0xd9,0x12,0x24,0xba,0x99,0x11,0xa3,
  297. 0x65,0x3d,0x00,0xe4,0x84,0xe2,0xce,0x23,
  298. 0x25,0x21,0x48,0x1c,0x86,0x58,0xdf,0x30,
  299. 0x4b,0xb7,0x74,0x5a,0x73,0x51,0x4c,0xdb,
  300. 0x9b,0xf3,0xe1,0x57,0x84,0xab,0x71,0x28,
  301. 0x4f,0x8d,0x07,0x04,0xa6,0x08,0xc5,0x4a,
  302. 0x6b,0x62,0xd9,0x7b,0xeb,0x51,0x1d,0x13,
  303. 0x21,0x00
  304. }};
  305. template<> const Block Tests<Ed448Goldilocks>::eddsa_sk[] = {
  306. Block(ed448_eddsa_sk[0],57),
  307. Block(ed448_eddsa_sk[1],57),
  308. Block(ed448_eddsa_sk[1],57),
  309. Block(ed448_eddsa_sk[2],57),
  310. Block(ed448_eddsa_sk[3],57),
  311. Block(ed448_eddsa_sk[4],57),
  312. Block(ed448_eddsa_sk[4],57),
  313. Block(NULL,0)
  314. };
  315. template<> const Block Tests<Ed448Goldilocks>::eddsa_pk[] = {
  316. Block(ed448_eddsa_pk[0],57),
  317. Block(ed448_eddsa_pk[1],57),
  318. Block(ed448_eddsa_pk[1],57),
  319. Block(ed448_eddsa_pk[2],57),
  320. Block(ed448_eddsa_pk[3],57),
  321. Block(ed448_eddsa_pk[4],57),
  322. Block(ed448_eddsa_pk[4],57)
  323. };
  324. template<> const Block Tests<Ed448Goldilocks>::eddsa_message[] = {
  325. Block(ed448_eddsa_message[0],0),
  326. Block(ed448_eddsa_message[1],1),
  327. Block(ed448_eddsa_message[1],1),
  328. Block(ed448_eddsa_message[2],11),
  329. Block(ed448_eddsa_message[3],12),
  330. Block(ed448_eddsa_message[4],3),
  331. Block(ed448_eddsa_message[4],3)
  332. };
  333. template<> const Block Tests<Ed448Goldilocks>::eddsa_context[] = {
  334. Block(NULL,0),
  335. Block(NULL,0),
  336. Block(ed448_eddsa_context[0],3),
  337. Block(NULL,0),
  338. Block(NULL,0),
  339. Block(NULL,0),
  340. Block(ed448_eddsa_context[0],3)
  341. };
  342. template<> const Block Tests<Ed448Goldilocks>::eddsa_sig[] = {
  343. Block(ed448_eddsa_sig[0],114),
  344. Block(ed448_eddsa_sig[1],114),
  345. Block(ed448_eddsa_sig[4],114),
  346. Block(ed448_eddsa_sig[2],114),
  347. Block(ed448_eddsa_sig[3],114),
  348. Block(ed448_eddsa_sig[5],114),
  349. Block(ed448_eddsa_sig[6],114)
  350. };
  351. const uint8_t ed25519_eddsa_sk[][32] = {{
  352. 0x9d,0x61,0xb1,0x9d,0xef,0xfd,0x5a,0x60,
  353. 0xba,0x84,0x4a,0xf4,0x92,0xec,0x2c,0xc4,
  354. 0x44,0x49,0xc5,0x69,0x7b,0x32,0x69,0x19,
  355. 0x70,0x3b,0xac,0x03,0x1c,0xae,0x7f,0x60
  356. }, {
  357. 0x4c,0xcd,0x08,0x9b,0x28,0xff,0x96,0xda,
  358. 0x9d,0xb6,0xc3,0x46,0xec,0x11,0x4e,0x0f,
  359. 0x5b,0x8a,0x31,0x9f,0x35,0xab,0xa6,0x24,
  360. 0xda,0x8c,0xf6,0xed,0x4f,0xb8,0xa6,0xfb
  361. }, {
  362. 0xc5,0xaa,0x8d,0xf4,0x3f,0x9f,0x83,0x7b,
  363. 0xed,0xb7,0x44,0x2f,0x31,0xdc,0xb7,0xb1,
  364. 0x66,0xd3,0x85,0x35,0x07,0x6f,0x09,0x4b,
  365. 0x85,0xce,0x3a,0x2e,0x0b,0x44,0x58,0xf7
  366. }, {
  367. 0x83,0x3f,0xe6,0x24,0x09,0x23,0x7b,0x9d,
  368. 0x62,0xec,0x77,0x58,0x75,0x20,0x91,0x1e,
  369. 0x9a,0x75,0x9c,0xec,0x1d,0x19,0x75,0x5b,
  370. 0x7d,0xa9,0x01,0xb9,0x6d,0xca,0x3d,0x42
  371. }, {
  372. 0x03,0x05,0x33,0x4e,0x38,0x1a,0xf7,0x8f,
  373. 0x14,0x1c,0xb6,0x66,0xf6,0x19,0x9f,0x57,
  374. 0xbc,0x34,0x95,0x33,0x5a,0x25,0x6a,0x95,
  375. 0xbd,0x2a,0x55,0xbf,0x54,0x66,0x63,0xf6
  376. }};
  377. const uint8_t ed25519_eddsa_pk[][32] = {{
  378. 0xd7,0x5a,0x98,0x01,0x82,0xb1,0x0a,0xb7,
  379. 0xd5,0x4b,0xfe,0xd3,0xc9,0x64,0x07,0x3a,
  380. 0x0e,0xe1,0x72,0xf3,0xda,0xa6,0x23,0x25,
  381. 0xaf,0x02,0x1a,0x68,0xf7,0x07,0x51,0x1a
  382. }, {
  383. 0x3d,0x40,0x17,0xc3,0xe8,0x43,0x89,0x5a,
  384. 0x92,0xb7,0x0a,0xa7,0x4d,0x1b,0x7e,0xbc,
  385. 0x9c,0x98,0x2c,0xcf,0x2e,0xc4,0x96,0x8c,
  386. 0xc0,0xcd,0x55,0xf1,0x2a,0xf4,0x66,0x0c
  387. }, {
  388. 0xfc,0x51,0xcd,0x8e,0x62,0x18,0xa1,0xa3,
  389. 0x8d,0xa4,0x7e,0xd0,0x02,0x30,0xf0,0x58,
  390. 0x08,0x16,0xed,0x13,0xba,0x33,0x03,0xac,
  391. 0x5d,0xeb,0x91,0x15,0x48,0x90,0x80,0x25
  392. }, {
  393. 0xec,0x17,0x2b,0x93,0xad,0x5e,0x56,0x3b,
  394. 0xf4,0x93,0x2c,0x70,0xe1,0x24,0x50,0x34,
  395. 0xc3,0x54,0x67,0xef,0x2e,0xfd,0x4d,0x64,
  396. 0xeb,0xf8,0x19,0x68,0x34,0x67,0xe2,0xbf
  397. }, {
  398. 0xdf,0xc9,0x42,0x5e,0x4f,0x96,0x8f,0x7f,
  399. 0x0c,0x29,0xf0,0x25,0x9c,0xf5,0xf9,0xae,
  400. 0xd6,0x85,0x1c,0x2b,0xb4,0xad,0x8b,0xfb,
  401. 0x86,0x0c,0xfe,0xe0,0xab,0x24,0x82,0x92
  402. }};
  403. const uint8_t ed25519_eddsa_message[][16] = {{
  404. 0
  405. }, {
  406. 0x72
  407. }, {
  408. 0xaf,0x82
  409. }, {
  410. 0x61,0x62,0x63
  411. }, {
  412. 0xf7,0x26,0x93,0x6d,0x19,0xc8,0x00,0x49,
  413. 0x4e,0x3f,0xda,0xff,0x20,0xb2,0x76,0xa8
  414. }};
  415. const uint8_t ed25519_eddsa_context[][3] = {{
  416. 0x66,0x6f,0x6f
  417. }, {
  418. 0x62,0x61,0x72
  419. }};
  420. const uint8_t ed25519_eddsa_sig[][64] = {{
  421. 0xe5,0x56,0x43,0x00,0xc3,0x60,0xac,0x72,
  422. 0x90,0x86,0xe2,0xcc,0x80,0x6e,0x82,0x8a,
  423. 0x84,0x87,0x7f,0x1e,0xb8,0xe5,0xd9,0x74,
  424. 0xd8,0x73,0xe0,0x65,0x22,0x49,0x01,0x55,
  425. 0x5f,0xb8,0x82,0x15,0x90,0xa3,0x3b,0xac,
  426. 0xc6,0x1e,0x39,0x70,0x1c,0xf9,0xb4,0x6b,
  427. 0xd2,0x5b,0xf5,0xf0,0x59,0x5b,0xbe,0x24,
  428. 0x65,0x51,0x41,0x43,0x8e,0x7a,0x10,0x0b
  429. } , {
  430. 0x92,0xa0,0x09,0xa9,0xf0,0xd4,0xca,0xb8,
  431. 0x72,0x0e,0x82,0x0b,0x5f,0x64,0x25,0x40,
  432. 0xa2,0xb2,0x7b,0x54,0x16,0x50,0x3f,0x8f,
  433. 0xb3,0x76,0x22,0x23,0xeb,0xdb,0x69,0xda,
  434. 0x08,0x5a,0xc1,0xe4,0x3e,0x15,0x99,0x6e,
  435. 0x45,0x8f,0x36,0x13,0xd0,0xf1,0x1d,0x8c,
  436. 0x38,0x7b,0x2e,0xae,0xb4,0x30,0x2a,0xee,
  437. 0xb0,0x0d,0x29,0x16,0x12,0xbb,0x0c,0x00
  438. }, {
  439. 0x62,0x91,0xd6,0x57,0xde,0xec,0x24,0x02,
  440. 0x48,0x27,0xe6,0x9c,0x3a,0xbe,0x01,0xa3,
  441. 0x0c,0xe5,0x48,0xa2,0x84,0x74,0x3a,0x44,
  442. 0x5e,0x36,0x80,0xd7,0xdb,0x5a,0xc3,0xac,
  443. 0x18,0xff,0x9b,0x53,0x8d,0x16,0xf2,0x90,
  444. 0xae,0x67,0xf7,0x60,0x98,0x4d,0xc6,0x59,
  445. 0x4a,0x7c,0x15,0xe9,0x71,0x6e,0xd2,0x8d,
  446. 0xc0,0x27,0xbe,0xce,0xea,0x1e,0xc4,0x0a
  447. }, {
  448. 0x98,0xa7,0x02,0x22,0xf0,0xb8,0x12,0x1a,
  449. 0xa9,0xd3,0x0f,0x81,0x3d,0x68,0x3f,0x80,
  450. 0x9e,0x46,0x2b,0x46,0x9c,0x7f,0xf8,0x76,
  451. 0x39,0x49,0x9b,0xb9,0x4e,0x6d,0xae,0x41,
  452. 0x31,0xf8,0x50,0x42,0x46,0x3c,0x2a,0x35,
  453. 0x5a,0x20,0x03,0xd0,0x62,0xad,0xf5,0xaa,
  454. 0xa1,0x0b,0x8c,0x61,0xe6,0x36,0x06,0x2a,
  455. 0xaa,0xd1,0x1c,0x2a,0x26,0x08,0x34,0x06
  456. }, {
  457. 0x55,0xa4,0xcc,0x2f,0x70,0xa5,0x4e,0x04,
  458. 0x28,0x8c,0x5f,0x4c,0xd1,0xe4,0x5a,0x7b,
  459. 0xb5,0x20,0xb3,0x62,0x92,0x91,0x18,0x76,
  460. 0xca,0xda,0x73,0x23,0x19,0x8d,0xd8,0x7a,
  461. 0x8b,0x36,0x95,0x0b,0x95,0x13,0x00,0x22,
  462. 0x90,0x7a,0x7f,0xb7,0xc4,0xe9,0xb2,0xd5,
  463. 0xf6,0xcc,0xa6,0x85,0xa5,0x87,0xb4,0xb2,
  464. 0x1f,0x4b,0x88,0x8e,0x4e,0x7e,0xdb,0x0d
  465. }, {
  466. 0xfc,0x60,0xd5,0x87,0x2f,0xc4,0x6b,0x3a,
  467. 0xa6,0x9f,0x8b,0x5b,0x43,0x51,0xd5,0x80,
  468. 0x8f,0x92,0xbc,0xc0,0x44,0x60,0x6d,0xb0,
  469. 0x97,0xab,0xab,0x6d,0xbc,0xb1,0xae,0xe3,
  470. 0x21,0x6c,0x48,0xe8,0xb3,0xb6,0x64,0x31,
  471. 0xb5,0xb1,0x86,0xd1,0xd2,0x8f,0x8e,0xe1,
  472. 0x5a,0x5c,0xa2,0xdf,0x66,0x68,0x34,0x62,
  473. 0x91,0xc2,0x04,0x3d,0x4e,0xb3,0xe9,0x0d
  474. }};
  475. template<> const bool Tests<IsoEd25519>::eddsa_prehashed[] = {
  476. false,
  477. false,
  478. false,
  479. true,
  480. false,
  481. false
  482. };
  483. template<> const Block Tests<IsoEd25519>::eddsa_sk[] = {
  484. Block(ed25519_eddsa_sk[0],32),
  485. Block(ed25519_eddsa_sk[1],32),
  486. Block(ed25519_eddsa_sk[2],32),
  487. Block(ed25519_eddsa_sk[3],32),
  488. Block(ed25519_eddsa_sk[4],32),
  489. Block(ed25519_eddsa_sk[4],32),
  490. Block(NULL,0)
  491. };
  492. template<> const Block Tests<IsoEd25519>::eddsa_pk[] = {
  493. Block(ed25519_eddsa_pk[0],32),
  494. Block(ed25519_eddsa_pk[1],32),
  495. Block(ed25519_eddsa_pk[2],32),
  496. Block(ed25519_eddsa_pk[3],32),
  497. Block(ed25519_eddsa_pk[4],32),
  498. Block(ed25519_eddsa_pk[4],32)
  499. };
  500. template<> const Block Tests<IsoEd25519>::eddsa_context[] = {
  501. EdDSA<IsoEd25519>::NO_CONTEXT(),
  502. EdDSA<IsoEd25519>::NO_CONTEXT(),
  503. EdDSA<IsoEd25519>::NO_CONTEXT(),
  504. Block(NULL,0),
  505. Block(ed25519_eddsa_context[0],3),
  506. Block(ed25519_eddsa_context[1],3)
  507. };
  508. template<> const Block Tests<IsoEd25519>::eddsa_message[] = {
  509. Block(ed25519_eddsa_message[0],0),
  510. Block(ed25519_eddsa_message[1],1),
  511. Block(ed25519_eddsa_message[2],2),
  512. Block(ed25519_eddsa_message[3],3),
  513. Block(ed25519_eddsa_message[4],16),
  514. Block(ed25519_eddsa_message[4],16)
  515. };
  516. template<> const Block Tests<IsoEd25519>::eddsa_sig[] = {
  517. Block(ed25519_eddsa_sig[0],64),
  518. Block(ed25519_eddsa_sig[1],64),
  519. Block(ed25519_eddsa_sig[2],64),
  520. Block(ed25519_eddsa_sig[3],64),
  521. Block(ed25519_eddsa_sig[4],64),
  522. Block(ed25519_eddsa_sig[5],64)
  523. };