Documentation ¶
Overview ¶
Package cryptocore wraps OpenSSL and Go GCM crypto and provides a nonce generator.
Index ¶
Constants ¶
View Source
const ( // HaveModernGoGCM indicates if Go GCM supports 128-bit nonces HaveModernGoGCM = true )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BackendTypeEnum ¶
type BackendTypeEnum int
BackendTypeEnum indicates the type of backend in use.
const ( // KeyLen is the cipher key length in bytes. 32 for AES-256. KeyLen = 32 // AuthTagLen is the length of a GCM auth tag in bytes. AuthTagLen = 16 // BackendOpenSSL specifies the OpenSSL backend. BackendOpenSSL BackendTypeEnum = iota // BackendGoGCM specifies the Go based GCM backend. BackendGoGCM BackendTypeEnum = iota // BackendAESSIV specifies an AESSIV backend. BackendAESSIV BackendTypeEnum = iota )
type CryptoCore ¶
type CryptoCore struct { // AES-256 block cipher. This is used for EME filename encryption. BlockCipher cipher.Block // GCM or AES-SIV. This is used for content encryption. AEADCipher cipher.AEAD // Which backend is behind AEADCipher? AEADBackend BackendTypeEnum // GCM needs unique IVs (nonces) IVGenerator *nonceGenerator IVLen int }
CryptoCore is the low level crypto implementation.
func New ¶
func New(key []byte, backend BackendTypeEnum, IVBitLen int) *CryptoCore
New returns a new CryptoCore object or panics.
Even though the "GCMIV128" feature flag is now mandatory, we must still support 96-bit IVs here because they are used for encrypting the master key in gocryptfs.conf.
Click to show internal directories.
Click to hide internal directories.