bitwiseshiftleft / sjcl

Stanford Javascript Crypto Library
http://bitwiseshiftleft.github.com/sjcl/
Other
7.19k stars 988 forks source link

bn sub incorrect result #411

Open guidovranken opened 4 years ago

guidovranken commented 4 years ago
{
    var bn1 = new sjcl.bn("12c");
    var bn2 = new sjcl.bn("c623c5a01658c5eacfc91f2305b3ec");
    console.log(bn1.sub(bn2).toString());
}

Expected result:

0x-c623c5a01658c5eacfc91f2305b2c0

Actual result:

0x-c623c65fe9a73a153036e0dcfa4d40