Open-source aspects of GOST Cryptography
 help / color / mirror / Atom feed
From: Vitaly Chikunov <vt@altlinux.org>
To: oss-gost-crypto@lists.altlinux.org
Subject: Re: [oss-gost-crypto] ГОСТ 34.10 и  CryptoAPI (FYI progress update 2)
Date: Sun, 6 Jan 2019 19:10:56 +0300
Message-ID: <20190106161056.icemlafjfq6jzhln@sole.flsd.net> (raw)
In-Reply-To: <20181227061852.4hdhmdfbrckvi5fn@sole.flsd.net>

Hi,

On Thu, Dec 27, 2018 at 09:18:52AM +0300, Vitaly Chikunov wrote:
> i) Добавил такие оптимизации: 1) пофиксил разложенеи по модулю для
> кривых "B" (стали значительно быстрее, хоть и не на 100% так же как для
> А); 2) замена в умножении (mul_64_64) четырех умножений u64 на одну
> операцию с unsigned __int128; 3) сделал отдельную версию умножения
> маленького числа на очень большое для использования в разложении по
> модулю для специальных простых чисел (которые в кривых "A" и "B", но не
> в "C"); 4) финальная операция проверки подписи сделана через Shamir's
> trick, что сэкономило одно уможение скаляра на точку. Последние три
> оптимизации каждая дают ускорение примерно в полтора-два раза. Так что
> получился следующий бенчмарк:
> 
>   gost2012_256-A  925.73734979911 (verify/s)
>   gost2012_256-B  743.48889599333
>   gost2012_512-A  199.76707159452
>   gost2012_512-B  172.92092844704
> 
> Думаю, на этом пока остановиться, так как стало более менее приемлемо.
> Если кто-то захочет оптимизировать дальше, то welcome. Для сравнения
> скорость gost-engine на этом же железе:
> 
>   gost2012_256 A: sign: 865.5/s, verify: 1085.6/s
>   gost2012_256 B: sign: 891.5/s, verify: 1105.7/s
>   gost2012_256 C: sign: 907.4/s, verify: 1096.2/s
>   gost2012_512 A: sign: 231.0/s, verify: 324.2/s
>   gost2012_512 B: sign: 223.9/s, verify: 336.9/s.
> 
> ii) Кривая gost2012_256-C благодаря Shamir's trick стала вычисляться,
> так как пропал X=0. Но все равно она осталась очень медленной из-за
> того, что разложение по модулю для нее не оптимизировано. Всё таки я
> хочу отложить её до лучших времен. И так в ядре всего две NIST кривые, а
> ГОСТовых уже может быть четыре (а всего стандартизовано семь).

1. Таки я сделал Barrett's reduction для кривой C, скорость

  gost2012_256-C  662.769581527289 (verify/s)

что меня устраивает.

2. Послал RFC с GOST 34.10:

  https://patchwork.kernel.org/project/linux-crypto/list/?series=62661



      parent reply	other threads:[~2019-01-06 16:10 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-27  6:18 Vitaly Chikunov
2018-12-28  6:05 ` Vitaly Chikunov
2019-01-06 16:10 ` Vitaly Chikunov [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190106161056.icemlafjfq6jzhln@sole.flsd.net \
    --to=vt@altlinux.org \
    --cc=oss-gost-crypto@lists.altlinux.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Open-source aspects of GOST Cryptography

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://lore.altlinux.org/oss-gost-crypto/0 oss-gost-crypto/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 oss-gost-crypto oss-gost-crypto/ http://lore.altlinux.org/oss-gost-crypto \
		oss-gost-crypto@lists.altlinux.org oss-gost-crypto@lists.altlinux.ru oss-gost-crypto@lists.altlinux.com
	public-inbox-index oss-gost-crypto

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://lore.altlinux.org/org.altlinux.lists.oss-gost-crypto


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git