.TH LIBSHA1_HMAC_INIT 3 2019-02-10 libsha1 .SH NAME libsha1_hmac_init \- Initialises hashing with an HMAC-SHA 1/0 algorithm .SH SYNOPSIS .nf #include enum libsha1_algorithm { LIBSHA1_0, /* SHA-0 */ LIBSHA1_1 /* SHA-1 */ }; int libsha1_hmac_init(struct libsha1_hmac_state *restrict \fIstate\fP, enum libsha1_algorithm \fIalgorithm\fP, const void *restrict \fIkey\fP, size_t \fIkeylen\fP); .fi .PP Link with .IR \-lsha1 . .SH DESCRIPTION The .BR libsha1_hmac_init () function stores the selected .I algorithm in .I state and initialises .I state with the first .I keylen bits of .I key as the key. .SH RETURN VALUE The .BR libsha1_hmac_init () function returns 0 upon successful completion, otherwise -1 is returned and .I errno is set appropriately. .SH ERRORS The .BR libsha1_hmac_init () function will fail if: .TP .B EINVAL .I algorithm is not a valid .B enum libsha1_algorithm value. .SH EXAMPLES None. .SH APPLICATION USAGE None. .SH RATIONALE None. .SH FUTURE DIRECTIONS None. .SH NOTES None. .SH BUGS None. .SH SEE ALSO .BR libsha1_hmac_digest (3), .BR libsha1_hmac_marshal (3), .BR libsha1_hmac_unmarshal (3), .BR libsha1_hmac_update (3)