(key, iv, src []byte)
| 173 | } |
| 174 | |
| 175 | func encrypt(key, iv, src []byte) ([]byte, error) { |
| 176 | ivCopy := make([]byte, 16) |
| 177 | copy(ivCopy, iv[:]) |
| 178 | cipher, err := y.XORBlockAllocate(src, key, ivCopy) |
| 179 | if err != nil { |
| 180 | return nil, err |
| 181 | } |
| 182 | return cipher, nil |
| 183 | } |
| 184 | |
| 185 | // used to verify client has correct key and can decrypt audit log header |
| 186 | func decrypt(key, iv, src []byte) ([]byte, error) { |