X25519 function

  1. @RecordUse.new()
  2. @Native<Int Function(Pointer<Uint8>, Pointer<Uint8>, Pointer<Uint8>)>(ffi.Pointer<ffi.Uint8>, ffi.Pointer<ffi.Uint8>, ffi.Pointer<ffi.Uint8>)>(symbol: 'bssl_dart_X25519')
int X25519(
  1. Pointer<Uint8> out_shared_key,
  2. Pointer<Uint8> private_key,
  3. Pointer<Uint8> peer_public_value
)

X25519 writes a shared key to |out_shared_key| that is calculated from the given private key and the peer's public value. It returns one on success and zero on error.

Don't use the shared key directly, rather use a KDF and also include the two public values as inputs.

Implementation

@meta.RecordUse()
@ffi.Native<
  ffi.Int Function(
    ffi.Pointer<ffi.Uint8>,
    ffi.Pointer<ffi.Uint8>,
    ffi.Pointer<ffi.Uint8>,
  )
>(symbol: 'bssl_dart_X25519')
external int X25519(
  ffi.Pointer<ffi.Uint8> out_shared_key,
  ffi.Pointer<ffi.Uint8> private_key,
  ffi.Pointer<ffi.Uint8> peer_public_value,
);