Home
last modified time | relevance | path

Searched refs:SM2_INT_SIZE_BYTES (Results 1 – 6 of 6) sorted by relevance

/optee_os/lib/libmbedtls/core/
H A Dsm2-kep.c17 #define SM2_INT_SIZE_BYTES 32 macro
35 uint8_t buf[SM2_INT_SIZE_BYTES] = { }; in sm2_kep_compute_Z()
65 mres = mbedtls_mpi_write_binary(&grp->A, buf, SM2_INT_SIZE_BYTES); in sm2_kep_compute_Z()
74 mres = mbedtls_mpi_write_binary(&grp->B, buf, SM2_INT_SIZE_BYTES); in sm2_kep_compute_Z()
83 mres = mbedtls_mpi_write_binary(&grp->G.X, buf, SM2_INT_SIZE_BYTES); in sm2_kep_compute_Z()
92 mres = mbedtls_mpi_write_binary(&grp->G.Y, buf, SM2_INT_SIZE_BYTES); in sm2_kep_compute_Z()
101 mres = mbedtls_mpi_write_binary(key->x, buf, SM2_INT_SIZE_BYTES); in sm2_kep_compute_Z()
110 mres = mbedtls_mpi_write_binary(key->y, buf, SM2_INT_SIZE_BYTES); in sm2_kep_compute_Z()
141 uint8_t buf[SM2_INT_SIZE_BYTES]; in sm2_kep_compute_S()
159 mres = mbedtls_mpi_write_binary(&UV->X, buf, SM2_INT_SIZE_BYTES); in sm2_kep_compute_S()
[all …]
H A Dsm2-pke.c21 #define SM2_INT_SIZE_BYTES 32 macro
31 if (max_size < (size_t)(2 * SM2_INT_SIZE_BYTES)) in sm2_uncompressed_bytes_to_point()
34 mres = mbedtls_mpi_read_binary(&p->X, ptr, SM2_INT_SIZE_BYTES); in sm2_uncompressed_bytes_to_point()
38 ptr += SM2_INT_SIZE_BYTES; in sm2_uncompressed_bytes_to_point()
40 mres = mbedtls_mpi_read_binary(&p->Y, ptr, SM2_INT_SIZE_BYTES); in sm2_uncompressed_bytes_to_point()
52 *consumed = 2 * SM2_INT_SIZE_BYTES + 1; /* PC */ in sm2_uncompressed_bytes_to_point()
167 if (mbedtls_mpi_size(&x2y2p.X) > SM2_INT_SIZE_BYTES || in sm2_mbedtls_pke_decrypt()
168 mbedtls_mpi_size(&x2y2p.Y) > SM2_INT_SIZE_BYTES) { in sm2_mbedtls_pke_decrypt()
173 mres = mbedtls_mpi_write_binary(&x2y2p.X, x2y2, SM2_INT_SIZE_BYTES); in sm2_mbedtls_pke_decrypt()
178 mres = mbedtls_mpi_write_binary(&x2y2p.Y, x2y2 + SM2_INT_SIZE_BYTES, in sm2_mbedtls_pke_decrypt()
[all …]
H A Dsm2-dsa.c20 #define SM2_INT_SIZE_BYTES 32 macro
39 if (*sig_len < 2 * SM2_INT_SIZE_BYTES) { in sm2_mbedtls_dsa_sign()
124 *sig_len = 2 * SM2_INT_SIZE_BYTES; in sm2_mbedtls_dsa_sign()
126 mres = mbedtls_mpi_write_binary(&r, sig, SM2_INT_SIZE_BYTES); in sm2_mbedtls_dsa_sign()
129 mres = mbedtls_mpi_write_binary(&s, sig + SM2_INT_SIZE_BYTES, in sm2_mbedtls_dsa_sign()
130 SM2_INT_SIZE_BYTES); in sm2_mbedtls_dsa_sign()
/optee_os/core/lib/libtomcrypt/
H A Dsm2-kep.c19 #define SM2_INT_SIZE_BYTES 32 macro
30 uint8_t buf[SM2_INT_SIZE_BYTES]; in sm2_kep_compute_Z()
59 mp_to_unsigned_bin2(key->dp.A, buf, SM2_INT_SIZE_BYTES); in sm2_kep_compute_Z()
64 mp_to_unsigned_bin2(key->dp.B, buf, SM2_INT_SIZE_BYTES); in sm2_kep_compute_Z()
69 mp_to_unsigned_bin2(key->dp.base.x, buf, SM2_INT_SIZE_BYTES); in sm2_kep_compute_Z()
74 mp_to_unsigned_bin2(key->dp.base.y, buf, SM2_INT_SIZE_BYTES); in sm2_kep_compute_Z()
79 mp_to_unsigned_bin2(key->pubkey.x, buf, SM2_INT_SIZE_BYTES); in sm2_kep_compute_Z()
84 mp_to_unsigned_bin2(key->pubkey.y, buf, SM2_INT_SIZE_BYTES); in sm2_kep_compute_Z()
110 uint8_t buf[SM2_INT_SIZE_BYTES]; in sm2_kep_compute_S()
127 mp_to_unsigned_bin2(UV->x, buf, SM2_INT_SIZE_BYTES); in sm2_kep_compute_S()
[all …]
H A Dsm2-pke.c21 #define SM2_INT_SIZE_BYTES 32 macro
32 if (max_size < (size_t)(2 * SM2_INT_SIZE_BYTES)) in sm2_uncompressed_bytes_to_point()
35 ltc_res = mp_read_unsigned_bin(p->x, ptr, SM2_INT_SIZE_BYTES); in sm2_uncompressed_bytes_to_point()
39 ptr += SM2_INT_SIZE_BYTES; in sm2_uncompressed_bytes_to_point()
41 ltc_res = mp_read_unsigned_bin(p->y, ptr, SM2_INT_SIZE_BYTES); in sm2_uncompressed_bytes_to_point()
51 *consumed = 2 * SM2_INT_SIZE_BYTES + 1; /* PC */ in sm2_uncompressed_bytes_to_point()
208 if (mp_unsigned_bin_size(x2y2p->x) > SM2_INT_SIZE_BYTES || in sm2_ltc_pke_decrypt()
209 mp_unsigned_bin_size(x2y2p->y) > SM2_INT_SIZE_BYTES) { in sm2_ltc_pke_decrypt()
214 mp_to_unsigned_bin2(x2y2p->x, x2y2, SM2_INT_SIZE_BYTES); in sm2_ltc_pke_decrypt()
215 mp_to_unsigned_bin2(x2y2p->y, x2y2 + SM2_INT_SIZE_BYTES, in sm2_ltc_pke_decrypt()
[all …]
H A Dsm2-dsa.c16 #define SM2_INT_SIZE_BYTES 32 macro
35 if (*sig_len < 2 * SM2_INT_SIZE_BYTES) { in sm2_ltc_dsa_sign()
125 *sig_len = 2 * SM2_INT_SIZE_BYTES; in sm2_ltc_dsa_sign()
127 mp_to_unsigned_bin2(r, sig, SM2_INT_SIZE_BYTES); in sm2_ltc_dsa_sign()
128 mp_to_unsigned_bin2(s, sig + SM2_INT_SIZE_BYTES, SM2_INT_SIZE_BYTES); in sm2_ltc_dsa_sign()