|
Boost : |
From: Andrey Semashev (andrey.semashev_at_[hidden])
Date: 2024-12-07 01:48:49
On 12/7/24 04:29, Vinnie Falco via Boost wrote:
>
> I propose to change HashAlgorithm requirements as follows:
>
> ---
> HashAlgorithm result() is renamed to
>
> result_type finalize();
>
> The current documentation for finalize [1] is moved elsewhere and replaced
> with the following text:
>
> This function shall return the final hash value of the input message,
> where the input message is defined by the ordered sequence of bytes
> provided in all prior calls to update(). The behavior of subsequent calls
> to finalize()
...and update()...
> is undefined unless specified by the HashAlgorithm.
With the above amendment, I agree.
> We should use the more strict definition I
> provided above for now, and only in the future loosen the definition if
> there is evidence that doing so yields a net benefit. It is always easier
> to go from strict to loose.
I believe, the change is in the opposite direction, i.e. the behavior is
more loosely defined after the change (UB) than before it (valid call,
returns new data). But other than that, I agree.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk