2020-06-09 00:44:51 +03:00
|
|
|
/- post
|
|
|
|
^?
|
|
|
|
=< [post .]
|
|
|
|
=, post
|
|
|
|
|%
|
2020-06-18 22:59:50 +03:00
|
|
|
++ sign
|
|
|
|
|= [our=ship now=time =hash]
|
|
|
|
^- signature
|
|
|
|
=/ =life .^(life %j /=life/(scot %da now)/(scot %p our))
|
|
|
|
=/ =ring .^(ring %j /=vein/(scot %da now)/(scot %ud life))
|
|
|
|
:+ `@ux`(sign:as:(nol:nu:crub:crypto ring) hash)
|
|
|
|
our
|
|
|
|
life
|
2020-06-09 00:44:51 +03:00
|
|
|
::
|
|
|
|
++ is-signature-valid
|
|
|
|
|= [=signature =hash now=time]
|
|
|
|
^- ?
|
2020-06-09 21:48:05 +03:00
|
|
|
=/ deed=(unit [a=life b=pass c=(unit @ux)])
|
|
|
|
.^ (unit [life pass (unit @ux)])
|
2020-06-09 00:44:51 +03:00
|
|
|
%j
|
|
|
|
/=deed/(scot %da now)/(scot %p q.signature)/(scot %ud p.signature)
|
|
|
|
==
|
2020-06-09 21:48:05 +03:00
|
|
|
:: we do not have a public key from ship
|
|
|
|
::
|
|
|
|
?~ deed %.y
|
|
|
|
:: we do not have a public key from ship at this life
|
|
|
|
::
|
|
|
|
?. =(a.u.deed r.signature) %.y
|
|
|
|
:: verify signature from ship at life
|
|
|
|
::
|
2020-07-31 00:43:40 +03:00
|
|
|
=(`hash (tear:as:crub:crypto b.u.deed p.signature))
|
2020-06-09 00:44:51 +03:00
|
|
|
::
|
|
|
|
++ are-signatures-valid
|
|
|
|
|= [=signatures =hash now=time]
|
|
|
|
^- ?
|
|
|
|
=/ signature-list ~(tap in signatures)
|
|
|
|
|-
|
|
|
|
?~ signature-list
|
|
|
|
%.y
|
|
|
|
?: (is-signature-valid i.signature-list hash now)
|
|
|
|
$(signature-list t.signature-list)
|
|
|
|
%.n
|
|
|
|
--
|