summaryrefslogtreecommitdiff
path: root/src/pkg/crypto/des/cipher.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/pkg/crypto/des/cipher.go')
-rw-r--r--src/pkg/crypto/des/cipher.go11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/pkg/crypto/des/cipher.go b/src/pkg/crypto/des/cipher.go
index d17a1a783..fc252c813 100644
--- a/src/pkg/crypto/des/cipher.go
+++ b/src/pkg/crypto/des/cipher.go
@@ -4,17 +4,14 @@
package des
-import (
- "os"
- "strconv"
-)
+import "strconv"
// The DES block size in bytes.
const BlockSize = 8
type KeySizeError int
-func (k KeySizeError) String() string {
+func (k KeySizeError) Error() string {
return "crypto/des: invalid key size " + strconv.Itoa(int(k))
}
@@ -24,7 +21,7 @@ type Cipher struct {
}
// NewCipher creates and returns a new Cipher.
-func NewCipher(key []byte) (*Cipher, os.Error) {
+func NewCipher(key []byte) (*Cipher, error) {
if len(key) != 8 {
return nil, KeySizeError(len(key))
}
@@ -60,7 +57,7 @@ type TripleDESCipher struct {
}
// NewCipher creates and returns a new Cipher.
-func NewTripleDESCipher(key []byte) (*TripleDESCipher, os.Error) {
+func NewTripleDESCipher(key []byte) (*TripleDESCipher, error) {
if len(key) != 24 {
return nil, KeySizeError(len(key))
}