Jpp
18.0.1-rc.2
the software that should make you happy
|
#include <errno.h>
#include <limits.h>
#include <stdint.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/param.h>
#include <sys/types.h>
Go to the source code of this file.
Classes | |
struct | sha256_ctx |
Macros | |
#define | MAX(x, y) ((x)>(y)?(x):(y)) |
#define | MIN(x, y) ((x)<(y)?(x):(y)) |
#define | SWAP(n) (((n) << 24) | (((n) & 0xff00) << 8) | (((n) >> 8) & 0xff00) | ((n) >> 24)) |
#define | Ch(x, y, z) ((x & y) ^ (~x & z)) |
#define | Maj(x, y, z) ((x & y) ^ (x & z) ^ (y & z)) |
#define | S0(x) (CYCLIC (x, 2) ^ CYCLIC (x, 13) ^ CYCLIC (x, 22)) |
#define | S1(x) (CYCLIC (x, 6) ^ CYCLIC (x, 11) ^ CYCLIC (x, 25)) |
#define | R0(x) (CYCLIC (x, 7) ^ CYCLIC (x, 18) ^ (x >> 3)) |
#define | R1(x) (CYCLIC (x, 17) ^ CYCLIC (x, 19) ^ (x >> 10)) |
#define | CYCLIC(w, s) ((w >> s) | (w << (32 - s))) |
#define | UNALIGNED_P(p) (((uintptr_t) p) % sizeof (uint32_t) != 0) |
#define | SALT_LEN_MAX 16 |
#define | ROUNDS_DEFAULT 5000 |
#define | ROUNDS_MIN 1000 |
#define | ROUNDS_MAX 999999999 |
#define | b64_from_24bit(B2, B1, B0, N) |
Functions | |
static void | sha256_process_block (const void *buffer, size_t len, struct sha256_ctx *ctx) |
static void | sha256_init_ctx (struct sha256_ctx *ctx) |
static void * | sha256_finish_ctx (struct sha256_ctx *ctx, void *resbuf) |
static void | sha256_process_bytes (const void *buffer, size_t len, struct sha256_ctx *ctx) |
static char * | sha256_crypt_r (const char *key, const char *salt, char *buffer, int buflen) |
char * | sha256_crypt (const char *key, const char *salt) |
Variables | |
static const unsigned char | fillbuf [64] = { 0x80, 0 } |
static const uint32_t | K [64] |
static const char | sha256_salt_prefix [] = "$5$" |
static const char | sha256_rounds_prefix [] = "rounds=" |
static const char | b64t [65] = "./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" |
#define Ch | ( | x, | |
y, | |||
z | |||
) | ((x & y) ^ (~x & z)) |
#define Maj | ( | x, | |
y, | |||
z | |||
) | ((x & y) ^ (x & z) ^ (y & z)) |
#define CYCLIC | ( | w, | |
s | |||
) | ((w >> s) | (w << (32 - s))) |
#define UNALIGNED_P | ( | p | ) | (((uintptr_t) p) % sizeof (uint32_t) != 0) |
#define b64_from_24bit | ( | B2, | |
B1, | |||
B0, | |||
N | |||
) |
|
static |
Definition at line 99 of file crypt.cc.
|
static |
|
static |
Definition at line 217 of file crypt.cc.
|
static |
Definition at line 247 of file crypt.cc.
|
static |
Definition at line 327 of file crypt.cc.
char* sha256_crypt | ( | const char * | key, |
const char * | salt | ||
) |
Definition at line 573 of file crypt.cc.
|
static |