dkg method

  1. @override
BuBytes dkg({
  1. required Dkls23Curve curve,
  2. required List<int> sid,
  3. required int n,
  4. required int t,
  5. required List<int> seeds,
})
override

Full DKG ceremony (n parties, threshold t) from n 32-byte seeds → framed shares blob. Throws on bad n/t/seed lengths.

Implementation

@override
BuBytes dkg({
  required Dkls23Curve curve,
  required List<int> sid,
  required int n,
  required int t,
  required List<int> seeds,
}) {
  if (n < 2) {
    throw CoreErrors.invalidOperationArguments(
      '$_tag.dkg',
      name: 'n',
      reason: 'at least 2 parties required',
    );
  }
  if (sid.isEmpty) {
    throw CoreErrors.invalidOperationArguments(
      '$_tag.dkg',
      name: 'sid',
      reason: 'session id must not be empty.',
    );
  }
  if (t < 2 || t > n) {
    throw CoreErrors.invalidOperationArguments(
      '$_tag.dkg',
      name: 't',
      reason: 'need 2 <= t <= n',
    );
  }
  ApiValidate.length(seeds, n * 32, operation: '$_tag.dkg', name: 'seeds');
  return ApiValidate.call(
    '$_tag.dkg',
    () => inner.dkg(curve: curve, sid: sid, n: n, t: t, seeds: seeds),
  );
}