-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reorganize merkletree pkg for repo consolidation
- Loading branch information
Showing
20 changed files
with
73 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,29 @@ | ||
[](https://travis-ci.org/coniks-sys/libmerkleprefixtree-go) | ||
# CONIKS Go Library | ||
|
||
# libmerkleprefixtree-go | ||
A Merkle prefix tree implementation in Golang | ||
[](https://travis-ci.org/coniks-sys/coniks-go) | ||
|
||
This library currently uses the `SHAKE128` ShakeHash with output size of 32 bytes. | ||
https://coniks.org | ||
|
||
The signature scheme is `Ed25519` signature algorithm. | ||
##Introduction | ||
CONIKS is a key management system that provides transparency and privacy | ||
for end-user public keys. | ||
CONIKS protects end-to-end encrypted communications against malicious or | ||
compromised communication providers and surveillance by storing users' | ||
encryption keys in tamper-evident and publicly auditable | ||
key directories on the server side. | ||
This allows messaging clients to verify the identity of | ||
users automatically, and prevents malicious/compromised servers from | ||
hijacking secure communications without getting caught. | ||
|
||
### Usage | ||
Initiate the history hash chain (the persistent authenticated dictionary) | ||
``` | ||
// generate private key for STR signing | ||
signKey := crypto.GenerateKey() | ||
## Golang Library | ||
The packages in this library implement the various components of the CONIKS system and may be imported individually. | ||
|
||
// init STR history chain with maximum length is len | ||
// using DefaultPolicies as current policy | ||
pad := NewPAD(NewPolicies(epochDeadline), signKey, len) | ||
``` | ||
- ``crypto``: Cryptographic algorithms and operations | ||
- ``merkletree``: Merkle prefix tree and related data structures | ||
- ``utils``: Utility functions | ||
|
||
Update tree in each epoch | ||
``` | ||
// insert new data | ||
pad.Set(key, value) | ||
... | ||
// update STR history chain | ||
// pass nil if the policies doesn't change | ||
pad.Update(nil) | ||
``` | ||
## Disclaimer | ||
Please keep in mind that this CONIKS library is under active development. The repository may contain experimental features that aren't fully tested. We recommend using a [tagged release](https://github.com/coniks-sys/coniks-go/releases). | ||
|
||
Look-up | ||
|
||
`LookUp(key)` and `LookUpInEpoch(key, epoch)` return a `MerkleNode` instance and an `AuthenticationPath` for proofs of inclusion/absence. | ||
A proof of absence also includes an empty leaf node in the returned auth path. | ||
|
||
### TODO | ||
Some methods/functions should be exported in the future when the library is being used in real applications. | ||
##Documentation | ||
Coming soon! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# Merkle Tree | ||
This package contains the CONIKS Merkle prefix tree implementation | ||
|
||
We use the `SHAKE128` ShakeHash with output size of 32 bytes, and the signature scheme is `Ed25519` signature algorithm. See our [crypto package](https://github.com/coniks-sys/coniks-go/tree/master/crypto) for details and the implementation used. | ||
|
||
### Usage | ||
Initiate the history hash chain (the persistent authenticated dictionary) | ||
``` | ||
// generate private key for STR signing | ||
signKey := crypto.GenerateKey() | ||
// init STR history chain with maximum length is len | ||
// using DefaultPolicies as current policy | ||
pad := NewPAD(NewPolicies(epochDeadline), signKey, len) | ||
``` | ||
|
||
Update tree in each epoch | ||
``` | ||
// insert new data | ||
pad.Set(key, value) | ||
... | ||
// update STR history chain | ||
// pass nil if the policies doesn't change | ||
pad.Update(nil) | ||
``` | ||
|
||
Look-up | ||
|
||
`LookUp(key)` and `LookUpInEpoch(key, epoch)` return a `MerkleNode` instance and an `AuthenticationPath` for proofs of inclusion/absence. | ||
A proof of absence also includes an empty leaf node in the returned auth path. | ||
|
||
### TODO | ||
Some methods/functions should be exported in the future when the library is being used in real applications. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.