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. 0xB3,0xDB,0x56,0x63,0x38,0x40,0xF6,0x12,0xF6,0x12,0xBD,0xBA,
  8. 0x2D,0x16,0x1E,0xDA,0x2B,0x06,0xFD,0xEE,0x9D,0x2F,0x91,0x52,
  9. 0x30,0x2F,0x74,0x9E,0xDE,0xE7,0x8B,0x8E,0x01,0x9C,0xCE,0x52,
  10. 0x42,0xD9,0xA7,0xAD,0x39,0x6C,0x04,0xD6,0x25,0x9F,0x79,0x63,
  11. 0xE6,0x71,0xFD,0x66,0x54,0x01,0x61,0xB1,0x57,0xFC,0x9C,0x88,
  12. 0xD4,0xCB,0x8D,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. }