Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generation of test vectors #196

Merged
merged 8 commits into from Feb 25, 2020
Merged

Generation of test vectors #196

merged 8 commits into from Feb 25, 2020

Conversation

armfazh
Copy link
Collaborator

@armfazh armfazh commented Dec 13, 2019

It is re-based on top of #189 and #201 .

JSON test vectors for matching compatible implementations.

Example:

{
  "ciphersuite": "P256-SHA256-SSWU-RO-",
  "curve": "P256",
  "dst": "QUUX-V01-CS02",
  "field": {
    "m": "0x1",
    "p": "0xffffffff00000001000000000000000000000000ffffffffffffffffffffffff"
  },
  "hash": "sha256",
  "map": {
    "name": "SSWU",
    "sgn0": "sgn0_le"
  },
  "randomOracle": true,
  "vectors": [
    {
      "P": {
        "x": "0x8beb73a82ebeb6b400456f4da126aacbfa9b8049b71b250d2b7e4885b6b466bd",
        "y": "0x15826dc578f4fbc1ac5fc3f9e15da3ece18be914f332bce8ce5bf1371805d149"
      },
      "msg": ""
    },
 ]
}

@kwantam
Copy link
Collaborator

@kwantam kwantam commented Dec 13, 2019

Nice! I will take a more careful look in the next few days.

To be clear: the JSON wouldn't go into the document, right? (Of course, we can provide test vector files to be downloaded and mechanically processed.)

So probably we will also want a script to turn the JSON structures into whatever format will actually go into the appendix of the document. (Or have I missed it, and that's already here?)

@armfazh
Copy link
Collaborator Author

@armfazh armfazh commented Dec 14, 2019

To be clear: the JSON wouldn't go into the document, right?

No, only ascii. JSON files are intended to be available at an external repo.

So probably we will also want a script to turn the JSON structures into whatever format will actually go into the appendix of the document.

Now it supports both ascii and json formats.

@armfazh
Copy link
Collaborator Author

@armfazh armfazh commented Jan 22, 2020

This branch has been rebased including the Python3 updates.
Should I also include in this PR the test vector (json/ascii) files?

@kwantam
Copy link
Collaborator

@kwantam kwantam commented Jan 22, 2020

I know that I still need to review this. I'm sorry for the very long delay. I should have time this week.

Just to double check: The Sage9/Python3 version generates the same test vectors as the Sage8/Python2 version, right?

@armfazh armfazh force-pushed the test_vectors branch 2 times, most recently from 3d8a9db to b84043b Compare Jan 28, 2020
@armfazh
Copy link
Collaborator Author

@armfazh armfazh commented Jan 29, 2020

The SHA512 suites for {curve/edwards}25519 are now included in Sage scripts.

@kwantam
Copy link
Collaborator

@kwantam kwantam commented Feb 25, 2020

I rebased this on top of master because the diff interface was very confused :)

Copy link
Collaborator

@kwantam kwantam left a comment

Looks good to me. I re-ran test vector generation on my machine (sage9/python3) and got the same files back out. Just a few very small things.

I assume once #212 lands and we update the code to the new suites we'll generate new test vectors, but it doesn't hurt to have these in the repo history anyway, IMO.

poc/README.md Outdated Show resolved Hide resolved
poc/ell2_generic.sage Outdated Show resolved Hide resolved
poc/suite_p256.sage Outdated Show resolved Hide resolved
poc/suite_p384.sage Outdated Show resolved Hide resolved
poc/suite_p521.sage Outdated Show resolved Hide resolved
Copy link
Collaborator

@chris-wood chris-wood left a comment

I did a quick cursory scan -- looks good! (Riad having run them gives me confidence it's good to go.)

armfazh and others added 3 commits Feb 25, 2020
Co-Authored-By: Riad S. Wahby <kwantam@gmail.com>
Co-Authored-By: Riad S. Wahby <kwantam@gmail.com>
@armfazh armfazh merged commit 2500e6c into cfrg:master Feb 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants