util.sasl.scram: Slight optimization of HMAC

Tue, 30 Sep 2014 12:16:33 +0200

author
Kim Alvefur <zash@zash.se>
date
Tue, 30 Sep 2014 12:16:33 +0200
changeset 363
056ccefa6acf
parent 362
d8c3e94d765d
child 364
69fc23b44819

util.sasl.scram: Slight optimization of HMAC

util/sasl/scram.lua file | annotate | diff | comparison | revisions
--- a/util/sasl/scram.lua	Tue Sep 30 11:59:52 2014 +0200
+++ b/util/sasl/scram.lua	Tue Sep 30 12:16:33 2014 +0200
@@ -18,8 +18,9 @@
 	return crypto.digest("sha1", str, true);
 end
 
+local _hmac_digest = crypto.hmac.digest;
 local function HMAC(key, str)
-	return crypto.hmac.digest("sha1", str, key, true);
+	return _hmac_digest("sha1", str, key, true);
 end
 
 local function Hi(str, salt, i)

mercurial