summaryrefslogtreecommitdiff
path: root/node/Poly1305.hpp
diff options
context:
space:
mode:
authorAdam Ierymenko <adam.ierymenko@gmail.com>2013-09-14 13:51:08 -0400
committerAdam Ierymenko <adam.ierymenko@gmail.com>2013-09-14 13:51:08 -0400
commit660f92b6a7f91f9a4c53e0c40ce188a6f8878f04 (patch)
treec41908584b00915a7d78293e32ed6a649aa9c618 /node/Poly1305.hpp
parent09c8b4bbb37250df95ee898bcd6a0e090049d225 (diff)
downloadinfinitytier-660f92b6a7f91f9a4c53e0c40ce188a6f8878f04.tar.gz
infinitytier-660f92b6a7f91f9a4c53e0c40ce188a6f8878f04.zip
Add test vectors for ensuring identical C25519 operation across systems.
Diffstat (limited to 'node/Poly1305.hpp')
-rw-r--r--node/Poly1305.hpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/node/Poly1305.hpp b/node/Poly1305.hpp
index c61abcea..afe7439f 100644
--- a/node/Poly1305.hpp
+++ b/node/Poly1305.hpp
@@ -30,8 +30,16 @@
namespace ZeroTier {
+#define ZT_POLY1305_KEY_LEN 32
+#define ZT_POLY1305_MAC_LEN 16
+
/**
* Poly1305 one-time authentication code
+ *
+ * This takes a one-time-use 32-byte key and generates a 16-byte message
+ * authentication code. The key must never be re-used for a different
+ * message. Normally this is done by taking a base key and mangling it
+ * using a nonce and possibly other data, as in Packet.
*/
class Poly1305
{
@@ -44,7 +52,7 @@ public:
* @param len Length of data to authenticate in bytes
* @param key 32-byte one-time use key to authenticate data (must not be reused)
*/
- static void computeAuthCode(void *auth,const void *data,unsigned int len,const void *key)
+ static void mac(void *auth,const void *data,unsigned int len,const void *key)
throw();
};