-libcrypto.PKCS5_PBKDF2_HMAC.argtypes=(c_char_p,c_int,c_char_p,c_int,c_int,
- c_void_p,c_int,c_char_p)
-libcrypto.PKCS5_PBKDF2_HMAC.restupe=c_int
+ @returns outlen bytes of key material derived from password and salt
+ """
+ dgst = DigestType(digesttype)
+ out = create_string_buffer(outlen)
+ res = libcrypto.PKCS5_PBKDF2_HMAC(password, len(password), salt, len(salt),
+ iterations, dgst.digest, outlen, out)
+ if res <= 0:
+ raise LibCryptoError("error computing PBKDF2")
+ return out.raw
+
+libcrypto.PKCS5_PBKDF2_HMAC.argtypes = (c_char_p, c_int, c_char_p, c_int, c_int,
+ c_void_p, c_int, c_char_p)
+libcrypto.PKCS5_PBKDF2_HMAC.restupe = c_int