From 92d9e59d6b3dc5375c100c72ba8907502aea8331 Mon Sep 17 00:00:00 2001 From: David Phillips Date: Mon, 3 Jul 2017 17:50:03 +1200 Subject: Add more function docs to onion_base32.c --- onion_base32.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/onion_base32.c b/onion_base32.c index 7863f8c..701b302 100644 --- a/onion_base32.c +++ b/onion_base32.c @@ -3,6 +3,11 @@ 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; @@ -35,6 +40,9 @@ 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 base32_dec_single(char b) { if (b >= 'a' && b <= 'z') -- cgit v1.1