Lines Matching refs:ctx
46 void mbedtls_nist_kw_init(mbedtls_nist_kw_context *ctx)
48 memset(ctx, 0, sizeof(mbedtls_nist_kw_context));
51 int mbedtls_nist_kw_setkey(mbedtls_nist_kw_context *ctx,
84 mbedtls_cipher_free(&ctx->cipher_ctx);
86 if ((ret = mbedtls_cipher_setup(&ctx->cipher_ctx, cipher_info)) != 0) {
90 if ((ret = mbedtls_cipher_setkey(&ctx->cipher_ctx, key, keybits,
103 void mbedtls_nist_kw_free(mbedtls_nist_kw_context *ctx)
105 mbedtls_cipher_free(&ctx->cipher_ctx);
106 mbedtls_platform_zeroize(ctx, sizeof(mbedtls_nist_kw_context));
125 int mbedtls_nist_kw_wrap(mbedtls_nist_kw_context *ctx,
196 ret = mbedtls_cipher_update(&ctx->cipher_ctx,
218 ret = mbedtls_cipher_update(&ctx->cipher_ctx,
256 static int unwrap(mbedtls_nist_kw_context *ctx,
285 ret = mbedtls_cipher_update(&ctx->cipher_ctx,
319 int mbedtls_nist_kw_unwrap(mbedtls_nist_kw_context *ctx,
347 ret = unwrap(ctx, input, in_len / KW_SEMIBLOCK_LENGTH,
378 ret = mbedtls_cipher_update(&ctx->cipher_ctx,
390 ret = unwrap(ctx, input, in_len / KW_SEMIBLOCK_LENGTH,
582 mbedtls_nist_kw_context ctx;
587 mbedtls_nist_kw_init(&ctx);
600 ret = mbedtls_nist_kw_setkey(&ctx, MBEDTLS_CIPHER_ID_AES,
610 ret = mbedtls_nist_kw_wrap(&ctx, MBEDTLS_KW_MODE_KW, kw_msg[i],
622 if ((ret = mbedtls_nist_kw_setkey(&ctx, MBEDTLS_CIPHER_ID_AES,
632 ret = mbedtls_nist_kw_unwrap(&ctx, MBEDTLS_KW_MODE_KW,
663 ret = mbedtls_nist_kw_setkey(&ctx, MBEDTLS_CIPHER_ID_AES, kwp_key[i],
672 ret = mbedtls_nist_kw_wrap(&ctx, MBEDTLS_KW_MODE_KWP, kwp_msg[i],
685 if ((ret = mbedtls_nist_kw_setkey(&ctx, MBEDTLS_CIPHER_ID_AES,
695 ret = mbedtls_nist_kw_unwrap(&ctx, MBEDTLS_KW_MODE_KWP, out,
714 mbedtls_nist_kw_free(&ctx);