Skip to content

Commit df275ea

Browse files
hodgesdsKernel Patches Daemon
authored andcommitted
bpf: Extend bpf_crypto_type with hash operations
Add hash operation callbacks to bpf_crypto_type structure: - hash(): Performs hashing operation on input data - digestsize(): Returns the output size for the hash algorithm These additions enable BPF programs to use cryptographic hash functions through the unified bpf_crypto_type interface, supporting use cases such as content verification, integrity checking, and data authentication. Signed-off-by: Daniel Hodges <[email protected]>
1 parent 6ba2fc1 commit df275ea

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

include/linux/bpf_crypto.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,10 @@ struct bpf_crypto_type {
1111
int (*setauthsize)(void *tfm, unsigned int authsize);
1212
int (*encrypt)(void *tfm, const u8 *src, u8 *dst, unsigned int len, u8 *iv);
1313
int (*decrypt)(void *tfm, const u8 *src, u8 *dst, unsigned int len, u8 *iv);
14+
int (*hash)(void *tfm, const u8 *data, u8 *out, unsigned int len);
1415
unsigned int (*ivsize)(void *tfm);
1516
unsigned int (*statesize)(void *tfm);
17+
unsigned int (*digestsize)(void *tfm);
1618
u32 (*get_flags)(void *tfm);
1719
struct module *owner;
1820
char name[14];

0 commit comments

Comments
 (0)