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. 0xAE,0x63,0x22,0x35,0x42,0xB6,0xE3,0x9D,0x7E,0x19,0x82,0x86,
  8. 0x4E,0x35,0x2E,0xB6,0xC6,0xCB,0xEE,0x31,0x12,0xC7,0x65,0xB1,
  9. 0x2E,0xFD,0x0D,0x5D,0x2E,0xED,0x68,0xF8,0x8F,0x34,0xFB,0x00,
  10. 0x78,0x12,0xCA,0x21,0x18,0x04,0x5F,0x27,0x25,0x29,0x9D,0x30,
  11. 0x44,0xF1,0xD4,0xC1,0x2F,0x69,0x51,0x40,0xB1,0x0C,0x09,0xA8,
  12. 0x3C,0x41,0x5C,0x73,
  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. }