def open_checked

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

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
import bend-collections@1.0.0.0/src/crypto/subtle.bend as Subtle

164# The plaintext when t is the tag of c; None otherwise (compared in constant time).
165def open_checked(+sched: A.Schedule, +n0: T.Quad, +n1: T.Quad, +n2: T.Quad, +aad: List<&2, U32>, +c: List<&2, U32>, t: List<&2, U32>) -> Maybe<&2, List<&2, U32>>:
166  accept(Subtle.eq(t, tag(sched, n0, n1, n2, aad, c)), gctr(sched, c, n0, n1, n2, 2))

Uses (9)

Used by (1)