diff options
author | cinap_lenrek <cinap_lenrek@felloff.net> | 2016-07-10 21:41:57 +0200 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@felloff.net> | 2016-07-10 21:41:57 +0200 |
commit | 1492f46f87b0a79cc4a2a2dadb16c1c1911c097c (patch) | |
tree | 5282730d82830026005a97b87de4e550a80ce498 /sys/include | |
parent | 677dd90b029cc7e11020af220bbcdd2f6028db45 (diff) |
libsec: add scrypt password based key derivation function
Diffstat (limited to 'sys/include')
-rw-r--r-- | sys/include/ape/libsec.h | 7 | ||||
-rw-r--r-- | sys/include/libsec.h | 7 |
2 files changed, 14 insertions, 0 deletions
diff --git a/sys/include/ape/libsec.h b/sys/include/ape/libsec.h index b4fde5256..8c7fb7c23 100644 --- a/sys/include/ape/libsec.h +++ b/sys/include/ape/libsec.h @@ -154,6 +154,8 @@ void salsa_setblock(Salsastate*, u64int); void salsa_encrypt(uchar*, ulong, Salsastate*); void salsa_encrypt2(uchar*, uchar*, ulong, Salsastate*); +void salsa_core(u32int in[16], u32int out[16], int rounds); + void hsalsa(uchar h[32], uchar *key, ulong keylen, uchar nonce[16], int rounds); /* @@ -575,6 +577,11 @@ void curve25519_dh_finish(uchar x[32], uchar y[32], uchar z[32]); 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); +/* scrypt password-based key derivation function */ +char* scrypt(uchar *p, ulong plen, uchar *s, ulong slen, + ulong N, ulong R, ulong P, + uchar *d, ulong dlen); + /* hmac-based key derivation function (rfc5869) */ void hkdf_x(uchar *salt, ulong nsalt, uchar *info, ulong ninfo, uchar *key, ulong nkey, uchar *d, ulong dlen, DigestState* (*x)(uchar*, ulong, uchar*, ulong, uchar*, DigestState*), int xlen); diff --git a/sys/include/libsec.h b/sys/include/libsec.h index ab8f579aa..793f13845 100644 --- a/sys/include/libsec.h +++ b/sys/include/libsec.h @@ -146,6 +146,8 @@ void salsa_setblock(Salsastate*, u64int); void salsa_encrypt(uchar*, ulong, Salsastate*); void salsa_encrypt2(uchar*, uchar*, ulong, Salsastate*); +void salsa_core(u32int in[16], u32int out[16], int rounds); + void hsalsa(uchar h[32], uchar *key, ulong keylen, uchar nonce[16], int rounds); /* @@ -567,6 +569,11 @@ void curve25519_dh_finish(uchar x[32], uchar y[32], uchar z[32]); 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); +/* scrypt password-based key derivation function */ +char* scrypt(uchar *p, ulong plen, uchar *s, ulong slen, + ulong N, ulong R, ulong P, + uchar *d, ulong dlen); + /* hmac-based key derivation function (rfc5869) */ void hkdf_x(uchar *salt, ulong nsalt, uchar *info, ulong ninfo, uchar *key, ulong nkey, uchar *d, ulong dlen, DigestState* (*x)(uchar*, ulong, uchar*, ulong, uchar*, DigestState*), int xlen); |