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. 0x8A,0xA6,0xF0,0xEF,0x5E,0x6E,0x71,0x62,0x1A,0x5F,0xE7,0xA8,
  8. 0xF8,0x81,0xD3,0x28,0x7E,0x4A,0x57,0x35,0xE3,0x55,0x72,0x9F,
  9. 0x0F,0xB8,0x39,0x5F,0x80,0x5B,0xA6,0x38,0xB9,0xAB,0xE6,0xCD,
  10. 0x9A,0x08,0x3E,0x8D,0xE2,0xB4,0xFB,0xC9,0x2B,0x74,0x36,0xD5,
  11. 0x0E,0x41,0x3F,0x6B,0x99,0xA5,0xB4,0x8E,0x09,0xC2,0x5E,0x81,
  12. 0xB5,0xB9,0x71,0x93,
  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. }