Restructure ++number and ++crypto in %zuse.

This commit is contained in:
C. Guy Yarvin 2016-10-21 16:19:42 -07:00
parent e57149b7c5
commit 7c5a3763aa
11 changed files with 57 additions and 32 deletions

View File

@ -515,7 +515,7 @@
%+ weld
(turn q.hit |=({a/@t b/@t} "{(trip a)}: {(trip b)}"))
:- i=""
t=(turn `wain`?~(r.hit ~ (lore q.u.r.hit)) trip)
t=(turn `wain`?~(r.hit ~ (lore:differ q.u.r.hit)) trip)
==
::
++ dy-show-span-noun

View File

@ -1368,7 +1368,7 @@
now.hid
(sy /fora-post eyre+pax ~)
:- %mor :~
[%fat text+(lore txt) [%url [ra-base-hart `pax ~] `fra]]
[%fat text+(lore:differ txt) [%url [ra-base-hart `pax ~] `fra]]
[%app %tree (crip "forum post: '{(trip hed)}'")]
==
==
@ -1409,7 +1409,7 @@
now.hid
(sy /comment eyre+pax ~)
:- %mor :~
[%fat text+(lore txt) [%url [ra-base-hart `pax ~] `fra]]
[%fat text+(lore:differ txt) [%url [ra-base-hart `pax ~] `fra]]
[%app %tree (crip "comment on /{nam}")]
==
==

View File

@ -1515,7 +1515,7 @@
:: key: generated key
:: bul: initial bull
::
=/ key (ypt:scr (mix our %jael-make) gen)
=/ key (ypt:scr:number (mix our %jael-make) gen)
=* doc `bull`[(sein our) & nym]
::
:: register generator as login secret
@ -1555,7 +1555,7 @@
:: had: key handle
:: ryt: initial right
::
=/ key (ypt:scr (mix our %jael-make) gen)
=/ key (ypt:scr:number (mix our %jael-make) gen)
=* had (shaf %hand key)
=* ryt `rite`[%urban [had (add ~m1 now) key] ~ ~]
::

View File

@ -1926,27 +1926,31 @@
?. &(?=(^ tin) =(key p.u.tin) =(msg q.u.tin))
~|(%test-fail-seal !!)
msg
::
++ crub :: cryptosuite B (Ed)
:: :: ++crub:crypto
++ crub :: cryptosuite B (Ed)
^- acru
=, number
=, crypto
=| {pub/{cry/@ sgn/@} sek/(unit {cry/@ sgn/@})}
|%
++ as
:: :: ++as:crub:crypto
++ as ::
|%
++ sign
:: :: ++sign:as:crub
++ sign ::
|= {@ msg/@}
^- @ux
?~ sek ~| %pubkey-only !!
(jam [(sign:ed msg sgn.u.sek) msg])
++ sure
:: :: ++sure:as:crub
++ sure ::
|= {@ txt/@}
^- (unit @ux)
=+ ((hard {sig/@ msg/@}) (cue txt))
?. (veri:ed sig msg sgn.pub) ~
(some msg)
++ seal
:: :: ++seal:as:crub
++ seal ::
|= {bpk/pass m1/@ m2/@}
^- @ux
?~ sek ~| %pubkey-only !!
@ -1956,7 +1960,8 @@
=+ msg=(jam m1 m2)
=+ smsg=(sign ~ msg)
(jam (~(en siva:aes shar ~) smsg))
++ tear
:: :: ++tear:as:crub
++ tear ::
|= {bpk/pass txt/@}
^- (unit (pair @ux @ux))
?~ sek ~| %pubkey-only !!
@ -1970,7 +1975,8 @@
?~ veri ~
(some ((hard (pair @ux @ux)) (cue u.veri)))
--
++ de
:: :: ++de:crub:crypto
++ de :: decrypt
|= {key/@J txt/@}
^- (unit @ux)
=+ ((hard {iv/@ len/@ cph/@}) (cue txt))
@ -1978,19 +1984,36 @@
iv
len
cph
++ dy |=({key/@I cph/@} (need (de key cph)))
++ en
:: :: ++dy:crub:crypto
++ dy :: need decrypt
|= {key/@I cph/@}
(need (de key cph))
:: :: ++en:crub:crypto
++ en :: encrypt
|= {key/@J msg/@}
^- @ux
(jam (~(en sivc:aes (shaz key) ~) msg))
++ ex
:: :: ++ex:crub:crypto
++ ex :: extract
|%
++ fig ^- @uvH (shaf %bfig sgn.^pub)
++ pac ^- @uvG ?~ sek ~| %pubkey-only !!
(end 6 1 (shaf %bcod sgn.u.sek))
++ pub ^- pass (cat 3 'b' (cat 8 sgn.^pub cry.^pub))
++ sec ^- ring ?~ sek ~| %pubkey-only !!
(cat 3 'B' (cat 8 sgn.u.sek cry.u.sek))
:: :: ++fig:ex:crub
++ fig :: fingerprint
^- @uvH
(shaf %bfig sgn.^pub)
:: :: ++pac:ex:crub
++ pac :: private fingerprint
^- @uvG
?~ sek ~| %pubkey-only !!
(end 6 1 (shaf %bcod sgn.u.sek))
:: :: ++pub:ex:crub
++ pub :: public key
^- pass
(cat 3 'b' (cat 8 sgn.^pub cry.^pub))
:: :: ++sec:ex:crub
++ sec :: private key
^- ring
?~ sek ~| %pubkey-only !!
(cat 3 'B' (cat 8 sgn.u.sek cry.u.sek))
--
++ nu
|%
@ -2013,8 +2036,8 @@
..nu(pub [cry=(rsh 8 1 bod) sgn=(end 8 1 bod)], sek ~)
--
--
::
++ trub :: test crub
:: :: ++trub:crypto
++ trub :: test crub
|= msg/@t
::
:: make acru cores

View File

@ -80,7 +80,7 @@
|= hood-begin =< abet
?> ?=($~ bur)
=+ buz=(shaz :(mix (jam ges) eny))
=+ loy=(pit:nu:crub 512 buz)
=+ loy=(pit:nu:crub:crypto 512 buz)
%- emit(bur `[his [0 sec:ex:loy]~])
[%wont /helm/ticket [our (sein his)] /a/ta his tic ges pub:ex:loy]
::

View File

@ -677,7 +677,7 @@
~& [%backing-up pas=pas]
=; dif (emit %info /backup [our dif])
%+ foal (welp pax /jam-crub)
[%jam-crub !>((en:crub pas (jam `part`+:abet)))]
[%jam-crub !>((en:crub:crypto pas (jam `part`+:abet)))]
::
++ poke-rekey :: extend will
|= $~

View File

@ -114,7 +114,7 @@
|= {hot/host dat/@}
?> ?=($& -.hot)
=. p.hot (scag 2 p.hot) :: ignore subdomain
=. dat (scot %uw (en:crua ames-secret dat)) :: XX clay permissions
=. dat (scot %uw (en:crua:crypto ames-secret dat)) :: XX clay permissions
(poke--data [`%atom [%sec p.hot]] %mime / (taco dat))
::
++ poke--data

View File

@ -43,7 +43,7 @@
|% :: convert from
++ mime |=({p/mite q/octs} q.q)
++ noun @t :: clam from %noun
++ txt role
++ txt role:differ
--
++ grad %txt
--

View File

@ -8,13 +8,13 @@
|%
++ mime [/text/x-markdown (taco mud)]
++ txt
(lore mud)
(lore:differ mud)
--
++ grab
|%
++ mime |=({p/mite q/octs} q.q)
++ noun @t
++ txt role
++ txt role:differ
--
++ grad %txt
++ garb /down

View File

@ -2,10 +2,10 @@
:::: /hoon/txt-diff/mar
::
/? 310
|_ txt-diff/(urge cord)
|_ txt-diff/(urge:^differ cord)
::
++ grab :: convert from
|%
++ noun (urge cord) :: clam from %noun
++ noun (urge:^differ cord) :: clam from %noun
--
--

View File

@ -3,6 +3,8 @@
::
/? 310
!:
=, ^differ
=, differ
|_ txt/wain
::
++ grab :: convert from