![]() |
Nilorea Library
C utilities for networking, threading, graphics
|
#include <stdio.h>#include <stdlib.h>#include <string.h>#include <unistd.h>#include "nilorea/n_common.h"#include "nilorea/n_log.h"#include "nilorea/n_sha256.h"Go to the source code of this file.
Functions | |
| static void | expect_true (const char *what, int ok) |
| count a failed check | |
| static int | hex_is (const void *data, size_t len, const char *want) |
| the hex digest of a buffer equals the expected one | |
| int | main (int argc, char **argv) |
| run the checks | |
| static int | process_args (int argc, char **argv) |
| read -V | |
Variables | |
| static int | failures = 0 |
| failed checks | |
| static int | log_level = 3 |
| log level from -V | |
|
static |
|
static |
the hex digest of a buffer equals the expected one
| data | the bytes |
| len | how many |
| want | expected lowercase hex |
Definition at line 77 of file ex_sha256.c.
References n_sha256(), n_sha256_hex(), N_SHA256_HEX_LEN, and N_SHA256_LEN.
Referenced by main().
| int main | ( | int | argc, |
| char ** | argv ) |
run the checks
| argc | argument count |
| argv | arguments |
Definition at line 90 of file ex_sha256.c.
References done, expect_true(), failures, hex_is(), LOG_ERR, log_level, n_sha256(), n_sha256_file(), n_sha256_final(), n_sha256_init(), N_SHA256_LEN, n_sha256_update(), process_args(), and set_log_level().
|
static |
read -V
| argc | argument count |
| argv | arguments |
Definition at line 59 of file ex_sha256.c.
References log_level.
|
static |
failed checks
Definition at line 41 of file ex_sha256.c.
|
static |
log level from -V
Definition at line 39 of file ex_sha256.c.