Lines Matching refs:len

100                                  unsigned char *out, size_t len)  in cts128_cs1_encrypt()  argument
105 residue = len % CTS_BLOCK_SIZE; in cts128_cs1_encrypt()
106 len -= residue; in cts128_cs1_encrypt()
107 if (!ctx->hw->cipher(ctx, out, in, len)) in cts128_cs1_encrypt()
111 return len; in cts128_cs1_encrypt()
113 in += len; in cts128_cs1_encrypt()
114 out += len; in cts128_cs1_encrypt()
121 return len + residue; in cts128_cs1_encrypt()
125 size_t len, unsigned char *out) in do_xor() argument
129 for (i = 0; i < len; ++i) in do_xor()
134 unsigned char *out, size_t len) in cts128_cs1_decrypt() argument
139 residue = len % CTS_BLOCK_SIZE; in cts128_cs1_decrypt()
142 if (!ctx->hw->cipher(ctx, out, in, len)) in cts128_cs1_decrypt()
144 return len; in cts128_cs1_decrypt()
147 len -= CTS_BLOCK_SIZE + residue; in cts128_cs1_decrypt()
148 if (len > 0) { in cts128_cs1_decrypt()
149 if (!ctx->hw->cipher(ctx, out, in, len)) in cts128_cs1_decrypt()
151 in += len; in cts128_cs1_decrypt()
152 out += len; in cts128_cs1_decrypt()
192 return len + CTS_BLOCK_SIZE + residue; in cts128_cs1_decrypt()
196 unsigned char *out, size_t len) in cts128_cs3_encrypt() argument
201 if (len < CTS_BLOCK_SIZE) /* CS3 requires at least one block */ in cts128_cs3_encrypt()
205 if (len == CTS_BLOCK_SIZE) in cts128_cs3_encrypt()
206 return ctx->hw->cipher(ctx, out, in, len) ? len : 0; in cts128_cs3_encrypt()
208 residue = len % CTS_BLOCK_SIZE; in cts128_cs3_encrypt()
211 len -= residue; in cts128_cs3_encrypt()
213 if (!ctx->hw->cipher(ctx, out, in, len)) in cts128_cs3_encrypt()
216 in += len; in cts128_cs3_encrypt()
217 out += len; in cts128_cs3_encrypt()
224 return len + residue; in cts128_cs3_encrypt()
236 unsigned char *out, size_t len) in cts128_cs3_decrypt() argument
241 if (len < CTS_BLOCK_SIZE) /* CS3 requires at least one block */ in cts128_cs3_decrypt()
245 if (len == CTS_BLOCK_SIZE) in cts128_cs3_decrypt()
246 return ctx->hw->cipher(ctx, out, in, len) ? len : 0; in cts128_cs3_decrypt()
249 residue = len % CTS_BLOCK_SIZE; in cts128_cs3_decrypt()
252 len -= CTS_BLOCK_SIZE + residue; in cts128_cs3_decrypt()
254 if (len > 0) { in cts128_cs3_decrypt()
255 if (!ctx->hw->cipher(ctx, out, in, len)) in cts128_cs3_decrypt()
257 in += len; in cts128_cs3_decrypt()
258 out += len; in cts128_cs3_decrypt()
298 return len + CTS_BLOCK_SIZE + residue; in cts128_cs3_decrypt()
302 unsigned char *out, size_t len) in cts128_cs2_encrypt() argument
304 if (len % CTS_BLOCK_SIZE == 0) { in cts128_cs2_encrypt()
306 if (!ctx->hw->cipher(ctx, out, in, len)) in cts128_cs2_encrypt()
308 return len; in cts128_cs2_encrypt()
311 return cts128_cs3_encrypt(ctx, in, out, len); in cts128_cs2_encrypt()
315 unsigned char *out, size_t len) in cts128_cs2_decrypt() argument
317 if (len % CTS_BLOCK_SIZE == 0) { in cts128_cs2_decrypt()
319 if (!ctx->hw->cipher(ctx, out, in, len)) in cts128_cs2_decrypt()
321 return len; in cts128_cs2_decrypt()
324 return cts128_cs3_decrypt(ctx, in, out, len); in cts128_cs2_decrypt()