-
Notifications
You must be signed in to change notification settings - Fork 30
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
Merkle tree #1
Merkle tree #1
Conversation
11eb024
to
f0f7333
Compare
interiorNode | ||
key string | ||
value []byte | ||
index []byte |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The field for the cryptographic commitment commit(key || value)
should still be included since it needs to be returned as part of the auth path.
return nil | ||
} | ||
|
||
func (m *MerkleTree) RecomputeHash() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this wrapper function really needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, it will be removed in the refactoring phase.
01a1ac9
to
ec01cde
Compare
|
||
// Private Index calculation function | ||
// would be replaced with Ismail's VRF implementation | ||
func (m *MerkleTree) computePrivateIndex(key string) []byte { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above, I would put computePrivateIndex
in a separate module for all things crypto.
I decided to remove db module for the sake of simplicity. Thus, tree/STR storage will be implemented outside this library. All look-up operations now are in-memory only. |
return nil | ||
} | ||
|
||
currentNodeKey := computePrivateIndex(currentNodeUL.key) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this expected to be different from currentNodeUL.index
already?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think at this point it is since the check for equality happens in the if statement above. But as you said in your previous note, the check in that if statement should compare indices, not the keys.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this expected to be different from currentNodeUL.index already?
No, it should be the same. I removed this redundant code.
cc @masomel
Ok, I'm going to merge some of this now. |
Let's see if 14956a9 works first though :) |
This is the travis log of the previous check: https://s3.amazonaws.com/archive.travis-ci.org/jobs/139557242/log.txt (before 14956a9) Actually Travis did run all subpackage tests
So I guess you want to run subpackage tests first? |
Oh, no, I just didn't realize the default for go was https://docs.travis-ci.com/user/languages/go#Default-Test-Script My bad. Sorry for the noise. |
Ok, most of this is merged in 57c9831. I'll open up a pull with the rest for review. |
Implement the Merkle prefix tree #2 and STR #3