Lines Matching refs:ctx
46 static unsigned int crounds(struct siphash_data_st *ctx)
48 return ctx->crounds != 0 ? ctx->crounds : SIPHASH_C_ROUNDS;
51 static unsigned int drounds(struct siphash_data_st *ctx)
53 return ctx->drounds != 0 ? ctx->drounds : SIPHASH_D_ROUNDS;
58 struct siphash_data_st *ctx;
62 ctx = OPENSSL_zalloc(sizeof(*ctx));
63 if (ctx != NULL)
64 ctx->provctx = provctx;
65 return ctx;
90 struct siphash_data_st *ctx = vmacctx;
92 return SipHash_hash_size(&ctx->siphash);
95 static int siphash_setkey(struct siphash_data_st *ctx,
102 ret = SipHash_Init(&ctx->siphash, key, crounds(ctx), drounds(ctx));
104 ctx->sipcopy = ctx->siphash;
111 struct siphash_data_st *ctx = vmacctx;
113 if (!ossl_prov_is_running() || !siphash_set_params(ctx, params))
120 ctx->siphash = ctx->sipcopy;
123 return siphash_setkey(ctx, key, keylen);
129 struct siphash_data_st *ctx = vmacctx;
134 SipHash_Update(&ctx->siphash, data, datalen);
141 struct siphash_data_st *ctx = vmacctx;
142 size_t hlen = siphash_size(ctx);
148 return SipHash_Final(&ctx->siphash, out, hlen);
151 static const OSSL_PARAM *siphash_gettable_ctx_params(ossl_unused void *ctx,
166 struct siphash_data_st *ctx = vmacctx;
173 && !OSSL_PARAM_set_uint(p, crounds(ctx)))
176 && !OSSL_PARAM_set_uint(p, drounds(ctx)))
181 static const OSSL_PARAM *siphash_settable_ctx_params(ossl_unused void *ctx,
197 struct siphash_data_st *ctx = vmacctx;
206 || !SipHash_set_hash_size(&ctx->siphash, size)
207 || !SipHash_set_hash_size(&ctx->sipcopy, size))
211 && !OSSL_PARAM_get_uint(p, &ctx->crounds))
214 && !OSSL_PARAM_get_uint(p, &ctx->drounds))
218 || !siphash_setkey(ctx, p->data, p->data_size))