Tags: gopherjs/gopherjs
Tags
Use ES2020 BigInt for edwards25519/field long arithmetics. I attempted to improve edwards25519 performance by using BigInt for long arithmetics instead of a 64-bit based algorithm. The improvement is decent: ``` name old time/op new time/op delta Multiply 19.1µs ± 6% 5.9µs ±10% -69.15% (p=0.000 n=10+97) ``` Unfortunately, it's nowhere near native Go: ``` name old time/op new time/op delta Multiply 26.5ns ± 3% 5878.1ns ±10% +22103.27% (p=0.000 n=92+97) ``` Note that this commit is just exploration, and is incomplete in several ways: - It only optimizes multiplication and not other operations like squaring. - It will actually fail the upstream TestFeMul test, although that's because the test is unnecessarily dependent on implementation details. Specifically it expects a non-normalized Element representation, which doesn't happen in my implementation. - It uses BigInt from ES2020 standard without a fallback, whereas GopherJS is currently targeting ES2015 runtimes. - Arguably, BigInt should not be used in cryptography because it's not constant time: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt#cryptography. I doubt it makes much difference for GopherJS use cases, but worth noting still. Ultimately, JavaScript kind of sucks for big number crunching that cryptography needs, so it's much slower than native code with no easy way to fix it.
Merge pull request #1198 from gopherjs/bumpVersion Update references to latest patch version of Go 1.18 in preparation for next beta release
Prepare a new 1.18.0-beta2+go1.18.5 release. I tried to bump the tested Go version to 1.18.9, but it isn't available in Chocolatey and causes Windows CI to fail. I ran the tests locally though and there doesn't seem to be any incompatibility.
Prepare a new 1.18.0-beta2+go1.18.5 release. I tried to bump the tested Go version to 1.18.9, but it isn't available in Chocolatey and causes Windows CI to fail. I ran the tests locally though and there doesn't seem to be any incompatibility.
PreviousNext