libsec: generalize pbkdf2_hmac_sha1() to pbkdf2_x() passing the hmac as an argument

This commit is contained in:
cinap_lenrek 2015-09-02 11:28:11 +02:00
parent 4c52aedfe9
commit b749f36baa
4 changed files with 21 additions and 14 deletions

View file

@ -454,12 +454,13 @@ mpint* dh_new(DHstate *dh, mpint *p, mpint *q, mpint *g);
/* calculate shared key: k = y**x % p */
mpint* dh_finish(DHstate *dh, mpint *y);
/* password-based key derivation function 2 (RFC 2898) */
void pbkdf2_hmac_sha1(uchar *p, ulong plen, uchar *s, ulong slen, ulong rounds, uchar *d, ulong dlen);
/* Curve25519 elliptic curve, public key function */
void curve25519(uchar mypublic[32], uchar secret[32], uchar basepoint[32]);
/* Curve25519 diffie hellman */
void curve25519_dh_new(uchar x[32], uchar y[32]);
void curve25519_dh_finish(uchar x[32], uchar y[32], uchar z[32]);
/* password-based key derivation function 2 (rfc2898) */
void pbkdf2_x(uchar *p, ulong plen, uchar *s, ulong slen, ulong rounds, uchar *d, ulong dlen,
DigestState* (*x)(uchar*, ulong, uchar*, ulong, uchar*, DigestState*), int xlen);