aboutsummaryrefslogtreecommitdiff
path: root/lib/std/crypto/25519/curve25519.zig
diff options
context:
space:
mode:
Diffstat (limited to 'lib/std/crypto/25519/curve25519.zig')
-rw-r--r--lib/std/crypto/25519/curve25519.zig5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/std/crypto/25519/curve25519.zig b/lib/std/crypto/25519/curve25519.zig
index 94490f674c..7f180eac2f 100644
--- a/lib/std/crypto/25519/curve25519.zig
+++ b/lib/std/crypto/25519/curve25519.zig
@@ -39,6 +39,11 @@ pub const Curve25519 = struct {
}
}
+ /// Multiply a point by the cofactor
+ pub fn clearCofactor(p: Edwards25519) Edwards25519 {
+ return p.dbl().dbl().dbl();
+ }
+
fn ladder(p: Curve25519, s: [32]u8, comptime bits: usize) !Curve25519 {
var x1 = p.x;
var x2 = Fe.one;