mirror of
https://github.com/restic/restic.git
synced 2026-11-06 15:29:21 +00:00
repository: move crypto package to internal/repository/crypto
This commit is contained in:
1 parent
35e60dc2c7
commit
c8a0bc2c5e
22 files changed
+16
-16
No files matched your search
@@ -0,0 +1,19 @@
|
||||
package crypto
|
||||
|
||||
// NewBlobBuffer returns a buffer that is large enough to hold a blob of size
|
||||
// plaintext bytes, including the crypto overhead.
|
||||
func NewBlobBuffer(size int) []byte {
|
||||
return make([]byte, size, size+Extension)
|
||||
}
|
||||
|
||||
// PlaintextLength returns the plaintext length of a blob with ciphertextSize
|
||||
// bytes.
|
||||
func PlaintextLength(ciphertextSize int) int {
|
||||
return ciphertextSize - Extension
|
||||
}
|
||||
|
||||
// CiphertextLength returns the encrypted length of a blob with plaintextSize
|
||||
// bytes.
|
||||
func CiphertextLength(plaintextSize int) int {
|
||||
return plaintextSize + Extension
|
||||
}
|
||||
Reference in new issue
Block a user