padlock_cipher.c (f91ab858cf2bcadcc5978ec919a40681906c4f01) | padlock_cipher.c (29fe41ddd714bae92a09fd4098fad614945bedf5) |
---|---|
1/*- 2 * Copyright (c) 2005-2006 Pawel Jakub Dawidek <pjd@FreeBSD.org> 3 * Copyright (c) 2004 Mark R V Murray 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: --- 195 unchanged lines hidden (view full) --- 204 } 205 206 cw = &ses->ses_cw; 207 cw->cw_filler0 = 0; 208 cw->cw_filler1 = 0; 209 cw->cw_filler2 = 0; 210 cw->cw_filler3 = 0; 211 | 1/*- 2 * Copyright (c) 2005-2006 Pawel Jakub Dawidek <pjd@FreeBSD.org> 3 * Copyright (c) 2004 Mark R V Murray 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: --- 195 unchanged lines hidden (view full) --- 204 } 205 206 cw = &ses->ses_cw; 207 cw->cw_filler0 = 0; 208 cw->cw_filler1 = 0; 209 cw->cw_filler2 = 0; 210 cw->cw_filler3 = 0; 211 |
212 if (crp->crp_flags & CRYPTO_F_IV_GENERATE) { 213 arc4rand(iv, AES_BLOCK_LEN, 0); 214 crypto_copyback(crp, crp->crp_iv_start, AES_BLOCK_LEN, iv); 215 } else if (crp->crp_flags & CRYPTO_F_IV_SEPARATE) 216 memcpy(iv, crp->crp_iv, AES_BLOCK_LEN); 217 else 218 crypto_copydata(crp, crp->crp_iv_start, AES_BLOCK_LEN, iv); | 212 crypto_read_iv(crp, iv); |
219 220 if (CRYPTO_OP_IS_ENCRYPT(crp->crp_op)) { 221 cw->cw_direction = PADLOCK_DIRECTION_ENCRYPT; 222 key = ses->ses_ekey; 223 } else { 224 cw->cw_direction = PADLOCK_DIRECTION_DECRYPT; 225 key = ses->ses_dkey; 226 } --- 21 unchanged lines hidden --- | 213 214 if (CRYPTO_OP_IS_ENCRYPT(crp->crp_op)) { 215 cw->cw_direction = PADLOCK_DIRECTION_ENCRYPT; 216 key = ses->ses_ekey; 217 } else { 218 cw->cw_direction = PADLOCK_DIRECTION_DECRYPT; 219 key = ses->ses_dkey; 220 } --- 21 unchanged lines hidden --- |