| 1 |
. |
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
#ifndef __LINUX_CRYPTO_H |
| 9 |
#define __LINUX_CRYPTO_H |
| 10 |
|
| 11 |
#include "common/attributes.h" |
| 12 |
|
| 13 |
#include <sys/syscall.h> |
| 14 |
#include <sys/socket.h> |
| 15 |
#include <sys/types.h> |
| 16 |
#include <stdlib.h> |
| 17 |
#include <stdint.h> |
| 18 |
#include <stdio.h> |
| 19 |
#include <stddef.h> |
| 20 |
#include <string.h> |
| 21 |
#include <unistd.h> |
| 22 |
#include <errno.h> |
| 23 |
#include <linux/if_alg.h> |
| 24 |
|
| 25 |
#ifndef AF_ALG |
| 26 |
#define AF_ALG 38 |
| 27 |
#endif |
| 28 |
#ifndef SOL_ALG |
| 29 |
#define SOL_ALG 279 |
| 30 |
#endif |
| 31 |
|
| 32 |
struct linux_crypto; |
| 33 |
|
| 34 |
|
| 35 |
int linux_crypto_init(struct linux_crypto **ctx); |
| 36 |
int linux_crypto_set_key(const uint8_t *key, int keylen,struct linux_crypto *ctx); |
| 37 |
int linux_crypto_decrypt(const uint8_t inbuf[], uint8_t outbuf[], int buflen, uint8_t iv[], struct linux_crypto *ctx); |
| 38 |
int linux_crypto_encrypt(const uint8_t inbuf[], uint8_t outbuf[], int buflen, uint8_t iv[], struct linux_crypto *ctx); |
| 39 |
void linux_crypto_free(struct linux_crypto **ctx); |
| 40 |
#endif |