[PATCH 1/3] Add Stribog OIDs from TC26 space

Dmitry Eremin-Solenikov dbaryshkov at gmail.com
Fri Nov 25 13:52:45 CET 2016


* cipher/stribog.c (oid_spec_stribog256, oid_spec_stribog512): New.

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov at gmail.com>
---
 cipher/stribog.c | 22 ++++++++++++++++++++--
 1 file changed, 20 insertions(+), 2 deletions(-)

diff --git a/cipher/stribog.c b/cipher/stribog.c
index 7f38e6f..7b6e330 100644
--- a/cipher/stribog.c
+++ b/cipher/stribog.c
@@ -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)
-- 
2.10.2




More information about the Gcrypt-devel mailing list