[PATCH] Add support for Salsa20/12 - 12 round version of Salsa20

Dmitry Eremin-Solenikov dbaryshkov at gmail.com
Sun Jul 21 16:53:22 CEST 2013


* src/gcrypt.h.in (GCRY_CIPHER_SALSA20R12): New.
* src/salsa20.c (salsa20_core, salsa20_do_encrypt_stream): Add support
for reduced round versions.
  (salsa20r12_encrypt_stream, _gcry_cipher_spec_salsa20r12): Implement
Salsa20/12 - a 12 round version of Salsa20 selected by eStream.
* src/cipher.h: Declsare Salsa20/12 definition.
* cipher/cipher.c: Register Salsa20/12
* tests/basic.c: (check_stream_cipher, check_stream_cipher_large_block):
Populate Salsa20/12 tests with test vectors from ecrypt
(check_ciphers): Add simple test for Salsa20/12
--

Salsa20/12 is a reduced round version of Salsa20 that is amongst ciphers
selected by eSTREAM for Phase 3 of Profile 1 algorithm. Moreover it is
one of proposed ciphers for TLS (draft-josefsson-salsa20-tls-02).

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov at gmail.com>
---
 NEWS             |    3 +-
 cipher/cipher.c  |    2 +
 cipher/salsa20.c |   49 ++++++++++--
 doc/gcrypt.texi  |    4 +
 src/cipher.h     |    1 +
 src/gcrypt.h.in  |    3 +-
 tests/basic.c    |  218 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 7 files changed, 273 insertions(+), 7 deletions(-)

diff --git a/NEWS b/NEWS
index 508b943..3e47400 100644
--- a/NEWS
+++ b/NEWS
@@ -12,7 +12,7 @@ Noteworthy changes in version 1.6.0 (unreleased)
 
  * Added support for the IDEA cipher algorithm.
 
- * Added support for the Salsa20 stream cipher.
+ * Added support for the Salsa20 and reduced Salsa20/12 stream ciphers.
 
  * Added a random number generator to directly use the system's RNG.
    Also added an interface to prefer the use of a specified RNG.
@@ -74,6 +74,7 @@ Noteworthy changes in version 1.6.0 (unreleased)
  GCRYCTL_DISABLE_PRIV_DROP       NEW.
  GCRY_CIPHER_SALSA20             NEW.
  gcry_sexp_nth_buffer            NEW.
+ GCRY_CIPHER_SALSA20R12          NEW.
 
 
 Noteworthy changes in version 1.5.0 (2011-06-29)
diff --git a/cipher/cipher.c b/cipher/cipher.c
index 08d6165..7b320c4 100644
--- a/cipher/cipher.c
+++ b/cipher/cipher.c
@@ -107,6 +107,8 @@ static struct cipher_table_entry
 #if USE_SALSA20
     { &_gcry_cipher_spec_salsa20,
       &_gcry_cipher_extraspec_salsa20,    GCRY_CIPHER_SALSA20 },
+    { &_gcry_cipher_spec_salsa20r12,
+      &_gcry_cipher_extraspec_salsa20,    GCRY_CIPHER_SALSA20R12 },
 #endif
     { NULL                    }
   };
diff --git a/cipher/salsa20.c b/cipher/salsa20.c
index e26c328..2fd77e0 100644
--- a/cipher/salsa20.c
+++ b/cipher/salsa20.c
@@ -49,6 +49,7 @@
 /* Number of rounds.  The standard uses 20 rounds.  In any case the
    number of rounds must be even.  */
 #define SALSA20_ROUNDS       20
+#define SALSA20r12_ROUNDS    12
 
 
 typedef struct
@@ -120,13 +121,13 @@ static const char *selftest (void);
   } while(0)
 
 static void
-salsa20_core (u32 *dst, const u32 *src)
+salsa20_core (u32 *dst, const u32 *src, unsigned rounds)
 {
   u32 pad[SALSA20_INPUT_LENGTH];
   unsigned int i;
 
   memcpy (pad, src, sizeof(pad));
-  for (i = 0; i < SALSA20_ROUNDS; i += 2)
+  for (i = 0; i < rounds; i += 2)
     {
       SALSA20_CORE_DEBUG (i);
       QROUND (pad[0],  pad[4],  pad[8],  pad[12]);
@@ -253,7 +254,7 @@ salsa20_setiv (void *context, const byte *iv, unsigned int ivlen)
 static void
 salsa20_do_encrypt_stream (SALSA20_context_t *ctx,
                            byte *outbuf, const byte *inbuf,
-                           unsigned int length)
+                           unsigned int length, unsigned rounds)
 {
   if (ctx->unused)
     {
@@ -280,7 +281,7 @@ salsa20_do_encrypt_stream (SALSA20_context_t *ctx,
       /* Create the next pad and bump the block counter.  Note that it
          is the user's duty to change to another nonce not later than
          after 2^70 processed bytes.  */
-      salsa20_core (ctx->pad, ctx->input);
+      salsa20_core (ctx->pad, ctx->input, rounds);
       if (!++ctx->input[8])
         ctx->input[9]++;
 
@@ -306,7 +307,30 @@ salsa20_encrypt_stream (void *context,
 
   if (length)
     {
-      salsa20_do_encrypt_stream (ctx, outbuf, inbuf, length);
+      salsa20_do_encrypt_stream (ctx, outbuf, inbuf, length, SALSA20_ROUNDS);
+      _gcry_burn_stack (/* salsa20_do_encrypt_stream: */
+                        2*sizeof (void*)
+                        + 3*sizeof (void*) + sizeof (unsigned int)
+                        /* salsa20_core: */
+                        + 2*sizeof (void*)
+                        + 2*sizeof (void*)
+                        + 64
+                        + sizeof (unsigned int)
+                        + sizeof (u32)
+                        );
+    }
+}
+
+
+static void
+salsa20r12_encrypt_stream (void *context,
+                           byte *outbuf, const byte *inbuf, unsigned int length)
+{
+  SALSA20_context_t *ctx = (SALSA20_context_t *)context;
+
+  if (length)
+    {
+      salsa20_do_encrypt_stream (ctx, outbuf, inbuf, length, SALSA20r12_ROUNDS);
       _gcry_burn_stack (/* salsa20_do_encrypt_stream: */
                         2*sizeof (void*)
                         + 3*sizeof (void*) + sizeof (unsigned int)
@@ -372,6 +396,21 @@ gcry_cipher_spec_t _gcry_cipher_spec_salsa20 =
     salsa20_encrypt_stream
   };
 
+gcry_cipher_spec_t _gcry_cipher_spec_salsa20r12 =
+  {
+    "SALSA20/12",  /* name */
+    NULL,       /* aliases */
+    NULL,       /* oids */
+    1,          /* blocksize in bytes. */
+    SALSA20_MAX_KEY_SIZE*8,  /* standard key length in bits. */
+    sizeof (SALSA20_context_t),
+    salsa20_setkey,
+    NULL,
+    NULL,
+    salsa20r12_encrypt_stream,
+    salsa20r12_encrypt_stream
+  };
+
 cipher_extra_spec_t _gcry_cipher_extraspec_salsa20 =
   {
     NULL,
diff --git a/doc/gcrypt.texi b/doc/gcrypt.texi
index 770a245..b49dee3 100644
--- a/doc/gcrypt.texi
+++ b/doc/gcrypt.texi
@@ -1579,6 +1579,10 @@ The Camellia cipher by NTT.  See
 @cindex Salsa20
 This is the Salsa20 stream cipher.
 
+ at item GCRY_CIPHER_SALSA20R12
+ at cindex Salsa20/12
+This is the Salsa20/12 - reduced round version of Salsa20 stream cipher.
+
 @end table
 
 @node Available cipher modes
diff --git a/src/cipher.h b/src/cipher.h
index bb92758..710061a 100644
--- a/src/cipher.h
+++ b/src/cipher.h
@@ -196,6 +196,7 @@ extern gcry_cipher_spec_t _gcry_cipher_spec_camellia192;
 extern gcry_cipher_spec_t _gcry_cipher_spec_camellia256;
 extern gcry_cipher_spec_t _gcry_cipher_spec_idea;
 extern gcry_cipher_spec_t _gcry_cipher_spec_salsa20;
+extern gcry_cipher_spec_t _gcry_cipher_spec_salsa20r12;
 
 extern cipher_extra_spec_t _gcry_cipher_extraspec_tripledes;
 extern cipher_extra_spec_t _gcry_cipher_extraspec_aes;
diff --git a/src/gcrypt.h.in b/src/gcrypt.h.in
index 06d6663..ce7c154 100644
--- a/src/gcrypt.h.in
+++ b/src/gcrypt.h.in
@@ -820,7 +820,8 @@ enum gcry_cipher_algos
     GCRY_CIPHER_CAMELLIA128 = 310,
     GCRY_CIPHER_CAMELLIA192 = 311,
     GCRY_CIPHER_CAMELLIA256 = 312,
-    GCRY_CIPHER_SALSA20     = 313
+    GCRY_CIPHER_SALSA20     = 313,
+    GCRY_CIPHER_SALSA20R12  = 314
   };
 
 /* The Rijndael algorithm is basically AES, so provide some macros. */
diff --git a/tests/basic.c b/tests/basic.c
index 46e213c..4fbca43 100644
--- a/tests/basic.c
+++ b/tests/basic.c
@@ -1241,6 +1241,91 @@ check_stream_cipher (void)
           "\x2B\xB2\x55\x71\xE1\xAA\x85\x93\x75\x8F\xC3\x82\xB1\x28\x0B\x71"
         }
       }
+    },
+    {
+      "Salsa20/12 128 bit, test 1",
+      GCRY_CIPHER_SALSA20R12, 16, 8,
+      "\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00",
+      "\x00\x00\x00\x00\x00\x00\x00\x00",
+      {
+        { 8,
+          "\x00\x00\x00\x00\x00\x00\x00\x00",
+          "\xFC\x20\x7D\xBF\xC7\x6C\x5E\x17"
+        }
+      }
+    },
+    {
+      "Salsa20/12 128 bit, test 2",
+      GCRY_CIPHER_SALSA20R12, 16, 8,
+      "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00",
+      "\x80\x00\x00\x00\x00\x00\x00\x00",
+      {
+        { 8,
+          "\x00\x00\x00\x00\x00\x00\x00\x00",
+          "\x08\x28\x39\x9A\x6F\xEF\x20\xDA"
+        }
+      }
+    },
+    {
+      "Salsa20/12 128 bit, test 3",
+      GCRY_CIPHER_SALSA20R12, 16, 8,
+      "\x00\x53\xA6\xF9\x4C\x9F\xF2\x45\x98\xEB\x3E\x91\xE4\x37\x8A\xDD",
+      "\x0D\x74\xDB\x42\xA9\x10\x77\xDE",
+      {
+        { 8,
+          "\x00\x00\x00\x00\x00\x00\x00\x00",
+          "\xAD\x9E\x60\xE6\xD2\xA2\x64\xB8"
+        }
+      }
+    },
+    {
+      "Salsa20/12 256 bit, test 1",
+      GCRY_CIPHER_SALSA20R12, 32, 8,
+      "\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+      "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00",
+      "\x00\x00\x00\x00\x00\x00\x00\x00",
+      {
+        { 8,
+          "\x00\x00\x00\x00\x00\x00\x00\x00",
+          "\xAF\xE4\x11\xED\x1C\x4E\x07\xE4"
+        }
+      }
+    },
+    {
+      "Salsa20/12 256 bit, test 2",
+      GCRY_CIPHER_SALSA20R12, 32, 8,
+      "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+      "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00",
+      "\x80\x00\x00\x00\x00\x00\x00\x00",
+      {
+        { 8,
+          "\x00\x00\x00\x00\x00\x00\x00\x00",
+          "\x17\x2C\x51\x92\xCB\x6E\x64\x5B"
+        }
+      }
+    },
+    {
+      "Salsa20/12 256 bit, ecrypt verified, set 6, vector 0",
+      GCRY_CIPHER_SALSA20R12, 32, 8,
+      "\x00\x53\xA6\xF9\x4C\x9F\xF2\x45\x98\xEB\x3E\x91\xE4\x37\x8A\xDD"
+      "\x30\x83\xD6\x29\x7C\xCF\x22\x75\xC8\x1B\x6E\xC1\x14\x67\xBA\x0D",
+      "\x0D\x74\xDB\x42\xA9\x10\x77\xDE",
+      {
+        { 8,
+          "\x00\x00\x00\x00\x00\x00\x00\x00",
+          "\x52\xE2\x0C\xF8\x77\x5A\xE8\x82"
+        },
+        { 64,
+          "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+          "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+          "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+          "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00",
+          "\x52\xE2\x0C\xF8\x77\x5A\xE8\x82\xF2\x00\xC2\x99\x9F\xE4\xBA\x31"
+          "\xA7\xA1\x8F\x1D\x5C\x97\x16\x19\x1D\x12\x31\x75\xE1\x47\xBD\x4E"
+          "\x8C\xA6\xED\x16\x6C\xE0\xFC\x8E\x65\xA5\xCA\x60\x84\x20\xFC\x65"
+          "\x44\xC9\x70\x0A\x0F\x21\x38\xE8\xC1\xA2\x86\xFB\x8C\x1F\xBF\xA0"
+        }
+      }
     }
 #endif /*USE_SALSA20*/
   };
@@ -1543,6 +1628,138 @@ check_stream_cipher_large_block (void)
           "\xEB\x31\x4E\xD4\x70\xB1\xAF\x6B\x9F\x8D\x69\xDD\x79\xA9\xD7\x50"
         }
       }
+    },
+    {
+      "Salsa20/12 256 bit, ecrypt verified, set 6, vector 0",
+      GCRY_CIPHER_SALSA20R12, 32, 8,
+      "\x00\x53\xA6\xF9\x4C\x9F\xF2\x45\x98\xEB\x3E\x91\xE4\x37\x8A\xDD"
+      "\x30\x83\xD6\x29\x7C\xCF\x22\x75\xC8\x1B\x6E\xC1\x14\x67\xBA\x0D",
+      "\x0D\x74\xDB\x42\xA9\x10\x77\xDE",
+      {
+        { 0, 64,
+          "\x52\xE2\x0C\xF8\x77\x5A\xE8\x82\xF2\x00\xC2\x99\x9F\xE4\xBA\x31"
+          "\xA7\xA1\x8F\x1D\x5C\x97\x16\x19\x1D\x12\x31\x75\xE1\x47\xBD\x4E"
+          "\x8C\xA6\xED\x16\x6C\xE0\xFC\x8E\x65\xA5\xCA\x60\x84\x20\xFC\x65"
+          "\x44\xC9\x70\x0A\x0F\x21\x38\xE8\xC1\xA2\x86\xFB\x8C\x1F\xBF\xA0"
+        },
+        { 65472, 64,
+          "\x8F\xBC\x9F\xE8\x69\x1B\xD4\xF0\x82\xB4\x7F\x54\x05\xED\xFB\xC1"
+          "\x6F\x4D\x5A\x12\xDD\xCB\x2D\x75\x4E\x8A\x99\x98\xD0\xB2\x19\x55"
+          "\x7D\xFE\x29\x84\xF4\xA1\xD2\xDD\xA7\x6B\x95\x96\x92\x8C\xCE\x05"
+          "\x56\xF5\x00\x66\xCD\x59\x9E\x44\xEF\x5C\x14\xB2\x26\x68\x3A\xEF"
+        },
+        { 65536, 64,
+          "\xBC\xBD\x01\xDD\x28\x96\x1C\xC7\xAD\x30\x47\x38\x6C\xBC\xC6\x7C"
+          "\x10\x8D\x6A\xF1\x11\x67\xE4\x0D\x7A\xE1\xB2\xFC\x45\x18\xA8\x67"
+          "\xEF\xE4\x02\x65\x1D\x1D\x88\x51\xC4\xFD\x23\x30\xC5\x97\xB3\x6A"
+          "\x46\xD5\x68\x9E\x00\xFC\x96\xFE\xCF\x9C\xE3\xE2\x21\x1D\x44\xBE"
+        },
+        { 131008, 64,
+          "\x91\x66\xF3\x1C\xD8\x5B\x5B\xB1\x8F\xC6\x14\xE5\x4E\x4A\xD6\x7F"
+          "\xB8\x65\x8E\x3B\xF9\xFB\x19\xB7\xA8\x2F\x0F\xE7\xDC\x90\x2D\xF5"
+          "\x63\xC6\xAC\x4F\x44\x67\x48\xC4\xBC\x3E\x14\x05\xE1\x24\x82\x0D"
+          "\xC4\x09\x41\x99\x8F\x44\xA8\x10\xE7\x22\x78\x7F\xCD\x47\x78\x4C"
+        }
+      }
+    },
+    {
+      "Salsa20/12 256 bit, ecrypt verified, set 6, vector 1",
+      GCRY_CIPHER_SALSA20R12, 32, 8,
+      "\x05\x58\xAB\xFE\x51\xA4\xF7\x4A\x9D\xF0\x43\x96\xE9\x3C\x8F\xE2"
+      "\x35\x88\xDB\x2E\x81\xD4\x27\x7A\xCD\x20\x73\xC6\x19\x6C\xBF\x12",
+      "\x16\x7D\xE4\x4B\xB2\x19\x80\xE7",
+      {
+        { 0, 64,
+          "\xC0\x75\x60\xB3\xE7\x76\xB4\x71\xC5\xE2\x93\x14\x26\xCA\xF1\xED"
+          "\x3A\xE4\xB8\x67\x08\x76\x82\xCA\x9D\xFD\xC2\xBA\xE8\x93\x50\xBD"
+          "\x84\x82\x1C\xAE\xFF\x85\xAA\xC4\x9D\x74\x35\xA7\xD9\x88\x93\x52"
+          "\xF5\x27\x9E\x36\x12\x3F\x41\x72\x8A\x14\xEF\x26\x9F\xCB\x94\x4B"
+        },
+        { 65472, 64,
+          "\xEE\xD1\xBB\x58\xF9\x0C\x89\xE0\x5C\xC6\x8B\x2D\xB6\x05\x58\x49"
+          "\xB3\xD2\xB1\x87\xB7\xF0\x2F\x9A\x24\xCE\x34\x2A\xF0\xFC\x47\xA3"
+          "\x74\xBD\x75\x90\xFB\xF4\xFD\x9E\xE5\x9B\x1A\x38\x1E\xBF\xD2\x29"
+          "\xAD\x2A\x29\x01\xB3\xFB\x61\x08\x12\x90\x0B\x92\x30\xE6\x22\xE9"
+        },
+        { 65536, 64,
+          "\x70\xF0\x49\x3A\x1B\x62\x53\xCC\x5E\xD3\x45\x0A\x31\xCF\x37\x7D"
+          "\x83\x4B\xAD\x20\x72\x30\x29\x27\xCC\xD8\x30\x10\x4B\xD3\x05\xFF"
+          "\x59\xD2\x94\x17\xB2\x32\x88\x4E\xC9\x59\x19\x4D\x60\x47\xC3\xDD"
+          "\x66\x56\xC4\x7E\x32\x00\x64\xEB\x01\x44\xF7\x34\x1B\xC3\xD6\x97"
+        },
+        { 131008, 64,
+          "\xD2\xCC\xF7\xC1\xAF\x2A\xB4\x66\xE6\x27\xDB\x44\x08\x40\x96\x9A"
+          "\xBD\xAB\x68\xD8\x86\xAE\x6A\x38\xA1\x3F\xEE\x17\x50\xCA\x97\xB5"
+          "\xD3\x31\x5B\x84\x08\x47\x28\x86\x2F\xBC\xC7\xD4\xA9\x7C\x75\xC8"
+          "\x65\x5F\xF9\xD6\xBB\xC2\x61\x88\x63\x6F\x3E\xDF\xE1\x5C\x7D\x30"
+        }
+      }
+    },
+    {
+      "Salsa20/12 256 bit, ecrypt verified, set 6, vector 2",
+      GCRY_CIPHER_SALSA20R12, 32, 8,
+      "\x0A\x5D\xB0\x03\x56\xA9\xFC\x4F\xA2\xF5\x48\x9B\xEE\x41\x94\xE7"
+      "\x3A\x8D\xE0\x33\x86\xD9\x2C\x7F\xD2\x25\x78\xCB\x1E\x71\xC4\x17",
+      "\x1F\x86\xED\x54\xBB\x22\x89\xF0",
+      {
+        { 0, 64,
+          "\x51\x22\x52\x91\x01\x90\xD1\x54\xD1\x4D\x0B\x92\x32\xB8\x84\x31"
+          "\x8C\xCB\x43\x81\x9B\xD5\x42\x19\x32\xC0\x3A\x13\xF0\x7B\x40\x10"
+          "\x83\xD7\x89\x72\x5A\xA9\xDA\x0B\x41\xCB\x62\x24\x94\x5E\xDC\xB0"
+          "\xFB\x6F\xD7\xC2\x34\x22\x35\xC9\x70\xF6\x4E\x10\x1C\x25\x68\x64"
+        },
+        { 65472, 64,
+          "\x97\x96\x74\x55\x84\x0A\x4A\xE5\xC1\xCA\xCE\x49\x15\x19\x13\x8A"
+          "\xA3\x5E\x5F\x02\x40\x7D\x4A\x1F\xE5\x08\x6D\x35\xF3\x55\x1E\xF4"
+          "\x77\xD9\x28\x9D\x17\x23\x79\x7C\x1A\x49\xEC\x26\x62\x9A\xFA\xDC"
+          "\x56\xA0\x38\xA3\x8C\x75\x88\x1B\x62\x17\xFD\x74\x67\x25\x59\x09"
+        },
+        { 65536, 64,
+          "\x1B\xF8\x2E\x3D\x5C\x54\xDA\xAB\xCF\x84\x15\xF8\xA2\xA1\xA2\x2E"
+          "\x86\x88\x06\x33\x4F\xF3\x11\x36\x04\x74\x1C\x1D\xF2\xB9\x84\x0F"
+          "\x87\xDE\xEF\xB0\x07\x23\xA8\xA1\xB2\x4A\x4D\xA1\x7E\xCD\xAD\x00"
+          "\x01\xF9\x79\xDD\xAE\x2D\xF0\xC5\xE1\xE5\x32\xC4\x8F\x8E\x0D\x34"
+        },
+        { 131008, 64,
+          "\x06\xD8\x4F\x6A\x71\x34\x84\x20\x32\x9F\xCD\x0C\x41\x75\x9A\xD1"
+          "\x8F\x99\x57\xA3\x8F\x22\x89\x3B\xA5\x58\xC5\x05\x11\x97\x28\x5C"
+          "\x6B\xE2\xFD\x6C\x96\xA5\xC6\x62\xAF\xD3\x11\x78\xE7\x0F\x96\x0A"
+          "\xAB\x3F\x47\x96\x23\xA4\x44\xB6\x81\x91\xE4\xC5\x28\x46\x93\x88"
+        }
+      }
+    },
+    {
+      "Salsa20/12 256 bit, ecrypt verified, set 6, vector 3",
+      GCRY_CIPHER_SALSA20R12, 32, 8,
+      "\x0F\x62\xB5\x08\x5B\xAE\x01\x54\xA7\xFA\x4D\xA0\xF3\x46\x99\xEC"
+      "\x3F\x92\xE5\x38\x8B\xDE\x31\x84\xD7\x2A\x7D\xD0\x23\x76\xC9\x1C",
+      "\x28\x8F\xF6\x5D\xC4\x2B\x92\xF9",
+      {
+        { 0, 64,
+          "\x99\xDB\x33\xAD\x11\xCE\x0C\xCB\x3B\xFD\xBF\x8D\x0C\x18\x16\x04"
+          "\x52\xD0\x14\xCD\xE9\x89\xB4\xC4\x11\xA5\x59\xFF\x7C\x20\xA1\x69"
+          "\xE6\xDC\x99\x09\xD8\x16\xBE\xCE\xDC\x40\x63\xCE\x07\xCE\xA8\x28"
+          "\xF4\x4B\xF9\xB6\xC9\xA0\xA0\xB2\x00\xE1\xB5\x2A\xF4\x18\x59\xC5"
+        },
+        { 65472, 64,
+          "\x2F\xF2\x02\x64\xEE\xAF\x47\xAB\x7D\x57\xC3\x62\x24\x53\x54\x51"
+          "\x73\x5A\xC8\x36\xD3\x2D\xD2\x8A\xE6\x36\x45\xCE\x95\x2F\x7F\xDB"
+          "\xE6\x68\x9C\x69\x59\x77\xB1\xC7\x6E\x60\xDD\x5B\x27\xAC\xA4\x76"
+          "\xD2\x62\x0F\xDC\x93\x13\xE8\x48\x9B\xA5\x6A\x70\xC9\xF4\xC3\xA8"
+        },
+        { 65536, 64,
+          "\xEB\x30\xCD\xA7\x27\xC0\xF8\xB7\xE4\x5D\x5E\xF3\x0D\xB7\xCB\xE0"
+          "\x21\xF2\x29\x1E\x5F\x56\x93\x8D\x56\xF6\x87\xB7\x37\xC3\xB4\x27"
+          "\x54\x5C\x56\xA6\xD3\xA0\xBF\x2B\x2F\x47\xB4\x84\x93\xFA\xE4\x5E"
+          "\xD5\x0C\x2E\x9B\xBE\x49\xFD\x92\xD6\x7C\x76\x49\x05\x5F\x06\xFD"
+        },
+        { 131008, 64,
+          "\x0E\xBF\x6C\xC3\xCB\xCB\xE7\x4E\x6E\xE8\x07\x47\x1B\x49\x2A\x67"
+          "\x39\xA5\x2F\x57\x11\x31\xA2\x50\xBC\xDF\xA0\x76\xA2\x65\x90\xD7"
+          "\xED\xE6\x75\x1C\x03\x26\xA0\x2C\xB1\x1C\x58\x77\x35\x52\x80\x4F"
+          "\xD8\x68\x67\x15\x35\x5C\x5A\x5C\xC5\x91\x96\x3A\x75\xE9\x94\xB4"
+        }
+      }
     }
 #endif /*USE_SALSA20*/
   };
@@ -2170,6 +2387,7 @@ check_ciphers (void)
 #endif
 #if USE_SALSA20
     GCRY_CIPHER_SALSA20,
+    GCRY_CIPHER_SALSA20R12,
 #endif
     0
   };
-- 
1.7.10.4




More information about the Gcrypt-devel mailing list