summaryrefslogtreecommitdiff
path: root/include/plop.hrl
diff options
context:
space:
mode:
authorLinus Nordberg <linus@nordu.net>2014-05-01 18:02:31 +0200
committerLinus Nordberg <linus@nordu.net>2014-05-01 18:02:31 +0200
commit339656a35441a5d7d02282e6a5c6cdfeaf0571d6 (patch)
tree823cbe7f492c4c3f9bb8ffdc359ddefc1ffcb6e2 /include/plop.hrl
parent835638e11919d2012ab74bf5e3185732e604d0ff (diff)
Move some records out of public header file. Improve db initialisation some.
Wait for mnesia tables in init() and make the init-functions do some more.
Diffstat (limited to 'include/plop.hrl')
-rw-r--r--include/plop.hrl34
1 files changed, 10 insertions, 24 deletions
diff --git a/include/plop.hrl b/include/plop.hrl
index 5492024..30a5385 100644
--- a/include/plop.hrl
+++ b/include/plop.hrl
@@ -6,14 +6,9 @@
-type entry_type() :: x509 | precert | test. % uint16
-type leaf_type() :: timestamped_entry | test. % uint8
-%% @doc What's stored in the database.
--record(plop, {
- index :: non_neg_integer(), % Primary key.
- hash :: binary(), % SHA-256 over #FIXME.entry. Indexed in db.
- spt :: binary() % serialise(#spt_on_wire{})
- }).
-
-%% @doc Merkle Tree Leaf -- input to hash function for leaf hashes.
+%% @doc Merkle Tree Leaf -- what's sent as 'leaf_input' in response to
+%% get-entries requests and also the input to the hash function for
+%% leaf hashes in the tree. RFC 6962 sect 3.4.
-record(mtl, {
version = 1 :: pos_integer(),
leaf_type = timestamped_entry :: leaf_type(),
@@ -21,14 +16,6 @@
}).
-type mtl() :: #mtl{}.
-%% @doc Parts of what goes in an SPT. Used for FIXME.
-%% -record(spt, {
-%% version = 1 :: pos_integer(),
-%% signature_type :: signature_type(),
-%% entry :: timestamped_entry()
-%% }).
-%%-type spt() :: #spt{}.
-
-record(spt_on_wire, {
version :: pos_integer(), % uint8
logid :: binary(), % SHA-256 over DER encoded public log key
@@ -48,14 +35,6 @@
}).
-type spt_signed() :: #spt_signed{}.
-%% Internal representation of a data entry.
--record(timestamped_entry, {
- timestamp = now :: now | integer(),
- entry_type :: entry_type(),
- entry :: binary()
- }).
--type timestamped_entry() :: #timestamped_entry{}.
-
%% %% Part of interface to plop:add/1.
%% -record(plop_entry, {
%% type :: entry_type(),
@@ -63,6 +42,13 @@
%% }).
%% -type plop_entry() :: #plop_entry{}.
+%% A data entry.
+-record(timestamped_entry, {
+ timestamp = now :: now | integer(),
+ entry_type :: entry_type(),
+ entry :: binary()
+ }).
+-type timestamped_entry() :: #timestamped_entry{}.
%% @doc The parts of an STH which is to be signed. Used as the
%% interface to plop:sth/1, for testing. Should probably be internal