Advertisement
Guest User

Untitled

a guest
May 28th, 2015
202
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.54 KB | None | 0 0
  1. /*
  2.    This file is part of The Labnix Cryptography Library.
  3.  
  4.    The Labnix Cryptography Library is free software: you can redistribute
  5.    it and/or modify it under the terms of the GNU General Public License
  6.    as published by the Free Software Foundation, either version 3 of
  7.    the License, or (at your option) any later version.
  8.  
  9.    The Labnix Cryptography Library is distributed in the hope that it will
  10.    be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
  11.    of 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 The Labnix Cryptography Library. If not, see
  16.    <http://www.gnu.org/licenses/>.
  17.  */
  18. #ifndef CRYPTO_H
  19. #define CRYPTO_H
  20.  
  21. #include <ctype.h>
  22. #include <sys/types.h>
  23. #include <inttypes.h>
  24.  
  25. typedef int BASE;
  26.  
  27. enum {
  28.     BASE_16 = 16,
  29.     BASE_64 = 64,
  30.     BYTE = 8,
  31.     MAXLINE = 4096,
  32.     MAX_UNPRINTABLE = 0
  33. };
  34.  
  35. struct ca { /* character analysis */
  36.     float total, punct, alpha, digit, vowel, e ,t;
  37. };
  38. /* convert.c */
  39. size_t blen(const char *s, BASE n);
  40. size_t slen(int blen, BASE n);
  41. uint8_t *decode(uint8_t *raw, const char *estr, BASE n);
  42. char *encode(char *estr, const uint8_t *raw, size_t len, BASE n);
  43. /* xor.c */
  44. uint8_t *xor(uint8_t *buf, size_t blen, const uint8_t *key, size_t klen);
  45. void xorb(uint8_t *raw, size_t n, int c);
  46.  
  47. void filter( uint8_t *raw, size_t n, struct ca *min, struct ca *max); /* filter.c */
  48.  
  49.  
  50. #endif /* CRYPTO_H */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement