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);
25 extern struct curve25519_struct
*curve25519_tfm_alloc(void);
26 extern void curve25519_tfm_free(struct curve25519_struct
*tfm
);
27 extern void curve25519_tfm_free_void(void *tfm
);
29 extern void curve25519_proto_init(struct curve25519_proto
*proto
,
30 unsigned char *pubkey_remote
, size_t len
);
31 extern int curve25519_pubkey_hexparse_32(unsigned char *bin
, size_t blen
,
32 const char *ascii
, size_t alen
);
34 extern ssize_t
curve25519_encode(struct curve25519_struct
*curve
,
35 struct curve25519_proto
*proto
,
36 unsigned char *plaintext
, size_t size
,
37 unsigned char **ciphertext
);
38 extern ssize_t
curve25519_decode(struct curve25519_struct
*curve
,
39 struct curve25519_proto
*proto
,
40 unsigned char *ciphertext
, size_t size
,
41 unsigned char **plaintext
,
42 struct taia
*arrival_taia
);