crypto_chacha20_djb function

  1. @Native<Uint64 Function(Pointer<Uint8>, Pointer<Uint8>, Size, Pointer<Uint8>, Pointer<Uint8>, Uint64)>(ffi.Pointer<ffi.Uint8>, ffi.Pointer<ffi.Uint8>, ffi.Size, ffi.Pointer<ffi.Uint8>, ffi.Pointer<ffi.Uint8>, ffi.Uint64)>()
int crypto_chacha20_djb(
  1. Pointer<Uint8> cipher_text,
  2. Pointer<Uint8> plain_text,
  3. int text_size,
  4. Pointer<Uint8> key,
  5. Pointer<Uint8> nonce,
  6. int ctr,
)

Unauthenticated stream cipher. Don't forget to add authentication.

Implementation

@ffi.Native<
  ffi.Uint64 Function(
    ffi.Pointer<ffi.Uint8>,
    ffi.Pointer<ffi.Uint8>,
    ffi.Size,
    ffi.Pointer<ffi.Uint8>,
    ffi.Pointer<ffi.Uint8>,
    ffi.Uint64,
  )
>()
external int crypto_chacha20_djb(
  ffi.Pointer<ffi.Uint8> cipher_text,
  ffi.Pointer<ffi.Uint8> plain_text,
  int text_size,
  ffi.Pointer<ffi.Uint8> key,
  ffi.Pointer<ffi.Uint8> nonce,
  int ctr,
);