Lines Matching defs:len
35 _write_pkcs7_pad(uint8_t *p, int len)
37 unsigned int n = 0, padlen = LWS_AES_CBC_BLOCKLEN * ((unsigned int)len /
38 LWS_AES_CBC_BLOCKLEN + 1) - (unsigned int)len;
40 p += len;
72 ctx->k->buf, ctx->k->len * 8);
90 ctx->k->len * 8);
96 ctx->k->len * 8);
104 ctx->k->len * 8);
115 ctx->k->len * 8);
119 ctx->k->len * 8);
290 lws_genaes_crypt(struct lws_genaes_ctx *ctx, const uint8_t *in, size_t len,
300 /* a key of length ctx->k->len is wrapped by a 128-bit KEK */
302 (ctx->op == MBEDTLS_AES_ENCRYPT ? (int)len * 8 :
303 ((int)len - 8) * 8), ctx->k->buf,
304 (int)ctx->k->len * 8,
325 lws_gencrypto_padded_length(LWS_AES_CBC_BLOCKLEN, len),
331 memcpy(padin, in, len);
332 len += _write_pkcs7_pad((uint8_t *)padin, (int)len);
333 n = mbedtls_aes_crypt_cbc(&ctx->u.ctx, (int)ctx->op, len, iv,
337 n = mbedtls_aes_crypt_cbc(&ctx->u.ctx, (int)ctx->op, len, iv,
344 n = mbedtls_aes_crypt_cfb128(&ctx->u.ctx, (int)ctx->op, len,
350 n = mbedtls_aes_crypt_cfb8(&ctx->u.ctx, (int)ctx->op, len, iv,
357 n = mbedtls_aes_crypt_ctr(&ctx->u.ctx, len, nc_or_iv_off,
370 n = mbedtls_aes_crypt_ofb(&ctx->u.ctx, len, nc_or_iv_off, iv,
380 n = mbedtls_aes_crypt_xts(&ctx->u.ctx_xts, (int)ctx->op, len, iv,
398 * additional data len: len
407 in, len);
411 *nc_or_iv_off, in, len);
426 n = mbedtls_gcm_update(&ctx->u.ctx_gcm, in, len, out, len, &al);
429 n = mbedtls_gcm_update(&ctx->u.ctx_gcm, len, in, out);
441 lwsl_notice("%s: failed: -0x%x, len %d\n", __func__, -n, (int)len);