Giter Site home page Giter Site logo

Comments (6)

lixin9311 avatar lixin9311 commented on June 2, 2024

好几个月都没一点动静了 你猜呢

lenovo-me [email protected]于2015年1月13日星期二写道:

谢谢!


Reply to this email directly or view it on GitHub
#55.

from shadowsocks-go.

lixin9311 avatar lixin9311 commented on June 2, 2024

golang下如果官方不出面很难有支持的,即使有性能也没AES好。
因为AES有硬件加速支持的,而chacha20没有,靠的是用汇编指令才获得评测中的好成绩。
salse20貌似是有官方库。虽然现在有人在golang实现chacha20,不过也是调用了cgo,这样就没有移植性了,如果用纯go语言写,又因为go runtime,性能还不如aes,所以没有必要在golang上实现chacha20。
再说加密计算速度又不是限制你网速的瓶颈,瓶颈大多数还是你的网络带宽,没有必要去玩chacha20,除非你有信仰

from shadowsocks-go.

cyfdecyf avatar cyfdecyf commented on June 2, 2024

其他加密方法如果有纯的 Go 实现的话会考虑加入。如 @lixin9311 所说,引入 cgo 之后跨体系结构和系统的支持就难做了。

from shadowsocks-go.

defia avatar defia commented on June 2, 2024

https://github.com/codahale/chacha20
这里有个pure go的chacha20实现,我回头测试一下性能,估计是不会有aes好的。。

ps:看了下,这个实现用了unsafe.Pointer来做强制类型转换。。个人觉得不是很好,暂时放弃这个包

from shadowsocks-go.

defia avatar defia commented on June 2, 2024

PASS
BenchmarkRC4Init-8 200000 8180 ns/op
BenchmarkAES128Init-8 300000 3930 ns/op
BenchmarkAES192Init-8 300000 4193 ns/op
BenchmarkAES256Init-8 300000 4826 ns/op
BenchmarkBlowFishInit-8 20000 57403 ns/op
BenchmarkCast5Init-8 30000 57369 ns/op
BenchmarkDESInit-8 300000 5053 ns/op
BenchmarkRC4MD5Init-8 200000 8710 ns/op
BenchmarkChaCha20Init-8 1000000 1044 ns/op
ok /D/shadowsocks-go/shadowsocks 14.824s

试了下chacha20,确实快不少。与shadowsocks-libev互通成功。
上述chacha20包封装的很标准,所以改起来也很简单,但是因为引入了unsafe包,具体要不要加入,由cyfdecyf决定吧

from shadowsocks-go.

defia avatar defia commented on June 2, 2024

https://godoc.org/golang.org/x/crypto/salsa20
然后看上去salsa20也在进入准官方库的过程中。不过现在的封装跟标准库不太一样。。

from shadowsocks-go.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.