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

Support non-standard extra algorithms #8

Closed
zonyitoo opened this issue Apr 16, 2021 · 4 comments · Fixed by #9
Closed

Support non-standard extra algorithms #8

zonyitoo opened this issue Apr 16, 2021 · 4 comments · Fixed by #9
Labels
enhancement New feature or request

Comments

@zonyitoo
Copy link
Collaborator

zonyitoo commented Apr 16, 2021

Background

Algorithms that are already supported by crypto2:

  • aes-128-ccm, aes-256-ccm
  • aes-128-gcm-siv, aes-256-gcm-siv
  • aes-128-ocb-taglen128, aes-192-ocb-taglen128, aes-256-ocb-taglen128
  • aes-siv-cmac-256, aes-siv-cmac-384, aes-siv-cmac-512

Algorithms that are the most wanted in other implementations:

Some algorithms that are not implemented yet:

  • sm4-gcm
  • sm4-ccm

These algorithms are not standardized by shadowsocks' community, but it is still possible to enable these by optional features.

Proposal

Add an optional feature v1-aead-extra to enable all the extra algorithms described above.

Notice: xchacha20-ietf-poly1305 doesn't have a standardized specification about its technical detail, so we have to use its original and the only implementation in libsodium. This may significantly increase the output binary size.

@zonyitoo zonyitoo added the enhancement New feature or request label Apr 16, 2021
@DuckSoft
Copy link

for xchacha20-ietf-poly1305 maybe we can file a feature request to crypto2.
embedding the whole libsodium is way too dirty.

@database64128
Copy link

Instead of adding rarely-used algorithms without changing the protocol, maybe we should turn our focus to implementing one of our proposed draft protocols.

@DuckSoft
Copy link

Instead of adding rarely-used algorithms without changing the protocol, maybe we should turn our focus to implementing one of our proposed draft protocols.

Agreed but that's offtopic here. Open another issue to track it.

@zonyitoo
Copy link
Collaborator Author

zonyitoo commented Apr 16, 2021

I don't think so. xchacha20-ietf-poly1305 has 2 different definitions, the only implementation in libsodium has a 64-bit counter but the RFC doesn't define it clearly. But according to this thread, RFC seems to imply it has a 32-bit counter.

So it the safest way is to use the libsodium's implementation.

zonyitoo added a commit that referenced this issue Apr 16, 2021
- Enable new ciphers with v1-aead-extra
- Support xchacha20-ietf-poly1305 with libsodium

fixes #8
zonyitoo added a commit that referenced this issue Apr 16, 2021
- Enable new ciphers with v1-aead-extra
- Support xchacha20-ietf-poly1305 with libsodium

fixes #8
zonyitoo added a commit that referenced this issue Apr 16, 2021
- Enable new ciphers with v1-aead-extra
- Support xchacha20-ietf-poly1305 with libsodium

fixes #8
zonyitoo added a commit that referenced this issue Apr 16, 2021
- Enable new ciphers with v1-aead-extra
- Support xchacha20-ietf-poly1305 with libsodium

fixes #8
zonyitoo added a commit that referenced this issue Apr 16, 2021
- Enable new ciphers with v1-aead-extra
- Support xchacha20-ietf-poly1305 with libsodium

fixes #8
zonyitoo added a commit that referenced this issue Apr 17, 2021
- Enable new ciphers with v1-aead-extra
- Support xchacha20-ietf-poly1305 with libsodium

fixes #8
zonyitoo added a commit that referenced this issue Apr 17, 2021
* Support non-standard AEAD ciphers with feature v1-aead-extra

- Enable new ciphers with v1-aead-extra
- Support xchacha20-ietf-poly1305 with libsodium

fixes #8

* crypto2 has removed Zeroize

- release version 0.2.1

* switched to self implemented xchacha20-ietf-poly1305

Co-authored-by: luozijun <[email protected]>
zonyitoo added a commit to shadowsocks/shadowsocks-rust that referenced this issue Apr 17, 2021
- updated crypto2 to 0.1.2
- support AEAD extra ciphers with aead-cipher-extra
- fixes shadowsocks/shadowsocks-android#2663
- ref shadowsocks/shadowsocks-crypto#8
zonyitoo added a commit to shadowsocks/shadowsocks-rust that referenced this issue Apr 17, 2021
- updated crypto2 to 0.1.2
- support AEAD extra ciphers with aead-cipher-extra
- fixes shadowsocks/shadowsocks-android#2663
- ref shadowsocks/shadowsocks-crypto#8
zonyitoo added a commit to shadowsocks/shadowsocks-rust that referenced this issue Apr 17, 2021
- updated crypto2 to 0.1.2
- support AEAD extra ciphers with aead-cipher-extra
- fixes shadowsocks/shadowsocks-android#2663
- ref shadowsocks/shadowsocks-crypto#8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants