def x1_r

bend-collections-laws-crypto@1.0.0.0 · proofs/crypto/secp256k1/prec.bend:110

import bend-collections-laws-crypto@1.0.0.0/proofs/crypto/secp256k1/prec.bend as Prec
import Base
import bend-collections-laws-crypto@1.0.0.0/spec/crypto/secp256k1/field.bend as FS
import bend-collections-laws-crypto@1.0.0.0/src/crypto/secp256k1/field.bend as F
import bend-collections-laws-crypto@1.0.0.0/src/crypto/secp256k1/ecdsa.bend as E
import bend-collections-laws-crypto@1.0.0.0/proofs/crypto/secp256k1/fieldops.bend as FO
import bend-collections-laws-crypto@1.0.0.0/proofs/crypto/secp256k1/point.bend as PT

110# x1 = (r - c_n + c_p) mod p = (r + n) mod p
111def x1_r(+one: Nat, +h1: {one == 1n : Nat}, +r: List<&2, Nat>, +hr: {FS.reduced(one, FS.order(one), r) == True{} : Bool}) -> {PT.red(one, E.rn_fe(r)) == True{} : Bool}:
112  FO.add_r(one, h1, F.sub(r, E.cn_fe()), E.cp_fe(), FO.sub_r(one, h1, r, E.cn_fe(), rp_red(one, h1, r, hr), cn_red(one, h1)), cp_red(one, h1))

Uses (15)

Used by (4)