Branch: Tag:

2017-07-19

2017-07-19 18:15:19 by Martin Nilsson <nilsson@fastmail.com>

3-5 times faster pbkdf2 for SHA1 and SHA256

25:    hash->meta = &cmod_CONCAT_EVAL(nettle_, NETTLE_NAME);    }    + #ifdef SPECIAL_PBKDF2 +  PIKEFUN string pbkdf2(string(8bit) password, string(8bit) salt, +  int rounds, int bytes) +  { +  struct pike_string *dst = begin_shared_string(bytes); +  NO_WIDE_STRING(password); +  NO_WIDE_STRING(salt); +  cmod_CONCAT_EVAL(pbkdf2_hmac_,NETTLE_NAME)(password->len, +  (const uint8_t *)password->str, +  rounds, +  salt->len, +  (const uint8_t *)salt->str, +  bytes, +  (uint8_t *)dst->str); +  push_string(end_shared_string(dst)); +  } + #endif +     DOCSTART() @class State    *!    *! State for PIKE_NAME hashing.