cryptography
cryptography copied to clipboard
asn1: Add `SIZE` support to `BIT STRING`
Similar to https://github.com/pyca/cryptography/pull/13899, this PR extends the support for SIZE to BIT STRING
The logic to check the size constraint is moved to its own function (check_size_constraint()), so that it can be reused by all types that support SIZE annotations.
I've also moved the existing tests for SIZE to their own class.
Part of https://github.com/pyca/cryptography/issues/12283