From 6445dad7d66fa6a1867090fcd9602c98863649f6 Mon Sep 17 00:00:00 2001 From: ebiggers Date: Sun, 8 Sep 2019 19:46:59 -0700 Subject: Fix various typos and grammatical errors (#141) These were found by a combination of manual review and a custom script that checks for common errors. Also removed an outdated sentence from the comment for setupBefore(). --- crypto/crypto.go | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'crypto/crypto.go') diff --git a/crypto/crypto.go b/crypto/crypto.go index 7327bd5..8de8134 100644 --- a/crypto/crypto.go +++ b/crypto/crypto.go @@ -50,7 +50,7 @@ import ( // Crypto error values var ( ErrBadAuth = errors.New("key authentication check failed") - ErrNegitiveLength = errors.New("keys cannot have negative lengths") + ErrNegativeLength = errors.New("keys cannot have negative lengths") ErrRecoveryCode = errors.New("invalid recovery code") ErrGetrandomFail = util.SystemError("getrandom() failed") ErrKeyAlloc = util.SystemError("could not allocate memory for key") @@ -71,8 +71,8 @@ func checkWrappingKey(wrappingKey *Key) error { return errors.Wrap(err, "wrapping key") } -// stretchKey stretches a key of length KeyLen using unsalted HKDF to make two -// keys of length KeyLen. +// stretchKey stretches a key of length InternalKeyLen using unsalted HKDF to +// make two keys of length InternalKeyLen. func stretchKey(key *Key) (encKey, authKey *Key) { panicInputLength("hkdf key", metadata.InternalKeyLen, key.Len()) @@ -148,9 +148,10 @@ func Wrap(wrappingKey, secretKey *Key) (*metadata.WrappedKeyData, error) { return data, nil } -// Unwrap takes a wrapping Key of length KeyLen, and uses it to unwrap the -// WrappedKeyData to get the unwrapped secret Key. The Wrapped Key data includes -// an authentication check, so an error will be returned if that check fails. +// Unwrap takes a wrapping Key of length InternalKeyLen, and uses it to unwrap +// the WrappedKeyData to get the unwrapped secret Key. The Wrapped Key data +// includes an authentication check, so an error will be returned if that check +// fails. func Unwrap(wrappingKey *Key, data *metadata.WrappedKeyData) (*Key, error) { if err := checkWrappingKey(wrappingKey); err != nil { return nil, err -- cgit v1.2.3