Software /
code /
prosody
Comparison
util-src/hashes.c @ 12561:adfb46a3e8a7
util.hashes: Expose sha224 and sha384 HMAC functions
For completeness and consistency with set of plain hash functions
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Sun, 29 Nov 2020 17:58:45 +0100 |
parent | 12560:1e41dd0f8353 |
child | 12562:4f4d096a14cb |
comparison
equal
deleted
inserted
replaced
12560:1e41dd0f8353 | 12561:adfb46a3e8a7 |
---|---|
167 | 167 |
168 static int Lhmac_sha1(lua_State *L) { | 168 static int Lhmac_sha1(lua_State *L) { |
169 return Levp_hmac(L, EVP_sha1()); | 169 return Levp_hmac(L, EVP_sha1()); |
170 } | 170 } |
171 | 171 |
172 static int Lhmac_sha224(lua_State *L) { | |
173 return Levp_hmac(L, EVP_sha224()); | |
174 } | |
175 | |
172 static int Lhmac_sha256(lua_State *L) { | 176 static int Lhmac_sha256(lua_State *L) { |
173 return Levp_hmac(L, EVP_sha256()); | 177 return Levp_hmac(L, EVP_sha256()); |
178 } | |
179 | |
180 static int Lhmac_sha384(lua_State *L) { | |
181 return Levp_hmac(L, EVP_sha384()); | |
174 } | 182 } |
175 | 183 |
176 static int Lhmac_sha512(lua_State *L) { | 184 static int Lhmac_sha512(lua_State *L) { |
177 return Levp_hmac(L, EVP_sha512()); | 185 return Levp_hmac(L, EVP_sha512()); |
178 } | 186 } |
234 { "sha256", Lsha256 }, | 242 { "sha256", Lsha256 }, |
235 { "sha384", Lsha384 }, | 243 { "sha384", Lsha384 }, |
236 { "sha512", Lsha512 }, | 244 { "sha512", Lsha512 }, |
237 { "md5", Lmd5 }, | 245 { "md5", Lmd5 }, |
238 { "hmac_sha1", Lhmac_sha1 }, | 246 { "hmac_sha1", Lhmac_sha1 }, |
247 { "hmac_sha224", Lhmac_sha224 }, | |
239 { "hmac_sha256", Lhmac_sha256 }, | 248 { "hmac_sha256", Lhmac_sha256 }, |
249 { "hmac_sha384", Lhmac_sha384 }, | |
240 { "hmac_sha512", Lhmac_sha512 }, | 250 { "hmac_sha512", Lhmac_sha512 }, |
241 { "hmac_md5", Lhmac_md5 }, | 251 { "hmac_md5", Lhmac_md5 }, |
242 { "scram_Hi_sha1", Lpbkdf2_sha1 }, /* COMPAT */ | 252 { "scram_Hi_sha1", Lpbkdf2_sha1 }, /* COMPAT */ |
243 { "pbkdf2_hmac_sha1", Lpbkdf2_sha1 }, | 253 { "pbkdf2_hmac_sha1", Lpbkdf2_sha1 }, |
244 { "pbkdf2_hmac_sha256", Lpbkdf2_sha256 }, | 254 { "pbkdf2_hmac_sha256", Lpbkdf2_sha256 }, |