def expanded_block_from_initial

qasim-bend-kit@0.1.0.2 · proof/AES_BlockBridgeProof.bend:17

import qasim-bend-kit@0.1.0.2/proof/AES_BlockBridgeProof.bend as AESBlockBridgeProof
import Base
import qasim-bend-kit@0.1.0.2/libs/AES256GCMCore.bend as Core

17# Establish the public-function conversion while inputs remain symbolic.
18# A concrete caller then compares identical public applications instead of
19# unfolding all fourteen rounds to recognize the internal implementation.
20def expanded_block_from_initial(+words: List<&2, U32>, +block: List<&2, U32>,
21    +initial: List<&2, U32>, +expected: List<&2, U32>,
22    initial_match: {Core.aes_add_key(block, words, 0n) == initial : List<&2, U32>},
23    rounds_match: {Core.aes_rounds.go(13n, initial, words, 1n) == expected : List<&2, U32>}) ->
24    {Core.aes256_encrypt_expanded(words, block) == expected : List<&2, U32>}:
25    match words:
26        case Nil{}:
27            rounds_input_matches(13n, words, block, initial, expected,
28                initial_match, rounds_match)
29        case head <> tail:
30            rounds_input_matches(13n, words, block, initial, expected,
31                initial_match, rounds_match)

Uses (6)

Used by (6)