This commit is contained in:
Mike 2023-07-31 09:39:40 +03:00
parent 6afc19d154
commit f014089be7
3 changed files with 36 additions and 1 deletions

View file

@ -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
View 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
View file

@ -0,0 +1,8 @@
(load "monocypher.l")
(load "lib
(println
(crypto_argon2i 3 8
(mapcar char (chop "mikemike"))
(mapcar char (chop "mikemike"))
8 ) )