summaryrefslogtreecommitdiffstats
path: root/external_libs/python/pyzmq-14.7.0/bundled/libsodium/src/libsodium/crypto_box/crypto_box.c
blob: 7ae4297cf88464a35db5bac0f211275bfb387fde (plain)
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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
#include "crypto_box.h"

size_t
crypto_box_seedbytes(void)
{
    return crypto_box_SEEDBYTES;
}

size_t
crypto_box_publickeybytes(void)
{
    return crypto_box_PUBLICKEYBYTES;
}

size_t
crypto_box_secretkeybytes(void)
{
    return crypto_box_SECRETKEYBYTES;
}

size_t
crypto_box_beforenmbytes(void)
{
    return crypto_box_BEFORENMBYTES;
}

size_t
crypto_box_noncebytes(void)
{
    return crypto_box_NONCEBYTES;
}

size_t
crypto_box_zerobytes(void)
{
    return crypto_box_ZEROBYTES;
}

size_t
crypto_box_boxzerobytes(void)
{
    return crypto_box_BOXZEROBYTES;
}

size_t
crypto_box_macbytes(void)
{
    return crypto_box_MACBYTES;
}

const char *
crypto_box_primitive(void)
{
    return crypto_box_PRIMITIVE;
}

int
crypto_box_seed_keypair(unsigned char *pk, unsigned char *sk,
                        const unsigned char *seed)
{
    return crypto_box_curve25519xsalsa20poly1305_seed_keypair(pk, sk, seed);
}

int
crypto_box_keypair(unsigned char *pk, unsigned char *sk)
{
    return crypto_box_curve25519xsalsa20poly1305_keypair(pk, sk);
}

int
crypto_box_beforenm(unsigned char *k, const unsigned char *pk,
                    const unsigned char *sk)
{
    return crypto_box_curve25519xsalsa20poly1305_beforenm(k, pk, sk);
}

int
crypto_box_afternm(unsigned char *c, const unsigned char *m,
                   unsigned long long mlen, const unsigned char *n,
                   const unsigned char *k)
{
    return crypto_box_curve25519xsalsa20poly1305_afternm(c, m, mlen, n, k);
}

int
crypto_box_open_afternm(unsigned char *m, const unsigned char *c,
                        unsigned long long clen, const unsigned char *n,
                        const unsigned char *k)
{
    return crypto_box_curve25519xsalsa20poly1305_open_afternm(m, c, clen, n, k);
}

int
crypto_box(unsigned char *c, const unsigned char *m,
           unsigned long long mlen, const unsigned char *n,
           const unsigned char *pk, const unsigned char *sk)
{
    return crypto_box_curve25519xsalsa20poly1305(c, m, mlen, n, pk, sk);
}

int
crypto_box_open(unsigned char *m, const unsigned char *c,
                unsigned long long clen, const unsigned char *n,
                const unsigned char *pk, const unsigned char *sk)
{
    return crypto_box_curve25519xsalsa20poly1305_open(m, c, clen, n, pk, sk);
}