Documentation ¶
Index ¶
Constants ¶
View Source
const ( // BlockSize for aes256-gcm is 32 bytes BlockSize = (1 << 5) // ScryptN is the CPU/memory cost parameter for Scrypt ScryptN = (1 << 18) // ScryptR is the blocksize parameter for Scrypt ScryptR = (1 << 3) // ScryptP is the parallelization parameter for Scrypt ScryptP = 1 )
View Source
const (
// EdDSA is used to generate ed25519 keys
EdDSA = 1
)
View Source
const ( // PublicKeySize is 32 bytes (compressed) PublicKeySize = ed25519.PublicKeySize )
Variables ¶
View Source
var ( // ErrKeyLen is thrown on an invalid key length ErrKeyLen = errors.New("invalid key length") // ErrKeyType is thrown on an invalid key type ErrKeyType = errors.New("invalid key type") )
Functions ¶
Types ¶
type Cipher ¶
type Cipher struct { Payload []byte `json:"payload"` IV []byte `json:"iv"` Salt []byte `json:"salt"` Nonce []byte `json:"nonce"` N int `json:"n"` R int `json:"r"` P int `json:"p"` }
Cipher wraps an aes256-gcm block cipher with scrypt for key derivation
Click to show internal directories.
Click to hide internal directories.