Pdec.dl: def of bend-collections-laws-crypto@1.0.0.0 Import: import bend-collections-laws-crypto@1.0.0.0/proofs/crypto/secp256k1/pdec.bend as Pdec Lines 117-129 of bend-collections-laws-crypto@1.0.0.0/proofs/crypto/secp256k1/pdec.bend: https://jend.leeeet.dev/read.txt?path=bend-collections-laws-crypto@1.0.0.0/proofs/crypto/secp256k1/pdec.bend&start_line=117&end_line=129 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/spec/crypto/secp256k1/curve.bend as CV import bend-collections-laws-crypto@1.0.0.0/src/crypto/secp256k1/bytes.bend as B import bend-collections-laws-crypto@1.0.0.0/src/crypto/secp256k1/point.bend as P import bend-collections-laws-crypto@1.0.0.0/proofs/crypto/secp256k1/penc.bend as PE import bend-collections-laws-crypto@1.0.0.0/proofs/crypto/secp256k1/blist.bend as BL def dl(+one: Nat, +h1: {one == 1n : Nat}, +bs: List<&2, U32>, c33: Bool, c65: Bool, +h33: {B.has_len(33n, bs) == c33 : Bool}, +h65: {B.has_len(65n, bs) == c65 : Bool}) -> {PE.mpv(one, P.decode_len(bs, c33, c65)) == CV.decode_len(FS.prime(one), bs, c33, c65) : Maybe<&2, CV.SPoint>}: match c33 c65: case True{} _: %Equal.sym(U32, B.head(bs), CV.head(bs), BL.head_eq(bs)) : {PE.mpv(one, P.decode_33(_, B.tail(bs))) == CV.decode_c(FS.prime(one), CV.head(bs), CV.os2ip(CV.after(1n, bs))) : Maybe<&2, CV.SPoint>} %Equal.sym(List<&2, U32>, B.tail(bs), CV.after(1n, bs), BL.tail_after(bs)) : {PE.mpv(one, P.decode_33(CV.head(bs), _)) == CV.decode_c(FS.prime(one), CV.head(bs), CV.os2ip(CV.after(1n, bs))) : Maybe<&2, CV.SPoint>} d33(one, h1, CV.head(bs), CV.after(1n, bs), BL.len_tail(32n, bs, h33)) case False{} True{}: %Equal.sym(U32, B.head(bs), CV.head(bs), BL.head_eq(bs)) : {PE.mpv(one, P.decode_65(_, B.tail(bs))) == CV.decode_u(FS.prime(one), CV.head(bs), CV.os2ip(CV.first(32n, CV.after(1n, bs))), CV.os2ip(CV.after(33n, bs))) : Maybe<&2, CV.SPoint>} %Equal.sym(List<&2, U32>, B.tail(bs), CV.after(1n, bs), BL.tail_after(bs)) : {PE.mpv(one, P.decode_65(CV.head(bs), _)) == CV.decode_u(FS.prime(one), CV.head(bs), CV.os2ip(CV.first(32n, CV.after(1n, bs))), CV.os2ip(CV.after(33n, bs))) : Maybe<&2, CV.SPoint>} %Equal.sym(List<&2, U32>, CV.after(33n, bs), CV.after(32n, CV.after(1n, bs)), BL.after33(bs)) : {PE.mpv(one, P.decode_65(CV.head(bs), CV.after(1n, bs))) == CV.decode_u(FS.prime(one), CV.head(bs), CV.os2ip(CV.first(32n, CV.after(1n, bs))), CV.os2ip(_)) : Maybe<&2, CV.SPoint>} d65(one, h1, CV.head(bs), CV.after(1n, bs), BL.len_tail(64n, bs, h65)) case False{} False{}: {==} Uses (28): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Equal.sym https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Maybe https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32 https://jend.leeeet.dev/definition.txt?path=bend-collections-laws-crypto@1.0.0.0/proofs/crypto/secp256k1/blist.bend&name=after33 https://jend.leeeet.dev/definition.txt?path=bend-collections-laws-crypto@1.0.0.0/proofs/crypto/secp256k1/blist.bend&name=head_eq https://jend.leeeet.dev/definition.txt?path=bend-collections-laws-crypto@1.0.0.0/proofs/crypto/secp256k1/blist.bend&name=len_tail https://jend.leeeet.dev/definition.txt?path=bend-collections-laws-crypto@1.0.0.0/proofs/crypto/secp256k1/blist.bend&name=tail_after https://jend.leeeet.dev/definition.txt?path=bend-collections-laws-crypto@1.0.0.0/proofs/crypto/secp256k1/pdec.bend&name=d33 https://jend.leeeet.dev/definition.txt?path=bend-collections-laws-crypto@1.0.0.0/proofs/crypto/secp256k1/pdec.bend&name=d65 https://jend.leeeet.dev/definition.txt?path=bend-collections-laws-crypto@1.0.0.0/proofs/crypto/secp256k1/penc.bend&name=mpv https://jend.leeeet.dev/definition.txt?path=bend-collections-laws-crypto@1.0.0.0/spec/crypto/secp256k1/curve.bend&name=SPoint https://jend.leeeet.dev/definition.txt?path=bend-collections-laws-crypto@1.0.0.0/spec/crypto/secp256k1/curve.bend&name=after https://jend.leeeet.dev/definition.txt?path=bend-collections-laws-crypto@1.0.0.0/spec/crypto/secp256k1/curve.bend&name=decode_c https://jend.leeeet.dev/definition.txt?path=bend-collections-laws-crypto@1.0.0.0/spec/crypto/secp256k1/curve.bend&name=decode_len https://jend.leeeet.dev/definition.txt?path=bend-collections-laws-crypto@1.0.0.0/spec/crypto/secp256k1/curve.bend&name=decode_u https://jend.leeeet.dev/definition.txt?path=bend-collections-laws-crypto@1.0.0.0/spec/crypto/secp256k1/curve.bend&name=first https://jend.leeeet.dev/definition.txt?path=bend-collections-laws-crypto@1.0.0.0/spec/crypto/secp256k1/curve.bend&name=head https://jend.leeeet.dev/definition.txt?path=bend-collections-laws-crypto@1.0.0.0/spec/crypto/secp256k1/curve.bend&name=os2ip https://jend.leeeet.dev/definition.txt?path=bend-collections-laws-crypto@1.0.0.0/spec/crypto/secp256k1/field.bend&name=prime https://jend.leeeet.dev/definition.txt?path=bend-collections-laws-crypto@1.0.0.0/src/crypto/secp256k1/bytes.bend&name=has_len https://jend.leeeet.dev/definition.txt?path=bend-collections-laws-crypto@1.0.0.0/src/crypto/secp256k1/bytes.bend&name=head https://jend.leeeet.dev/definition.txt?path=bend-collections-laws-crypto@1.0.0.0/src/crypto/secp256k1/bytes.bend&name=tail https://jend.leeeet.dev/definition.txt?path=bend-collections-laws-crypto@1.0.0.0/src/crypto/secp256k1/point.bend&name=decode_33 https://jend.leeeet.dev/definition.txt?path=bend-collections-laws-crypto@1.0.0.0/src/crypto/secp256k1/point.bend&name=decode_65 https://jend.leeeet.dev/definition.txt?path=bend-collections-laws-crypto@1.0.0.0/src/crypto/secp256k1/point.bend&name=decode_len