Post
Topic
Board Announcements (Altcoins)
Re: NXT :: descendant of Bitcoin - Updated Information
by
gimre
on 09/02/2014, 16:27:08 UTC
Waoh, made the mistake and had a look at:
https://github.com/gimer/curve25519-sign-test/blob/master/src/nxt/crypto/Curve25519.java
My eyes are bleeding as does my computer science heart.

Mathematicians, physicists and cryptographists should NOT write code. Please! Pleeeease!  Cry

You want us to audit but reading this is like reading a best-seller that has been injected grammar errors and typos each in every sentence. So, how to find the errors in content if you can barely tell them apart from the former ones.

I really get the impression that programmed cryptography is not so difficult in the end; except when people having no idea how to write it down write it down.  Angry

Sorry for being emotional.

But you are aware, that this is almost exactly the same file, as used in NRS... :>

You see what I mean?  Angry

Bugs hidden up.

Yeah, this piece is far from beauty, but keep in mind few things:
  • curve itself and calculation of priv key is done the way, that djb did it
  • it was optimized for speed
  • once you know what all the strange APIs (mula_small, mula32, divmod) are doing, it's not that hard to follow, what's going on
  • sign&verify, was done by xmath @ sci.crypt list: https://groups.google.com/forum/#!topic/sci.crypt/J_7OGDf9cJE
  • it's hard to tell, if the bug was present in original C implementation*, or was it introduced, when code was ported to Java

* if some would have the copy of that C implementation, I'd be really thankful, to have look at it.