Skip to content

Instantly share code, notes, and snippets.

@wilsonianb
Last active April 16, 2020 21:32
Show Gist options
  • Select an option

  • Save wilsonianb/b164080a6c1b62e0e2be11d41efb8b13 to your computer and use it in GitHub Desktop.

Select an option

Save wilsonianb/b164080a6c1b62e0e2be11d41efb8b13 to your computer and use it in GitHub Desktop.

Revisions

  1. wilsonianb revised this gist Apr 16, 2020. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion stream.asn
    Original file line number Diff line number Diff line change
    @@ -24,6 +24,7 @@ ReceiptV1 ::= SEQUENCE {
    totalReceived UInt64,

    -- HMAC-SHA256 using a 32 byte Secret
    -- The message is the concatenation of the 1 byte type/version and all other fields, in the order listed above
    -- The message is the concatenation of the 1 byte type/version (always 1) and all other fields,
    -- in the order listed above
    hmac UInt256
    }
  2. wilsonianb revised this gist Apr 16, 2020. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion stream.asn
    Original file line number Diff line number Diff line change
    @@ -24,6 +24,6 @@ ReceiptV1 ::= SEQUENCE {
    totalReceived UInt64,

    -- HMAC-SHA256 using a 32 byte Secret
    -- The message is the concatenation of the 1 byte type/version and all other fields, in the order listed above (NOT THE TYPE/VERSION)
    -- The message is the concatenation of the 1 byte type/version and all other fields, in the order listed above
    hmac UInt256
    }
  3. wilsonianb revised this gist Apr 16, 2020. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion stream.asn
    Original file line number Diff line number Diff line change
    @@ -24,6 +24,6 @@ ReceiptV1 ::= SEQUENCE {
    totalReceived UInt64,

    -- HMAC-SHA256 using a 32 byte Secret
    -- The message is the concatenation of all other fields, in the order listed above (NOT THE TYPE/VERSION)
    -- The message is the concatenation of the 1 byte type/version and all other fields, in the order listed above (NOT THE TYPE/VERSION)
    hmac UInt256
    }
  4. wilsonianb created this gist Apr 14, 2020.
    29 changes: 29 additions & 0 deletions stream.asn
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,29 @@
    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 all other fields, in the order listed above (NOT THE TYPE/VERSION)
    hmac UInt256
    }