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. 0x96,0x9A,0x23,0x95,0x6A,0xBA,0x24,0x9C,0xE6,0x46,0x5B,0xFF,
  8. 0xFE,0x76,0xEA,0xCF,0xA5,0xCF,0xE0,0xD8,0x94,0xDB,0x77,0x78,
  9. 0xC4,0x22,0xE8,0xC6,0x36,0x4B,0xDF,0x34,0xE1,0xA7,0x12,0x66,
  10. 0x6A,0x43,0x46,0x81,0x8D,0xFB,0xF3,0xE5,0xDC,0x13,0x19,0x3F,
  11. 0x90,0xFD,0x21,0x1C,0x2E,0x1F,0xCF,0xEF,0x5B,0x3F,0x25,0x75,
  12. 0x09,0xBB,0xF2,0x3B,
  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. }