Comparison

util/hmac.lua @ 3540:bc139431830b

Monster whitespace commit (beware the whitespace monster).
author Waqas Hussain <waqas20@gmail.com>
date Sat, 16 Oct 2010 23:00:42 +0500
parent 2925:692b3c6c5bd2
child 5537:15464633d8fb
comparison
equal deleted inserted replaced
3539:8bbd965267b2 3540:bc139431830b
38 hash 38 hash
39 the hash function 39 the hash function
40 blocksize 40 blocksize
41 the blocksize for the hash function in bytes 41 the blocksize for the hash function in bytes
42 hex 42 hex
43 return raw hash or hexadecimal string 43 return raw hash or hexadecimal string
44 --]] 44 --]]
45 function hmac(key, message, hash, blocksize, hex) 45 function hmac(key, message, hash, blocksize, hex)
46 if #key > blocksize then 46 if #key > blocksize then
47 key = hash(key) 47 key = hash(key)
48 end 48 end