Debian Codegraph @

src/bindings/crypto_secretstream.h

raw
1 /* Copyright 2013-2018 Donald Stufft and individual contributors
2 *
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 * http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15
16 size_t crypto_secretstream_xchacha20poly1305_abytes(void);
17 size_t crypto_secretstream_xchacha20poly1305_headerbytes(void);
18 size_t crypto_secretstream_xchacha20poly1305_keybytes(void);
19 size_t crypto_secretstream_xchacha20poly1305_messagebytes_max(void);
20
21 unsigned char crypto_secretstream_xchacha20poly1305_tag_message(void);
22 unsigned char crypto_secretstream_xchacha20poly1305_tag_push(void);
23 unsigned char crypto_secretstream_xchacha20poly1305_tag_rekey(void);
24 unsigned char crypto_secretstream_xchacha20poly1305_tag_final(void);
25
26 /*
27 * We use crypto_secretstream_xchacha20poly1305_state * as
28 * a pointer to an opaque buffer,
29 * therefore the following typedef makes sense:
30 */
31
32 typedef void crypto_secretstream_xchacha20poly1305_state;
33
34 size_t crypto_secretstream_xchacha20poly1305_statebytes(void);
35
36 void crypto_secretstream_xchacha20poly1305_keygen
37 (unsigned char *k);
38
39 int crypto_secretstream_xchacha20poly1305_init_push (crypto_secretstream_xchacha20poly1305_state *state,
40 unsigned char *header,
41 const unsigned char *k);
42
43 int crypto_secretstream_xchacha20poly1305_push
44 (crypto_secretstream_xchacha20poly1305_state *state,
45 unsigned char *c, unsigned long long *clen_p,
46 const unsigned char *m, unsigned long long mlen,
47 const unsigned char *ad, unsigned long long adlen, unsigned char tag);
48
49 int crypto_secretstream_xchacha20poly1305_init_pull
50 (crypto_secretstream_xchacha20poly1305_state *state,
51 const unsigned char *header,
52 const unsigned char *k);
53
54 int crypto_secretstream_xchacha20poly1305_pull
55 (crypto_secretstream_xchacha20poly1305_state *state,
56 unsigned char *m, unsigned long long *mlen_p, unsigned char *tag_p,
57 const unsigned char *c, unsigned long long clen,
58 const unsigned char *ad, unsigned long long adlen);
59
60 void crypto_secretstream_xchacha20poly1305_rekey
61 (crypto_secretstream_xchacha20poly1305_state *state);