13 #ifndef SCRAM_COMMON_H
14 #define SCRAM_COMMON_H
20 #define SCRAM_SHA_256_NAME "SCRAM-SHA-256"
21 #define SCRAM_SHA_256_PLUS_NAME "SCRAM-SHA-256-PLUS"
24 #define SCRAM_SHA_256_KEY_LEN PG_SHA256_DIGEST_LENGTH
30 #define SCRAM_MAX_KEY_LEN SCRAM_SHA_256_KEY_LEN
37 #define SCRAM_RAW_NONCE_LEN 18
44 #define SCRAM_DEFAULT_SALT_LEN 16
50 #define SCRAM_SHA_256_DEFAULT_ITERATIONS 4096
55 uint8 *result,
const char **errstr);
57 int key_length,
uint8 *result,
61 uint8 *result,
const char **errstr);
64 uint8 *result,
const char **errstr);
68 const char *
password,
const char **errstr);
int scram_ServerKey(const uint8 *salted_password, pg_cryptohash_type hash_type, int key_length, uint8 *result, const char **errstr)
int scram_SaltedPassword(const char *password, pg_cryptohash_type hash_type, int key_length, const char *salt, int saltlen, int iterations, uint8 *result, const char **errstr)
int scram_ClientKey(const uint8 *salted_password, pg_cryptohash_type hash_type, int key_length, uint8 *result, const char **errstr)
char * scram_build_secret(pg_cryptohash_type hash_type, int key_length, const char *salt, int saltlen, int iterations, const char *password, const char **errstr)
int scram_H(const uint8 *input, pg_cryptohash_type hash_type, int key_length, uint8 *result, const char **errstr)