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 852 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
863 #endif | 863 #endif |
864 #else | 864 #else |
865 PORT_SetError(SEC_ERROR_UNSUPPORTED_KEYALG); | 865 PORT_SetError(SEC_ERROR_UNSUPPORTED_KEYALG); |
866 #endif /* NSS_DISABLE_ECC */ | 866 #endif /* NSS_DISABLE_ECC */ |
867 | 867 |
868 return rv; | 868 return rv; |
869 } | 869 } |
870 | 870 |
871 /* | 871 /* |
872 ** Checks the signature on the given digest using the key provided. | 872 ** Checks the signature on the given digest using the key provided. |
| 873 ** |
| 874 ** The key argument must represent a valid EC public key (a point on |
| 875 ** the relevant curve). If it is not a valid point, then the behavior |
| 876 ** of this function is undefined. In cases where a public key might |
| 877 ** not be valid, use EC_ValidatePublicKey to check. |
873 */ | 878 */ |
874 SECStatus | 879 SECStatus |
875 ECDSA_VerifyDigest(ECPublicKey *key, const SECItem *signature, | 880 ECDSA_VerifyDigest(ECPublicKey *key, const SECItem *signature, |
876 const SECItem *digest) | 881 const SECItem *digest) |
877 { | 882 { |
878 SECStatus rv = SECFailure; | 883 SECStatus rv = SECFailure; |
879 #ifndef NSS_DISABLE_ECC | 884 #ifndef NSS_DISABLE_ECC |
880 mp_int r_, s_; /* tuple (r', s') is received signature) */ | 885 mp_int r_, s_; /* tuple (r', s') is received signature) */ |
881 mp_int c, u1, u2, v; /* intermediate values used in verification */ | 886 mp_int c, u1, u2, v; /* intermediate values used in verification */ |
882 mp_int x1; | 887 mp_int x1; |
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1071 printf("ECDSA verification %s\n", | 1076 printf("ECDSA verification %s\n", |
1072 (rv == SECSuccess) ? "succeeded" : "failed"); | 1077 (rv == SECSuccess) ? "succeeded" : "failed"); |
1073 #endif | 1078 #endif |
1074 #else | 1079 #else |
1075 PORT_SetError(SEC_ERROR_UNSUPPORTED_KEYALG); | 1080 PORT_SetError(SEC_ERROR_UNSUPPORTED_KEYALG); |
1076 #endif /* NSS_DISABLE_ECC */ | 1081 #endif /* NSS_DISABLE_ECC */ |
1077 | 1082 |
1078 return rv; | 1083 return rv; |
1079 } | 1084 } |
1080 | 1085 |
OLD | NEW |