aboutsummaryrefslogtreecommitdiff
path: root/tests/unit_tests
diff options
context:
space:
mode:
authorSarang Noether <32460187+SarangNoether@users.noreply.github.com>2019-08-27 16:22:44 -0400
committerSarang Noether <32460187+SarangNoether@users.noreply.github.com>2019-08-27 16:22:44 -0400
commit3a0451a8be43154f0da06dd9c693ed6f0c657042 (patch)
tree298545ee6661a331d615de049359e74e5a9e5ca2 /tests/unit_tests
parentMerge pull request #5641 (diff)
downloadmonero-3a0451a8be43154f0da06dd9c693ed6f0c657042.tar.xz
MLSAG speedup and additional checks
Diffstat (limited to 'tests/unit_tests')
-rw-r--r--tests/unit_tests/ringct.cpp15
1 files changed, 14 insertions, 1 deletions
diff --git a/tests/unit_tests/ringct.cpp b/tests/unit_tests/ringct.cpp
index 4d51ec434..8788dba8d 100644
--- a/tests/unit_tests/ringct.cpp
+++ b/tests/unit_tests/ringct.cpp
@@ -788,7 +788,20 @@ TEST(ringct, HPow2)
{
key G = scalarmultBase(d2h(1));
- key H = hashToPointSimple(G);
+ // Note that H is computed differently than standard hashing
+ // This method is not guaranteed to return a curvepoint for all inputs
+ // Don't use it elsewhere
+ key H = cn_fast_hash(G);
+ ge_p3 H_p3;
+ int decode = ge_frombytes_vartime(&H_p3, H.bytes);
+ ASSERT_EQ(decode, 0); // this is known to pass for the particular value G
+ ge_p2 H_p2;
+ ge_p3_to_p2(&H_p2, &H_p3);
+ ge_p1p1 H8_p1p1;
+ ge_mul8(&H8_p1p1, &H_p2);
+ ge_p1p1_to_p3(&H_p3, &H8_p1p1);
+ ge_p3_tobytes(H.bytes, &H_p3);
+
for (int j = 0 ; j < ATOMS ; j++) {
ASSERT_TRUE(equalKeys(H, H2[j]));
addKeys(H, H, H);