Bitcoin Forum
June 21, 2024, 11:43:47 PM *
News: Voting for pizza day contest
 
  Home Help Search Login Register More  
  Show Posts
Pages: [1] 2 »
1  Alternate cryptocurrencies / Announcements (Altcoins) / Re: NXT :: descendant of Bitcoin - Updated Information on: January 21, 2014, 06:16:21 PM
@ 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.
2  Alternate cryptocurrencies / Announcements (Altcoins) / Re: NXT :: descendant of Bitcoin - Updated Information on: January 21, 2014, 12:09:46 PM
@ NRS crypto algo bounty contestants:

Please, confirm that I should use the following files:

https://github.com/moadib/nxt_crypto_js/blob/master/crypto.js

I will use only these files without the others from GIT repository.

Please, get latest version, both functions now accept hex-string arguments:
Code:
crypto_sign(message, secretPhrase)
Code:
crypto_verify(signature, message, publicKey)
3  Alternate cryptocurrencies / Announcements (Altcoins) / Re: NXT :: descendant of Bitcoin - Updated Information on: January 21, 2014, 10:48:40 AM

BloodyRookie's:
I updated my javascript project for the bounty:

https://github.com/BloodyRookie/nxtCrypto

I think a test should at least include chrome and firefox because those 2 are probably the most comon browsers.
4  Alternate cryptocurrencies / Announcements (Altcoins) / Re: [ANN] Nxt Bounty for working JavaScript code that signs and verifies signatures on: January 20, 2014, 03:11:00 PM
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.
5  Alternate cryptocurrencies / Announcements (Altcoins) / Re: Nxt :: descendant of Bitcoin - Updated Information on: January 16, 2014, 06:32:42 AM
Bounty announcement

100'000 NXT will be paid for working JavaScript code that signs and verifies signatures using NRS algo.

- The licence must allow to use the code in any application
- Sign/verify speed must be not lower than 100 signatures per second on a 1 GHz CPU (1 core)
- All the code must be in a single non-obfuscated well-formatted .js file
- Input/output values must be strings like "8302504e4e57c6c65335289879c6915a273d3aae7bd086058e403fcd2bc18341"

The bounty is valid till the 20th of January, 2014 12:00:00 UTC. The complete code must be published in this thread.

Here is requirement to post code here, so...

I've changed base math from long10-based(as in Nxt java sources) to more JS-friendly (https://github.com/kosta/confidential-publishing/blob/master/js/curve25519/curve25519.js), have optimized them and now  my implementation enough fast to met "speed requirement", at least at my computer it require less than 10ms for sign/verify.

https://github.com/moadib/nxt_crypto_js

Any feedback would be appreciated.
6  Alternate cryptocurrencies / Announcements (Altcoins) / Re: [ANN] Nxt Bounty for working JavaScript code that signs and verifies signatures on: January 16, 2014, 06:15:09 AM
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).

Here are the latest numbers for hoax's code:
Code:
Javascript needs 3.6ms/getPublicKey
Javascript needs 6.9ms/sign
Javascript needs 7.8ms/verify

Nice job!
Thank you Smiley
7  Alternate cryptocurrencies / Announcements (Altcoins) / Re: [ANN] Nxt Bounty for working JavaScript code that signs and verifies signatures on: January 15, 2014, 06:02:34 PM
Hmmm.....you didn't understand what I was trying to say, so here we go again.
You're right. Thank you. I've fixed it and will look at this closer again Smiley
8  Alternate cryptocurrencies / Announcements (Altcoins) / Re: [ANN] Nxt Bounty for working JavaScript code that signs and verifies signatures on: January 15, 2014, 03:59:44 PM
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
9  Alternate cryptocurrencies / Announcements (Altcoins) / Re: [ANN] Nxt Bounty for working JavaScript code that signs and verifies signatures on: January 15, 2014, 03:36:23 PM
Thanks to Jaguar0625 for tests. I just runned my latest version(on github) on them, all tests are passed Smiley
10  Alternate cryptocurrencies / Announcements (Altcoins) / Re: [ANN] Nxt Bounty for working JavaScript code that signs and verifies signatures on: January 15, 2014, 03:22:19 PM
Javascript needs 5.5ms/getPublicKey
Javascript needs 12ms/sign
Javascript needs 9.5ms/verify

So, who said that 10ms is impossible? Smiley
We talk about 1ghz core? Wink

But in overall, yes, i was too pessimistic Smiley
On my pc(core i5 2.67ghz) i now get 7.5ms(avg) for sign and 5.5ms(avg) for verify in Chrome Smiley
11  Alternate cryptocurrencies / Announcements (Altcoins) / Re: [ANN] Nxt Bounty for working JavaScript code that signs and verifies signatures on: January 15, 2014, 01:39:24 PM
What else do you think is not working?
I was wrong Smiley But also confused by "It's a normal behavior"(c)CfB
12  Alternate cryptocurrencies / Announcements (Altcoins) / Re: [ANN] Nxt Bounty for working JavaScript code that signs and verifies signatures on: January 15, 2014, 09:09:12 AM
My js ported directly from this, not from Nxt sources Smiley

ok, but did you actually test the c++ program?
No, compared only with Nxt sources behavior.

I'm getting quite terrible results from node.js - last time I checked they were 10 times worse than ones from the browser...
I would appreciate if anyone would share his (her?) results from within the browser

CPU - core i5 2.6ghz

Chrome 32beta:
crypto_sign - 64ms, crypto_verify - 32ms

Node.js:
crypto_sign - 88ms, crypto_verify - 44ms

Firefox 26:
crypto_sign - 80ms, crypto_verify - 60ms

Results depends on "how you're measure" them Smiley

Sometimes browser can be meditative and run JS slowly and i get worst results(~ x2 slower). And if i call this functions in 100x cycle then avg time is better(36ms, 29ms on chrome).
13  Alternate cryptocurrencies / Announcements (Altcoins) / Re: [ANN] Nxt Bounty for working JavaScript code that signs and verifies signatures on: January 14, 2014, 12:08:58 PM
My js ported directly from this, not from Nxt sources Smiley

And about "helloworld" false result: CfB said that this is normal behavior :O

As i can seen now, https://github.com/rev22/curve255js have nice performance only for one reason: it have simplified math, which can't work with negative numbers. This is reason, why "verify" used this math doesn't work.

The only thing not working is the is_negative function, right?
Not only, as i can see.
14  Alternate cryptocurrencies / Announcements (Altcoins) / Re: [ANN] Nxt Bounty for working JavaScript code that signs and verifies signatures on: January 14, 2014, 09:56:35 AM
hoax, did you test the original cpp code? I tried but I got funny results Sad
Sources of what?

I have a few ideas about how to optimize the long class, but I need to spend time with a profiler first and see where all the time is being spent. Has anyone tried this already?

Look at my repo. I removed from Long all codepathsthat useless for long10 implementation. Also added multiplySmall, which faster when we multiple int64 by 1,2,4,9,19,38,76.

Maybe we can optimize further but with loss of readability or insignificantly Smiley

As i can seen now, https://github.com/rev22/curve255js have nice performance only for one reason: it have simplified math, which can't work with negative numbers. This is reason, why "verify" used this math doesn't work.

15  Alternate cryptocurrencies / Announcements (Altcoins) / Re: [ANN] Nxt Bounty for working JavaScript code that signs and verifies signatures on: January 13, 2014, 09:18:22 AM
Yep, i also mean approach from https://github.com/kosta/confidential-publishing/blob/master/js/curve25519/curve25519.js Smiley

And your version of verifyalso return false for
Code:
var message = "Hello World!";
var secretPhrase = "secretPhrase";
Smiley

Interesting...
And the original Java code also returns false on verifying Cheesy
Yep, just noticed that. Damn, i spend a lot of time for fixing wrong testcase!

Ok, but your verify also return false for:
Can you give some input and expected output?

Verification:
public key = "7c3ff12215636a7b246dea25d5e446a91fa59a9150c6ed50d8126ee86a648b68"
message = "0000a9d63800a0057c3ff12215636a7b246dea25d5e446a91fa59a9150c6ed50d8126ee86a648b6 87e2fad81dbf18f2da0860100640000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000000000000000000 0000000000000000000"
signature = "4f0626ccd4edebb17e9d06e928b5b4e944aa7ef88a111081919794a3e265c206f9d9b0ce42a8d2e 7f6d902a172159bcd39dcaab8468373258fccea9e5d2ed319"
output = true

(The data from http://localhost:7874/nxt?requestType=getTransaction&transaction=14039483471941095190 and http://localhost:7874/nxt?requestType=getTransactionBytes&transaction=14039483471941095190)

Signing:

Similar, but take values from a transaction signed by ur account. This requires to reveal a secret phrase.

So, let's examine this approach further.
16  Alternate cryptocurrencies / Announcements (Altcoins) / Re: [ANN] Nxt Bounty for working JavaScript code that signs and verifies signatures on: January 13, 2014, 07:53:38 AM
Yep, i also mean approach from https://github.com/kosta/confidential-publishing/blob/master/js/curve25519/curve25519.js Smiley

And your version of verifyalso return false for
Code:
var message = "Hello World!";
var secretPhrase = "secretPhrase";
Smiley
17  Alternate cryptocurrencies / Announcements (Altcoins) / Re: [ANN] Nxt Bounty for working JavaScript code that signs and verifies signatures on: January 12, 2014, 11:15:36 AM
I think the speed could be improved a lot but it will take time.
What are you replacing the int10 and Long with?
Can you test my latest update?


I just posted a working version of the curve stuff here: https://github.com/Jaguar0625/JavaScriptNrs

I'm afraid that using Long class for all math isn't good. I think that better use Long only in mul and sqr functions. Then we can remove all unnecessary optimizations from Long class.

But fastest approach must forgive about Long class and use only JS-friendly math. I have working(and fast, more faster than latest version on github) sign function, but can't solve problems with verify, so continue my work.
18  Alternate cryptocurrencies / Announcements (Altcoins) / Re: [ANN] Nxt Bounty for working JavaScript code that signs and verifies signatures on: January 10, 2014, 04:26:41 PM
@hoax: I tried your code. It works. But somehow firefox has timing problems. Running crypto_sign needs about 630ms which is slow but not horrible. But crypto_verify needs more than 11 seconds ?!
Can you tell me why firefox is having trouble?

To compare with my version (i7 CPU 950 3.07GHz):
Code:
Test
message: This is a secret message that needs to be signed
secret phrase: This is my very secret phrase
public key: 698168d8669c9310d68101dfcc974ed4ef454692da6f028f68114db5fdcc4f6a
Signing...
Signature: 94956bf3de7cfdedb2562a0eff698fed7f3e54bbf4476fbb23a192ddea04040f68efa5d03c3f9ebec4109401b50433f1df267299d8b1ad2c485046c45e6b38da
Verifying...
verify returned: true
Speed test
Javascript needs 174.5ms/sign
Javascript needs 145.5ms/verify
Finished

Edit: Updated speed test result due to bug.

Interesting, don't test on Firefox before. I believe that new version, which not use int10&Long can achieve your speed. I'll write here when update sources.
19  Alternate cryptocurrencies / Announcements (Altcoins) / Re: [ANN] Nxt Bounty for working JavaScript code that signs and verifies signatures on: January 10, 2014, 07:42:12 AM
I don't believe that
Quote
Sign/verify speed must be not lower than 100 signatures per second on a 1 GHz CPU (1 core)
can be achieved.

I have working implementation of nrs: https://github.com/moadib/nxt_crypto_js

On my PC(core i5 2.6ghz) algo took approx 200ms for one signature on Google V8(chrome, nodejs).

I'm also tried compile c++ code to js with emscripten and it give approx 2x faster unreadable file. This is not enough too.

P.S. also i think that other(which not have Google V8) browsers will show worse results
20  Alternate cryptocurrencies / Announcements (Altcoins) / Re: Nxt :: descendant of Bitcoin - Updated Information on: January 09, 2014, 04:29:12 PM
Nobody tried to convert cpp to js?
Generated code approx 2x faster than my implementation, but not readable. And still not enough fast as required.


Quote
Dependencies, included in script:

    Long class from Google Closure Library (Apache license)
    jssha256 by B. Poettering (GNU GPL)

Other conditions are met?
If GPL license not suitable i can easily change it for another. Used only in crypto_sign and crypto_verify functions.
Pages: [1] 2 »
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!