Pages:
Author

Topic: [ANN] Nxt Bounty for working JavaScript code that signs and verifies signatures (Read 8425 times)

sr. member
Activity: 462
Merit: 250
Anyone have any tips on getting the accountid from a public key?

static long getId(byte[] publicKey) throws Exception {
         
      byte[] publicKeyHash = MessageDigest.getInstance("SHA-256").digest(publicKey);
      BigInteger bigInteger = new BigInteger(1, new byte[] {publicKeyHash[7], publicKeyHash[6], publicKeyHash[5], publicKeyHash[4], publicKeyHash[3], publicKeyHash[2], publicKeyHash[1], publicKeyHash[0]});
      return bigInteger.longValue();
      
}

I found this snippet in the source code but trying to replicate in JS gives me no results.
Any help?
legendary
Activity: 866
Merit: 1002
I think Jaguars version is fast in chrome. When testing with firefox, my version ist very fast.

Hello.

If this is the case maybe then each one of you should write in the code or
in the release notes on which platform the code has best performance.

For example a developer could implement all your scripts in his code
and load dynamically a script depending on the user platform to
achieve best performances.


I think web wallet on http://nxtra.org/nxt-client/ will include JS implementation.  (BloodyRookie's I guess)
hero member
Activity: 1110
Merit: 534
I think Jaguars version is fast in chrome. When testing with firefox, my version ist very fast.

Hello.

If this is the case maybe then each one of you should write in the code or
in the release notes on which platform the code has best performance.

For example a developer could implement all your scripts in his code
and load dynamically a script depending on the user platform to
achieve best performances.

hero member
Activity: 687
Merit: 500
I think Jaguars version is fast in chrome. When testing with firefox, my version ist very fast.
legendary
Activity: 866
Merit: 1002
I guess these are proper acct numbers:

Jaguar: 14544444716689899421
hoax: 5637350814069846194
BloodyRookie: 11095639652683007953
me: 6669070404060812420


Jaguar, could you run one last batch of tests to confirm that your one is the fastest one?
I should have some time during weekend, I think we all could take one more look at it, and try push it to the limits Smiley
sr. member
Activity: 299
Merit: 250
I agreed to the split in the main thread. Good job to all!

@ NRS crypto algo bounty contestants:
Guys, u were talking about splitting the bounty to 4 parts. Did u come to a decision? If u r agree to split the bounty then I won't spend time on speedtests.

Well I wouldn't mind. We all spend a lot of time coding. I guess hoax and gimre don't mind too, but I haven't heard Jaguar's opinion yet.
I agree, 25% to everyone will be a fair.

I agree that a 25% split of the bounty is fair. We all spent a good amount of time on this.

Of course, I also wouldn't be opposed to one of the founders tipping the fastest implementation Wink.

You can send my next to the address in my signature.
Thanks!
hero member
Activity: 687
Merit: 500
I am willing to split among those who invested a lot of time as long as the other guys are willing to do the same Wink.
I think it is fair.

What about you, Jaguar?

As for me, I don't think I deserve equal share, and if you don't mind splitting with me, I suggest 10/30/30/30

That's ok for me too Wink
legendary
Activity: 866
Merit: 1002
I am willing to split among those who invested a lot of time as long as the other guys are willing to do the same Wink.
I think it is fair.

What about you, Jaguar?

As for me, I don't think I deserve equal share, and if you don't mind splitting with me, I suggest 10/30/30/30
hero member
Activity: 687
Merit: 500
I am willing to split among those who invested a lot of time as long as the other guys are willing to do the same Wink.
I think it is fair.

What about you, Jaguar?
newbie
Activity: 36
Merit: 0
I am willing to split among those who invested a lot of time as long as the other guys are willing to do the same Wink.
I think it is fair.
legendary
Activity: 866
Merit: 1002
who invested a lot of time

...heh, much more than I expected + wanted Wink but it was fun
hero member
Activity: 687
Merit: 500
I am willing to split among those who invested a lot of time as long as the other guys are willing to do the same Wink.
legendary
Activity: 866
Merit: 1002
Can I get some consolation prize?  Roll Eyes
hero member
Activity: 687
Merit: 500
So now we have 3 implementations that are essentially equal.
If one of these implementations win, wouldn't it be fair to split?
sr. member
Activity: 299
Merit: 250
Finally finished my implementation: https://github.com/Jaguar0625/JavaScriptNrs.

Here are the numbers from my machine:
Code:
Public Key  3.027ms
Sign          6.169ms
Verify        4.371ms

The code I am using to run the timing tests is also in the repo under the browser_test subdirectory in case anyone wants to verify the numbers Smiley.
sr. member
Activity: 299
Merit: 250
Could I kindly ask you to run test also on my code?

Are the inputs and outputs of all of your functions byte arrays?

almost, was it specified anywhere how input output should look like?

take a look at github, there's description of input output there.

Sorry, had a busy weekend. I just ran your code tonight:
Code:
Public Key  6.904ms
Sign          14.396ms
Verify        11.795ms
legendary
Activity: 2142
Merit: 1010
Newbie
almost, was it specified anywhere how input output should look like?

Quote
- Input/output values must be strings like "8302504e4e57c6c65335289879c6915a273d3aae7bd086058e403fcd2bc18341"
legendary
Activity: 866
Merit: 1002
Could I kindly ask you to run test also on my code?

Are the inputs and outputs of all of your functions byte arrays?

almost, was it specified anywhere how input output should look like?

take a look at github, there's description of input output there.
sr. member
Activity: 299
Merit: 250
I was finally able to get rid of all the Long math and replace it from fast math functions from curve255.js and got much better results Smiley:
Code:
Javascript needs 6.9ms/getPublicKey
Javascript needs 13.4ms/sign
Javascript needs 10.7ms/verify

Still not as good as hoax's, but a lot better than my earlier numbers.
sr. member
Activity: 299
Merit: 250
Could I kindly ask you to run test also on my code?

Are the inputs and outputs of all of your functions byte arrays?
Pages:
Jump to: