curve25519_scalarmult

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

Parameters

secret
Type: ubyte[32]

Your secret key, the 'exponent'.

p
Type: 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