Lines Matching refs:algo

129 static inline u32 ocs_hcu_num_chains(enum ocs_hcu_algo algo)  in ocs_hcu_num_chains()  argument
131 switch (algo) { in ocs_hcu_num_chains()
144 static inline u32 ocs_hcu_digest_size(enum ocs_hcu_algo algo) in ocs_hcu_digest_size() argument
146 switch (algo) { in ocs_hcu_digest_size()
245 enum ocs_hcu_algo algo) in ocs_hcu_get_intermediate_data() argument
247 const int n = ocs_hcu_num_chains(algo); in ocs_hcu_get_intermediate_data()
288 enum ocs_hcu_algo algo) in ocs_hcu_set_intermediate_data() argument
290 const int n = ocs_hcu_num_chains(algo); in ocs_hcu_set_intermediate_data()
308 enum ocs_hcu_algo algo, u8 *dgst, size_t dgst_len) in ocs_hcu_get_digest() argument
318 if (dgst_len != ocs_hcu_digest_size(algo)) in ocs_hcu_get_digest()
341 static int ocs_hcu_hw_cfg(struct ocs_hcu_dev *hcu_dev, enum ocs_hcu_algo algo, in ocs_hcu_hw_cfg() argument
347 if (algo != OCS_HCU_ALGO_SHA256 && algo != OCS_HCU_ALGO_SHA224 && in ocs_hcu_hw_cfg()
348 algo != OCS_HCU_ALGO_SHA384 && algo != OCS_HCU_ALGO_SHA512 && in ocs_hcu_hw_cfg()
349 algo != OCS_HCU_ALGO_SM3) in ocs_hcu_hw_cfg()
361 cfg |= algo << HCU_MODE_ALGO_SHIFT; in ocs_hcu_hw_cfg()
586 int ocs_hcu_hash_init(struct ocs_hcu_hash_ctx *ctx, enum ocs_hcu_algo algo) in ocs_hcu_hash_init() argument
591 ctx->algo = algo; in ocs_hcu_hash_init()
617 rc = ocs_hcu_hw_cfg(hcu_dev, ctx->algo, false); in ocs_hcu_hash_update()
623 ocs_hcu_set_intermediate_data(hcu_dev, &ctx->idata, ctx->algo); in ocs_hcu_hash_update()
631 return ocs_hcu_get_intermediate_data(hcu_dev, &ctx->idata, ctx->algo); in ocs_hcu_hash_update()
655 rc = ocs_hcu_hw_cfg(hcu_dev, ctx->algo, false); in ocs_hcu_hash_finup()
661 ocs_hcu_set_intermediate_data(hcu_dev, &ctx->idata, ctx->algo); in ocs_hcu_hash_finup()
669 return ocs_hcu_get_digest(hcu_dev, ctx->algo, dgst, dgst_len); in ocs_hcu_hash_finup()
691 rc = ocs_hcu_hw_cfg(hcu_dev, ctx->algo, false); in ocs_hcu_hash_final()
697 ocs_hcu_set_intermediate_data(hcu_dev, &ctx->idata, ctx->algo); in ocs_hcu_hash_final()
712 return ocs_hcu_get_digest(hcu_dev, ctx->algo, dgst, dgst_len); in ocs_hcu_hash_final()
726 int ocs_hcu_digest(struct ocs_hcu_dev *hcu_dev, enum ocs_hcu_algo algo, in ocs_hcu_digest() argument
735 rc = ocs_hcu_hw_cfg(hcu_dev, algo, false); in ocs_hcu_digest()
762 return ocs_hcu_get_digest(hcu_dev, algo, dgst, dgst_len); in ocs_hcu_digest()
777 int ocs_hcu_hmac(struct ocs_hcu_dev *hcu_dev, enum ocs_hcu_algo algo, in ocs_hcu_hmac() argument
789 rc = ocs_hcu_hw_cfg(hcu_dev, algo, true); in ocs_hcu_hmac()
805 return ocs_hcu_get_digest(hcu_dev, algo, dgst, dgst_len); in ocs_hcu_hmac()