[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <afb45da9-5731-4f7b-afc1-cd4dc26a0166@linux.dev>
Date: Tue, 6 Jan 2026 22:12:19 +0000
From: Vadim Fedorenko <vadim.fedorenko@...ux.dev>
To: Daniel Hodges <git@...ielhodges.dev>, bpf@...r.kernel.org
Cc: Alexei Starovoitov <ast@...nel.org>, Andrii Nakryiko <andrii@...nel.org>,
Daniel Borkmann <daniel@...earbox.net>, Song Liu <song@...nel.org>,
Mykyta Yatsenko <yatsenko@...a.com>, Martin KaFai Lau
<martin.lau@...ux.dev>, Eduard Zingerman <eddyz87@...il.com>,
Hao Luo <haoluo@...gle.com>, Jiri Olsa <jolsa@...nel.org>,
John Fastabend <john.fastabend@...il.com>, KP Singh <kpsingh@...nel.org>,
Stanislav Fomichev <sdf@...ichev.me>, Yonghong Song
<yonghong.song@...ux.dev>, Herbert Xu <herbert@...dor.apana.org.au>,
"David S . Miller" <davem@...emloft.net>, linux-crypto@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-kselftest@...r.kernel.org
Subject: Re: [PATCH bpf-next v4 3/6] bpf: Add hash kfunc for cryptographic
hashing
On 05/01/2026 17:37, Daniel Hodges wrote:
> Extend bpf_crypto_type structure with hash operations:
> - hash(): Performs hashing operation
> - digestsize(): Returns hash output size
well, as I've already mentioned, none of them are actually introduced in
the patchset.
>
> Update bpf_crypto_ctx_create() to support keyless operations:
> - Hash algorithms don't require keys, unlike ciphers
> - Only validates key presence if type->setkey is defined
> - Conditionally sets IV/state length for cipher operations only
>
> Add bpf_crypto_hash() kfunc that works with any hash algorithm
> registered in the kernel's crypto API through the BPF crypto type
> system. This enables BPF programs to compute cryptographic hashes for
> use cases such as content verification, integrity checking, and data
> authentication.
>
> Signed-off-by: Daniel Hodges <git@...ielhodges.dev>
> ---
> kernel/bpf/crypto.c | 78 ++++++++++++++++++++++++++++++++++++++++-----
> 1 file changed, 70 insertions(+), 8 deletions(-)
>
Powered by blists - more mailing lists