BN_mod_mul(UKM, UKM, cofactor, order, ctx);
BN_mod_mul(p, key, UKM, order, ctx);
if (!EC_POINT_mul(EC_KEY_get0_group(priv_key), pnt, NULL, pub_key, p, ctx)) {
BN_mod_mul(UKM, UKM, cofactor, order, ctx);
BN_mod_mul(p, key, UKM, order, ctx);
if (!EC_POINT_mul(EC_KEY_get0_group(priv_key), pnt, NULL, pub_key, p, ctx)) {
- if (RAND_bytes(data->shared_ukm, 32) <= 0) {
- GOSTerr(GOST_F_PKEY_GOST2018_ENCRYPT, ERR_R_INTERNAL_ERROR);
- goto err;
- }
- data->shared_ukm_size = 32;
+ if (RAND_bytes(data->shared_ukm, 32) <= 0) {
+ GOSTerr(GOST_F_PKEY_GOST2018_ENCRYPT, ERR_R_INTERNAL_ERROR);
+ goto err;
+ }
+ data->shared_ukm_size = 32;
size_t *key_len, const unsigned char *in, size_t in_len)
{
struct gost_pmeth_data *gctx = EVP_PKEY_CTX_get_data(pctx);
size_t *key_len, const unsigned char *in, size_t in_len)
{
struct gost_pmeth_data *gctx = EVP_PKEY_CTX_get_data(pctx);
- switch (gctx->cipher_nid)
- {
- case NID_id_Gost28147_89:
- case NID_undef: /* FIXME */
- return pkey_GOST_ECcp_decrypt(pctx, key, key_len, in, in_len);
- case NID_kuznyechik_ctr:
- case NID_magma_ctr:
- return pkey_gost2018_decrypt(pctx, key, key_len, in, in_len);
- default:
+ switch (gctx->cipher_nid)
+ {
+ case NID_id_Gost28147_89:
+ case NID_undef: /* FIXME */
+ return pkey_GOST_ECcp_decrypt(pctx, key, key_len, in, in_len);
+ case NID_kuznyechik_ctr:
+ case NID_magma_ctr:
+ return pkey_gost2018_decrypt(pctx, key, key_len, in, in_len);
+ default: