File tree Expand file tree Collapse file tree 3 files changed +12
-0
lines changed Expand file tree Collapse file tree 3 files changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -471,6 +471,10 @@ pub const AffineCoordinates = struct {
471
471
/// Identity element in affine coordinates.
472
472
pub const identityElement = AffineCoordinates { .x = P256 .identityElement .x , .y = P256 .identityElement .y };
473
473
474
+ pub fn neg (p : AffineCoordinates ) AffineCoordinates {
475
+ return .{ .x = p .x , .y = p .y .neg () };
476
+ }
477
+
474
478
fn cMov (p : * AffineCoordinates , a : AffineCoordinates , c : u1 ) void {
475
479
p .x .cMov (a .x , c );
476
480
p .y .cMov (a .y , c );
Original file line number Diff line number Diff line change @@ -471,6 +471,10 @@ pub const AffineCoordinates = struct {
471
471
/// Identity element in affine coordinates.
472
472
pub const identityElement = AffineCoordinates { .x = P384 .identityElement .x , .y = P384 .identityElement .y };
473
473
474
+ pub fn neg (p : AffineCoordinates ) AffineCoordinates {
475
+ return .{ .x = p .x , .y = p .y .neg () };
476
+ }
477
+
474
478
fn cMov (p : * AffineCoordinates , a : AffineCoordinates , c : u1 ) void {
475
479
p .x .cMov (a .x , c );
476
480
p .y .cMov (a .y , c );
Original file line number Diff line number Diff line change @@ -549,6 +549,10 @@ pub const AffineCoordinates = struct {
549
549
/// Identity element in affine coordinates.
550
550
pub const identityElement = AffineCoordinates { .x = Secp256k1 .identityElement .x , .y = Secp256k1 .identityElement .y };
551
551
552
+ pub fn neg (p : AffineCoordinates ) AffineCoordinates {
553
+ return .{ .x = p .x , .y = p .y .neg () };
554
+ }
555
+
552
556
fn cMov (p : * AffineCoordinates , a : AffineCoordinates , c : u1 ) void {
553
557
p .x .cMov (a .x , c );
554
558
p .y .cMov (a .y , c );
You can’t perform that action at this time.
0 commit comments