2 #include <linux/types.h>
3 #include <linux/string.h>
8 #include "hmac_generic.h"
10 #include "hmac_sha2.h"
12 void inline sha256_result(sha256_context
*ctx
, u_int8_t
* hash
, int hashlen
) {
14 memcpy(hash
, &ctx
->sha_out
[0], hashlen
);
16 void inline sha512_result(sha512_context
*ctx
, u_int8_t
* hash
, int hashlen
) {
18 memcpy(hash
, &ctx
->sha_out
[0], hashlen
);
20 HMAC_SET_KEY_IMPL (sha256_hmac_set_key
,
21 sha256_hmac_context
, SHA256_BLOCKSIZE
,
22 sha256_init
, sha256_write
)
23 HMAC_HASH_IMPL (sha256_hmac_hash
,
24 sha256_hmac_context
, sha256_context
, SHA256_HASHLEN
,
25 sha256_write
, sha256_result
)
27 HMAC_SET_KEY_IMPL (sha512_hmac_set_key
,
28 sha512_hmac_context
, SHA512_BLOCKSIZE
,
29 sha512_init
, sha512_write
)
30 HMAC_HASH_IMPL (sha512_hmac_hash
,
31 sha512_hmac_context
, sha512_context
, SHA512_HASHLEN
,
32 sha512_write
, sha512_result
)