-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathblake2b.l
40 lines (40 loc) · 1010 Bytes
/
blake2b.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
(de mono_blake2b (L K O)
(default O 64)
(let (Len (length L) Ken (length K))
(use R
(native
"libmonocypher.so"
"crypto_blake2b_general"
NIL
(cons 'R (cons (cons O 'B O)))
O
(cons NIL (cons Ken) K)
Ken
(cons NIL (cons Len) L)
Len )
R ) ) )
(de slide (L K O)
(let (Len (length L) Ken (length K) R)
(native
"libslide.so.0"
"blake2b"
NIL
(cons NIL (cons Len) L)
Len
(cons NIL (cons Ken) K)
Ken
(cons 'R (cons (cons O 'B O)))
O )
R ) )
(test
(mono_blake2b (mapcar char (chop "abc")) (1 2 3) 8)
(slide (mapcar char (chop "abc")) (1 2 3) 8) )
(for O 64
(for K (range 0 64)
(for D (range 0 256)
(let (Key (need K 255) Data (need D 255))
(test
(mono_blake2b Data Key O)
(slide Data Key O) ) ) ) ) )
(msg 'ok)
(bye)