d9c258469dd337a775361044cdddbfe106018e1f
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_beforenmbytes
] __aligned_16
;
17 struct curve25519_struct
{
18 unsigned char *enc
, *dec
;
19 size_t enc_size
, dec_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 void curve25519_proto_init(struct curve25519_proto
*proto
,
27 unsigned char *pubkey_remote
, size_t len
);
28 extern int curve25519_pubkey_hexparse_32(unsigned char *bin
, size_t blen
,
29 const char *ascii
, size_t alen
);
31 extern ssize_t
curve25519_encode(struct curve25519_struct
*curve
,
32 struct curve25519_proto
*proto
,
33 unsigned char *plaintext
, size_t size
,
34 unsigned char **ciphertext
);
35 extern ssize_t
curve25519_decode(struct curve25519_struct
*curve
,
36 struct curve25519_proto
*proto
,
37 unsigned char *ciphertext
, size_t size
,
38 unsigned char **plaintext
,
39 struct taia
*arrival_taia
);