@@ -3,12 +3,12 @@ use fp2::fq::Fq as FqTrait;
3
3
use crate :: elliptic:: { curve:: Curve , projective_point:: Point } ;
4
4
5
5
#[ derive( Clone , Copy , Debug ) ]
6
- pub struct CouplePoint < Fq : FqTrait > {
6
+ pub struct ProductPoint < Fq : FqTrait > {
7
7
P1 : Point < Fq > ,
8
8
P2 : Point < Fq > ,
9
9
}
10
10
11
- impl < Fq : FqTrait > CouplePoint < Fq > {
11
+ impl < Fq : FqTrait > ProductPoint < Fq > {
12
12
/// Return the pair of points at infinity: O1, O2 on E1 x E2
13
13
pub const INFINITY : Self = Self {
14
14
P1 : Point :: INFINITY ,
@@ -26,7 +26,7 @@ impl<Fq: FqTrait> CouplePoint<Fq> {
26
26
}
27
27
}
28
28
29
- impl < Fq : FqTrait > :: std:: fmt:: Display for CouplePoint < Fq > {
29
+ impl < Fq : FqTrait > :: std:: fmt:: Display for ProductPoint < Fq > {
30
30
fn fmt ( & self , f : & mut :: std:: fmt:: Formatter ) -> :: std:: fmt:: Result {
31
31
write ! ( f, "CouplePoint with Points:\n {}\n {}" , self . P1 , self . P2 )
32
32
}
@@ -53,15 +53,15 @@ impl<Fq: FqTrait> EllipticProduct<Fq> {
53
53
/// Addition of elements (P1, P2) and (Q1, Q2) on E1 x E2 is defined
54
54
/// as (P1 + Q1, P2 + Q2). This function calls the add function for
55
55
/// the pair of curves on the EllipticProduct
56
- pub fn add ( self , C1 : & CouplePoint < Fq > , C2 : & CouplePoint < Fq > ) -> CouplePoint < Fq > {
57
- let mut C3 = CouplePoint :: INFINITY ;
56
+ pub fn add ( self , C1 : & ProductPoint < Fq > , C2 : & ProductPoint < Fq > ) -> ProductPoint < Fq > {
57
+ let mut C3 = ProductPoint :: INFINITY ;
58
58
C3 . P1 = self . E1 . add ( & C1 . P1 , & C2 . P1 ) ;
59
59
C3 . P2 = self . E2 . add ( & C1 . P2 , & C2 . P2 ) ;
60
60
C3
61
61
}
62
62
63
63
/// Doubles the pair of points (P1, P2) on E1 x E2 as ([2]P1, [2]P2)
64
- pub fn double ( self , C : & CouplePoint < Fq > ) -> CouplePoint < Fq > {
64
+ pub fn double ( self , C : & ProductPoint < Fq > ) -> ProductPoint < Fq > {
65
65
let mut C3 = * C ;
66
66
C3 . P1 = self . E1 . double ( & C3 . P1 ) ;
67
67
C3 . P2 = self . E2 . double ( & C3 . P2 ) ;
@@ -70,7 +70,7 @@ impl<Fq: FqTrait> EllipticProduct<Fq> {
70
70
71
71
/// Repeatedly doubles the pair of points (P1, P2) on E1 x E2 to get
72
72
/// ([2^n]P1, [2^n]P2)
73
- pub fn double_iter ( self , C : & CouplePoint < Fq > , n : usize ) -> CouplePoint < Fq > {
73
+ pub fn double_iter ( self , C : & ProductPoint < Fq > , n : usize ) -> ProductPoint < Fq > {
74
74
let mut C3 = * C ;
75
75
C3 . P1 = self . E1 . double_iter ( & C3 . P1 , n) ;
76
76
C3 . P2 = self . E2 . double_iter ( & C3 . P2 , n) ;
0 commit comments