summaryrefslogtreecommitdiff
path: root/base64.h
diff options
context:
space:
mode:
authorDan Egnor <egnor@ofb.net>2002-01-22 17:30:31 +0100
committerNiels Möller <nisse@lysator.liu.se>2002-01-22 17:30:31 +0100
commit836e5adc9cba03855d8f202fa4b0138a3f6eb7fe (patch)
tree8cce89889751089c46e84cc05d2b73a55a4bff17 /base64.h
parent55726355987146b1dc5747e28b51f30ee3d46e44 (diff)
downloadnettle-836e5adc9cba03855d8f202fa4b0138a3f6eb7fe.tar.gz
New files, hacked by Dan
Egnor. Rev: src/nettle/base64-meta.c:1.1 Rev: src/nettle/base64.c:1.1 Rev: src/nettle/base64.h:1.1
Diffstat (limited to 'base64.h')
-rw-r--r--base64.h46
1 files changed, 46 insertions, 0 deletions
diff --git a/base64.h b/base64.h
new file mode 100644
index 00000000..27888b85
--- /dev/null
+++ b/base64.h
@@ -0,0 +1,46 @@
+/* armor.h
+ *
+ * "ASCII armor" codecs.
+ */
+
+/* nettle, low-level cryptographics library
+ *
+ * Copyright (C) 2001 Niels Möller
+ *
+ * The nettle library is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * The nettle library is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with the nettle library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
+ * MA 02111-1307, USA.
+ */
+
+#ifndef NETTLE_ARMOR_H_INCLUDED
+#define NETTLE_ARMOR_H_INCLUDED
+
+#include <inttypes.h>
+
+/* Base64 encoding */
+
+#define BASE64_ASCII_BLOCK_SIZE 4
+#define BASE64_RAW_BLOCK_SIZE 3
+
+unsigned /* Returns the length of encoded data */
+base64_encode(uint8_t *dst,
+ unsigned src_length,
+ const uint8_t *src);
+
+unsigned /* Returns the length of decoded data */
+base64_decode(uint8_t *dst,
+ unsigned src_length,
+ const uint8_t *src);
+
+#endif /* NETTLE_ARMOR_H_INCLUDED */