Skip to content

Commit

Permalink
Add definition for 'truncate()'
Browse files Browse the repository at this point in the history
  • Loading branch information
bifurcation committed Nov 19, 2023
1 parent 0102a28 commit 1e8c156
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions draft-ietf-sframe-enc.md
Original file line number Diff line number Diff line change
Expand Up @@ -583,6 +583,10 @@ calls to the CTR encrypt function and HMAC. The resulting MAC value is truncate
to a number of bytes `Nt` fixed by the cipher suite.

~~~~~
def truncate(tag, n):
# Take the first `n` bytes of `tag`
return tag[..n]

def compute_tag(auth_key, nonce, aad, ct):
aad_len = encode_big_endian(len(aad), 8)
ct_len = encode_big_endian(len(ct), 8)
Expand Down

0 comments on commit 1e8c156

Please sign in to comment.