1
0
mirror of https://github.com/restic/restic.git synced 2024-06-30 08:20:55 +02:00

crypto: Remove type iv

This commit is contained in:
Alexander Neumann 2015-04-15 20:51:52 +02:00
parent 7b6bd98c9e
commit 63e79539e9
2 changed files with 5 additions and 5 deletions

View File

@ -48,7 +48,6 @@ type SigningKey struct {
K [16]byte `json:"k"` // for AES128
R [16]byte `json:"r"` // for Poly1305
}
type iv [ivSize]byte
// mask for key, (cf. http://cr.yp.to/mac/poly1305-20050329.pdf)
var poly1305KeyMask = [16]byte{
@ -160,12 +159,13 @@ func NewKey() (k *Key) {
return k
}
func newIV() (iv iv) {
n, err := rand.Read(iv[:])
func newIV() []byte {
iv := make([]byte, ivSize)
n, err := rand.Read(iv)
if n != ivSize || err != nil {
panic("unable to read enough random bytes for iv")
}
return
return iv
}
type jsonMACKey struct {

View File

@ -10,7 +10,7 @@ import (
)
type encryptWriter struct {
iv iv
iv []byte
wroteIV bool
data *bytes.Buffer
key *Key