From 1e8c156c61343bdf1f33f08e13d724ffd9f62784 Mon Sep 17 00:00:00 2001 From: Richard Barnes Date: Sun, 19 Nov 2023 09:37:24 -0500 Subject: [PATCH] Add definition for 'truncate()' --- draft-ietf-sframe-enc.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/draft-ietf-sframe-enc.md b/draft-ietf-sframe-enc.md index d504443..9c9839c 100644 --- a/draft-ietf-sframe-enc.md +++ b/draft-ietf-sframe-enc.md @@ -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)