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.

A Go implementation of Poly1305 that makes sense

195 pointsby pentestercrababout 6 years ago

3 comments

zimmerfreiabout 6 years ago
One reason this cannot be translated into a portable C version while retaining its compactness (and readability) is the lack of support for carry&#x2F;borrow chains.<p>In Go, bits.Add64 takes as input and returns the carry.<p>In C, there are some constructs that modern compilers will recognize as patterns people use to extract the carry, but it is a hit-and-miss.<p>Even compiler-specific intrinsics are a few and far between, inefficient or even broken.
评论 #19562600 未加载
tarikjnabout 6 years ago
Great write-up, I haven&#x27;t dug into understanding the whole code yet, but perhaps someone can answer this for me: can the code be made even simpler using Go&#x27;s bignum: big.Int?
评论 #19560836 未加载
评论 #19560937 未加载
评论 #19560789 未加载
评论 #19562904 未加载
simonhorlickabout 6 years ago
I find a lot of go libraries are very well commented and very accessible, but the standard library and especially the crypto stuff is very sparsely commented.