SHA test vectors#

Test vectors#

class crypto_condor.vectors.SHA.ShaVectors(hash_algorithm, orientation, short_msg, long_msg, montecarlo)#

A class to load SHA test vectors.

Do not instantiate directly, use load() instead.

Parameters:
  • hash_algorithm (Algorithm) – The hash algorithm to use.

  • orientation (Orientation) – The orientation of the implementation, either bit- or byte-oriented.

  • short_msg_tests – Short message tests.

  • long_msg_tests – Long message tests.

  • montecarlo_tests – Monte-Carlo tests.

Example

To load SHA-256 test vectors for a bit-oriented implementation.

>>> from crypto_condor.vectors.SHA import Algorithm, Orientation, ShaVectors
>>> vectors = ShaVectors.load(Algorithm.SHA_256, Orientation.BIT)

Enums#

enum crypto_condor.vectors.SHA.Algorithm(value)#

Supported hash algorithms.

Member Type:

str

Valid values are as follows:

SHA_1 = <Algorithm.SHA_1: 'SHA-1'>#
SHA_224 = <Algorithm.SHA_224: 'SHA-224'>#
SHA_256 = <Algorithm.SHA_256: 'SHA-256'>#
SHA_384 = <Algorithm.SHA_384: 'SHA-384'>#
SHA_512 = <Algorithm.SHA_512: 'SHA-512'>#
SHA_512_224 = <Algorithm.SHA_512_224: 'SHA-512/224'>#
SHA_512_256 = <Algorithm.SHA_512_256: 'SHA-512/256'>#
SHA3_224 = <Algorithm.SHA3_224: 'SHA3-224'>#
SHA3_256 = <Algorithm.SHA3_256: 'SHA3-256'>#
SHA3_384 = <Algorithm.SHA3_384: 'SHA3-384'>#
SHA3_512 = <Algorithm.SHA3_512: 'SHA3-512'>#
enum crypto_condor.vectors.SHA.Orientation(value)#

Orientation of the implementation.

Member Type:

str

Valid values are as follows:

BIT = <Orientation.BIT: 'bit'>#
BYTE = <Orientation.BYTE: 'byte'>#

Exceptions#

exception crypto_condor.vectors.SHA.ShaVectorsError#

Exception for errors when loading vectors.