-/* $OpenBSD: e_chacha.c,v 1.4 2014/07/10 22:45:57 jsing Exp $ */
+/* $OpenBSD: e_chacha.c,v 1.5 2014/08/04 04:16:11 miod Exp $ */
/*
* Copyright (c) 2014 Joel Sing <jsing@openbsd.org>
*
{
ChaCha_set_key((ChaCha_ctx *)ctx->cipher_data, key,
EVP_CIPHER_CTX_key_length(ctx) * 8);
- ChaCha_set_iv((ChaCha_ctx *)ctx->cipher_data, iv, NULL);
+ if (iv != NULL)
+ ChaCha_set_iv((ChaCha_ctx *)ctx->cipher_data, iv, NULL);
return 1;
}
-/* $OpenBSD: e_chacha.c,v 1.4 2014/07/10 22:45:57 jsing Exp $ */
+/* $OpenBSD: e_chacha.c,v 1.5 2014/08/04 04:16:11 miod Exp $ */
/*
* Copyright (c) 2014 Joel Sing <jsing@openbsd.org>
*
{
ChaCha_set_key((ChaCha_ctx *)ctx->cipher_data, key,
EVP_CIPHER_CTX_key_length(ctx) * 8);
- ChaCha_set_iv((ChaCha_ctx *)ctx->cipher_data, iv, NULL);
+ if (iv != NULL)
+ ChaCha_set_iv((ChaCha_ctx *)ctx->cipher_data, iv, NULL);
return 1;
}