OLD | NEW |
1 /* This Source Code Form is subject to the terms of the Mozilla Public | 1 /* This Source Code Form is subject to the terms of the Mozilla Public |
2 * License, v. 2.0. If a copy of the MPL was not distributed with this | 2 * License, v. 2.0. If a copy of the MPL was not distributed with this |
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ | 3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
4 | 4 |
5 #ifdef FREEBL_NO_DEPEND | 5 #ifdef FREEBL_NO_DEPEND |
6 #include "stubs.h" | 6 #include "stubs.h" |
7 #endif | 7 #endif |
8 | 8 |
9 | 9 |
10 #include "blapi.h" | 10 #include "blapi.h" |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
197 /* Generates a new EC key pair. The private key is a supplied | 197 /* Generates a new EC key pair. The private key is a supplied |
198 * value and the public key is the result of performing a scalar | 198 * value and the public key is the result of performing a scalar |
199 * point multiplication of that value with the curve's base point. | 199 * point multiplication of that value with the curve's base point. |
200 */ | 200 */ |
201 SECStatus | 201 SECStatus |
202 ec_NewKey(ECParams *ecParams, ECPrivateKey **privKey, | 202 ec_NewKey(ECParams *ecParams, ECPrivateKey **privKey, |
203 const unsigned char *privKeyBytes, int privKeyLen) | 203 const unsigned char *privKeyBytes, int privKeyLen) |
204 { | 204 { |
205 SECStatus rv = SECFailure; | 205 SECStatus rv = SECFailure; |
206 #ifdef NSS_ENABLE_ECC | 206 #ifdef NSS_ENABLE_ECC |
207 PRArenaPool *arena; | 207 PLArenaPool *arena; |
208 ECPrivateKey *key; | 208 ECPrivateKey *key; |
209 mp_int k; | 209 mp_int k; |
210 mp_err err = MP_OKAY; | 210 mp_err err = MP_OKAY; |
211 int len; | 211 int len; |
212 | 212 |
213 #if EC_DEBUG | 213 #if EC_DEBUG |
214 printf("ec_NewKey called\n"); | 214 printf("ec_NewKey called\n"); |
215 #endif | 215 #endif |
216 MP_DIGITS(&k) = 0; | 216 MP_DIGITS(&k) = 0; |
217 | 217 |
(...skipping 853 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1071 printf("ECDSA verification %s\n", | 1071 printf("ECDSA verification %s\n", |
1072 (rv == SECSuccess) ? "succeeded" : "failed"); | 1072 (rv == SECSuccess) ? "succeeded" : "failed"); |
1073 #endif | 1073 #endif |
1074 #else | 1074 #else |
1075 PORT_SetError(SEC_ERROR_UNSUPPORTED_KEYALG); | 1075 PORT_SetError(SEC_ERROR_UNSUPPORTED_KEYALG); |
1076 #endif /* NSS_ENABLE_ECC */ | 1076 #endif /* NSS_ENABLE_ECC */ |
1077 | 1077 |
1078 return rv; | 1078 return rv; |
1079 } | 1079 } |
1080 | 1080 |
OLD | NEW |