-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmonocypher.l
55 lines (53 loc) · 1.37 KB
/
monocypher.l
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
############
# Argon2id #
############
(de crypto_argon2d (Out Blocks Iters Lanes Password Salt Key Ad)
(let
(Config (%@ "malloc" 'P 16)
Inputs (%@ "malloc" 'P 24)
Extras (%@ "malloc" 'P 24)
WorkArea (%@ "malloc" 'P (* 1024 Blocks))
PrtPass NIL
PtrSalt NIL
PtrKey NIL
PtrAd NIL
R NIL )
(struct Config NIL
(cons 0 4)
(cons Blocks 4)
(cons Iters 4)
(cons Lanes 4) )
(setq
PtrPass (%@ "strdup" 'P Password)
PtrSalt (%@ "strdup" 'P Salt)
PtrKey (%@ "strdup" 'P Key)
PtrAd (%@ "strdup" 'P Ad) )
(struct Inputs NIL
(cons PtrPass 8)
(cons PtrSalt 8)
(cons (length Password) 4)
(cons (length Salt) 4 ) )
(struct Extras NIL
(cons PtrKey 8)
(cons PtrAd 8)
(cons (length Key) 4)
(cons (length Ad) 4) )
(native
"./glue_argon2.so"
"glue_argon2"
NIL
(cons 'R (cons (cons Out 'B Out)))
Out
WorkArea
Config
Inputs
Extras )
(%@ "free" NIL PtrPass)
(%@ "free" NIL PtrSalt)
(%@ "free" NIL PtrKey)
(%@ "free" NIL PtrAd)
(%@ "free" NIL Config)
(%@ "free" NIL Inputs)
(%@ "free" NIL Extras)
(%@ "free" NIL WorkArea)
R ) )