You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A high bit when binary encoding a BN can signal the number is negative. There should be a way when encoding / decoding OpenSSL::BN to indicate if the encoded value is signed or unsigned.
Parsing a unsigned : OpenSSL::BN.new('FF', 16, signed: false) -> .to_i => 255
Parsing a signed : OpenSSL::BN.new('FF', 16, signed: true) -> .negative? => true
Omitting the value for signed: maintains compatibility
Similar parameters may be needed for #to_s as if it is a unsigned with the most significant bit set occurring on the byte boundary it needs an additional "\x00" prefix to disambiguate its sign