2018-10-12 19:57:33 +03:00
|
|
|
:: Create a private key-file for a random (or specified) moon
|
2015-10-20 21:12:22 +03:00
|
|
|
::
|
2016-02-05 06:05:37 +03:00
|
|
|
:::: /hoon/moon/gen
|
2015-10-20 21:12:22 +03:00
|
|
|
::
|
2016-02-17 04:40:32 +03:00
|
|
|
/? 310
|
2018-10-12 19:57:33 +03:00
|
|
|
/- *sole
|
2018-11-01 07:18:54 +03:00
|
|
|
/+ *generators
|
2015-10-20 21:12:22 +03:00
|
|
|
::
|
|
|
|
::::
|
2016-11-17 04:42:58 +03:00
|
|
|
::
|
2017-06-18 23:23:20 +03:00
|
|
|
:- %ask
|
2018-10-12 19:57:33 +03:00
|
|
|
|= $: [now=@da eny=@uvJ bec=beak]
|
|
|
|
arg=?(~ [mon=@p ~])
|
2018-03-19 07:18:20 +03:00
|
|
|
~
|
2015-10-20 21:12:22 +03:00
|
|
|
==
|
2018-10-12 19:57:33 +03:00
|
|
|
=* our p.bec
|
|
|
|
=/ ran (clan:title our)
|
2016-06-17 05:09:31 +03:00
|
|
|
?: ?=({?($earl $pawn)} ran)
|
2018-10-03 02:36:08 +03:00
|
|
|
%- produce
|
2017-06-18 23:23:20 +03:00
|
|
|
:- %tang :_ ~
|
|
|
|
leaf+"can't create a moon from a {?:(?=($earl ran) "moon" "comet")}"
|
2018-10-12 19:57:33 +03:00
|
|
|
=/ mon=ship
|
|
|
|
?^ arg
|
|
|
|
mon.arg
|
|
|
|
(add our (lsh 5 1 (end 5 1 (shaz eny))))
|
|
|
|
=/ seg=ship (sein:title our now mon)
|
|
|
|
?. =(our seg)
|
2018-11-01 07:18:54 +03:00
|
|
|
%- produce
|
2018-10-12 19:57:33 +03:00
|
|
|
:- %tang :_ ~
|
|
|
|
leaf+"can't create keys for {(scow %p mon)}, which belongs to {(scow %p seg)}"
|
|
|
|
=/ cub=acru:ames (pit:nu:crub:crypto 512 eny)
|
|
|
|
=/ lyf=life .^(@ud j+/(scot %p our)/life/(scot %da now)/(scot %p our))
|
|
|
|
=/ sig=oath:pki:jael
|
|
|
|
.^(@ j+/(scot %p our)/earl/(scot %da now)/(scot %p mon)/(scot %ud lyf)/(scot %ux pub:ex:cub))
|
|
|
|
=/ sed=seed:able:jael
|
|
|
|
[mon lyf sec:ex:cub `sig]
|
2018-11-01 07:18:54 +03:00
|
|
|
%+ print leaf+"moon: {(scow %p mon)}"
|
|
|
|
%- produce [%atom (scot %uw (jam sed))]
|