diff options
author | Matthias Andreas Benkard <code@mail.matthias.benkard.de> | 2011-08-16 00:33:19 +0200 |
---|---|---|
committer | Matthias Andreas Benkard <code@mail.matthias.benkard.de> | 2011-08-16 00:33:19 +0200 |
commit | 34a9c6bef7db450e0d8ea58dbc04740e3b261b12 (patch) | |
tree | 92fbf35538d24102245e74a94673ae62a0628fb1 /whirlpool.rkt | |
parent | 3aaa523f41df21b493133c4f3580c4cfed1611ff (diff) |
Implement HMAC.
Diffstat (limited to 'whirlpool.rkt')
-rw-r--r-- | whirlpool.rkt | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/whirlpool.rkt b/whirlpool.rkt index d57cf51..5d436aa 100644 --- a/whirlpool.rkt +++ b/whirlpool.rkt @@ -207,7 +207,7 @@ (let ([b (integer->bytes n)]) (bytes-append (make-bytes (- 32 (bytes-length b)) 0) b))) -(define: (pad-bytes [b : Bytes]) : Bytes +(define: (pad-whirlpool-bytes [b : Bytes]) : Bytes (let* ([missingno (modulo (- 32 (remainder (bytes-length b) 64)) 64)] [padding (cons #x80 (make-list (sub1 missingno) 0))] @@ -215,7 +215,7 @@ (bytes-append b (list->bytes padding) len))) (define: (bytes->message [b : Bytes]) : (Listof Matrix) - (let: ([pb : Bytes (pad-bytes b)]) + (let: ([pb : Bytes (pad-whirlpool-bytes b)]) (reverse (for/fold: ([acc : (Listof Matrix) (list)]) ([i : Exact-Nonnegative-Integer |