4
0

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. 0x95,0xC8,0x9C,0x13,0xC7,0x80,0x1E,0x4E,0x5D,0x18,0x4F,0x0D,
  8. 0x56,0x7A,0xCB,0xFE,0xE3,0xFF,0x10,0xE4,0x7C,0xF7,0x7E,0x7F,
  9. 0xF7,0x14,0x48,0x21,0x74,0x34,0xF6,0x80,0xF1,0xAF,0xD7,0x88,
  10. 0xDD,0xFF,0xB2,0x87,0x95,0xF6,0x10,0x06,0xD6,0x8F,0x11,0xD8,
  11. 0xEA,0xAC,0x6F,0x15,0x73,0xC3,0xC0,0x67,0xB0,0x4F,0xC1,0xAD,
  12. 0xBD,0x21,0xE7,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. }