Justus Winter <[email protected]> writes:

> What happens if that restriction is violated?  As the function cannot
> signal an error, does it lead to silent corruption of the data stream?
> Or does it assert that restriction?

It triggers an assert. Likewise, if you call gcm_update after
gcm_encrypt that also triggers an assert. While I think (without
checking the code closely) an invalid mix of gcm_encrypt and gcm_decrypt
will just result in a garbage digest.

So if you want the bindings to report errors in some friendler way on
misuse, you'd need to keep track of the state of the context and check
that each call is appropriate for the current state.
 
Regards,
/Niels

-- 
Niels Möller. PGP key CB4962D070D77D7FCB8BA36271D8F1FF368C6677.
Internet email is subject to wholesale government surveillance.
_______________________________________________
nettle-bugs mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to