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

input cleanup / only needed information #1

Open
cryptix opened this issue Apr 4, 2017 · 5 comments
Open

input cleanup / only needed information #1

cryptix opened this issue Apr 4, 2017 · 5 comments

Comments

@cryptix
Copy link

cryptix commented Apr 4, 2017

@dominictarr asked me to forward a suggestion I made on ssb.

on a tangential note: I must say (maybe i overlooked this in the docs of the vectors) that i was quite confused by the args having all the later to-be-derived info already in them. Like in init:0 args==result without any work.

...

It's a bit nit-picky but a new user could be thrown off by all the extra info in the argument that is not needed to calculate the data to compare against. For example the local.kx_pk and local.kx_sk are derived from random and could be empty/not set on the argument.
I guess what I'm saying is that the vectors aren't usefull to understand the protocol and what data is caluclated in the different steps. Than again, that might not be their job but it could help a new implementress to understand what is required of her without needing to understand another implementation and/or the paper. Redundant info can't hurt here, I think.

To get a little more hands-on, my idea would be to change the first initialize vector to this:

{
  "name": "initialize",
  "args": [
    {
      "app_key": "291356d28154da68e8a9ee4fed71497c0a67d121a41b544d7a6157e76e0df5bc",
      "local": {
        "publicKey": "d5bf4a3fcce717b0388bcc2749ebc148ad9969b23f45ee1b605fd58778576ac4",
        "secretKey": "2bd806c97f0e00af1a1fc3328fa763a9269723c8db8fac4f93af71db186d6e90d5bf4a3fcce717b0388bcc2749ebc148ad9969b23f45ee1b605fd58778576ac4",
      },
      "remote": {
        "publicKey": "ecc1b58727f3f12b3194881a9ecb9de0b28ce7b207230d8e930fe1bce75e256c"
      },
      "seed": null,
      "random": "bd070d239f0690dda26d6a28b1a4b0fea0404848469507031ceeec31de559c8f"
    }
  ],
  "result": {
    "app_key": "291356d28154da68e8a9ee4fed71497c0a67d121a41b544d7a6157e76e0df5bc",
    "local": {
      "kx_pk": "0b6ea52868f0cbbac2deba8bb0fc1a1251d5aa80bc4fa85d8143571abc458752",
      "kx_sk": "3886cd3e87ce98aa0e68da9ad04fb5b7b9089cc8a6705bc83cb507e69419a95b",
      "publicKey": "d5bf4a3fcce717b0388bcc2749ebc148ad9969b23f45ee1b605fd58778576ac4",
      "secretKey": "2bd806c97f0e00af1a1fc3328fa763a9269723c8db8fac4f93af71db186d6e90d5bf4a3fcce717b0388bcc2749ebc148ad9969b23f45ee1b605fd58778576ac4",
      "app_mac": "9e0986a9df0d04dc9884a58aa9f68cbd1690d0140a602d1ad4ba5599c4205596"
    },
    "remote": {
      "publicKey": "ecc1b58727f3f12b3194881a9ecb9de0b28ce7b207230d8e930fe1bce75e256c"
    },
    "seed": null,
    "random": "bd070d239f0690dda26d6a28b1a4b0fea0404848469507031ceeec31de559c8f"
  }
},

Since local.kx_pk and local.kx_sk are derived from random and local.app_mac is then derived from local.kx_pk, they shouldn't be part of the input state. One could argue that the long-term keypair and target remote pubkey also aren't used until the later stages but since they are required for normal operation I'd leave them in but I'm not sure about that.

@dominictarr
Copy link
Contributor

things that are needed later need to stay, because the only way they get there is passing them through the stages.
app_key is used throughout, and but kx_pk could be removed after the challenge is sent, and kx_sk could be removed after the challenge is received. then further secrets are created, we could ditch the ealier ones.

@dominictarr
Copy link
Contributor

@Kodest @david415 what are your thoughts?

@1082008
Copy link

1082008 commented Apr 17, 2017

Sorry about the late response but I had to begin my own implementation to get a deep understanding. I began with the initialize method and my empty initialize method passed the complete test set which is a little bit weird behavior I guess. I think there should be at least one test not having the expected output in the input already.

@dominictarr
Copy link
Contributor

that is definitely wrong. I guess we need tests for the vectors, that check that incorrect implementations do not pass...

@1082008
Copy link

1082008 commented Apr 26, 2017

Here is my PR for cleaning up input: #3
Please review!

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

No branches or pull requests

3 participants