NewCiphers is a convenience function for creating multiple ciphers. It currently only supports AES-256-GCM.
(keys ...[]byte)
| 32 | // NewCiphers is a convenience function for creating multiple ciphers. |
| 33 | // It currently only supports AES-256-GCM. |
| 34 | func 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. |
| 47 | func cipherAES256(key []byte) (*aes256, error) { |