ifpps: Remove unused 'forks' member from struct ifstat
[netsniff-ng.git] / curve.h
bloba79f99204c3c9d5c7fe48b1a3af999f4034a7b13
1 #ifndef CURVE_H
2 #define CURVE_H
4 #include "locking.h"
5 #include "built_in.h"
6 #include "ioops.h"
7 #include "rnd.h"
8 #include "taia.h"
9 #include "crypto.h"
11 struct curve25519_proto {
12 unsigned char enonce[crypto_box_noncebytes] __aligned_16;
13 unsigned char dnonce[crypto_box_noncebytes] __aligned_16;
14 unsigned char key[crypto_box_noncebytes] __aligned_16;
17 struct curve25519_struct {
18 unsigned char *enc_buf, *dec_buf;
19 size_t enc_buf_size, dec_buf_size;
20 struct spinlock enc_lock, dec_lock;
23 extern void curve25519_selftest(void);
24 extern void curve25519_alloc_or_maybe_die(struct curve25519_struct *curve);
25 extern void curve25519_free(void *curve);
26 extern int curve25519_pubkey_hexparse_32(unsigned char *bin, size_t blen, const char *ascii, size_t alen);
27 extern int curve25519_proto_init(struct curve25519_proto *proto, unsigned char *pubkey_remote, size_t len,
28 char *home, int server);
29 extern ssize_t curve25519_encode(struct curve25519_struct *curve, struct curve25519_proto *proto,
30 unsigned char *plaintext, size_t size, unsigned char **chipertext);
31 extern ssize_t curve25519_decode(struct curve25519_struct *curve, struct curve25519_proto *proto,
32 unsigned char *chipertext, size_t size, unsigned char **plaintext,
33 struct taia *arrival_taia);
35 #endif /* CURVE_H */