Repository navigation
Config.PrivateKey: []byte -> *ecdh.PrivateKey - #40
Conversation
|
Rebase,@yuhan6665 你看看 |
344f62e to
315178e
Compare
|
顺便试试能不能 linkname #37 (comment) ,都放这个 PR 里吧 |
跟原版比似乎少了一个copy 不知道会不会有问题? |
|
|
|
个人感觉无所谓 在非瓶颈的路径上加缓存快点是快点但是终归是反模式 也就让握手快了 0.029 ms |
9bcc460 to
160630b
Compare
`Config.PrivateKey` is now `*ecdh.PrivateKey`, parsed once by the caller. This avoids deriving the same static public key on every authentication attempt. Auth DH: 58.08 → 29.13 µs, 7 → 3 allocs/op (Go 1.27.0, darwin/arm64, Apple M3 Max; 10 runs). Microbenchmark only. Checked locally: race detector, amd64 correctness and FIPS enforcement.
160630b to
920c977
Compare
|
Thanks for the discussion) Sadly, I don't know Chinese but as I understand from the translation :
|
|
看了下代码是并发安全的,我顺便把下面那个 hkdf 也改成 crypto/hkdf 吧, |
应该纯粹是因为 23 年初 Golang 还没内置这个 crypto/ecdh 库,之前看到过一个并发不安全的可能是 hash sum #37 (comment) |
|
|
|
|
|
|
Config.PrivateKeyis now*ecdh.PrivateKey, parsed once by the caller. This avoids deriving the same static public key on every authentication attempt.Auth DH: 58.08 → 29.13 µs, 7 → 3 allocs/op (Go 1.27.0, darwin/arm64, Apple M3 Max; 10 runs). Microbenchmark only.
Checked locally: race detector, amd64 correctness and FIPS enforcement.