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. 0xFB,0x08,0x25,0x3A,0x54,0x60,0x09,0xB0,0xEB,0xCE,0x3C,0xDD,
  8. 0x35,0x82,0x5F,0xA3,0xBD,0x55,0xB6,0x5B,0xB6,0x7B,0x0C,0xD0,
  9. 0xAC,0x70,0x50,0xFE,0x06,0xFA,0xA8,0xF5,0xE3,0x89,0x88,0x5F,
  10. 0xFA,0x71,0x4E,0x63,0x65,0x31,0x03,0x2F,0x8E,0x35,0xE1,0x97,
  11. 0x05,0x0C,0xBE,0xA0,0xB9,0xC3,0x42,0x97,0x94,0xB0,0x4D,0x33,
  12. 0x31,0xBC,0xA2,0x9B,
  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. }