@@ -1335,7 +1335,7 @@ impl GroupEncoding for EdwardsPoint {
13351335/// A `SubgroupPoint` represents a point on the Edwards form of Curve25519, that is
13361336/// guaranteed to be in the prime-order subgroup.
13371337#[ cfg( feature = "group" ) ]
1338- #[ derive( Clone , Copy , Debug , PartialEq , Eq ) ]
1338+ #[ derive( Clone , Copy , Debug , Default , PartialEq , Eq ) ]
13391339pub struct SubgroupPoint ( EdwardsPoint ) ;
13401340
13411341#[ cfg( feature = "group" ) ]
@@ -1510,6 +1510,20 @@ impl MulAssign<&Scalar> for SubgroupPoint {
15101510#[ cfg( feature = "group" ) ]
15111511define_mul_assign_variants ! ( LHS = SubgroupPoint , RHS = Scalar ) ;
15121512
1513+ #[ cfg( feature = "group" ) ]
1514+ impl ConstantTimeEq for SubgroupPoint {
1515+ fn ct_eq ( & self , other : & SubgroupPoint ) -> Choice {
1516+ self . 0 . ct_eq ( & other. 0 )
1517+ }
1518+ }
1519+
1520+ #[ cfg( feature = "group" ) ]
1521+ impl ConditionallySelectable for SubgroupPoint {
1522+ fn conditional_select ( a : & SubgroupPoint , b : & SubgroupPoint , choice : Choice ) -> SubgroupPoint {
1523+ SubgroupPoint ( EdwardsPoint :: conditional_select ( & a. 0 , & b. 0 , choice) )
1524+ }
1525+ }
1526+
15131527#[ cfg( feature = "group" ) ]
15141528impl group:: Group for SubgroupPoint {
15151529 type Scalar = Scalar ;
0 commit comments