8 Commits

Author SHA1 Message Date
205853656b Fix Clippy warnings in test code.
And use the same Rust nightly version for Clippy and Rustfmt.
2018-08-09 17:22:29 +02:00
5e3ed116f1 Rustfmt 2018-05-15 18:17:36 +02:00
958c8c8353 Formatting. 2017-09-24 13:10:40 +02:00
249234caca Adopting Hashable trait.
* Remove useless T: AsRef<[u8]> constraint in Lemma.

* Introduce a custom `Hashable` trait instead of requiring `AsRef<[u8]>`.

Since not every type can implement `AsRef<[u8]>`,
this commit removes that constraint, and requires instead
that values implement the `Hashable` trait.

A default instance is provided for types that already implements `AsRef<[u8]>`.

* Update documentation.

* Add a Protobuf test with custom struct and Hashable impl.
2016-12-20 10:23:07 +01:00
bce59c9f39 Separate the leafs hash domain from the internal nodes' one (#22)
* Separate the leafs hash domain from the internal nodes' one.

This change prevents an internal node from having the same hash as a leaf,
and thus from potentially ending up with two different trees with the same root hash.

Close #20

* Align with the CT spec, and allows building a tree from an empty dataset.

Fixes #20. Prepares #24.
2016-12-19 16:14:41 +01:00
4503258724 Port to ring. (#15) 2016-11-29 21:38:47 +01:00
e621241f2f Removing MerkleTree::from_vec_unsafe. (#13)
We can leave it up to the developer to implement the unwrap behaviour.
2016-11-24 10:06:10 +01:00
2176200d3d Test the Protobuf serialization. 2016-11-21 23:01:31 +01:00