libbpf: Implement SHA256 internal helper
authorKP Singh <kpsingh@kernel.org>
Sun, 14 Sep 2025 21:51:32 +0000 (23:51 +0200)
committerAlexei Starovoitov <ast@kernel.org>
Fri, 19 Sep 2025 02:11:42 +0000 (19:11 -0700)
commitc297fe3e9f9917e8bfd569442290736a551bfc60
tree9db7ee43c1cc6c61ce9c9ddc3c02c100908ac385
parentbaefdbdf6812e120c9fba9cfb101d3656f478026
libbpf: Implement SHA256 internal helper

Use AF_ALG sockets to not have libbpf depend on OpenSSL. The helper is
used for the loader generation code to embed the metadata hash in the
loader program and also by the bpf_map__make_exclusive API to calculate
the hash of the program the map is exclusive to.

Acked-by: Andrii Nakryiko <andrii@kernel.org>
Signed-off-by: KP Singh <kpsingh@kernel.org>
Link: https://lore.kernel.org/r/20250914215141.15144-4-kpsingh@kernel.org
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
tools/lib/bpf/libbpf.c
tools/lib/bpf/libbpf_internal.h