Post
Topic
Board Announcements (Altcoins)
Re: [ANN] Nxt Bounty for working JavaScript code that signs and verifies signatures
by
hoax
on 15/01/2014, 15:59:44 UTC
Hmmm...chrome is indeed faster but even on a 3GHz maschine I don't get your results:

Code:
Javascript needs 12.22ms/getPublicKey
Javascript needs 26.24ms/sign
Javascript needs 21.18ms/verify

What am I doing wrong?


Hmmm...chrome is indeed faster but even on a 3GHz maschine I don't get your results:

Code:
Javascript needs 12.22ms/getPublicKey
Javascript needs 26.24ms/sign
Javascript needs 21.18ms/verify

What am I doing wrong?

Just runned in ff26: 22ms(avg)/sign 16ms(avg)/verify.

As i can see it depends on loop count(more loops - better time) and browser wish(sometimes it do everything slower(extensions, synchronization, etc??).

We should test everything in same environment Smiley I would be appreciated if Jaguar0625 measure time for my latest version(which use rev22 math with some optimizations).

@hoax: I don't think your version of is_negative is compatible with the java version, or is it?
Code:
/* checks if x is "negative", requires reduced input */
function is_negative(x)
{
    return x[0] & 0xFF >= 0x80;
}


This check for overflow. Tested on Jaguar0625 tests(generated from Java) and get 100/100 passed, so... You can correct me if i'm wrong.

And you can remove in your sources second argument from
Code:
SHA256_write(m, m.length);
it was my copy-paste typo, sorry Sad