IntersectMBO/cardano-base

Validate Acceptance Criteria of SECP bindings

Closed this issue · 1 comments

Acceptance criteria for testing. On top of this, we want test-vectors, generated independently.

ID Feature AC
1 ECDSA verification(VerificationKey, MsgHash, Signature) -> Bool
Parameters specification:
  1. VerificationKey - compressed EC point
    1. 33 bytes
  2. MsgHash
    1. 32 bytes
    2. SHA256 hash of the message
  3. Signature
    1. 64 bytes
    2. 2 integers of size 32 bytes each
Given I invoke the ECDSA builtinWhen I use valid parameters in the right order,Then the function output is Validation pass.
2 Message hash prior to ECDSA verification Given I receive a pre-image of the message hash, a valid signature and its corresponding verification keyWhen I hash the message using SHA256 algorithm and When I execute the ECDSA verification methodThen the function output is Validation pass.
3 ECDSA verification Given I invoke the ECDSA builtinWhen the size of the parameters is not exactly like specified,Then the function output is Validation failed.
4 ECDSA verification Given I invoke the ECDSA builtinWhen I use an invalid VerificationKey,Then the function output is Validation failed.
5 ECDSA verification Given I invoke the ECDSA builtinWhen I use an invalid MsgHash,Then the function output is Validation failed.
6 ECDSA verification Given I invoke the ECDSA builtinWhen I use an invalid Signature,Then the function output is Validation failed.
7 Schnorr verification(VerificationKey, Msg, Signature) -> Bool
Parameters specification:
  1. VerificationKey - compressed EC point
    1. 32 bytes
  2. Msg
    1. The function has no size limit
  3. Signature
    1. 64 bytes
    2. 1 compressed point of 32 bytes, and
    3. 1 integer of size 32 bytes
Given I invoke the Schnorr builtinWhen I use valid parameters,Then the function output is Validation pass.
8 Schnorr verification Given I invoke the Schnorr builtinWhen the size of the parameters is not according to specification,Then the function output is Validation failed.
9 Schnorr verification Given I invoke the Schnorr builtinWhen I use an invalid VerificationKey,Then the function output is Validation failed.
10 Schnorr verification Given I invoke the Schnorr builtinWhen I use an invalid Msg,Then the function output is Validation failed.
11 Schnorr verification Given I invoke the Schnorr builtinWhen I use an invalid Signature,Then the function output is Validation failed.

The tests have been implemented in #320 and #332 and are passing (on top of what already existed in the testing framework). AC are met.