mirror of
https://github.com/serai-dex/serai.git
synced 2025-12-08 04:09:23 +00:00
Place Schnorr signature aggregation behind a feature flag
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "schnorr-signatures"
|
||||
version = "0.5.1"
|
||||
version = "0.5.2"
|
||||
description = "Minimal Schnorr signatures crate hosting common code"
|
||||
license = "MIT"
|
||||
repository = "https://github.com/serai-dex/serai/tree/develop/crypto/schnorr"
|
||||
@@ -39,5 +39,6 @@ dalek-ff-group = { path = "../dalek-ff-group" }
|
||||
ciphersuite = { path = "../ciphersuite", features = ["ed25519"] }
|
||||
|
||||
[features]
|
||||
aggregate = []
|
||||
std = ["std-shims/std", "rand_core/std", "zeroize/std", "transcript/std", "ciphersuite/std", "multiexp/std"]
|
||||
default = ["std"]
|
||||
|
||||
@@ -25,6 +25,7 @@ use ciphersuite::{
|
||||
use multiexp::{multiexp_vartime, BatchVerifier};
|
||||
|
||||
/// Half-aggregation from <https://eprint.iacr.org/2021/350>.
|
||||
#[cfg(feature = "aggregate")]
|
||||
pub mod aggregate;
|
||||
|
||||
#[cfg(test)]
|
||||
|
||||
@@ -9,10 +9,9 @@ use ciphersuite::{
|
||||
};
|
||||
use multiexp::BatchVerifier;
|
||||
|
||||
use crate::{
|
||||
SchnorrSignature,
|
||||
aggregate::{SchnorrAggregator, SchnorrAggregate},
|
||||
};
|
||||
use crate::SchnorrSignature;
|
||||
#[cfg(feature = "aggregate")]
|
||||
use crate::aggregate::{SchnorrAggregator, SchnorrAggregate};
|
||||
|
||||
mod rfc8032;
|
||||
|
||||
@@ -77,6 +76,7 @@ pub(crate) fn batch_verify<C: Ciphersuite>() {
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "aggregate")]
|
||||
pub(crate) fn aggregate<C: Ciphersuite>() {
|
||||
const DST: &[u8] = b"Schnorr Aggregator Test";
|
||||
|
||||
@@ -117,5 +117,6 @@ fn test() {
|
||||
sign::<Ed25519>();
|
||||
verify::<Ed25519>();
|
||||
batch_verify::<Ed25519>();
|
||||
#[cfg(feature = "aggregate")]
|
||||
aggregate::<Ed25519>();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user