def pick1

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

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

101def pick1(+x: U32, +y: U32) -> {Li.pick(4294967295, x, y) == y : U32}:
102  match x y:
103    case U32{a} U32{b}:
104      Equal.trans(U32, U32{Word.xor(32n, a, Word.and(32n, wones(32n), Word.xor(32n, a, b)))}, U32{Word.xor(32n, a, Word.xor(32n, a, b))}, U32{b},
105        Equal.cong(Word(32n), U32, w => U32{Word.xor(32n, a, w)}, Word.and(32n, wones(32n), Word.xor(32n, a, b)), Word.xor(32n, a, b), wand1(32n, Word.xor(32n, a, b))),
106        Equal.cong(Word(32n), U32, w => U32{w}, Word.xor(32n, a, Word.xor(32n, a, b)), b, wxor2(32n, a, b)))

Uses (10)

Used by (1)