Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
4c4e72c
Sigma-style protocol for inhomogeneous tuple morphism
waamm Dec 11, 2025
fbb56d3
Fixed new DST
waamm Dec 11, 2025
9ea8bea
Tiny edit
waamm Dec 11, 2025
7634837
Added the new hom with outputs in E::G1 and E::G2
waamm Dec 11, 2025
9b66859
Merge branch 'main' into wicher/more-dkg-edits
waamm Dec 11, 2025
76d9af1
About to change aggregatable
waamm Dec 11, 2025
888d036
Changed Aggregatable<C> to Aggregatable
waamm Dec 11, 2025
878b8f0
Renamed SubTranscript to Subtranscript
waamm Dec 11, 2025
46fa0c0
lints
waamm Dec 11, 2025
fa3d524
more lints
waamm Dec 11, 2025
83e20cd
More lints
waamm Dec 11, 2025
6a632a2
removed two files
waamm Dec 11, 2025
c49a47c
Comments
waamm Dec 11, 2025
7b79792
Added benches and PVSSv2
waamm Dec 15, 2025
a706c64
Hmm made player version of scalar_mul, but tests are not passing
waamm Dec 15, 2025
3f8cacd
Tests passing
waamm Dec 16, 2025
ea47739
Added serialize PVSS bench
waamm Dec 16, 2025
512552e
Tempt commit after adding batch_normalize to trait
waamm Dec 19, 2025
13a678c
Too many changes
waamm Dec 23, 2025
bf3c1cf
Merge branch 'main' into wicher/more-dkg-edits
waamm Dec 23, 2025
7cac22d
Commit before new batch serialize
waamm Dec 29, 2025
e50e779
Various changes
waamm Jan 6, 2026
586c011
Merge branch 'wicher/more-dkg-edits' of github.com:aptos-labs/aptos-c…
waamm Jan 6, 2026
07a03f7
Some initial benchmark edits
waamm Jan 8, 2026
9013f62
Merge branch 'main' into wicher/more-dkg-edits
waamm Jan 8, 2026
18b4154
Added Zeromorph and PCS trait and PCS bench
waamm Jan 8, 2026
49ae8dd
Some changes
waamm Jan 8, 2026
8f313eb
Added PVSS benches
waamm Jan 12, 2026
77681dc
Preparing for merge
waamm Jan 16, 2026
b698fd4
Changed PublicParameters again to CurveGroup
waamm Jan 16, 2026
e23a4ec
Merged main
waamm Jan 16, 2026
2abfdc4
Tiny edits
waamm Jan 16, 2026
e0ebab5
Tiny edits
waamm Jan 16, 2026
9b80bb2
License
waamm Jan 16, 2026
aca7d2a
Small edits
waamm Jan 16, 2026
aa6b2e3
Small fixes
waamm Jan 16, 2026
ae67e0c
Removed Base associated type from FixedBaseMsms
waamm Jan 17, 2026
a3ee07b
Small fixes
waamm Jan 17, 2026
b2dfc03
Lints
waamm Jan 17, 2026
4149ca7
Edits to Zeromorph
waamm Jan 17, 2026
427847d
More edits
waamm Jan 17, 2026
04e6ac3
Lints
waamm Jan 17, 2026
f655093
cargo-machete
waamm Jan 17, 2026
52740cf
Edit to deserialization
waamm Jan 17, 2026
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
2 changes: 2 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions crates/aptos-batch-encryption/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,9 @@ harness = false
name = "multi_point_eval"
harness = false

[[bench]]
name = "fptx"
harness = false
# [[bench]]
# name = "fptx"
# harness = false

[[bench]]
name = "fptx_succinct"
Expand Down
7 changes: 5 additions & 2 deletions crates/aptos-batch-encryption/src/schemes/fptx_weighted.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ use crate::{
errors::BatchEncryptionError,
group::*,
shared::{
ark_serialize::*,
ciphertext::{CTDecrypt, CTEncrypt, PreparedCiphertext, StandardCiphertext},
digest::{Digest, DigestKey, EvalProof, EvalProofs, EvalProofsPromise},
encryption_key::EncryptionKey,
Expand All @@ -19,7 +18,11 @@ use crate::{
},
};
use anyhow::{anyhow, Result};
use aptos_crypto::{weighted_config::WeightedConfigArkworks, SecretSharingConfig as _};
use aptos_crypto::{
arkworks::serialization::{ark_de, ark_se},
weighted_config::WeightedConfigArkworks,
SecretSharingConfig as _,
};
use aptos_dkg::pvss::{
traits::{Reconstructable as _, Subtranscript},
Player,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
// Copyright (c) Aptos Foundation
// Licensed pursuant to the Innovation-Enabling Source Code License, available at https://github.com/aptos-labs/aptos-core/blob/main/LICENSE
use super::multi_point_eval::multi_point_eval;
use crate::shared::{algebra::multi_point_eval::multi_point_eval_naive, ark_serialize::*};
use crate::shared::algebra::multi_point_eval::multi_point_eval_naive;
use aptos_crypto::arkworks::serialization::{ark_de, ark_se};
use ark_ec::VariableBaseMSM;
use ark_ff::FftField;
use ark_poly::{domain::DomainCoeff, EvaluationDomain, Radix2EvaluationDomain};
Expand Down
3 changes: 2 additions & 1 deletion crates/aptos-batch-encryption/src/shared/ciphertext/bibe.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@ use super::super::{
use crate::{
errors::BatchEncryptionError,
group::{Fr, G1Affine, G2Affine, G2Prepared, PairingOutput, PairingSetting},
shared::{ark_serialize::*, digest::EvalProof, encryption_key::EncryptionKey, ids::Id},
shared::{digest::EvalProof, encryption_key::EncryptionKey, ids::Id},
traits::Plaintext,
};
use anyhow::Result;
use aptos_crypto::arkworks::serialization::{ark_de, ark_se};
use ark_ec::{pairing::Pairing, AffineRepr};
use ark_serialize::CanonicalSerialize;
use ark_std::{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ use crate::{
errors::BatchEncryptionError,
group::{Fr, G1Affine, G2Affine, PairingOutput, PairingSetting},
shared::{
ark_serialize::*,
ciphertext::bibe::{BIBECTEncrypt, InnerCiphertext},
digest::{Digest, EvalProof},
encryption_key::AugmentedEncryptionKey,
Expand All @@ -20,6 +19,7 @@ use crate::{
traits::Plaintext,
};
use anyhow::Result;
use aptos_crypto::arkworks::serialization::{ark_de, ark_se};
use ark_ec::{pairing::Pairing, AffineRepr};
use ark_serialize::CanonicalSerialize;
use ark_std::{
Expand Down
3 changes: 2 additions & 1 deletion crates/aptos-batch-encryption/src/shared/digest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@ use super::ids::{ComputedCoeffs, Id, IdSet};
use crate::{
errors::BatchEncryptionError,
group::{Fr, G1Affine, G1Projective, G2Affine, G2Projective, PairingSetting},
shared::{algebra::fk_algorithm::FKDomain, ark_serialize::*, ids::UncomputedCoeffs},
shared::{algebra::fk_algorithm::FKDomain, ids::UncomputedCoeffs},
};
use anyhow::{anyhow, Result};
use aptos_crypto::arkworks::serialization::{ark_de, ark_se};
use ark_ec::{pairing::Pairing, AffineRepr, ScalarMul, VariableBaseMSM};
use ark_std::{
rand::{CryptoRng, RngCore},
Expand Down
2 changes: 1 addition & 1 deletion crates/aptos-batch-encryption/src/shared/encryption_key.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
use crate::{
group::G2Affine,
shared::{
ark_serialize::*,
digest::Digest,
key_derivation::{BIBEDecryptionKey, BIBEMasterPublicKey},
},
};
use anyhow::Result;
use aptos_crypto::arkworks::serialization::{ark_de, ark_se};
use serde::{Deserialize, Serialize};

#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq)]
Expand Down
6 changes: 2 additions & 4 deletions crates/aptos-batch-encryption/src/shared/ids/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,9 @@
// Licensed pursuant to the Innovation-Enabling Source Code License, available at https://github.com/aptos-labs/aptos-core/blob/main/LICENSE
use crate::{
group::{Fr, G1Affine, G1Projective},
shared::{
algebra::mult_tree::{compute_mult_tree, quotient},
ark_serialize::*,
},
shared::algebra::mult_tree::{compute_mult_tree, quotient},
};
use aptos_crypto::arkworks::serialization::{ark_de, ark_se};
use ark_ec::VariableBaseMSM as _;
use ark_ff::field_hashers::{DefaultFieldHasher, HashToField};
use ark_poly::univariate::DensePolynomial;
Expand Down
7 changes: 5 additions & 2 deletions crates/aptos-batch-encryption/src/shared/key_derivation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,15 @@ use super::symmetric;
use crate::{
errors::BatchEncryptionError,
group::{Fr, G1Affine, G2Affine, PairingSetting},
shared::{ark_serialize::*, digest::Digest},
shared::digest::Digest,
traits::{DecryptionKeyShare, VerificationKey},
};
use anyhow::Result;
use aptos_crypto::{
arkworks::shamir::{Reconstructable, ShamirGroupShare, ShamirThresholdConfig},
arkworks::{
serialization::{ark_de, ark_se},
shamir::{Reconstructable, ShamirGroupShare, ShamirThresholdConfig},
},
player::Player,
};
use ark_ec::{pairing::Pairing as _, AffineRepr};
Expand Down
1 change: 0 additions & 1 deletion crates/aptos-batch-encryption/src/shared/mod.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// Copyright (c) Aptos Foundation
// Licensed pursuant to the Innovation-Enabling Source Code License, available at https://github.com/aptos-labs/aptos-core/blob/main/LICENSE
pub mod algebra;
pub mod ark_serialize;
pub mod ciphertext;
pub mod digest;
pub mod encryption_key;
Expand Down
8 changes: 4 additions & 4 deletions crates/aptos-crypto-derive/src/unions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -277,20 +277,20 @@ pub fn impl_enum_signature(
type VerifyingKeyMaterial = #pub_kt;
type SigningKeyMaterial = #priv_kt;

fn verify<T: aptos_crypto::hash::CryptoHash + serde::Serialize>(&self, message: &T, public_key: &Self::VerifyingKeyMaterial) -> std::result::Result<(), aptos_crypto::error::Error> {
fn verify<T: aptos_crypto::hash::CryptoHash + serde::Serialize>(&self, message: &T, public_key: &Self::VerifyingKeyMaterial) -> std::result::Result<(), anyhow::Error> {
match (self, public_key) {
#match_struct_arms
_ => aptos_crypto::error::bail!(
_ => anyhow::bail!(
"provided the wrong alternative in {:?}!",
(self, public_key)
),
}
}

fn verify_arbitrary_msg(&self, message: &[u8], public_key: &Self::VerifyingKeyMaterial) -> std::result::Result<(), aptos_crypto::error::Error> {
fn verify_arbitrary_msg(&self, message: &[u8], public_key: &Self::VerifyingKeyMaterial) -> std::result::Result<(), anyhow::Error> {
match (self, public_key) {
#match_arms
_ => aptos_crypto::error::bail!(
_ => anyhow::bail!(
"provided the wrong alternative in {:?}!",
(self, public_key)
),
Expand Down
1 change: 1 addition & 0 deletions crates/aptos-crypto/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ proptest = { workspace = true, optional = true }
proptest-derive = { workspace = true, optional = true }
rand = { workspace = true }
rand_core = { workspace = true }
rayon = { workspace = true }
ring = { workspace = true }
serde = { workspace = true }
serde-name = { workspace = true }
Expand Down
16 changes: 12 additions & 4 deletions crates/aptos-crypto/benches/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@

## Batched Bulletproofs and DeKART

Go to `aptos-crypto`:
Go to `aptos-crypto/benches`:
```
cd crates/aptos-crypto
cd crates/aptos-crypto/benches
```

Install [`criterion-means`](https://crates.io/crates/cargo-criterion-means):
Install [`cargo-criterion-means`](https://crates.io/crates/cargo-criterion-means):

```
cargo install criterion-means
cargo install cargo-criterion-means
```

Run the Bulletproof and DeKART benchmarks in one line via:
Expand All @@ -19,3 +19,11 @@ Run the Bulletproof and DeKART benchmarks in one line via:
```

This will generate CSV data with the benchmark data, format it as Markdown and copy it to your clipboard!

## Chunky PVSS

Follow the same steps, but run the benchmarks via:

```
./run-pvss-benches.sh
```
Loading
Loading