Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create Test Vectors #177

Open
gdbelvin opened this issue Jun 19, 2017 · 10 comments
Open

Create Test Vectors #177

gdbelvin opened this issue Jun 19, 2017 · 10 comments

Comments

@gdbelvin
Copy link

A set of test vectors for

  • Tree hashing
  • VRF
  • Other crypto functions

Would be helpful for assessing cross-project and cross-language compatibility.
I've begun doing this in google/keytransparency#613

vqhuy added a commit that referenced this issue Jun 19, 2017
@vqhuy
Copy link
Member

vqhuy commented Jun 19, 2017

Thanks @gdbelvin, I've also begun doing this in #178.

Note that there is a difference between your tree hashing and ours: we use treeNonce []byte instead of treeID uint64.

@gdbelvin
Copy link
Author

Would you be interested in putting a maximum length on the treeNonce for compatibility?
Would be awesome to have a common interface.

vqhuy added a commit that referenced this issue Jun 20, 2017
vqhuy added a commit that referenced this issue Jun 20, 2017
vqhuy added a commit that referenced this issue Jun 20, 2017
@vqhuy
Copy link
Member

vqhuy commented Jun 21, 2017

@gdbelvin

Would you be interested in putting a maximum length on the treeNonce for compatibility?

In our implementation, it is a 32-byte array. Do you have any idea how should the interface be for compatibility?

/cc @masomel @arlolra @liamsi

@gdbelvin
Copy link
Author

gdbelvin commented Jun 21, 2017 via email

@gdbelvin
Copy link
Author

After some more thought, I'd love to jump on a call to discuss this.
An 8 byte nonce would give us 32 bits of security before two tree nonces accidentally collided with each other. 2^32 trees would indeed be a lot of CONIKS and Key Transparency servers 👍. Is there a reason for more than 32 bits of security in the tree nonce?

@liamsi
Copy link
Member

liamsi commented Jun 27, 2017

As far as I remember this was discussed quite a while ago and we've decided to reuse HashSizeByte for simplicity (not introducing another constant) and some extra-bits of security. Another related reason was that we've decided to always hash the output of the system's randomness (and we use a 32-byte hash for that). But I agree that a 64-bit tree-nonce should be sufficient.

@vqhuy
Copy link
Member

vqhuy commented Jun 27, 2017

I think I don't want to let users (the developer/operator) supply the tree ID. As stated somewhere, maintaining the uniqueness of the counter (in this case the map/tree ID) is nontrivial.
As discussed at google/keytransparency#65 (comment), I'd love to know the reason why KT still use the tree nonce.

@gdbelvin
Copy link
Author

Trillian (the distributed merkle tree database) generates the treeID behind the scenes - the developers don't get to pick it.

As for maintaining uniqueness of the nonce, 64 bits is enough to ensure uniqueness for up to 2^32 servers.

@liamsi
Copy link
Member

liamsi commented Jun 27, 2017

@vqhuy
Copy link
Member

vqhuy commented Jun 28, 2017

Thanks for the explanation! Let's see what others say.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants