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
);