}
/* bytes to existing buffer */
memset(out.ptr, 0, out.len);
+ if (vector->stateful)
+ {
+ prf->set_key(prf, key);
+ }
prf->get_bytes(prf, seed, out.ptr);
if (!memeq(vector->out, out.ptr, out.len))
{
if (seed.len > 2)
{
memset(out.ptr, 0, out.len);
+ if (vector->stateful)
+ {
+ prf->set_key(prf, key);
+ }
prf->allocate_bytes(prf, chunk_create(seed.ptr, 1), NULL);
prf->get_bytes(prf, chunk_create(seed.ptr + 1, 1), NULL);
prf->get_bytes(prf, chunk_skip(seed, 2), out.ptr);
struct prf_test_vector_t {
/** prf algorithm this test vector tests */
pseudo_random_function_t alg;
+ /** is this PRF stateful? */
+ bool stateful;
/** key length to use, in bytes */
size_t key_size;
/** key to use */