-
Notifications
You must be signed in to change notification settings - Fork 34
Serialisation format
Toralf Wittner edited this page Jul 24, 2015
·
9 revisions
Proteus uses CBOR (RFC 7049) as its serialisation format. The following sections describe the serialised structure definitions using CDDL syntax.
; Version 1
Envelope = [
version : uint,
mac : bstr,
message : bstr ; Message as embedded CBOR.
]
Message = (1, PlainMessage) / (2, PreKeyMessage)
PlainMessage = (
session-tag : bstr,
counter : uint,
previous-counter : uint,
ratchet-key : bstr,
cipher-text : bstr
)
PreKeyMessage = (
prekey-id : uint,
base-key : bstr, ; public key
identity-key : bstr, ; public key
PlainMessage
)
; Version 1
PreKeyBundle = [
version : uint,
prekey-id : uint,
public-key : bstr,
public-identity-key : bstr
]
; Version 1
PreKey = [
version : uint,
prekey-id : uint,
secret-key : bstr,
public-key : bstr
]
; Version 1
IdentityKey = [
version : uint,
secret-key : bstr,
public-key : bstr
]
; Version 1
Session = [
version : uint,
session-tag : bstr,
local-identity : bstr, ; public key
remote-identity : bstr, ; public key
pending-prekey : ?[ prekey-id: uint, public-key: bstr ],
session-states : [+ SessionState ]
]
SessionState = (
session-tag : bstr,
receive-chains : [+ ReceiveChain ],
send-chain : SendChain
root-key : bstr,
counter : uint,
skipped-message-keys : [* MessageKeys ]
)
ReceiveChain = (
ChainKey,
ratchet-key : bstr
)
SendChain = (
ChainKey,
secret-ratchet_key : bstr,
public-ratchet_key : bstr
)
ChainKey = (
mac-key : bstr,
counter : uint
)
MessageKeys = (
cipher-key : bstr,
mac-key : bstr,
counter : uint
)