• 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
      • Riscv
      • Taspi
      • Bitcoin
      • Des
      • Ethereum
      • X86isa
      • Sha-2
      • Yul
      • Zcash
        • Jubjub
        • Verify-zcash-r1cs
        • Lift-zcash-r1cs
        • Pedersen-hash
        • Zcash-gadgets
        • Bit/byte/integer-conversions
          • Leos2ip
            • Lebs2osp
            • Lebs2ip
            • Leos2bsp
            • I2lebsp
            • I2bebsp
          • Constants
          • Blake2-hash
          • Randomness-beacon
        • Proof-checker-itp13
        • Regex
        • ACL2-programming-language
        • Json
        • Jfkr
        • Equational
        • Cryptography
        • Poseidon
        • Where-do-i-place-my-book
        • Axe
        • Aleo
        • Bigmems
        • Builtins
        • Execloader
        • Solidity
        • Paco
        • Concurrent-programs
        • Bls12-377-curves
      • Debugging
      • Std
      • Community
      • Proof-automation
      • ACL2
      • Macro-libraries
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • Math
      • Testing-utilities
    • Bit/byte/integer-conversions

    Leos2ip

    The function \mathsf{LEOS2IP} in [ZPS:5.1].

    Signature
    (leos2ip s) → x
    Arguments
    s — Guard (byte-listp s).
    Returns
    x — Type (natp x).

    The $\ell$ argument can be determined from the S argument: it is the length of S times 8. Thus, in our formalization we just have one argument.

    Definitions and Theorems

    Function: leos2ip

    (defun leos2ip (s)
      (declare (xargs :guard (byte-listp s)))
      (let ((__function__ 'leos2ip))
        (declare (ignorable __function__))
        (acl2::lebytes=>nat s)))

    Theorem: natp-of-leos2ip

    (defthm natp-of-leos2ip
      (b* ((x (leos2ip s))) (natp x))
      :rule-classes :type-prescription)

    Theorem: leos2ip-upper-bound

    (defthm leos2ip-upper-bound
      (b* ((?x (leos2ip s)))
        (< x (expt 2 (* 8 (len s)))))
      :rule-classes :linear)

    Theorem: leos2ip-injectivity

    (defthm leos2ip-injectivity
      (implies (equal (len s1) (len s2))
               (equal (equal (leos2ip s1) (leos2ip s2))
                      (equal (acl2::byte-list-fix s1)
                             (acl2::byte-list-fix s2)))))