aboutsummaryrefslogtreecommitdiff
path: root/tests/crypto/main.cpp
diff options
context:
space:
mode:
authorkoe <ukoe@protonmail.com>2021-11-08 18:14:17 -0600
committerkoe <ukoe@protonmail.com>2022-01-25 07:14:46 -0600
commitc36ea26e5c6b94f107cc1aeb02a45cfc5a7c38ef (patch)
tree06ead3fb8c9b88df1084d475d0673b88811a7183 /tests/crypto/main.cpp
parentMerge pull request #8021 (diff)
downloadmonero-c36ea26e5c6b94f107cc1aeb02a45cfc5a7c38ef.tar.xz
fix ge_p3_is_point_at_infinity(), which is evaluating field elements that haven't been reduced by the field order
Diffstat (limited to 'tests/crypto/main.cpp')
-rw-r--r--tests/crypto/main.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/crypto/main.cpp b/tests/crypto/main.cpp
index f804c45dc..5486937c2 100644
--- a/tests/crypto/main.cpp
+++ b/tests/crypto/main.cpp
@@ -259,6 +259,16 @@ int main(int argc, char *argv[]) {
if (expected != actual) {
goto error;
}
+ } else if (cmd == "check_ge_p3_identity") {
+ cerr << "Testing: " << cmd << endl;
+ public_key point;
+ bool expected_bad, expected_good, result_badfunc, result_goodfunc;
+ get(input, point, expected_bad, expected_good);
+ result_badfunc = check_ge_p3_identity_failure(point);
+ result_goodfunc = check_ge_p3_identity_success(point);
+ if (expected_bad != result_badfunc || expected_good != result_goodfunc) {
+ goto error;
+ }
} else {
throw ios_base::failure("Unknown function: " + cmd);
}