summaryrefslogtreecommitdiff
path: root/src/plop.hrl
diff options
context:
space:
mode:
authorMagnus Ahltorp <map@kth.se>2014-10-21 17:17:36 +0200
committerMagnus Ahltorp <map@kth.se>2014-10-21 17:17:36 +0200
commit55542cce03a088e41e11b8ca5524a534ca4dcd61 (patch)
tree4321af9e894a7284695b1ab26c6a78ae61e5220e /src/plop.hrl
parent3995b3448ad06954f119851734de6de750977268 (diff)
Break include dependency on plop.hrlexternal-merge
Diffstat (limited to 'src/plop.hrl')
-rw-r--r--src/plop.hrl27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/plop.hrl b/src/plop.hrl
new file mode 100644
index 0000000..2e0d436
--- /dev/null
+++ b/src/plop.hrl
@@ -0,0 +1,27 @@
+%%% Copyright (c) 2014, NORDUnet A/S.
+%%% See LICENSE for licensing information.
+
+%%% Plop data structures. Heavily based on RFC 6962. Some are for
+%%% database storage, some for interfacing with consumers and some are
+%%% for serialisation.
+
+%% Signed tree head
+%% {Treesize, Timestamp, Roothash, Signature}
+-type sth() :: tuple(integer(), integer(), binary(), signature()).
+
+%% RFC 5246 7.4.1.4.1
+-type hash_alg_type() :: none | md5 | sha1 | sha224 | sha256 | sha384 |
+ sha512. % uint8
+-type signature_alg_type() :: anonymous | rsa | dsa | ecdsa. % uint8
+-record(sig_and_hash_alg, {
+ hash_alg :: hash_alg_type(),
+ signature_alg :: signature_alg_type()
+ }).
+-type sig_and_hash_alg() :: #sig_and_hash_alg{}.
+
+%% RFC 5246 4.7
+-record(signature, {
+ algorithm :: sig_and_hash_alg(),
+ signature :: binary()
+ }).
+-type signature() :: #signature{}.