TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Implementing a Tor relay from scratch in golang (2015)

109 pointsby loxover 8 years ago

9 comments

tvdwover 8 years ago
Hi. I wrote the post, happy to answer questions.<p>* yes, more modern versions of Go would likely mitigate some of the memory pain * yes, crypto&#x2F;tls is fast now * no, crypto&#x2F;tls still has insufficient functionality for implementing this. crypto&#x2F;tls implicitly assumes you want to authenticate the channel through certificates, which Tor doesn&#x27;t do * I was using go 1.4 * yes, I tried Rust
评论 #12719154 未加载
评论 #12719390 未加载
billhathawayover 8 years ago
There were some very significant[0] crypto speed improvements in the Go 1.6 releases. It would be interesting to see how well a pure go implementation would perform.<p>[0] Russ Cox mentions a ~ 10x performance in a TLS benchmark between 1.5 and 1.6.2 at <a href="https:&#x2F;&#x2F;github.com&#x2F;golang&#x2F;go&#x2F;issues&#x2F;15713" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;golang&#x2F;go&#x2F;issues&#x2F;15713</a>
danesparzaover 8 years ago
The author doesn&#x27;t indicate what version of Go they were attempting to use, but in the last two years, Go has seen many improvements by their very active dev team.<p>Notably, there were several changes to crypto in 1.5: <a href="https:&#x2F;&#x2F;golang.org&#x2F;doc&#x2F;go1.5#minor_library_changes" rel="nofollow">https:&#x2F;&#x2F;golang.org&#x2F;doc&#x2F;go1.5#minor_library_changes</a><p>1.6: <a href="https:&#x2F;&#x2F;golang.org&#x2F;doc&#x2F;go1.6#minor_library_changes" rel="nofollow">https:&#x2F;&#x2F;golang.org&#x2F;doc&#x2F;go1.6#minor_library_changes</a><p>and 1.7: <a href="https:&#x2F;&#x2F;golang.org&#x2F;doc&#x2F;go1.7#minor_library_changes" rel="nofollow">https:&#x2F;&#x2F;golang.org&#x2F;doc&#x2F;go1.7#minor_library_changes</a>
loxover 8 years ago
I posted this because I was interested to see if anyone else had experienced gaps in the golang `crypto&#x2F;tls` library. The original author is pretty scathing about Go&#x27;s implementation, but my impression thus far has been that it&#x27;s an amazing quality part of the Go standard lib.<p>I&#x27;d take it any day over openssl, that is for sure. I wish the author had published methodology on the benchmark comparison, would be interesting to dissect that.
评论 #12716885 未加载
评论 #12716930 未加载
daenneyover 8 years ago
The article seems to contradict itself, between &quot;the Go implementation broke the speed record&quot; and &quot;Go makes the product too slow.&quot;<p>Granted the cgo stuff and the memory usage would be something that one needs to deal with. Did you talk to go-nuts at all? They might&#x27;ve been able to offer some more insight into all of this, a better way to deal with the cgo related issue and perhaps even make some changes to handle these kinds of cases better.
评论 #12718384 未加载
IshKebabover 8 years ago
&gt; Go has its own TLS implementation called “crypto&#x2F;tls“, apparently because agl__, one of the people working on the language, decided so.<p>I thought it was rewritten because of the terrible quality of the OpenSSL code, which turned out to be a very good decision.
jasonlaiover 8 years ago
Have you tried Rust? It interacts with C libraries fairly nicely.
keyleover 8 years ago
Nim might have been a good language for this. As fast to write as Go, direct C access.
评论 #12718128 未加载
dimitar9over 8 years ago
go is a meteor for sure. C,live long and prosper.
评论 #12716778 未加载