Adding references to types in the documentation.

NOKEYCHECK=True
PiperOrigin-RevId: 233065086
GitOrigin-RevId: a4af2453b9798b7e14bd14c2b4c5e07a1e9d72d0
This commit is contained in:
bleichen
2019-02-08 08:32:06 -08:00
committed by Tink Team
parent 7ca8c8d16f
commit cb98c9f432
2 changed files with 420 additions and 331 deletions
+3 -3
View File
@@ -27,12 +27,12 @@ these test files are described in [files.md](files.md).
## Naming of primitives and algebraic structures ## Naming of primitives and algebraic structures
### Hash functions ### Hash functions {#HashFunctions}
Wycheproof uses the following strings to denote hash functions: SHA-1, SHA-224, Wycheproof uses the following strings to denote hash functions: SHA-1, SHA-224,
SHA-256, SHA-384, SHA-512, SHA3-224, SHA3-256, SHA3-384, SHA3-512 SHA-256, SHA-384, SHA-512, SHA3-224, SHA3-256, SHA3-384, SHA3-512
### Elliptic curves ### Elliptic curves {#EcCurve}
The following names for elliptic curves are used in Wycheproof. Some of the The following names for elliptic curves are used in Wycheproof. Some of the
curves have a jwk equivalent. curves have a jwk equivalent.
@@ -63,7 +63,7 @@ Test vectors are divided into several test groups. A test group is a list of
test vectors that use some common parameters (e.g. the same public key and test vectors that use some common parameters (e.g. the same public key and
algorithm) algorithm)
## Representation of some data types ## Representation of some data types {#DataTypes}
Some data types that don't have an exact match in Json use a specific format as Some data types that don't have an exact match in Json use a specific format as
described below described below
+417 -328
View File
@@ -37,22 +37,31 @@ A test vector for authenticated encryption with additional data.
Fields additional to the fields in TestVector are\: Fields additional to the fields in TestVector are\:
| **name** | **type** | **desc** | | **name** | **type** | **desc** |
| -------- | -------- | ------------------------------------------------------ | | -------- | -------------------------------- | ------------------------------ |
| key | HexBytes | the key | | key | [HexBytes](formats.md#DataTypes) | the key |
| iv | HexBytes | the nonce | | iv | [HexBytes](formats.md#DataTypes) | the nonce |
| aad | HexBytes | additional authenticated data | | aad | [HexBytes](formats.md#DataTypes) | additional authenticated data |
| msg | HexBytes | the plaintext | | msg | [HexBytes](formats.md#DataTypes) | the plaintext |
| ct | HexBytes | the ciphertext (without iv and tag) | | ct | [HexBytes](formats.md#DataTypes) | the ciphertext (without iv and |
| tag | HexBytes | The authenticatian tag. Most encryption append the tag | : : : tag) :
: : : to the ciphertext. Encryption results in the : | tag | [HexBytes](formats.md#DataTypes) | The authenticatian tag. Most |
: : : concatenation ct || tag and decryption expects ct || : : : : encryption append the tag to :
: : : tag as input. There are however some exceptions. For : : : : the ciphertext. Encryption :
: : : example AEAD-AES-SIV-CMAC (RFC 5297) computes a : : : : results in the concatenation :
: : : synthetic IV (SIV), which is used to initialize the : : : : ct || tag and decryption :
: : : counter for AES. The typical encoding here is to : : : : expects ct || tag as input. :
: : : prepend the SIV. I.e. implementations would expect : : : : There are however some :
: : : ciphertext of the form tag || ct or iv || tag || ct. : : : : exceptions. For example :
: : : AEAD-AES-SIV-CMAC (RFC 5297) :
: : : computes a synthetic IV (SIV), :
: : : which is used to initialize :
: : : the counter for AES. The :
: : : typical encoding here is to :
: : : prepend the SIV. I.e. :
: : : implementations would expect :
: : : ciphertext of the form tag || :
: : : ct or iv || tag || ct. :
Used in [AeadTestGroup](#AeadTestGroup). Used in [AeadTestGroup](#AeadTestGroup).
@@ -69,10 +78,10 @@ is valid.
Fields additional to the fields in TestVector are\: Fields additional to the fields in TestVector are\:
**name** | **type** | **desc** **name** | **type** | **desc**
-------- | -------- | -------------------------------- -------- | -------------------------------- | --------------------------------
msg | HexBytes | The message to sign msg | [HexBytes](formats.md#DataTypes) | The message to sign
sig | Asn | An ASN encoded signature for msg sig | Asn | An ASN encoded signature for msg
Used in [DsaTestGroup](#DsaTestGroup), [EcdsaTestGroup](#EcdsaTestGroup). Used in [DsaTestGroup](#DsaTestGroup), [EcdsaTestGroup](#EcdsaTestGroup).
@@ -93,12 +102,12 @@ data.
Fields additional to the fields in TestVector are\: Fields additional to the fields in TestVector are\:
**name** | **type** | **desc** **name** | **type** | **desc**
-------- | -------- | ----------------------------- -------- | -------------------------------- | -----------------------------
key | HexBytes | the key key | [HexBytes](formats.md#DataTypes) | the key
aad | HexBytes | additional authenticated data aad | [HexBytes](formats.md#DataTypes) | additional authenticated data
msg | HexBytes | the plaintext msg | [HexBytes](formats.md#DataTypes) | the plaintext
ct | HexBytes | the ciphertext including tag ct | [HexBytes](formats.md#DataTypes) | the ciphertext including tag
Used in [DaeadTestGroup](#DaeadTestGroup). Used in [DaeadTestGroup](#DaeadTestGroup).
@@ -108,30 +117,43 @@ A DSA private key. This implementation of DSA must only be used for testing rsp.
for generating test vectors. It has not been checked for flaws and in some cases for generating test vectors. It has not been checked for flaws and in some cases
may even avoid necessary checks so that it can be used for flawed test vectors. may even avoid necessary checks so that it can be used for flawed test vectors.
| **name** | **type** | **desc** | **enum** | | **name** | **type** | **desc** | **enum** |
| -------- | -------- | ----------------------------------- | --------------- | | -------- | ------------------------------ | -------------- | --------------- |
| g | BigInt | the generator of the multiplicative | | | g | [BigInt](formats.md#DataTypes) | the generator | |
: : : subgroup : : : : : of the : :
| keySize | int | the key size in bits | | : : : multiplicative : :
| p | BigInt | the modulus p | | : : : subgroup : :
| q | BigInt | the order of the generator g | | | keySize | int | the key size | |
| type | str | the key type | 'DsaPrivateKey' | : : : in bits : :
| x | BigInt | the private key value | | | p | [BigInt](formats.md#DataTypes) | the modulus p | |
| y | BigInt | the public key value | | | q | [BigInt](formats.md#DataTypes) | the order of | |
: : : the generator : :
: : : g : :
| type | str | the key type | 'DsaPrivateKey' |
| x | [BigInt](formats.md#DataTypes) | the private | |
: : : key value : :
| y | [BigInt](formats.md#DataTypes) | the public key | |
: : : value : :
## DsaPublicKey {#DsaPublicKey} ## DsaPublicKey {#DsaPublicKey}
The public key for DSA. The public key for DSA.
| **name** | **type** | **desc** | **enum** | | **name** | **type** | **desc** | **enum** |
| -------- | -------- | ----------------------------------- | -------------- | | -------- | ------------------------------ | -------------- | -------------- |
| g | BigInt | the generator of the multiplicative | | | g | [BigInt](formats.md#DataTypes) | the generator | |
: : : subgroup : : : : : of the : :
| keySize | int | the key size in bits | | : : : multiplicative : :
| p | BigInt | the modulus p | | : : : subgroup : :
| q | BigInt | the order of the generator g | | | keySize | int | the key size | |
| type | str | the key type | 'DsaPublicKey' | : : : in bits : :
| y | BigInt | the public key value | | | p | [BigInt](formats.md#DataTypes) | the modulus p | |
| q | [BigInt](formats.md#DataTypes) | the order of | |
: : : the generator : :
: : : g : :
| type | str | the key type | 'DsaPublicKey' |
| y | [BigInt](formats.md#DataTypes) | the public key | |
: : : value : :
## DsaTestGroup {#DsaTestGroup} ## DsaTestGroup {#DsaTestGroup}
@@ -166,11 +188,11 @@ Fields in EcPointTestGroup are\:
Fields additional to the fields in TestVector are\: Fields additional to the fields in TestVector are\:
**name** | **type** | **desc** **name** | **type** | **desc**
-------- | -------- | ------------------------------- -------- | -------------------------------- | -------------------------------
encoded | HexBytes | X509 encoded point on the curve encoded | [HexBytes](formats.md#DataTypes) | X509 encoded point on the curve
x | BigInt | x-coordinate of the point x | [BigInt](formats.md#DataTypes) | x-coordinate of the point
y | BigInt | y-coordiante of the point y | [BigInt](formats.md#DataTypes) | y-coordiante of the point
Used in [EcPointTestGroup](#EcPointTestGroup). Used in [EcPointTestGroup](#EcPointTestGroup).
@@ -185,27 +207,23 @@ parameters generator, order and cofactor.
curve | typing.Union[ecutil.EcUnnamedGroup, ecutil.EcNamedGroup] | the EC group used by this public key | curve | typing.Union[ecutil.EcUnnamedGroup, ecutil.EcNamedGroup] | the EC group used by this public key |
keySize | int | the key size in bits | keySize | int | the key size in bits |
type | str | the key type | 'EcPublicKey' type | str | the key type | 'EcPublicKey'
uncompressed | HexBytes | X509 encoded public key point in hexadecimal format | uncompressed | [HexBytes](formats.md#DataTypes) | X509 encoded public key point in hexadecimal format |
wx | BigInt | the x-coordinate of the public key point | wx | [BigInt](formats.md#DataTypes) | the x-coordinate of the public key point |
wy | BigInt | the y-coordinate of the public key point | wy | [BigInt](formats.md#DataTypes) | the y-coordinate of the public key point |
## EcPublicKeyOnNamedCurve {#EcPublicKeyOnNamedCurve} ## EcPublicKeyOnNamedCurve {#EcPublicKeyOnNamedCurve}
An EC public key. This data type allows only named curves to specify the An EC public key. This data type allows only named curves to specify the
underlying EC parameters. underlying EC parameters.
| **name** | **type** | **desc** | **enum** | **name** | **type** | **desc** | **enum**
| ------------ | ------------ | ------------------------------ | ------------- | ------------ | -------------------------------- | --------------------------------------------------- | --------
| curve | EcNamedGroup | the EC group used by this | | curve | EcNamedGroup | the EC group used by this public key |
: : : public key : : keySize | int | the key size in bits |
| keySize | int | the key size in bits | | type | str | the key type | 'EcPublicKey'
| type | str | the key type | 'EcPublicKey' | uncompressed | [HexBytes](formats.md#DataTypes) | X509 encoded public key point in hexadecimal format |
| uncompressed | HexBytes | X509 encoded public key point | | wx | [BigInt](formats.md#DataTypes) | the x-coordinate of the public key point |
: : : in hexadecimal format : : wy | [BigInt](formats.md#DataTypes) | the y-coordinate of the public key point |
| wx | BigInt | the x-coordinate of the public | |
: : : key point : :
| wy | BigInt | the y-coordinate of the public | |
: : : key point : :
## EcPublicKeyTestGroup {#EcPublicKeyTestGroup} ## EcPublicKeyTestGroup {#EcPublicKeyTestGroup}
@@ -228,18 +246,21 @@ importing the EC public keys notices inconsistencies and bad formatting.
Fields additional to the fields in TestVector are\: Fields additional to the fields in TestVector are\:
**name** | **type** | **desc** | **name** | **type** | **desc** |
-------- | -------- | ---------------------------------------------- | -------- | ------------------------------ | -------------------------------- |
encoded | Asn | Encoded EC public key over a prime order field | encoded | Asn | Encoded EC public key over a |
p | BigInt | The order of underlying field : : : prime order field :
n | BigInt | The order of the generator | p | [BigInt](formats.md#DataTypes) | The order of underlying field |
a | BigInt | The value a of the Weierstrass equation | n | [BigInt](formats.md#DataTypes) | The order of the generator |
b | BigInt | The value b of the Weierstrass equation | a | [BigInt](formats.md#DataTypes) | The value a of the Weierstrass |
gx | BigInt | x-coordinate of the generator : : : equation :
gy | BigInt | y-coordinate of the generator | b | [BigInt](formats.md#DataTypes) | The value b of the Weierstrass |
h | int | [optional] the cofactor : : : equation :
wx | BigInt | x-coordinate of the public point | gx | [BigInt](formats.md#DataTypes) | x-coordinate of the generator |
wy | BigInt | y-coordinate of the public point | gy | [BigInt](formats.md#DataTypes) | y-coordinate of the generator |
| h | int | [optional] the cofactor |
| wx | [BigInt](formats.md#DataTypes) | x-coordinate of the public point |
| wy | [BigInt](formats.md#DataTypes) | y-coordinate of the public point |
Used in [EcPublicKeyTestGroup](#EcPublicKeyTestGroup). Used in [EcPublicKeyTestGroup](#EcPublicKeyTestGroup).
@@ -247,46 +268,67 @@ Used in [EcPublicKeyTestGroup](#EcPublicKeyTestGroup).
An unamed EC group An unamed EC group
| **name** | **type** | **desc** | **enum** | | **name** | **type** | **desc** | **enum** |
| -------- | -------- | --------------------------------- | ----------------- | | -------- | ------------------------------ | ------------ | ----------------- |
| a | BigInt | coefficient a of the elliptic | | | a | [BigInt](formats.md#DataTypes) | coefficient | |
: : : curve equation : : : : : a of the : :
| b | BigInt | coefficient b of the elliptic | | : : : elliptic : :
: : : curve equation : : : : : curve : :
| gx | BigInt | the x-coordinate of the generator | | : : : equation : :
| gy | BigInt | the y-coordinate of the generator | | | b | [BigInt](formats.md#DataTypes) | coefficient | |
| h | int | the cofactor | | : : : b of the : :
| n | BigInt | the order of the generator | | : : : elliptic : :
| p | BigInt | the order of the underlying field | | : : : curve : :
| type | str | an unnamed EC group over a prime | 'PrimeOrderCurve' | : : : equation : :
: : : field in Weierstrass form : : | gx | [BigInt](formats.md#DataTypes) | the | |
: : : x-coordinate : :
: : : of the : :
: : : generator : :
| gy | [BigInt](formats.md#DataTypes) | the | |
: : : y-coordinate : :
: : : of the : :
: : : generator : :
| h | int | the cofactor | |
| n | [BigInt](formats.md#DataTypes) | the order of | |
: : : the : :
: : : generator : :
| p | [BigInt](formats.md#DataTypes) | the order of | |
: : : the : :
: : : underlying : :
: : : field : :
| type | str | an unnamed | 'PrimeOrderCurve' |
: : : EC group : :
: : : over a prime : :
: : : field in : :
: : : Weierstrass : :
: : : form : :
## EcdhEcpointTestGroup {#EcdhEcpointTestGroup} ## EcdhEcpointTestGroup {#EcdhEcpointTestGroup}
Fields in EcdhEcpointTestGroup are\: Fields in EcdhEcpointTestGroup are\:
| **name** | **type** | **desc** | **enum** | | **name** | **type** | **desc** | **enum** |
| -------- | --------------------- | -------------------- | ----------------- | | -------- | ----------------------------- | ------------- | ----------------- |
| curve | str | the curve of the | | | curve | [EcCurve](formats.md#EcCurve) | the curve of | |
: : : private key : : : : : the private : :
| encoding | str | the encoding of the | 'ecpoint' | : : : key : :
: : : public key : : | encoding | str | the encoding | 'ecpoint' |
| type | str | the type of the test | 'EcdhEcpointTest' | : : : of the public : :
| tests | List of | a list of test | | : : : key : :
: : EcdhEcpointTestVector : vectors : : | type | str | the type of | 'EcdhEcpointTest' |
: : : the test : :
| tests | List of EcdhEcpointTestVector | a list of | |
: : : test vectors : :
## EcdhEcpointTestVector {#EcdhEcpointTestVector} ## EcdhEcpointTestVector {#EcdhEcpointTestVector}
Fields additional to the fields in TestVector are\: Fields additional to the fields in TestVector are\:
| **name** | **type** | **desc** | **format** | **ref** | **name** | **type** | **desc** | **format** | **ref**
| -------- | -------- | ------------------ | ------------ | -------------- | -------- | -------------------------------- | ------------------------ | ------------ | -------
| public | Asn | ASN encoded public | OCTET STRING | X9.62, Section | public | Asn | ASN encoded public point | OCTET STRING | X9.62, Section 4.3.6
: : : point : : 4.3.6 : private | [BigInt](formats.md#DataTypes) | The private exponent | |
| private | BigInt | The private | | | shared | [HexBytes](formats.md#DataTypes) | The shared secret key | |
: : : exponent : : :
| shared | HexBytes | The shared secret | | |
: : : key : : :
Used in [EcdhEcpointTestGroup](#EcdhEcpointTestGroup). Used in [EcdhEcpointTestGroup](#EcdhEcpointTestGroup).
@@ -307,11 +349,11 @@ Fields in EcdhPemTestGroup are\:
Fields additional to the fields in TestVector are\: Fields additional to the fields in TestVector are\:
**name** | **type** | **desc** **name** | **type** | **desc**
-------- | -------- | ---------------------- -------- | -------------------------------- | ----------------------
public | Pem | Pem encoded public key public | Pem | Pem encoded public key
private | BigInt | the private key private | [BigInt](formats.md#DataTypes) | the private key
shared | HexBytes | The shared secret key shared | [HexBytes](formats.md#DataTypes) | The shared secret key
Used in [EcdhPemTestGroup](#EcdhPemTestGroup). Used in [EcdhPemTestGroup](#EcdhPemTestGroup).
@@ -319,30 +361,42 @@ Used in [EcdhPemTestGroup](#EcdhPemTestGroup).
Fields in EcdhTestGroup are\: Fields in EcdhTestGroup are\:
**name** | **type** | **desc** | **enum** | **name** | **type** | **desc** | **enum** |
-------- | ---------------------- | ------------------------------ | ---------- | -------- | ----------------------------- | -------------------- | ---------- |
curve | str | the curve of the private key | | curve | [EcCurve](formats.md#EcCurve) | the curve of the | |
encoding | str | the encoding of the public key | 'asn' : : : private key : :
type | str | the type of the test | 'EcdhTest' | encoding | str | the encoding of the | 'asn' |
tests | List of EcdhTestVector | a list of test vectors | : : : public key : :
| type | str | the type of the test | 'EcdhTest' |
| tests | List of EcdhTestVector | a list of test | |
: : : vectors : :
## EcdhTestVector {#EcdhTestVector} ## EcdhTestVector {#EcdhTestVector}
Fields additional to the fields in TestVector are\: Fields additional to the fields in TestVector are\:
| **name** | **type** | **desc** | | **name** | **type** | **desc** |
| -------- | -------- | ------------------------------------------------------ | | -------- | -------------------------------- | ------------------------------ |
| public | Asn | X509 encoded public key. The encoding of the public | | public | Asn | X509 encoded public key. The |
: : : key contains the type of the public key, the curve and : : : : encoding of the public key :
: : : possibly the curve parameters. The test vectors : : : : contains the type of the :
: : : contain cases where these fields do not match the : : : : public key, the curve and :
: : : curve in the testGroup. : : : : possibly the curve parameters. :
| private | BigInt | the private key | : : : The test vectors contain cases :
| shared | HexBytes | The shared secret key. Some invalid test vectors | : : : where these fields do not :
: : : contain a shared secret, which is computed using the : : : : match the curve in the :
: : : curve of the private key. This allows to distinguish : : : : testGroup. :
: : : between implementations ignoring public key info and : | private | [BigInt](formats.md#DataTypes) | the private key |
: : : implementations using the curve of the public key. : | shared | [HexBytes](formats.md#DataTypes) | The shared secret key. Some |
: : : invalid test vectors contain a :
: : : shared secret, which is :
: : : computed using the curve of :
: : : the private key. This allows :
: : : to distinguish between :
: : : implementations ignoring :
: : : public key info and :
: : : implementations using the :
: : : curve of the public key. :
Used in [EcdhTestGroup](#EcdhTestGroup). Used in [EcdhTestGroup](#EcdhTestGroup).
@@ -350,26 +404,30 @@ Used in [EcdhTestGroup](#EcdhTestGroup).
Fields in EcdhWebcryptoTestGroup are\: Fields in EcdhWebcryptoTestGroup are\:
| **name** | **type** | **desc** | **enum** | | **name** | **type** | **desc** | **enum** |
| -------- | ----------------------- | ---------------- | ------------------- | | -------- | ----------------------------- | ----------- | ------------------- |
| curve | str | the curve of the | | | curve | [EcCurve](formats.md#EcCurve) | the curve | |
: : : private key : : : : : of the : :
| encoding | str | the encoding of | 'webcrypto' | : : : private key : :
: : : the public key : : | encoding | str | the | 'webcrypto' |
| type | str | the type of the | 'EcdhWebcryptoTest' | : : : encoding of : :
: : : test : : : : : the public : :
| tests | List of | a list of test | | : : : key : :
: : EcdhWebcryptoTestVector : vectors : : | type | str | the type of | 'EcdhWebcryptoTest' |
: : : the test : :
| tests | List of | a list of | |
: : EcdhWebcryptoTestVector : test : :
: : : vectors : :
## EcdhWebcryptoTestVector {#EcdhWebcryptoTestVector} ## EcdhWebcryptoTestVector {#EcdhWebcryptoTestVector}
Fields additional to the fields in TestVector are\: Fields additional to the fields in TestVector are\:
**name** | **type** | **desc** **name** | **type** | **desc**
-------- | -------- | ------------------------------- -------- | -------------------------------- | -------------------------------
public | Json | Public key in webcrypto format public | Json | Public key in webcrypto format
private | Json | Private key in webcrypto format private | Json | Private key in webcrypto format
shared | HexBytes | The shared secret key shared | [HexBytes](formats.md#DataTypes) | The shared secret key
Used in [EcdhWebcryptoTestGroup](#EcdhWebcryptoTestGroup). Used in [EcdhWebcryptoTestGroup](#EcdhWebcryptoTestGroup).
@@ -451,13 +509,17 @@ salt, info, size
Fields additional to the fields in TestVector are\: Fields additional to the fields in TestVector are\:
**name** | **type** | **desc** | **name** | **type** | **desc** |
-------- | -------- | ------------------------------------------------- | -------- | -------------------------------- | ------------------------------ |
ikm | HexBytes | the key (input key material) | ikm | [HexBytes](formats.md#DataTypes) | the key (input key material) |
salt | HexBytes | the salt for the key derivation | salt | [HexBytes](formats.md#DataTypes) | the salt for the key |
info | HexBytes | additional information used in the key derivation : : : derivation :
size | int | the size of the output in bytes | info | [HexBytes](formats.md#DataTypes) | additional information used in |
okm | HexBytes | the generated bytes (output key material) : : : the key derivation :
| size | int | the size of the output in |
: : : bytes :
| okm | [HexBytes](formats.md#DataTypes) | the generated bytes (output |
: : : key material) :
Used in [HkdfTestGroup](#HkdfTestGroup). Used in [HkdfTestGroup](#HkdfTestGroup).
@@ -484,12 +546,12 @@ block chaining (CBC) is tested using this format.
Fields additional to the fields in TestVector are\: Fields additional to the fields in TestVector are\:
**name** | **type** | **desc** **name** | **type** | **desc**
-------- | -------- | ------------------------------- -------- | -------------------------------- | -------------------------------
key | HexBytes | the key key | [HexBytes](formats.md#DataTypes) | the key
iv | HexBytes | the initialization vector iv | [HexBytes](formats.md#DataTypes) | the initialization vector
msg | HexBytes | the plaintext msg | [HexBytes](formats.md#DataTypes) | the plaintext
ct | HexBytes | the raw ciphertext (without IV) ct | [HexBytes](formats.md#DataTypes) | the raw ciphertext (without IV)
Used in [IndCpaTestGroup](#IndCpaTestGroup). Used in [IndCpaTestGroup](#IndCpaTestGroup).
@@ -513,11 +575,11 @@ entropy. Hence some of the key wrap primitives are deterministic.
Fields additional to the fields in TestVector are\: Fields additional to the fields in TestVector are\:
**name** | **type** | **desc** **name** | **type** | **desc**
-------- | -------- | --------------------- -------- | -------------------------------- | ---------------------
key | HexBytes | the wrapping key key | [HexBytes](formats.md#DataTypes) | the wrapping key
msg | HexBytes | the key bytes to wrap msg | [HexBytes](formats.md#DataTypes) | the key bytes to wrap
ct | HexBytes | the wrapped key ct | [HexBytes](formats.md#DataTypes) | the wrapped key
Used in [KeywrapTestGroup](#KeywrapTestGroup). Used in [KeywrapTestGroup](#KeywrapTestGroup).
@@ -539,11 +601,11 @@ A test vector for message authentication codes (MAC).
Fields additional to the fields in TestVector are\: Fields additional to the fields in TestVector are\:
**name** | **type** | **desc** **name** | **type** | **desc**
-------- | -------- | ---------------------- -------- | -------------------------------- | ----------------------
key | HexBytes | the key key | [HexBytes](formats.md#DataTypes) | the key
msg | HexBytes | the plaintext msg | [HexBytes](formats.md#DataTypes) | the plaintext
tag | HexBytes | the authentication tag tag | [HexBytes](formats.md#DataTypes) | the authentication tag
Used in [MacTestGroup](#MacTestGroup). Used in [MacTestGroup](#MacTestGroup).
@@ -568,9 +630,9 @@ Fields in RsaKeyTestGroup are\:
Fields additional to the fields in TestVector are\: Fields additional to the fields in TestVector are\:
**name** | **type** | **desc** **name** | **type** | **desc**
-------- | -------- | ---------------------- -------- | -------------------------------- | ----------------------
public | HexBytes | the encoded public key public | [HexBytes](formats.md#DataTypes) | the encoded public key
Used in [RsaKeyTestGroup](#RsaKeyTestGroup). Used in [RsaKeyTestGroup](#RsaKeyTestGroup).
@@ -578,45 +640,28 @@ Used in [RsaKeyTestGroup](#RsaKeyTestGroup).
Fields in RsaesOaepTestGroup are\: Fields in RsaesOaepTestGroup are\:
| **name** | **type** | **desc** | **enum** | **name** | **type** | **desc** | **enum**
| --------------- | ------------------- | --------------- | ------------------ | --------------- | ------------------------------ | ----------------------------------------------------------- | --------
| d | BigInt | The private | | d | [BigInt](formats.md#DataTypes) | The private exponent |
: : : exponent : : e | [BigInt](formats.md#DataTypes) | The public exponent |
| e | BigInt | The public | | mgf | str | the message generating function (e.g. MGF1) |
: : : exponent : : mgfSha | str | The hash function used for the message generating function. |
| mgf | str | the message | | n | [BigInt](formats.md#DataTypes) | The modulus of the key |
: : : generating : : privateKeyPem | Pem | Pem encoded private key |
: : : function (e.g. : : privateKeyPkcs8 | Der | Pkcs 8 encoded private key. |
: : : MGF1) : : sha | str | The hash function for hashing the label. |
| mgfSha | str | The hash | | type | str | the type of the test | 'RsaesOaepDecrypt'
: : : function used : : tests | List of RsaesOaepTestVector | a list of test vectors |
: : : for the message : :
: : : generating : :
: : : function. : :
| n | BigInt | The modulus of | |
: : : the key : :
| privateKeyPem | Pem | Pem encoded | |
: : : private key : :
| privateKeyPkcs8 | Der | Pkcs 8 encoded | |
: : : private key. : :
| sha | str | The hash | |
: : : function for : :
: : : hashing the : :
: : : label. : :
| type | str | the type of the | 'RsaesOaepDecrypt' |
: : : test : :
| tests | List of | a list of test | |
: : RsaesOaepTestVector : vectors : :
## RsaesOaepTestVector {#RsaesOaepTestVector} ## RsaesOaepTestVector {#RsaesOaepTestVector}
Fields additional to the fields in TestVector are\: Fields additional to the fields in TestVector are\:
**name** | **type** | **desc** **name** | **type** | **desc**
-------- | -------- | --------------------------------- -------- | -------------------------------- | ---------------------------------
msg | HexBytes | The encrypted message msg | [HexBytes](formats.md#DataTypes) | The encrypted message
ct | HexBytes | An encryption of msg ct | [HexBytes](formats.md#DataTypes) | An encryption of msg
label | HexBytes | The label used for the encryption label | [HexBytes](formats.md#DataTypes) | The label used for the encryption
Used in [RsaesOaepTestGroup](#RsaesOaepTestGroup). Used in [RsaesOaepTestGroup](#RsaesOaepTestGroup).
@@ -624,76 +669,92 @@ Used in [RsaesOaepTestGroup](#RsaesOaepTestGroup).
Fields in RsassaPkcs1GenTestGroup are\: Fields in RsassaPkcs1GenTestGroup are\:
**name** | **type** | **desc** | **ref** | **since** | **enum** **name** | **type** | **desc** | **ref** | **since** | **enum**
------------- | --------------------------- | -------------------------------------- | -------- | --------- | -------- ------------- | ------------------------------ | -------------------------------------- | -------- | --------- | --------
d | BigInt | The private exponent | | | d | [BigInt](formats.md#DataTypes) | The private exponent | | |
e | BigInt | The public exponent | | | e | [BigInt](formats.md#DataTypes) | The public exponent | | |
keyAsn | Der | DER encoding of the sequence [n, e] | | | keyAsn | Der | DER encoding of the sequence [n, e] | | |
keyDer | Der | DER encoding of the public key | | | keyDer | Der | DER encoding of the public key | | |
keyJwk | Json | [Optional] Private key in JWK format | RFC 7517 | 0.7 | keyJwk | Json | [Optional] Private key in JWK format | RFC 7517 | 0.7 |
keyPem | Pem | Pem encoded public key | | | keyPem | Pem | Pem encoded public key | | |
keySize | int | the size of the modulus in bits | | | keySize | int | the size of the modulus in bits | | |
n | BigInt | The modulus of the key | | | n | [BigInt](formats.md#DataTypes) | The modulus of the key | | |
privateKeyDer | Der | DER encoding of the private key | | | privateKeyDer | Der | DER encoding of the private key | | |
privateKeyJwk | Json | [Optional] Private key in JWK format | RFC 7517 | 0.7 | privateKeyJwk | Json | [Optional] Private key in JWK format | RFC 7517 | 0.7 |
privateKeyPem | Pem | Pem encoded private key | | | privateKeyPem | Pem | Pem encoded private key | | |
sha | str | the hash function used for the message | | | sha | str | the hash function used for the message | | |
type | str | the type of the test | | | 'RsassaPkcs1Generate' type | str | the type of the test | | | 'RsassaPkcs1Generate'
tests | List of SignatureTestVector | a list of test vectors | | | tests | List of SignatureTestVector | a list of test vectors | | |
## RsassaPkcs1TestGroup {#RsassaPkcs1TestGroup} ## RsassaPkcs1TestGroup {#RsassaPkcs1TestGroup}
Fields in RsassaPkcs1TestGroup are\: Fields in RsassaPkcs1TestGroup are\:
**name** | **type** | **desc** | **ref** | **since** | **enum** **name** | **type** | **desc** | **ref** | **since** | **enum**
-------- | --------------------------- | -------------------------------------------------------------------------------------------------------------- | -------- | --------- | -------- -------- | ------------------------------ | -------------------------------------------------------------------------------------------------------------- | -------- | --------- | --------
d | BigInt | The private exponent | | | d | [BigInt](formats.md#DataTypes) | The private exponent | | |
e | BigInt | The public exponent | | | e | [BigInt](formats.md#DataTypes) | The public exponent | | |
keyAsn | Der | ASN encoding of the sequence [n, e] | | | keyAsn | Der | ASN encoding of the sequence [n, e] | | |
keyDer | Der | ASN encoding of the public key | | | keyDer | Der | ASN encoding of the public key | | |
keyJwk | Json | The public key in JWK format. The key is missing if the signature algorithm for the given hash is not defined. | RFC 7517 | 0.7 | keyJwk | Json | The public key in JWK format. The key is missing if the signature algorithm for the given hash is not defined. | RFC 7517 | 0.7 |
keyPem | Pem | Pem encoded public key | | | keyPem | Pem | Pem encoded public key | | |
keySize | int | the size of the modulus in bits | | | keySize | int | the size of the modulus in bits | | |
n | BigInt | The modulus of the key | | | n | [BigInt](formats.md#DataTypes) | The modulus of the key | | |
sha | str | the hash function used for the message | | | sha | str | the hash function used for the message | | |
type | str | the type of the test | | | 'RsassaPkcs1Verify' type | str | the type of the test | | | 'RsassaPkcs1Verify'
tests | List of SignatureTestVector | a list of test vectors | | | tests | List of SignatureTestVector | a list of test vectors | | |
## RsassaPssTestGroup {#RsassaPssTestGroup} ## RsassaPssTestGroup {#RsassaPssTestGroup}
Fields in RsassaPssTestGroup are\: Fields in RsassaPssTestGroup are\:
| **name** | **type** | **desc** | **enum** | | **name** | **type** | **desc** | **enum** |
| -------- | ------------------- | ----------------------- | ----------------- | | -------- | ------------------------------ | ------------ | ----------------- |
| d | BigInt | The private exponent | | | d | [BigInt](formats.md#DataTypes) | The private | |
| e | BigInt | The public exponent | | : : : exponent : :
| keyAsn | Der | ASN encoding of the | | | e | [BigInt](formats.md#DataTypes) | The public | |
: : : sequence [n, e] : : : : : exponent : :
| keyDer | Der | ASN encoding of the | | | keyAsn | Der | ASN encoding | |
: : : public key : : : : : of the : :
| keyPem | Pem | Pem encoded public key | | : : : sequence [n, : :
| keySize | int | the size of the modulus | | : : : e] : :
: : : in bits : : | keyDer | Der | ASN encoding | |
| mgf | str | the message generating | | : : : of the : :
: : : function (e.g. MGF1) : : : : : public key : :
| mgfSha | str | The hash function used | | | keyPem | Pem | Pem encoded | |
: : : for the message : : : : : public key : :
: : : generating function. : : | keySize | int | the size of | |
| n | BigInt | The modulus of the key | | : : : the modulus : :
| sha | str | The hash function for | | : : : in bits : :
: : : hasing the message. : : | mgf | str | the message | |
| type | str | the type of the test | 'RsassaPssVerify' | : : : generating : :
| tests | List of | a list of test vectors | | : : : function : :
: : RsassaPssTestVector : : : : : : (e.g. MGF1) : :
| mgfSha | str | The hash | |
: : : function : :
: : : used for the : :
: : : message : :
: : : generating : :
: : : function. : :
| n | [BigInt](formats.md#DataTypes) | The modulus | |
: : : of the key : :
| sha | str | The hash | |
: : : function for : :
: : : hasing the : :
: : : message. : :
| type | str | the type of | 'RsassaPssVerify' |
: : : the test : :
| tests | List of RsassaPssTestVector | a list of | |
: : : test vectors : :
## RsassaPssTestVector {#RsassaPssTestVector} ## RsassaPssTestVector {#RsassaPssTestVector}
Fields additional to the fields in TestVector are\: Fields additional to the fields in TestVector are\:
**name** | **type** | **desc** **name** | **type** | **desc**
-------- | -------- | ------------------- -------- | -------------------------------- | -------------------
msg | HexBytes | The message to sign msg | [HexBytes](formats.md#DataTypes) | The message to sign
sig | HexBytes | a signature for msg sig | [HexBytes](formats.md#DataTypes) | a signature for msg
Used in [RsassaPssTestGroup](#RsassaPssTestGroup). Used in [RsassaPssTestGroup](#RsassaPssTestGroup).
@@ -706,10 +767,10 @@ formatting (e.g. ASN.1 encoded ECDSA signatures) have their separate types.
Fields additional to the fields in TestVector are\: Fields additional to the fields in TestVector are\:
**name** | **type** | **desc** **name** | **type** | **desc**
-------- | -------- | ------------------- -------- | -------------------------------- | -------------------
msg | HexBytes | The message to sign msg | [HexBytes](formats.md#DataTypes) | The message to sign
sig | HexBytes | A signature for msg sig | [HexBytes](formats.md#DataTypes) | A signature for msg
Used in Used in
[EcdsaP1363TestGroup](#EcdsaP1363TestGroup), [EddsaTestGroup](#EddsaTestGroup), [EcdsaP1363TestGroup](#EcdsaP1363TestGroup), [EddsaTestGroup](#EddsaTestGroup),
@@ -877,22 +938,32 @@ type | str | the type of the test
Fields in XdhAsnTestGroup are\: Fields in XdhAsnTestGroup are\:
| **name** | **type** | **desc** | **enum** | | **name** | **type** | **desc** | **enum** |
| -------- | ---------------- | ------------------------------- | ------------ | | -------- | ----------------------------- | ------------------ | ------------ |
| curve | str | The name of the curve. If test | | | curve | [EcCurve](formats.md#EcCurve) | The name of the | |
: : : vectors encode the curve as : : : : : curve. If test : :
: : : part of the public and private : : : : : vectors encode the : :
: : : key then this field describes : : : : : curve as part of : :
: : : the curve of the private key. : : : : : the public and : :
: : : Test vectors with such encoding : : : : : private key then : :
: : : can contain distinct curves. : : : : : this field : :
: : : Such test vectors are of course : : : : : describes the : :
: : : invalid and an attempt to : : : : : curve of the : :
: : : compute a shared secret is : : : : : private key. Test : :
: : : expected to fail. : : : : : vectors with such : :
| type | str | the type of the test | 'XdhAsnComp' | : : : encoding can : :
| tests | List of | a list of test vectors | | : : : contain distinct : :
: : XdhAsnTestVector : : : : : : curves. Such test : :
: : : vectors are of : :
: : : course invalid and : :
: : : an attempt to : :
: : : compute a shared : :
: : : secret is expected : :
: : : to fail. : :
| type | str | the type of the | 'XdhAsnComp' |
: : : test : :
| tests | List of XdhAsnTestVector | a list of test | |
: : : vectors : :
## XdhAsnTestVector {#XdhAsnTestVector} ## XdhAsnTestVector {#XdhAsnTestVector}
@@ -901,11 +972,11 @@ encoded.
Fields additional to the fields in TestVector are\: Fields additional to the fields in TestVector are\:
**name** | **type** | **desc** **name** | **type** | **desc**
-------- | -------- | ---------------------------- -------- | -------------------------------- | ----------------------------
public | Asn | X.509 encoded the public key public | Asn | X.509 encoded the public key
private | Der | PKCS #8 encoded private key private | Der | PKCS #8 encoded private key
shared | HexBytes | the shared secret shared | [HexBytes](formats.md#DataTypes) | the shared secret
Used in [XdhAsnTestGroup](#XdhAsnTestGroup). Used in [XdhAsnTestGroup](#XdhAsnTestGroup).
@@ -913,22 +984,32 @@ Used in [XdhAsnTestGroup](#XdhAsnTestGroup).
Fields in XdhJwkTestGroup are\: Fields in XdhJwkTestGroup are\:
| **name** | **type** | **desc** | **enum** | | **name** | **type** | **desc** | **enum** |
| -------- | ---------------- | ------------------------------- | ------------ | | -------- | ----------------------------- | ------------------ | ------------ |
| curve | str | The name of the curve. If test | | | curve | [EcCurve](formats.md#EcCurve) | The name of the | |
: : : vectors encode the curve as : : : : : curve. If test : :
: : : part of the public and private : : : : : vectors encode the : :
: : : key then this field describes : : : : : curve as part of : :
: : : the curve of the private key. : : : : : the public and : :
: : : Test vectors with such encoding : : : : : private key then : :
: : : can contain distinct curves. : : : : : this field : :
: : : Such test vectors are of course : : : : : describes the : :
: : : invalid and an attempt to : : : : : curve of the : :
: : : compute a shared secret is : : : : : private key. Test : :
: : : expected to fail. : : : : : vectors with such : :
| type | str | the type of the test | 'XdhJwkComp' | : : : encoding can : :
| tests | List of | a list of test vectors | | : : : contain distinct : :
: : XdhJwkTestVector : : : : : : curves. Such test : :
: : : vectors are of : :
: : : course invalid and : :
: : : an attempt to : :
: : : compute a shared : :
: : : secret is expected : :
: : : to fail. : :
| type | str | the type of the | 'XdhJwkComp' |
: : : test : :
| tests | List of XdhJwkTestVector | a list of test | |
: : : vectors : :
## XdhJwkTestVector {#XdhJwkTestVector} ## XdhJwkTestVector {#XdhJwkTestVector}
@@ -938,11 +1019,13 @@ the jwk format.
Fields additional to the fields in TestVector are\: Fields additional to the fields in TestVector are\:
**name** | **type** | **desc** | **ref** | **name** | **type** | **desc** | **ref** |
-------- | -------- | ----------------------------- | -------- | -------- | -------------------------------- | ------------------ | -------- |
public | JSON | the public key in jwk format | RFC 8037 | public | JSON | the public key in | RFC 8037 |
private | JSON | the private key in jwk format | RFC 8037 : : : jwk format : :
shared | HexBytes | the shared secret | | private | JSON | the private key in | RFC 8037 |
: : : jwk format : :
| shared | [HexBytes](formats.md#DataTypes) | the shared secret | |
Used in [XdhJwkTestGroup](#XdhJwkTestGroup). Used in [XdhJwkTestGroup](#XdhJwkTestGroup).
@@ -950,22 +1033,28 @@ Used in [XdhJwkTestGroup](#XdhJwkTestGroup).
Fields in XdhTestGroup are\: Fields in XdhTestGroup are\:
| **name** | **type** | **desc** | **enum** | | **name** | **type** | **desc** | **enum** |
| -------- | --------------------- | ----------------------------- | --------- | | -------- | ----------------------------- | --------------------- | --------- |
| curve | str | The name of the curve. If | | | curve | [EcCurve](formats.md#EcCurve) | The name of the | |
: : : test vectors encode the curve : : : : : curve. If test : :
: : : as part of the public and : : : : : vectors encode the : :
: : : private key then this field : : : : : curve as part of the : :
: : : describes the curve of the : : : : : public and private : :
: : : private key. Test vectors : : : : : key then this field : :
: : : with such encoding can : : : : : describes the curve : :
: : : contain distinct curves. Such : : : : : of the private key. : :
: : : test vectors are of course : : : : : Test vectors with : :
: : : invalid and an attempt to : : : : : such encoding can : :
: : : compute a shared secret is : : : : : contain distinct : :
: : : expected to fail. : : : : : curves. Such test : :
| type | str | the type of the test | 'XdhComp' | : : : vectors are of course : :
| tests | List of XdhTestVector | a list of test vectors | | : : : invalid and an : :
: : : attempt to compute a : :
: : : shared secret is : :
: : : expected to fail. : :
| type | str | the type of the test | 'XdhComp' |
| tests | List of XdhTestVector | a list of test | |
: : : vectors : :
## XdhTestVector {#XdhTestVector} ## XdhTestVector {#XdhTestVector}
@@ -976,10 +1065,10 @@ for X25519 and 56 bytes for X448.
Fields additional to the fields in TestVector are\: Fields additional to the fields in TestVector are\:
**name** | **type** | **desc** **name** | **type** | **desc**
-------- | -------- | ------------------------------- -------- | -------------------------------- | -------------------------------
public | HexBytes | the raw bytes of the public key public | [HexBytes](formats.md#DataTypes) | the raw bytes of the public key
private | HexBytes | the raw bytes of private key private | [HexBytes](formats.md#DataTypes) | the raw bytes of private key
shared | HexBytes | the shared secret shared | [HexBytes](formats.md#DataTypes) | the shared secret
Used in [XdhTestGroup](#XdhTestGroup). Used in [XdhTestGroup](#XdhTestGroup).