Compute the key and the message with HMAC SHA512
(k, m)
| 46 | |
| 47 | |
| 48 | def hmac_sha512(k, m): |
| 49 | """ |
| 50 | Compute the key and the message with HMAC SHA512 |
| 51 | """ |
| 52 | key = OpenSSL.malloc(k, len(k)) |
| 53 | d = OpenSSL.malloc(m, len(m)) |
| 54 | md = OpenSSL.malloc(0, 64) |
| 55 | i = OpenSSL.pointer(OpenSSL.c_int(0)) |
| 56 | OpenSSL.HMAC(OpenSSL.EVP_sha512(), key, len(k), d, len(m), md, i) |
| 57 | return md.raw |
| 58 | |
| 59 | |
| 60 | def pbkdf2(password, salt=None, i=10000, keylen=64): |