Browse Source

Add serialization for CP6-782 (#120)

Co-authored-by: onewayfunc <onewayfunc@gmail.com>
cherry-pick
Weikeng Chen 2 years ago
committed by GitHub
parent
commit
f74378c017
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 3 deletions
  1. +1
    -1
      cp6_782/Cargo.toml
  2. +3
    -1
      cp6_782/src/curves/g1.rs
  3. +3
    -1
      cp6_782/src/curves/g2.rs

+ 1
- 1
cp6_782/Cargo.toml

@ -18,9 +18,9 @@ ark-ec = { version = "^0.3.0", default-features = false }
ark-std = { version = "^0.3.0", default-features = false } ark-std = { version = "^0.3.0", default-features = false }
ark-bls12-377 = { version = "^0.3.0", path = "../bls12_377", default-features = false, features = [ "base_field" ] } ark-bls12-377 = { version = "^0.3.0", path = "../bls12_377", default-features = false, features = [ "base_field" ] }
itertools = { version = "0.10", default-features = false } itertools = { version = "0.10", default-features = false }
ark-serialize = { version = "^0.3.0", default-features = false }
[dev-dependencies] [dev-dependencies]
ark-serialize = { version = "^0.3.0", default-features = false }
ark-algebra-test-templates = { version = "^0.3.0", default-features = false } ark-algebra-test-templates = { version = "^0.3.0", default-features = false }
[features] [features]

+ 3
- 1
cp6_782/src/curves/g1.rs

@ -4,13 +4,15 @@ use ark_ec::{
AffineRepr, CurveGroup, AffineRepr, CurveGroup,
}; };
use ark_ff::MontFp; use ark_ff::MontFp;
use ark_serialize::{CanonicalDeserialize, CanonicalSerialize};
use ark_std::vec::Vec;
use crate::{Fq, Fr}; use crate::{Fq, Fr};
pub type G1Affine = Affine<Parameters>; pub type G1Affine = Affine<Parameters>;
pub type G1Projective = Projective<Parameters>; pub type G1Projective = Projective<Parameters>;
#[derive(Clone, Debug, PartialEq, Eq)]
#[derive(Clone, Debug, PartialEq, Eq, CanonicalSerialize, CanonicalDeserialize)]
pub struct G1Prepared(pub G1Affine); pub struct G1Prepared(pub G1Affine);
impl From<G1Affine> for G1Prepared { impl From<G1Affine> for G1Prepared {

+ 3
- 1
cp6_782/src/curves/g2.rs

@ -4,13 +4,15 @@ use ark_ec::{
AffineRepr, CurveGroup, AffineRepr, CurveGroup,
}; };
use ark_ff::{Field, MontFp}; use ark_ff::{Field, MontFp};
use ark_serialize::{CanonicalDeserialize, CanonicalSerialize};
use ark_std::vec::Vec;
use crate::{Fq, Fq3, Fr}; use crate::{Fq, Fq3, Fr};
pub type G2Affine = Affine<Parameters>; pub type G2Affine = Affine<Parameters>;
pub type G2Projective = Projective<Parameters>; pub type G2Projective = Projective<Parameters>;
#[derive(Clone, Debug, PartialEq, Eq)]
#[derive(Clone, Debug, PartialEq, Eq, CanonicalSerialize, CanonicalDeserialize)]
pub struct G2Prepared(pub G2Affine); pub struct G2Prepared(pub G2Affine);
impl From<G2Affine> for G2Prepared { impl From<G2Affine> for G2Prepared {

Loading…
Cancel
Save