• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
      • Apt
      • Zfc
      • Acre
      • Milawa
      • Smtlink
      • Abnf
      • Vwsim
      • Isar
      • Wp-gen
      • Dimacs-reader
      • Pfcs
      • Legacy-defrstobj
      • Proof-checker-array
      • Soft
      • C
      • Farray
      • Rp-rewriter
      • Instant-runoff-voting
      • Imp-language
      • Sidekick
      • Leftist-trees
      • Java
      • Taspi
      • Bitcoin
      • Riscv
      • Des
      • Ethereum
      • X86isa
      • Sha-2
      • Yul
      • Zcash
      • Proof-checker-itp13
      • Regex
      • ACL2-programming-language
      • Json
      • Jfkr
      • Equational
      • Cryptography
      • Poseidon
        • Poseidon-main-definition
          • Param
          • Hashp
          • Absorb1
          • Sponge
          • Hash
          • All-rounds
          • Sponge-validp
          • Squeeze1
          • Sub-words-partial
          • Squeeze
          • Round
          • Partial-rounds
          • Mode
          • Full-rounds
          • Permute
            • Sub-words
            • Add-round-constants
            • Mix-layer
            • Dot-product
            • Absorb
            • Pow-by-alpha
            • Param->size
            • Sub-words-full
            • Param->capacity-then-rate-p
            • Param->partial-last-p
            • Param-additional-theorems
            • Param->rounds
            • Param->descending-p
            • Init-sponge
          • Poseidon-instantiations
        • Where-do-i-place-my-book
        • Axe
        • Bigmems
        • Builtins
        • Execloader
        • Aleo
        • Solidity
        • Paco
        • Concurrent-programs
        • Bls12-377-curves
      • Debugging
      • Std
      • Proof-automation
      • Macro-libraries
      • ACL2
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • Math
      • Testing-utilities
    • Poseidon-main-definition

    Permute

    Permutation.

    Signature
    (permute stat param) → new-stat
    Arguments
    stat — Guard (fe-listp stat (param->prime param)).
    param — Guard (paramp param).
    Returns
    new-stat — Type (fe-listp new-stat (param->prime param)), given (fe-listp stat (param->prime param)).

    This is a wrapper of all-rounds that provides a more compact interface, consisting of a state vector and the parameters, whose components are passed to all-rounds.

    Definitions and Theorems

    Function: permute

    (defun permute (stat param)
     (declare (xargs :guard (and (paramp param)
                                 (fe-listp stat (param->prime param)))))
     (declare (xargs :guard (equal (len stat) (param->size param))))
     (let ((__function__ 'permute))
       (declare (ignorable __function__))
       (all-rounds stat (param->constants param)
                   (param->alpha param)
                   (param->partial-first-p param)
                   (param->mds param)
                   (param->full-rounds-half param)
                   (param->partial-rounds param)
                   (param->prime param))))

    Theorem: return-type-of-permute

    (defthm return-type-of-permute
      (implies (fe-listp stat (param->prime param))
               (b* ((new-stat (permute stat param)))
                 (fe-listp new-stat (param->prime param))))
      :rule-classes :rewrite)

    Theorem: len-of-permute

    (defthm len-of-permute
      (implies (and (equal (len stat) (param->size param))
                    (paramp param))
               (b* ((?new-stat (permute stat param)))
                 (equal (len new-stat) (len stat)))))