def pick0

bend-collections-laws-crypto@1.0.0.0 · proofs/crypto/poly1305/final.bend:94

import bend-collections-laws-crypto@1.0.0.0/proofs/crypto/poly1305/final.bend as Final
import Base
import bend-collections-laws-crypto@1.0.0.0/src/crypto/poly1305/limbs.bend as Li

94def pick0(+x: U32, +y: U32) -> {Li.pick(0, x, y) == x : U32}:
95  match x y:
96    case U32{a} U32{b}:
97      Equal.trans(U32, U32{Word.xor(32n, a, Word.and(32n, Word.zero(32n), Word.xor(32n, a, b)))}, U32{Word.xor(32n, a, Word.zero(32n))}, U32{a},
98        Equal.cong(Word(32n), U32, w => U32{Word.xor(32n, a, w)}, Word.and(32n, Word.zero(32n), Word.xor(32n, a, b)), Word.zero(32n), wand0(32n, Word.xor(32n, a, b))),
99        Equal.cong(Word(32n), U32, w => U32{w}, Word.xor(32n, a, Word.zero(32n)), a, wxor0(32n, a)))

Uses (10)

Used by (1)