wolfSSL SSL/TLS library, support up to TLS1.3
Dependents: CyaSSL-Twitter-OAuth4Tw Example-client-tls-cert TwitterReader TweetTest ... more
wolfcrypt/src/ge_low_mem.c@17:a5f916481144, 2020-06-05 (annotated)
- Committer:
- wolfSSL
- Date:
- Fri Jun 05 00:11:07 2020 +0000
- Revision:
- 17:a5f916481144
- Parent:
- 16:8e0d178b1d1e
wolfSSL 4.4.0
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
wolfSSL | 15:117db924cf7c | 1 | /* ge_low_mem.c |
wolfSSL | 15:117db924cf7c | 2 | * |
wolfSSL | 16:8e0d178b1d1e | 3 | * Copyright (C) 2006-2020 wolfSSL Inc. |
wolfSSL | 15:117db924cf7c | 4 | * |
wolfSSL | 15:117db924cf7c | 5 | * This file is part of wolfSSL. |
wolfSSL | 15:117db924cf7c | 6 | * |
wolfSSL | 15:117db924cf7c | 7 | * wolfSSL is free software; you can redistribute it and/or modify |
wolfSSL | 15:117db924cf7c | 8 | * it under the terms of the GNU General Public License as published by |
wolfSSL | 15:117db924cf7c | 9 | * the Free Software Foundation; either version 2 of the License, or |
wolfSSL | 15:117db924cf7c | 10 | * (at your option) any later version. |
wolfSSL | 15:117db924cf7c | 11 | * |
wolfSSL | 15:117db924cf7c | 12 | * wolfSSL is distributed in the hope that it will be useful, |
wolfSSL | 15:117db924cf7c | 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
wolfSSL | 15:117db924cf7c | 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
wolfSSL | 15:117db924cf7c | 15 | * GNU General Public License for more details. |
wolfSSL | 15:117db924cf7c | 16 | * |
wolfSSL | 15:117db924cf7c | 17 | * You should have received a copy of the GNU General Public License |
wolfSSL | 15:117db924cf7c | 18 | * along with this program; if not, write to the Free Software |
wolfSSL | 15:117db924cf7c | 19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA |
wolfSSL | 15:117db924cf7c | 20 | */ |
wolfSSL | 15:117db924cf7c | 21 | |
wolfSSL | 15:117db924cf7c | 22 | |
wolfSSL | 15:117db924cf7c | 23 | /* Based from Daniel Beer's public domain work. */ |
wolfSSL | 15:117db924cf7c | 24 | |
wolfSSL | 15:117db924cf7c | 25 | #ifdef HAVE_CONFIG_H |
wolfSSL | 15:117db924cf7c | 26 | #include <config.h> |
wolfSSL | 15:117db924cf7c | 27 | #endif |
wolfSSL | 15:117db924cf7c | 28 | |
wolfSSL | 15:117db924cf7c | 29 | #include <wolfssl/wolfcrypt/settings.h> |
wolfSSL | 15:117db924cf7c | 30 | |
wolfSSL | 15:117db924cf7c | 31 | #ifdef HAVE_ED25519 |
wolfSSL | 15:117db924cf7c | 32 | #ifdef ED25519_SMALL /* use slower code that takes less memory */ |
wolfSSL | 15:117db924cf7c | 33 | |
wolfSSL | 15:117db924cf7c | 34 | #include <wolfssl/wolfcrypt/ge_operations.h> |
wolfSSL | 15:117db924cf7c | 35 | #include <wolfssl/wolfcrypt/error-crypt.h> |
wolfSSL | 15:117db924cf7c | 36 | #ifdef NO_INLINE |
wolfSSL | 15:117db924cf7c | 37 | #include <wolfssl/wolfcrypt/misc.h> |
wolfSSL | 15:117db924cf7c | 38 | #else |
wolfSSL | 15:117db924cf7c | 39 | #define WOLFSSL_MISC_INCLUDED |
wolfSSL | 15:117db924cf7c | 40 | #include <wolfcrypt/src/misc.c> |
wolfSSL | 15:117db924cf7c | 41 | #endif |
wolfSSL | 15:117db924cf7c | 42 | |
wolfSSL | 15:117db924cf7c | 43 | void ed25519_smult(ge_p3 *r, const ge_p3 *a, const byte *e); |
wolfSSL | 15:117db924cf7c | 44 | void ed25519_add(ge_p3 *r, const ge_p3 *a, const ge_p3 *b); |
wolfSSL | 15:117db924cf7c | 45 | void ed25519_double(ge_p3 *r, const ge_p3 *a); |
wolfSSL | 15:117db924cf7c | 46 | |
wolfSSL | 15:117db924cf7c | 47 | |
wolfSSL | 15:117db924cf7c | 48 | static const byte ed25519_order[F25519_SIZE] = { |
wolfSSL | 15:117db924cf7c | 49 | 0xed, 0xd3, 0xf5, 0x5c, 0x1a, 0x63, 0x12, 0x58, |
wolfSSL | 15:117db924cf7c | 50 | 0xd6, 0x9c, 0xf7, 0xa2, 0xde, 0xf9, 0xde, 0x14, |
wolfSSL | 15:117db924cf7c | 51 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
wolfSSL | 15:117db924cf7c | 52 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10 |
wolfSSL | 15:117db924cf7c | 53 | }; |
wolfSSL | 15:117db924cf7c | 54 | |
wolfSSL | 15:117db924cf7c | 55 | /*Arithmetic modulo the group order m = 2^252 + |
wolfSSL | 15:117db924cf7c | 56 | 27742317777372353535851937790883648493 = |
wolfSSL | 15:117db924cf7c | 57 | 7237005577332262213973186563042994240857116359379907606001950938285454250989 */ |
wolfSSL | 15:117db924cf7c | 58 | |
wolfSSL | 15:117db924cf7c | 59 | static const word32 m[32] = { |
wolfSSL | 15:117db924cf7c | 60 | 0xED,0xD3,0xF5,0x5C,0x1A,0x63,0x12,0x58,0xD6,0x9C,0xF7,0xA2,0xDE,0xF9, |
wolfSSL | 15:117db924cf7c | 61 | 0xDE,0x14,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, |
wolfSSL | 15:117db924cf7c | 62 | 0x00,0x00,0x00,0x10 |
wolfSSL | 15:117db924cf7c | 63 | }; |
wolfSSL | 15:117db924cf7c | 64 | |
wolfSSL | 15:117db924cf7c | 65 | static const word32 mu[33] = { |
wolfSSL | 15:117db924cf7c | 66 | 0x1B,0x13,0x2C,0x0A,0xA3,0xE5,0x9C,0xED,0xA7,0x29,0x63,0x08,0x5D,0x21, |
wolfSSL | 15:117db924cf7c | 67 | 0x06,0x21,0xEB,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, |
wolfSSL | 15:117db924cf7c | 68 | 0xFF,0xFF,0xFF,0xFF,0x0F |
wolfSSL | 15:117db924cf7c | 69 | }; |
wolfSSL | 15:117db924cf7c | 70 | |
wolfSSL | 15:117db924cf7c | 71 | |
wolfSSL | 15:117db924cf7c | 72 | int ge_compress_key(byte* out, const byte* xIn, const byte* yIn, |
wolfSSL | 15:117db924cf7c | 73 | word32 keySz) |
wolfSSL | 15:117db924cf7c | 74 | { |
wolfSSL | 15:117db924cf7c | 75 | byte tmp[F25519_SIZE]; |
wolfSSL | 15:117db924cf7c | 76 | byte parity; |
wolfSSL | 15:117db924cf7c | 77 | byte pt[32]; |
wolfSSL | 15:117db924cf7c | 78 | int i; |
wolfSSL | 15:117db924cf7c | 79 | |
wolfSSL | 15:117db924cf7c | 80 | lm_copy(tmp, xIn); |
wolfSSL | 15:117db924cf7c | 81 | parity = (tmp[0] & 1) << 7; |
wolfSSL | 15:117db924cf7c | 82 | |
wolfSSL | 15:117db924cf7c | 83 | lm_copy(pt, yIn); |
wolfSSL | 15:117db924cf7c | 84 | pt[31] |= parity; |
wolfSSL | 15:117db924cf7c | 85 | |
wolfSSL | 15:117db924cf7c | 86 | for(i = 0; i < 32; i++) { |
wolfSSL | 15:117db924cf7c | 87 | out[32-i-1] = pt[i]; |
wolfSSL | 15:117db924cf7c | 88 | } |
wolfSSL | 15:117db924cf7c | 89 | (void)keySz; |
wolfSSL | 15:117db924cf7c | 90 | return 0; |
wolfSSL | 15:117db924cf7c | 91 | } |
wolfSSL | 15:117db924cf7c | 92 | |
wolfSSL | 15:117db924cf7c | 93 | |
wolfSSL | 15:117db924cf7c | 94 | static word32 lt(word32 a,word32 b) /* 16-bit inputs */ |
wolfSSL | 15:117db924cf7c | 95 | { |
wolfSSL | 16:8e0d178b1d1e | 96 | word32 x = a; |
wolfSSL | 15:117db924cf7c | 97 | x -= (unsigned int) b; /* 0..65535: no; 4294901761..4294967295: yes */ |
wolfSSL | 15:117db924cf7c | 98 | x >>= 31; /* 0: no; 1: yes */ |
wolfSSL | 15:117db924cf7c | 99 | return x; |
wolfSSL | 15:117db924cf7c | 100 | } |
wolfSSL | 15:117db924cf7c | 101 | |
wolfSSL | 15:117db924cf7c | 102 | |
wolfSSL | 15:117db924cf7c | 103 | /* Reduce coefficients of r before calling reduce_add_sub */ |
wolfSSL | 15:117db924cf7c | 104 | static void reduce_add_sub(word32 *r) |
wolfSSL | 15:117db924cf7c | 105 | { |
wolfSSL | 15:117db924cf7c | 106 | word32 pb = 0; |
wolfSSL | 15:117db924cf7c | 107 | word32 b; |
wolfSSL | 15:117db924cf7c | 108 | word32 mask; |
wolfSSL | 15:117db924cf7c | 109 | int i; |
wolfSSL | 15:117db924cf7c | 110 | unsigned char t[32]; |
wolfSSL | 15:117db924cf7c | 111 | |
wolfSSL | 15:117db924cf7c | 112 | for(i=0;i<32;i++) |
wolfSSL | 15:117db924cf7c | 113 | { |
wolfSSL | 15:117db924cf7c | 114 | pb += m[i]; |
wolfSSL | 15:117db924cf7c | 115 | b = lt(r[i],pb); |
wolfSSL | 15:117db924cf7c | 116 | t[i] = r[i]-pb+(b<<8); |
wolfSSL | 15:117db924cf7c | 117 | pb = b; |
wolfSSL | 15:117db924cf7c | 118 | } |
wolfSSL | 15:117db924cf7c | 119 | mask = b - 1; |
wolfSSL | 15:117db924cf7c | 120 | for(i=0;i<32;i++) |
wolfSSL | 15:117db924cf7c | 121 | r[i] ^= mask & (r[i] ^ t[i]); |
wolfSSL | 15:117db924cf7c | 122 | } |
wolfSSL | 15:117db924cf7c | 123 | |
wolfSSL | 15:117db924cf7c | 124 | |
wolfSSL | 15:117db924cf7c | 125 | /* Reduce coefficients of x before calling barrett_reduce */ |
wolfSSL | 15:117db924cf7c | 126 | static void barrett_reduce(word32* r, word32 x[64]) |
wolfSSL | 15:117db924cf7c | 127 | { |
wolfSSL | 15:117db924cf7c | 128 | /* See HAC, Alg. 14.42 */ |
wolfSSL | 15:117db924cf7c | 129 | int i,j; |
wolfSSL | 15:117db924cf7c | 130 | word32 q2[66]; |
wolfSSL | 15:117db924cf7c | 131 | word32 *q3 = q2 + 33; |
wolfSSL | 15:117db924cf7c | 132 | word32 r1[33]; |
wolfSSL | 15:117db924cf7c | 133 | word32 r2[33]; |
wolfSSL | 15:117db924cf7c | 134 | word32 carry; |
wolfSSL | 15:117db924cf7c | 135 | word32 pb = 0; |
wolfSSL | 15:117db924cf7c | 136 | word32 b; |
wolfSSL | 15:117db924cf7c | 137 | |
wolfSSL | 15:117db924cf7c | 138 | for (i = 0;i < 66;++i) q2[i] = 0; |
wolfSSL | 15:117db924cf7c | 139 | for (i = 0;i < 33;++i) r2[i] = 0; |
wolfSSL | 15:117db924cf7c | 140 | |
wolfSSL | 15:117db924cf7c | 141 | for(i=0;i<33;i++) |
wolfSSL | 15:117db924cf7c | 142 | for(j=0;j<33;j++) |
wolfSSL | 15:117db924cf7c | 143 | if(i+j >= 31) q2[i+j] += mu[i]*x[j+31]; |
wolfSSL | 15:117db924cf7c | 144 | carry = q2[31] >> 8; |
wolfSSL | 15:117db924cf7c | 145 | q2[32] += carry; |
wolfSSL | 15:117db924cf7c | 146 | carry = q2[32] >> 8; |
wolfSSL | 15:117db924cf7c | 147 | q2[33] += carry; |
wolfSSL | 15:117db924cf7c | 148 | |
wolfSSL | 15:117db924cf7c | 149 | for(i=0;i<33;i++)r1[i] = x[i]; |
wolfSSL | 15:117db924cf7c | 150 | for(i=0;i<32;i++) |
wolfSSL | 15:117db924cf7c | 151 | for(j=0;j<33;j++) |
wolfSSL | 15:117db924cf7c | 152 | if(i+j < 33) r2[i+j] += m[i]*q3[j]; |
wolfSSL | 15:117db924cf7c | 153 | |
wolfSSL | 15:117db924cf7c | 154 | for(i=0;i<32;i++) |
wolfSSL | 15:117db924cf7c | 155 | { |
wolfSSL | 15:117db924cf7c | 156 | carry = r2[i] >> 8; |
wolfSSL | 15:117db924cf7c | 157 | r2[i+1] += carry; |
wolfSSL | 15:117db924cf7c | 158 | r2[i] &= 0xff; |
wolfSSL | 15:117db924cf7c | 159 | } |
wolfSSL | 15:117db924cf7c | 160 | |
wolfSSL | 15:117db924cf7c | 161 | for(i=0;i<32;i++) |
wolfSSL | 15:117db924cf7c | 162 | { |
wolfSSL | 15:117db924cf7c | 163 | pb += r2[i]; |
wolfSSL | 15:117db924cf7c | 164 | b = lt(r1[i],pb); |
wolfSSL | 15:117db924cf7c | 165 | r[i] = r1[i]-pb+(b<<8); |
wolfSSL | 15:117db924cf7c | 166 | pb = b; |
wolfSSL | 15:117db924cf7c | 167 | } |
wolfSSL | 15:117db924cf7c | 168 | |
wolfSSL | 15:117db924cf7c | 169 | /* XXX: Can it really happen that r<0?, See HAC, Alg 14.42, Step 3 |
wolfSSL | 15:117db924cf7c | 170 | * r is an unsigned type. |
wolfSSL | 15:117db924cf7c | 171 | * If so: Handle it here! |
wolfSSL | 15:117db924cf7c | 172 | */ |
wolfSSL | 15:117db924cf7c | 173 | |
wolfSSL | 15:117db924cf7c | 174 | reduce_add_sub(r); |
wolfSSL | 15:117db924cf7c | 175 | reduce_add_sub(r); |
wolfSSL | 15:117db924cf7c | 176 | } |
wolfSSL | 15:117db924cf7c | 177 | |
wolfSSL | 15:117db924cf7c | 178 | |
wolfSSL | 15:117db924cf7c | 179 | void sc_reduce(unsigned char x[64]) |
wolfSSL | 15:117db924cf7c | 180 | { |
wolfSSL | 15:117db924cf7c | 181 | int i; |
wolfSSL | 15:117db924cf7c | 182 | word32 t[64]; |
wolfSSL | 15:117db924cf7c | 183 | word32 r[32]; |
wolfSSL | 15:117db924cf7c | 184 | for(i=0;i<64;i++) t[i] = x[i]; |
wolfSSL | 15:117db924cf7c | 185 | barrett_reduce(r, t); |
wolfSSL | 15:117db924cf7c | 186 | for(i=0;i<32;i++) x[i] = (r[i] & 0xFF); |
wolfSSL | 15:117db924cf7c | 187 | } |
wolfSSL | 15:117db924cf7c | 188 | |
wolfSSL | 15:117db924cf7c | 189 | |
wolfSSL | 15:117db924cf7c | 190 | void sc_muladd(byte* out, const byte* a, const byte* b, const byte* c) |
wolfSSL | 15:117db924cf7c | 191 | { |
wolfSSL | 15:117db924cf7c | 192 | |
wolfSSL | 15:117db924cf7c | 193 | byte s[32]; |
wolfSSL | 15:117db924cf7c | 194 | byte e[64]; |
wolfSSL | 15:117db924cf7c | 195 | |
wolfSSL | 15:117db924cf7c | 196 | XMEMSET(e, 0, sizeof(e)); |
wolfSSL | 15:117db924cf7c | 197 | XMEMCPY(e, b, 32); |
wolfSSL | 15:117db924cf7c | 198 | |
wolfSSL | 15:117db924cf7c | 199 | /* Obtain e */ |
wolfSSL | 15:117db924cf7c | 200 | sc_reduce(e); |
wolfSSL | 15:117db924cf7c | 201 | |
wolfSSL | 15:117db924cf7c | 202 | /* Compute s = ze + k */ |
wolfSSL | 15:117db924cf7c | 203 | fprime_mul(s, a, e, ed25519_order); |
wolfSSL | 15:117db924cf7c | 204 | fprime_add(s, c, ed25519_order); |
wolfSSL | 15:117db924cf7c | 205 | |
wolfSSL | 15:117db924cf7c | 206 | XMEMCPY(out, s, 32); |
wolfSSL | 15:117db924cf7c | 207 | } |
wolfSSL | 15:117db924cf7c | 208 | |
wolfSSL | 15:117db924cf7c | 209 | |
wolfSSL | 15:117db924cf7c | 210 | /* Base point is (numbers wrapped): |
wolfSSL | 15:117db924cf7c | 211 | * |
wolfSSL | 15:117db924cf7c | 212 | * x = 151122213495354007725011514095885315114 |
wolfSSL | 15:117db924cf7c | 213 | * 54012693041857206046113283949847762202 |
wolfSSL | 15:117db924cf7c | 214 | * y = 463168356949264781694283940034751631413 |
wolfSSL | 15:117db924cf7c | 215 | * 07993866256225615783033603165251855960 |
wolfSSL | 15:117db924cf7c | 216 | * |
wolfSSL | 15:117db924cf7c | 217 | * y is derived by transforming the original Montgomery base (u=9). x |
wolfSSL | 15:117db924cf7c | 218 | * is the corresponding positive coordinate for the new curve equation. |
wolfSSL | 15:117db924cf7c | 219 | * t is x*y. |
wolfSSL | 15:117db924cf7c | 220 | */ |
wolfSSL | 15:117db924cf7c | 221 | const ge_p3 ed25519_base = { |
wolfSSL | 15:117db924cf7c | 222 | { |
wolfSSL | 15:117db924cf7c | 223 | 0x1a, 0xd5, 0x25, 0x8f, 0x60, 0x2d, 0x56, 0xc9, |
wolfSSL | 15:117db924cf7c | 224 | 0xb2, 0xa7, 0x25, 0x95, 0x60, 0xc7, 0x2c, 0x69, |
wolfSSL | 15:117db924cf7c | 225 | 0x5c, 0xdc, 0xd6, 0xfd, 0x31, 0xe2, 0xa4, 0xc0, |
wolfSSL | 15:117db924cf7c | 226 | 0xfe, 0x53, 0x6e, 0xcd, 0xd3, 0x36, 0x69, 0x21 |
wolfSSL | 15:117db924cf7c | 227 | }, |
wolfSSL | 15:117db924cf7c | 228 | { |
wolfSSL | 15:117db924cf7c | 229 | 0x58, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, |
wolfSSL | 15:117db924cf7c | 230 | 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, |
wolfSSL | 15:117db924cf7c | 231 | 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, |
wolfSSL | 15:117db924cf7c | 232 | 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66 |
wolfSSL | 15:117db924cf7c | 233 | }, |
wolfSSL | 15:117db924cf7c | 234 | {1, 0}, |
wolfSSL | 15:117db924cf7c | 235 | { |
wolfSSL | 15:117db924cf7c | 236 | 0xa3, 0xdd, 0xb7, 0xa5, 0xb3, 0x8a, 0xde, 0x6d, |
wolfSSL | 15:117db924cf7c | 237 | 0xf5, 0x52, 0x51, 0x77, 0x80, 0x9f, 0xf0, 0x20, |
wolfSSL | 15:117db924cf7c | 238 | 0x7d, 0xe3, 0xab, 0x64, 0x8e, 0x4e, 0xea, 0x66, |
wolfSSL | 15:117db924cf7c | 239 | 0x65, 0x76, 0x8b, 0xd7, 0x0f, 0x5f, 0x87, 0x67 |
wolfSSL | 15:117db924cf7c | 240 | }, |
wolfSSL | 15:117db924cf7c | 241 | |
wolfSSL | 15:117db924cf7c | 242 | }; |
wolfSSL | 15:117db924cf7c | 243 | |
wolfSSL | 15:117db924cf7c | 244 | |
wolfSSL | 15:117db924cf7c | 245 | const ge_p3 ed25519_neutral = { |
wolfSSL | 15:117db924cf7c | 246 | {0}, |
wolfSSL | 15:117db924cf7c | 247 | {1, 0}, |
wolfSSL | 15:117db924cf7c | 248 | {1, 0}, |
wolfSSL | 15:117db924cf7c | 249 | {0}, |
wolfSSL | 15:117db924cf7c | 250 | |
wolfSSL | 15:117db924cf7c | 251 | }; |
wolfSSL | 15:117db924cf7c | 252 | |
wolfSSL | 15:117db924cf7c | 253 | |
wolfSSL | 15:117db924cf7c | 254 | static const byte ed25519_d[F25519_SIZE] = { |
wolfSSL | 15:117db924cf7c | 255 | 0xa3, 0x78, 0x59, 0x13, 0xca, 0x4d, 0xeb, 0x75, |
wolfSSL | 15:117db924cf7c | 256 | 0xab, 0xd8, 0x41, 0x41, 0x4d, 0x0a, 0x70, 0x00, |
wolfSSL | 15:117db924cf7c | 257 | 0x98, 0xe8, 0x79, 0x77, 0x79, 0x40, 0xc7, 0x8c, |
wolfSSL | 15:117db924cf7c | 258 | 0x73, 0xfe, 0x6f, 0x2b, 0xee, 0x6c, 0x03, 0x52 |
wolfSSL | 15:117db924cf7c | 259 | }; |
wolfSSL | 15:117db924cf7c | 260 | |
wolfSSL | 15:117db924cf7c | 261 | |
wolfSSL | 15:117db924cf7c | 262 | /* k = 2d */ |
wolfSSL | 15:117db924cf7c | 263 | static const byte ed25519_k[F25519_SIZE] = { |
wolfSSL | 15:117db924cf7c | 264 | 0x59, 0xf1, 0xb2, 0x26, 0x94, 0x9b, 0xd6, 0xeb, |
wolfSSL | 15:117db924cf7c | 265 | 0x56, 0xb1, 0x83, 0x82, 0x9a, 0x14, 0xe0, 0x00, |
wolfSSL | 15:117db924cf7c | 266 | 0x30, 0xd1, 0xf3, 0xee, 0xf2, 0x80, 0x8e, 0x19, |
wolfSSL | 15:117db924cf7c | 267 | 0xe7, 0xfc, 0xdf, 0x56, 0xdc, 0xd9, 0x06, 0x24 |
wolfSSL | 15:117db924cf7c | 268 | }; |
wolfSSL | 15:117db924cf7c | 269 | |
wolfSSL | 15:117db924cf7c | 270 | |
wolfSSL | 15:117db924cf7c | 271 | void ed25519_add(ge_p3 *r, |
wolfSSL | 15:117db924cf7c | 272 | const ge_p3 *p1, const ge_p3 *p2) |
wolfSSL | 15:117db924cf7c | 273 | { |
wolfSSL | 15:117db924cf7c | 274 | /* Explicit formulas database: add-2008-hwcd-3 |
wolfSSL | 15:117db924cf7c | 275 | * |
wolfSSL | 15:117db924cf7c | 276 | * source 2008 Hisil--Wong--Carter--Dawson, |
wolfSSL | 15:117db924cf7c | 277 | * http://eprint.iacr.org/2008/522, Section 3.1 |
wolfSSL | 15:117db924cf7c | 278 | * appliesto extended-1 |
wolfSSL | 15:117db924cf7c | 279 | * parameter k |
wolfSSL | 15:117db924cf7c | 280 | * assume k = 2 d |
wolfSSL | 15:117db924cf7c | 281 | * compute A = (Y1-X1)(Y2-X2) |
wolfSSL | 15:117db924cf7c | 282 | * compute B = (Y1+X1)(Y2+X2) |
wolfSSL | 15:117db924cf7c | 283 | * compute C = T1 k T2 |
wolfSSL | 15:117db924cf7c | 284 | * compute D = Z1 2 Z2 |
wolfSSL | 15:117db924cf7c | 285 | * compute E = B - A |
wolfSSL | 15:117db924cf7c | 286 | * compute F = D - C |
wolfSSL | 15:117db924cf7c | 287 | * compute G = D + C |
wolfSSL | 15:117db924cf7c | 288 | * compute H = B + A |
wolfSSL | 15:117db924cf7c | 289 | * compute X3 = E F |
wolfSSL | 15:117db924cf7c | 290 | * compute Y3 = G H |
wolfSSL | 15:117db924cf7c | 291 | * compute T3 = E H |
wolfSSL | 15:117db924cf7c | 292 | * compute Z3 = F G |
wolfSSL | 15:117db924cf7c | 293 | */ |
wolfSSL | 15:117db924cf7c | 294 | byte a[F25519_SIZE]; |
wolfSSL | 15:117db924cf7c | 295 | byte b[F25519_SIZE]; |
wolfSSL | 15:117db924cf7c | 296 | byte c[F25519_SIZE]; |
wolfSSL | 15:117db924cf7c | 297 | byte d[F25519_SIZE]; |
wolfSSL | 15:117db924cf7c | 298 | byte e[F25519_SIZE]; |
wolfSSL | 15:117db924cf7c | 299 | byte f[F25519_SIZE]; |
wolfSSL | 15:117db924cf7c | 300 | byte g[F25519_SIZE]; |
wolfSSL | 15:117db924cf7c | 301 | byte h[F25519_SIZE]; |
wolfSSL | 15:117db924cf7c | 302 | |
wolfSSL | 15:117db924cf7c | 303 | /* A = (Y1-X1)(Y2-X2) */ |
wolfSSL | 15:117db924cf7c | 304 | lm_sub(c, p1->Y, p1->X); |
wolfSSL | 15:117db924cf7c | 305 | lm_sub(d, p2->Y, p2->X); |
wolfSSL | 15:117db924cf7c | 306 | fe_mul__distinct(a, c, d); |
wolfSSL | 15:117db924cf7c | 307 | |
wolfSSL | 15:117db924cf7c | 308 | /* B = (Y1+X1)(Y2+X2) */ |
wolfSSL | 15:117db924cf7c | 309 | lm_add(c, p1->Y, p1->X); |
wolfSSL | 15:117db924cf7c | 310 | lm_add(d, p2->Y, p2->X); |
wolfSSL | 15:117db924cf7c | 311 | fe_mul__distinct(b, c, d); |
wolfSSL | 15:117db924cf7c | 312 | |
wolfSSL | 15:117db924cf7c | 313 | /* C = T1 k T2 */ |
wolfSSL | 15:117db924cf7c | 314 | fe_mul__distinct(d, p1->T, p2->T); |
wolfSSL | 15:117db924cf7c | 315 | fe_mul__distinct(c, d, ed25519_k); |
wolfSSL | 15:117db924cf7c | 316 | |
wolfSSL | 15:117db924cf7c | 317 | /* D = Z1 2 Z2 */ |
wolfSSL | 15:117db924cf7c | 318 | fe_mul__distinct(d, p1->Z, p2->Z); |
wolfSSL | 15:117db924cf7c | 319 | lm_add(d, d, d); |
wolfSSL | 15:117db924cf7c | 320 | |
wolfSSL | 15:117db924cf7c | 321 | /* E = B - A */ |
wolfSSL | 15:117db924cf7c | 322 | lm_sub(e, b, a); |
wolfSSL | 15:117db924cf7c | 323 | |
wolfSSL | 15:117db924cf7c | 324 | /* F = D - C */ |
wolfSSL | 15:117db924cf7c | 325 | lm_sub(f, d, c); |
wolfSSL | 15:117db924cf7c | 326 | |
wolfSSL | 15:117db924cf7c | 327 | /* G = D + C */ |
wolfSSL | 15:117db924cf7c | 328 | lm_add(g, d, c); |
wolfSSL | 15:117db924cf7c | 329 | |
wolfSSL | 15:117db924cf7c | 330 | /* H = B + A */ |
wolfSSL | 15:117db924cf7c | 331 | lm_add(h, b, a); |
wolfSSL | 15:117db924cf7c | 332 | |
wolfSSL | 15:117db924cf7c | 333 | /* X3 = E F */ |
wolfSSL | 15:117db924cf7c | 334 | fe_mul__distinct(r->X, e, f); |
wolfSSL | 15:117db924cf7c | 335 | |
wolfSSL | 15:117db924cf7c | 336 | /* Y3 = G H */ |
wolfSSL | 15:117db924cf7c | 337 | fe_mul__distinct(r->Y, g, h); |
wolfSSL | 15:117db924cf7c | 338 | |
wolfSSL | 15:117db924cf7c | 339 | /* T3 = E H */ |
wolfSSL | 15:117db924cf7c | 340 | fe_mul__distinct(r->T, e, h); |
wolfSSL | 15:117db924cf7c | 341 | |
wolfSSL | 15:117db924cf7c | 342 | /* Z3 = F G */ |
wolfSSL | 15:117db924cf7c | 343 | fe_mul__distinct(r->Z, f, g); |
wolfSSL | 15:117db924cf7c | 344 | } |
wolfSSL | 15:117db924cf7c | 345 | |
wolfSSL | 15:117db924cf7c | 346 | |
wolfSSL | 15:117db924cf7c | 347 | void ed25519_double(ge_p3 *r, const ge_p3 *p) |
wolfSSL | 15:117db924cf7c | 348 | { |
wolfSSL | 15:117db924cf7c | 349 | /* Explicit formulas database: dbl-2008-hwcd |
wolfSSL | 15:117db924cf7c | 350 | * |
wolfSSL | 15:117db924cf7c | 351 | * source 2008 Hisil--Wong--Carter--Dawson, |
wolfSSL | 15:117db924cf7c | 352 | * http://eprint.iacr.org/2008/522, Section 3.3 |
wolfSSL | 15:117db924cf7c | 353 | * compute A = X1^2 |
wolfSSL | 15:117db924cf7c | 354 | * compute B = Y1^2 |
wolfSSL | 15:117db924cf7c | 355 | * compute C = 2 Z1^2 |
wolfSSL | 15:117db924cf7c | 356 | * compute D = a A |
wolfSSL | 15:117db924cf7c | 357 | * compute E = (X1+Y1)^2-A-B |
wolfSSL | 15:117db924cf7c | 358 | * compute G = D + B |
wolfSSL | 15:117db924cf7c | 359 | * compute F = G - C |
wolfSSL | 15:117db924cf7c | 360 | * compute H = D - B |
wolfSSL | 15:117db924cf7c | 361 | * compute X3 = E F |
wolfSSL | 15:117db924cf7c | 362 | * compute Y3 = G H |
wolfSSL | 15:117db924cf7c | 363 | * compute T3 = E H |
wolfSSL | 15:117db924cf7c | 364 | * compute Z3 = F G |
wolfSSL | 15:117db924cf7c | 365 | */ |
wolfSSL | 15:117db924cf7c | 366 | byte a[F25519_SIZE]; |
wolfSSL | 15:117db924cf7c | 367 | byte b[F25519_SIZE]; |
wolfSSL | 15:117db924cf7c | 368 | byte c[F25519_SIZE]; |
wolfSSL | 15:117db924cf7c | 369 | byte e[F25519_SIZE]; |
wolfSSL | 15:117db924cf7c | 370 | byte f[F25519_SIZE]; |
wolfSSL | 15:117db924cf7c | 371 | byte g[F25519_SIZE]; |
wolfSSL | 15:117db924cf7c | 372 | byte h[F25519_SIZE]; |
wolfSSL | 15:117db924cf7c | 373 | |
wolfSSL | 15:117db924cf7c | 374 | /* A = X1^2 */ |
wolfSSL | 15:117db924cf7c | 375 | fe_mul__distinct(a, p->X, p->X); |
wolfSSL | 15:117db924cf7c | 376 | |
wolfSSL | 15:117db924cf7c | 377 | /* B = Y1^2 */ |
wolfSSL | 15:117db924cf7c | 378 | fe_mul__distinct(b, p->Y, p->Y); |
wolfSSL | 15:117db924cf7c | 379 | |
wolfSSL | 15:117db924cf7c | 380 | /* C = 2 Z1^2 */ |
wolfSSL | 15:117db924cf7c | 381 | fe_mul__distinct(c, p->Z, p->Z); |
wolfSSL | 15:117db924cf7c | 382 | lm_add(c, c, c); |
wolfSSL | 15:117db924cf7c | 383 | |
wolfSSL | 15:117db924cf7c | 384 | /* D = a A (alter sign) */ |
wolfSSL | 15:117db924cf7c | 385 | /* E = (X1+Y1)^2-A-B */ |
wolfSSL | 15:117db924cf7c | 386 | lm_add(f, p->X, p->Y); |
wolfSSL | 15:117db924cf7c | 387 | fe_mul__distinct(e, f, f); |
wolfSSL | 15:117db924cf7c | 388 | lm_sub(e, e, a); |
wolfSSL | 15:117db924cf7c | 389 | lm_sub(e, e, b); |
wolfSSL | 15:117db924cf7c | 390 | |
wolfSSL | 15:117db924cf7c | 391 | /* G = D + B */ |
wolfSSL | 15:117db924cf7c | 392 | lm_sub(g, b, a); |
wolfSSL | 15:117db924cf7c | 393 | |
wolfSSL | 15:117db924cf7c | 394 | /* F = G - C */ |
wolfSSL | 15:117db924cf7c | 395 | lm_sub(f, g, c); |
wolfSSL | 15:117db924cf7c | 396 | |
wolfSSL | 15:117db924cf7c | 397 | /* H = D - B */ |
wolfSSL | 15:117db924cf7c | 398 | lm_neg(h, b); |
wolfSSL | 15:117db924cf7c | 399 | lm_sub(h, h, a); |
wolfSSL | 15:117db924cf7c | 400 | |
wolfSSL | 15:117db924cf7c | 401 | /* X3 = E F */ |
wolfSSL | 15:117db924cf7c | 402 | fe_mul__distinct(r->X, e, f); |
wolfSSL | 15:117db924cf7c | 403 | |
wolfSSL | 15:117db924cf7c | 404 | /* Y3 = G H */ |
wolfSSL | 15:117db924cf7c | 405 | fe_mul__distinct(r->Y, g, h); |
wolfSSL | 15:117db924cf7c | 406 | |
wolfSSL | 15:117db924cf7c | 407 | /* T3 = E H */ |
wolfSSL | 15:117db924cf7c | 408 | fe_mul__distinct(r->T, e, h); |
wolfSSL | 15:117db924cf7c | 409 | |
wolfSSL | 15:117db924cf7c | 410 | /* Z3 = F G */ |
wolfSSL | 15:117db924cf7c | 411 | fe_mul__distinct(r->Z, f, g); |
wolfSSL | 15:117db924cf7c | 412 | } |
wolfSSL | 15:117db924cf7c | 413 | |
wolfSSL | 15:117db924cf7c | 414 | |
wolfSSL | 15:117db924cf7c | 415 | void ed25519_smult(ge_p3 *r_out, const ge_p3 *p, const byte *e) |
wolfSSL | 15:117db924cf7c | 416 | { |
wolfSSL | 15:117db924cf7c | 417 | ge_p3 r; |
wolfSSL | 15:117db924cf7c | 418 | int i; |
wolfSSL | 15:117db924cf7c | 419 | |
wolfSSL | 15:117db924cf7c | 420 | XMEMCPY(&r, &ed25519_neutral, sizeof(r)); |
wolfSSL | 15:117db924cf7c | 421 | |
wolfSSL | 15:117db924cf7c | 422 | for (i = 255; i >= 0; i--) { |
wolfSSL | 15:117db924cf7c | 423 | const byte bit = (e[i >> 3] >> (i & 7)) & 1; |
wolfSSL | 15:117db924cf7c | 424 | ge_p3 s; |
wolfSSL | 15:117db924cf7c | 425 | |
wolfSSL | 15:117db924cf7c | 426 | ed25519_double(&r, &r); |
wolfSSL | 15:117db924cf7c | 427 | ed25519_add(&s, &r, p); |
wolfSSL | 15:117db924cf7c | 428 | |
wolfSSL | 15:117db924cf7c | 429 | fe_select(r.X, r.X, s.X, bit); |
wolfSSL | 15:117db924cf7c | 430 | fe_select(r.Y, r.Y, s.Y, bit); |
wolfSSL | 15:117db924cf7c | 431 | fe_select(r.Z, r.Z, s.Z, bit); |
wolfSSL | 15:117db924cf7c | 432 | fe_select(r.T, r.T, s.T, bit); |
wolfSSL | 15:117db924cf7c | 433 | } |
wolfSSL | 15:117db924cf7c | 434 | XMEMCPY(r_out, &r, sizeof(r)); |
wolfSSL | 15:117db924cf7c | 435 | } |
wolfSSL | 15:117db924cf7c | 436 | |
wolfSSL | 15:117db924cf7c | 437 | |
wolfSSL | 15:117db924cf7c | 438 | void ge_scalarmult_base(ge_p3 *R,const unsigned char *nonce) |
wolfSSL | 15:117db924cf7c | 439 | { |
wolfSSL | 15:117db924cf7c | 440 | ed25519_smult(R, &ed25519_base, nonce); |
wolfSSL | 15:117db924cf7c | 441 | } |
wolfSSL | 15:117db924cf7c | 442 | |
wolfSSL | 15:117db924cf7c | 443 | |
wolfSSL | 15:117db924cf7c | 444 | /* pack the point h into array s */ |
wolfSSL | 15:117db924cf7c | 445 | void ge_p3_tobytes(unsigned char *s,const ge_p3 *h) |
wolfSSL | 15:117db924cf7c | 446 | { |
wolfSSL | 15:117db924cf7c | 447 | byte x[F25519_SIZE]; |
wolfSSL | 15:117db924cf7c | 448 | byte y[F25519_SIZE]; |
wolfSSL | 15:117db924cf7c | 449 | byte z1[F25519_SIZE]; |
wolfSSL | 15:117db924cf7c | 450 | byte parity; |
wolfSSL | 15:117db924cf7c | 451 | |
wolfSSL | 15:117db924cf7c | 452 | fe_inv__distinct(z1, h->Z); |
wolfSSL | 15:117db924cf7c | 453 | fe_mul__distinct(x, h->X, z1); |
wolfSSL | 15:117db924cf7c | 454 | fe_mul__distinct(y, h->Y, z1); |
wolfSSL | 15:117db924cf7c | 455 | |
wolfSSL | 15:117db924cf7c | 456 | fe_normalize(x); |
wolfSSL | 15:117db924cf7c | 457 | fe_normalize(y); |
wolfSSL | 15:117db924cf7c | 458 | |
wolfSSL | 15:117db924cf7c | 459 | parity = (x[0] & 1) << 7; |
wolfSSL | 15:117db924cf7c | 460 | lm_copy(s, y); |
wolfSSL | 15:117db924cf7c | 461 | fe_normalize(s); |
wolfSSL | 15:117db924cf7c | 462 | s[31] |= parity; |
wolfSSL | 15:117db924cf7c | 463 | } |
wolfSSL | 15:117db924cf7c | 464 | |
wolfSSL | 15:117db924cf7c | 465 | |
wolfSSL | 15:117db924cf7c | 466 | /* pack the point h into array s */ |
wolfSSL | 15:117db924cf7c | 467 | void ge_tobytes(unsigned char *s,const ge_p2 *h) |
wolfSSL | 15:117db924cf7c | 468 | { |
wolfSSL | 15:117db924cf7c | 469 | byte x[F25519_SIZE]; |
wolfSSL | 15:117db924cf7c | 470 | byte y[F25519_SIZE]; |
wolfSSL | 15:117db924cf7c | 471 | byte z1[F25519_SIZE]; |
wolfSSL | 15:117db924cf7c | 472 | byte parity; |
wolfSSL | 15:117db924cf7c | 473 | |
wolfSSL | 15:117db924cf7c | 474 | fe_inv__distinct(z1, h->Z); |
wolfSSL | 15:117db924cf7c | 475 | fe_mul__distinct(x, h->X, z1); |
wolfSSL | 15:117db924cf7c | 476 | fe_mul__distinct(y, h->Y, z1); |
wolfSSL | 15:117db924cf7c | 477 | |
wolfSSL | 15:117db924cf7c | 478 | fe_normalize(x); |
wolfSSL | 15:117db924cf7c | 479 | fe_normalize(y); |
wolfSSL | 15:117db924cf7c | 480 | |
wolfSSL | 15:117db924cf7c | 481 | parity = (x[0] & 1) << 7; |
wolfSSL | 15:117db924cf7c | 482 | lm_copy(s, y); |
wolfSSL | 15:117db924cf7c | 483 | fe_normalize(s); |
wolfSSL | 15:117db924cf7c | 484 | s[31] |= parity; |
wolfSSL | 15:117db924cf7c | 485 | } |
wolfSSL | 15:117db924cf7c | 486 | |
wolfSSL | 15:117db924cf7c | 487 | |
wolfSSL | 15:117db924cf7c | 488 | /* |
wolfSSL | 15:117db924cf7c | 489 | Test if the public key can be uncompressed and negate it (-X,Y,Z,-T) |
wolfSSL | 15:117db924cf7c | 490 | return 0 on success |
wolfSSL | 15:117db924cf7c | 491 | */ |
wolfSSL | 15:117db924cf7c | 492 | int ge_frombytes_negate_vartime(ge_p3 *p,const unsigned char *s) |
wolfSSL | 15:117db924cf7c | 493 | { |
wolfSSL | 15:117db924cf7c | 494 | |
wolfSSL | 15:117db924cf7c | 495 | byte parity; |
wolfSSL | 15:117db924cf7c | 496 | byte x[F25519_SIZE]; |
wolfSSL | 15:117db924cf7c | 497 | byte y[F25519_SIZE]; |
wolfSSL | 15:117db924cf7c | 498 | byte a[F25519_SIZE]; |
wolfSSL | 15:117db924cf7c | 499 | byte b[F25519_SIZE]; |
wolfSSL | 15:117db924cf7c | 500 | byte c[F25519_SIZE]; |
wolfSSL | 15:117db924cf7c | 501 | int ret = 0; |
wolfSSL | 15:117db924cf7c | 502 | |
wolfSSL | 15:117db924cf7c | 503 | /* unpack the key s */ |
wolfSSL | 15:117db924cf7c | 504 | parity = s[31] >> 7; |
wolfSSL | 15:117db924cf7c | 505 | lm_copy(y, s); |
wolfSSL | 15:117db924cf7c | 506 | y[31] &= 127; |
wolfSSL | 15:117db924cf7c | 507 | |
wolfSSL | 15:117db924cf7c | 508 | fe_mul__distinct(c, y, y); |
wolfSSL | 15:117db924cf7c | 509 | fe_mul__distinct(b, c, ed25519_d); |
wolfSSL | 15:117db924cf7c | 510 | lm_add(a, b, f25519_one); |
wolfSSL | 15:117db924cf7c | 511 | fe_inv__distinct(b, a); |
wolfSSL | 15:117db924cf7c | 512 | lm_sub(a, c, f25519_one); |
wolfSSL | 15:117db924cf7c | 513 | fe_mul__distinct(c, a, b); |
wolfSSL | 15:117db924cf7c | 514 | fe_sqrt(a, c); |
wolfSSL | 15:117db924cf7c | 515 | lm_neg(b, a); |
wolfSSL | 15:117db924cf7c | 516 | fe_select(x, a, b, (a[0] ^ parity) & 1); |
wolfSSL | 15:117db924cf7c | 517 | |
wolfSSL | 15:117db924cf7c | 518 | /* test that x^2 is equal to c */ |
wolfSSL | 15:117db924cf7c | 519 | fe_mul__distinct(a, x, x); |
wolfSSL | 15:117db924cf7c | 520 | fe_normalize(a); |
wolfSSL | 15:117db924cf7c | 521 | fe_normalize(c); |
wolfSSL | 15:117db924cf7c | 522 | ret |= ConstantCompare(a, c, F25519_SIZE); |
wolfSSL | 15:117db924cf7c | 523 | |
wolfSSL | 15:117db924cf7c | 524 | /* project the key s onto p */ |
wolfSSL | 15:117db924cf7c | 525 | lm_copy(p->X, x); |
wolfSSL | 15:117db924cf7c | 526 | lm_copy(p->Y, y); |
wolfSSL | 15:117db924cf7c | 527 | fe_load(p->Z, 1); |
wolfSSL | 15:117db924cf7c | 528 | fe_mul__distinct(p->T, x, y); |
wolfSSL | 15:117db924cf7c | 529 | |
wolfSSL | 15:117db924cf7c | 530 | /* negate, the point becomes (-X,Y,Z,-T) */ |
wolfSSL | 15:117db924cf7c | 531 | lm_neg(p->X,p->X); |
wolfSSL | 15:117db924cf7c | 532 | lm_neg(p->T,p->T); |
wolfSSL | 15:117db924cf7c | 533 | |
wolfSSL | 15:117db924cf7c | 534 | return ret; |
wolfSSL | 15:117db924cf7c | 535 | } |
wolfSSL | 15:117db924cf7c | 536 | |
wolfSSL | 15:117db924cf7c | 537 | |
wolfSSL | 15:117db924cf7c | 538 | int ge_double_scalarmult_vartime(ge_p2* R, const unsigned char *h, |
wolfSSL | 15:117db924cf7c | 539 | const ge_p3 *inA,const unsigned char *sig) |
wolfSSL | 15:117db924cf7c | 540 | { |
wolfSSL | 15:117db924cf7c | 541 | ge_p3 p, A; |
wolfSSL | 15:117db924cf7c | 542 | int ret = 0; |
wolfSSL | 15:117db924cf7c | 543 | |
wolfSSL | 15:117db924cf7c | 544 | XMEMCPY(&A, inA, sizeof(ge_p3)); |
wolfSSL | 15:117db924cf7c | 545 | |
wolfSSL | 15:117db924cf7c | 546 | /* find SB */ |
wolfSSL | 15:117db924cf7c | 547 | ed25519_smult(&p, &ed25519_base, sig); |
wolfSSL | 15:117db924cf7c | 548 | |
wolfSSL | 15:117db924cf7c | 549 | /* find H(R,A,M) * -A */ |
wolfSSL | 15:117db924cf7c | 550 | ed25519_smult(&A, &A, h); |
wolfSSL | 15:117db924cf7c | 551 | |
wolfSSL | 15:117db924cf7c | 552 | /* SB + -H(R,A,M)A */ |
wolfSSL | 15:117db924cf7c | 553 | ed25519_add(&A, &p, &A); |
wolfSSL | 15:117db924cf7c | 554 | |
wolfSSL | 15:117db924cf7c | 555 | lm_copy(R->X, A.X); |
wolfSSL | 15:117db924cf7c | 556 | lm_copy(R->Y, A.Y); |
wolfSSL | 15:117db924cf7c | 557 | lm_copy(R->Z, A.Z); |
wolfSSL | 15:117db924cf7c | 558 | |
wolfSSL | 15:117db924cf7c | 559 | return ret; |
wolfSSL | 15:117db924cf7c | 560 | } |
wolfSSL | 15:117db924cf7c | 561 | |
wolfSSL | 15:117db924cf7c | 562 | #endif /* ED25519_SMALL */ |
wolfSSL | 15:117db924cf7c | 563 | #endif /* HAVE_ED25519 */ |
wolfSSL | 15:117db924cf7c | 564 |