MCPcopy Index your code
hub / github.com/Bitmessage/PyBitmessage / hmac_sha256

Function hmac_sha256

src/pyelliptic/hash.py:36–45  ·  view source on GitHub ↗

Compute the key and the message with HMAC SHA5256

(k, m)

Source from the content-addressed store, hash-verified

34
35
36def 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
48def hmac_sha512(k, m):

Callers 2

raw_encryptMethod · 0.90
decryptMethod · 0.90

Calls 1

mallocMethod · 0.80

Tested by

no test coverage detected