-
Notifications
You must be signed in to change notification settings - Fork 7
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
Create a :%:
modular newtype
#369
Comments
Can we have |
Sure, even more generally it's possible to make newtype (:%:) (int :: Type) (modulus :: kind) = UnsafeMod int |
:%:
modular arithmetic datatype:%:
modular newtype
But there's a couple reasons we want
The second is just pragmatic, Haskell's |
We can link |
You can link It makes sense to make the type Ed25519_Scalar = 7237005577332262213973186563042994240857116359379907606001950938285454250989
type BN254_Base = 21888242871839275222246405745257275088696311157297823662689037894645226208583 My hope is that this will be conducive for translating between Haskell and Symbolic byte level representations, or abstracting typeclass interfaces they may share. The numerator type for prime field quotient types will be a |
Consider the following type: |
I don't think it's important to prevent that 🤷 Just have |
This is the
Mod
type from #177 proof-of-conceptMotivation is to model things as what they are. For instance, in elliptic curve crypto, point coordinates are fixed width integer types in their (big-endian?) bit-representation. But the arithmetic functions that operate on them depend on a prime modulus which is smaller than their width. With
(:%:)
and the largeword library that can be represented directly.The text was updated successfully, but these errors were encountered: