mirror of
https://github.com/urbit/shrub.git
synced 2024-12-02 08:55:07 +03:00
50782bd1c9
* research-constitution: (120 commits) removes obsolete doccords-style comments Revert "fixy uno~by, other vor-based code duplication" Implement argon2. Use face over lark when available. Implement blake2b. Use ++rep over ++can when we can Use ++rev over ++swp, for safety. Clean up base58 en/decoding Rename secp point serialization arms Add HMAC-SHA1 Put +=byts to use Restructure and complete BIP32 core Fix bug in RIPEMD-160 implementation. BIP32 key derivation logic. Messy, in dire need of restructuring. Fix bug in HMAC implementation. SHA-1 re-implementation, can account for leading zeroes. Converting points on curve to un/compressed numbers. RIPEMD-160 implementation. Start work on BIP32 support. Library file includes wrappers for the SHA family to make it take and produce sane byte order data, and a new HMAC implementation that depends on it. Also includes @belisarius222's secp256k1 implementation, plus experimental (and broken) support for other secp variants. Add ++rev to bit arithmetic, for reversing block order while accounting for leading zeroes. ...
67 lines
1.6 KiB
Plaintext
67 lines
1.6 KiB
Plaintext
:: Compile arvo as a pill noun, without compiler changes.
|
|
:: usage
|
|
::
|
|
:: .urbit/pill +solid
|
|
::
|
|
:::: /hoon/solid/gen
|
|
::
|
|
/? 310
|
|
::
|
|
::::
|
|
!:
|
|
:- %say
|
|
|= $: {now/@da eny/@uvJ bec/beak}
|
|
{arg/$@(~ {top/path ~}) dub/_|}
|
|
==
|
|
?~ arg $(arg ~[top=`path`/(scot %p p.bec)/[q.bec]/(scot %da now)/sys])
|
|
::
|
|
:- %noun
|
|
=+ pax=`path`(weld top.arg `path`[%hoon ~])
|
|
=+ arp=`path`(weld top.arg `path`[%arvo ~])
|
|
~& %solid-start
|
|
=+ txt=.^(@t %cx (weld pax `path`[%hoon ~]))
|
|
=+ rax=.^(@t %cx (weld arp `path`[%hoon ~]))
|
|
=+ ^= ken
|
|
=- ?:(?=(%& -.res) p.res (mean (flop p.res)))
|
|
^= res %- mule |.
|
|
~& %solid-loaded
|
|
=+ gen=(rain pax txt)
|
|
~& %solid-parsed
|
|
=+ one=(~(mint ut %noun) %noun gen)
|
|
~& %solid-compiled
|
|
?. dub
|
|
=+ two=(~(mint ut p.one) %noun (rain arp rax))
|
|
~& %solid-arvo
|
|
[7 q.one q.two]
|
|
=+ zax=(cat 3 '=> ' (cat 3 txt (cat 3 ' ' rax)))
|
|
~& %solid-double-loading
|
|
=+ all=.*(0 q.one)
|
|
~& %solid-double-loaded
|
|
=< +
|
|
.*(all [9 2 [0 2] [1 %noun zax] [0 7]])
|
|
::
|
|
~& [%solid-kernel `@ux`(mug ken)]
|
|
:- ken
|
|
=+ all=.*(0 ken)
|
|
=+ ^= vay ^- (list {p/@tas q/path})
|
|
:~ [%$ /zuse]
|
|
[%f /vane/ford]
|
|
[%b /vane/behn]
|
|
[%d /vane/dill]
|
|
[%a /vane/ames]
|
|
[%c /vane/clay]
|
|
[%g /vane/gall]
|
|
[%e /vane/eyre]
|
|
[%j /vane/jael]
|
|
==
|
|
|- ^+ all
|
|
?~ vay all
|
|
=+ pax=(weld top.arg q.i.vay)
|
|
=+ txt=.^(@ %cx (weld pax `path`[%hoon ~]))
|
|
=+ sam=[now `ovum`[[%gold ~] [%veer p.i.vay pax txt]]]
|
|
~& [%solid-veer i.vay]
|
|
=+ gat=.*(all .*(all [0 42]))
|
|
=+ nex=+:.*([-.gat [sam +>.gat]] -.gat)
|
|
$(vay t.vay, all nex)
|
|
|