MCCI TweetNaCl
TweetNaCl library adapted for embedded use
mcci_tweetnacl.h File Reference
#include <stdbool.h>
#include <stdlib.h>
+ Include dependency graph for mcci_tweetnacl.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define _mcci_tweetnacl_h_   /* prevent multiple includes */
 

Typedefs

typedef mcci_tweetnacl_randombytes_error_t() mcci_tweetnacl_randombytes_fn_t(mcci_tweetnacl_randombytes_handle_t hDriver, unsigned char *pOutBuffer, size_t nBuffer)
 symbolic type for function implementing local random-number generator More...
 
typedef struct mcci_tweetnacl_randombytes_driver_s * mcci_tweetnacl_randombytes_handle_t
 abstract type for randombytes driver context More...
 
typedef int mcci_tweetnacl_result_t
 symbolic type for result of TweetNaCl primitives More...
 

Enumerations

enum  mcci_tweetnacl_randombytes_error_t {
  MCCI_TWEETNACL_RANDOMBYTES_ERROR_SUCCESS = 0, MCCI_TWEETNACL_RANDOMBYTES_ERROR_UNKNOWN = 1, MCCI_TWEETNACL_RANDOMBYTES_ERROR_NOT_INITIALIZED = 2, MCCI_TWEETNACL_RANDOMBYTES_ERROR_INVALID_PARAMETER = 3,
  MCCI_TWEETNACL_RANDOMBYTES_ERROR_CRYPTO_API_FAILED = 4
}
 error codes from mcci_tweetnacl_randombytes_fn_t implementations errors More...
 
enum  mcci_tweetnacl_result_e { MCCI_TWEETNACL_RESULT_SUCCESS, MCCI_TWEETNACL_RESULT_FAILED = -1 }
 result codes for TweetNaCl primitives More...
 

Functions

mcci_tweetnacl_result_t mcci_tweetnacl_configure_randombytes (mcci_tweetnacl_randombytes_fn_t *pRandomBytesFn, mcci_tweetnacl_randombytes_handle_t hDriver)
 setup the random number generator connection More...
 
mcci_tweetnacl_randombytes_error_t mcci_tweetnacl_hal_randombytes_getlasterror (void)
 Get the last error reported in the randombytes() mechanism. More...
 
void mcci_tweetnacl_hal_randombytes_setlasterror (mcci_tweetnacl_randombytes_error_t lastError)
 Change the last error cell for the randombytes() mechanism. More...
 
static bool mcci_tweetnacl_result_is_success (mcci_tweetnacl_result_t resultCode)
 check whether an API result code indicates succcess More...
 
static mcci_tweetnacl_result_t mcci_tweetnacl_verify_16 (const unsigned char *x, const unsigned char *y)
 Compare two 16-byte buffers, in a time-invariant fashion. More...
 
static mcci_tweetnacl_result_t mcci_tweetnacl_verify_32 (const unsigned char *x, const unsigned char *y)
 Compare two 32-byte buffers, in a time-invariant fashion. More...
 
static mcci_tweetnacl_result_t mcci_tweetnacl_verify_64 (const unsigned char *x, const unsigned char *y)
 Compare two 64-byte buffers, in a time-invariant fashion. More...
 

Macro Definition Documentation

◆ _mcci_tweetnacl_h_

#define _mcci_tweetnacl_h_   /* prevent multiple includes */

Definition at line 24 of file mcci_tweetnacl.h.