switch truncate_digest_for_ecdsa to context manager

Also adds a docstring to fix #1335
1 file changed