-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
21 changed files
with
87 additions
and
87 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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$ | ||
|
@@ -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)/ | ||
|
@@ -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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. | ||
|
@@ -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 | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. | ||
|
@@ -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); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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$ | ||
|
@@ -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" | ||
|
@@ -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); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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$ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. | ||
|
@@ -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, | ||
|
@@ -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, | ||
|
@@ -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, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. | ||
|
Oops, something went wrong.