diff options
author | Nick Mathewson <nickm@torproject.org> | 2015-07-31 11:21:34 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2015-07-31 11:21:34 -0400 |
commit | 347fe449fe818f97e0f3ba29dd0a08ff6d39081e (patch) | |
tree | 9397c155e38a7e7084b91c55f1c57f576aa42b25 /src/common/crypto.h | |
parent | 8c83e8cec0e8d4c29577ae7c7b27637e5b91c99e (diff) | |
download | tor-347fe449fe818f97e0f3ba29dd0a08ff6d39081e.tar.gz tor-347fe449fe818f97e0f3ba29dd0a08ff6d39081e.zip |
Move formatting functions around.
The base64 and base32 functions used to be in crypto.c;
crypto_format.h had no header; some general-purpose functions were in
crypto_curve25519.c.
This patch makes a {crypto,util}_format.[ch], and puts more functions
there. Small modules are beautiful!
Diffstat (limited to 'src/common/crypto.h')
-rw-r--r-- | src/common/crypto.h | 20 |
1 files changed, 0 insertions, 20 deletions
diff --git a/src/common/crypto.h b/src/common/crypto.h index b953ab93e7..368e9d8e32 100644 --- a/src/common/crypto.h +++ b/src/common/crypto.h @@ -278,26 +278,6 @@ struct smartlist_t; void *smartlist_choose(const struct smartlist_t *sl); void smartlist_shuffle(struct smartlist_t *sl); -#define BASE64_ENCODE_MULTILINE 1 -size_t base64_encode_size(size_t srclen, int flags); -int base64_encode(char *dest, size_t destlen, const char *src, size_t srclen, - int flags); -int base64_decode(char *dest, size_t destlen, const char *src, size_t srclen); -int base64_encode_nopad(char *dest, size_t destlen, - const uint8_t *src, size_t srclen); -int base64_decode_nopad(uint8_t *dest, size_t destlen, - const char *src, size_t srclen); - -/** Characters that can appear (case-insensitively) in a base32 encoding. */ -#define BASE32_CHARS "abcdefghijklmnopqrstuvwxyz234567" -void base32_encode(char *dest, size_t destlen, const char *src, size_t srclen); -int base32_decode(char *dest, size_t destlen, const char *src, size_t srclen); - -int digest_to_base64(char *d64, const char *digest); -int digest_from_base64(char *digest, const char *d64); -int digest256_to_base64(char *d64, const char *digest); -int digest256_from_base64(char *digest, const char *d64); - /** OpenSSL-based utility functions. */ void memwipe(void *mem, uint8_t byte, size_t sz); |