crypto_point_add static method

int crypto_point_add(
  1. Uint8List out,
  2. Uint8List p1,
  3. Uint8List p2
)

Implementation

static int crypto_point_add(Uint8List out, Uint8List p1, Uint8List p2) {
  final p =
      List<Int32List>.generate(4, (_) => Int32List(16), growable: false);

  final q =
      List<Int32List>.generate(4, (_) => Int32List(16), growable: false);

  if (TweetNaCl._unpackneg(p, p1) != 0) return -1;
  if (TweetNaCl._unpackneg(q, p2) != 0) return -1;

  TweetNaCl._add(p, q);
  TweetNaCl._pack(out, p);

  out[31] ^= 0x80;

  return 0;
}