armv8_crypto.c (c03414326909ed7a740be3ba63fbbef01fe513a8) armv8_crypto.c (29fe41ddd714bae92a09fd4098fad614945bedf5)
1/*-
2 * Copyright (c) 2005-2008 Pawel Jakub Dawidek <pjd@FreeBSD.org>
3 * Copyright (c) 2010 Konstantin Belousov <kib@FreeBSD.org>
4 * Copyright (c) 2014,2016 The FreeBSD Foundation
5 * All rights reserved.
6 *
7 * Portions of this software were developed by John-Mark Gurney
8 * under sponsorship of the FreeBSD Foundation and

--- 321 unchanged lines hidden (view full) ---

330 fpu_kern_enter(curthread, ctx,
331 FPU_KERN_NORMAL | FPU_KERN_KTHR);
332 }
333
334 if (crp->crp_cipher_key != NULL) {
335 panic("armv8: new cipher key");
336 }
337
1/*-
2 * Copyright (c) 2005-2008 Pawel Jakub Dawidek <pjd@FreeBSD.org>
3 * Copyright (c) 2010 Konstantin Belousov <kib@FreeBSD.org>
4 * Copyright (c) 2014,2016 The FreeBSD Foundation
5 * All rights reserved.
6 *
7 * Portions of this software were developed by John-Mark Gurney
8 * under sponsorship of the FreeBSD Foundation and

--- 321 unchanged lines hidden (view full) ---

330 fpu_kern_enter(curthread, ctx,
331 FPU_KERN_NORMAL | FPU_KERN_KTHR);
332 }
333
334 if (crp->crp_cipher_key != NULL) {
335 panic("armv8: new cipher key");
336 }
337
338 /* Setup iv */
339 if (crp->crp_flags & CRYPTO_F_IV_GENERATE) {
340 arc4rand(iv, csp->csp_ivlen, 0);
341 crypto_copyback(crp, crp->crp_iv_start, csp->csp_ivlen, iv);
342 } else if (crp->crp_flags & CRYPTO_F_IV_SEPARATE)
343 memcpy(iv, crp->crp_iv, csp->csp_ivlen);
344 else
345 crypto_copydata(crp, crp->crp_iv_start, csp->csp_ivlen, iv);
338 crypto_read_iv(crp, iv);
346
347 /* Do work */
348 switch (csp->csp_cipher_alg) {
349 case CRYPTO_AES_CBC:
350 if (encflag)
351 armv8_aes_encrypt_cbc(ses->rounds, ses->enc_schedule,
352 crp->crp_payload_length, buf, buf, iv);
353 else

--- 39 unchanged lines hidden ---
339
340 /* Do work */
341 switch (csp->csp_cipher_alg) {
342 case CRYPTO_AES_CBC:
343 if (encflag)
344 armv8_aes_encrypt_cbc(ses->rounds, ses->enc_schedule,
345 crp->crp_payload_length, buf, buf, iv);
346 else

--- 39 unchanged lines hidden ---