28#ifndef CRYPT_HASHGEN_IMPL_H
29#define CRYPT_HASHGEN_IMPL_H
30#define ROUNDS_DEFAULT 5000
31#define ROUNDS_MIN ROUNDS_DEFAULT
32#define ROUNDS_MAX (0xFFF * 1000)
34#define CRYPT_SALT_LENGTH 20
35#define CRYPT_MAGIC_LENGTH 3
36#define CRYPT_PARAM_LENGTH 13
37#define SHA256_HASH_LENGTH 43
38#define CRYPT_MAX_PASSWORD_SIZE \
39 (CRYPT_SALT_LENGTH + SHA256_HASH_LENGTH + CRYPT_MAGIC_LENGTH + \
41#define MAX_PLAINTEXT_LENGTH 256
48char *
my_crypt_genhash(
char *ctbuffer,
size_t ctbufflen,
const char *plaintext,
49 size_t plaintext_len,
const char *switchsalt,
50 const char **params,
unsigned int *num_rounds =
nullptr);
52void xor_string(
char *to,
int to_len,
char *pattern,
int pattern_len);
void my_make_scrambled_password(char *to, const char *password, size_t pass_len)
Definition: crypt_genhash_impl.cc:445
void xor_string(char *to, int to_len, char *pattern, int pattern_len)
Definition: crypt_genhash_impl.cc:436
void generate_user_salt(char *buffer, int buffer_len)
Generate a random string using ASCII characters but avoid separator character.
Definition: crypt_genhash_impl.cc:423
char * my_crypt_genhash(char *ctbuffer, size_t ctbufflen, const char *plaintext, size_t plaintext_len, const char *switchsalt, const char **params, unsigned int *num_rounds=nullptr)
Definition: crypt_genhash_impl.cc:236
int extract_user_salt(const char **salt_begin, const char **salt_end)
Finds the interval which envelopes the user salt in a crypt password The crypt format is assumed to b...
Definition: crypt_genhash_impl.cc:188
static char * password
Definition: mysql_secure_installation.cc:58
mutable_buffer buffer(void *p, size_t n) noexcept
Definition: buffer.h:418