Lines 536-548
Link Here
|
536 |
crp->crp_digest_start = 0; |
536 |
crp->crp_digest_start = 0; |
537 |
crp->crp_payload_start = sc->sc_alen; |
537 |
crp->crp_payload_start = sc->sc_alen; |
538 |
crp->crp_payload_length = data_secsize; |
538 |
crp->crp_payload_length = data_secsize; |
539 |
crp->crp_flags |= CRYPTO_F_IV_SEPARATE; |
|
|
540 |
if ((sc->sc_flags & G_ELI_FLAG_FIRST_KEY) == 0) { |
539 |
if ((sc->sc_flags & G_ELI_FLAG_FIRST_KEY) == 0) { |
541 |
crp->crp_cipher_key = g_eli_key_hold(sc, dstoff, |
540 |
crp->crp_cipher_key = g_eli_key_hold(sc, dstoff, |
542 |
encr_secsize); |
541 |
encr_secsize); |
543 |
} |
542 |
} |
544 |
g_eli_crypto_ivgen(sc, dstoff, crp->crp_iv, |
543 |
if (g_eli_ivlen(sc->sc_ealgo) != 0) { |
545 |
sizeof(crp->crp_iv)); |
544 |
crp->crp_flags |= CRYPTO_F_IV_SEPARATE; |
|
|
545 |
g_eli_crypto_ivgen(sc, dstoff, crp->crp_iv, |
546 |
sizeof(crp->crp_iv)); |
547 |
} |
546 |
|
548 |
|
547 |
g_eli_auth_keygen(sc, dstoff, authkey); |
549 |
g_eli_auth_keygen(sc, dstoff, authkey); |
548 |
crp->crp_auth_key = authkey; |
550 |
crp->crp_auth_key = authkey; |