summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorLinus Nordberg <linus@nordu.net>2014-05-02 18:21:47 +0200
committerLinus Nordberg <linus@nordu.net>2014-05-02 18:21:47 +0200
commitdf6fca69a7d9bb11d7c6116a9cc4062a6e5e040d (patch)
treeddb03b65a863384057696300bc756bd863621f59 /include
parentd1adbd1523f6d584fd9d060e4224ca07251aeb46 (diff)
Sign using ECDSA and fix a couple bugs.
Revive the plop_entry and hash over that instead of the full MTL, for the db hash. We don't want the timestamp in that hash! Use ECDSA instead of RSA for signing stuff. That's what Google does and we want to use their test suites. An annoyance with DSA is that the signature isn't deterministic. Testing just became less easy. Fix db:find() now that the hash is no longer the primary key.
Diffstat (limited to 'include')
-rw-r--r--include/plop.hrl21
1 files changed, 11 insertions, 10 deletions
diff --git a/include/plop.hrl b/include/plop.hrl
index 30a5385..8115374 100644
--- a/include/plop.hrl
+++ b/include/plop.hrl
@@ -35,21 +35,22 @@
}).
-type spt_signed() :: #spt_signed{}.
-%% %% Part of interface to plop:add/1.
-%% -record(plop_entry, {
-%% type :: entry_type(),
-%% data :: binary()
-%% }).
-%% -type plop_entry() :: #plop_entry{}.
-
-%% A data entry.
+%% A plop entry with timestamp. Part of the Merkle Tree Leaf
+%% structure.
-record(timestamped_entry, {
timestamp = now :: now | integer(),
- entry_type :: entry_type(),
- entry :: binary()
+ entry :: plop_entry()
}).
-type timestamped_entry() :: #timestamped_entry{}.
+%% An entry, without the timestamp. This is what we hash over and
+%% store in the the database for finding duplicated submissions.
+-record(plop_entry, {
+ type :: entry_type(),
+ data :: binary()
+ }).
+-type plop_entry() :: #plop_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
%% to plop, if that can be arranged wrt testing.