x25519.mx raw

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