Lines Matching defs:dh
1 /* apps/dh.c */
70 # include <openssl/dh.h>
92 DH *dh = NULL;
221 dh = d2i_DHparams_bio(in, NULL);
223 dh = PEM_read_bio_DHparams(in, NULL, NULL, NULL);
228 if (dh == NULL) {
235 DHparams_print(out, dh);
238 BN_print(stdout, dh->p);
240 BN_print(stdout, dh->g);
242 if (dh->length != 0)
243 printf("recommended private length=%ld\n", dh->length);
248 if (!DH_check(dh, &i)) {
267 len = BN_num_bytes(dh->p);
268 bits = BN_num_bits(dh->p);
274 l = BN_bn2bin(dh->p, data);
275 printf("static unsigned char dh%d_p[]={", bits);
283 l = BN_bn2bin(dh->g, data);
284 printf("static unsigned char dh%d_g[]={", bits);
293 printf("\tDH *dh;\n\n");
294 printf("\tif ((dh=DH_new()) == NULL) return(NULL);\n");
295 printf("\tdh->p=BN_bin2bn(dh%d_p,sizeof(dh%d_p),NULL);\n",
297 printf("\tdh->g=BN_bin2bn(dh%d_g,sizeof(dh%d_g),NULL);\n",
299 printf("\tif ((dh->p == NULL) || (dh->g == NULL))\n");
301 printf("\treturn(dh);\n\t}\n");
307 i = i2d_DHparams_bio(out, dh);
309 i = PEM_write_bio_DHparams(out, dh);
326 if (dh != NULL)
327 DH_free(dh);