24 static int VKO_compute_key(
unsigned char *shared_key,
size_t shared_key_size,
const EC_POINT *pub_key,
EC_KEY *priv_key,
const unsigned char *ukm)
26 unsigned char ukm_be[8],databuf[64],hashbuf[64];
27 BIGNUM *UKM=NULL,*
p=NULL,*order=NULL,*
X=NULL,*
Y=NULL;
56 hashbuf[63-i]=databuf[i];
123 unsigned char ukm[8], shared_key[32], crypted_key[44];
125 int key_is_ephemeral=1;
177 gkt = GOST_KEY_TRANSPORT_new();
195 if (key_is_ephemeral) {
206 if (!key_is_ephemeral)
216 if ((*out_len = i2d_GOST_KEY_TRANSPORT(gkt,out?&out:NULL))>0) ret =1;
217 GOST_KEY_TRANSPORT_free(gkt);
221 GOST_KEY_TRANSPORT_free(gkt);
230 const unsigned char *p = in;
234 unsigned char wrappedKey[44];
235 unsigned char sharedKey[32];
238 EVP_PKEY *eph_key=NULL, *peerkey=NULL;
245 gkt = d2i_GOST_KEY_TRANSPORT(NULL,(
const unsigned char **)&p,
306 if (gkt) GOST_KEY_TRANSPORT_free(gkt);