mirror of
https://github.com/yggdrasil-network/yggdrasil-go.git
synced 2026-05-22 05:46:30 +03:00
have the stream code use bufio instead of copying manually to an input buffer, slightly reduces total uses of memmove
This commit is contained in:
@@ -172,7 +172,7 @@ func BoxOpen(shared *BoxSharedKey,
|
||||
boxed []byte,
|
||||
nonce *BoxNonce) ([]byte, bool) {
|
||||
out := util.GetBytes()
|
||||
return append(out, boxed...), true
|
||||
return append(out, boxed...), true //FIXME disabled crypto for benchmarking
|
||||
s := (*[BoxSharedKeyLen]byte)(shared)
|
||||
n := (*[BoxNonceLen]byte)(nonce)
|
||||
unboxed, success := box.OpenAfterPrecomputation(out, boxed, n, s)
|
||||
@@ -185,7 +185,7 @@ func BoxSeal(shared *BoxSharedKey, unboxed []byte, nonce *BoxNonce) ([]byte, *Bo
|
||||
}
|
||||
nonce.Increment()
|
||||
out := util.GetBytes()
|
||||
return append(out, unboxed...), nonce
|
||||
return append(out, unboxed...), nonce // FIXME disabled crypto for benchmarking
|
||||
s := (*[BoxSharedKeyLen]byte)(shared)
|
||||
n := (*[BoxNonceLen]byte)(nonce)
|
||||
boxed := box.SealAfterPrecomputation(out, unboxed, n, s)
|
||||
|
||||
Reference in New Issue
Block a user