Merge bitcoin-core/secp256k1#1474: tests: restore scalar_mul test
3dbfb48946tests: restore scalar_mul test (Jonas Nick) Pull request description: Without this commit, the res[i][1] test vectors are unused. They were introduced to test the correctness of scalar_sqr(x) and scalar_mul(x, x). These tests were deleted as part of removing scalar_sqr in commit [5437e7bdfb](5437e7bdfb (diff-c2d5f1f7616875ab71cd41b053cfb428696988ff89642b931a0963d50f34f7e8L2195)). Discovered in https://github.com/bitcoin-core/secp256k1/discussions/1463 by Coding-Enthusiast (thanks!). ACKs for top commit: real-or-random: utACK3dbfb48946Tree-SHA512: 914e08db3efaa1cef546a9730096e740478c422d41fedb2b71ec3a7ea962f81740a05dc7e7c1fb191088f6d38b5690479c7d0864ca8abf2b2e9c4334f03ca605
This commit is contained in:
@@ -2941,6 +2941,8 @@ static void run_scalar_tests(void) {
|
||||
CHECK(!secp256k1_scalar_check_overflow(&zz));
|
||||
CHECK(secp256k1_scalar_eq(&secp256k1_scalar_one, &zz));
|
||||
}
|
||||
secp256k1_scalar_mul(&z, &x, &x);
|
||||
CHECK(secp256k1_scalar_eq(&r2, &z));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user