mirror of
https://github.com/ilyakooo0/urbit.git
synced 2024-12-04 20:54:21 +03:00
commit
53503c7161
@ -4162,21 +4162,26 @@
|
|||||||
==
|
==
|
||||||
::
|
::
|
||||||
++ secp
|
++ secp
|
||||||
|= [w=@ p=@ a=@ b=@ g=pont n=@]
|
~/ %secp
|
||||||
|
|= [w=@ p=@ a=@ b=@ g=pont n=@] :: being passed in from above
|
||||||
=/ p ~(. fo p)
|
=/ p ~(. fo p)
|
||||||
=/ n ~(. fo n)
|
=/ n ~(. fo n)
|
||||||
|
~% %helper ..$ ~
|
||||||
|%
|
|%
|
||||||
++ compress-point
|
++ compress-point
|
||||||
|
~/ %compress-point
|
||||||
|= pont
|
|= pont
|
||||||
^- @
|
^- @
|
||||||
(can 3 ~[w^x 1^(add 0x2 (cut 0 [0 1] y))])
|
(can 3 ~[w^x 1^(add 0x2 (cut 0 [0 1] y))])
|
||||||
::
|
::
|
||||||
++ serialize-point
|
++ serialize-point
|
||||||
|
~/ %serialize-point
|
||||||
|= pont
|
|= pont
|
||||||
^- @
|
^- @
|
||||||
(can 3 ~[w^y w^x 1^0x4])
|
(can 3 ~[w^y w^x 1^0x4])
|
||||||
::
|
::
|
||||||
++ decompress-point
|
++ decompress-point
|
||||||
|
~/ %decompress-point
|
||||||
|= dat=@
|
|= dat=@
|
||||||
^- pont
|
^- pont
|
||||||
=+ x=(end 3 w a)
|
=+ x=(end 3 w a)
|
||||||
@ -4189,11 +4194,13 @@
|
|||||||
!!
|
!!
|
||||||
::
|
::
|
||||||
++ priv-to-pub :: get pub from priv
|
++ priv-to-pub :: get pub from priv
|
||||||
|
~/ %priv-to-pub
|
||||||
|= prv=@
|
|= prv=@
|
||||||
^- pont
|
^- pont
|
||||||
(jc-mul g prv)
|
(jc-mul g prv)
|
||||||
::
|
::
|
||||||
++ make-k :: deterministic nonce
|
++ make-k :: deterministic nonce
|
||||||
|
~/ %make-k
|
||||||
=, mimes:html
|
=, mimes:html
|
||||||
|= [has=@uvI prv=@]
|
|= [has=@uvI prv=@]
|
||||||
^- @
|
^- @
|
||||||
@ -4207,6 +4214,7 @@
|
|||||||
(hmc w^k w^v)
|
(hmc w^k w^v)
|
||||||
::
|
::
|
||||||
++ ecdsa-raw-sign :: generate signature
|
++ ecdsa-raw-sign :: generate signature
|
||||||
|
~/ %ecdsa-raw-sign
|
||||||
|= [has=@uvI prv=@]
|
|= [has=@uvI prv=@]
|
||||||
^- [v=@ r=@ s=@]
|
^- [v=@ r=@ s=@]
|
||||||
=/ z has
|
=/ z has
|
||||||
@ -4220,6 +4228,7 @@
|
|||||||
==
|
==
|
||||||
::
|
::
|
||||||
++ ecdsa-raw-recover :: get pubkey from sig
|
++ ecdsa-raw-recover :: get pubkey from sig
|
||||||
|
~/ %ecdsa-raw-recover
|
||||||
|= [has=@uvI sig=[v=@ r=@ s=@]]
|
|= [has=@uvI sig=[v=@ r=@ s=@]]
|
||||||
^- pont
|
^- pont
|
||||||
?> (lte v.sig 7)
|
?> (lte v.sig 7)
|
||||||
|
Loading…
Reference in New Issue
Block a user