Skip to content

Commit

Permalink
Remove trailing whitespace.
Browse files Browse the repository at this point in the history
  • Loading branch information
besser82 authored and adegtyarev committed Nov 5, 2018
1 parent 0b399d0 commit 1874ab5
Show file tree
Hide file tree
Showing 21 changed files with 87 additions and 87 deletions.
30 changes: 15 additions & 15 deletions Changelog
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ Changes with version 0.11 22 Feb 2013

* Bugfix: variables, structures, functions changed their names from
*GOST3411* to fully-qualified *GOST34112012*

* Bugfix: API: GOST34112012Init() now operates on allocated memory.
Previously, memory allocation for context has been done with
GOST34112012Init() call - this guarantee proper alignment for context's
members. As for now, alignment is done with ALIGN keyword in object
declaration and GOST34112012Init() does not allocate any byte of memory.

* Bugfix: API: GOST34112012Final() now returns digest in memory pointed by
second argument. Context member "hexdigest" not used anymore thus
abandoned. It is up to calling application to present digest in
Expand All @@ -39,18 +39,18 @@ Changes with version 0.10 29 Jan 2013
substitution by Pi[] while generating multiplication lookup table.
Lookup table arranged in a such way totally eliminates the need to do
whole S-cycle in LPS.

* Feature: use SSE4.1 instructions set in LPS if available.

* Feature: multiplication lookup table is now statically precomputed in
header file and is in constant memory.

* Bugfix: rewrite GOST3411Update() function to implement streaming mode
when processing large amount of data.

* Bugfix: rename round2() and round3() to stage2() and stage3()
respectively.

* Bugfix: in auto configuration probes: delete temporary files.

Changes with version 0.09 22 Jan 2013
Expand All @@ -60,10 +60,10 @@ Changes with version 0.09 22 Jan 2013
quadruples. This avoid copying of temporary key and internal state
between rounds in g(), thus reduce instructions count per plaintext
block.

* Feature: with code optimization above, performance on 32-bit systems
greatly improved and is now about as fast as with 64-bit systems.

* Feature: detect MMX and SSE2 capabilities on compile time and use faster
code when possible. From this version onward there are at least two
versions of implementation: portable (not using any extensions like MMX
Expand All @@ -76,7 +76,7 @@ Changes with version 0.09 22 Jan 2013

* Bugfix: integer overflow incorrectly handled in addition by modulo 2.
This could lead to incorrect results on some files.

Changes with version 0.08 19 Jan 2013

* Feature: boost performance on 32-bit systems by using 64-bit MMX XOR
Expand All @@ -94,31 +94,31 @@ Changes with version 0.07 17 Jan 2013

* Bugfix: key generation function K replaced with XLPS macros to avoid
inlining issues when max inline instruction limit reached.

* Bugfix: encryption function E inlined to compression g to avoid
compile-time inlining issues when max inline instruction limit reached.

* Bugfix: use unsigned integers where possible.

* Bugfix: fix typo in update() when comparing bufsize.

* Bugfix: memory allocator rewritten to use posix_memalign().

Changes with version 0.06 09 Jan 2013

* Feature: performance optimization in LPS: hint compiler to use eight
registers instead of union buffer.

* Feature: performance optimization in permutation P: rotate matrix by
cyclic right shifting bits in source matrix columns to rows in
destination matrix.

* Feature: as result of previous two optimizations: replace LPS macros
with improved macros XLPS.

* Bugfix: improve constant table C presentation to avoid runtime
conversion in key generator K.

* Bugfix: unroll key generation loop in E.

* Bugfix: rename union member names according to their natural meaning.
Expand Down
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2013, Alexey Degtyarev <[email protected]>.
# Copyright (c) 2013, Alexey Degtyarev <[email protected]>.
# All rights reserved.
#
# $Id$
Expand Down Expand Up @@ -69,7 +69,7 @@ clean: rmconfig

dist: clean man
mkdir -p $(DISTNAME)
cp $(SOURCES) $(HEADERS) $(DISTNAME)
cp $(SOURCES) $(HEADERS) $(DISTNAME)
cp Changelog LICENSE Makefile VERSION README.md configure $(DISTNAME)
cp gost3411-2012.1 gost3411-2012.1.h2m $(DISTNAME)
cp -R auto examples $(DISTNAME)/
Expand All @@ -78,14 +78,14 @@ dist: clean man
tar czf $(DISTNAME).tar.gz $(DISTNAME)
rm -r $(DISTNAME)

distclean:
distclean:
-rm $(DISTNAME).tar.gz 2>/dev/null

test: gost3411-2012
./gost3411-2012 -t
./gost3411-2012 -t | cmp auto/test.txt

bench:
bench:
$(MAKE) remake CC=clang && ./gost3411-2012 -b
$(MAKE) remake CC=gcc46 && ./gost3411-2012 -b
$(MAKE) remake CC=gcc47 && ./gost3411-2012 -b
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ void GOST34112012Update(GOST34112012Context *CTX, const unsigned char *data, siz

Hash some `data` of `len` bytes size. The best performance results are
achieved when `len` is multiple of 64.

Note that this call does not modify original data in memory. If
security is an issue, calling application should destroy that memory
block right after `GOST34112012Update()`, by e.g. `memset()` to zero.
Expand Down
2 changes: 1 addition & 1 deletion auto/header/endianness
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/sh
#
# Copyright (c) 2013, Alexey Degtyarev <[email protected]>.
# Copyright (c) 2013, Alexey Degtyarev <[email protected]>.
# All rights reserved.
#
# Detect running system endianness.
Expand Down
2 changes: 1 addition & 1 deletion auto/header/mmx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/sh
#
# Copyright (c) 2013, Alexey Degtyarev <[email protected]>.
# Copyright (c) 2013, Alexey Degtyarev <[email protected]>.
# All rights reserved.
#
# Detect MMX capability in processor and compiler.
Expand Down
2 changes: 1 addition & 1 deletion auto/header/sse2
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/sh
#
# Copyright (c) 2013, Alexey Degtyarev <[email protected]>.
# Copyright (c) 2013, Alexey Degtyarev <[email protected]>.
# All rights reserved.
#
# Detect SSE2 capability in processor and compiler.
Expand Down
2 changes: 1 addition & 1 deletion auto/header/sse41
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/sh
#
# Copyright (c) 2013, Alexey Degtyarev <[email protected]>.
# Copyright (c) 2013, Alexey Degtyarev <[email protected]>.
# All rights reserved.
#
# Detect SSE4.1 capability in processor and compiler.
Expand Down
2 changes: 1 addition & 1 deletion auto/header/supercop
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/sh
#
# Copyright (c) 2013, Alexey Degtyarev <[email protected]>.
# Copyright (c) 2013, Alexey Degtyarev <[email protected]>.
# All rights reserved.
#
# Activate SUPERCOP stuff when SUPERCOP environment variable is set.
Expand Down
2 changes: 1 addition & 1 deletion auto/mk/mmx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/sh
#
# Copyright (c) 2013, Alexey Degtyarev <[email protected]>.
# Copyright (c) 2013, Alexey Degtyarev <[email protected]>.
# All rights reserved.
#
# Detect MMX capability in processor and compiler.
Expand Down
2 changes: 1 addition & 1 deletion auto/mk/sse2
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/sh
#
# Copyright (c) 2013, Alexey Degtyarev <[email protected]>.
# Copyright (c) 2013, Alexey Degtyarev <[email protected]>.
# All rights reserved.
#
# Detect SSE2 capability in processor and compiler.
Expand Down
2 changes: 1 addition & 1 deletion auto/mk/sse41
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/sh
#
# Copyright (c) 2013, Alexey Degtyarev <[email protected]>.
# Copyright (c) 2013, Alexey Degtyarev <[email protected]>.
# All rights reserved.
#
# Detect SSE4.1 capability in processor and compiler.
Expand Down
2 changes: 1 addition & 1 deletion configure
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ EOF

cat ${AUTO_CONF_MK}.t >> ${AUTO_CONF_MK} && rm -f ${AUTO_CONF_MK}.t

cat >>${AUTO_CONF_MK} <<"EOF"
cat >>${AUTO_CONF_MK} <<"EOF"
compile:
$(CC) $(CFLAGS) -o gost3411-2012 $(SOURCES)
Expand Down
78 changes: 39 additions & 39 deletions gost3411-2012-const.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2013, Alexey Degtyarev <[email protected]>.
* Copyright (c) 2013, Alexey Degtyarev <[email protected]>.
* All rights reserved.
*
* Iteration constants defined in standard.
Expand Down Expand Up @@ -267,47 +267,47 @@ GOST3411_ALIGN(16) static const gost34112012_uint512_u C[12] = {
#endif

static const unsigned char Tau[64] = {
0, 8, 16, 24, 32, 40, 48, 56,
1, 9, 17, 25, 33, 41, 49, 57,
2, 10, 18, 26, 34, 42, 50, 58,
3, 11, 19, 27, 35, 43, 51, 59,
4, 12, 20, 28, 36, 44, 52, 60,
5, 13, 21, 29, 37, 45, 53, 61,
6, 14, 22, 30, 38, 46, 54, 62,
0, 8, 16, 24, 32, 40, 48, 56,
1, 9, 17, 25, 33, 41, 49, 57,
2, 10, 18, 26, 34, 42, 50, 58,
3, 11, 19, 27, 35, 43, 51, 59,
4, 12, 20, 28, 36, 44, 52, 60,
5, 13, 21, 29, 37, 45, 53, 61,
6, 14, 22, 30, 38, 46, 54, 62,
7, 15, 23, 31, 39, 47, 55, 63
};

static const unsigned char Pi[256] = {
252, 238, 221, 17, 207, 110, 49, 22,
251, 196, 250, 218, 35, 197, 4, 77,
233, 119, 240, 219, 147, 46, 153, 186,
23, 54, 241, 187, 20, 205, 95, 193,
249, 24, 101, 90, 226, 92, 239, 33,
129, 28, 60, 66, 139, 1, 142, 79,
5, 132, 2, 174, 227, 106, 143, 160,
6, 11, 237, 152, 127, 212, 211, 31,
235, 52, 44, 81, 234, 200, 72, 171,
242, 42, 104, 162, 253, 58, 206, 204,
181, 112, 14, 86, 8, 12, 118, 18,
191, 114, 19, 71, 156, 183, 93, 135,
21, 161, 150, 41, 16, 123, 154, 199,
243, 145, 120, 111, 157, 158, 178, 177,
50, 117, 25, 61, 255, 53, 138, 126,
109, 84, 198, 128, 195, 189, 13, 87,
223, 245, 36, 169, 62, 168, 67, 201,
215, 121, 214, 246, 124, 34, 185, 3,
224, 15, 236, 222, 122, 148, 176, 188,
220, 232, 40, 80, 78, 51, 10, 74,
167, 151, 96, 115, 30, 0, 98, 68,
26, 184, 56, 130, 100, 159, 38, 65,
173, 69, 70, 146, 39, 94, 85, 47,
140, 163, 165, 125, 105, 213, 149, 59,
7, 88, 179, 64, 134, 172, 29, 247,
48, 55, 107, 228, 136, 217, 231, 137,
225, 27, 131, 73, 76, 63, 248, 254,
141, 83, 170, 144, 202, 216, 133, 97,
32, 113, 103, 164, 45, 43, 9, 91,
203, 155, 37, 208, 190, 229, 108, 82,
89, 166, 116, 210, 230, 244, 180, 192,
252, 238, 221, 17, 207, 110, 49, 22,
251, 196, 250, 218, 35, 197, 4, 77,
233, 119, 240, 219, 147, 46, 153, 186,
23, 54, 241, 187, 20, 205, 95, 193,
249, 24, 101, 90, 226, 92, 239, 33,
129, 28, 60, 66, 139, 1, 142, 79,
5, 132, 2, 174, 227, 106, 143, 160,
6, 11, 237, 152, 127, 212, 211, 31,
235, 52, 44, 81, 234, 200, 72, 171,
242, 42, 104, 162, 253, 58, 206, 204,
181, 112, 14, 86, 8, 12, 118, 18,
191, 114, 19, 71, 156, 183, 93, 135,
21, 161, 150, 41, 16, 123, 154, 199,
243, 145, 120, 111, 157, 158, 178, 177,
50, 117, 25, 61, 255, 53, 138, 126,
109, 84, 198, 128, 195, 189, 13, 87,
223, 245, 36, 169, 62, 168, 67, 201,
215, 121, 214, 246, 124, 34, 185, 3,
224, 15, 236, 222, 122, 148, 176, 188,
220, 232, 40, 80, 78, 51, 10, 74,
167, 151, 96, 115, 30, 0, 98, 68,
26, 184, 56, 130, 100, 159, 38, 65,
173, 69, 70, 146, 39, 94, 85, 47,
140, 163, 165, 125, 105, 213, 149, 59,
7, 88, 179, 64, 134, 172, 29, 247,
48, 55, 107, 228, 136, 217, 231, 137,
225, 27, 131, 73, 76, 63, 248, 254,
141, 83, 170, 144, 202, 216, 133, 97,
32, 113, 103, 164, 45, 43, 9, 91,
203, 155, 37, 208, 190, 229, 108, 82,
89, 166, 116, 210, 230, 244, 180, 192,
209, 102, 175, 194, 57, 75, 99, 182
};
4 changes: 2 additions & 2 deletions gost3411-2012-core.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2013, Alexey Degtyarev <[email protected]>.
* Copyright (c) 2013, Alexey Degtyarev <[email protected]>.
* All rights reserved.
*
* GOST R 34.11-2012 core and API functions.
Expand Down Expand Up @@ -189,7 +189,7 @@ GOST34112012Update(GOST34112012Context *CTX, const unsigned char *data, size_t l
CTX->bufsize += chunksize;
len -= chunksize;
data += chunksize;

if (CTX->bufsize == 64)
{
stage2(CTX, CTX->buffer);
Expand Down
8 changes: 4 additions & 4 deletions gost3411-2012-core.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2013, Alexey Degtyarev <[email protected]>.
* Copyright (c) 2013, Alexey Degtyarev <[email protected]>.
* All rights reserved.
*
* $Id$
Expand All @@ -19,7 +19,7 @@
#include "gost3411-2012-sse41.h"
#elif defined __GOST3411_HAS_SSE2__
#include "gost3411-2012-sse2.h"
#elif defined __GOST3411_HAS_MMX__
#elif defined __GOST3411_HAS_MMX__
#include "gost3411-2012-mmx.h"
#else
#include "gost3411-2012-ref.h"
Expand Down Expand Up @@ -48,8 +48,8 @@ void GOST34112012Init(GOST34112012Context *CTX,
const unsigned int digest_size);

void GOST34112012Update(GOST34112012Context *CTX, const unsigned char *data,
size_t len);
size_t len);

void GOST34112012Final(GOST34112012Context *CTX, unsigned char *digest);
void GOST34112012Final(GOST34112012Context *CTX, unsigned char *digest);

void GOST34112012Cleanup(GOST34112012Context *CTX);
2 changes: 1 addition & 1 deletion gost3411-2012-mmx.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2013, Alexey Degtyarev <[email protected]>.
* Copyright (c) 2013, Alexey Degtyarev <[email protected]>.
* All rights reserved.
*
* $Id$
Expand Down
8 changes: 4 additions & 4 deletions gost3411-2012-precalc.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2013, Alexey Degtyarev <[email protected]>.
* Copyright (c) 2013, Alexey Degtyarev <[email protected]>.
* All rights reserved.
*
* Precalculation of matrix A multiplication.
Expand All @@ -8,7 +8,7 @@
*/

#ifndef __GOST3411_BIG_ENDIAN__
GOST3411_ALIGN(16) static const unsigned long long Ax[8][256] =
GOST3411_ALIGN(16) static const unsigned long long Ax[8][256] =
{
{
0xd01f715b5c7ef8e6ULL, 0x16fa240980778325ULL, 0xa8a42e857ee049c8ULL,
Expand Down Expand Up @@ -716,7 +716,7 @@ GOST3411_ALIGN(16) static const unsigned long long Ax[8][256] =
}
};
#else
GOST3411_ALIGN(16) static const unsigned long long Ax[8][256] =
GOST3411_ALIGN(16) static const unsigned long long Ax[8][256] =
{
{
0xe6f87e5c5b711fd0ULL, 0x258377800924fa16ULL, 0xc849e07e852ea4a8ULL,
Expand Down Expand Up @@ -1156,7 +1156,7 @@ GOST3411_ALIGN(16) static const unsigned long long Ax[8][256] =
0x45be423c2f5bb7c1ULL, 0xf71e55fefd88e55dULL, 0x6853032b59f3ee6eULL,
0x65b3e9c4ff073aaaULL, 0x772ac3399ae5ebecULL, 0x87816e97f842a75bULL,
0x110e2db2e0484a4bULL, 0x331277cb3dd8deddULL, 0xbd510cac79eb9fa5ULL,
0x352179552a91f5c7ULL
0x352179552a91f5c7ULL
},
{
0x8ab0a96846e06a6dULL, 0x43c7e80b4bf0b33aULL, 0x08c9b3546b161ee5ULL,
Expand Down
2 changes: 1 addition & 1 deletion gost3411-2012-ref.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2013, Alexey Degtyarev <[email protected]>.
* Copyright (c) 2013, Alexey Degtyarev <[email protected]>.
* All rights reserved.
*
* Portable and simple (thus sometimes slow) implementation of core functions.
Expand Down
Loading

0 comments on commit 1874ab5

Please sign in to comment.