Re-design of the original gocryptfs code to work as a library.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
libgocryptfs/internal/stupidgcm/without_openssl.go

48 lines
864 B

// +build without_openssl
package stupidgcm
import (
"os"
"github.com/rfjakob/gocryptfs/internal/tlog"
)
type stupidGCM struct{}
const (
// BuiltWithoutOpenssl indicates if openssl been disabled at compile-time
BuiltWithoutOpenssl = true
)
func errExit() {
tlog.Fatal.Println("gocryptfs has been compiled without openssl support but you are still trying to use openssl")
os.Exit(2)
}
func New(_ []byte) stupidGCM {
errExit()
// This panic is never reached, but having it here stops the Go compiler
// from complaining about the missing return code.
panic("")
}
func (g stupidGCM) NonceSize() int {
errExit()
panic("")
}
func (g stupidGCM) Overhead() int {
errExit()
panic("")
}
func (g stupidGCM) Seal(_, _, _, _ []byte) []byte {
errExit()
panic("")
}
func (g stupidGCM) Open(_, _, _, _ []byte) ([]byte, error) {
errExit()
panic("")
}