This commit is contained in:
Steven Dee 2014-01-30 11:01:55 -08:00
parent b3b2c56603
commit a1e460cba2
4 changed files with 36 additions and 22 deletions

View File

@ -187,7 +187,7 @@
0
(rap 7 (bren key (mix i haf)) $(i +(i)) ~)
++ en
|+ [key=@I msg=@]
|+ [key=@I msg=@] ^- @uv
=+ len=(met 7 msg)
=+ adj=?:(=(0 len) 1 len)
=+ hax=(shax (mix key (shax (mix adj msg))))
@ -195,7 +195,7 @@
=+ ret=(can 7 ~[[2 hax] [adj (mix (burn key haf adj) msg)]])
ret
++ de
|+ [key=@I cep=@] ^- (unit ,@)
|+ [key=@I cep=@] ^- (unit ,@uv)
=+ toh=(met 7 cep)
?: (lth toh 3)
~

View File

@ -1,20 +0,0 @@
!:
:: /=try=/bin/aes/hoon
::
=> %= .
+
=> +
^/=main=/lib/cryo
==
|= *
|= ~
^- bowl
=+ k=0x1f1e.1d1c.1b1a.1918.1716.1514.1312.1110.0f0e.0d0c.0b0a.0908.0706.0504.0302.0100
=+ m=0xffee.ddcc.bbaa.9988.7766.5544.3322.1100
=+ e=(en:aes k m)
:_ ~ :_ ~
:- %$
=+ o=(en:aes 2 1)
=+ d=(de:aes 2 o)
!>
[`@ux`e `@ux`(de:aes k e) `@ux`o `@ux`d]

17
try/bin/aesde.hoon Normal file
View File

@ -0,0 +1,17 @@
!:
:: /=try=/bin/aesde/hoon
::
:: AES decryption toy. Don't use this for anything real.
::
=> %= .
+
=> +
^/=main=/lib/cryo
==
|= *
|= [k=@I c=@ ~]
^- bowl
=+ m=(de:aes k c)
:_ ~ :_ ~
:- %$
!> m

17
try/bin/aesen.hoon Normal file
View File

@ -0,0 +1,17 @@
!:
:: /=try=/bin/aesen/hoon
::
:: AES encryption toy. Don't use this for anything real.
::
=> %= .
+
=> +
^/=main=/lib/cryo
==
|= *
|= [k=@I m=@ ~]
^- bowl
=+ c=(en:aes k m)
:_ ~ :_ ~
:- %$
!> c