Skip to content

xchacha20-ietf-poly1305 的速度只有 chacha20-ietf-poly1305 的一半? #500

Answered by zonyitoo
pexcn asked this question in Q&A
Discussion options

You must be logged in to vote

Well, I suspected that there are two main reasons

First of all, shadowsocks-libev uses libsodium for these two algorithms. chacha20 and xchacha20 have very similar implementation except nonce length, so they should perform nearly the same with the same implementation in one library. But xchacha20-ietf-poly1305 should expect to have lower performance compared to chacha20-ietf-poly1305 because it requires extra calculation on generating new keys and nonces on every encrypt calls.

Secondly, chacha20-ietf-poly1305 in this project uses ring as its backend, but xchacha20-ietf-poly1305 uses a pure Rust implementation. As you can see in its implementation, if your CPU supports SSE4.1, it will use…

Replies: 2 comments 7 replies

Comment options

You must be logged in to vote
6 replies
@zonyitoo
Comment options

@zonyitoo
Comment options

@pexcn
Comment options

@pexcn
Comment options

@zonyitoo
Comment options

Answer selected by pexcn
Comment options

You must be logged in to vote
1 reply
@zonyitoo
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants