public inbox for gost@lists.cypherpunks.ru
Atom feed
* Баг в функции wrap_cryptopro?
@ 2022-02-02 13:27 Евгений
  2022-02-02 16:56 ` Sergey Matveev
  0 siblings, 1 reply; 2+ messages in thread
From: Евгений @ 2022-02-02 13:27 UTC (permalink / raw)
  To: gost


[-- Attachment #1.1: Type: text/plain, Size: 136 bytes --]

Думаю забыли параметр sbox в diversify в wrap_cryptopro, т.к. в функции
unwrap_cryptopro он есть

[-- Attachment #1.2: Type: text/html, Size: 160 bytes --]

[-- Attachment #2: wrap_cryptopro.patch --]
[-- Type: text/x-patch, Size: 472 bytes --]

diff --git a/pygost/wrap.py b/pygost/wrap.py
index 9deeff5..cbb8bcf 100644
--- a/pygost/wrap.py
+++ b/pygost/wrap.py
@@ -79,7 +79,7 @@ def wrap_cryptopro(ukm, kek, cek, sbox=DEFAULT_SBOX):
     :returns: wrapped key
     :rtype: bytes, 44 bytes
     """
-    return wrap_gost(ukm, diversify(kek, bytearray(ukm)), cek, sbox=sbox)
+    return wrap_gost(ukm, diversify(kek, bytearray(ukm), sbox=sbox), cek, sbox=sbox)
 
 
 def unwrap_cryptopro(kek, data, sbox=DEFAULT_SBOX):

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: Баг в функции wrap_cryptopro?
  2022-02-02 13:27 Баг в функции wrap_cryptopro? Евгений
@ 2022-02-02 16:56 ` Sergey Matveev
  0 siblings, 0 replies; 2+ messages in thread
From: Sergey Matveev @ 2022-02-02 16:56 UTC (permalink / raw)
  To: gost

[-- Attachment #1: Type: text/plain, Size: 516 bytes --]

Приветствую!

*** Евгений [2022-02-02 16:27]:
>Думаю забыли параметр sbox в diversify в wrap_cryptopro, т.к. в функции
>unwrap_cryptopro он есть

Да, действительно потерялся. Исправил, обновил тесты. Всё это вошло в
версию 5.9 PyGOST пакета. Спасибо большое!

-- 
Sergey Matveev (http://www.stargrave.org/)
OpenPGP: CF60 E89A 5923 1E76 E263  6422 AE1A 8109 E498 57EF

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-02-02 16:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-02 13:27 Баг в функции wrap_cryptopro? Евгений
2022-02-02 16:56 ` Sergey Matveev