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. 0xB4,0xC4,0xCB,0xF8,0x94,0xEE,0x4D,0x73,0x23,0xF9,0xB0,0xC4,
  8. 0x07,0xB5,0x69,0xC8,0x7B,0x85,0x10,0xA6,0xB6,0x56,0x2B,0x52,
  9. 0xDB,0x7C,0xC6,0x39,0x34,0x1B,0xAB,0x68,0xB2,0x05,0x8F,0x87,
  10. 0x0D,0x53,0xD1,0x32,0x85,0xDC,0xEE,0xA4,0x92,0xBF,0x1B,0x40,
  11. 0x99,0x76,0xF5,0x28,0xA4,0xAC,0x35,0xD6,0x3F,0x7C,0x23,0xE0,
  12. 0xBC,0xE9,0x34,0x03,
  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. }