diff options
Diffstat (limited to 'onion_base32.c')
-rw-r--r-- | onion_base32.c | 14 |
1 files changed, 1 insertions, 13 deletions
diff --git a/onion_base32.c b/onion_base32.c index 701b302..53c6404 100644 --- a/onion_base32.c +++ b/onion_base32.c @@ -3,11 +3,6 @@ static const char base32_lookup[] = "abcdefghijklmnopqrstuvwxyz234567"; -/* Find the first instance of a character in `subject` which is not in the - * base32 alphabet. - * Returns the offset into `subject` of the first such character, or -1 - * if no such character exists in the string - */ int check_base32(char *subject) { size_t offset = 0; @@ -18,11 +13,6 @@ check_base32(char *subject) { return -1; } -/* Simple and reliable base32 algorithm - "old trusty" - * Note: This is not a general base32 algorithm; it outputs only the - * first 16 base32 symbols of the input buffer, using only the first - * 20 bytes of that buffer. - */ void onion_base32(char output[16], unsigned char sum[20]) { size_t c = 0; @@ -43,7 +33,7 @@ onion_base32(char output[16], unsigned char sum[20]) { /* Helper function for onion_base32_dec. Decodes a single base32 character * into its binary equivalent */ -unsigned char +static unsigned char base32_dec_single(char b) { if (b >= 'a' && b <= 'z') return b - 'a'; @@ -53,8 +43,6 @@ base32_dec_single(char b) { return 0; } -/* Simple algorithm to decode a 16-byte base32 sequence to the 10 bytes - * it represents, placing the result in dec */ void onion_base32_dec(unsigned char dec[10], char base32[16]) { |