Last active
April 16, 2020 21:32
-
-
Save wilsonianb/b164080a6c1b62e0e2be11d41efb8b13 to your computer and use it in GitHub Desktop.
Proposed STREAM Receipt ASN.1 OER
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
StreamReceipt ::= SEQUENCE { | |
streamId VarUInt, | |
receipt Receipt | |
} | |
RECEIPT ::= CLASS { | |
&typeId UInt8 UNIQUE, | |
&Type | |
} WITH SYNTAX {&typeId &Type} | |
ReceiptSet RECEIPT ::= { | |
{1 ReceiptV1} | |
} | |
Receipt ::= SEQUENCE { | |
type RECEIPT.&typeId ({ReceiptSet}), | |
-- NON-Length-prefixed data | |
data RECEIPT.&Type ({ReceiptSet}{@type}) | |
} | |
ReceiptV1 ::= SEQUENCE { | |
nonce UInt128, | |
streamId UInt8, | |
totalReceived UInt64, | |
-- HMAC-SHA256 using a 32 byte Secret | |
-- The message is the concatenation of the 1 byte type/version (always 1) and all other fields, | |
-- in the order listed above | |
hmac UInt256 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment