linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Vitaly Chikunov <vt@altlinux.org>
To: Herbert Xu <herbert@gondor.apana.org.au>,
	"David S. Miller" <davem@davemloft.net>,
	linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: Gleb Fotengauer-Malinovskiy <glebfm@altlinux.org>,
	"Anton V. Boyarshinov" <boyarsh@altlinux.org>
Subject: Re: [PATCH 1/2] crypto: streebog - add Streebog hash function
Date: Tue, 9 Oct 2018 09:57:19 +0300	[thread overview]
Message-ID: <20181009065719.5cb2lk7fdulfcyvp@sole.flsd.net> (raw)
In-Reply-To: <20181007094114.16777-2-vt@altlinux.org>

On Sun, Oct 07, 2018 at 12:41:10PM +0300, Vitaly Chikunov wrote:
> Add GOST/IETF Streebog hash function (GOST R 34.11-2012, RFC 6986)
> generic hash transformation.
> 
> Signed-off-by: Vitaly Chikunov <vt@altlinux.org>
> ---
>  crypto/Kconfig            |   12 +
>  crypto/Makefile           |    1 +
>  crypto/streebog_generic.c | 1142 +++++++++++++++++++++++++++++++++++++++++++++
>  include/crypto/streebog.h |   34 ++
>  4 files changed, 1189 insertions(+)
>  create mode 100644 crypto/streebog_generic.c
>  create mode 100644 include/crypto/streebog.h
> 
> diff --git a/crypto/streebog_generic.c b/crypto/streebog_generic.c
> --- /dev/null
> +++ b/crypto/streebog_generic.c
> @@ -0,0 +1,1142 @@
>> ...
> +static inline void add512(const struct streebog_uint512 *x,
> +			  const struct streebog_uint512 *y,
> +			  struct streebog_uint512 *r)
> +{
> +	u64 carry = 0;
> +	int i;
> +
> +	for (i = 0; i < 8; i++) {
> +		const u64 left = le64_to_cpu(x->qword[i]);
> +		u64 sum;
> +
> +		sum = left + le64_to_cpu(y->qword[i]) + carry;
> +		if (sum != left)
> +			carry = (sum < left);
> +		r->qword[i] = sum;

Last assignment should be: r->qword[i] = cpu_to_le64(sum).


  reply	other threads:[~2018-10-09  6:57 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-07  9:41 [PATCH 0/2] crypto: streebog - add Streebog hash function Vitaly Chikunov
2018-10-07  9:41 ` [PATCH 1/2] " Vitaly Chikunov
2018-10-09  6:57   ` Vitaly Chikunov [this message]
2018-10-07  9:41 ` [PATCH 2/2] crypto: streebog - add Streebog test vectors Vitaly Chikunov

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=20181009065719.5cb2lk7fdulfcyvp@sole.flsd.net \
    --to=vt@altlinux.org \
    --cc=boyarsh@altlinux.org \
    --cc=davem@davemloft.net \
    --cc=glebfm@altlinux.org \
    --cc=herbert@gondor.apana.org.au \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).