DH1080.h 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. #include <stdlib.h>
  2. #include <stdio.h>
  3. #include <time.h>
  4. #include <string.h>
  5. #include <openssl/rand.h>
  6. #include <openssl/bn.h>
  7. #include <openssl/dh.h>
  8. #include <openssl/engine.h>
  9. #include <openssl/sha.h>
  10. // Input: priv_key = buffer of 200 bytes
  11. // pub_key = buffer of 200 bytes
  12. // Output: priv_key = Your private key
  13. // pub_key = Your public key
  14. int DH1080_gen(char *priv_key, char *pub_key);
  15. // Input: MyPrivKey = Your private key
  16. // HisPubKey = Someones pubic key
  17. // Output: MyPrivKey has been destroyed for security reasons
  18. // HisPubKey = the secret key
  19. int DH1080_comp(char *MyPrivKey, char *HisPubKey);
  20. int DH1080_Init();
  21. void DH1080_DeInit();
  22. #define DH1080_PRIME_BITS 1080
  23. #define DH1080_PRIME_BYTES 135
  24. void initb64(void);
  25. int b64toh(char *b, char *d);
  26. int htob64(char *h, char *d, unsigned int l);
  27. extern char B64ABC[]; // original Base64 alphabet
  28. extern char B64[]; // Base64 alphabet used by blowcrypt
  29. // return full path for ~/.irssi/config
  30. extern const char *get_irssi_config(void);