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. 0xE9,0xFF,0x32,0x13,0x76,0x3B,0xCC,0x89,0xEC,0xAD,0x06,0xA3,
  8. 0x0B,0x60,0x0F,0x55,0xBF,0x12,0xD3,0xDB,0x64,0x41,0x25,0xF1,
  9. 0xF4,0xF9,0xBF,0x37,0x7A,0xB1,0x8F,0xD8,0xCB,0x35,0xD9,0x51,
  10. 0xC3,0x7B,0x1A,0x63,0xCC,0x4A,0x02,0x7A,0xDF,0xDD,0x74,0x40,
  11. 0x7E,0x3A,0xA1,0xB0,0x0B,0x51,0xEC,0xBA,0x10,0x19,0x70,0x6B,
  12. 0xF5,0xDF,0xEC,0xE3,
  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. }