diff options
| author | Andrii Nakryiko <andrii@kernel.org> | 2025-10-01 10:13:25 -0700 |
|---|---|---|
| committer | Alexei Starovoitov <ast@kernel.org> | 2025-10-01 15:27:25 -0700 |
| commit | a7f36f81d0bde9e274606f771f7bfd59b2c8c083 (patch) | |
| tree | 9a334b225b4970aa246c9c62d53a2cae56d2d209 /tools/lib/bpf/libbpf_internal.h | |
| parent | c68b6fdc3600466e3c265bad34d099eb8c5280f1 (diff) | |
libbpf: move libbpf_sha256() implementation into libbpf_utils.c
Move sha256 implementation out of already large and unwieldy libbpf.c
into libbpf_utils.c where we'll keep reusable helpers.
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/r/20251001171326.3883055-5-andrii@kernel.org
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Eduard Zingerman <eddyz87@gmail.com>
Diffstat (limited to 'tools/lib/bpf/libbpf_internal.h')
| -rw-r--r-- | tools/lib/bpf/libbpf_internal.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/tools/lib/bpf/libbpf_internal.h b/tools/lib/bpf/libbpf_internal.h index a8f204139371..35b2527bedec 100644 --- a/tools/lib/bpf/libbpf_internal.h +++ b/tools/lib/bpf/libbpf_internal.h @@ -722,6 +722,11 @@ static inline bool is_pow_of_2(size_t x) return x && (x & (x - 1)) == 0; } +static inline __u32 ror32(__u32 v, int bits) +{ + return (v >> bits) | (v << (32 - bits)); +} + #define PROG_LOAD_ATTEMPTS 5 int sys_bpf_prog_load(union bpf_attr *attr, unsigned int size, int attempts); |