RSASSA test vectors#

Test vectors for RSASSA.

enum crypto_condor.vectors.RSASSA.Hash(value)#

Bases: StrEnum

A list of available hash functions.

Member Type:

str

Valid values are as follows:

SHA_1 = <Hash.SHA_1: 'SHA-1'>#
SHA_224 = <Hash.SHA_224: 'SHA-224'>#
SHA_256 = <Hash.SHA_256: 'SHA-256'>#
SHA_384 = <Hash.SHA_384: 'SHA-384'>#
SHA_512 = <Hash.SHA_512: 'SHA-512'>#
SHA_512_224 = <Hash.SHA_512_224: 'SHA-512/224'>#
SHA_512_256 = <Hash.SHA_512_256: 'SHA-512/256'>#
SHA3_224 = <Hash.SHA3_224: 'SHA3-224'>#
SHA3_256 = <Hash.SHA3_256: 'SHA3-256'>#
SHA3_384 = <Hash.SHA3_384: 'SHA3-384'>#
SHA3_512 = <Hash.SHA3_512: 'SHA3-512'>#
class crypto_condor.vectors.RSASSA.RsaSigGenVectors(scheme, hash_algorithm, nist)#

Bases: object

RSA vectors for signature generation.

Do not instantiate directly, use load() instead.

Parameters:
  • scheme (Scheme) – The encryption scheme of the test vectors.

  • hash_algorithm (Hash) – The hash algorithm used to generate the vectors.

  • nist (dict[str, RsaNistSigGenVectors] | None) – A dictionary of NIST vectors or None if there are no vectors for the given parameters.

Example

Using load() to load the test vectors:

>>> from crypto_condor.vectors.RSASSA import Hash, RsaSigGenVectors, Scheme
>>> scheme = Scheme.PSS
>>> hash_algorithm = Hash.SHA_256
>>> vectors = RsaSigGenVectors.load(scheme, hash_algorithm)
classmethod load(scheme, hash_algorithm)#

Loads RSASSA signature generation test vectors.

Parameters:
  • scheme (Scheme) – The signature scheme to get vectors of.

  • hash_algorithm (Hash) – The hash algorithm used to generate the signatures.

Returns:

An instance of RsaSigGenVectors.

class crypto_condor.vectors.RSASSA.RsaSigVerVectors(scheme, hash_algorithm, nist, wycheproof)#

Bases: object

RSA vectors for signature verification.

Do not instantiate directly, use load().

Parameters:
  • scheme (Scheme) – The encryption scheme of the test vectors.

  • hash_algorithm (Hash) – The hash algorithm used to generate the vectors.

  • nist (dict[str, RsaNistSigVerVectors] | None) – A dictionary of NIST vectors or None if there are no vectors for the given parameters.

  • wycheproof (dict[str, RsaWycheproofSigVectors] | None) – A dictionary of Wycheproof vectors or None if there are no vectors for the given parameters.

Example

Using load() to load the test vectors:

>>> from crypto_condor.vectors.RSASSA import Hash, RsaSigVerVectors, Scheme
>>> scheme = Scheme.PSS
>>> hash_algorithm = Hash.SHA_256
>>> vectors = RsaSigVerVectors.load(scheme, hash_algorithm)
classmethod load(scheme, hash_algorithm)#

Loads SigVer vectors.

Parameters:
  • scheme (Scheme) – The signature scheme to get vectors of.

  • hash_algorithm (Hash) – The hash algorithm used to generate the signatures.

Returns:

An instance of RsaSigVerVectors.

class crypto_condor.vectors.RSASSA.RsaWycheproofSigGroup#

Bases: TypedDict

Represents a single Wycheproof signature group.

class crypto_condor.vectors.RSASSA.RsaWycheproofSigTest#

Bases: TypedDict

Represents a single Wycheproof signature test.

class crypto_condor.vectors.RSASSA.RsaWycheproofSigVectors#

Bases: TypedDict

Represents a file of Wycheproof signature vectors.

enum crypto_condor.vectors.RSASSA.Scheme(value)#

Bases: StrEnum

RSA signature schemes.

Member Type:

str

Valid values are as follows:

PKCS = <Scheme.PKCS: 'RSASSA-PKCS1-v1_5'>#
PSS = <Scheme.PSS: 'RSASSA-PSS'>#
crypto_condor.vectors.RSASSA.load_nist_sigver_vectors(scheme, hash_algorithm)#

Loads NIST SigVer vectors.

Parameters:
  • scheme (Scheme) – The signature scheme to get vectors of.

  • hash_algorithm (Hash) – The hash algorithm used to generate the signatures.

Returns:

A dictionary with test vectors indexed by filename, or None if there aren’t vectors for the given parameters.

Return type:

dict[str, RsaNistSigVerVectors] | None

crypto_condor.vectors.RSASSA.load_wycheproof_vectors(scheme, hash_algorithm)#

Loads Wycheproof test vectors for signature verification.

Parameters:
  • scheme (Scheme) – The scheme of the test vectors to load.

  • hash_algorithm (Hash) – The hash algorithm used to generate the test vectors.

Returns:

A dictionary of test vectors, indexed by the names of the files loaded, or None if there aren’t vectors for the given parameters.

Return type:

dict[str, RsaWycheproofSigVectors] | None