aboutsummaryrefslogtreecommitdiff
path: root/internal
diff options
context:
space:
mode:
Diffstat (limited to 'internal')
-rw-r--r--internal/stupidgcm/stupidgcm.go4
-rw-r--r--internal/syscallcompat/emulate.go3
2 files changed, 4 insertions, 3 deletions
diff --git a/internal/stupidgcm/stupidgcm.go b/internal/stupidgcm/stupidgcm.go
index c8aecca..59636c0 100644
--- a/internal/stupidgcm/stupidgcm.go
+++ b/internal/stupidgcm/stupidgcm.go
@@ -23,7 +23,7 @@ const (
tagLen = 16
)
-// stupidGCM implements the cipher.AEAD interface
+// StupidGCM implements the cipher.AEAD interface
type StupidGCM struct {
key []byte
forceDecode bool
@@ -42,10 +42,12 @@ func New(keyIn []byte, forceDecode bool) cipher.AEAD {
return &StupidGCM{key: key, forceDecode: forceDecode}
}
+// NonceSize returns the required size of the nonce / IV.
func (g *StupidGCM) NonceSize() int {
return ivLen
}
+// Overhead returns the number of bytes that are added for authentication.
func (g *StupidGCM) Overhead() int {
return tagLen
}
diff --git a/internal/syscallcompat/emulate.go b/internal/syscallcompat/emulate.go
index e5aeae7..c0a0d09 100644
--- a/internal/syscallcompat/emulate.go
+++ b/internal/syscallcompat/emulate.go
@@ -78,9 +78,8 @@ func emulateUnlinkat(dirfd int, path string, flags int) (err error) {
}
if (flags & unix.AT_REMOVEDIR) != 0 {
return syscall.Rmdir(path)
- } else {
- return syscall.Unlink(path)
}
+ return syscall.Unlink(path)
}
// emulateMknodat emulates the syscall for platforms that don't have it