Não pode escolher mais do que 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.
 
 
 
 
 
 

561 linhas
16 KiB

  1. /* Copyright (c) 2014, Intel Corporation.
  2. *
  3. * Permission to use, copy, modify, and/or distribute this software for any
  4. * purpose with or without fee is hereby granted, provided that the above
  5. * copyright notice and this permission notice appear in all copies.
  6. *
  7. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
  8. * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
  9. * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
  10. * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
  11. * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
  12. * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
  13. * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */
  14. /* Developers and authors:
  15. * Shay Gueron (1, 2), and Vlad Krasnov (1)
  16. * (1) Intel Corporation, Israel Development Center
  17. * (2) University of Haifa
  18. * Reference:
  19. * S.Gueron and V.Krasnov, "Fast Prime Field Elliptic Curve Cryptography with
  20. * 256 Bit Primes" */
  21. #include <openssl/ec.h>
  22. #include <assert.h>
  23. #include <stdint.h>
  24. #include <string.h>
  25. #include <openssl/bn.h>
  26. #include <openssl/crypto.h>
  27. #include <openssl/err.h>
  28. #include "../bn/internal.h"
  29. #include "../internal.h"
  30. #include "internal.h"
  31. #include "p256-x86_64.h"
  32. #if !defined(OPENSSL_NO_ASM) && defined(OPENSSL_X86_64) && \
  33. !defined(OPENSSL_SMALL)
  34. typedef P256_POINT_AFFINE PRECOMP256_ROW[64];
  35. /* One converted into the Montgomery domain */
  36. static const BN_ULONG ONE[P256_LIMBS] = {
  37. TOBN(0x00000000, 0x00000001), TOBN(0xffffffff, 0x00000000),
  38. TOBN(0xffffffff, 0xffffffff), TOBN(0x00000000, 0xfffffffe),
  39. };
  40. /* Precomputed tables for the default generator */
  41. #include "p256-x86_64-table.h"
  42. /* Recode window to a signed digit, see util-64.c for details */
  43. static unsigned booth_recode_w5(unsigned in) {
  44. unsigned s, d;
  45. s = ~((in >> 5) - 1);
  46. d = (1 << 6) - in - 1;
  47. d = (d & s) | (in & ~s);
  48. d = (d >> 1) + (d & 1);
  49. return (d << 1) + (s & 1);
  50. }
  51. static unsigned booth_recode_w7(unsigned in) {
  52. unsigned s, d;
  53. s = ~((in >> 7) - 1);
  54. d = (1 << 8) - in - 1;
  55. d = (d & s) | (in & ~s);
  56. d = (d >> 1) + (d & 1);
  57. return (d << 1) + (s & 1);
  58. }
  59. /* copy_conditional copies |src| to |dst| if |move| is one and leaves it as-is
  60. * if |move| is zero.
  61. *
  62. * WARNING: this breaks the usual convention of constant-time functions
  63. * returning masks. */
  64. static void copy_conditional(BN_ULONG dst[P256_LIMBS],
  65. const BN_ULONG src[P256_LIMBS], BN_ULONG move) {
  66. BN_ULONG mask1 = ((BN_ULONG)0) - move;
  67. BN_ULONG mask2 = ~mask1;
  68. dst[0] = (src[0] & mask1) ^ (dst[0] & mask2);
  69. dst[1] = (src[1] & mask1) ^ (dst[1] & mask2);
  70. dst[2] = (src[2] & mask1) ^ (dst[2] & mask2);
  71. dst[3] = (src[3] & mask1) ^ (dst[3] & mask2);
  72. if (P256_LIMBS == 8) {
  73. dst[4] = (src[4] & mask1) ^ (dst[4] & mask2);
  74. dst[5] = (src[5] & mask1) ^ (dst[5] & mask2);
  75. dst[6] = (src[6] & mask1) ^ (dst[6] & mask2);
  76. dst[7] = (src[7] & mask1) ^ (dst[7] & mask2);
  77. }
  78. }
  79. /* is_not_zero returns one iff in != 0 and zero otherwise.
  80. *
  81. * WARNING: this breaks the usual convention of constant-time functions
  82. * returning masks.
  83. *
  84. * (define-fun is_not_zero ((in (_ BitVec 64))) (_ BitVec 64)
  85. * (bvlshr (bvor in (bvsub #x0000000000000000 in)) #x000000000000003f)
  86. * )
  87. *
  88. * (declare-fun x () (_ BitVec 64))
  89. *
  90. * (assert (and (= x #x0000000000000000) (= (is_not_zero x) #x0000000000000001)))
  91. * (check-sat)
  92. *
  93. * (assert (and (not (= x #x0000000000000000)) (= (is_not_zero x) #x0000000000000000)))
  94. * (check-sat)
  95. * */
  96. static BN_ULONG is_not_zero(BN_ULONG in) {
  97. in |= (0 - in);
  98. in >>= BN_BITS2 - 1;
  99. return in;
  100. }
  101. /* ecp_nistz256_mod_inverse_mont sets |r| to (|in| * 2^-256)^-1 * 2^256 mod p.
  102. * That is, |r| is the modular inverse of |in| for input and output in the
  103. * Montgomery domain. */
  104. static void ecp_nistz256_mod_inverse_mont(BN_ULONG r[P256_LIMBS],
  105. const BN_ULONG in[P256_LIMBS]) {
  106. /* The poly is ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff
  107. ffffffff
  108. We use FLT and used poly-2 as exponent */
  109. BN_ULONG p2[P256_LIMBS];
  110. BN_ULONG p4[P256_LIMBS];
  111. BN_ULONG p8[P256_LIMBS];
  112. BN_ULONG p16[P256_LIMBS];
  113. BN_ULONG p32[P256_LIMBS];
  114. BN_ULONG res[P256_LIMBS];
  115. int i;
  116. ecp_nistz256_sqr_mont(res, in);
  117. ecp_nistz256_mul_mont(p2, res, in); /* 3*p */
  118. ecp_nistz256_sqr_mont(res, p2);
  119. ecp_nistz256_sqr_mont(res, res);
  120. ecp_nistz256_mul_mont(p4, res, p2); /* f*p */
  121. ecp_nistz256_sqr_mont(res, p4);
  122. ecp_nistz256_sqr_mont(res, res);
  123. ecp_nistz256_sqr_mont(res, res);
  124. ecp_nistz256_sqr_mont(res, res);
  125. ecp_nistz256_mul_mont(p8, res, p4); /* ff*p */
  126. ecp_nistz256_sqr_mont(res, p8);
  127. for (i = 0; i < 7; i++) {
  128. ecp_nistz256_sqr_mont(res, res);
  129. }
  130. ecp_nistz256_mul_mont(p16, res, p8); /* ffff*p */
  131. ecp_nistz256_sqr_mont(res, p16);
  132. for (i = 0; i < 15; i++) {
  133. ecp_nistz256_sqr_mont(res, res);
  134. }
  135. ecp_nistz256_mul_mont(p32, res, p16); /* ffffffff*p */
  136. ecp_nistz256_sqr_mont(res, p32);
  137. for (i = 0; i < 31; i++) {
  138. ecp_nistz256_sqr_mont(res, res);
  139. }
  140. ecp_nistz256_mul_mont(res, res, in);
  141. for (i = 0; i < 32 * 4; i++) {
  142. ecp_nistz256_sqr_mont(res, res);
  143. }
  144. ecp_nistz256_mul_mont(res, res, p32);
  145. for (i = 0; i < 32; i++) {
  146. ecp_nistz256_sqr_mont(res, res);
  147. }
  148. ecp_nistz256_mul_mont(res, res, p32);
  149. for (i = 0; i < 16; i++) {
  150. ecp_nistz256_sqr_mont(res, res);
  151. }
  152. ecp_nistz256_mul_mont(res, res, p16);
  153. for (i = 0; i < 8; i++) {
  154. ecp_nistz256_sqr_mont(res, res);
  155. }
  156. ecp_nistz256_mul_mont(res, res, p8);
  157. ecp_nistz256_sqr_mont(res, res);
  158. ecp_nistz256_sqr_mont(res, res);
  159. ecp_nistz256_sqr_mont(res, res);
  160. ecp_nistz256_sqr_mont(res, res);
  161. ecp_nistz256_mul_mont(res, res, p4);
  162. ecp_nistz256_sqr_mont(res, res);
  163. ecp_nistz256_sqr_mont(res, res);
  164. ecp_nistz256_mul_mont(res, res, p2);
  165. ecp_nistz256_sqr_mont(res, res);
  166. ecp_nistz256_sqr_mont(res, res);
  167. ecp_nistz256_mul_mont(r, res, in);
  168. }
  169. /* ecp_nistz256_bignum_to_field_elem copies the contents of |in| to |out| and
  170. * returns one if it fits. Otherwise it returns zero. */
  171. static int ecp_nistz256_bignum_to_field_elem(BN_ULONG out[P256_LIMBS],
  172. const BIGNUM *in) {
  173. if (in->top > P256_LIMBS) {
  174. return 0;
  175. }
  176. memset(out, 0, sizeof(BN_ULONG) * P256_LIMBS);
  177. memcpy(out, in->d, sizeof(BN_ULONG) * in->top);
  178. return 1;
  179. }
  180. /* r = p * p_scalar */
  181. static int ecp_nistz256_windowed_mul(const EC_GROUP *group, P256_POINT *r,
  182. const EC_POINT *p, const BIGNUM *p_scalar,
  183. BN_CTX *ctx) {
  184. assert(p != NULL);
  185. assert(p_scalar != NULL);
  186. static const unsigned kWindowSize = 5;
  187. static const unsigned kMask = (1 << (5 /* kWindowSize */ + 1)) - 1;
  188. /* A |P256_POINT| is (3 * 32) = 96 bytes, and the 64-byte alignment should
  189. * add no more than 63 bytes of overhead. Thus, |table| should require
  190. * ~1599 ((96 * 16) + 63) bytes of stack space. */
  191. alignas(64) P256_POINT table[16];
  192. uint8_t p_str[33];
  193. int ret = 0;
  194. BN_CTX *new_ctx = NULL;
  195. int ctx_started = 0;
  196. if (BN_num_bits(p_scalar) > 256 || BN_is_negative(p_scalar)) {
  197. if (ctx == NULL) {
  198. new_ctx = BN_CTX_new();
  199. if (new_ctx == NULL) {
  200. OPENSSL_PUT_ERROR(EC, ERR_R_MALLOC_FAILURE);
  201. goto err;
  202. }
  203. ctx = new_ctx;
  204. }
  205. BN_CTX_start(ctx);
  206. ctx_started = 1;
  207. BIGNUM *mod = BN_CTX_get(ctx);
  208. if (mod == NULL) {
  209. OPENSSL_PUT_ERROR(EC, ERR_R_MALLOC_FAILURE);
  210. goto err;
  211. }
  212. if (!BN_nnmod(mod, p_scalar, &group->order, ctx)) {
  213. OPENSSL_PUT_ERROR(EC, ERR_R_BN_LIB);
  214. goto err;
  215. }
  216. p_scalar = mod;
  217. }
  218. int j;
  219. for (j = 0; j < p_scalar->top * BN_BYTES; j += BN_BYTES) {
  220. BN_ULONG d = p_scalar->d[j / BN_BYTES];
  221. p_str[j + 0] = d & 0xff;
  222. p_str[j + 1] = (d >> 8) & 0xff;
  223. p_str[j + 2] = (d >> 16) & 0xff;
  224. p_str[j + 3] = (d >>= 24) & 0xff;
  225. if (BN_BYTES == 8) {
  226. d >>= 8;
  227. p_str[j + 4] = d & 0xff;
  228. p_str[j + 5] = (d >> 8) & 0xff;
  229. p_str[j + 6] = (d >> 16) & 0xff;
  230. p_str[j + 7] = (d >> 24) & 0xff;
  231. }
  232. }
  233. for (; j < 33; j++) {
  234. p_str[j] = 0;
  235. }
  236. /* table[0] is implicitly (0,0,0) (the point at infinity), therefore it is
  237. * not stored. All other values are actually stored with an offset of -1 in
  238. * table. */
  239. P256_POINT *row = table;
  240. if (!ecp_nistz256_bignum_to_field_elem(row[1 - 1].X, &p->X) ||
  241. !ecp_nistz256_bignum_to_field_elem(row[1 - 1].Y, &p->Y) ||
  242. !ecp_nistz256_bignum_to_field_elem(row[1 - 1].Z, &p->Z)) {
  243. OPENSSL_PUT_ERROR(EC, EC_R_COORDINATES_OUT_OF_RANGE);
  244. goto err;
  245. }
  246. ecp_nistz256_point_double(&row[2 - 1], &row[1 - 1]);
  247. ecp_nistz256_point_add(&row[3 - 1], &row[2 - 1], &row[1 - 1]);
  248. ecp_nistz256_point_double(&row[4 - 1], &row[2 - 1]);
  249. ecp_nistz256_point_double(&row[6 - 1], &row[3 - 1]);
  250. ecp_nistz256_point_double(&row[8 - 1], &row[4 - 1]);
  251. ecp_nistz256_point_double(&row[12 - 1], &row[6 - 1]);
  252. ecp_nistz256_point_add(&row[5 - 1], &row[4 - 1], &row[1 - 1]);
  253. ecp_nistz256_point_add(&row[7 - 1], &row[6 - 1], &row[1 - 1]);
  254. ecp_nistz256_point_add(&row[9 - 1], &row[8 - 1], &row[1 - 1]);
  255. ecp_nistz256_point_add(&row[13 - 1], &row[12 - 1], &row[1 - 1]);
  256. ecp_nistz256_point_double(&row[14 - 1], &row[7 - 1]);
  257. ecp_nistz256_point_double(&row[10 - 1], &row[5 - 1]);
  258. ecp_nistz256_point_add(&row[15 - 1], &row[14 - 1], &row[1 - 1]);
  259. ecp_nistz256_point_add(&row[11 - 1], &row[10 - 1], &row[1 - 1]);
  260. ecp_nistz256_point_double(&row[16 - 1], &row[8 - 1]);
  261. BN_ULONG tmp[P256_LIMBS];
  262. alignas(32) P256_POINT h;
  263. unsigned index = 255;
  264. unsigned wvalue = p_str[(index - 1) / 8];
  265. wvalue = (wvalue >> ((index - 1) % 8)) & kMask;
  266. ecp_nistz256_select_w5(r, table, booth_recode_w5(wvalue) >> 1);
  267. while (index >= 5) {
  268. if (index != 255) {
  269. unsigned off = (index - 1) / 8;
  270. wvalue = p_str[off] | p_str[off + 1] << 8;
  271. wvalue = (wvalue >> ((index - 1) % 8)) & kMask;
  272. wvalue = booth_recode_w5(wvalue);
  273. ecp_nistz256_select_w5(&h, table, wvalue >> 1);
  274. ecp_nistz256_neg(tmp, h.Y);
  275. copy_conditional(h.Y, tmp, (wvalue & 1));
  276. ecp_nistz256_point_add(r, r, &h);
  277. }
  278. index -= kWindowSize;
  279. ecp_nistz256_point_double(r, r);
  280. ecp_nistz256_point_double(r, r);
  281. ecp_nistz256_point_double(r, r);
  282. ecp_nistz256_point_double(r, r);
  283. ecp_nistz256_point_double(r, r);
  284. }
  285. /* Final window */
  286. wvalue = p_str[0];
  287. wvalue = (wvalue << 1) & kMask;
  288. wvalue = booth_recode_w5(wvalue);
  289. ecp_nistz256_select_w5(&h, table, wvalue >> 1);
  290. ecp_nistz256_neg(tmp, h.Y);
  291. copy_conditional(h.Y, tmp, wvalue & 1);
  292. ecp_nistz256_point_add(r, r, &h);
  293. ret = 1;
  294. err:
  295. if (ctx_started) {
  296. BN_CTX_end(ctx);
  297. }
  298. BN_CTX_free(new_ctx);
  299. return ret;
  300. }
  301. static int ecp_nistz256_points_mul(
  302. const EC_GROUP *group, EC_POINT *r, const BIGNUM *g_scalar,
  303. const EC_POINT *p_, const BIGNUM *p_scalar, BN_CTX *ctx) {
  304. assert((p_ != NULL) == (p_scalar != NULL));
  305. static const unsigned kWindowSize = 7;
  306. static const unsigned kMask = (1 << (7 /* kWindowSize */ + 1)) - 1;
  307. alignas(32) union {
  308. P256_POINT p;
  309. P256_POINT_AFFINE a;
  310. } t, p;
  311. int ret = 0;
  312. BN_CTX *new_ctx = NULL;
  313. int ctx_started = 0;
  314. if (g_scalar != NULL) {
  315. if (BN_num_bits(g_scalar) > 256 || BN_is_negative(g_scalar)) {
  316. if (ctx == NULL) {
  317. new_ctx = BN_CTX_new();
  318. if (new_ctx == NULL) {
  319. goto err;
  320. }
  321. ctx = new_ctx;
  322. }
  323. BN_CTX_start(ctx);
  324. ctx_started = 1;
  325. BIGNUM *tmp_scalar = BN_CTX_get(ctx);
  326. if (tmp_scalar == NULL) {
  327. goto err;
  328. }
  329. if (!BN_nnmod(tmp_scalar, g_scalar, &group->order, ctx)) {
  330. OPENSSL_PUT_ERROR(EC, ERR_R_BN_LIB);
  331. goto err;
  332. }
  333. g_scalar = tmp_scalar;
  334. }
  335. uint8_t p_str[33] = {0};
  336. int i;
  337. for (i = 0; i < g_scalar->top * BN_BYTES; i += BN_BYTES) {
  338. BN_ULONG d = g_scalar->d[i / BN_BYTES];
  339. p_str[i + 0] = d & 0xff;
  340. p_str[i + 1] = (d >> 8) & 0xff;
  341. p_str[i + 2] = (d >> 16) & 0xff;
  342. p_str[i + 3] = (d >>= 24) & 0xff;
  343. if (BN_BYTES == 8) {
  344. d >>= 8;
  345. p_str[i + 4] = d & 0xff;
  346. p_str[i + 5] = (d >> 8) & 0xff;
  347. p_str[i + 6] = (d >> 16) & 0xff;
  348. p_str[i + 7] = (d >> 24) & 0xff;
  349. }
  350. }
  351. for (; i < (int) sizeof(p_str); i++) {
  352. p_str[i] = 0;
  353. }
  354. /* First window */
  355. unsigned wvalue = (p_str[0] << 1) & kMask;
  356. unsigned index = kWindowSize;
  357. wvalue = booth_recode_w7(wvalue);
  358. const PRECOMP256_ROW *const precomputed_table =
  359. (const PRECOMP256_ROW *)ecp_nistz256_precomputed;
  360. ecp_nistz256_select_w7(&p.a, precomputed_table[0], wvalue >> 1);
  361. ecp_nistz256_neg(p.p.Z, p.p.Y);
  362. copy_conditional(p.p.Y, p.p.Z, wvalue & 1);
  363. /* Convert |p| from affine to Jacobian coordinates. We set Z to zero if |p|
  364. * is infinity and |ONE| otherwise. |p| was computed from the table, so it
  365. * is infinity iff |wvalue >> 1| is zero. */
  366. memset(p.p.Z, 0, sizeof(p.p.Z));
  367. copy_conditional(p.p.Z, ONE, is_not_zero(wvalue >> 1));
  368. for (i = 1; i < 37; i++) {
  369. unsigned off = (index - 1) / 8;
  370. wvalue = p_str[off] | p_str[off + 1] << 8;
  371. wvalue = (wvalue >> ((index - 1) % 8)) & kMask;
  372. index += kWindowSize;
  373. wvalue = booth_recode_w7(wvalue);
  374. ecp_nistz256_select_w7(&t.a, precomputed_table[i], wvalue >> 1);
  375. ecp_nistz256_neg(t.p.Z, t.a.Y);
  376. copy_conditional(t.a.Y, t.p.Z, wvalue & 1);
  377. ecp_nistz256_point_add_affine(&p.p, &p.p, &t.a);
  378. }
  379. }
  380. const int p_is_infinity = g_scalar == NULL;
  381. if (p_scalar != NULL) {
  382. P256_POINT *out = &t.p;
  383. if (p_is_infinity) {
  384. out = &p.p;
  385. }
  386. if (!ecp_nistz256_windowed_mul(group, out, p_, p_scalar, ctx)) {
  387. goto err;
  388. }
  389. if (!p_is_infinity) {
  390. ecp_nistz256_point_add(&p.p, &p.p, out);
  391. }
  392. }
  393. /* Not constant-time, but we're only operating on the public output. */
  394. if (!bn_set_words(&r->X, p.p.X, P256_LIMBS) ||
  395. !bn_set_words(&r->Y, p.p.Y, P256_LIMBS) ||
  396. !bn_set_words(&r->Z, p.p.Z, P256_LIMBS)) {
  397. return 0;
  398. }
  399. ret = 1;
  400. err:
  401. if (ctx_started) {
  402. BN_CTX_end(ctx);
  403. }
  404. BN_CTX_free(new_ctx);
  405. return ret;
  406. }
  407. static int ecp_nistz256_get_affine(const EC_GROUP *group, const EC_POINT *point,
  408. BIGNUM *x, BIGNUM *y, BN_CTX *ctx) {
  409. BN_ULONG z_inv2[P256_LIMBS];
  410. BN_ULONG z_inv3[P256_LIMBS];
  411. BN_ULONG point_x[P256_LIMBS], point_y[P256_LIMBS], point_z[P256_LIMBS];
  412. if (EC_POINT_is_at_infinity(group, point)) {
  413. OPENSSL_PUT_ERROR(EC, EC_R_POINT_AT_INFINITY);
  414. return 0;
  415. }
  416. if (!ecp_nistz256_bignum_to_field_elem(point_x, &point->X) ||
  417. !ecp_nistz256_bignum_to_field_elem(point_y, &point->Y) ||
  418. !ecp_nistz256_bignum_to_field_elem(point_z, &point->Z)) {
  419. OPENSSL_PUT_ERROR(EC, EC_R_COORDINATES_OUT_OF_RANGE);
  420. return 0;
  421. }
  422. ecp_nistz256_mod_inverse_mont(z_inv3, point_z);
  423. ecp_nistz256_sqr_mont(z_inv2, z_inv3);
  424. /* TODO(davidben): The two calls to |ecp_nistz256_from_mont| may be factored
  425. * into one call now that other operations also reduce mod P. */
  426. if (x != NULL) {
  427. BN_ULONG x_aff[P256_LIMBS];
  428. ecp_nistz256_mul_mont(x_aff, z_inv2, point_x);
  429. ecp_nistz256_from_mont(x_aff, x_aff);
  430. if (!bn_set_words(x, x_aff, P256_LIMBS)) {
  431. OPENSSL_PUT_ERROR(EC, ERR_R_MALLOC_FAILURE);
  432. return 0;
  433. }
  434. }
  435. if (y != NULL) {
  436. BN_ULONG y_aff[P256_LIMBS];
  437. ecp_nistz256_mul_mont(z_inv3, z_inv3, z_inv2);
  438. ecp_nistz256_mul_mont(y_aff, z_inv3, point_y);
  439. ecp_nistz256_from_mont(y_aff, y_aff);
  440. if (!bn_set_words(y, y_aff, P256_LIMBS)) {
  441. OPENSSL_PUT_ERROR(EC, ERR_R_MALLOC_FAILURE);
  442. return 0;
  443. }
  444. }
  445. return 1;
  446. }
  447. const EC_METHOD EC_GFp_nistz256_method = {
  448. ec_GFp_mont_group_init,
  449. ec_GFp_mont_group_finish,
  450. ec_GFp_mont_group_copy,
  451. ec_GFp_mont_group_set_curve,
  452. ecp_nistz256_get_affine,
  453. ecp_nistz256_points_mul,
  454. ec_GFp_mont_field_mul,
  455. ec_GFp_mont_field_sqr,
  456. ec_GFp_mont_field_encode,
  457. ec_GFp_mont_field_decode,
  458. };
  459. #endif /* !defined(OPENSSL_NO_ASM) && defined(OPENSSL_X86_64) && \
  460. !defined(OPENSSL_SMALL) */