.
This commit is contained in:
parent
6743357590
commit
903a1baaf5
|
@ -4,7 +4,7 @@
|
|||
(pack
|
||||
(mapcar '((B) (pad 2 (hex B))) Lst) ) ) )
|
||||
(let (SK (range 0 63) Pair)
|
||||
(do 1000000
|
||||
(do 1
|
||||
(setq Pair (crypto_ed25519_key_pair (head 32 SK)))
|
||||
(setq SK (crypto_ed25519_sign (car Pair) SK)) )
|
||||
(println (L2hex SK)) )
|
||||
|
|
|
@ -1,30 +1,7 @@
|
|||
`(== 64 64)
|
||||
(de soda_init (C)
|
||||
(native
|
||||
"libsodium.so"
|
||||
"crypto_sign_init"
|
||||
NIL
|
||||
C ) )
|
||||
(de soda_update (C M)
|
||||
(let ML (length M)
|
||||
(native
|
||||
"libsodium.so"
|
||||
"crypto_sign_update"
|
||||
NIL
|
||||
C
|
||||
(cons NIL (cons ML) M)
|
||||
ML ) ) )
|
||||
(de soda_fin (C Prv)
|
||||
(let Sign NIL
|
||||
(native
|
||||
"libsodium.so"
|
||||
"crypto_sign_final_create"
|
||||
NIL
|
||||
C
|
||||
'(Sign (64 B . 64))
|
||||
0
|
||||
(cons NIL (64) Prv) )
|
||||
Sign ) )
|
||||
(de L2hex (Lst)
|
||||
(lowc
|
||||
(pack
|
||||
(mapcar '((B) (pad 2 (hex B))) Lst) ) ) )
|
||||
(de soda_detached (D Size Prv)
|
||||
(let Sign NIL
|
||||
(native
|
||||
|
@ -49,26 +26,24 @@
|
|||
(list PK SK) ) )
|
||||
(de soda_start NIL
|
||||
(native "libsodium.so" "sodium_init") )
|
||||
(de sodium_sha512_init (S)
|
||||
(native
|
||||
"libsodium.so"
|
||||
"crypto_hash_sha512_init"
|
||||
'I
|
||||
S ) )
|
||||
(de sodium_sha512_update (S D Size)
|
||||
(native
|
||||
"libsodium.so"
|
||||
"crypto_hash_sha512_update"
|
||||
'I
|
||||
S
|
||||
D
|
||||
Size ) )
|
||||
(de sodium_sha512_fin (S)
|
||||
(let R NIL
|
||||
(native
|
||||
"libsodium.so"
|
||||
"crypto_hash_sha512_final"
|
||||
'I
|
||||
S
|
||||
'(R (64 B . 64)) )
|
||||
R ) )
|
||||
|
||||
(soda_start)
|
||||
(let (SK (range 0 63) Pair)
|
||||
(do 1
|
||||
(setq Pair (soda_seed_keypair (head 32 SK)))
|
||||
(println Pair)
|
||||
(msg "next")
|
||||
(setq SK (soda_detached (range 1 64) 64 (list (range 1 64) (range 1 64))))
|
||||
(msg "ok?")
|
||||
)
|
||||
|
||||
(println (L2hex SK))
|
||||
|
||||
)
|
||||
|
||||
|
||||
|
||||
(msg 'ok)
|
||||
(bye)
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue