SPAKE2_CTX_new function

  1. @RecordUse.new()
  2. @Native<Pointer<SPAKE2_CTX> Function(UnsignedInt, Pointer<Uint8>, Size, Pointer<Uint8>, Size)>(ffi.UnsignedInt, ffi.Pointer<ffi.Uint8>, ffi.Size, ffi.Pointer<ffi.Uint8>, ffi.Size)>(symbol: 'bssl_dart_SPAKE2_CTX_new')
Pointer<SPAKE2_CTX> SPAKE2_CTX_new(
  1. int my_role,
  2. Pointer<Uint8> my_name,
  3. int my_name_len,
  4. Pointer<Uint8> their_name,
  5. int their_name_len,
)

SPAKE2_CTX_new creates a new |SPAKE2_CTX| (which can only be used for a single execution of the protocol). SPAKE2 requires the symmetry of the two parties to be broken which is indicated via |my_role| – each party must pass a different value for this argument.

The |my_name| and |their_name| arguments allow optional, opaque names to be bound into the protocol. For example MAC addresses, hostnames, usernames etc. These values are not exposed and can avoid context-confusion attacks when a password is shared between several devices.

Implementation

@meta.RecordUse()
@ffi.Native<
  ffi.Pointer<SPAKE2_CTX> Function(
    ffi.UnsignedInt,
    ffi.Pointer<ffi.Uint8>,
    ffi.Size,
    ffi.Pointer<ffi.Uint8>,
    ffi.Size,
  )
>(symbol: 'bssl_dart_SPAKE2_CTX_new')
external ffi.Pointer<SPAKE2_CTX> SPAKE2_CTX_new(
  int my_role,
  ffi.Pointer<ffi.Uint8> my_name,
  int my_name_len,
  ffi.Pointer<ffi.Uint8> their_name,
  int their_name_len,
);