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. 0xD5,0x3F,0x5B,0x7D,0x68,0xC5,0xC1,0x1A,0x5E,0x52,0x50,0x32,
  8. 0xCA,0x47,0xA4,0x1F,0x54,0x64,0xCF,0x6F,0x10,0xC6,0x1E,0x40,
  9. 0xA2,0xD0,0x24,0x84,0xD2,0x61,0xE9,0x5E,0x5B,0xAA,0x0B,0xF0,
  10. 0xFB,0x51,0x2B,0xCC,0x97,0x17,0xB2,0x78,0xF8,0x6C,0xA3,0xB4,
  11. 0xDA,0xAD,0x47,0xB3,0x1F,0x69,0xEC,0x3A,0xD0,0xA3,0xC9,0x6E,
  12. 0x69,0x8B,0x48,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. }