50 if (!pkey_gost_init(dst))
56 *dst_data = *src_data;
93 #ifndef OPENSSL_NO_CMS
108 if (p1 == 0 || p1 == 1)
121 const char *type,
const char *value)
130 if (strlen(value) == 1)
132 switch(toupper((
unsigned char)value[0]))
151 else if ((strlen(value) == 2) && (toupper((
unsigned char)value[0]) ==
'X'))
153 switch (toupper((
unsigned char)value[1]))
179 if (p->
nid == param_nid)
break;
196 const char *type,
const char *value)
205 if (strlen(value) == 1)
207 switch(toupper((
unsigned char)value[0]))
226 else if ((strlen(value) == 2) && (toupper((
unsigned char)value[0]) ==
'X'))
228 switch (toupper((
unsigned char)value[1]))
251 if (p->
nid == param_nid)
break;
317 if (!pkey_gost94_paramgen(ctx,pkey))
return 0;
327 if (!pkey_gost01_paramgen(ctx,pkey))
return 0;
337 static int pkey_gost94_cp_sign(
EVP_PKEY_CTX *ctx,
unsigned char *sig,
size_t *siglen,
338 const unsigned char *tbs,
size_t tbs_len)
342 if (!siglen)
return 0;
356 static int pkey_gost01_cp_sign(
EVP_PKEY_CTX *ctx,
unsigned char *sig,
size_t *siglen,
357 const unsigned char *tbs,
size_t tbs_len)
361 if (!siglen)
return 0;
377 static int pkey_gost94_cp_verify(
EVP_PKEY_CTX *ctx,
const unsigned char *sig,
378 size_t siglen,
const unsigned char *tbs,
size_t tbs_len)
390 static int pkey_gost01_cp_verify(
EVP_PKEY_CTX *ctx,
const unsigned char *sig,
391 size_t siglen,
const unsigned char *tbs,
size_t tbs_len)
398 fprintf(stderr,
"R=");
400 fprintf(stderr,
"\nS=");
402 fprintf(stderr,
"\n");
438 if (!pkey_gost_mac_init(dst))
444 *dst_data = *src_data;
448 static int pkey_gost_mac_ctrl(
EVP_PKEY_CTX *ctx,
int type,
int p1,
void *p2)
479 memcpy(data->
key,p2,32);
509 const char *type,
const char *value)
513 if (strlen(value)!=32)
524 long keylen;
int ret;
545 unsigned char *keydata;
552 memcpy(keydata,data->
key,32);
564 unsigned int tmpsiglen=*siglen;
579 if (!*pmeth)
return 0;