From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-180.mta0.migadu.com (out-180.mta0.migadu.com [91.218.175.180]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B44DC281368 for ; Tue, 6 Jan 2026 22:12:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.180 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767737555; cv=none; b=JroorHP4fnDstvPeR937V8bs8QSNooXbfFqrjyaOqvA1E3DN6zCYJPQ+oTcTwU6n7nE6h5O1c2edRPpWmpLD49o3Dt2xFqoypv27JjH9J3EY2LaLFs35RfcaoGk2RvFdnwKMdWd6OCUCr+spGQUpdtOvlfXHBMrXn0EF64NfWOY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767737555; c=relaxed/simple; bh=udzO7jzqWyR1EVEo78AX3W184D1928dk9ftVb7kARmI=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=rVS5Pw3l82fa7FFSxGLEv26UaL8fJQXGSScaTAu2pP1zg+q4w1SIO8uoSRyCcZgbqVCN1XFyr6UlyzbJzv+OLJSov8/DHAx1oV9wWmltIHL8iA9GmDnYvuhFkIOGFtnB4wyGZCIUqzUq/riKK4moQa5nYK3WpQb/iZUUfsy13N8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=CgTvNe1l; arc=none smtp.client-ip=91.218.175.180 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="CgTvNe1l" Message-ID: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1767737541; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=1d6rGS30zhJFKH3xp2dbt9eqhgPyFglX2SCUjcGokIs=; b=CgTvNe1lnErk5ZJZhdX2lbw7/ZI86ijQymlwpxnuM9tjc26bM4zLZUCGZVCGoJvrmCiXoL RDLdjK3Eduz3/2OElkHZ+5BupxXzwz7uTzNd4EGzzEH5BTWtxe355tmbO4Czkglyc3elT3 KLIqB9txoK/3cEvVtZ2nuOUXY3u3VQY= Date: Tue, 6 Jan 2026 22:12:19 +0000 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Subject: Re: [PATCH bpf-next v4 3/6] bpf: Add hash kfunc for cryptographic hashing To: Daniel Hodges , bpf@vger.kernel.org Cc: Alexei Starovoitov , Andrii Nakryiko , Daniel Borkmann , Song Liu , Mykyta Yatsenko , Martin KaFai Lau , Eduard Zingerman , Hao Luo , Jiri Olsa , John Fastabend , KP Singh , Stanislav Fomichev , Yonghong Song , Herbert Xu , "David S . Miller" , linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org References: <20260105173755.22515-1-git@danielhodges.dev> <20260105173755.22515-4-git@danielhodges.dev> Content-Language: en-US X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Vadim Fedorenko In-Reply-To: <20260105173755.22515-4-git@danielhodges.dev> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Migadu-Flow: FLOW_OUT 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 > --- > kernel/bpf/crypto.c | 78 ++++++++++++++++++++++++++++++++++++++++----- > 1 file changed, 70 insertions(+), 8 deletions(-) >