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. 0xB8,0xDD,0x6F,0x79,0x72,0xD2,0x5B,0xAA,0x5B,0xAA,0x86,0x18,
  8. 0x9C,0x0E,0xE1,0xD7,0x8E,0xB6,0x6C,0x19,0x47,0xE7,0xF0,0xDC,
  9. 0xCE,0xB0,0xFD,0x61,0x2E,0x34,0xCD,0x3E,0x62,0x3B,0x8A,0xA4,
  10. 0x0C,0x53,0x24,0xFE,0x03,0x1B,0x45,0x5B,0xBF,0x13,0x48,0x76,
  11. 0x07,0x59,0xDD,0x13,0x2E,0x87,0x11,0x0F,0x3E,0xAA,0xD7,0xF1,
  12. 0xAF,0x15,0x27,0x83,
  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. }