Documentation ¶
Overview ¶
Package stupidgcm is a thin wrapper for OpenSSL's GCM encryption and decryption functions. It only support 32-byte keys and 16-bit IVs.
Index ¶
Constants ¶
View Source
const ( // BuiltWithoutOpenssl indicates if openssl been disabled at compile-time BuiltWithoutOpenssl = false )
Variables ¶
View Source
var ErrAuth = fmt.Errorf("stupidgcm: message authentication failed")
ErrAuth is returned when the message authentication fails
Functions ¶
func PreferOpenSSL ¶
func PreferOpenSSL() bool
PreferOpenSSL tells us if OpenSSL is faster than Go GCM on this machine.
Go GCM is only faster if the CPU either:
- Is X86_64 && has AES instructions && Go is v1.6 or higher
- Is ARM64 && has AES instructions && Go is v1.11 or higher (commit https://github.com/golang/go/commit/4f1f503373cda7160392be94e3849b0c9b9ebbda)
See https://github.com/rfjakob/gocryptfs/wiki/CPU-Benchmarks for benchmarks.
Types ¶
type StupidGCM ¶
type StupidGCM struct {
// contains filtered or unexported fields
}
StupidGCM implements the cipher.AEAD interface
func (*StupidGCM) Open ¶
Open decrypts "in" using "iv" and "authData" and append the result to "dst"
func (*StupidGCM) Overhead ¶
Overhead returns the number of bytes that are added for authentication.
Click to show internal directories.
Click to hide internal directories.