[PATCH] Stribog endianness fixup

Dmitry Eremin-Solenikov dbaryshkov at gmail.com
Tue Jun 17 13:11:46 CEST 2014


Please ignore this particular patch, it was sent by the coincidence.

The rest of the patches still are proposed to be applied.

On Fri, Jun 6, 2014 at 10:48 PM, Dmitry Eremin-Solenikov
<dbaryshkov at gmail.com> wrote:
> Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov at gmail.com>
> ---
>  cipher/gost28147.c    | 130 ++++++++++++++++++++++++++++++++++++++++++++++++++
>  cipher/mac-internal.h |   9 ++++
>  cipher/mac.c          |   3 ++
>  cipher/stribog.c      |  10 ++--
>  src/gcrypt.h.in       |   1 +
>  tests/basic.c         |   7 +++
>  6 files changed, 155 insertions(+), 5 deletions(-)
>
> diff --git a/cipher/stribog.c b/cipher/stribog.c
> index 1456fee..fa16cfe 100644
> --- a/cipher/stribog.c
> +++ b/cipher/stribog.c
> @@ -1242,12 +1242,12 @@ transform_bits (STRIBOG_CONTEXT *hd, const unsigned char *data, unsigned count)
>          }
>      }
>
> -  hd->Sigma[0] += M[0];
> -  for (i = 1; i < 8; i++)
> -    if (hd->Sigma[i-1] < M[i-1])
> -      hd->Sigma[i] += M[i] + 1;
> +  hd->Sigma[7] += M[7];
> +  for (i = 7; i >= 1; i--)
> +    if (hd->Sigma[i] < M[i])
> +      hd->Sigma[i-1] += M[i-1] + 1;
>      else
> -      hd->Sigma[i] += M[i];
> +      hd->Sigma[i-1] += M[i-1];
>  }
>
>  static unsigned int



-- 
With best wishes
Dmitry



More information about the Gcrypt-devel mailing list