#ifdef PKCS_1
enum
ltc_pkcs_1_v1_5_blocks
{
LTC_PKCS_1_EMSA = 1,
LTC_PKCS_1_EME = 2
};
enum
ltc_pkcs_1_paddings
{
LTC_PKCS_1_V1_5 = 1,
LTC_PKCS_1_OAEP = 2,
LTC_PKCS_1_PSS = 3
};
int
pkcs_1_mgf1(
int
hash_idx,
const
unsigned
char
*seed, unsigned
long
seedlen,
unsigned
char
*mask, unsigned
long
masklen);
int
pkcs_1_i2osp(
void
*n, unsigned
long
modulus_len, unsigned
char
*out);
int
pkcs_1_os2ip(
void
*n, unsigned
char
*in, unsigned
long
inlen);
int
pkcs_1_v1_5_encode(
const
unsigned
char
*msg,
unsigned
long
msglen,
int
block_type,
unsigned
long
modulus_bitlen,
prng_state *prng,
int
prng_idx,
unsigned
char
*out,
unsigned
long
*outlen);
int
pkcs_1_v1_5_decode(
const
unsigned
char
*msg,
unsigned
long
msglen,
int
block_type,
unsigned
long
modulus_bitlen,
unsigned
char
*out,
unsigned
long
*outlen,
int
*is_valid);
int
pkcs_1_oaep_encode(
const
unsigned
char
*msg, unsigned
long
msglen,
const
unsigned
char
*lparam, unsigned
long
lparamlen,
unsigned
long
modulus_bitlen, prng_state *prng,
int
prng_idx,
int
hash_idx,
unsigned
char
*out, unsigned
long
*outlen);
int
pkcs_1_oaep_decode(
const
unsigned
char
*msg, unsigned
long
msglen,
const
unsigned
char
*lparam, unsigned
long
lparamlen,
unsigned
long
modulus_bitlen,
int
hash_idx,
unsigned
char
*out, unsigned
long
*outlen,
int
*res);
int
pkcs_1_pss_encode(
const
unsigned
char
*msghash, unsigned
long
msghashlen,
unsigned
long
saltlen, prng_state *prng,
int
prng_idx,
int
hash_idx,
unsigned
long
modulus_bitlen,
unsigned
char
*out, unsigned
long
*outlen);
int
pkcs_1_pss_decode(
const
unsigned
char
*msghash, unsigned
long
msghashlen,
const
unsigned
char
*sig, unsigned
long
siglen,
unsigned
long
saltlen,
int
hash_idx,
unsigned
long
modulus_bitlen,
int
*res);
#endif /* PKCS_1 */
#ifdef PKCS_5
int
pkcs_5_alg1(
const
unsigned
char
*password, unsigned
long
password_len,
const
unsigned
char
*salt,
int
iteration_count,
int
hash_idx,
unsigned
char
*out, unsigned
long
*outlen);
int
pkcs_5_alg2(
const
unsigned
char
*password, unsigned
long
password_len,
const
unsigned
char
*salt, unsigned
long
salt_len,
int
iteration_count,
int
hash_idx,
unsigned
char
*out, unsigned
long
*outlen);
#endif /* PKCS_5 */