curve25519_scalarmult

  1. ubyte[32] curve25519_scalarmult(ubyte[] secret, ubyte[] p)
  2. ubyte[32] curve25519_scalarmult(ubyte[32] secret, ubyte[32] p)
    @safe nothrow @nogc @safe nothrow @nogc
    ubyte[32]
    curve25519_scalarmult
    (
    in ref ubyte[32] secret
    ,
    in ref ubyte[32] p = publicBasePoint
    )

Parameters

secret ubyte[32]

Your secret key, the 'exponent'.

p ubyte[32]

Receivers public key. Default base point = 9.

Return Value

Type: ubyte[32]

p^secret.

Examples

ubyte[32] publicKey = curve25519_scalarmult(secretKey);

ubyte[32] sharedKey = curve25519_scalarmult(mySecretKey, herPublicKey);

Meta