From 6a5e975b49aace3ac4febc5df0deb4017aff6094 Mon Sep 17 00:00:00 2001 From: Matt Liberty Date: Wed, 8 May 2024 17:45:58 -0400 Subject: [PATCH] Fixed GitHub packaging action. * Fixed intermittently failing unit test * Excluded python 3.9 build for macOS. --- .github/workflows/packaging.yml | 3 +++ test/test_monocypher.py | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/packaging.yml b/.github/workflows/packaging.yml index 37e76c2..552c7bd 100644 --- a/.github/workflows/packaging.yml +++ b/.github/workflows/packaging.yml @@ -83,6 +83,9 @@ jobs: matrix: os: ["ubuntu-latest", "windows-latest", "macos-latest"] python_version: ["cp39", "cp310", "cp311", "cp312"] + exclude: + - os: "macos-latest" + python_version: "cp39" steps: - name: Download sdist diff --git a/test/test_monocypher.py b/test/test_monocypher.py index d3ea5a7..bdc5ad7 100644 --- a/test/test_monocypher.py +++ b/test/test_monocypher.py @@ -102,7 +102,7 @@ def test_IncrementalAuthenticatedEncryption(self): def test_sign(self): random = np.random.RandomState(seed=1) - for i in range(10): + for i in range(100): length = random.randint(1, 4096) secret_key, expected_public_key = monocypher.generate_signing_key_pair() msg = bytes(random.randint(0, 256, length, dtype=np.uint8)) @@ -111,7 +111,7 @@ def test_sign(self): sig = monocypher.signature_sign(secret_key, msg) self.assertTrue(monocypher.signature_check(sig, public_key, msg)) self.assertFalse(monocypher.signature_check(sig, public_key, msg + b'0')) - sig2 = sig[:10] + bytes([sig[10] + 1]) + sig[11:] + sig2 = sig[:10] + bytes([(sig[10] + 1) & 0xff]) + sig[11:] self.assertFalse(monocypher.signature_check(sig2, public_key, msg)) def test_key_exchange_static(self):