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 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": ""
    },
 ]
}
@armfazh armfazh requested review from kwantam, chris-wood and samscott89 Dec 13, 2019
@kwantam

This comment has been minimized.

Copy link
Collaborator

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 armfazh force-pushed the armfazh:test_vectors branch from 79a213c to f8f45ac Dec 13, 2019
@armfazh

This comment has been minimized.

Copy link
Collaborator Author

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 armfazh force-pushed the armfazh:test_vectors branch from 9210456 to 8d17858 Jan 22, 2020
@armfazh

This comment has been minimized.

Copy link
Collaborator Author

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

This comment has been minimized.

Copy link
Collaborator

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 armfazh:test_vectors branch 2 times, most recently from 3d8a9db to b84043b Jan 24, 2020
@armfazh

This comment has been minimized.

Copy link
Collaborator Author

armfazh commented Jan 29, 2020

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

@chris-wood chris-wood force-pushed the cfrg:master branch from 4966eb2 to 6893c4d Feb 16, 2020
@kwantam kwantam mentioned this pull request Feb 25, 2020
5 of 5 tasks complete
@kwantam kwantam force-pushed the armfazh:test_vectors branch from e6b8324 to 5d30875 Feb 25, 2020
@kwantam

This comment has been minimized.

Copy link
Collaborator

kwantam commented Feb 25, 2020

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

Copy link
Collaborator

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 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
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants
You can’t perform that action at this time.