Security Scol plugin
naclite.h
Go to the documentation of this file.
1// naclite.h - written and placed in the public domain by Jeffrey Walton
2// based on public domain NaCl source code written by
3// Daniel J. Bernstein, Bernard van Gastel, Wesley Janssen,
4// Tanja Lange, Peter Schwabe and Sjaak Smetsers.
5
6// The Tweet API was added to the Crypto++ library to cross-validate results.
7// We debated over putting it in the Test namespace, but settled for the NaCl
8// namespace to segregate it from other parts of the library.
9
49
50#ifndef CRYPTOPP_NACL_H
51#define CRYPTOPP_NACL_H
52
53#include "config.h"
54#include "stdcpp.h"
55
56#if defined(NO_OS_DEPENDENCE) || !defined(OS_RNG_AVAILABLE)
57# define CRYPTOPP_DISABLE_NACL 1
58#endif
59
60#ifndef CRYPTOPP_DISABLE_NACL
61
62NAMESPACE_BEGIN(CryptoPP)
63NAMESPACE_BEGIN(NaCl)
64
65
67CRYPTOPP_CONSTANT(crypto_hash_BYTES = 64);
68
71CRYPTOPP_CONSTANT(crypto_stream_KEYBYTES = 32);
74CRYPTOPP_CONSTANT(crypto_stream_NONCEBYTES = 24);
75
78CRYPTOPP_CONSTANT(crypto_auth_KEYBYTES = 32);
81CRYPTOPP_CONSTANT(crypto_auth_BYTES = 16);
82
85CRYPTOPP_CONSTANT(crypto_onetimeauth_KEYBYTES = 32);
88CRYPTOPP_CONSTANT(crypto_onetimeauth_BYTES = 16);
89
92CRYPTOPP_CONSTANT(crypto_secretbox_KEYBYTES = 32);
95CRYPTOPP_CONSTANT(crypto_secretbox_NONCEBYTES = 24);
98CRYPTOPP_CONSTANT(crypto_secretbox_ZEROBYTES = 32);
101CRYPTOPP_CONSTANT(crypto_secretbox_BOXZEROBYTES = 16);
102
105CRYPTOPP_CONSTANT(crypto_box_SECRETKEYBYTES = 32);
108CRYPTOPP_CONSTANT(crypto_box_PUBLICKEYBYTES = 32);
111CRYPTOPP_CONSTANT(crypto_box_NONCEBYTES = 24);
114CRYPTOPP_CONSTANT(crypto_box_ZEROBYTES = 32);
117CRYPTOPP_CONSTANT(crypto_box_BOXZEROBYTES = 16);
120CRYPTOPP_CONSTANT(crypto_box_BEFORENMBYTES = 32);
125CRYPTOPP_CONSTANT(crypto_box_MACBYTES = 16);
126
129CRYPTOPP_CONSTANT(crypto_sign_SECRETKEYBYTES = 64);
132CRYPTOPP_CONSTANT(crypto_sign_PUBLICKEYBYTES = 32);
135CRYPTOPP_CONSTANT(crypto_sign_SEEDBYTES = 32);
138CRYPTOPP_CONSTANT(crypto_sign_BYTES = 64);
139
142CRYPTOPP_CONSTANT(crypto_scalarmult_BYTES = 32);
145CRYPTOPP_CONSTANT(crypto_scalarmult_SCALARBYTES = 32);
146
158int crypto_box(byte *c,const byte *m,word64 d,const byte *n,const byte *y,const byte *x);
159
171int crypto_box_open(byte *m,const byte *c,word64 d,const byte *n,const byte *y,const byte *x);
172
179int crypto_box_keypair(byte *y,byte *x);
180
190int crypto_box_beforenm(byte *k,const byte *y,const byte *x);
191
204int crypto_box_afternm(byte *c,const byte *m,word64 d,const byte *n,const byte *k);
205
218int crypto_box_open_afternm(byte *m,const byte *c,word64 d,const byte *n,const byte *k);
219
242int crypto_box_unchecked(byte *c,const byte *m,word64 d,const byte *n,const byte *y,const byte *x);
243
266int crypto_box_open_unchecked(byte *m,const byte *c,word64 d,const byte *n,const byte *y,const byte *x);
267
288int crypto_box_beforenm_unchecked(byte *k,const byte *y,const byte *x);
289
291int crypto_core_salsa20(byte *out,const byte *in,const byte *k,const byte *c);
292
296int crypto_core_hsalsa20(byte *out,const byte *in,const byte *k,const byte *c);
297
303int crypto_hashblocks(byte *x,const byte *m,word64 n);
304
310int crypto_hash(byte *out,const byte *m,word64 n);
311
317int crypto_onetimeauth(byte *out,const byte *m,word64 n,const byte *k);
318
323int crypto_onetimeauth_verify(const byte *h,const byte *m,word64 n,const byte *k);
324
330int crypto_scalarmult(byte *q,const byte *n,const byte *p);
331
337int crypto_scalarmult_base(byte *q,const byte *n);
338
344int crypto_secretbox(byte *c,const byte *m,word64 d,const byte *n,const byte *k);
345
350int crypto_secretbox_open(byte *m,const byte *c,word64 d,const byte *n,const byte *k);
351
362int crypto_sign(byte *sm,word64 *smlen,const byte *m,word64 n,const byte *sk);
363
373int crypto_sign_open(byte *m,word64 *mlen,const byte *sm,word64 n,const byte *pk);
374
382int crypto_sign_keypair(byte *pk, byte *sk);
383
395int crypto_sign_sk2pk(byte *pk, const byte *sk);
396
402int crypto_stream(byte *c,word64 d,const byte *n,const byte *k);
403
408int crypto_stream_xor(byte *c,const byte *m,word64 d,const byte *n,const byte *k);
409
414int crypto_stream_salsa20(byte *c,word64 d,const byte *n,const byte *k);
415
420int crypto_stream_salsa20_xor(byte *c,const byte *m,word64 b,const byte *n,const byte *k);
421
426int crypto_verify_16(const byte *x,const byte *y);
427
432int crypto_verify_32(const byte *x,const byte *y);
433
434NAMESPACE_END // CryptoPP
435NAMESPACE_END // NaCl
436
437#endif // CRYPTOPP_DISABLE_NACL
438#endif // CRYPTOPP_NACL_H
Library configuration file.
Common C++ header files.