MCPcopy Index your code
hub / github.com/coder/coder / NewCiphers

Function NewCiphers

enterprise/dbcrypt/cipher.go:34–44  ·  view source on GitHub ↗

NewCiphers is a convenience function for creating multiple ciphers. It currently only supports AES-256-GCM.

(keys ...[]byte)

Source from the content-addressed store, hash-verified

32// NewCiphers is a convenience function for creating multiple ciphers.
33// It currently only supports AES-256-GCM.
34func NewCiphers(keys ...[]byte) ([]Cipher, error) {
35 var cs []Cipher
36 for _, key := range keys {
37 c, err := cipherAES256(key)
38 if err != nil {
39 return nil, err
40 }
41 cs = append(cs, c)
42 }
43 return cs, nil
44}
45
46// cipherAES256 returns a new AES-256 cipher.
47func cipherAES256(key []byte) (*aes256, error) {

Calls 1

cipherAES256Function · 0.85