stellar / rs-soroban-sdk

Rust SDK for Soroban contracts.
Apache License 2.0
128 stars 67 forks source link

expose `Fr` into its own type #1373

Closed jayz22 closed 1 month ago

jayz22 commented 1 month ago

What

Resolves https://github.com/stellar/rs-soroban-sdk/issues/1352

Why

Fr is the 255-bit scalar with a fixed modulus (equal to the subgroup order r) and all its operations are modulo arithmetics. Exposing it as separate type (zero-sized wrapping of an U256) is better signaling that the two have different semantics and avoids potential footgun.

Known limitations

[TODO or N/A]

leighmcculloch commented 1 month ago

Builds will pass after the following PR is merged: