]> wagner.pp.ru Git - openssl-gost/engine.git/blobdiff - gost_crypt.c
elbrus: Workaround `-Werror=assign-where-compare-meant'
[openssl-gost/engine.git] / gost_crypt.c
index 930d40adc76941aedef3479efb841c44d7e55801..7e733df7e581168ef2fd57cc9d78a0d2f333b509 100644 (file)
@@ -302,7 +302,7 @@ EVP_MD *imit_gost_cpa(void)
             || !EVP_MD_meth_set_input_blocksize(md, 8)
             || !EVP_MD_meth_set_app_datasize(md,
                                              sizeof(struct ossl_gost_imit_ctx))
-            || !EVP_MD_meth_set_flags(md, 0)
+            || !EVP_MD_meth_set_flags(md, EVP_MD_FLAG_XOF)
             || !EVP_MD_meth_set_init(md, gost_imit_init_cpa)
             || !EVP_MD_meth_set_update(md, gost_imit_update)
             || !EVP_MD_meth_set_final(md, gost_imit_final)
@@ -333,7 +333,7 @@ EVP_MD *imit_gost_cp_12(void)
             || !EVP_MD_meth_set_input_blocksize(md, 8)
             || !EVP_MD_meth_set_app_datasize(md,
                                              sizeof(struct ossl_gost_imit_ctx))
-            || !EVP_MD_meth_set_flags(md, 0)
+            || !EVP_MD_meth_set_flags(md, EVP_MD_FLAG_XOF)
             || !EVP_MD_meth_set_init(md, gost_imit_init_cp_12)
             || !EVP_MD_meth_set_update(md, gost_imit_update)
             || !EVP_MD_meth_set_final(md, gost_imit_final)
@@ -1071,15 +1071,14 @@ static int gost_imit_init_cp_12(EVP_MD_CTX *ctx)
 static void mac_block_mesh(struct ossl_gost_imit_ctx *c,
                            const unsigned char *data)
 {
-    unsigned char buffer[8];
     /*
-     * We are using local buffer for iv because CryptoPro doesn't interpret
+     * We are using NULL for iv because CryptoPro doesn't interpret
      * internal state of MAC algorithm as iv during keymeshing (but does
      * initialize internal state from iv in key transport
      */
     assert(c->count % 8 == 0 && c->count <= 1024);
     if (c->key_meshing && c->count == 1024) {
-        cryptopro_key_meshing(&(c->cctx), buffer);
+        cryptopro_key_meshing(&(c->cctx), NULL);
     }
     mac_block(&(c->cctx), c->buffer, data);
     c->count = c->count % 1024 + 8;
@@ -1180,7 +1179,7 @@ int gost_imit_ctrl(EVP_MD_CTX *ctx, int type, int arg, void *ptr)
             GOSTerr(GOST_F_GOST_IMIT_CTRL, GOST_R_INVALID_MAC_KEY_SIZE);
             return 0;
         }
-    case EVP_MD_CTRL_MAC_LEN:
+    case EVP_MD_CTRL_XOF_LEN:
         {
             struct ossl_gost_imit_ctx *c = EVP_MD_CTX_md_data(ctx);
             if (arg < 1 || arg > 8) {