Skip to content

Commit 1ff6f39

Browse files
committed
Add proper declaration for Kalyna tables; and split from definitions
1 parent 1d0c6dd commit 1ff6f39

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

kalynatab.cpp

+5-4
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,11 @@
77
NAMESPACE_BEGIN(CryptoPP)
88
NAMESPACE_BEGIN(KalynaTab)
99

10-
CRYPTOPP_TABLE
10+
extern const word64 T[8][256]; // Columns
11+
extern const word64 IT[8][256]; // Inverse
12+
extern const byte S[4][256]; // Substitution
13+
extern const byte IS[4][256]; // Inverse
14+
1115
const word64 T[8][256] =
1216
{
1317
{
@@ -540,7 +544,6 @@ const word64 T[8][256] =
540544
}
541545
};
542546

543-
CRYPTOPP_TABLE
544547
const word64 IT[8][256] =
545548
{
546549
{
@@ -1073,7 +1076,6 @@ const word64 IT[8][256] =
10731076
}
10741077
};
10751078

1076-
CRYPTOPP_TABLE
10771079
const byte S[4][256] =
10781080
{
10791081
{
@@ -1150,7 +1152,6 @@ const byte S[4][256] =
11501152
}
11511153
};
11521154

1153-
CRYPTOPP_TABLE
11541155
const byte IS[4][256] =
11551156
{
11561157
{

sha.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -73,11 +73,11 @@ extern void SHA256_HashMultipleBlocks_POWER8(word32 *state, const word32 *data,
7373
extern void SHA512_HashMultipleBlocks_POWER8(word64 *state, const word64 *data, size_t length, ByteOrder order);
7474
#endif
7575

76+
// We add extern to export table to sha-simd.cpp, but it
77+
// cleared http://github.com/weidai11/cryptopp/issues/502
7678
extern const word32 SHA256_K[64];
7779
extern const word64 SHA512_K[80];
7880

79-
// We add extern to export table to sha-simd.cpp, but it
80-
// cleared http://github.com/weidai11/cryptopp/issues/502
8181
CRYPTOPP_ALIGN_DATA(16)
8282
const word64 SHA512_K[80] = {
8383
W64LIT(0x428a2f98d728ae22), W64LIT(0x7137449123ef65cd),

0 commit comments

Comments
 (0)