dh_util.h 496 B

12345678910111213141516171819202122
  1. /* dh_util.h
  2. *
  3. */
  4. #ifndef _DH_UTIL_H
  5. #define _DH_UTIL_H 1
  6. #include <sys/types.h>
  7. #include <openssl/dh.h>
  8. namespace bd {
  9. class String;
  10. }
  11. // Adapated from znc-fish
  12. bd::String fishBase64Encode(const bd::String& str);
  13. bd::String fishBase64Decode(const bd::String& str);
  14. void DH1080_gen(bd::String& privateKey, bd::String& publicKeyB64);
  15. bool DH1080_comp(const bd::String privateKey, const bd::String theirPublicKeyB64, bd::String& sharedKey);
  16. void DH1080_init();
  17. void DH1080_uninit();
  18. #endif