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

DO NOT MERGE: feat: upgrade to new crypto primitives #81

Closed
wants to merge 50 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
7831bb6
wip: start building full encryption library
bhgomes May 25, 2022
4397206
wip: add authenticated encryption extension on symmetric encryption
bhgomes May 26, 2022
c010b33
wip: add duplex sponge encryption scheme
bhgomes May 28, 2022
6de5dd3
Merge branch 'main' into feat/add-crypto-primitives
bhgomes Jun 2, 2022
5722c16
Merge branch 'main' into feat/add-crypto-primitives
bhgomes Jun 7, 2022
95a8bdd
fix: remove old MAC and authenticated encryption code
bhgomes Jun 7, 2022
d789588
wip: start converting over to new conventions
bhgomes Jun 8, 2022
6e5873b
wip: continue moving to new conventions
bhgomes Jun 8, 2022
fdbfe0c
wip: start moving to eclair organizational structure
bhgomes Jun 8, 2022
fe953bb
wip: migrate majority of code out of old constraint system lib
bhgomes Jun 8, 2022
f7c5734
wip: fix local feature issues
bhgomes Jun 8, 2022
7c4a68e
wip: start migrating merkle-tree to ECLAIR
bhgomes Jun 9, 2022
7cc8406
wip: move to new generalized encryption scheme
bhgomes Jun 9, 2022
460dbed
Merge branch 'main' into feat/add-crypto-primitives
bhgomes Jun 9, 2022
cf1f1a2
wip: add scafolding for hybrid encryption
bhgomes Jun 9, 2022
4ea8704
wip: move to new encryption primitives
bhgomes Jun 9, 2022
de98526
Merge branch 'main' into feat/add-crypto-primitives
bhgomes Jun 9, 2022
b476d85
wip: clean up old kdf/group primitives
bhgomes Jun 10, 2022
89e7cd7
wip: start migrating manta-accounting
bhgomes Jun 10, 2022
dbb2e82
Merge branch 'main' into feat/add-crypto-primitives
bhgomes Jun 10, 2022
2e35e2d
wip: finish building duplex-sponge construction
bhgomes Jun 11, 2022
dfde069
Merge branch 'feat/add-crypto-primitives' of https://github.com/Manta…
bhgomes Jun 11, 2022
15f3179
wip: start upgrading merkle-tree code
bhgomes Jun 14, 2022
b43de84
fix: revert to previous merkle tree model
bhgomes Jun 14, 2022
2893170
feat: add encryption docs
bhgomes Jun 14, 2022
85419b8
fix: separate plaintext from encryption types, fix typos
bhgomes Jun 14, 2022
1aa7680
Merge branch 'main' into feat/add-crypto-primitives
bhgomes Jun 14, 2022
ef903e1
fix: update docs, resolve missing names
bhgomes Jun 14, 2022
f2b198e
fix: update to new encryption scheme interfaces
bhgomes Jun 15, 2022
a650e69
wip: upgrade manta-pay to new algebra/key-agreement primitives
bhgomes Jun 15, 2022
12caa95
feat: add plaintext conversion adapter for encryption
bhgomes Jun 15, 2022
7be97ab
feat: move AES to new encryption scheme primitives
bhgomes Jun 15, 2022
272dda5
wip: upgrade manta-pay to new crypto interfaces
bhgomes Jun 16, 2022
5fd43b5
wip: add key-conversion traits for encryption
bhgomes Jun 16, 2022
3a6afbd
feat: upgrade encryption scheme protocols for key-conversion
bhgomes Jun 17, 2022
387dd5a
Merge branch 'main' into feat/add-crypto-primitives
bhgomes Jun 17, 2022
cddce4e
fix: move to new encryption mechanism
bhgomes Jun 17, 2022
720b9f4
fix: add encode/decode for relevant primitives
bhgomes Jun 17, 2022
f1616b0
fix: use correct encryption tests
bhgomes Jun 17, 2022
9b524d4
fix: use correct duplex encryption implementation
bhgomes Jun 17, 2022
13dde5e
fix: use correct conditional swap implementation
bhgomes Jun 17, 2022
3c5e215
Merge branch 'main' into feat/add-crypto-primitives
bhgomes Jun 18, 2022
7ea1400
feat: move to new permutation scheme for Poseidon
bhgomes Jun 20, 2022
a3d9528
wip: start building duplex encryption specification for Poseidon
bhgomes Jun 20, 2022
177369d
wip: add scaffolding for poseidon encryption
bhgomes Jun 20, 2022
d46f13c
wip: add encryption/decryption block update rules
bhgomes Jun 20, 2022
ef4617a
wip: finish building encryption module
bhgomes Jun 21, 2022
48547ed
fix: add missing `vec!` import
bhgomes Jun 21, 2022
26915b7
fix: add `alloc` feature to manta-crypto import
bhgomes Jun 21, 2022
69ed216
chore: bump clap dependency to 3.2.6
bhgomes Jun 21, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions manta-accounting/src/asset.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ use core::{
};
use derive_more::{Add, AddAssign, Display, From, Sub, SubAssign, Sum};
use manta_crypto::{
constraint::{Allocator, Secret, ValueSource, Variable},
rand::{CryptoRng, Rand, RngCore, Sample},
constraint::{Allocate, Allocator, Secret, Variable},
rand::{Rand, RngCore, Sample},
};
use manta_util::{into_array_unchecked, Array, SizeLimit};

Expand Down Expand Up @@ -105,7 +105,7 @@ impl AssetId {
#[inline]
pub fn sample_up_to<R>(self, maximum: AssetValue, rng: &mut R) -> Asset
where
R: CryptoRng + RngCore + ?Sized,
R: RngCore + ?Sized,
{
self.value(rng.gen_range(0..maximum.0))
}
Expand All @@ -132,7 +132,7 @@ where
#[inline]
fn sample<R>(distribution: D, rng: &mut R) -> Self
where
R: CryptoRng + RngCore + ?Sized,
R: RngCore + ?Sized,
{
Self(rng.sample(distribution))
}
Expand Down Expand Up @@ -263,7 +263,7 @@ where
#[inline]
fn sample<R>(distribution: D, rng: &mut R) -> Self
where
R: CryptoRng + RngCore + ?Sized,
R: RngCore + ?Sized,
{
Self(rng.sample(distribution))
}
Expand Down Expand Up @@ -473,7 +473,7 @@ impl Sample for Asset {
#[inline]
fn sample<R>(_: (), rng: &mut R) -> Self
where
R: CryptoRng + RngCore + ?Sized,
R: RngCore + ?Sized,
{
Self::new(rng.gen(), rng.gen())
}
Expand Down
12 changes: 6 additions & 6 deletions manta-accounting/src/key.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ use core::{
marker::PhantomData,
};
use manta_crypto::{
key::KeyDerivationFunction,
rand::{CryptoRng, RngCore, Sample},
key::kdf::KeyDerivationFunction,
rand::{RngCore, Sample},
};

#[cfg(feature = "serde")]
Expand Down Expand Up @@ -246,19 +246,19 @@ where
#[inline]
fn derive(&self, account: AccountIndex, kind: Kind, index: KeyIndex) -> Self::SecretKey {
self.key_derivation_function
.derive(&self.base.derive(account, kind, index))
.derive(&self.base.derive(account, kind, index), &mut ())
}

#[inline]
fn derive_spend(&self, account: AccountIndex, index: KeyIndex) -> Self::SecretKey {
self.key_derivation_function
.derive(&self.base.derive_spend(account, index))
.derive(&self.base.derive_spend(account, index), &mut ())
}

#[inline]
fn derive_view(&self, account: AccountIndex, index: KeyIndex) -> Self::SecretKey {
self.key_derivation_function
.derive(&self.base.derive_view(account, index))
.derive(&self.base.derive_view(account, index), &mut ())
}
}

Expand All @@ -270,7 +270,7 @@ where
#[inline]
fn sample<R>(distribution: (D, F), rng: &mut R) -> Self
where
R: CryptoRng + RngCore + ?Sized,
R: RngCore + ?Sized,
{
Self::new(H::sample(distribution.0, rng), distribution.1)
}
Expand Down
4 changes: 2 additions & 2 deletions manta-accounting/src/transfer/batch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ use crate::{
use alloc::vec::Vec;
use manta_crypto::{
accumulator::Accumulator,
rand::{CryptoRng, Rand, RngCore},
rand::{Rand, RngCore},
};
use manta_util::into_array_unchecked;

Expand Down Expand Up @@ -54,7 +54,7 @@ where
rng: &mut R,
) -> ([Receiver<C>; RECEIVERS], Self)
where
R: CryptoRng + RngCore + ?Sized,
R: RngCore + ?Sized,
{
let mut receivers = Vec::with_capacity(RECEIVERS);
let mut zeroes = Vec::with_capacity(RECEIVERS - 1);
Expand Down
4 changes: 2 additions & 2 deletions manta-accounting/src/transfer/canonical.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ where
rng: &mut R,
) -> Self
where
R: CryptoRng + RngCore + ?Sized,
R: RngCore + ?Sized,
{
Self::build(asset, spending_key.receiver(parameters, rng.gen(), asset))
}
Expand All @@ -129,7 +129,7 @@ where
rng: &mut R,
) -> (Self, PreSender<C>)
where
R: CryptoRng + RngCore + ?Sized,
R: RngCore + ?Sized,
{
let (receiver, pre_sender) = spending_key.internal_pair(parameters, rng.gen(), asset);
(Self::build(asset, receiver), pre_sender)
Expand Down
Loading