NewSSEC returns a new server-side-encryption using SSE-C and the provided key. The key must be 32 bytes long.
(key []byte)
| 111 | // NewSSEC returns a new server-side-encryption using SSE-C and the provided key. |
| 112 | // The key must be 32 bytes long. |
| 113 | func NewSSEC(key []byte) (ServerSide, error) { |
| 114 | if len(key) != 32 { |
| 115 | return nil, errors.New("encrypt: SSE-C key must be 256 bit long") |
| 116 | } |
| 117 | sse := ssec{} |
| 118 | copy(sse[:], key) |
| 119 | return sse, nil |
| 120 | } |
| 121 | |
| 122 | // SSE transforms a SSE-C copy encryption into a SSE-C encryption. |
| 123 | // It is the inverse of SSECopy(...). |
no outgoing calls