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

feat: add ChaCha20 crypto transport #55

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open

feat: add ChaCha20 crypto transport #55

wants to merge 7 commits into from

Conversation

TwoTenPvP
Copy link
Contributor

No description provided.

@TwoTenPvP TwoTenPvP requested a review from LukeStampfli April 9, 2021 13:59
@TwoTenPvP
Copy link
Contributor Author

TwoTenPvP commented Apr 9, 2021

Two things not yet finished:

  1. IV and Counter has to be reset for every packet. Otherwise we will get a keystream mismatch when a packet goes out of order or go missing.
  2. There is not yet a validation handler for certificates. All certificates are blindly just "accepted".

Both these things should be fixed before we merge this. But it's a good starting point for crypto. I will get to this once I have time. Just thought it still might be useful as a PR in the meantime.

@TwoTenPvP
Copy link
Contributor Author

Counter synchronization is now implemeneted. You can have anywhere between 64-128 blocks of loss or reordering before things break.

This could be massively improved by using some of the first header byte to store a slightly larger counter (just a few bits would make a huge difference). This however requires custom int rollover so will have to be future developments.

A cert handler is also implemented and required when using signed handshakes.

@LukeStampfli LukeStampfli changed the base branch from master to main November 26, 2021 09:49
@LukeStampfli
Copy link
Contributor

Had to retarget this at main so that we can delete the master branch.

Copy link
Contributor

@LukeStampfli LukeStampfli left a comment

Choose a reason for hiding this comment

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

Code looks all good. We shuffled some stuff around in the repo and file paths for transports now use com.community.netcode instead of com.mlapi.contrib. etc. Could you adjust that?

@unity-cla-assistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

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.

3 participants