@@ -1335,7 +1335,7 @@ impl GroupEncoding for EdwardsPoint {
1335
1335
/// A `SubgroupPoint` represents a point on the Edwards form of Curve25519, that is
1336
1336
/// guaranteed to be in the prime-order subgroup.
1337
1337
#[ cfg( feature = "group" ) ]
1338
- #[ derive( Clone , Copy , Debug , PartialEq , Eq ) ]
1338
+ #[ derive( Clone , Copy , Debug , Default , PartialEq , Eq ) ]
1339
1339
pub struct SubgroupPoint ( EdwardsPoint ) ;
1340
1340
1341
1341
#[ cfg( feature = "group" ) ]
@@ -1510,6 +1510,20 @@ impl MulAssign<&Scalar> for SubgroupPoint {
1510
1510
#[ cfg( feature = "group" ) ]
1511
1511
define_mul_assign_variants ! ( LHS = SubgroupPoint , RHS = Scalar ) ;
1512
1512
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
+
1513
1527
#[ cfg( feature = "group" ) ]
1514
1528
impl group:: Group for SubgroupPoint {
1515
1529
type Scalar = Scalar ;
0 commit comments