-
Notifications
You must be signed in to change notification settings - Fork 7
Blsct arith classes with tests #54
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
Blsct arith classes with tests #54
Conversation
…sVec size don't match
…ng functions to Elements
|
One of the tests fails for me: Added some log: Output: |
…goex/navcoin into blsct-arith-classes-with-tests
|
@aguycalled The test was originally created to test FirstNPow for a case where y is 0: // (64)
auto hhp = hh * Scalars::FirstNPow(n, y.Invert());but now i think the test is not necessary since y is in Z^*_p and non-zero. Also since multiplying any element by its invese results in unit element 1 and multiplying any element by 0 results in 0, I think the inverse of 0 in Z_p is undefined. It probably just happes to return 0 on x86_64 implementation. So I removed the test and added another test case for Scalars::FirstNPow to test if it always return alist that starts with 1 regardless of the value of base value instead. Can you try again? |
All the tests pass for me now 👍 % ./src/test/test_navcoin
Running 586 test cases...
*** No errors detectedMaybe, |
|
I think this would be a good idea, since we are not supposed to use a zero value in Scalar right? |
|
sure. now calling Invert on Scalar(0) throws an exception. |
…goex/navcoin into blsct-arith-classes-with-tests
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approving and merging. Pending solving the CI issues in a different task #61.
* Added the new classes Scalar and G1Point
* Added scalar.{h,cpp} and g1point.{h,cpp} to make file
* Implemented more of the operators
* Implemented more functions
* Added new << >> logic for bitwise ops
* implemented Scalar::{Rand,GetString,Hash}
* Updated the arith scalar logic
* Added more G1Point arith logic, math...
* Added hashMapTo
* Removed Scalar::hashAndMap
* Updates that I forgot to push
* Updated G1Point::Rand()
* Update the mulVec func in G1Point to throw and exception if gVec and sVec size don't match
* Removed the test code that was accidentally added
* Implemented mulVec
* Removed some unused header calls
* Added return statement for G1Point::Double
* add g1point/scalar and their tests
* ignore .vscode
* add endianness parameter to G1Point::MapToG1. add g1point_hash_and_map test
* add mulvec_mcl test
* add mulvec tests
* add scalars and g1points classes
* add MapToG1(string&)
* extracted common parts of Scalars and G1Points to Elements. add slicing functions to Elements
* wip
* wip
* drop G1point::operator^
* drop the 2nd type artument from Elements
* add skeleton elements tests
* add elements tests
* support non-zero rand generatation
* wip
* add Elements::FirstNPowers
* add .gitignore to exclude dynamically generated files on macos. add Elements::RandomVector
* wip
* add Scalar::Pow and Scalar::GetBits
* add range proof test (not tested)
* add type parameter where required
* calculate t1, t2 properly
* fix typo
* add Elements::RepeatN test
* add comment
* add integration_tests and move such tests there
* introduce std::is_same in elements.h
* add gg^z == gg^(ones * z)
* wip
* add working h^mu gg^l test
* add Scalars::FirstNInvPow
* add multiply inv power seq for G1Points
* wip
* wip
* drop FirstNInvPow. add working 65_g_part_ts_only test
* wip
* add working range proof test
* wip
* make the range proof procedure a function
* integrate inner product argument to range proof
* wip
* wip
* wip
* wip
* drop unused variable
* separate elements implementation to cpp
* clean up code
* wip
* wip
* ignore .vscode
add endianness parameter to G1Point::MapToG1. add g1point_hash_and_map test
add mulvec_mcl test
add mulvec tests
add scalars and g1points classes
add MapToG1(string&)
extracted common parts of Scalars and G1Points to Elements. add slicing functions to Elements
wip
wip
drop G1point::operator^
drop the 2nd type artument from Elements
add skeleton elements tests
add elements tests
support non-zero rand generatation
wip
add Elements::FirstNPowers
add .gitignore to exclude dynamically generated files on macos. add Elements::RandomVector
wip
add Scalar::Pow and Scalar::GetBits
add range proof test (not tested)
add type parameter where required
calculate t1, t2 properly
fix typo
add Elements::RepeatN test
add comment
add integration_tests and move such tests there
introduce std::is_same in elements.h
add gg^z == gg^(ones * z)
wip
add working h^mu gg^l test
add Scalars::FirstNInvPow
add multiply inv power seq for G1Points
wip
wip
drop FirstNInvPow. add working 65_g_part_ts_only test
wip
add working range proof test
wip
make the range proof procedure a function
integrate inner product argument to range proof
wip
drop unused variable
wip
wip
wip
separate elements implementation to cpp
clean up code
wip
wip
* squashed commits
* fix typo
* migrate indirect MulVec to Elements
* fix build issues in clang
* fix spelling errors
* add newly introduced boost depdendency to lint-includes.py
* remove local depdendent functions
* wip
* remove trailing spaces
* Added BLS and MCL libs/includes to kernel build
* Updated copy constructor and assignment operators
* Added clean steps to clean-local for mcl and bls libs
* FORCE mcl and bls libs to build using main project CC and CXX values
* replace test_integration_invert_zero by additional test case of Scalars::FirstNPow
* use fixture test suite to provide name for bls/arith tests
* throw exception when Scalar(0) is inverted
* include bls/arith headers in setup_common.h
* add g1point and mcl_initializer dependency to test_util source
* fix test_util.include
* add blsct/arith/scalar depedency to libtest_util
* Disabled LLVM use in MCL compilation, this disabled ASM
* Added NM to android host configs for depends builds
* Added ABI=32 for i386 builds of GMP in depends
* fix undefined sanitizer error
Co-authored-by: mxaddict <mxaddict@codedmaster.com>
* Added the new classes Scalar and G1Point
* Added scalar.{h,cpp} and g1point.{h,cpp} to make file
* Implemented more of the operators
* Implemented more functions
* Added new << >> logic for bitwise ops
* implemented Scalar::{Rand,GetString,Hash}
* Updated the arith scalar logic
* Added more G1Point arith logic, math...
* Added hashMapTo
* Removed Scalar::hashAndMap
* Updates that I forgot to push
* Updated G1Point::Rand()
* Update the mulVec func in G1Point to throw and exception if gVec and sVec size don't match
* Removed the test code that was accidentally added
* Implemented mulVec
* Removed some unused header calls
* Added return statement for G1Point::Double
* add g1point/scalar and their tests
* ignore .vscode
* add endianness parameter to G1Point::MapToG1. add g1point_hash_and_map test
* add mulvec_mcl test
* add mulvec tests
* add scalars and g1points classes
* add MapToG1(string&)
* extracted common parts of Scalars and G1Points to Elements. add slicing functions to Elements
* wip
* wip
* drop G1point::operator^
* drop the 2nd type artument from Elements
* add skeleton elements tests
* add elements tests
* support non-zero rand generatation
* wip
* add Elements::FirstNPowers
* add .gitignore to exclude dynamically generated files on macos. add Elements::RandomVector
* wip
* add Scalar::Pow and Scalar::GetBits
* add range proof test (not tested)
* add type parameter where required
* calculate t1, t2 properly
* fix typo
* add Elements::RepeatN test
* add comment
* add integration_tests and move such tests there
* introduce std::is_same in elements.h
* add gg^z == gg^(ones * z)
* wip
* add working h^mu gg^l test
* add Scalars::FirstNInvPow
* add multiply inv power seq for G1Points
* wip
* wip
* drop FirstNInvPow. add working 65_g_part_ts_only test
* wip
* add working range proof test
* wip
* make the range proof procedure a function
* integrate inner product argument to range proof
* wip
* wip
* wip
* wip
* drop unused variable
* separate elements implementation to cpp
* clean up code
* wip
* wip
* ignore .vscode
add endianness parameter to G1Point::MapToG1. add g1point_hash_and_map test
add mulvec_mcl test
add mulvec tests
add scalars and g1points classes
add MapToG1(string&)
extracted common parts of Scalars and G1Points to Elements. add slicing functions to Elements
wip
wip
drop G1point::operator^
drop the 2nd type artument from Elements
add skeleton elements tests
add elements tests
support non-zero rand generatation
wip
add Elements::FirstNPowers
add .gitignore to exclude dynamically generated files on macos. add Elements::RandomVector
wip
add Scalar::Pow and Scalar::GetBits
add range proof test (not tested)
add type parameter where required
calculate t1, t2 properly
fix typo
add Elements::RepeatN test
add comment
add integration_tests and move such tests there
introduce std::is_same in elements.h
add gg^z == gg^(ones * z)
wip
add working h^mu gg^l test
add Scalars::FirstNInvPow
add multiply inv power seq for G1Points
wip
wip
drop FirstNInvPow. add working 65_g_part_ts_only test
wip
add working range proof test
wip
make the range proof procedure a function
integrate inner product argument to range proof
wip
drop unused variable
wip
wip
wip
separate elements implementation to cpp
clean up code
wip
wip
* squashed commits
* fix typo
* migrate indirect MulVec to Elements
* fix build issues in clang
* fix spelling errors
* add newly introduced boost depdendency to lint-includes.py
* remove local depdendent functions
* wip
* remove trailing spaces
* Added BLS and MCL libs/includes to kernel build
* Updated copy constructor and assignment operators
* Added clean steps to clean-local for mcl and bls libs
* FORCE mcl and bls libs to build using main project CC and CXX values
* replace test_integration_invert_zero by additional test case of Scalars::FirstNPow
* use fixture test suite to provide name for bls/arith tests
* throw exception when Scalar(0) is inverted
* include bls/arith headers in setup_common.h
* add g1point and mcl_initializer dependency to test_util source
* fix test_util.include
* add blsct/arith/scalar depedency to libtest_util
* Disabled LLVM use in MCL compilation, this disabled ASM
* Added NM to android host configs for depends builds
* Added ABI=32 for i386 builds of GMP in depends
* fix undefined sanitizer error
Co-authored-by: mxaddict <mxaddict@codedmaster.com>
fixes for CI builds related to PR #54
For issue #42