![]() |
Nilorea Library
C utilities for networking, threading, graphics
|
#include "nilorea/n_common.h"#include "nilorea/n_digest.h"#include "nilorea/n_hex.h"#include "nilorea/n_log.h"#include "nilorea/n_str.h"#include <stdio.h>#include <string.h>Go to the source code of this file.
Functions | |
| static void | expect_hex (const unsigned char *digest, size_t len, const char *want, const char *label) |
| int | main (int argc, char **argv) |
| void | process_args (int argc, char **argv) |
| static void | test_aead (void) |
| static void | test_aead_chacha (void) |
| static void | test_consttime (void) |
| static void | test_digests (void) |
| static void | test_errors (void) |
| static void | test_hmac (void) |
| static void | test_hmac_variants (void) |
| static void | test_kdf (void) |
| static void | test_pbkdf2 (void) |
| static void | test_sha256_hex (void) |
Variables | |
| static int | failures = 0 |
|
static |
Definition at line 71 of file ex_digest.c.
References N_STR::data, failures, free_nstr, LOG_ERR, n_hex_encode(), and n_log.
Referenced by test_aead(), test_aead_chacha(), test_digests(), test_hmac(), test_hmac_variants(), test_kdf(), and test_pbkdf2().
| int main | ( | int | argc, |
| char ** | argv ) |
Definition at line 392 of file ex_digest.c.
References failures, LOG_ERR, LOG_NOTICE, n_log, process_args(), set_log_level(), test_aead(), test_aead_chacha(), test_consttime(), test_digests(), test_errors(), test_hmac(), test_hmac_variants(), test_kdf(), test_pbkdf2(), and test_sha256_hex().
| void process_args | ( | int | argc, |
| char ** | argv ) |
Definition at line 39 of file ex_digest.c.
References LOG_DEBUG, LOG_ERR, LOG_INFO, LOG_NOTICE, LOG_NULL, and set_log_level().
|
static |
Definition at line 241 of file ex_digest.c.
References expect_hex(), failures, key, n_aead_aes256gcm_decrypt(), n_aead_aes256gcm_encrypt(), N_AEAD_AES256GCM_KEY_LEN, and N_AEAD_AES256GCM_TAG_LEN.
Referenced by main().
|
static |
Definition at line 290 of file ex_digest.c.
References expect_hex(), failures, key, LOG_NOTICE, n_aead_chacha20poly1305_decrypt(), n_aead_chacha20poly1305_encrypt(), N_AEAD_CHACHA20POLY1305_KEY_LEN, N_AEAD_CHACHA20POLY1305_TAG_LEN, and n_log.
Referenced by main().
|
static |
Definition at line 199 of file ex_digest.c.
References failures, and n_digest_consttime_equal().
Referenced by main().
|
static |
Definition at line 85 of file ex_digest.c.
References expect_hex(), failures, LOG_NOTICE, n_digest_blake2b512(), N_DIGEST_BLAKE2B512_LEN, n_digest_md5(), N_DIGEST_MD5_LEN, n_digest_sha1(), N_DIGEST_SHA1_LEN, n_digest_sha256(), N_DIGEST_SHA256_LEN, n_digest_sha384(), N_DIGEST_SHA384_LEN, n_digest_sha512(), N_DIGEST_SHA512_LEN, and n_log.
Referenced by main().
|
static |
Definition at line 343 of file ex_digest.c.
References failures, LOG_ERR, n_digest_sha256(), N_DIGEST_SHA256_LEN, n_hmac_sha256(), and n_log.
Referenced by main().
|
static |
Definition at line 157 of file ex_digest.c.
References expect_hex(), failures, key, LOG_ERR, N_DIGEST_SHA256_LEN, n_hmac_sha256(), and n_log.
Referenced by main().
|
static |
Definition at line 170 of file ex_digest.c.
References expect_hex(), failures, key, N_DIGEST_SHA1_LEN, N_DIGEST_SHA384_LEN, N_DIGEST_SHA512_LEN, n_hmac_sha1(), n_hmac_sha384(), and n_hmac_sha512().
Referenced by main().
|
static |
Definition at line 364 of file ex_digest.c.
References expect_hex(), failures, LOG_NOTICE, n_kdf_hkdf_sha256(), n_kdf_scrypt(), and n_log.
Referenced by main().
|
static |
Definition at line 212 of file ex_digest.c.
References expect_hex(), failures, n_pbkdf2_hmac_sha1(), and n_pbkdf2_hmac_sha256().
Referenced by main().
|
static |
Definition at line 140 of file ex_digest.c.
References N_STR::data, failures, free_nstr, LOG_ERR, n_digest_sha256_hex(), and n_log.
Referenced by main().
|
static |
Definition at line 36 of file ex_digest.c.