aboutsummaryrefslogtreecommitdiff
path: root/src/util/tweetnacl-gnunet.h
blob: d052d8824779de68b7434912f22400813352e301 (plain) (blame)
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
/*
      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 GNUNET_TWEETNACL_SIGN_SECRETKEYBYTES 64
#define GNUNET_TWEETNACL_SIGN_PUBLICBYTES 32
#define GNUNET_TWEETNACL_SCALARMULT_BYTES 32

int
GNUNET_TWEETNACL_scalarmult_curve25519 (uint8_t *,
                                        const uint8_t *,
                                        const uint8_t *);
extern int
GNUNET_TWEETNACL_scalarmult_curve25519_base (uint8_t *,
                                             const uint8_t *);
void
GNUNET_TWEETNACL_sign_pk_from_seed (uint8_t *pk, const uint8_t *seed);

void
GNUNET_TWEETNACL_sign_sk_from_seed (uint8_t *sk, const uint8_t *seed);

int
GNUNET_TWEETNACL_sign_ed25519_pk_to_curve25519 (uint8_t *x25519_pk,
                                                const uint8_t *ed25519_pk);

int
GNUNET_TWEETNACL_sign_detached_verify (const uint8_t *sig,
                                       const uint8_t *m,
                                       uint64_t n,
                                       const uint8_t *pk);

int
GNUNET_TWEETNACL_sign_detached (uint8_t *sig,
                                const uint8_t *m,
                                uint64_t n,
                                const uint8_t *sk);

void
GNUNET_TWEETNACL_scalarmult_gnunet_ecdsa (uint8_t *pk, const uint8_t *s);

#endif