mirror of
https://github.com/arnaucube/arkeddsa.git
synced 2026-01-12 16:21:29 +01:00
add clone to TEConfig
This commit is contained in:
@@ -75,7 +75,7 @@ pub struct SigningKey<TE: TECurveConfig> {
|
|||||||
public_key: PublicKey<TE>,
|
public_key: PublicKey<TE>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<TE: TECurveConfig> SigningKey<TE>
|
impl<TE: TECurveConfig + Clone> SigningKey<TE>
|
||||||
where
|
where
|
||||||
TE::BaseField: PrimeField + Absorb,
|
TE::BaseField: PrimeField + Absorb,
|
||||||
{
|
{
|
||||||
@@ -138,7 +138,7 @@ where
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<TE: TECurveConfig> PublicKey<TE>
|
impl<TE: TECurveConfig + Clone> PublicKey<TE>
|
||||||
where
|
where
|
||||||
TE::BaseField: PrimeField + Absorb,
|
TE::BaseField: PrimeField + Absorb,
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ mod test {
|
|||||||
PoseidonConfig::new(full_rounds, partial_rounds, 5, mds, ark, rate, 1)
|
PoseidonConfig::new(full_rounds, partial_rounds, 5, mds, ark, rate, 1)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn run_test<TE: TECurveConfig, D: Digest>()
|
fn run_test<TE: TECurveConfig + Clone, D: Digest>()
|
||||||
where
|
where
|
||||||
TE::BaseField: Absorb + PrimeField,
|
TE::BaseField: Absorb + PrimeField,
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -5,12 +5,12 @@ use ark_serialize::CanonicalSerialize;
|
|||||||
|
|
||||||
#[derive(Clone, Copy, Debug)]
|
#[derive(Clone, Copy, Debug)]
|
||||||
/// `SignatureComponents` contains the realized parts of a signature
|
/// `SignatureComponents` contains the realized parts of a signature
|
||||||
pub struct Signature<TE: TECurveConfig> {
|
pub struct Signature<TE: TECurveConfig + Clone> {
|
||||||
r: Affine<TE>,
|
r: Affine<TE>,
|
||||||
s: TE::ScalarField,
|
s: TE::ScalarField,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<TE: TECurveConfig> Signature<TE> {
|
impl<TE: TECurveConfig + Clone> Signature<TE> {
|
||||||
/// Serializes the signature components to bytes as uncompressed.
|
/// Serializes the signature components to bytes as uncompressed.
|
||||||
/// Expect output size to be `size_of(TE::BaseField) * 2 + size_of(TE::ScalarField)`
|
/// Expect output size to be `size_of(TE::BaseField) * 2 + size_of(TE::ScalarField)`
|
||||||
pub fn to_bytes(&self) -> Vec<u8> {
|
pub fn to_bytes(&self) -> Vec<u8> {
|
||||||
|
|||||||
Reference in New Issue
Block a user