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. 0xC4,0xA5,0x12,0x8D,0x07,0x6B,0x7C,0x00,0x1A,0x5E,0xFE,0xF5,
  8. 0xA8,0x36,0x55,0xBB,0xBD,0x23,0x69,0x76,0x34,0xA0,0x36,0x79,
  9. 0x15,0x70,0x22,0xFF,0xAB,0xA8,0x8F,0xAF,0x7B,0x4C,0x9F,0xAB,
  10. 0x16,0x7D,0xB6,0x92,0x51,0xE6,0x0C,0x50,0x39,0xCB,0x92,0x92,
  11. 0x29,0x24,0x03,0x32,0xC7,0x26,0x26,0x36,0xA5,0x10,0x35,0x42,
  12. 0x7B,0xA6,0x0F,0x33,
  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. }