.
This commit is contained in:
parent
6afc19d154
commit
f014089be7
3 changed files with 36 additions and 1 deletions
|
@ -1,4 +1,4 @@
|
|||
(de libargon2 (Iters Blocks Pass Salt HashLen)
|
||||
(de libargon2i (Iters Blocks Pass Salt HashLen)
|
||||
(let
|
||||
(PL (length Pass)
|
||||
SL (length Salt)
|
27
monocypher.l
Normal file
27
monocypher.l
Normal file
|
@ -0,0 +1,27 @@
|
|||
(de crypto_argon2i (Iters Blocks Pass Salt HashLen)
|
||||
(let
|
||||
(WorkArea (%@ "malloc" 'P (* 1024 Blocks))
|
||||
PL (length Pass)
|
||||
SL (length Salt)
|
||||
R NIL )
|
||||
(native
|
||||
"libmonocypher.so.3"
|
||||
"crypto_argon2i"
|
||||
NIL
|
||||
(list 'R (cons HashLen 'B HashLen))
|
||||
HashLen
|
||||
WorkArea
|
||||
Blocks
|
||||
Iters
|
||||
(cons NIL (cons PL) Pass)
|
||||
PL
|
||||
(cons NIL (cons SL) Salt)
|
||||
SL )
|
||||
(prog1
|
||||
R
|
||||
(%@ "free" NIL WorkArea) ) ) )
|
||||
(println
|
||||
(crypto_argon2i 3 8
|
||||
(mapcar char (chop "mikemike"))
|
||||
(mapcar char (chop "mikemike"))
|
||||
8 ) )
|
8
test.l
Normal file
8
test.l
Normal file
|
@ -0,0 +1,8 @@
|
|||
(load "monocypher.l")
|
||||
(load "lib
|
||||
|
||||
(println
|
||||
(crypto_argon2i 3 8
|
||||
(mapcar char (chop "mikemike"))
|
||||
(mapcar char (chop "mikemike"))
|
||||
8 ) )
|
Loading…
Reference in a new issue