5 ms·
Constantine: modular, high-performance, zero-dependency cryptography stack
- taspeotis 2y agoTW: blockchain > Releasing Constantine v0.1.0 - A modular cryptography stack for blockchain and proof systems I guess OP had to “edit” the title for conciseness…
- deleted 2y ago[deleted]
- tempodox 2y agoFerengi Rule of Acquisition #239: Never be afraid to mislabel a product. Cryptography and cryptocurrency aren't the same, and I know of no other use for blockchain. Maybe they were hoping to win over non-believers by deceiving them about the content of the article.
- narodnik 2y agolet me guess, you don't actually write code. just talk down people who actually do this is a crypto lib and the authors repo obv has a ton of hardwork https://github.com/mratsim/constantine https://github.com/mratsim/constantine
- IanCal 2y ago> Cryptography and cryptocurrency aren't the same, They aren't, but this is a cryptography library.
- debatem1 2y agoAt a glance it seems fair to say that this is both a cryptocurrency library and a cryptography library. The only truly general purpose thing here is SHA256. Every protocol on its supported list starts with either "ethereum" or "evm", and to the best of my knowledge the other primitives have seen very little use besides cryptocurrency.
- mratsim 2y agoBLS signatures are general purpose, the only Ethereum specific thing is choosing which elliptic curves are used for public keys and which for signatures as well as a prefix before hashing inputs. Similarly KZG polynomial commitments are generic, the Ethereum specific thing is the trusted setup ceremony which needs to be specialized per protocol. The finite field backends and the elliptic curves supported are all generic as well: https://github.com/mratsim/constantine/blob/master/constantine%2Fnamed%2Fconfig_fields_and_curves.nim#L73-L283 https://github.com/mratsim/constantine/blob/master/constanti...
- mratsim 2y agoThe Internet Engineering Task Force, which in particular standardizes TLS, has acknowledge my contributions for my contributions to the very generic and globally useful hashing-to-curve primitive: https://datatracker.ietf.org/doc/html/draft-irtf-cfrg-hash-to-curve-16#name-acknowledgements https://datatracker.ietf.org/doc/html/draft-irtf-cfrg-hash-t... And BLS signatures are standards as well: https://www.ietf.org/archive/id/draft-irtf-cfrg-bls-signature-05.html https://www.ietf.org/archive/id/draft-irtf-cfrg-bls-signatur...
- inhumantsar 2y agothe vehemently anti-blockchain community is starting to sound more religious about their belief than the cryptobros ever did...
- deleted 2y ago[deleted]
- medo-bear 2y agoI think this is cool, but how sure are the authors that this is side-channel safe? There is a similar (modular, high performance, zero-dependency) library in Common Lisp but it can't give side-channel guarantees due to how some Common Lisp compilers implement integer and arithmetic functions https://github.com/sharplispers/ironclad https://github.com/sharplispers/ironclad
- mratsim 2y agoGreat question, first of all I did extensive research https://github.com/mratsim/constantine/wiki/Constant-time-arithmetics https://github.com/mratsim/constantine/wiki/Constant-time-ar.... Then the library defines its own types SecretBool and SecretWord throughough library that cannot be mixed with regular Nim types and are based on uint32/uint64 so the compiler cannot assume 0/1 and do boolean logic. Assembly is used to avoid compilers getting too smart and reintroducing branches but the no-assembly fallback should still compile without branches. By convention, all variable-time cryptographic functions are suffixed _vartime. There is a plan to add automated constant-time checks as well https://github.com/mratsim/constantine/issues/7 https://github.com/mratsim/constantine/issues/7.
- mratsim 2y agoAuthor here, adding an accompanying post focused on performance: https://ethresear.ch/t/releasing-constantine-v0-1-0-a-modular-cryptography-stack-for-ethereum/19990?u=mratsim https://ethresear.ch/t/releasing-constantine-v0-1-0-a-modula...
- christophilus 2y ago> Constantine has been written to have zero-dependency, besides the Nim compiler. More of this, please. I think this should be the norm.