util.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. /*
  2. * Slitheen - a decoy routing system for censorship resistance
  3. * Copyright (C) 2017 Cecylia Bocovich (cbocovic@uwaterloo.ca)
  4. *
  5. * This program is free software: you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License as published by
  7. * the Free Software Foundation, version 3.
  8. *
  9. * This program is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU General Public License
  15. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  16. *
  17. * Additional permission under GNU GPL version 3 section 7
  18. *
  19. * If you modify this Program, or any covered work, by linking or combining
  20. * it with the OpenSSL library (or a modified version of that library),
  21. * containing parts covered by the terms of [name of library's license],
  22. * the licensors of this Program grant you additional permission to convey
  23. * the resulting work. {Corresponding Source for a non-source form of such
  24. * a combination shall include the source code for the parts of the OpenSSL
  25. * library used as well as that of the covered work.}
  26. */
  27. #ifndef _UTIL_H_
  28. #define _UTIL_H_
  29. #include <stdint.h>
  30. #include <stdlib.h>
  31. int base64_encode(uint8_t *in, size_t len, char **out);
  32. void *emalloc(size_t size);
  33. void *ecalloc(size_t nmemb, size_t size);
  34. #endif