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_KEY_LEN PG_SHA256_DIGEST_LENGTH 27 #define SHA256_HMAC_B PG_SHA256_BLOCK_LENGTH 34 #define SCRAM_RAW_NONCE_LEN 18 41 #define SCRAM_DEFAULT_SALT_LEN 16 47 #define SCRAM_DEFAULT_ITERATIONS 4096 63 int saltlen,
int iterations,
uint8 *result);
char * scram_build_secret(const char *salt, int saltlen, int iterations, const char *password)
int scram_H(const uint8 *str, int len, uint8 *result)
pg_cryptohash_ctx * sha256ctx
int scram_ClientKey(const uint8 *salted_password, uint8 *result)
int scram_SaltedPassword(const char *password, const char *salt, int saltlen, int iterations, uint8 *result)
int scram_HMAC_init(scram_HMAC_ctx *ctx, const uint8 *key, int keylen)
int scram_HMAC_update(scram_HMAC_ctx *ctx, const char *str, int slen)
int scram_HMAC_final(uint8 *result, scram_HMAC_ctx *ctx)
int scram_ServerKey(const uint8 *salted_password, uint8 *result)