ivp = iv;
/*
- * xforms that provide a reinit method perform all IV
- * handling themselves.
- */
- if (exf->reinit)
- exf->reinit(sw->sw_kschedule, iv);
-
- /*
* The semantics are seriously broken because the session key
* storage was never designed for concurrent ops.
*/
explicit_kschedule = 0;
}
+ /*
+ * xforms that provide a reinit method perform all IV
+ * handling themselves.
+ */
+ if (exf->reinit)
+ exf->reinit(kschedule, iv);
+
if (flags & CRYPTO_F_IMBUF) {
struct mbuf *m = (struct mbuf *) buf;
/*
* contiguous buffer
*/
- if (crd->crd_flags & CRD_F_ENCRYPT) {
+ if (exf->reinit) {
+ for(i = crd->crd_skip;
+ i < crd->crd_skip + crd->crd_len; i += blks) {
+ if (crd->crd_flags & CRD_F_ENCRYPT) {
+ exf->encrypt(kschedule, buf + i);
+ } else {
+ exf->decrypt(kschedule, buf + i);
+ }
+ }
+ } else if (crd->crd_flags & CRD_F_ENCRYPT) {
for (i = crd->crd_skip;
i < crd->crd_skip + crd->crd_len; i += blks) {
/* XOR with the IV/previous block, as appropriate. */