cryptonote tweak v2.2
This commit is contained in:
parent
bb30a72367
commit
f3cd51a12b
|
@ -198,6 +198,22 @@ extern int aesb_pseudo_round(const uint8_t *in, uint8_t *out, const uint8_t *exp
|
||||||
} while (0)
|
} while (0)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#define VARIANT2_2_PORTABLE() \
|
||||||
|
if (variant >= 2) { \
|
||||||
|
xor_blocks(long_state + (j ^ 0x10), d); \
|
||||||
|
xor_blocks(d, long_state + (j ^ 0x20)); \
|
||||||
|
}
|
||||||
|
|
||||||
|
#define VARIANT2_2() \
|
||||||
|
do if (variant >= 2) \
|
||||||
|
{ \
|
||||||
|
*U64(hp_state + (j ^ 0x10)) ^= hi; \
|
||||||
|
*(U64(hp_state + (j ^ 0x10)) + 1) ^= lo; \
|
||||||
|
hi ^= *U64(hp_state + (j ^ 0x20)); \
|
||||||
|
lo ^= *(U64(hp_state + (j ^ 0x20)) + 1); \
|
||||||
|
} while (0)
|
||||||
|
|
||||||
|
|
||||||
#if !defined NO_AES && (defined(__x86_64__) || (defined(_MSC_VER) && defined(_WIN64)))
|
#if !defined NO_AES && (defined(__x86_64__) || (defined(_MSC_VER) && defined(_WIN64)))
|
||||||
// Optimised code below, uses x86-specific intrinsics, SSE2, AES-NI
|
// Optimised code below, uses x86-specific intrinsics, SSE2, AES-NI
|
||||||
// Fall back to more portable code is down at the bottom
|
// Fall back to more portable code is down at the bottom
|
||||||
|
@ -282,6 +298,7 @@ extern int aesb_pseudo_round(const uint8_t *in, uint8_t *out, const uint8_t *exp
|
||||||
b[0] = p[0]; b[1] = p[1]; \
|
b[0] = p[0]; b[1] = p[1]; \
|
||||||
VARIANT2_INTEGER_MATH_SSE2(b, c); \
|
VARIANT2_INTEGER_MATH_SSE2(b, c); \
|
||||||
__mul(); \
|
__mul(); \
|
||||||
|
VARIANT2_2(); \
|
||||||
VARIANT2_SHUFFLE_ADD_SSE2(hp_state, j); \
|
VARIANT2_SHUFFLE_ADD_SSE2(hp_state, j); \
|
||||||
a[0] += hi; a[1] += lo; \
|
a[0] += hi; a[1] += lo; \
|
||||||
p = U64(&hp_state[j]); \
|
p = U64(&hp_state[j]); \
|
||||||
|
@ -884,6 +901,7 @@ union cn_slow_hash_state
|
||||||
b[0] = p[0]; b[1] = p[1]; \
|
b[0] = p[0]; b[1] = p[1]; \
|
||||||
VARIANT2_PORTABLE_INTEGER_MATH(b, c); \
|
VARIANT2_PORTABLE_INTEGER_MATH(b, c); \
|
||||||
__mul(); \
|
__mul(); \
|
||||||
|
VARIANT2_2(); \
|
||||||
VARIANT2_SHUFFLE_ADD_NEON(hp_state, j); \
|
VARIANT2_SHUFFLE_ADD_NEON(hp_state, j); \
|
||||||
a[0] += hi; a[1] += lo; \
|
a[0] += hi; a[1] += lo; \
|
||||||
p = U64(&hp_state[j]); \
|
p = U64(&hp_state[j]); \
|
||||||
|
@ -1305,6 +1323,7 @@ void cn_slow_hash(const void *data, size_t length, char *hash, int variant, int
|
||||||
|
|
||||||
VARIANT2_PORTABLE_INTEGER_MATH(c, c1);
|
VARIANT2_PORTABLE_INTEGER_MATH(c, c1);
|
||||||
mul(c1, c, d);
|
mul(c1, c, d);
|
||||||
|
VARIANT2_2_PORTABLE();
|
||||||
VARIANT2_PORTABLE_SHUFFLE_ADD(long_state, j);
|
VARIANT2_PORTABLE_SHUFFLE_ADD(long_state, j);
|
||||||
sum_half_blocks(a, d);
|
sum_half_blocks(a, d);
|
||||||
swap_blocks(a, c);
|
swap_blocks(a, c);
|
||||||
|
@ -1486,6 +1505,7 @@ void cn_slow_hash(const void *data, size_t length, char *hash, int variant, int
|
||||||
copy_block(c2, &long_state[j]);
|
copy_block(c2, &long_state[j]);
|
||||||
VARIANT2_PORTABLE_INTEGER_MATH(c2, c1);
|
VARIANT2_PORTABLE_INTEGER_MATH(c2, c1);
|
||||||
mul(c1, c2, d);
|
mul(c1, c2, d);
|
||||||
|
VARIANT2_2_PORTABLE();
|
||||||
VARIANT2_PORTABLE_SHUFFLE_ADD(long_state, j);
|
VARIANT2_PORTABLE_SHUFFLE_ADD(long_state, j);
|
||||||
swap_blocks(a, c1);
|
swap_blocks(a, c1);
|
||||||
sum_half_blocks(c1, d);
|
sum_half_blocks(c1, d);
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
4cf1ff9ca46eb433b36cd9f70e02b14cc06bfd18ca77fa9ccaafd1fd96c674b0 5468697320697320612074657374205468697320697320612074657374205468697320697320612074657374
|
353fdc068fd47b03c04b9431e005e00b68c2168a3cc7335c8b9b308156591a4f 5468697320697320612074657374205468697320697320612074657374205468697320697320612074657374
|
||||||
7d292e43f4751714ec07dbcb0e4bbffe2a7afb6066420960684ff57d7474c871 4c6f72656d20697073756d20646f6c6f722073697420616d65742c20636f6e73656374657475722061646970697363696e67
|
72f134fc50880c330fe65a2cb7896d59b2e708a0221c6a9da3f69b3a702d8682 4c6f72656d20697073756d20646f6c6f722073697420616d65742c20636f6e73656374657475722061646970697363696e67
|
||||||
335563425256edebf1d92dc342369c2f4770ebb4112ba975659bd8a0f210abd0 656c69742c2073656420646f20656975736d6f642074656d706f7220696e6369646964756e74207574206c61626f7265
|
410919660ec540fc49d8695ff01f974226a2a28dbbac82949c12f541b9a62d2f 656c69742c2073656420646f20656975736d6f642074656d706f7220696e6369646964756e74207574206c61626f7265
|
||||||
47758e86d2f57210366cec36fff26f9464d89efd116fe6ef28b718b5da120801 657420646f6c6f7265206d61676e6120616c697175612e20557420656e696d206164206d696e696d2076656e69616d2c
|
4472fecfeb371e8b7942ce0378c0ba5e6d0c6361b669c587807365c787ae652d 657420646f6c6f7265206d61676e6120616c697175612e20557420656e696d206164206d696e696d2076656e69616d2c
|
||||||
48787b48d5c68f0c1dd825c32580af741cc0ee314f08133135c1e86d87a24a95 71756973206e6f737472756420657865726369746174696f6e20756c6c616d636f206c61626f726973206e697369
|
577568395203f1f1225f2982b637f7d5e61b47a0f546ba16d46020b471b74076 71756973206e6f737472756420657865726369746174696f6e20756c6c616d636f206c61626f726973206e697369
|
||||||
93bdf47495854f7cfaaca1af8c0f39ef4a3024c10eb0dea23726b0e06ef29e84 757420616c697175697020657820656120636f6d6d6f646f20636f6e7365717561742e20447569732061757465
|
f6fd7efe95a5c6c4bb46d9b429e3faf65b1ce439e116742d42b928e61de52385 757420616c697175697020657820656120636f6d6d6f646f20636f6e7365717561742e20447569732061757465
|
||||||
a375a71d0541057ccc96719150dfe10b6e6f486b19cf4a0835e19605413a8417 697275726520646f6c6f7220696e20726570726568656e646572697420696e20766f6c7570746174652076656c6974
|
422f8cfe8060cf6c3d9fd66f68e3c9977adb683aea2788029308bbe9bc50d728 697275726520646f6c6f7220696e20726570726568656e646572697420696e20766f6c7570746174652076656c6974
|
||||||
163478a76f8f1432533fbdd1284d65c89f37479e54f20841c6ce4eba56c73854 657373652063696c6c756d20646f6c6f726520657520667567696174206e756c6c612070617269617475722e
|
512e62c8c8c833cfbd9d361442cb00d63c0a3fd8964cfd2fedc17c7c25ec2d4b 657373652063696c6c756d20646f6c6f726520657520667567696174206e756c6c612070617269617475722e
|
||||||
356b0470c6eea75cad7a108179e232905b23bdaf03c2824c6e619d503ee93677 4578636570746575722073696e74206f6363616563617420637570696461746174206e6f6e2070726f6964656e742c
|
12a794c1aa13d561c9c6111cee631ca9d0a321718d67d3416add9de1693ba41e 4578636570746575722073696e74206f6363616563617420637570696461746174206e6f6e2070726f6964656e742c
|
||||||
a47e2b007dc25bb279e197a1b91f67ecebe2ddd8791cd32dd2cb76dd21ed943f 73756e7420696e2063756c706120717569206f666669636961206465736572756e74206d6f6c6c697420616e696d20696420657374206c61626f72756d2e
|
2659ff95fc74b6215c1dc741e85b7a9710101b30620212f80eb59c3c55993f9d 73756e7420696e2063756c706120717569206f666669636961206465736572756e74206d6f6c6c697420616e696d20696420657374206c61626f72756d2e
|
||||||
|
|
Loading…
Reference in New Issue