| SYNOPSIS |
| #include <tls.h> |
| |
| string hmac(int method, string key, string arg ) |
| string hmac(int method, string key, bytes arg ) |
| string hmac(int method, string key, int * arg ) |
| string hmac(int method, bytes key, string arg ) |
| string hmac(int method, bytes key, bytes arg ) |
| string hmac(int method, bytes key, int * arg ) |
| |
| DESCRIPTION |
| Calculate the Hashed Message Authenication Code for <arg> based |
| on the digest <method> and the password <key>. Return the HMAC. |
| Any strings given as <key> or <arg> are converted to a UTF-8 |
| byte sequence before being used. |
| |
| <method> is one of the TLS_HASH_ constants defined in tls.h; not |
| all recognized methods may be supported for a given driven: |
| |
| TLS_HASH_SHA1 (1) |
| TLS_HASH_SHA224 (2) |
| TLS_HASH_SHA256 (3) |
| TLS_HASH_SHA384 (4) |
| TLS_HASH_SHA512 (5) |
| TLS_HASH_MD5 (6) |
| TLS_HASH_RIPEMD160 (7) |
| |
| If the driver is compiled without OpenSSL or GCrypt support |
| an error is thrown. |
| |
| |
| EXAMPLES |
| string s; |
| |
| s = hmac(TLS_HASH_SHA1, "secret", "Hello"); |
| s = hmac(TLS_HASH_SHA1, "secret", ({ 'H', 'e', 'l', 'l', 'o' }) ) |
| |
| HISTORY |
| Introduced in LDMud 3.3.714. |
| |
| SEE ALSO |
| crypt(E), md5(E), md5_crypt(E), sha1(E), hmac(E) |