def gcm_ctr_stream_exact.go

qasim-bend-kit@0.1.0.2 · libs/AES256GCMCore.bend:502

import qasim-bend-kit@0.1.0.2/libs/AES256GCMCore.bend as AES256GCMCore
import Base

502# Generate each AES counter block once and consume all of its bytes. Fuel is
503# still a byte count, so partial final blocks have exactly the requested length.
504def gcm_ctr_stream_exact.go(fuel: Nat, +words: List<&2, U32>,
505    counter: List<&2, U32>, block: List<&2, U32>) -> List<&2, U32>:
506    match fuel:
507        case 0n: Nil{}
508        case 1n+p:
509            +step = gcm_ctr_step(words, counter, block)
510            gcm_ctr_step_byte(step) <>
511                gcm_ctr_stream_exact.go(p, words, gcm_ctr_step_counter(step),
512                    gcm_ctr_step_rest(step))

Uses (7)

Used by (11)