cipher: Add Stribog OIDs from TC26 space.
authorDmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Fri, 25 Nov 2016 12:52:45 +0000 (15:52 +0300)
committerNIIBE Yutaka <gniibe@fsij.org>
Mon, 28 Nov 2016 00:39:56 +0000 (09:39 +0900)
* cipher/stribog.c (oid_spec_stribog256, oid_spec_stribog512): New.

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
cipher/stribog.c

index 7f38e6f..7b6e330 100644 (file)
@@ -1321,10 +1321,28 @@ stribog_read_256 (void *context)
   return hd->result + 32;
 }
 
+static gcry_md_oid_spec_t oid_spec_stribog256[] =
+  {
+    /* id-tc26-signwithdigest-gost3410-12-256 */
+    { "1.2.643.7.1.1.3.2" },
+    /* id-tc26-gost3411-12-256 */
+    { "1.2.643.7.1.1.2.2" },
+    { NULL },
+  };
+
+static gcry_md_oid_spec_t oid_spec_stribog512[] =
+  {
+    /* id-tc26-signwithdigest-gost3410-12-512 */
+    { "1.2.643.7.1.1.3.3" },
+    /* id-tc26-gost3411-12-512 */
+    { "1.2.643.7.1.1.2.3" },
+    { NULL },
+  };
+
 gcry_md_spec_t _gcry_digest_spec_stribog_256 =
   {
     GCRY_MD_STRIBOG256, {0, 0},
-    "STRIBOG256", NULL, 0, NULL, 32,
+    "STRIBOG256", NULL, 0, oid_spec_stribog256, 32,
     stribog_init_256, _gcry_md_block_write, stribog_final, stribog_read_256,
     NULL,
     sizeof (STRIBOG_CONTEXT)
@@ -1333,7 +1351,7 @@ gcry_md_spec_t _gcry_digest_spec_stribog_256 =
 gcry_md_spec_t _gcry_digest_spec_stribog_512 =
   {
     GCRY_MD_STRIBOG512, {0, 0},
-    "STRIBOG512", NULL, 0, NULL, 64,
+    "STRIBOG512", NULL, 0, oid_spec_stribog512, 64,
     stribog_init_512, _gcry_md_block_write, stribog_final, stribog_read_512,
     NULL,
     sizeof (STRIBOG_CONTEXT)