summaryrefslogtreecommitdiff
path: root/hmac.rkt
diff options
context:
space:
mode:
authorMatthias Andreas Benkard <code@mail.matthias.benkard.de>2011-08-16 15:14:52 +0200
committerMatthias Andreas Benkard <code@mail.matthias.benkard.de>2011-08-16 15:14:52 +0200
commit93515cf43ce16974c7bef1d1d8332e3c8cfe6fac (patch)
tree84af96f2c50a933d94857d1563186c8bd66dadb7 /hmac.rkt
parent594c161d6e84581fb89873e216a70bd68a750919 (diff)
Implement the Salsa20 stream cipher.
Diffstat (limited to 'hmac.rkt')
-rw-r--r--hmac.rkt5
1 files changed, 4 insertions, 1 deletions
diff --git a/hmac.rkt b/hmac.rkt
index 314ab88..b618537 100644
--- a/hmac.rkt
+++ b/hmac.rkt
@@ -36,7 +36,7 @@
[ipad (make-bytes blocksize #x36)]
[padded-key
(pad-bytes (if (> (bytes-length key) blocksize)
- (integer->bytes (hashfn key))
+ (integer->bytes (hashfn key) 'big-endian)
key)
blocksize
#x0
@@ -44,6 +44,7 @@
(hashfn (bytes-append (integer->bytes/size
(bitwise-xor (bytes->integer opad)
(bytes->integer padded-key))
+ 'big-endian
blocksize)
(integer->bytes/size
(hashfn
@@ -51,8 +52,10 @@
(integer->bytes/size
(bitwise-xor (bytes->integer ipad)
(bytes->integer padded-key))
+ 'big-endian
blocksize)
msg))
+ 'big-endian
hashsize)))))
;; According to Ironclad: