Compute the key and the message with HMAC SHA5256
(k, m)
| 34 | |
| 35 | |
| 36 | def hmac_sha256(k, m): |
| 37 | """ |
| 38 | Compute the key and the message with HMAC SHA5256 |
| 39 | """ |
| 40 | key = OpenSSL.malloc(k, len(k)) |
| 41 | d = OpenSSL.malloc(m, len(m)) |
| 42 | md = OpenSSL.malloc(0, 32) |
| 43 | i = OpenSSL.pointer(OpenSSL.c_int(0)) |
| 44 | OpenSSL.HMAC(OpenSSL.EVP_sha256(), key, len(k), d, len(m), md, i) |
| 45 | return md.raw |
| 46 | |
| 47 | |
| 48 | def hmac_sha512(k, m): |
no test coverage detected