mirror of
https://github.com/restic/restic.git
synced 2026-10-25 10:08:53 +00:00
Reorganize crypto code
Move all crypto functions to package "crypto", move random generators for tests into helper package.
This commit is contained in:
1 parent
8e8f31d3fe
commit
3a2525809c
10 files changed
+166
-187
No files matched your search
@@ -0,0 +1,19 @@
|
||||
package crypto
|
||||
|
||||
import "sync"
|
||||
|
||||
const defaultBufSize = 2048
|
||||
|
||||
var bufPool = sync.Pool{
|
||||
New: func() interface{} {
|
||||
return make([]byte, defaultBufSize)
|
||||
},
|
||||
}
|
||||
|
||||
func getBuffer() []byte {
|
||||
return bufPool.Get().([]byte)
|
||||
}
|
||||
|
||||
func freeBuffer(buf []byte) {
|
||||
bufPool.Put(buf)
|
||||
}
|
||||
Reference in new issue
Block a user