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

refactor: parameterize handshake patterns #46

Merged
merged 9 commits into from
Nov 27, 2023
Merged

Conversation

richard-ramos
Copy link
Member

@richard-ramos richard-ramos commented Nov 20, 2023

In https://rfc.vac.dev/spec/70/ a new pattern is defined that uses a different DH, Cipher and Hash function.
js-noise currently only accepts 25519, ChaChaPoly and Sha256. With this PR it should be possible to use also other types as long as they follow stablelib Hash interface, DHKey and Cipher interface

  • Allow Hash customization
  • Allow DH customization
  • Allow Cipher customization
    - Allow AES256GCM Cipher
    - Allow x448 key?
    - Define Noise_IX_448_AES256GCM_SHA256 pattern

Fixes #48

@richard-ramos
Copy link
Member Author

IX pattern should be defined as follows:

[
    new MessagePattern(MessageDirection.r, [NoiseTokens.e, NoiseTokens.s]),
    new MessagePattern(MessageDirection.l, [
      NoiseTokens.e,
      NoiseTokens.s,
      NoiseTokens.es,
      NoiseTokens.se,
      NoiseTokens.ee,
    ]),
  ]

@richard-ramos richard-ramos requested a review from weboko November 21, 2023 16:40
@richard-ramos
Copy link
Member Author

The following tasks will be done in a separate PR:

Allow AES256GCM Cipher
Allow x448 key ?
Define Noise_IX_448_AES256GCM_SHA256 pattern

@richard-ramos richard-ramos marked this pull request as ready for review November 21, 2023 16:41
@richard-ramos richard-ramos changed the title refactor: parameterize handshake patterns and introduce new handshake pattern refactor: parameterize handshake patterns Nov 22, 2023
Copy link
Collaborator

@weboko weboko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

took longer to digest, good job!

@richard-ramos richard-ramos merged commit 0f9b146 into master Nov 27, 2023
4 of 5 checks passed
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.

feat: allow parameterization of handshakes
2 participants