Lines Matching refs:inlen
50 const unsigned char *in, size_t inlen, in CRYPTO_128_wrap() argument
55 if ((inlen & 0x7) || (inlen < 16) || (inlen > CRYPTO128_WRAP_MAX)) in CRYPTO_128_wrap()
59 memmove(out + 8, in, inlen); in CRYPTO_128_wrap()
67 for (i = 0; i < inlen; i += 8, t++, R += 8) { in CRYPTO_128_wrap()
80 return inlen + 8; in CRYPTO_128_wrap()
101 const unsigned char *in, size_t inlen, in crypto_128_unwrap_raw() argument
106 inlen -= 8; in crypto_128_unwrap_raw()
107 if ((inlen & 0x7) || (inlen < 16) || (inlen > CRYPTO128_WRAP_MAX)) in crypto_128_unwrap_raw()
110 t = 6 * (inlen >> 3); in crypto_128_unwrap_raw()
112 memmove(out, in + 8, inlen); in crypto_128_unwrap_raw()
114 R = out + inlen - 8; in crypto_128_unwrap_raw()
115 for (i = 0; i < inlen; i += 8, t--, R -= 8) { in crypto_128_unwrap_raw()
128 return inlen; in crypto_128_unwrap_raw()
152 size_t inlen, block128_f block) in CRYPTO_128_unwrap() argument
157 ret = crypto_128_unwrap_raw(key, got_iv, out, in, inlen, block); in CRYPTO_128_unwrap()
185 const unsigned char *in, size_t inlen, in CRYPTO_128_wrap_pad() argument
194 const size_t blocks_padded = (inlen + 7) / 8; /* CEILING(m/8) */ in CRYPTO_128_wrap_pad()
196 const size_t padding_len = padded_len - inlen; in CRYPTO_128_wrap_pad()
202 if (inlen == 0 || inlen >= CRYPTO128_WRAP_MAX) in CRYPTO_128_wrap_pad()
211 aiv[4] = (inlen >> 24) & 0xFF; in CRYPTO_128_wrap_pad()
212 aiv[5] = (inlen >> 16) & 0xFF; in CRYPTO_128_wrap_pad()
213 aiv[6] = (inlen >> 8) & 0xFF; in CRYPTO_128_wrap_pad()
214 aiv[7] = inlen & 0xFF; in CRYPTO_128_wrap_pad()
222 memmove(out + 8, in, inlen); in CRYPTO_128_wrap_pad()
224 memset(out + 8 + inlen, 0, padding_len); in CRYPTO_128_wrap_pad()
228 memmove(out, in, inlen); in CRYPTO_128_wrap_pad()
229 memset(out + inlen, 0, padding_len); /* Section 4.1 step 1 */ in CRYPTO_128_wrap_pad()
253 const unsigned char *in, size_t inlen, in CRYPTO_128_unwrap_pad() argument
257 size_t n = inlen / 8 - 1; in CRYPTO_128_unwrap_pad()
267 if ((inlen & 0x7) != 0 || inlen < 16 || inlen >= CRYPTO128_WRAP_MAX) in CRYPTO_128_unwrap_pad()
270 if (inlen == 16) { in CRYPTO_128_unwrap_pad()
284 OPENSSL_cleanse(buff, inlen); in CRYPTO_128_unwrap_pad()
286 padded_len = inlen - 8; in CRYPTO_128_unwrap_pad()
287 ret = crypto_128_unwrap_raw(key, aiv, out, in, inlen, block); in CRYPTO_128_unwrap_pad()
289 OPENSSL_cleanse(out, inlen); in CRYPTO_128_unwrap_pad()
301 OPENSSL_cleanse(out, inlen); in CRYPTO_128_unwrap_pad()
315 OPENSSL_cleanse(out, inlen); in CRYPTO_128_unwrap_pad()
325 OPENSSL_cleanse(out, inlen); in CRYPTO_128_unwrap_pad()