]> git.codecow.com Git - Monocypher.git/commitdiff
renamed chacha20_Xinit into chacha20_x_init
authorLoup Vaillant <loup@loup-vaillant.fr>
Sun, 16 Jul 2017 12:56:47 +0000 (14:56 +0200)
committerLoup Vaillant <loup@loup-vaillant.fr>
Sun, 16 Jul 2017 12:56:47 +0000 (14:56 +0200)
MANUAL.md
src/monocypher.c
src/monocypher.h
tests/sodium.c
tests/vectors.c

index 9b8bb879fb348b9c593bed4ebea0d8c88bf11992..9acf34f2120805e1840eb0baab2054ee848b0a18 100644 (file)
--- a/MANUAL.md
+++ b/MANUAL.md
@@ -575,11 +575,11 @@ all an initial nonce of 0, 1 .. n-1 respectively, and have them
 increment their nonce by n.  (Also make sure the counters never wrap
 around.)
 
-### void crypto\_chacha20\_Xinit()
+### void crypto\_chacha20\_x_init()
 
-    void crypto_chacha20_Xinit(crypto_chacha_ctx *ctx,
-                               const uint8_t      key[32],
-                               const uint8_t      nonce[24]);
+    void crypto_chacha20_x_init(crypto_chacha_ctx *ctx,
+                                const uint8_t      key[32],
+                                const uint8_t      nonce[24]);
 
 Initialises a chacha context with a big nonce (192 bits).  This nonce
 is big enough to be selected at random (use the OS; avoid user space
index 602ef5d40cc2a75a8c6b609da280081b126bce68..1c9da4a1193d4a8639bc12e753f6654f90fa5b2d 100644 (file)
@@ -161,9 +161,9 @@ void crypto_chacha20_init(crypto_chacha_ctx *ctx,
     ctx->input[15] = load32_le(nonce + 4); // nonce
 }
 
-void crypto_chacha20_Xinit(crypto_chacha_ctx *ctx,
-                           const u8           key[32],
-                           const u8           nonce[24])
+void crypto_chacha20_x_init(crypto_chacha_ctx *ctx,
+                            const u8           key[32],
+                             const u8           nonce[24])
 {
     u8 derived_key[32];
     crypto_chacha20_H(derived_key, key, nonce);
@@ -1420,7 +1420,7 @@ void crypto_aead_lock(u8        mac[16],
 {   // encrypt then mac
     u8 auth_key[32];
     crypto_chacha_ctx e_ctx;
-    crypto_chacha20_Xinit  (&e_ctx, key, nonce);
+    crypto_chacha20_x_init (&e_ctx, key, nonce);
     crypto_chacha20_stream (&e_ctx, auth_key, 32);
     crypto_chacha20_encrypt(&e_ctx, ciphertext, plaintext, text_size);
     authenticate2(mac, auth_key, ad, ad_size, ciphertext, text_size);
@@ -1435,7 +1435,7 @@ int crypto_aead_unlock(u8       *plaintext,
 {
     u8 auth_key[32], real_mac[16];
     crypto_chacha_ctx e_ctx;
-    crypto_chacha20_Xinit (&e_ctx, key, nonce);
+    crypto_chacha20_x_init(&e_ctx, key, nonce);
     crypto_chacha20_stream(&e_ctx, auth_key, 32);
     authenticate2(real_mac, auth_key, ad, ad_size, ciphertext, text_size);
     if (crypto_memcmp(real_mac, mac, 16)) { return -1; } // reject forgeries
index 3aeb40e96adb0df7bd1f1bc0d0dd8ebcdd866279..1aa513c65c2a74ec7346fcb6b12d74d48f425aaf 100644 (file)
@@ -29,9 +29,9 @@ void crypto_chacha20_init(crypto_chacha_ctx *ctx,
                           const uint8_t      key[32],
                           const uint8_t      nonce[8]);
 
-void crypto_chacha20_Xinit(crypto_chacha_ctx *ctx,
-                           const uint8_t      key[32],
-                           const uint8_t      nonce[24]);
+void crypto_chacha20_x_init(crypto_chacha_ctx *ctx,
+                            const uint8_t      key[32],
+                            const uint8_t      nonce[24]);
 
 void crypto_chacha20_encrypt(crypto_chacha_ctx *ctx,
                              uint8_t           *cipher_text,
index f8d0e96f9624a57e95001f90fb0d8a52288e62ce..d2819fac8b43c4f4c7264c90168e91c27ad16eb0 100644 (file)
@@ -50,7 +50,7 @@ static int xchacha20(void)
         p_random(nonce, 24);
         p_random(in, size);
         rename_chacha_ctx ctx;
-        rename_chacha20_Xinit(&ctx, key, nonce);
+        rename_chacha20_x_init(&ctx, key, nonce);
         rename_chacha20_encrypt(&ctx, mono, in, size);
         crypto_stream_xchacha20_xor(sodium, in, size, nonce, key);
         status |= rename_memcmp(mono, sodium, size);
index 33f563af631ea2cf3f1c8f06492b238e2d300e0e..fbd1925207646b7522ec943dcb4e6bb3f66029eb 100644 (file)
@@ -108,7 +108,7 @@ sv x_chacha20(const vector in[], vector *out)
     const vector *key   = in;
     const vector *nonce = in + 1;
     crypto_chacha_ctx ctx;
-    crypto_chacha20_Xinit (&ctx, key->buf, nonce->buf);
+    crypto_chacha20_x_init(&ctx, key->buf, nonce->buf);
     crypto_chacha20_stream(&ctx, out->buf, out->size);
 }