Closed 302ba closed 4 years ago
The reason you get assert is because you didn't specify the sign.
I have fixed it.
procedure Test;
var
arrBytes: array[0..15] of
byte = (159, 245, 94, 199, 119, 153, 43, 128, 135, 251, 91, 211,
154, 145, 184, 255);
aBytes: TBytes;
r, s: TBigInteger;
begin
SetLength(aBytes, Length(arrBytes));
Move(arrBytes[0], aBytes[0], Length(arrBytes));
r := TBigInteger.Create(1, aBytes, 0, 16); //<== fixed
s := TBigInteger.Create(TConverters.ConvertBytesToHexString(aBytes, False), 16);
Assert(r.Equals(s), 'BigIntegers are not equal');
end;
Got it! Thanks for the help
Hi, Could you please tell me why I get assert:
S contains the right value, but why R is wrong? Thanks.
Best regards, Alex