def tag

bend-collections@1.0.0.0 · src/crypto/aes/gcm.bend:146

import bend-collections@1.0.0.0/src/crypto/aes/gcm.bend as Gcm
import Base
import bend-collections@1.0.0.0/src/crypto/aes/types.bend as T
import bend-collections@1.0.0.0/src/crypto/aes/aes.bend as A

146# The tag of ciphertext c: GHASH over A || 0^v || C || 0^u || lengths,
147# encrypted with the counter block J0 = nonce || 1.
148def tag(+sched: A.Schedule, +n0: T.Quad, +n1: T.Quad, +n2: T.Quad, +aad: List<&2, U32>, +c: List<&2, U32>) -> List<&2, U32>:
149  +h = hash_key(sched)
150  gctr(sched, unpack(ghash(h, lengths(aad, c), ghash(h, c, ghash(h, aad, zero())))), n0, n1, n2, 1)

Uses (10)

Used by (2)