Lines Matching refs:ctx

38 static rt_uint32_t swm_crc_update(struct hwcrypto_crc *ctx, const rt_uint8_t *in, rt_size_t length)  in swm_crc_update()  argument
41 …struct swm_hwcrypto_device *hwcrypto_dev = (struct swm_hwcrypto_device *)ctx->parent.device->user_… in swm_crc_update()
43 struct swm_crc_cfg *crc_cfg = (struct swm_crc_cfg *)(ctx->parent.contex); in swm_crc_update()
47 if (memcmp(&swm_crc_cfg, &ctx->crc_cfg, sizeof(struct hwcrypto_crc_cfg)) != 0) in swm_crc_update()
51 crc_cfg->CRC_initstruct.init_crc = ctx->crc_cfg.last_val; in swm_crc_update()
53 switch (ctx->crc_cfg.poly) in swm_crc_update()
72 switch (ctx->crc_cfg.width) in swm_crc_update()
87 switch (ctx->crc_cfg.flags) in swm_crc_update()
112 memcpy(&swm_crc_cfg, &ctx->crc_cfg, sizeof(struct hwcrypto_crc_cfg)); in swm_crc_update()
119 ctx->crc_cfg.last_val = result; in swm_crc_update()
121 swm_crc_cfg.last_val = ctx->crc_cfg.last_val; in swm_crc_update()
122 result = (result ? result ^ (ctx->crc_cfg.xorout) : result); in swm_crc_update()
143 static rt_uint32_t swm_rng_update(struct hwcrypto_rng *ctx) in swm_rng_update() argument
147 struct swm_rng_cfg *rng_cfg = (struct swm_rng_cfg *)(ctx->parent.contex); in swm_rng_update()
162 static rt_err_t swm_crypto_create(struct rt_hwcrypto_ctx *ctx) in swm_crypto_create() argument
166 switch (ctx->type & HWCRYPTO_MAIN_TYPE_MASK) in swm_crypto_create()
178 ctx->contex = crc_cfg; in swm_crypto_create()
179 ((struct hwcrypto_crc *)ctx)->ops = &swm_crc_ops; in swm_crypto_create()
198 ctx->contex = rng_cfg; in swm_crypto_create()
199 ((struct hwcrypto_rng *)ctx)->ops = &swm_rng_ops; in swm_crypto_create()
212 static void swm_crypto_destroy(struct rt_hwcrypto_ctx *ctx) in swm_crypto_destroy() argument
214 struct swm_crc_cfg *crc_cfg = (struct swm_crc_cfg *)(ctx->contex); in swm_crypto_destroy()
215 switch (ctx->type & HWCRYPTO_MAIN_TYPE_MASK) in swm_crypto_destroy()
232 rt_free(ctx->contex); in swm_crypto_destroy()
266 static void swm_crypto_reset(struct rt_hwcrypto_ctx *ctx) in swm_crypto_reset() argument
268 struct swm_crc_cfg *crc_cfg = (struct swm_crc_cfg *)(ctx->contex); in swm_crypto_reset()
269 switch (ctx->type & HWCRYPTO_MAIN_TYPE_MASK) in swm_crypto_reset()