mirror of
https://github.com/urbit/shrub.git
synced 2024-12-01 14:42:02 +03:00
Update keygen in accordance with latest spec
For details on these changes, see urbit/fora-posts#9.
This commit is contained in:
parent
717073b22d
commit
90379789a0
@ -28,6 +28,14 @@
|
||||
%+ to-seed:bip39 nom
|
||||
(trip (fall pass ''))
|
||||
::
|
||||
++ derive-network-seed
|
||||
|= [mngs=@ rev=@ud]
|
||||
^- @ux
|
||||
=+ (seed:ds 64^mngs (weld "network" (a-co:co rev)))
|
||||
?: =(0 rev) -
|
||||
:: hash again to prevent length extension attacks
|
||||
(sha-256l:sha 32 -)
|
||||
::
|
||||
++ full-wallet-from-ticket
|
||||
:: who: username
|
||||
:: ticket: password
|
||||
@ -62,7 +70,7 @@
|
||||
%+ to-seed:bip39
|
||||
seed:management
|
||||
(trip (fall pass ''))
|
||||
=+ sed=(seed:ds 64^mad (weld "network" (a-co:co rev)))
|
||||
=+ sed=(derive-network-seed mad rev)
|
||||
[rev sed (urbit:ds sed)]
|
||||
::
|
||||
++ ds :: derive from raw seed
|
||||
|
@ -334,4 +334,15 @@
|
||||
:: ralmed-dinfeb-fopbyr-sanbet-sovmyl-dozsut-
|
||||
:: mogsyx-mapwyc-sorrup-ricnec-marnys-lignex
|
||||
[6 `'froot loops']
|
||||
::
|
||||
++ test-derive-network-seed-rev-0
|
||||
%+ expect-eq
|
||||
!> (seed:ds 64^0x5eed "network0")
|
||||
!> (derive-network-seed 0x5eed 0)
|
||||
::
|
||||
++ test-derive-network-seed-rev-up
|
||||
%+ expect-eq
|
||||
!> |
|
||||
!> .= (seed:ds 64^0x5eed "network1")
|
||||
(derive-network-seed 0x5eed 1)
|
||||
--
|
||||
|
Loading…
Reference in New Issue
Block a user