/crypto/ |
D | aes_generic.c | 59 static inline u8 byte(const u32 x, const unsigned n) in byte() argument 61 return x >> (n << 3); in byte() 1147 #define f_rn(bo, bi, n, k) do { \ argument 1148 bo[n] = crypto_ft_tab[0][byte(bi[n], 0)] ^ \ 1149 crypto_ft_tab[1][byte(bi[(n + 1) & 3], 1)] ^ \ 1150 crypto_ft_tab[2][byte(bi[(n + 2) & 3], 2)] ^ \ 1151 crypto_ft_tab[3][byte(bi[(n + 3) & 3], 3)] ^ *(k + n); \ 1162 #define f_rl(bo, bi, n, k) do { \ argument 1163 bo[n] = crypto_fl_tab[0][byte(bi[n], 0)] ^ \ 1164 crypto_fl_tab[1][byte(bi[(n + 1) & 3], 1)] ^ \ [all …]
|
D | twofish_generic.c | 53 #define ENCROUND(n, a, b, c, d) \ argument 55 x += y; y += x + ctx->k[2 * (n) + 1]; \ 56 (c) ^= x + ctx->k[2 * (n)]; \ 60 #define DECROUND(n, a, b, c, d) \ argument 63 (d) ^= y + ctx->k[2 * (n) + 1]; \ 66 (c) ^= (x + ctx->k[2 * (n)]) 71 #define ENCCYCLE(n) \ argument 72 ENCROUND (2 * (n), a, b, c, d); \ 73 ENCROUND (2 * (n) + 1, c, d, a, b) 75 #define DECCYCLE(n) \ argument [all …]
|
D | rsa.c | 16 MPI n; member 28 if (mpi_cmp_ui(m, 0) < 0 || mpi_cmp(m, key->n) >= 0) in _rsa_enc() 32 return mpi_powm(c, m, key->e, key->n); in _rsa_enc() 42 if (mpi_cmp_ui(c, 0) < 0 || mpi_cmp(c, key->n) >= 0) in _rsa_dec() 46 return mpi_powm(m, c, key->d, key->n); in _rsa_dec() 65 if (unlikely(!pkey->n || !pkey->e)) { in rsa_enc() 104 if (unlikely(!pkey->n || !pkey->d)) { in rsa_dec() 135 mpi_free(key->n); in rsa_free_mpi_key() 138 key->n = NULL; in rsa_free_mpi_key() 174 mpi_key->n = mpi_read_raw_data(raw_key.n, raw_key.n_sz); in rsa_set_pub_key() [all …]
|
D | sm2.c | 43 const char *n; /* The order of the base point. */ member 57 .n = "0xfffffffeffffffffffffffffffffffff7203df6b21c6052b53bbf40939d54123", 99 ec->n = mpi_scanval(ecp->n); in sm2_ec_ctx_init() 100 if (!ec->n) { in sm2_ec_ctx_init() 136 size_t n; in sm2_ecc_os2ec() local 140 n = MPI_NBYTES(value); in sm2_ecc_os2ec() 141 buf = kmalloc(n, GFP_KERNEL); in sm2_ecc_os2ec() 145 rc = mpi_print(GCRYMPI_FMT_USG, buf, n, &n, value); in sm2_ecc_os2ec() 150 if (n < 1 || ((n - 1) % 2)) in sm2_ecc_os2ec() 157 n = (n - 1) / 2; in sm2_ecc_os2ec() [all …]
|
D | ecrdsa.c | 116 vli_cmp(r, ctx->curve->n, ndigits) >= 0 || in ecrdsa_verify() 118 vli_cmp(s, ctx->curve->n, ndigits) >= 0) in ecrdsa_verify() 124 if (vli_cmp(e, ctx->curve->n, ndigits) >= 0) in ecrdsa_verify() 125 vli_sub(e, e, ctx->curve->n, ndigits); in ecrdsa_verify() 130 vli_mod_inv(v, e, ctx->curve->n, ndigits); in ecrdsa_verify() 133 vli_mod_mult_slow(z1, s, v, ctx->curve->n, ndigits); in ecrdsa_verify() 134 vli_sub(_r, ctx->curve->n, r, ndigits); in ecrdsa_verify() 135 vli_mod_mult_slow(z2, _r, v, ctx->curve->n, ndigits); in ecrdsa_verify() 140 if (vli_cmp(cc.x, ctx->curve->n, ndigits) >= 0) in ecrdsa_verify() 141 vli_sub(cc.x, cc.x, ctx->curve->n, ndigits); in ecrdsa_verify()
|
D | ecrdsa_defs.h | 56 .n = cp256a_n, 89 .n = cp256b_n, 126 .n = cp256c_n, 175 .n = tc512a_n, 220 .n = tc512b_n,
|
D | skcipher.c | 107 unsigned int n = walk->nbytes; in skcipher_walk_done() local 110 if (!n) in skcipher_walk_done() 114 n -= err; in skcipher_walk_done() 115 nbytes = walk->total - n; in skcipher_walk_done() 129 memcpy(walk->dst.virt.addr, walk->page, n); in skcipher_walk_done() 142 n = skcipher_done_slow(walk, n); in skcipher_walk_done() 151 scatterwalk_advance(&walk->in, n); in skcipher_walk_done() 152 scatterwalk_advance(&walk->out, n); in skcipher_walk_done() 231 unsigned n; in skcipher_next_slow() local 245 n = bsize; in skcipher_next_slow() [all …]
|
D | sm3_generic.c | 39 static inline u32 ff(unsigned int n, u32 a, u32 b, u32 c) in ff() argument 41 return (n < 16) ? (a ^ b ^ c) : ((a & b) | (a & c) | (b & c)); in ff() 44 static inline u32 gg(unsigned int n, u32 e, u32 f, u32 g) in gg() argument 46 return (n < 16) ? (e ^ f ^ g) : ((e & f) | ((~e) & g)); in gg() 49 static inline u32 t(unsigned int n) in t() argument 51 return (n < 16) ? SM3_T1 : SM3_T2; in t()
|
D | vmac.c | 496 unsigned int n; in vmac_update() local 500 n = min(len, VMAC_NONCEBYTES - dctx->nonce_size); in vmac_update() 501 memcpy(&dctx->nonce.bytes[dctx->nonce_size], p, n); in vmac_update() 502 dctx->nonce_size += n; in vmac_update() 503 p += n; in vmac_update() 504 len -= n; in vmac_update() 508 n = min(len, VMAC_NHBYTES - dctx->partial_size); in vmac_update() 509 memcpy(&dctx->partial[dctx->partial_size], p, n); in vmac_update() 510 dctx->partial_size += n; in vmac_update() 511 p += n; in vmac_update() [all …]
|
D | polyval-generic.c | 159 int n; in polyval_update() local 162 n = min(srclen, dctx->bytes); in polyval_update() 165 dctx->bytes -= n; in polyval_update() 166 srclen -= n; in polyval_update() 168 while (n--) in polyval_update()
|
D | ecc_curve_defs.h | 26 .n = nist_p192_n, 52 .n = nist_p256_n, 84 .n = nist_p384_n,
|
D | ecdsa.c | 106 if (vli_is_zero(r, ndigits) || vli_cmp(r, curve->n, ndigits) >= 0 || in _ecdsa_verify() 107 vli_is_zero(s, ndigits) || vli_cmp(s, curve->n, ndigits) >= 0) in _ecdsa_verify() 115 vli_mod_inv(s1, s, curve->n, ndigits); in _ecdsa_verify() 117 vli_mod_mult_slow(u1, hash, s1, curve->n, ndigits); in _ecdsa_verify() 119 vli_mod_mult_slow(u2, r, s1, curve->n, ndigits); in _ecdsa_verify() 124 if (unlikely(vli_cmp(res.x, curve->n, ndigits) == 1)) in _ecdsa_verify() 126 vli_sub(res.x, res.x, curve->n, ndigits); in _ecdsa_verify()
|
D | ghash-generic.c | 86 int n = min(srclen, dctx->bytes); in ghash_update() local 89 dctx->bytes -= n; in ghash_update() 90 srclen -= n; in ghash_update() 92 while (n--) in ghash_update()
|
D | twofish_common.c | 535 #define CALC_K(a, j, k, l, m, n) \ argument 537 y = CALC_K_2 (m, n, m, n, 4); \ 548 #define CALC_K192(a, j, k, l, m, n) \ argument 550 y = CALC_K192_2 (n, n, m, m, 4); \ 561 #define CALC_K256(a, j, k, l, m, n) \ argument 563 y = CALC_K256_2 (m, n, 4); \
|
D | tea.c | 59 u32 y, z, n, sum = 0; in tea_encrypt() local 73 n = TEA_ROUNDS; in tea_encrypt() 75 while (n-- > 0) { in tea_encrypt() 87 u32 y, z, n, sum; in tea_decrypt() local 103 n = TEA_ROUNDS; in tea_decrypt() 105 while (n-- > 0) { in tea_decrypt()
|
D | fips140-eval-testing.c | 81 fips140_copy_to_user(void __user *to, const void *from, unsigned long n) in fips140_copy_to_user() argument 83 return copy_to_user(to, from, n); in fips140_copy_to_user()
|
D | algapi.c | 94 struct crypto_spawn *spawn, *n; in crypto_more_spawns() local 100 n = list_prev_entry(spawn, list); in crypto_more_spawns() 103 if (list_is_last(&n->list, stack)) in crypto_more_spawns() 106 n = list_next_entry(n, list); in crypto_more_spawns() 108 n->dead = false; in crypto_more_spawns() 110 return &n->inst->alg.cra_users; in crypto_more_spawns() 143 struct crypto_spawn *spawn, *n; in crypto_remove_spawns() local 150 list_for_each_entry_safe(spawn, n, spawns, list) { in crypto_remove_spawns() 210 list_for_each_entry_safe(spawn, n, &secondary_spawns, list) { in crypto_remove_spawns() 420 struct crypto_alg *n; in crypto_remove_final() local [all …]
|
D | fcrypt.c | 58 #define ror56(hi, lo, n) \ argument 60 u32 t = lo & ((1 << n) - 1); \ 61 lo = (lo >> n) | ((hi & ((1 << n) - 1)) << (32 - n)); \ 62 hi = (hi >> n) | (t << (24-n)); \ 66 #define ror56_64(k, n) (k = (k >> n) | ((k & ((1 << n) - 1)) << (56 - n))) argument
|
D | jitterentropy-kcapi.c | 73 void jent_memcpy(void *dest, const void *src, unsigned int n) in jent_memcpy() argument 75 memcpy(dest, src, n); in jent_memcpy()
|
D | blowfish_common.c | 304 #define ROUND(a, b, n) ({ b ^= P[n]; a ^= bf_F(b); }) argument
|
D | blowfish_generic.c | 34 #define ROUND(a, b, n) ({ b ^= P[n]; a ^= bf_F(b); }) argument
|
D | rsapubkey.asn1 | 2 n INTEGER ({ rsa_get_n }),
|
D | rsaprivkey.asn1 | 3 n INTEGER ({ rsa_get_n }),
|
/crypto/asymmetric_keys/ |
D | asymmetric_type.c | 338 int n; in asymmetric_key_describe() local 349 n = kid->len; in asymmetric_key_describe() 351 if (n > 4) { in asymmetric_key_describe() 352 p += n - 4; in asymmetric_key_describe() 353 n = 4; in asymmetric_key_describe() 355 seq_printf(m, "%*phN", n, p); in asymmetric_key_describe()
|
D | public_key.c | 72 int n; in software_key_determine_akcipher() local 83 n = snprintf(alg_name, CRYPTO_MAX_ALG_NAME, in software_key_determine_akcipher() 87 n = snprintf(alg_name, CRYPTO_MAX_ALG_NAME, in software_key_determine_akcipher() 90 return n >= CRYPTO_MAX_ALG_NAME ? -EINVAL : 0; in software_key_determine_akcipher()
|