w3f / polkadot-spec

The Polkadot Protocol Specification
https://spec.polkadot.network
Creative Commons Attribution Share Alike 4.0 International
180 stars 70 forks source link

Review Kagome crypto #236

Closed drskalman closed 4 years ago

drskalman commented 4 years ago

This include algorithms used in BABE signature, BABE VRF, GRANDPA, Header hash.

lamafab commented 4 years ago
drskalman commented 4 years ago

The only crypto algorithm in the spec to be implemented by the Kagome at the time of delivery are sign and verify as such, the only crypto is happening in:

So I need to check:

drskalman commented 4 years ago

David's list:

drskalman commented 4 years ago

Hashers are headers can be found in :

kagome/core/crypto/hasher.hpp

blake2b has been implemented in house? from scratch?:

kagome/core/crypto/blake2/blake2b.c

It is good to know its origin so we don't need to re-audit it.

drskalman commented 4 years ago

xxhash is imported from original implementation:

kagome/core/crypto/twox/twox.cpp::#include%20<xxhash/xxhash.h>

It uses the original hunter package of xxhash which is the official implementation xxhash.
drskalman commented 4 years ago

ed25519 implementation has not been audited but it's been used in hyperledger. It is good to have an audit at some point. https://docs.hunter.sh/en/latest/packages/pkg/iroha-ed25519.html

drskalman commented 4 years ago

All done, following issues are filed which came up in the course of review process: