diff options
author | Linus Nordberg <linus@nordu.net> | 2014-05-04 23:58:11 +0200 |
---|---|---|
committer | Linus Nordberg <linus@nordu.net> | 2014-05-04 23:58:11 +0200 |
commit | 9dc05f0ed8c31ade084712c87417328183c6a658 (patch) | |
tree | 1e48af3c72be8abf17ef5aaf1a1210b00cacd182 | |
parent | 525ec22812f3f56c7da6064be034a808eca4d43c (diff) |
Rename spt_on_wire -> spt.
-rw-r--r-- | include/plop.hrl | 4 | ||||
-rw-r--r-- | src/db.hrl | 2 | ||||
-rw-r--r-- | src/plop.erl | 8 |
3 files changed, 7 insertions, 7 deletions
diff --git a/include/plop.hrl b/include/plop.hrl index 8115374..17d81c8 100644 --- a/include/plop.hrl +++ b/include/plop.hrl @@ -16,13 +16,13 @@ }). -type mtl() :: #mtl{}. --record(spt_on_wire, { +-record(spt, { version :: pos_integer(), % uint8 logid :: binary(), % SHA-256 over DER encoded public log key timestamp :: integer(), % uint64 signature :: binary() }). --type spt_on_wire() :: #spt_on_wire{}. +-type spt() :: #spt{}. %% @doc What's signed in an SPT. Used for serialisation before hasning %% and signing. FIXME: Overlapping #spt{} -- merge somehow. @@ -4,5 +4,5 @@ index :: non_neg_integer(), % Primary key. hash :: binary(), % Hash over #plop_entry{} in mtl. mtl :: mtl(), % Merkle Tree Leaf. - spt :: spt_on_wire() % Signed Plop Timestamp. + spt :: spt() % Signed Plop Timestamp. }). diff --git a/src/plop.erl b/src/plop.erl index 1a80dea..05b8a92 100644 --- a/src/plop.erl +++ b/src/plop.erl @@ -154,7 +154,7 @@ do_add(TimestampedEntry = #timestamped_entry{entry = PlopEntry}, %% @doc Signed Plop Timestamp, conformant to an SCT in RFC6962 3.2 and %% RFC5246 4.7. --spec spt(binary(), public_key:rsa_private_key(), timestamped_entry()) -> spt_on_wire(). +-spec spt(binary(), public_key:rsa_private_key(), timestamped_entry()) -> spt(). spt(LogID, PrivKey, #timestamped_entry{ timestamp = Timestamp, entry = #plop_entry{type = EntryType, data = EntryData} @@ -167,7 +167,7 @@ spt(LogID, PrivKey, #timestamped_entry{ entry_type = EntryType, signed_entry = EntryData})), Signature = signhash(BinToSign, PrivKey), - #spt_on_wire{ + #spt{ version = ?PLOPVERSION, logid = LogID, timestamp = Timestamp, @@ -285,7 +285,7 @@ timestamp(Timestamp) -> _ -> Timestamp end. --spec serialise(plop_entry() | timestamped_entry() | spt_on_wire() | spt_signed() | mtl() | sth()) -> iolist(). +-spec serialise(plop_entry() | timestamped_entry() | spt() | spt_signed() | mtl() | sth()) -> iolist(). serialise(#plop_entry{ type = TypeAtom, data = Data @@ -299,7 +299,7 @@ serialise(#timestamped_entry{ }) -> [<<Timestamp:64>>, serialise(PlopEntry)]; -serialise(#spt_on_wire{ +serialise(#spt{ version = Version, logid = LogID, timestamp = Timestamp, |