privateAdd function
Private Add
Implementation
Uint8List? privateAdd(Uint8List d, Uint8List tweak) {
if (!isPrivate(d)) throw ArgumentError(_throwBadPrivate);
if (!isOrderScalar(tweak)) throw ArgumentError(_throwBadTweak);
BigInt dd = fromBuffer(d);
BigInt tt = fromBuffer(tweak);
Uint8List dt = toBuffer((dd + tt) % _n);
if (dt.length < 32) {
Uint8List padLeadingZero = Uint8List(32 - dt.length);
dt = Uint8List.fromList(padLeadingZero + dt);
}
if (!isPrivate(dt)) return null;
return dt;
}