def sh_okb
bend-collections-laws-crypto@1.0.0.0 · proofs/crypto/curve25519/limbs.bend:104
import bend-collections-laws-crypto@1.0.0.0/proofs/crypto/curve25519/limbs.bend as Limbs
import Base
import bend-collections-laws-crypto@1.0.0.0/spec/lib/common.bend as C
import bend-collections-laws-crypto@1.0.0.0/proofs/lib/logic.bend as L
104def sh_okb(+n: Nat, +xs: List<&2, U32>, +b: Nat, +x: Nat, +e: {okb(n, xs, b) == True{} : Bool}) -> {sh(xs, x) == shn(n, x) : Nat}:
105 match n xs:
106 case 0n Nil{}:
107 {==}
108 case 0n Con{y, yt}:
109 Empty.absurd({sh(Con{y, yt}, x) == x : Nat}, L.false_true(e))
110 case 1n+m Nil{}:
111 Empty.absurd({x == shn(1n+m, x) : Nat}, L.false_true(e))
112 case 1n+ +m Con{+y, +yt}:
113 Equal.cong(Nat, Nat, z => C.shift(8n, z), sh(yt, x), shn(m, x), sh_okb(m, yt, b, x, okb_tail(m, y, yt, b, e)))