Skip to content

Adjusted initial bls12_381 branch#4

Merged
ewynx merged 19 commits intomainfrom
new-bls12-381
Oct 11, 2022
Merged

Adjusted initial bls12_381 branch#4
ewynx merged 19 commits intomainfrom
new-bls12-381

Conversation

@ewynx
Copy link
Contributor

@ewynx ewynx commented Sep 29, 2022

This is a new branch that contains the changes requested in the previous PR.

Changes:

  • commits specific for bls12_381 cherry-picked and squashed
  • added comments
  • updated README
  • added licence to choice.sw
  • created a separate testing folder where all test folder can go into
  • moved choice.sw into utils library so it can be reused easily
  • cleanup and changes along the way

This branch works on all comments in the previous PR, except for the last one about assembly versions of the computational heavy operations (whether that would be more efficient than pure Sway). I think it would be better to try that out in a separate branch.

@man2706kum shared that for him there occur some errors in compilation. For me on the other hand; I can compile and run the tests in testing/tests_bls12_381 for Fp succesfully. Might be some versioning issue, would be interesting to know whether you can compile @Mikerah.

ewynx and others added 17 commits September 23, 2022 18:59
…Adjusted the uses of the corresponding functions.
Started with a few functions in fp6 and g1; these cannot be tested yet. Some are commented out because they might prevent compilation.
- Extract useful functions to utils.sw
- Fuel-rs to version 0.19 in tests_bls12_381
Some functions are commented out in order for compilation to be possible.
- Added comment where error Immediate18TooLarge pops up & what functions work or not
- Converted tests_fp and tests_fp2 to use a local node with custom gas limit
- Fp2 multiplication fixed
- Fixes in g1.sw
…, Fp2, Fp6)

- Added a few untested functions for Fp6 (can't compile)
- Adjustments for other functions that can now use Choice instead of bool
… neg and ct_eq

- Implementation of some small traits in g1 and scalar
- Updates to util.sw
There's some assembly in here because Sway doesn't support underflow natively. This is usually leveraged to avoid writing if else.
… test for lexicographically_largest_fp will still give an error.
- Moved tests for bls into testing folder
- Included license from dalek-cryptography subtle library
…Also did some cleanup

- Moved BitwiseXor for u32 to choice and wherever possible use the binary operator instead of function call
- Updated README
Copy link
Contributor

@Mikerah Mikerah left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should clearly not what tests run but take way too long to run. Otherwise, LGTM

- Replaced some equals functions with the == symbol.
- Uncommented all tests we can run at once
@ewynx
Copy link
Contributor Author

ewynx commented Oct 11, 2022

Made the last fixes as suggested, will merge now

@ewynx ewynx merged commit 41401fd into main Oct 11, 2022
@Mikerah
Copy link
Contributor

Mikerah commented Oct 11, 2022

🚀

@ewynx ewynx deleted the new-bls12-381 branch October 12, 2022 17:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants