Skip to content
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

Kwxm/bls flat uncompression #5663

Merged
merged 28 commits into from
Dec 7, 2023
Merged

Kwxm/bls flat uncompression #5663

merged 28 commits into from
Dec 7, 2023

Conversation

kwxm
Copy link
Contributor

@kwxm kwxm commented Dec 3, 2023

Currently this is just an experiment and I want so see if it gets through CI.

This changes the Flat instances for the BLS12-381 G1 and G2 Element types to disallow uncompression during script flat-deseriailisation. Users should now use the appropriate uncompress methods explicitly to uncompress any group constants that are required in scripts.

For convenience (for example, in tests), literal constants of the form (con bls12_381_G1_element 0x...) are still allowed in textual PLC programs, but any attempt to serialise such a program in the flat format will fail.

@kwxm kwxm added Do not merge EXPERIMENT Experiments that we probably don't want to merge No Changelog Required Add this to skip the Changelog Check labels Dec 3, 2023
@kwxm kwxm removed the Do not merge label Dec 6, 2023
@kwxm kwxm added Builtins and removed EXPERIMENT Experiments that we probably don't want to merge No Changelog Required Add this to skip the Changelog Check labels Dec 6, 2023
@kwxm
Copy link
Contributor Author

kwxm commented Dec 6, 2023

I think that this should be ready to go once #5664 is merged. We should rebase this branch on that and then run

cabal test bls12-381-costs-test --test-option --accept

to update the costs of the BLS12-381 test cases in plutus-benchmark.

@kwxm
Copy link
Contributor Author

kwxm commented Dec 6, 2023

We should probably also add a test to make sure that serialising script containing a G1 or G2 constant fails. I'm nor sure how do that right now though.

@kwxm
Copy link
Contributor Author

kwxm commented Dec 6, 2023

This needs to go in the specification too. See PLT-8902.

@michaelpj michaelpj merged commit b5492cb into master Dec 7, 2023
5 checks passed
@michaelpj michaelpj deleted the kwxm/bls-flat-uncompression branch December 7, 2023 15:06
@kwxm kwxm mentioned this pull request Dec 19, 2023
v0d1ch pushed a commit to v0d1ch/plutus that referenced this pull request Dec 6, 2024
* WIP

* WIP

* WIP

* WIP

* WIP

* Remove old generator and zero constants

* Remove old generator and zero constants

* Add local copy of G1 generator for experimentation

* Add local copy of G1 generator for experimentation

* Expand comment

* Expand comment

* Remove accidental newlines

* Remove accidental newlines

* Update bls cost test results

* Update comments

* Update comments

* Remove workarounds for premature application

* Restore previous versions of some tests

* Restore previous versions of some tests

* Remove comment

* Represent compressed group points as byte arrays

* Better definitions of compressed group points

* Add changelog entries

* update test output

---------

Co-authored-by: Michael Peyton Jones <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants