diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/db.erl | 3 | ||||
-rw-r--r-- | src/db.hrl | 3 | ||||
-rw-r--r-- | src/hex.erl | 3 | ||||
-rw-r--r-- | src/ht.erl | 24 | ||||
-rw-r--r-- | src/plop.erl | 3 | ||||
-rw-r--r-- | src/plop_app.erl | 3 | ||||
-rw-r--r-- | src/plop_sup.erl | 3 |
7 files changed, 42 insertions, 0 deletions
@@ -1,3 +1,6 @@ +%%% Copyright (c) 2014, NORDUnet A/S. +%%% See LICENSE for licensing information. + -module(db). -behaviour(gen_server). @@ -1,3 +1,6 @@ +%%% Copyright (c) 2014, NORDUnet A/S. +%%% See LICENSE for licensing information. + %% @doc What's stored in the database. %% 'index' is the primary key, 'hash' is also indexed. -record(plop, { diff --git a/src/hex.erl b/src/hex.erl index dcb9349..e3c8441 100644 --- a/src/hex.erl +++ b/src/hex.erl @@ -1,3 +1,6 @@ +%%% Copyright (c) 2014, NORDUnet A/S. +%%% See LICENSE for licensing information. + -module(hex). -export([bin_to_hexstr/1,hexstr_to_bin/1]). @@ -1,3 +1,27 @@ +%%% Copyright (c) 2014, NORDUnet A/S. +%%% See LICENSE for licensing information. +%%% +%%% Implementation of a history tree similar to what is described in +%%% Efficient Data Structures for Tamper-Evident Logging [0]. This +%%% implementation follows RFC 6962 and differs from [0] only in how +%%% non-full trees are handled. +%%% +%%% Useful terminology: +%%% C -- Commitment. +%%% X -- Event, stored in leaf nodes. +%%% I(i,r) -- Interior node with index i, on layer r. +%%% A(v)(i,r) -- Hash of I(i,r) in tree of version v. +%%% d -- Depth of tree. +%%% +%%% Nodes are identified by their index i and layer r. +%%% I(i,r) has left child I(i,r-1) and right child I(i+2^(r-1),r-1). +%%% +%%% A version-n tree stores n+1 events. +%%% In a version-n tree, I(i,r) is frozen when n >= i + 2^r - 1. +%%% +%%% [0] https://www.usenix.org/event/sec09/tech/full_papers/crosby.pdf +%%% + -module('ht'). -include_lib("eunit/include/eunit.hrl"). diff --git a/src/plop.erl b/src/plop.erl index 5d29c24..f681898 100644 --- a/src/plop.erl +++ b/src/plop.erl @@ -1,3 +1,6 @@ +%%% Copyright (c) 2014, NORDUnet A/S. +%%% See LICENSE for licensing information. +%%% %%% @doc Server holding log entries in a database and hashes in a %%% Merkle tree. A backend for things like Certificate Transparency %%% (RFC 6962). diff --git a/src/plop_app.erl b/src/plop_app.erl index 0a972cc..f90792d 100644 --- a/src/plop_app.erl +++ b/src/plop_app.erl @@ -1,3 +1,6 @@ +%%% Copyright (c) 2014, NORDUnet A/S. +%%% See LICENSE for licensing information. + -module(plop_app). -behaviour(application). -export([start/2, stop/1]). diff --git a/src/plop_sup.erl b/src/plop_sup.erl index 1c6602c..089a812 100644 --- a/src/plop_sup.erl +++ b/src/plop_sup.erl @@ -1,3 +1,6 @@ +%%% Copyright (c) 2014, NORDUnet A/S. +%%% See LICENSE for licensing information. + -module(plop_sup). -behaviour(supervisor). |