def ghash_auth_with_hash_impl
qasim-bend-kit@0.1.0.2 · libs/AES256GCMCore.bend:433
import qasim-bend-kit@0.1.0.2/libs/AES256GCMCore.bend as AES256GCMCore
import Base
433def ghash_auth_with_hash_impl(+h: List<&2, U32>, +aad: List<&2, U32>, +ciphertext: List<&2, U32>) -> List<&2, U32>:
434 y0: List<&2, U32> = [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]
435 y1 = ghash_bytes(aad, h, y0)
436 y2 = ghash_bytes(ciphertext, h, y1)
437 aad_bits = ghash_nat_bytes((List.length(&2, U32, aad) * 8n : Nat))
438 ct_bits = ghash_nat_bytes((List.length(&2, U32, ciphertext) * 8n : Nat))
439 ghash_update(y2, h, List.append(&2, U32, aad_bits, ct_bits))