-
Notifications
You must be signed in to change notification settings - Fork 291
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
secp256k1: Test consistency cleanup and rework. #2887
Commits on Mar 10, 2022
-
Configuration menu - View commit details
-
Copy full SHA for f575845 - Browse repository at this point
Copy the full SHA f575845View commit details -
secp256k1: Benchmark consistency pass.
This makes several of the benchmarks more consistent in terms of resetting the timer and reporting memory allocations as well as moves the ones that only apply when accessing the package via the standard library elliptic curve adaptor code to a new file named ellipticadaptor_bench_test.go. It also converts the ecdsa signature verification benchmark to use bytes directly instead of standard lib big ints and remove the no longer necessary hexToBigInt helper.
Configuration menu - View commit details
-
Copy full SHA for 087aa1a - Browse repository at this point
Copy the full SHA 087aa1aView commit details -
secp256k1: Consolidate Jacobian group chk in tests.
In order to simplify and consolidate the test logic that ensures test points in Jacobian coordinates are valid group elements, this modifies the test helper function that determines if a given Jacobian point is on the secp256k1 curve to also check for the point at infinity, renames it to isValidJacobianPoint, and updates all callers accordingly.
Configuration menu - View commit details
-
Copy full SHA for 39c2b18 - Browse repository at this point
Copy the full SHA 39c2b18View commit details -
secp256k1: Consolidate affine group check in tests.
In order to simplify and consolidate the test logic that ensures test points in affine coordinates are valid group elements, this introduces a new test helper function that determines if a given affine point is on the secp256k1 curve or is the point at infinity and updates all callers accordingly.
Configuration menu - View commit details
-
Copy full SHA for 1360ae6 - Browse repository at this point
Copy the full SHA 1360ae6View commit details -
secp256k1: Cleanup and move affine addition tests.
This cleans up the tests for performing affine addition to make them more consistent with modern practices in the code and also moves them to the ellipticadaptor_test.go file since they only apply when accessing the package via the standard library elliptic curve adaptor code. The following is a high level overview of the changes: - Renames TestAddAffine to TestAddAffineAdaptor to make it clear it is testing via the adaptor - Adds names to each individual test for easier identification - Makes the individual test definitions consistent with the rest of the code
Configuration menu - View commit details
-
Copy full SHA for f2b42cc - Browse repository at this point
Copy the full SHA f2b42ccView commit details -
secp256k1: Cleanup and move affine double tests.
This cleans up the tests for performing affine point doubling to make them more consistent with modern practices in the code and also moves them to the ellipticadaptor_test.go file since they only apply when accessing the package via the standard library elliptic curve adaptor code. The following is a high level overview of the changes: - Renames TestDoubleAffine to TestDoubleAffineAdaptor to make it clear it is testing via the adaptor - Adds names to each individual test for easier identification - Makes the individual test definitions consistent with the rest of the code
Configuration menu - View commit details
-
Copy full SHA for 22185c1 - Browse repository at this point
Copy the full SHA 22185c1View commit details -
secp256k1: Cleanup and move key generation tests.
This cleans up the test for key generation to make it more consistent with modern practices in the code and also moves it to the privkey_test.go file since the associated function is defined in privkey.go. The following is a high level overview of the changes: - Rename TestKeyGeneration to TestGeneratePrivateKey to match the func name - Remove the curve-based indirection since it only works with secp256k1
Configuration menu - View commit details
-
Copy full SHA for f057e9b - Browse repository at this point
Copy the full SHA f057e9bView commit details -
secp256k1: Cleanup and move affine scalar mul tests.
This cleans up the tests for performing affine scalar point multiplication to make them more consistent with modern practices in the code and also moves them to the ellipticadaptor_test.go file since they only apply when accessing the package via the standard library elliptic curve adaptor code. The following is a high level overview of the changes: - Renames TestScalarMult to TestScalarMultAdaptor to make it clear it is testing via the adaptor - Adds names to each individual test for easier identification - Makes the individual test definitions consistent with the rest of the code - Adds some additional edge cases
Configuration menu - View commit details
-
Copy full SHA for 3b1afe6 - Browse repository at this point
Copy the full SHA 3b1afe6View commit details -
secp256k1: Cleanup affine scalar base mult tests.
This cleans up the tests for performing affine scalar base multiplication to make them more consistent with modern practices in the code. The following is a high level overview of the changes: - Adds names to each individual test for easier identification - Makes the individual test definitions consistent with the rest of the code - Adds some additional edge cases
Configuration menu - View commit details
-
Copy full SHA for 636070e - Browse repository at this point
Copy the full SHA 636070eView commit details -
secp256k1: Cleanup and move base mult rand tests.
This cleans up the test for performing affine scalar base multiplication with random scalars to make it more consistent with modern practices in the code and also moves it to the ellipticadaptor_test.go file since it only applies when accessing the package via the standard library elliptic curve adaptor code. The following is a high level overview of the changes: - Adds a randBytes convenience func to acquire a specified number of random bytes from a given rng - Renames TestBaseMultVerify to TestScalarBaseMultAdaptorRandom to make it clear it is testing via the adaptor and based on random values - Uses a new seed for each invocation to ensure new random values are tested each run as opposed to always testing the same random values generated by the same seed
Configuration menu - View commit details
-
Copy full SHA for fde9b81 - Browse repository at this point
Copy the full SHA fde9b81View commit details -
secp256k1: Cleanup private key tests.
This cleans up the test for key generation to make it more consistent with modern practices in the code and adds a couple more test cases.
Configuration menu - View commit details
-
Copy full SHA for 82faa8b - Browse repository at this point
Copy the full SHA 82faa8bView commit details -
secp256k1: Cleanup Jacobian addition tests.
This cleans up the tests for performing Jacobian addition to make them more consistent with modern practices in the code. The following is a high level overview of the changes: - Adds names to each individual test for easier identification - Makes the individual test definitions consistent with the rest of the code
Configuration menu - View commit details
-
Copy full SHA for 939e514 - Browse repository at this point
Copy the full SHA 939e514View commit details -
secp256k1: Cleanup Jacobian double tests.
This cleans up the tests for performing Jacobian point doubling to make them more consistent with modern practices in the code. The following is a high level overview of the changes: - Adds names to each individual test for easier identification - Makes the individual test definitions consistent with the rest of the code
Configuration menu - View commit details
-
Copy full SHA for b2f6fd7 - Browse repository at this point
Copy the full SHA b2f6fd7View commit details -
secp256k1: Add test gen for random mod n scalars.
This adds a new test helper for generating random mod n scalars without also generating a companion big integer and updates the tests to make use of it. It also marks the combined version as a test helper while here. The new helper will be useful for future tests.
Configuration menu - View commit details
-
Copy full SHA for 53a9ec0 - Browse repository at this point
Copy the full SHA 53a9ec0View commit details -
secp256k1: Add Jacobian scalar base mult tests.
This adds tests for scalar base multiplication for points projected in Jacobian coordinates.
Configuration menu - View commit details
-
Copy full SHA for 331adb1 - Browse repository at this point
Copy the full SHA 331adb1View commit details -
secp256k1: Rework Jacobian rand scalar mult tests.
This reworks the tests that deal with scalar point multiplication with points projected into Jacobian coordinates for randomly-generated scalars and points to make them more consistent with modern practices in the code as well as to expand the testing methodology to include additional assurances. It also updates the tests to ensure new random values are tested each run as opposed to the existing tests which always test the same values since they use the same random seed. Specifically: - The points are no longer converted to affine with each iteration which ensures z values other than 1 are tested - Each iteration now ensures calculating the negative version of the point and adding it results in the point at infinity - The check to ensure the same final point was calculated is now done outside of the loop to speed up the test
Configuration menu - View commit details
-
Copy full SHA for 4a6438a - Browse repository at this point
Copy the full SHA 4a6438aView commit details