aboutsummaryrefslogtreecommitdiff
path: root/onion_base32.h
diff options
context:
space:
mode:
Diffstat (limited to 'onion_base32.h')
-rw-r--r--onion_base32.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/onion_base32.h b/onion_base32.h
index 854c6f9..3ed2bf7 100644
--- a/onion_base32.h
+++ b/onion_base32.h
@@ -1,3 +1,17 @@
+/* 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 *);
+
+/* 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 [16], unsigned char (*));
+
+/* 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 [10], char[16]);