Possible fix for test_random_keys() failure on short keys #2173

Merged
PeterSurda merged 4 commits from gitea-68 into v0.6 2024-02-20 02:23:12 +01:00
PeterSurda commented 2024-02-20 01:17:43 +01:00 (Migrated from github.com)

Hi!

This is a possible fix for failures like this.

======================================================================
FAIL: test_random_keys (pybitmessage.pyelliptic.tests.test_ecc.TestECC)
A dummy test for random keys in ECC object
----------------------------------------------------------------------
Traceback (most recent call last):
 File "pybitmessage/pyelliptic/tests/test_ecc.py", line 31, in test_random_keys
 self.assertEqual(pubkey[:4], b'\x02\xca\x00\x20')
AssertionError: '\x02\xca\x00\x1f' != '\x02\xca\x00 '

I may be wrong. I preferred to pad the pubkey coordinates in ECC.get_pubkey() because I see the b'\x02\xca\x00 ' literal here in highlevelcrypto. Maybe I should've changed the pubkey parts of test_random_keys() instead, like I did for the privkey?

Hi! This is a possible fix for failures like [this](https://buildbot.bitmessage.org/#/builders/33/builds/16794/steps/4/logs/stdio). ``` ====================================================================== FAIL: test_random_keys (pybitmessage.pyelliptic.tests.test_ecc.TestECC) A dummy test for random keys in ECC object ---------------------------------------------------------------------- Traceback (most recent call last): File "pybitmessage/pyelliptic/tests/test_ecc.py", line 31, in test_random_keys self.assertEqual(pubkey[:4], b'\x02\xca\x00\x20') AssertionError: '\x02\xca\x00\x1f' != '\x02\xca\x00 ' ``` I may be wrong. I preferred to pad the pubkey coordinates in `ECC.get_pubkey()` because I see the `b'\x02\xca\x00 '` literal [here](https://github.com/Bitmessage/PyBitmessage/blob/v0.6/src/highlevelcrypto.py#L34) in `highlevelcrypto`. Maybe I should've changed the pubkey parts of `test_random_keys()` instead, like I did for the privkey?
This repo is archived. You cannot comment on pull requests.
No description provided.