arnaucube
arnaucube/ark-r1cs-stdPublic Self-hosted repository
ark-r1cs-std/r1cs-std/src/groups/curves/twisted_edwards/edwards_sw6.rs
r1cs-std/src/groups/curves/twisted_edwards/edwards_sw6.rsRaw
 1use crate::groups::curves::twisted_edwards::AffineGadget;
 2use algebra::{curves::edwards_sw6::EdwardsParameters, fields::edwards_sw6::fq::Fq};
 3
 4use crate::fields::edwards_sw6::FqGadget;
 5
 6pub type EdwardsSWGadget = AffineGadget<EdwardsParameters, Fq, FqGadget>;
 7
 8#[cfg(test)]
 9mod test {
10    use super::EdwardsSWGadget as EdwardsG;
11    use crate::{
12        groups::curves::twisted_edwards::test::{edwards_constraint_costs, edwards_test},
13        test_constraint_system::TestConstraintSystem,
14    };
15    use algebra::{curves::edwards_sw6::EdwardsParameters, fields::edwards_sw6::fq::Fq};
16
17    #[test]
18    fn edwards_constraint_costs_test() {
19        let mut cs = TestConstraintSystem::<Fq>::new();
20        edwards_constraint_costs::<_, EdwardsParameters, EdwardsG, _>(&mut cs);
21        assert!(cs.is_satisfied());
22    }
23
24    #[test]
25    fn edwards_sw6_gadget_test() {
26        let mut cs = TestConstraintSystem::<Fq>::new();
27        edwards_test::<_, EdwardsParameters, EdwardsG, _>(&mut cs);
28        assert!(cs.is_satisfied());
29    }
30}