Re: [RFC 4/8] checksum: add l_checksum_new_hmac_from_key_id
Denis Kenzior <[email protected]> Tue, 22 Nov 2022 10:53:03 -0600
| Newsgroups | dev.linux.lists.ell |
|---|---|
| Message-ID | <[email protected]> |
Hi James,
On 11/18/22 15:16, James Prestwood wrote:
> Same as l_checksum_new_hmac but uses a key ID rather than a
> key directly.
> ---
> ell/checksum.c | 17 +++++++++++++++++
> ell/checksum.h | 2 ++
> ell/ell.sym | 1 +
> 3 files changed, 20 insertions(+)
>
<snip>
> @@ -213,6 +217,19 @@ LIB_EXPORT struct l_checksum *l_checksum_new_hmac(enum l_checksum_type type,
> &checksum_hmac_algs[type]);
> }
>
> +struct l_checksum *l_checksum_new_hmac_from_key_id(enum l_checksum_type type,
> + int32_t key_id)
Missing LIB_EXPORT?
> +{
> + if (!is_valid_index(checksum_hmac_algs, type) ||
> + !checksum_hmac_algs[type].name)
> + return NULL;
> +
> + return checksum_new_common(checksum_hmac_algs[type].name,
> + ALG_SET_KEY_BY_KEY_SERIAL,
> + &key_id, sizeof(key_id),
> + &checksum_hmac_algs[type]);
> +}
> +
> /**
> * l_checksum_clone:
> * @checksum: parent checksum object
Regards,
-Denis