dh.h 732 B

12345678910111213141516171819202122232425
  1. #ifndef HEADER_DH_H
  2. #include <openssl/dh.h>
  3. #endif
  4. DH *get_dh512()
  5. {
  6. static unsigned char dh512_p[]={
  7. 0xB9,0xBD,0x35,0x0C,0xD1,0xE9,0x25,0x3F,0x88,0x0E,0x29,0x73,
  8. 0x6D,0x08,0xDB,0x75,0x5B,0x7A,0x43,0x2D,0x2A,0x73,0x55,0x94,
  9. 0xA2,0xC0,0x90,0xB5,0xE5,0x0D,0xB1,0x62,0x95,0x32,0xA7,0x6E,
  10. 0xC8,0x75,0x1E,0x30,0x0E,0x70,0xC3,0x5D,0x99,0xF9,0x6A,0xA5,
  11. 0xC2,0x0C,0x26,0xD5,0xC3,0x14,0x71,0x12,0x6E,0x7D,0x91,0x86,
  12. 0xED,0x73,0x29,0x63,
  13. };
  14. static unsigned char dh512_g[]={
  15. 0x02,
  16. };
  17. DH *dh;
  18. if ((dh=DH_new()) == NULL) return(NULL);
  19. dh->p=BN_bin2bn(dh512_p,sizeof(dh512_p),NULL);
  20. dh->g=BN_bin2bn(dh512_g,sizeof(dh512_g),NULL);
  21. if ((dh->p == NULL) || (dh->g == NULL))
  22. { DH_free(dh); return(NULL); }
  23. return(dh);
  24. }