208
206
guard (S.length dataBS >= 48) -- 16 bytes of IV + 32 bytes of Skein-MAC-512-256
209
207
let (auth, toBeAuthed) = S.splitAt 32 dataBS
210
208
auth' = macKey key toBeAuthed
212
210
let (iv_e, encrypted) = S.splitAt 16 toBeAuthed
213
211
iv <- either (const Nothing) Just $ decode iv_e
214
212
let (x, _) = Modes.unCtr' Modes.incIV (aesKey key) iv encrypted
222
215
-- Significantly more efficient random IV generation. Initial
223
216
-- benchmarks placed it at 6.06 us versus 1.69 ms for Modes.getIVIO,
224
217
-- since it does not require /dev/urandom I/O for every call.