Home
last modified time | relevance | path

Searched full:g (Results 1 – 25 of 198) sorted by relevance

12345678

/optee_os/core/lib/libtomcrypt/src/pk/dsa/
H A Ddsa_set.c9 Import DSA's p, q & g from raw numbers
14 @param g DSA's g in binary representation
15 @param glen The length of g
21 const unsigned char *g, unsigned long glen, in dsa_set_pqg() argument
28 LTC_ARGCHK(g != NULL); in dsa_set_pqg()
33 err = mp_init_multi(&key->p, &key->g, &key->q, &key->x, &key->y, LTC_NULL); in dsa_set_pqg()
37 … if ((err = mp_read_unsigned_bin(key->g, (unsigned char *)g , glen)) != CRYPT_OK) { goto LBL_ERR; } in dsa_set_pqg()
59 NB: The p, q & g parts must be set beforehand
75 LTC_ARGCHK(key->g != NULL); in dsa_set_key()
82 …if ((err = mp_exptmod(key->g, key->x, key->p, key->y)) != CRYPT_OK) { goto LBL_ERR; } in dsa_set_key()
H A Ddsa_verify_key.c38 of DSA params (p, q, g)
60 /* FIPS 186-4 chapter 4.1: 1 < g < p */ in dsa_int_validate_pqg()
61 if (mp_cmp_d(key->g, 1) != LTC_MP_GT || mp_cmp(key->g, key->p) != LTC_MP_LT) { in dsa_int_validate_pqg()
75 /* FIPS 186-4 chapter 4.1: g is a generator of a subgroup of order q in in dsa_int_validate_pqg()
76 * the multiplicative group of GF(p) - so we make sure that g^q mod p = 1 in dsa_int_validate_pqg()
78 if ((err = mp_exptmod(key->g, key->q, key->p, tmp1)) != CRYPT_OK) { goto error; } in dsa_int_validate_pqg()
160 /* FIPS 186-4 chapter 4.1: y = g^x mod p */ in dsa_int_validate_xy()
161 if ((err = mp_exptmod(key->g, key->x, key->p, tmp)) != CRYPT_OK) { in dsa_int_validate_xy()
170 /* with just a public key we cannot test y = g^x mod p therefore we in dsa_int_validate_xy()
171 * only test that y^q mod p = 1, which makes sure y is in g^x mod p in dsa_int_validate_xy()
H A Ddsa_generate_pqg.c7 DSA implementation - generate DSA parameters p, q & g
20 @param g [out] bignum where generated 'g' is stored (must be initialized by caller)
23 …ke_params(prng_state *prng, int wprng, int group_size, int modulus_size, void *p, void *q, void *g) in s_dsa_make_params() argument
38 * L = The desired length of the prime p (in bits e.g. L = 1024) in s_dsa_make_params()
39 * N = The desired length of the prime q (in bits e.g. N = 160) in s_dsa_make_params()
166 /* FIPS-186-4 A.2.1 Unverifiable Generation of the Generator g in s_dsa_make_params()
170 * 3. g = h^e mod p in s_dsa_make_params()
171 * 4. if (g == 1), then go to step 2. in s_dsa_make_params()
185 if ((err = mp_exptmod(h, e, p, g)) != CRYPT_OK) { goto cleanup; } in s_dsa_make_params()
186 } while (mp_cmp_d(g, 1) == LTC_MP_EQ); in s_dsa_make_params()
[all …]
H A Ddsa_set_pqg_dsaparam.c9 Import DSA's p, q & g from dsaparam
28 err = mp_init_multi(&key->p, &key->g, &key->q, &key->x, &key->y, LTC_NULL); in dsa_set_pqg_dsaparam()
34 LTC_ASN1_INTEGER, 1UL, key->g, in dsa_set_pqg_dsaparam()
41 /* quick p, q, g validation, without primality testing */ in dsa_set_pqg_dsaparam()
H A Ddsa_import.c31 if (mp_init_multi(&key->p, &key->g, &key->q, &key->x, &key->y, LTC_NULL) != CRYPT_OK) { in dsa_import()
44 LTC_ASN1_INTEGER, 1UL, key->g, in dsa_import()
59 LTC_ASN1_INTEGER, 1UL, key->g, in dsa_import()
79 LTC_ASN1_INTEGER, 1UL, key->g, in dsa_import()
91 LTC_SET_ASN1(params, 2, LTC_ASN1_INTEGER, key->g, 1UL); in dsa_import()
120 /* quick p, q, g validation, without primality testing */ in dsa_import()
H A Ddsa_generate_key.c26 /* so now we have our DH structure, generator g, order q, modulus p in dsa_generate_key()
27 Now we need a random exponent [mod q] and it's power g^x mod p in dsa_generate_key()
31 if ((err = mp_exptmod(key->g, key->x, key->p, key->y)) != CRYPT_OK) { return err; } in dsa_generate_key()
H A Ddsa_export.c43 LTC_ASN1_INTEGER, 1UL, key->g, in dsa_export()
51 LTC_ASN1_INTEGER, 1UL, key->g, in dsa_export()
76 LTC_SET_ASN1(int_list, 2, LTC_ASN1_INTEGER, key->g, 1UL); in dsa_export()
89 LTC_ASN1_INTEGER, 1UL, key->g, in dsa_export()
/optee_os/core/drivers/crypto/caam/acipher/
H A Dcaam_dsa.c35 * Domain Parameters (p, q, g)
40 struct caambuf g; /* Generator */ member
54 caam_free_buf(&key->g); in do_keypair_free()
62 * If all DSA parameters p, q and g are present, convert them from bignumbers
80 DSA_TRACE("DSA conv key param (p, g) of %zu bytes and (q) of %zu bytes", in get_keypair_domain_params()
87 retstatus = caam_calloc_buf(&outkey->g, l_bytes); in get_keypair_domain_params()
99 in_g_size = crypto_bignum_num_bytes(key->g); in get_keypair_domain_params()
104 /* Generate DSA parameters: Generator G and Primes P/Q */ in get_keypair_domain_params()
105 prime.g = &outkey->g; in get_keypair_domain_params()
110 DSA_TRACE("Generate G and Primes P/Q returned %#x", retstatus); in get_keypair_domain_params()
[all …]
H A Dcaam_dh.c32 struct caambuf g; /* Generator */ member
45 caam_free_buf(&key->g); in do_keypair_free()
52 * Convert Crypto DH Key p and g bignumbers to local buffers
67 DH_TRACE("DH Convert Key Parameters (p,g) size %zu bytes", p_size); in do_keypair_conv_p_g()
78 retstatus = caam_calloc_buf(&outkey->g, p_size); in do_keypair_conv_p_g()
82 /* Get the number of bytes of g to pad with 0's */ in do_keypair_conv_p_g()
83 field_size = crypto_bignum_num_bytes(inkey->g); in do_keypair_conv_p_g()
84 crypto_bignum_bn2bin(inkey->g, outkey->g.data + p_size - field_size); in do_keypair_conv_p_g()
85 cache_operation(TEE_CACHECLEAN, outkey->g.data, outkey->g.length); in do_keypair_conv_p_g()
169 key->g = crypto_bignum_allocate(size_bits); in do_allocate_keypair()
[all …]
/optee_os/lib/libmbedtls/mbedtls/library/
H A Dpsa_crypto_ffdh.c14 * MBEDTLS_DHM_RFC7919_FFDHEXXXX_[P|G]_BIN symbols that are used in
32 mbedtls_mpi *G) in mbedtls_psa_ffdh_set_prime_generator() argument
40 if (P == NULL && G == NULL) { in mbedtls_psa_ffdh_set_prime_generator()
124 if (G != NULL) { in mbedtls_psa_ffdh_set_prime_generator()
125 MBEDTLS_MPI_CHK(mbedtls_mpi_read_binary(G, dhm_G, in mbedtls_psa_ffdh_set_prime_generator()
153 mbedtls_mpi GX, G, X, P; in mbedtls_psa_ffdh_export_public_key() local
167 mbedtls_mpi_init(&GX); mbedtls_mpi_init(&G); in mbedtls_psa_ffdh_export_public_key()
172 status = mbedtls_psa_ffdh_set_prime_generator(key_len, &P, &G); in mbedtls_psa_ffdh_export_public_key()
181 MBEDTLS_MPI_CHK(mbedtls_mpi_exp_mod(&GX, &G, &X, &P, NULL)); in mbedtls_psa_ffdh_export_public_key()
188 mbedtls_mpi_free(&P); mbedtls_mpi_free(&G); in mbedtls_psa_ffdh_export_public_key()
[all …]
H A Dbignum_mod_raw.c164 /* Inversion by power: g^|G| = 1 => g^(-1) = g^(|G|-1), and in mbedtls_mpi_mod_raw_inv_prime()
165 * |G| = N - 1, so we want in mbedtls_mpi_mod_raw_inv_prime()
166 * g^(|G|-1) = g^(N - 2) in mbedtls_mpi_mod_raw_inv_prime()
H A Decjpake.c195 const mbedtls_ecp_point *G, in ecjpake_hash() argument
209 MBEDTLS_MPI_CHK(ecjpake_write_len_point(&p, end, grp, pf, G)); in ecjpake_hash()
246 const mbedtls_ecp_point *G, in ecjpake_zkp_read() argument
292 MBEDTLS_MPI_CHK(ecjpake_hash(md_type, grp, pf, G, &V, X, id, &h)); in ecjpake_zkp_read()
294 &VV, &h, X, &r, G)); in ecjpake_zkp_read()
316 const mbedtls_ecp_point *G, in ecjpake_zkp_write() argument
341 G, &v, &V, f_rng, p_rng)); in ecjpake_zkp_write()
342 MBEDTLS_MPI_CHK(ecjpake_hash(md_type, grp, pf, G, &V, X, id, &h)); in ecjpake_zkp_write()
377 const mbedtls_ecp_point *G, in ecjpake_kkp_read() argument
401 MBEDTLS_MPI_CHK(ecjpake_zkp_read(md_type, grp, pf, G, X, id, p, end)); in ecjpake_kkp_read()
[all …]
H A Ddhm.c123 src = &ctx->G; in mbedtls_dhm_get_value()
153 (ret = dhm_read_bignum(&ctx->G, p, end)) != 0 || in mbedtls_dhm_read_params()
207 * Calculate GX = G^X mod P in dhm_make_common()
209 MBEDTLS_MPI_CHK(mbedtls_mpi_exp_mod(&ctx->GX, &ctx->G, &ctx->X, in dhm_make_common()
238 * Export P, G, GX. RFC 5246 §4.4 states that "leading zero octets are in mbedtls_dhm_make_params()
252 n2 = mbedtls_mpi_size(&ctx->G); in mbedtls_dhm_make_params()
257 DHM_MPI_EXPORT(&ctx->G, n2); in mbedtls_dhm_make_params()
274 const mbedtls_mpi *G) in mbedtls_dhm_set_group() argument
279 (ret = mbedtls_mpi_copy(&ctx->G, G)) != 0) { in mbedtls_dhm_set_group()
287 * Import the peer's public value G^Y
[all …]
/optee_os/core/lib/libtomcrypt/
H A Ddsa.c20 if (!bn_alloc_max(&s->g)) in crypto_acipher_alloc_dsa_keypair()
33 crypto_bignum_free(&s->g); in crypto_acipher_alloc_dsa_keypair()
44 if (!bn_alloc_max(&s->g)) in crypto_acipher_alloc_dsa_public_key()
55 crypto_bignum_free(&s->g); in crypto_acipher_alloc_dsa_public_key()
69 ltc_res = mp_init_multi(&ltc_tmp_key.g, &ltc_tmp_key.p, &ltc_tmp_key.q, in crypto_acipher_gen_dsa_key()
75 mp_copy(key->g, ltc_tmp_key.g); in crypto_acipher_gen_dsa_key()
106 .g = key->g, in crypto_acipher_dsa_sign()
174 .g = key->g, in crypto_acipher_dsa_verify()
/optee_os/core/arch/arm/plat-hikey/
H A Dplatform_config.h127 * 3G board: 0~3G
128 * 4G board: 0~3G 3~3.5G 8~8.5G
129 * 6G board: 0~3G 4~7G
148 cannot support boards with 4G RAM or more
H A Dconf.mk50 # Hikey960 4G/6G versions have physical addresses above 4G range
/optee_os/core/lib/libtomcrypt/src/pk/dh/
H A Ddh_set.c9 Import DH key parts p and g from raw numbers
13 @param g DH's g (group)
14 @param glen DH's g's length
19 const unsigned char *g, unsigned long glen, in dh_set_pg() argument
26 LTC_ARGCHK(g != NULL); in dh_set_pg()
33 …if ((err = mp_read_unsigned_bin(key->base, (unsigned char*)g, glen)) != CRYPT_OK) { goto LBL_E… in dh_set_pg()
44 Import DH key parts p and g from built-in DH groups
77 NB: The p & g parts must be set beforehand
/optee_os/core/lib/libtomcrypt/src/pk/ecc/
H A Dltc_ecc_mulmod_timing.c18 @param G The base point
25 int ltc_ecc_mulmod(void *k, const ecc_point *G, ecc_point *R, void *a, void *modulus, int map) in ltc_ecc_mulmod() argument
34 LTC_ARGCHK(G != NULL); in ltc_ecc_mulmod()
38 if ((err = ltc_ecc_is_point_at_infinity(G, modulus, &inf)) != CRYPT_OK) return err; in ltc_ecc_mulmod()
70 /* make a copy of G incase R==G */ in ltc_ecc_mulmod()
74 /* tG = G and convert to montgomery */ in ltc_ecc_mulmod()
75 if ((err = mp_mulmod(G->x, mu, modulus, tG->x)) != CRYPT_OK) { goto done; } in ltc_ecc_mulmod()
76 if ((err = mp_mulmod(G->y, mu, modulus, tG->y)) != CRYPT_OK) { goto done; } in ltc_ecc_mulmod()
77 if ((err = mp_mulmod(G->z, mu, modulus, tG->z)) != CRYPT_OK) { goto done; } in ltc_ecc_mulmod()
82 /* M[0] == G */ in ltc_ecc_mulmod()
[all …]
H A Dltc_ecc_mulmod.c20 @param G The base point
26 int ltc_ecc_mulmod(void *k, const ecc_point *G, ecc_point *R, void *a, void *modulus, int map) in ltc_ecc_mulmod() argument
35 LTC_ARGCHK(G != NULL); in ltc_ecc_mulmod()
39 if ((err = ltc_ecc_is_point_at_infinity(G, modulus, &inf)) != CRYPT_OK) return err; in ltc_ecc_mulmod()
70 /* make a copy of G incase R==G */ in ltc_ecc_mulmod()
74 /* tG = G and convert to montgomery */ in ltc_ecc_mulmod()
76 if ((err = ltc_ecc_copy_point(G, tG)) != CRYPT_OK) { goto done; } in ltc_ecc_mulmod()
78 if ((err = mp_mulmod(G->x, mu, modulus, tG->x)) != CRYPT_OK) { goto done; } in ltc_ecc_mulmod()
79 if ((err = mp_mulmod(G->y, mu, modulus, tG->y)) != CRYPT_OK) { goto done; } in ltc_ecc_mulmod()
80 if ((err = mp_mulmod(G->z, mu, modulus, tG->z)) != CRYPT_OK) { goto done; } in ltc_ecc_mulmod()
[all …]
/optee_os/lib/libmbedtls/core/
H A Ddh.c21 s->g = crypto_bignum_allocate(key_size_bits); in crypto_acipher_alloc_dh_keypair()
22 if (!s->g) in crypto_acipher_alloc_dh_keypair()
38 crypto_bignum_free(&s->g); in crypto_acipher_alloc_dh_keypair()
59 dhm.G = *(mbedtls_mpi *)key->g; in crypto_acipher_gen_dh_key()
91 mbedtls_mpi_init(&dhm.G); in crypto_acipher_gen_dh_key()
111 dhm.G = *(mbedtls_mpi *)private_key->g; in crypto_acipher_dh_shared_secret()
137 mbedtls_mpi_init(&dhm.G); in crypto_acipher_dh_shared_secret()
/optee_os/scripts/
H A Dupdate_changelog.py77 for g in gits:
78 gu = g.replace('/', '_')
82 "[{}_pr_{}]\n".format(g, gu, rvu, gu, rvu, gu, rvu)
86 for g in gits:
87 gu = g.replace('/', '_')
90 "{}\n".format(gu, rvu, g, rv)
92 "{}...{}\n".format(gu, rvu, g, prv, rv)
95 gu, rvu, g, prd, rd)
/optee_os/core/lib/libtomcrypt/src/ciphers/safer/
H A Dsafer.c251 { unsigned char a, b, c, d, e, f, g, h, t; in s_safer_ecb_encrypt() local
261 e = pt[4]; f = pt[5]; g = pt[6]; h = pt[7]; in s_safer_ecb_encrypt()
266 e ^= *++key; f += *++key; g += *++key; h ^= *++key; in s_safer_ecb_encrypt()
270 g = LOG(g) ^ *++key; h = EXP(h) + *++key; in s_safer_ecb_encrypt()
271 PHT(a, b); PHT(c, d); PHT(e, f); PHT(g, h); in s_safer_ecb_encrypt()
272 PHT(a, c); PHT(e, g); PHT(b, d); PHT(f, h); in s_safer_ecb_encrypt()
273 PHT(a, e); PHT(b, f); PHT(c, g); PHT(d, h); in s_safer_ecb_encrypt()
274 t = b; b = e; e = c; c = t; t = d; d = f; f = g; g = t; in s_safer_ecb_encrypt()
277 e ^= *++key; f += *++key; g += *++key; h ^= *++key; in s_safer_ecb_encrypt()
281 ct[6] = g & 0xFF; ct[7] = h & 0xFF; in s_safer_ecb_encrypt()
[all …]
/optee_os/core/arch/arm/dts/
H A Dstm32mp15-pinctrl.dtsi156 pinmux = <STM32_PINMUX('G', 5, AF11)>, /* ETH_RGMII_CLK125 */
157 <STM32_PINMUX('G', 4, AF11)>, /* ETH_RGMII_GTX_CLK */
158 <STM32_PINMUX('G', 13, AF11)>, /* ETH_RGMII_TXD0 */
159 <STM32_PINMUX('G', 14, AF11)>, /* ETH_RGMII_TXD1 */
187 pinmux = <STM32_PINMUX('G', 5, ANALOG)>, /* ETH_RGMII_CLK125 */
188 <STM32_PINMUX('G', 4, ANALOG)>, /* ETH_RGMII_GTX_CLK */
189 <STM32_PINMUX('G', 13, ANALOG)>, /* ETH_RGMII_TXD0 */
190 <STM32_PINMUX('G', 14, ANALOG)>, /* ETH_RGMII_TXD1 */
207 pinmux = <STM32_PINMUX('G', 5, AF11)>, /* ETH_RGMII_CLK125 */
208 <STM32_PINMUX('G', 4, AF11)>, /* ETH_RGMII_GTX_CLK */
[all …]
/optee_os/core/drivers/crypto/hisilicon/
H A Dhpre_dh.c29 key->g = crypto_bignum_allocate(size_bits); in hpre_dh_alloc_keypair()
30 if (!key->g) in hpre_dh_alloc_keypair()
58 crypto_bignum_free(&key->g); in hpre_dh_alloc_keypair()
190 msg->g = msg->x_p + (msg->key_bytes << 1); in hpre_dh_params_alloc()
192 msg->out = msg->g + msg->key_bytes; in hpre_dh_params_alloc()
220 msg->gbytes = crypto_bignum_num_bytes(key->g); in hpre_dh_params_bn2bin()
221 crypto_bignum_bn2bin(key->g, msg->g); in hpre_dh_params_bn2bin()
226 crypto_bignum_bn2bin(pubkey, msg->g); in hpre_dh_params_bn2bin()
241 ret = hpre_bin_from_crypto_bin(msg->g, msg->g, msg->key_bytes, in hpre_dh_params_bn2bin()
286 if (!key || !key->g || !key->p || !key->x || !key->y) { in hpre_dh_gen_keypair()
/optee_os/core/lib/libtomcrypt/src/stream/rabbit/
H A Drabbit.c93 ulong32 g[8], c_old[8], i; in ss_rabbit_next_state() local
111 /* Calculate the g-values */ in ss_rabbit_next_state()
113 g[i] = ss_rabbit_g_func((ulong32)(p_instance->x[i] + p_instance->c[i])); in ss_rabbit_next_state()
117 p_instance->x[0] = (ulong32)(g[0] + ROLc(g[7],16) + ROLc(g[6], 16)); in ss_rabbit_next_state()
118 p_instance->x[1] = (ulong32)(g[1] + ROLc(g[0], 8) + g[7]); in ss_rabbit_next_state()
119 p_instance->x[2] = (ulong32)(g[2] + ROLc(g[1],16) + ROLc(g[0], 16)); in ss_rabbit_next_state()
120 p_instance->x[3] = (ulong32)(g[3] + ROLc(g[2], 8) + g[1]); in ss_rabbit_next_state()
121 p_instance->x[4] = (ulong32)(g[4] + ROLc(g[3],16) + ROLc(g[2], 16)); in ss_rabbit_next_state()
122 p_instance->x[5] = (ulong32)(g[5] + ROLc(g[4], 8) + g[3]); in ss_rabbit_next_state()
123 p_instance->x[6] = (ulong32)(g[6] + ROLc(g[5],16) + ROLc(g[4], 16)); in ss_rabbit_next_state()
[all …]

12345678