3131from .keys import BadSignatureError
3232from .util import sigencode_der , sigencode_string
3333from .util import sigdecode_der , sigdecode_string
34- from .curves import curves
34+ from .curves import curves , SECP112r2 , SECP128r1
3535from .der import (
3636 encode_integer ,
3737 encode_bitstring ,
5555bigger than order sizes of curves."""
5656
5757
58+ if "--fast" in sys .argv : # pragma: no cover
59+ curves = [SECP112r2 , SECP128r1 ]
60+
61+
5862keys_and_sigs = []
5963"""Name of the curve+hash combination, VerifyingKey and DER signature."""
6064
@@ -91,7 +95,7 @@ def test_signatures(verifying_key, signature):
9195
9296
9397@st .composite
94- def st_fuzzed_sig (draw , keys_and_sigs ):
98+ def st_fuzzed_sig (draw , keys_and_sigs ): # pragma: no cover
9599 """
96100 Hypothesis strategy that generates pairs of VerifyingKey and malformed
97101 signatures created by fuzzing of a valid signature.
@@ -174,7 +178,7 @@ def test_fuzzed_der_signatures(args):
174178
175179
176180@st .composite
177- def st_random_der_ecdsa_sig_value (draw ):
181+ def st_random_der_ecdsa_sig_value (draw ): # pragma: no cover
178182 """
179183 Hypothesis strategy for selecting random values and encoding them
180184 to ECDSA-Sig-Value object::
@@ -220,7 +224,7 @@ def test_random_der_ecdsa_sig_value(params):
220224 verifying_key .verify (sig , example_data , sigdecode = sigdecode_der )
221225
222226
223- def st_der_integer (* args , ** kwargs ):
227+ def st_der_integer (* args , ** kwargs ): # pragma: no cover
224228 """
225229 Hypothesis strategy that returns a random positive integer as DER
226230 INTEGER.
@@ -232,7 +236,7 @@ def st_der_integer(*args, **kwargs):
232236
233237
234238@st .composite
235- def st_der_bit_string (draw , * args , ** kwargs ):
239+ def st_der_bit_string (draw , * args , ** kwargs ): # pragma: no cover
236240 """
237241 Hypothesis strategy that returns a random DER BIT STRING.
238242 Parameters are passed to hypothesis.strategy.binary.
@@ -248,23 +252,23 @@ def st_der_bit_string(draw, *args, **kwargs):
248252 return encode_bitstring (data , unused )
249253
250254
251- def st_der_octet_string (* args , ** kwargs ):
255+ def st_der_octet_string (* args , ** kwargs ): # pragma: no cover
252256 """
253257 Hypothesis strategy that returns a random DER OCTET STRING object.
254258 Parameters are passed to hypothesis.strategy.binary
255259 """
256260 return st .builds (encode_octet_string , st .binary (* args , ** kwargs ))
257261
258262
259- def st_der_null ():
263+ def st_der_null (): # pragma: no cover
260264 """
261265 Hypothesis strategy that returns DER NULL object.
262266 """
263267 return st .just (b"\x05 \x00 " )
264268
265269
266270@st .composite
267- def st_der_oid (draw ):
271+ def st_der_oid (draw ): # pragma: no cover
268272 """
269273 Hypothesis strategy that returns DER OBJECT IDENTIFIER objects.
270274 """
@@ -279,7 +283,7 @@ def st_der_oid(draw):
279283 return encode_oid (first , second , * rest )
280284
281285
282- def st_der ():
286+ def st_der (): # pragma: no cover
283287 """
284288 Hypothesis strategy that returns random DER structures.
285289
0 commit comments