zuse: style cleanup, use +rep/+end
pub
++ schnorr
~% %schnorr ..schnorr ~
- => |% ++ tagged-hash
+ => |%
+ ++ tagged-hash
|= [tag=@ [l=@ x=@]]
=+ hat=(sha-256:sha (swp 3 tag))
%- sha-256l:sha
=/ rand
%+ tagged-hash 'BIP0340/nonce'
:- 96
- (can 8 ~[[1 m] [1 x.pp] [1 t]])
+ (rep 8 ~[m x.pp t])
=/ kp (mod rand n.domain.c)
=/ rr (mul-point-scalar g.domain.c kp)
=/ k
:_ n.domain.c
%+ tagged-hash 'BIP0340/challenge'
:- 96
- (can 8 ~[[1 m] [1 x.pp] [1 x.rr]])
+ (rep 8 ~[m x.pp x.rr])
=/ sig
%^ cat 8
(mod (add k (mul e d)) n.domain.c)
=/ r (cut 8 [1 1] sig)
?: (gte r p.domain.c)
%.n
- =/ s (cut 8 [0 1] sig)
+ =/ s (end 8 sig)
?: (gte s n.domain.c)
%.n
=/ e
:_ n.domain.c
%+ tagged-hash 'BIP0340/challenge'
:- 96
- (can 8 ~[[1 m] [1 x.pp] [1 r]])
+ (rep 8 ~[m x.pp r])
=/ aa
(mul-point-scalar g.domain.c s)
=/ bb
