def expand_input_matches

qasim-bend-kit@0.1.0.2 · proof/AES_TraceBridgeProof.bend:4

import qasim-bend-kit@0.1.0.2/proof/AES_TraceBridgeProof.bend as AESTraceBridgeProof
import Base
import qasim-bend-kit@0.1.0.2/libs/AES256GCMCore.bend as Core

4# Substitute a certified initial word list with a symbolic fuel parameter.
5# The public bridge below compares function aliases before applying the key,
6# avoiding normalization of all 52 rounds merely to compare the aliases.
7def expand_input_matches(+fuel: Nat, +key: List<&2, U32>,
8    +initial_words: List<&2, U32>, +expected: List<&2, U32>,
9    initial_match: {Core.aes_words(key) == initial_words : List<&2, U32>},
10    expanded_match: {Core.aes_expand.go(fuel, 8, 1, initial_words) == expected : List<&2, U32>}) ->
11    {Core.aes_expand.go(fuel, 8, 1, Core.aes_words(key)) == expected : List<&2, U32>}:
12    Equal.trans(List<&2, U32>, Core.aes_expand.go(fuel, 8, 1, Core.aes_words(key)),
13        Core.aes_expand.go(fuel, 8, 1, initial_words), expected,
14        Equal.cong(List<&2, U32>, List<&2, U32>, values => Core.aes_expand.go(fuel, 8, 1, values),
15            Core.aes_words(key), initial_words, initial_match), expanded_match)

Uses (7)

Used by (1)