1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
|
/*
This file has been placed in the public domain.
Based on TweetNaCl version 20140427
Originally obtained from:
https://tweetnacl.cr.yp.to/20140427/tweetnacl.h
SPDX-License-Identifier: 0BSD
*/
#ifndef TWEETNACL_H
#define TWEETNACL_H
#include <stdint.h>
#define crypto_scalarmult_PRIMITIVE "curve25519"
#define crypto_scalarmult crypto_scalarmult_curve25519
#define crypto_scalarmult_base crypto_scalarmult_curve25519_base
#define crypto_scalarmult_BYTES crypto_scalarmult_curve25519_BYTES
#define crypto_scalarmult_SCALARBYTES crypto_scalarmult_curve25519_SCALARBYTES
#define crypto_scalarmult_IMPLEMENTATION \
crypto_scalarmult_curve25519_IMPLEMENTATION
#define crypto_scalarmult_VERSION crypto_scalarmult_curve25519_VERSION
#define crypto_scalarmult_curve25519_tweet_BYTES 32
#define crypto_scalarmult_curve25519_tweet_SCALARBYTES 32
extern int crypto_scalarmult_curve25519_tweet (uint8_t *,
const uint8_t *,
const uint8_t *);
extern int crypto_scalarmult_curve25519_tweet_base (uint8_t *,
const uint8_t *);
#define crypto_scalarmult_curve25519_tweet_VERSION "-"
#define crypto_scalarmult_curve25519 crypto_scalarmult_curve25519_tweet
#define crypto_scalarmult_curve25519_base \
crypto_scalarmult_curve25519_tweet_base
#define crypto_scalarmult_curve25519_BYTES \
crypto_scalarmult_curve25519_tweet_BYTES
#define crypto_scalarmult_curve25519_SCALARBYTES \
crypto_scalarmult_curve25519_tweet_SCALARBYTES
#define crypto_scalarmult_curve25519_VERSION \
crypto_scalarmult_curve25519_tweet_VERSION
#define crypto_scalarmult_curve25519_IMPLEMENTATION \
"crypto_scalarmult/curve25519/tweet"
#define crypto_sign_PRIMITIVE "ed25519"
#define crypto_sign crypto_sign_ed25519
#define crypto_sign_BYTES crypto_sign_ed25519_BYTES
#define crypto_sign_PUBLICKEYBYTES crypto_sign_ed25519_PUBLICKEYBYTES
#define crypto_sign_SECRETKEYBYTES crypto_sign_ed25519_SECRETKEYBYTES
#define crypto_sign_IMPLEMENTATION crypto_sign_ed25519_IMPLEMENTATION
#define crypto_sign_VERSION crypto_sign_ed25519_VERSION
#define crypto_sign_ed25519_tweet_BYTES 64
#define crypto_sign_ed25519_tweet_PUBLICKEYBYTES 32
#define crypto_sign_ed25519_tweet_SECRETKEYBYTES 64
extern int crypto_sign_ed25519_tweet (uint8_t *,
uint64_t *,
const uint8_t *,
uint64_t,
const uint8_t *);
extern int crypto_sign_ed25519_tweet_open (uint8_t *,
uint64_t *,
const uint8_t *,
uint64_t,
const uint8_t *);
extern int crypto_sign_ed25519_tweet_keypair (uint8_t *,uint8_t *);
#define crypto_sign_ed25519_tweet_VERSION "-"
#define crypto_sign_ed25519 crypto_sign_ed25519_tweet
#define crypto_sign_ed25519_open crypto_sign_ed25519_tweet_open
#define crypto_sign_ed25519_keypair crypto_sign_ed25519_tweet_keypair
#define crypto_sign_ed25519_BYTES crypto_sign_ed25519_tweet_BYTES
#define crypto_sign_ed25519_PUBLICKEYBYTES \
crypto_sign_ed25519_tweet_PUBLICKEYBYTES
#define crypto_sign_ed25519_SECRETKEYBYTES \
crypto_sign_ed25519_tweet_SECRETKEYBYTES
#define crypto_sign_ed25519_VERSION crypto_sign_ed25519_tweet_VERSION
#define crypto_sign_ed25519_IMPLEMENTATION "crypto_sign/ed25519/tweet"
void crypto_sign_pk_from_seed (uint8_t *pk, const uint8_t *seed);
void crypto_sign_sk_from_seed (uint8_t *sk, const uint8_t *seed);
int crypto_sign_ed25519_pk_to_curve25519 (uint8_t *x25519_pk,
const uint8_t *ed25519_pk);
int crypto_sign_detached_verify (const uint8_t *sig,
const uint8_t *m,
uint64_t n,
const uint8_t *pk);
int crypto_sign_detached (uint8_t *sig,
const uint8_t *m,
uint64_t n,
const uint8_t *sk);
#endif
|