make configurable kdf to match hash, add a bunch of tests