x25519.mx raw
1 //go:build !wasm
2 //:build !wasm
3
4 package x25519
5
6 // X25519 Diffie-Hellman (RFC 7748) via JS BigInt.
7 // Curve25519 field arithmetic uses 256-bit integers which lose precision
8 // when compiled to JS float64. This jsbridge delegates to x25519.mjs
9 // which uses BigInt for exact arithmetic.
10
11 // ScalarMult computes X25519(scalar, point).
12 // Both inputs are 32-byte little-endian. Returns 32-byte shared secret.
13 // The scalar is clamped per RFC 7748 ยง5.
14 func ScalarMult(scalar, point []byte) (buf []byte) { panic("jsbridge") }
15
16 // ScalarBaseMult computes X25519(scalar, basepoint).
17 // scalar is 32 bytes. Returns 32-byte public key (little-endian u-coordinate).
18 func ScalarBaseMult(scalar []byte) (buf []byte) { panic("jsbridge") }
19