Lines Matching refs:ctx
274 void mbedtls_camellia_init(mbedtls_camellia_context *ctx)
276 memset(ctx, 0, sizeof(mbedtls_camellia_context));
279 void mbedtls_camellia_free(mbedtls_camellia_context *ctx)
281 if (ctx == NULL) {
285 mbedtls_platform_zeroize(ctx, sizeof(mbedtls_camellia_context));
291 int mbedtls_camellia_setkey_enc(mbedtls_camellia_context *ctx,
303 RK = ctx->rk;
306 memset(RK, 0, sizeof(ctx->rk));
309 case 128: ctx->nr = 3; idx = 0; break;
311 case 256: ctx->nr = 4; idx = 1; break;
403 int mbedtls_camellia_setkey_dec(mbedtls_camellia_context *ctx,
420 ctx->nr = cty.nr;
421 idx = (ctx->nr == 4);
423 RK = ctx->rk;
453 int mbedtls_camellia_crypt_ecb(mbedtls_camellia_context *ctx,
466 NR = ctx->nr;
467 RK = ctx->rk;
519 int mbedtls_camellia_crypt_cbc(mbedtls_camellia_context *ctx,
538 mbedtls_camellia_crypt_ecb(ctx, mode, input, output);
552 mbedtls_camellia_crypt_ecb(ctx, mode, output, output);
569 int mbedtls_camellia_crypt_cfb128(mbedtls_camellia_context *ctx,
591 mbedtls_camellia_crypt_ecb(ctx, MBEDTLS_CAMELLIA_ENCRYPT, iv, iv);
603 mbedtls_camellia_crypt_ecb(ctx, MBEDTLS_CAMELLIA_ENCRYPT, iv, iv);
622 int mbedtls_camellia_crypt_ctr(mbedtls_camellia_context *ctx,
640 mbedtls_camellia_crypt_ecb(ctx, MBEDTLS_CAMELLIA_ENCRYPT, nonce_counter,
879 mbedtls_camellia_context ctx;
881 mbedtls_camellia_init(&ctx);
907 mbedtls_camellia_setkey_dec(&ctx, key, 128 + u * 64);
913 mbedtls_camellia_setkey_enc(&ctx, key, 128 + u * 64);
918 mbedtls_camellia_crypt_ecb(&ctx, v, src, buf);
955 mbedtls_camellia_setkey_dec(&ctx, key, 128 + u * 64);
957 mbedtls_camellia_setkey_enc(&ctx, key, 128 + u * 64);
972 mbedtls_camellia_crypt_cbc(&ctx, v, 16, iv, src, buf);
1009 mbedtls_camellia_setkey_enc(&ctx, key, 128);
1015 mbedtls_camellia_crypt_ctr(&ctx, len, &offset, nonce_counter, stream_block,
1028 mbedtls_camellia_crypt_ctr(&ctx, len, &offset, nonce_counter, stream_block,
1052 mbedtls_camellia_free(&ctx);