Home
last modified time | relevance | path

Searched refs:algo (Results 1 – 25 of 574) sorted by relevance

12345678910>>...23

/OK3568_Linux_fs/u-boot/common/
H A Dhash.c34 static int hash_init_sha1(struct hash_algo *algo, void **ctxp) in hash_init_sha1() argument
42 static int hash_update_sha1(struct hash_algo *algo, void *ctx, const void *buf, in hash_update_sha1() argument
49 static int hash_finish_sha1(struct hash_algo *algo, void *ctx, void *dest_buf, in hash_finish_sha1() argument
52 if (size < algo->digest_size) in hash_finish_sha1()
62 static int hash_init_sha256(struct hash_algo *algo, void **ctxp) in hash_init_sha256() argument
70 static int hash_update_sha256(struct hash_algo *algo, void *ctx, in hash_update_sha256() argument
77 static int hash_finish_sha256(struct hash_algo *algo, void *ctx, void in hash_finish_sha256() argument
80 if (size < algo->digest_size) in hash_finish_sha256()
89 static int hash_init_crc32(struct hash_algo *algo, void **ctxp) in hash_init_crc32() argument
97 static int hash_update_crc32(struct hash_algo *algo, void *ctx, in hash_update_crc32() argument
[all …]
/OK3568_Linux_fs/external/security/rk_tee_user/v2/export-ta_arm32/include/
H A Dutee_defines.h55 static inline uint32_t __tee_alg_get_class(uint32_t algo) in __tee_alg_get_class() argument
57 if (algo == TEE_ALG_SM2_PKE) in __tee_alg_get_class()
59 if (algo == TEE_ALG_SM2_KEP) in __tee_alg_get_class()
61 if (algo == TEE_ALG_RSASSA_PKCS1_V1_5) in __tee_alg_get_class()
63 if (algo == TEE_ALG_DES3_CMAC) in __tee_alg_get_class()
66 return (algo >> 28) & 0xF; /* Bits [31:28] */ in __tee_alg_get_class()
69 #define TEE_ALG_GET_CLASS(algo) __tee_alg_get_class(algo) argument
71 static inline uint32_t __tee_alg_get_main_alg(uint32_t algo) in __tee_alg_get_main_alg() argument
73 switch (algo) { in __tee_alg_get_main_alg()
82 return algo & 0xff; in __tee_alg_get_main_alg()
[all …]
/OK3568_Linux_fs/external/security/rk_tee_user/v2/export-ta_arm64/host_include/
H A Dutee_defines.h55 static inline uint32_t __tee_alg_get_class(uint32_t algo) in __tee_alg_get_class() argument
57 if (algo == TEE_ALG_SM2_PKE) in __tee_alg_get_class()
59 if (algo == TEE_ALG_SM2_KEP) in __tee_alg_get_class()
61 if (algo == TEE_ALG_RSASSA_PKCS1_V1_5) in __tee_alg_get_class()
63 if (algo == TEE_ALG_DES3_CMAC) in __tee_alg_get_class()
66 return (algo >> 28) & 0xF; /* Bits [31:28] */ in __tee_alg_get_class()
69 #define TEE_ALG_GET_CLASS(algo) __tee_alg_get_class(algo) argument
71 static inline uint32_t __tee_alg_get_main_alg(uint32_t algo) in __tee_alg_get_main_alg() argument
73 switch (algo) { in __tee_alg_get_main_alg()
82 return algo & 0xff; in __tee_alg_get_main_alg()
[all …]
/OK3568_Linux_fs/external/security/rk_tee_user/v2/export-ta_arm64/include/
H A Dutee_defines.h55 static inline uint32_t __tee_alg_get_class(uint32_t algo) in __tee_alg_get_class() argument
57 if (algo == TEE_ALG_SM2_PKE) in __tee_alg_get_class()
59 if (algo == TEE_ALG_SM2_KEP) in __tee_alg_get_class()
61 if (algo == TEE_ALG_RSASSA_PKCS1_V1_5) in __tee_alg_get_class()
63 if (algo == TEE_ALG_DES3_CMAC) in __tee_alg_get_class()
66 return (algo >> 28) & 0xF; /* Bits [31:28] */ in __tee_alg_get_class()
69 #define TEE_ALG_GET_CLASS(algo) __tee_alg_get_class(algo) argument
71 static inline uint32_t __tee_alg_get_main_alg(uint32_t algo) in __tee_alg_get_main_alg() argument
73 switch (algo) { in __tee_alg_get_main_alg()
82 return algo & 0xff; in __tee_alg_get_main_alg()
[all …]
/OK3568_Linux_fs/external/security/rk_tee_user/v2/export-ta_arm32/host_include/
H A Dutee_defines.h55 static inline uint32_t __tee_alg_get_class(uint32_t algo) in __tee_alg_get_class() argument
57 if (algo == TEE_ALG_SM2_PKE) in __tee_alg_get_class()
59 if (algo == TEE_ALG_SM2_KEP) in __tee_alg_get_class()
61 if (algo == TEE_ALG_RSASSA_PKCS1_V1_5) in __tee_alg_get_class()
63 if (algo == TEE_ALG_DES3_CMAC) in __tee_alg_get_class()
66 return (algo >> 28) & 0xF; /* Bits [31:28] */ in __tee_alg_get_class()
69 #define TEE_ALG_GET_CLASS(algo) __tee_alg_get_class(algo) argument
71 static inline uint32_t __tee_alg_get_main_alg(uint32_t algo) in __tee_alg_get_main_alg() argument
73 switch (algo) { in __tee_alg_get_main_alg()
82 return algo & 0xff; in __tee_alg_get_main_alg()
[all …]
/OK3568_Linux_fs/kernel/lib/raid6/
H A Dalgos.c126 const struct raid6_recov_calls *const *algo; in raid6_choose_recov() local
129 for (best = NULL, algo = raid6_recov_algos; *algo; algo++) in raid6_choose_recov()
130 if (!best || (*algo)->priority > best->priority) in raid6_choose_recov()
131 if (!(*algo)->valid || (*algo)->valid()) in raid6_choose_recov()
132 best = *algo; in raid6_choose_recov()
150 const struct raid6_calls *const *algo; in raid6_choose_gen() local
153 for (bestgenperf = 0, bestxorperf = 0, best = NULL, algo = raid6_algos; *algo; algo++) { in raid6_choose_gen()
154 if (!best || (*algo)->prefer >= best->prefer) { in raid6_choose_gen()
155 if ((*algo)->valid && !(*algo)->valid()) in raid6_choose_gen()
159 best = *algo; in raid6_choose_gen()
[all …]
/OK3568_Linux_fs/external/security/rk_tee_user/v1/export-user_ta/include/
H A Dutee_defines.h66 #define TEE_ALG_GET_CLASS(algo) (((algo) >> 28) & 0xF) argument
68 #define TEE_ALG_GET_KEY_TYPE(algo, with_private_key) \ argument
69 (TEE_ALG_GET_MAIN_ALG(algo) | \
73 #define TEE_ALG_GET_MAIN_ALG(algo) ((algo) & 0xFF) argument
76 #define TEE_ALG_GET_CHAIN_MODE(algo) (((algo) >> 8) & 0xF) argument
79 #define TEE_ALG_GET_DIGEST_HASH(algo) (((algo) >> 12) & 0xF) argument
82 #define TEE_ALG_GET_ECC_CURVE(algo) (((algo) >> 16) & 0xF) argument
85 #define TEE_ALG_GET_INTERNAL_HASH(algo) (((algo) >> 20) & 0x7) argument
92 #define TEE_INTERNAL_HASH_TO_ALGO(algo) \ argument
93 TEE_ALG_HASH_ALGO(TEE_ALG_GET_INTERNAL_HASH(algo))
[all …]
/OK3568_Linux_fs/external/security/rk_tee_user/v1/export-user_ta/host_include/
H A Dutee_defines.h66 #define TEE_ALG_GET_CLASS(algo) (((algo) >> 28) & 0xF) argument
68 #define TEE_ALG_GET_KEY_TYPE(algo, with_private_key) \ argument
69 (TEE_ALG_GET_MAIN_ALG(algo) | \
73 #define TEE_ALG_GET_MAIN_ALG(algo) ((algo) & 0xFF) argument
76 #define TEE_ALG_GET_CHAIN_MODE(algo) (((algo) >> 8) & 0xF) argument
79 #define TEE_ALG_GET_DIGEST_HASH(algo) (((algo) >> 12) & 0xF) argument
82 #define TEE_ALG_GET_ECC_CURVE(algo) (((algo) >> 16) & 0xF) argument
85 #define TEE_ALG_GET_INTERNAL_HASH(algo) (((algo) >> 20) & 0x7) argument
92 #define TEE_INTERNAL_HASH_TO_ALGO(algo) \ argument
93 TEE_ALG_HASH_ALGO(TEE_ALG_GET_INTERNAL_HASH(algo))
[all …]
/OK3568_Linux_fs/external/security/librkcrypto/test/
H A Dtest_throughput.c23 uint32_t algo, uint32_t mode, uint32_t operation, in test_otp_key_item_tp() argument
46 config.algo = algo; in test_otp_key_item_tp()
65 test_algo_name(algo), key_len * 8, test_mode_name(mode), in test_otp_key_item_tp()
69 test_algo_name(algo), key_len * 8, test_mode_name(mode), in test_otp_key_item_tp()
86 test_algo_name(algo), key_len * 8, test_mode_name(mode), in test_otp_key_item_tp()
90 test_algo_name(algo), key_len * 8, test_mode_name(mode), in test_otp_key_item_tp()
99 uint32_t algo, key_id, mode, operation, len, key_len; in test_otp_key_virt_tp() local
118 algo = algo_tab[h]; in test_otp_key_virt_tp()
124 if (algo == RK_ALGO_AES) { in test_otp_key_virt_tp()
130 if (test_otp_key_item_tp(true, key_id, key_len, algo, in test_otp_key_virt_tp()
[all …]
H A Dtest_hash.c18 uint32_t algo; member
54 uint32_t algo, key_len; in test_hash_item_virt() local
61 algo = item->algo; in test_hash_item_virt()
65 hash_cfg.algo = algo; in test_hash_item_virt()
82 printf("virt:\t[%12s]\tN/A\n", test_algo_name(algo)); in test_hash_item_virt()
107 res = soft_hmac(algo, key, key_len, buffer, buffer_len, hash_soft, &out_len); in test_hash_item_virt()
109 res = soft_hash(algo, buffer, buffer_len, hash_soft, &out_len); in test_hash_item_virt()
126 printf("virt:\t[%12s]\tPASS\n", test_algo_name(algo)); in test_hash_item_virt()
131 printf("virt:\t[%12s]\tFAIL\n", test_algo_name(algo)); in test_hash_item_virt()
146 uint32_t algo, key_len; in test_hash_item_fd() local
[all …]
H A Dtest_ae.c19 uint32_t algo[2]; member
28 .algo = {RK_ALGO_AES, RK_ALGO_SM4},
47 uint32_t algo = 0, mode = 0, key_len, iv_len, data_len, aad_len, operation; in test_ae_item_virt() local
74 for (h = 0; h < ARRAY_SIZE(item->algo); h++) { in test_ae_item_virt()
75 algo = item->algo[h]; in test_ae_item_virt()
86 if (algo == RK_ALGO_SM4 && key_len !=16) in test_ae_item_virt()
105 ae_cfg.algo = algo; in test_ae_item_virt()
127 test_algo_name(algo), key_len * 8, in test_ae_item_virt()
153 res = soft_ae(algo, mode, operation, in test_ae_item_virt()
177 test_algo_name(algo), key_len * 8, in test_ae_item_virt()
[all …]
H A Dtest_cipher.c20 uint32_t algo; member
28 .algo = RK_ALGO_DES,
41 .algo = RK_ALGO_TDES,
54 .algo = RK_ALGO_AES,
70 .algo = RK_ALGO_SM4,
96 uint32_t algo = 0, mode = 0, key_len, iv_len, operation; in test_cipher_item_virt() local
123 algo = item->algo; in test_cipher_item_virt()
143 cipher_cfg.algo = algo; in test_cipher_item_virt()
161 test_algo_name(algo), key_len * 8, in test_cipher_item_virt()
198 res = soft_cipher(algo, mode, operation, in test_cipher_item_virt()
[all …]
H A Dtest_otp_key_crypto.c51 uint32_t algo; member
61 .algo = RK_ALGO_AES,
82 .algo = RK_ALGO_SM4,
153 uint32_t algo = 0, mode = 0, key_len, data_len, operation; in test_otp_key_item_virt() local
205 algo = item->algo; in test_otp_key_item_virt()
223 cipher_cfg.algo = algo; in test_otp_key_item_virt()
233 key_id, test_algo_name(algo), key_len * 8, in test_otp_key_item_virt()
242 rk_res = soft_cipher(algo, mode, operation, key, key_len, in test_otp_key_item_virt()
257 key_id, test_algo_name(algo), key_len * 8, in test_otp_key_item_virt()
275 key_id, test_algo_name(algo), key_len * 8, in test_otp_key_item_virt()
[all …]
/OK3568_Linux_fs/external/security/rk_tee_user/v2/host/xtest/
H A Dregression_4000_data.h6483 uint32_t algo; /* TEE_ALG_ECDH_P192,... */ member
6494 .algo = TEE_ALG_ECDH_P192,
6504 .algo = TEE_ALG_ECDH_P192,
6514 .algo = TEE_ALG_ECDH_P192,
6524 .algo = TEE_ALG_ECDH_P192,
6534 .algo = TEE_ALG_ECDH_P192,
6544 .algo = TEE_ALG_ECDH_P192,
6554 .algo = TEE_ALG_ECDH_P192,
6564 .algo = TEE_ALG_ECDH_P192,
6574 .algo = TEE_ALG_ECDH_P192,
[all …]
H A Dsha_perf.c108 static const char *algo_str(uint32_t algo) in algo_str() argument
110 switch (algo) { in algo_str()
126 static int hash_size(uint32_t algo) in hash_size() argument
128 switch (algo) { in hash_size()
148 static void alloc_shm(size_t sz, uint32_t algo, int offset) in alloc_shm() argument
158 out_shm.size = hash_size(algo); in alloc_shm()
236 static void prepare_op(int algo) in prepare_op() argument
244 op.params[0].value.a = algo; in prepare_op()
286 extern void sha_perf_run_test(int algo, size_t size, unsigned int n, in sha_perf_run_test() argument
306 prepare_op(algo); in sha_perf_run_test()
[all …]
/OK3568_Linux_fs/u-boot/lib/rsa/
H A Drsa-checksum.c24 struct hash_algo *algo; in rsa_hash_calculate() local
30 ret = hash_progressive_lookup_algo(name, &algo); in rsa_hash_calculate()
34 ret = algo->hash_init(algo, &ctx); in rsa_hash_calculate()
39 ret = algo->hash_update(algo, ctx, region[i].data, in rsa_hash_calculate()
45 ret = algo->hash_update(algo, ctx, region[i].data, region[i].size, 1); in rsa_hash_calculate()
48 ret = algo->hash_finish(algo, ctx, checksum, algo->digest_size); in rsa_hash_calculate()
69 ctx.algo = CRYPTO_SHA1; in hw_rsa_hash_calculate()
71 ctx.algo = CRYPTO_SHA256; in hw_rsa_hash_calculate()
75 dev = crypto_get_device(ctx.algo); in hw_rsa_hash_calculate()
/OK3568_Linux_fs/kernel/net/ipv6/
H A Dseg6_hmac.c106 struct seg6_hmac_algo *algo; in __hmac_get_algo() local
111 algo = &hmac_algos[i]; in __hmac_get_algo()
112 if (algo->alg_id == alg_id) in __hmac_get_algo()
113 return algo; in __hmac_get_algo()
122 struct seg6_hmac_algo *algo; in __do_hmac() local
127 algo = __hmac_get_algo(hinfo->alg_id); in __do_hmac()
128 if (!algo) in __do_hmac()
131 tfm = *this_cpu_ptr(algo->tfms); in __do_hmac()
146 shash = *this_cpu_ptr(algo->shashs); in __do_hmac()
354 struct seg6_hmac_algo *algo; in seg6_hmac_init_algo() local
[all …]
/OK3568_Linux_fs/kernel/security/integrity/ima/
H A Dima_crypto.c62 enum hash_algo algo; member
91 static struct crypto_shash *ima_alloc_tfm(enum hash_algo algo) in ima_alloc_tfm() argument
96 if (algo < 0 || algo >= HASH_ALGO__LAST) in ima_alloc_tfm()
97 algo = ima_hash_algo; in ima_alloc_tfm()
99 if (algo == ima_hash_algo) in ima_alloc_tfm()
103 if (ima_algo_array[i].tfm && ima_algo_array[i].algo == algo) in ima_alloc_tfm()
106 tfm = crypto_alloc_shash(hash_algo_name[algo], 0, 0); in ima_alloc_tfm()
110 hash_algo_name[algo], rc); in ima_alloc_tfm()
117 enum hash_algo algo; in ima_init_crypto() local
129 algo = ima_tpm_chip->allocated_banks[i].crypto_id; in ima_init_crypto()
[all …]
/OK3568_Linux_fs/kernel/drivers/video/fbdev/savage/
H A Dsavagefb-i2c.c141 chan->adapter.algo_data = &chan->algo; in savage_setup_i2c_bus()
143 chan->algo.udelay = 10; in savage_setup_i2c_bus()
144 chan->algo.timeout = 20; in savage_setup_i2c_bus()
145 chan->algo.data = chan; in savage_setup_i2c_bus()
150 chan->algo.setsda(chan, 1); in savage_setup_i2c_bus()
151 chan->algo.setscl(chan, 1); in savage_setup_i2c_bus()
178 par->chan.algo.setsda = prosavage_gpio_setsda; in savagefb_create_i2c_busses()
179 par->chan.algo.setscl = prosavage_gpio_setscl; in savagefb_create_i2c_busses()
180 par->chan.algo.getsda = prosavage_gpio_getsda; in savagefb_create_i2c_busses()
181 par->chan.algo.getscl = prosavage_gpio_getscl; in savagefb_create_i2c_busses()
[all …]
/OK3568_Linux_fs/external/security/rk_tee_user/v2/ta/rk_public_api/
H A Drk_crypto_api.h49 uint32_t algo; member
119 uint32_t out_len, uint32_t algo);
120 TEE_Result rk_hash_begin(crypto_ctx_t *ctx, uint32_t algo);
127 uint32_t algo, TEE_OperationMode mode);
130 uint8_t *iv, uint32_t algo, TEE_OperationMode mode);
137 uint32_t payload_len, uint32_t algo, TEE_OperationMode mode);
146 rsa_key_t *key, uint32_t algo, TEE_OperationMode mode);
149 uint32_t algo, TEE_OperationMode mode);
151 TEE_Result rk_rsa_begin(crypto_ctx_t *ctx, rsa_key_t *key, uint32_t algo,
159 uint32_t algo, uint32_t curve, uint32_t keysize, uint8_t *out);
[all …]
H A Drk_crypto_api.c242 uint32_t algo, TEE_OperationMode mode) in rk_cipher_crypto() argument
263 IMSG("in_len is %d; key_len is %d; algo is %08x", len, key_len, algo); in rk_cipher_crypto()
269 switch (algo) { in rk_cipher_crypto()
278 if (((algo == TEE_ALG_AES_CTS) && (len % AES_BLOCK_SIZE == 0)) || in rk_cipher_crypto()
279 ((algo != TEE_ALG_AES_CTS) && in rk_cipher_crypto()
280 (algo != TEE_ALG_AES_CTR) && (len % AES_BLOCK_SIZE != 0))) in rk_cipher_crypto()
335 res = TEE_AllocateOperation(&crypto_op, algo, mode, op_key_size); in rk_cipher_crypto()
354 if (algo == TEE_ALG_AES_XTS) { in rk_cipher_crypto()
490 uint8_t *iv, uint32_t algo, TEE_OperationMode mode) in rk_cipher_begin() argument
508 if (TEE_ALG_GET_CLASS(algo) != TEE_OPERATION_CIPHER) in rk_cipher_begin()
[all …]
/OK3568_Linux_fs/external/security/rk_tee_user/v1/ta/rk_public_api/
H A Drk_crypto_api.h47 uint32_t algo; member
102 uint32_t out_len, uint32_t algo);
103 TEE_Result rk_hash_begin(crypto_ctx_t *ctx, uint32_t algo);
110 uint32_t algo, TEE_OperationMode mode);
113 uint8_t *iv, uint32_t algo, TEE_OperationMode mode);
120 uint32_t payload_len, uint32_t algo, TEE_OperationMode mode);
129 rsa_key_t *key, uint32_t algo, TEE_OperationMode mode);
132 uint32_t algo, TEE_OperationMode mode);
134 TEE_Result rk_rsa_begin(crypto_ctx_t *ctx, rsa_key_t *key, uint32_t algo,
142 uint32_t algo, uint32_t curve, uint32_t keysize, uint8_t *out);
[all …]
H A Drk_crypto_api.c242 uint32_t algo, TEE_OperationMode mode) in rk_cipher_crypto() argument
263 IMSG("in_len is %d; key_len is %d; algo is %08x", len, key_len, algo); in rk_cipher_crypto()
269 switch (algo) { in rk_cipher_crypto()
278 if (((algo == TEE_ALG_AES_CTS) && (len % AES_BLOCK_SIZE == 0)) || in rk_cipher_crypto()
279 ((algo != TEE_ALG_AES_CTS) && in rk_cipher_crypto()
280 (algo != TEE_ALG_AES_CTR) && (len % AES_BLOCK_SIZE != 0)) ) in rk_cipher_crypto()
321 res = TEE_AllocateOperation(&crypto_op, algo, mode, op_key_size); in rk_cipher_crypto()
340 if (algo == TEE_ALG_AES_XTS) { in rk_cipher_crypto()
474 uint8_t *iv, uint32_t algo, TEE_OperationMode mode) in rk_cipher_begin() argument
492 if (TEE_ALG_GET_CLASS(algo) != TEE_OPERATION_CIPHER) in rk_cipher_begin()
[all …]
/OK3568_Linux_fs/u-boot/drivers/crypto/fsl/
H A Dfsl_hash.c45 static enum caam_hash_algos get_hash_type(struct hash_algo *algo) in get_hash_type() argument
47 if (!strcmp(algo->name, driver_hash[SHA1].name)) in get_hash_type()
162 unsigned char *pout, enum caam_hash_algos algo) in caam_hash() argument
174 driver_hash[algo].alg_type, in caam_hash()
175 driver_hash[algo].digestsize, in caam_hash()
198 int hw_sha_init(struct hash_algo *algo, void **ctxp) in hw_sha_init() argument
200 return caam_hash_init(ctxp, get_hash_type(algo)); in hw_sha_init()
203 int hw_sha_update(struct hash_algo *algo, void *ctx, const void *buf, in hw_sha_update() argument
206 return caam_hash_update(ctx, buf, size, is_last, get_hash_type(algo)); in hw_sha_update()
209 int hw_sha_finish(struct hash_algo *algo, void *ctx, void *dest_buf, in hw_sha_finish() argument
[all …]
/OK3568_Linux_fs/u-boot/board/freescale/common/
H A Dfsl_validate.c488 struct hash_algo *algo; in calc_img_key_hash() local
495 ret = hash_progressive_lookup_algo(algo_name, &algo); in calc_img_key_hash()
499 ret = algo->hash_init(algo, &ctx); in calc_img_key_hash()
506 ret = algo->hash_update(algo, ctx, in calc_img_key_hash()
513 ret = algo->hash_update(algo, ctx, in calc_img_key_hash()
519 ret = algo->hash_finish(algo, ctx, hash_val, algo->digest_size); in calc_img_key_hash()
536 struct hash_algo *algo; in calc_esbchdr_esbc_hash() local
543 ret = hash_progressive_lookup_algo(algo_name, &algo); in calc_esbchdr_esbc_hash()
547 ret = algo->hash_init(algo, &ctx); in calc_esbchdr_esbc_hash()
553 ret = algo->hash_update(algo, ctx, in calc_esbchdr_esbc_hash()
[all …]

12345678910>>...23