chore: add bn254 attribute when needed in the stdlib#3208
Conversation
jfecher
left a comment
There was a problem hiding this comment.
LGTM. Pinging @vezenovm and @kevaundray for re-review just in case.
|
I'm fine with merging this right now, but it does feel that the attributes in |
But we do not have attribute for modules? |
Yeah we do not, but each method calls |
Yeah it would need to be introduced in a separate PR |
* master: (242 commits) chore(docs): Update Windows installation (#3326) chore!: change stdlib function `pedersen` to `pedersen_commitment` (#3341) chore: add back algolia recrawler (#3332) chore: comment out algolia recrawler workflow as its failing master (#3331) chore: Modify single line if-else expression width threshold (#3329) feat: Expand trait impl overlap check to cover generic types (#3320) feat: Implement where clauses on impls (#3324) chore: builtin wrapping shift left (#3270) chore: format integration tests (#3257) fix(3300): cache warnings into debug artefacts (#3313) fix(3275): activate brillig modulo test with negative integers (#3318) feat: Add check for overlapping generic traits (#3307) feat: Refactor debugger and separate core from UI (#3308) chore: recrawl docs on merge (#3306) chore: add bn254 attribute when needed in the stdlib (#3208) feat: add exports of JS black box solvers to noirJS (#3295) chore: upload acir artifacts as a github artifact (#3288) chore: bump bb version to 0.12.0 (#3304) chore(docs): Supplement descriptions for defaulting loop indices to be `u64` (#3237) chore: create publish-docs.yml (#3298) ...
Description
Use the field attribute to restrict some functions in stdlib to bn254 field
Problem*
Some stdlib functions require that noir native field is the one from bn254 curve, so we use the new field attribute so that these functions cannot be used if the field is different.
Summary*
Add the attribute
#[field(bn254)]to a few functions in stdlib, such as:poseidon, babyjubjub and mimc.
Documentation
This PR requires documentation updates when merged.
Additional Context
PR Checklist*
cargo fmton default settings.