]> git.codecow.com Git - Monocypher.git/commitdiff
Renamed crypto_poly1305_auth to crypto_poly1305
authorLoup Vaillant <loup@loup-vaillant.fr>
Sat, 11 Nov 2017 18:17:03 +0000 (19:17 +0100)
committerLoup Vaillant <loup@loup-vaillant.fr>
Sat, 11 Nov 2017 18:17:46 +0000 (19:17 +0100)
doc/man/man3/crypto_poly1305.3monocypher [moved from doc/man/man3/crypto_poly1305_auth.3monocypher with 97% similarity]
doc/man/man3/crypto_poly1305_final.3monocypher
doc/man/man3/crypto_poly1305_init.3monocypher
doc/man/man3/crypto_poly1305_update.3monocypher
doc/man/man3/intro.3monocypher
src/monocypher.c
src/monocypher.h
tests/speed.c
tests/test.c

similarity index 97%
rename from doc/man/man3/crypto_poly1305_auth.3monocypher
rename to doc/man/man3/crypto_poly1305.3monocypher
index dbece627829d932a07b5734ba6fdc90d18025dda..92640ce5cda83e059ef6bd3025143fd185357043 100644 (file)
@@ -2,7 +2,7 @@
 .Dt CRYPTO_POLY1305_AUTH 3MONOCYPHER
 .Os
 .Sh NAME
-.Nm crypto_poly1305_auth ,
+.Nm crypto_poly1305 ,
 .Nm crypto_poly1305_init ,
 .Nm crypto_poly1305_update ,
 .Nm crypto_poly1305_final
@@ -10,7 +10,7 @@
 .Sh SYNOPSIS
 .In monocypher.h
 .Ft void
-.Fo crypto_poly1305_auth
+.Fo crypto_poly1305
 .Fa "uint8_t mac[16]"
 .Fa "const uint8_t *message"
 .Fa "size_t message_size"
@@ -45,7 +45,7 @@ Poly1305 is a low-level primitive.
 Consider using authenticated encryption, implemented by
 .Xr crypto_lock 3monocypher .
 .Ss Direct interface
-.Fn crypto_poly1305_auth
+.Fn crypto_poly1305
 produces a message authentication code for the given
 message and authentication key.
 The authentication key must be used only once.
@@ -84,7 +84,7 @@ To authenticate a message:
 const uint8_t msg[500];  /* Message to authenticate           */
 const uint8_t key[ 32];  /* Random secret key (use only once) */
 uint8_t       mac[ 16];  /* Message authentication code (MAC) */
-crypto_poly1305_auth(mac, msg, 500, key);
+crypto_poly1305(mac, msg, 500, key);
 crypto_wipe(key, 32);    /* The key should be wiped after use */
 .Ed
 .Pp
@@ -94,7 +94,7 @@ const uint8_t msg     [500];  /* Message to verify */
 const uint8_t key     [ 32];  /* The above key     */
 const uint8_t mac     [ 16];  /* The above MAC     */
 uint8_t       real_mac[ 16];  /* The actual MAC    */
-crypto_poly1305_auth(real_mac, msg, 500, key);
+crypto_poly1305(real_mac, msg, 500, key);
 crypto_wipe(key, 32);         /* Wipe right away   */
 if (crypto_verify16(mac, real_mac)) {
     /* The message is corrupted */
index d516dbde77c1b5a8d05eb55b996c5401b86bab5f..861ea256ef1228e468791b3fe574cc5db77edccc 120000 (symlink)
@@ -1 +1 @@
-crypto_poly1305_auth.3monocypher
\ No newline at end of file
+crypto_poly1305.3monocypher
\ No newline at end of file
index d516dbde77c1b5a8d05eb55b996c5401b86bab5f..861ea256ef1228e468791b3fe574cc5db77edccc 120000 (symlink)
@@ -1 +1 @@
-crypto_poly1305_auth.3monocypher
\ No newline at end of file
+crypto_poly1305.3monocypher
\ No newline at end of file
index d516dbde77c1b5a8d05eb55b996c5401b86bab5f..861ea256ef1228e468791b3fe574cc5db77edccc 120000 (symlink)
@@ -1 +1 @@
-crypto_poly1305_auth.3monocypher
\ No newline at end of file
+crypto_poly1305.3monocypher
\ No newline at end of file
index afb41ded7b88ed61fc85208cdc570cefc8d30206..0e01de8dac8fe00ac76503362a044f44e2c32fcb 100644 (file)
@@ -87,7 +87,7 @@ the chances of leaks.
 .Xr crypto_lock_final 3monocypher ,
 .Xr crypto_lock_init 3monocypher ,
 .Xr crypto_lock_update 3monocypher ,
-.Xr crypto_poly1305_auth 3monocypher ,
+.Xr crypto_poly1305 3monocypher ,
 .Xr crypto_poly1305_final 3monocypher ,
 .Xr crypto_poly1305_init 3monocypher ,
 .Xr crypto_poly1305_update 3monocypher ,
index 5b263ddfe7f3915ab251df8297cbb67f76e3d7f3..9f4b258e132539f81e66f1a32656fd9cbaf99640 100644 (file)
@@ -426,8 +426,8 @@ void crypto_poly1305_final(crypto_poly1305_ctx *ctx, u8 mac[16])
     crypto_wipe(ctx, sizeof(*ctx));
 }
 
-void crypto_poly1305_auth(u8     mac[16],  const u8 *message,
-                          size_t message_size, const u8  key[32])
+void crypto_poly1305(u8     mac[16],  const u8 *message,
+                     size_t message_size, const u8  key[32])
 {
     crypto_poly1305_ctx ctx;
     crypto_poly1305_init  (&ctx, key);
index de439bfa37bb19c0f537ac7dd9b6705d2eced6b8..713d225b92ba6790f60d68cbe036c63cd58a2028 100644 (file)
@@ -69,9 +69,12 @@ void crypto_poly1305_update(crypto_poly1305_ctx *ctx,
 
 void crypto_poly1305_final(crypto_poly1305_ctx *ctx, uint8_t mac[16]);
 
-void crypto_poly1305_auth(uint8_t        mac[16],
-                          const uint8_t *message, size_t message_size,
-                          const uint8_t  key[32]);
+void crypto_poly1305(uint8_t        mac[16],
+                     const uint8_t *message, size_t message_size,
+                     const uint8_t  key[32]);
+
+// Deprecated name
+#define crypto_poly1305_auth crypto_poly1305
 
 ////////////////
 /// Blake2 b ///
index 64fac0fe1dca873e2efcf14665dcab01ec101261..a03818a5246167aad0d63e1f3927edeff1d6ce70 100644 (file)
@@ -89,7 +89,7 @@ static u64 poly1305(void)
     static u8  out  [  16];
 
     TIMING_START {
-        crypto_poly1305_auth(out, in, SIZE, key);
+        crypto_poly1305(out, in, SIZE, key);
     }
     TIMING_END;
 }
index de988368fdce48d9a535e995d00a961229acbd58..ecaaad7fd211b060aa68caabd916d1d9981ee023 100644 (file)
@@ -111,7 +111,7 @@ static void poly1305(const vector in[], vector *out)
 {
     const vector *key = in;
     const vector *msg = in + 1;
-    crypto_poly1305_auth(out->buf, msg->buf, msg->size, key->buf);
+    crypto_poly1305(out->buf, msg->buf, msg->size, key->buf);
 }
 
 static void blake2b(const vector in[], vector *out)
@@ -348,7 +348,7 @@ static int p_poly1305()
         crypto_poly1305_final(&ctx, mac_chunk);
 
         // Authenticate all at once
-        crypto_poly1305_auth(mac_whole, input, offset, key);
+        crypto_poly1305(mac_whole, input, offset, key);
 
         // Compare the results (must be the same)
         status |= memcmp(mac_chunk, mac_whole, 16);
@@ -367,8 +367,8 @@ static int p_poly1305_overlap()
         u8 input[INPUT_SIZE];  p_random(input, INPUT_SIZE);
         u8 key  [32];          p_random(key  , 32);
         u8 mac  [16];
-        crypto_poly1305_auth(mac    , input + 16, POLY1305_BLOCK_SIZE, key);
-        crypto_poly1305_auth(input+i, input + 16, POLY1305_BLOCK_SIZE, key);
+        crypto_poly1305(mac    , input + 16, POLY1305_BLOCK_SIZE, key);
+        crypto_poly1305(input+i, input + 16, POLY1305_BLOCK_SIZE, key);
         status |= memcmp(mac, input + i, 16);
     }
     printf("%s: Poly1305 (overlaping i/o)\n", status != 0 ? "FAILED" : "OK");