summaryrefslogtreecommitdiff
path: root/Tests/LibCrypto/TestBigInteger.cpp
diff options
context:
space:
mode:
authorNico Weber <thakis@chromium.org>2022-01-17 20:03:51 -0500
committerAli Mohammad Pur <Ali.mpfard@gmail.com>2022-01-18 20:04:06 +0330
commitd9b6eb29bcd3228c3d5c14a83821293c52d199fa (patch)
tree6ee4519ba08fc7e187dba5488ffbadd7d016a3d0 /Tests/LibCrypto/TestBigInteger.cpp
parent013799a4dd303653aead72f1b35c6d96767abc94 (diff)
downloadserenity-d9b6eb29bcd3228c3d5c14a83821293c52d199fa.zip
LibCrypto+LibJS: Better bitwise binary_xor binop
We went through some trouble to make & and | work right. Reimplement ^ in terms of & and | to make ^ work right as well. This is less fast than a direct implementation, but let's get things working first.
Diffstat (limited to 'Tests/LibCrypto/TestBigInteger.cpp')
-rw-r--r--Tests/LibCrypto/TestBigInteger.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/Tests/LibCrypto/TestBigInteger.cpp b/Tests/LibCrypto/TestBigInteger.cpp
index 1ff373a987..7af6eb4a1d 100644
--- a/Tests/LibCrypto/TestBigInteger.cpp
+++ b/Tests/LibCrypto/TestBigInteger.cpp
@@ -526,8 +526,8 @@ TEST_CASE(test_signed_bigint_bitwise_xor)
auto num1 = "-3"_sbigint;
auto num2 = "1"_sbigint;
EXPECT_EQ(num1.bitwise_xor(num1), "0"_sbigint);
- EXPECT_EQ(num1.bitwise_xor(num2), "-2"_sbigint);
- EXPECT_EQ(num2.bitwise_xor(num1), "-2"_sbigint);
+ EXPECT_EQ(num1.bitwise_xor(num2), "-4"_sbigint);
+ EXPECT_EQ(num2.bitwise_xor(num1), "-4"_sbigint);
EXPECT_EQ(num2.bitwise_xor(num2), "0"_sbigint);
}