-
Notifications
You must be signed in to change notification settings - Fork 48
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
Migrate Crypto Upgrades from #153 #197
Conversation
Signed-off-by: Brandon H. Gomes <bhgomes@pm.me>
Signed-off-by: Brandon H. Gomes <bhgomes@pm.me>
Signed-off-by: Brandon H. Gomes <bhgomes@pm.me>
Signed-off-by: Brandon H. Gomes <bhgomes@pm.me>
Signed-off-by: Brandon H. Gomes <bhgomes@pm.me>
Signed-off-by: Brandon H. Gomes <bhgomes@pm.me>
Signed-off-by: Brandon H. Gomes <bhgomes@pm.me>
Signed-off-by: Brandon H. Gomes <bhgomes@pm.me>
Signed-off-by: Brandon H. Gomes <bhgomes@pm.me>
Signed-off-by: Brandon H. Gomes <bhgomes@pm.me>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- TODO:
- Add a parameter to
DiffieHellman
to support a generator with a different type than the public key group type - Add associated type to
HasGenerator
which returns a custom type
- Add a parameter to
Signed-off-by: Brandon H. Gomes <bhgomes@pm.me>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a small remark: I didn't fully understand the field_try_into
macro defined in arkworks::ff
, so please check with someone else that everything's correct there.
Signed-off-by: Brandon H. Gomes <bhgomes@pm.me>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All my comments were addressed, approved.
Signed-off-by: Brandon H. Gomes <bhgomes@pm.me>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only 1 minor typo.
Signed-off-by: Boyuan Feng <boyuan@ucsb.edu>
37b64ce
Signed-off-by: Brandon H. Gomes <bhgomes@pm.me>
Signed-off-by: Brandon H. Gomes <bhgomes@pm.me>
Signed-off-by: Brandon H. Gomes bhgomes@pm.me
Changed Interfaces
manta_crypto::accumulator
: AddTypes
base-trait foraccumulator
constructions. NowMembershipProof
depends only onM: Types
instead ofM: Model<COM>
so we can remove the compiler parameter and also add standardderive
implsmanta_crypto::algebra
: Rewrites theGroup
trait into the following set of traitsGroup
,Ring
,ScalarMul
,ScalarMulGroup
, andHasGenerator
manta_crypto::constraint
: ReplaceProofSystemInput
with theInput
/HasInput
trait-pair (Input
for implementation andHasInput
for introspection)manta_crypto::eclair::num
: ExpandZero
andOne
traits to match standard traits (includingzero
andone
functions respectively)manta_crypto::permutation::duplex
: Add customPlaintext
andCiphertext
types to duplex encryption sinceVec<PlaintextBlock>
andVec<CiphertextBlock>
will not work (these are not fixed-size and cannot be allocated in the unknown case) we force the implementer to handle this instead of providing a half-solution. We also fix Poseidion encryption to handle this new correct allocation storyNew Implementations or Removed Unused Code
Cryptography
manta_crypto
accumulator
: Remove unusedItemHashAccumulatorModel
accumulator
: Remove unusedare_independent
fromAccumulator
arkworks::ff
: Addtry_into_XXX
integer conversion methods fromF: PrimeField
(with testing suite)constraint::measure
: AddMeasure
implementation for()
the native compiler (currently no operations have a cost in this model, we can revisit this)constraint::measure
: Addprint_measurement
helper function to wrap any ECLAIR function call and print out it's measured sizeeclair
: AddType
introspection for theHas
traiteclair::alloc
: AddConstant
implementations forbool
,[T; N]
,Vec<T>
,Box<[T]>
,Array<T, N>
, andBoxArray<T, N>
eclair::alloc
: AddVariable
implementations forBox<T>
,[T; N]
,Array<T>
,BoxArray<T>
eclair::alloc
: GeneralizeAllocate
interfaceeclair::bool
: ImplementAssert
for()
eclair::bool
: AddConditionalSelect
implementations for native integer typeseclair::cmp
: AddPartialEq
implementations for native integer types and forVec<T>
,Box<[T]>
,Array<T, N>
,BoxArray<T, N>
eclair::num
: AddZero
andOne
implementations for integer types,UnsignedInteger
and arkworks backend variableseclair::num
: AddPartialEq
,ConditionalSelect
,ConditionalSwap
andVariable
implementations forUnsignedInteger
encryption
: Addencryption::EmptyHeader
type for encryption schemes with no headersencryption
: AddEncode
andconstraint::Input
implementations toencryption::EncryptedMessage
encryption::hybrid
: AddVariable
implementation tohybrid::Randomness
,hybrid::Ciphertext
encryption::hybrid
: AddEncode
andconstraint::Input
implementations tohybrid::Ciphertext
permutation::duplex
: AddVariable
,PartialEq
,Encode
, andconstraint::Input
implementations toduplex::Ciphertext
permutation::duplex
: AddConstant
andSample
implementations toduplex::Duplexer
rand
: AddSample
implementations forPhantomData
and()
signature
: Add more type aliases for signature schemessignature::convert
: Add signature message converterssignature::schnorr
: AddHasGenerator
implementation toSchnorr
signature and simplify type boundsAccounting
manta_accounting
transfer
: Removed theis_independent_from
methods forSender
/Receiver
(unused)Utilities
manta_util
bytes
: MoveAsBytes
tomanta_util
codec
: Add moreEncode
implementations for native typesconvert
: AddField
andVariant
introspection accessorscmp
: AddIndependence
relation which is a more general kind of non-equivalence relation. We will use it to distinguish between the kind of equivalence relation that checks if two nullifiers are strictly equal or their spend-receipt parts are equal (in the new protocol theNullifier = (commitment, outgoing_note)
and only thecommitment
is used to check the spend criterion so the independence relation checks if twocommitments
are unequal)iter
: AddIterable
extension traits for borrowed-iteration abstractionsMiscelanous Updates
NonNative
trait docsclap
,serde
andanyhow
bip32
(v0.4.0
is incompatible with some node dependenices)Before we can merge this PR, please make sure that all the following items have been checked off:
CHANGELOG.md
and added the appropriatechangelog
label to the PR.Files changed
in the GitHub PR explorer.CONTRIBUTING.md
.cargo hakari generate
to update theworkspace-hack
system