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. 0xEC,0xC9,0x9D,0xB4,0x77,0x0B,0x31,0xC3,0xEF,0xE7,0xEC,0xEE,
  8. 0x32,0xA5,0xED,0x4E,0x09,0xD3,0x78,0xDA,0xB2,0x62,0x82,0xA5,
  9. 0xF9,0xCE,0x6E,0x65,0x23,0x71,0x18,0x9B,0x78,0x41,0x37,0xA1,
  10. 0x6C,0xCB,0x2F,0xEF,0x2A,0x41,0x21,0x76,0x64,0x55,0xF7,0xFB,
  11. 0x6B,0xB5,0x98,0xB6,0x10,0x20,0xB8,0x29,0x2C,0xD4,0x4C,0x49,
  12. 0x58,0xB7,0x21,0x73,
  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. }