<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">We’re only starting out, so there isn’t any issue yet.  I am wondering if instead of terminating out OSSL_PARAM arrays with an empty element, would it make sense to pass a size and the array?<div class=""><br class=""></div><div class="">I.e. changing this code sequence (from crypto/evp/digest.c):</div><div class=""><br class=""></div><div class=""><div class=""><font face="Courier New" class="">    params[i++] = OSSL_PARAM_construct_size_t(OSSL_DIGEST_PARAM_XOFLEN,</font></div><div class=""><font face="Courier New" class="">                                              &size, NULL);</font></div><div class=""><font face="Courier New" class="">    params[i++] = OSSL_PARAM_construct_end();</font></div><div class=""><font face="Courier New" class="">    EVP_MD_CTX_set_params(ctx, params);</font></div><div class=""><br class=""></div><div class="">into:</div><div class=""><br class=""></div><div class=""><div class=""><font face="Courier New" class="">    params[i++] = OSSL_PARAM_construct_size_t(OSSL_DIGEST_PARAM_XOFLEN,</font></div><div class=""><font face="Courier New" class="">                                              &size, NULL);</font></div><div class=""><font face="Courier New" class="">    EVP_MD_CTX_set_params(ctx, i, params);</font></div></div><div class=""><br class=""></div><div class="">For fixed arrays OSSL_NELEM would be used instead of the counter variable.</div><div class=""><br class=""></div><div class=""><div class="">There are downsides with both approaches of course and neither jumps out as being obviously superior.</div></div><div class=""><br class=""></div><div class="">To me, at least, it looks like we’re going to have a lot of END’s throughout the codebase.  Saving one line many times seems like a win.</div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">Pauli</div><div class=""><div class=""><div>-- <br class="">Dr Paul Dale | Cryptographer | Network Security & Encryption <br class="">Phone +61 7 3031 7217<br class="">Oracle Australia</div><div><br class=""></div><br class="Apple-interchange-newline">

</div>
<br class=""></div></div></body></html>