Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc: fix sage code for deriving alternative generator H #292

Conversation

theStack
Copy link
Contributor

@theStack theStack commented May 7, 2024

The line calculating H (in particular, the expression G.decode('hex')) fails with the following error message on Sage 9.5:

AttributeError: 'str' object has no attribute 'decode'

Fix that by converting the hex-string to bytes using bytes.fromhex.

(Noticed while reviewing bitcoin/bitcoin#30048 which picks this code snippet comment up.)

The expression `G.decode('hex')` fails with the following error message
on Sage 9.5:

AttributeError: 'str' object has no attribute 'decode'

Fix that by converting the hex-string to bytes using `bytes.fromhex`.
Copy link

@josibake josibake left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK 7040a20

Verified by running this using the binder instance for Sage 10.3: https://mybinder.org/v2/gh/sagemath/sage-binder-env/master.

Worth mentioning this is a python2 to python3 change (decoded was removed in python3 iirc).

Copy link
Collaborator

@real-or-random real-or-random left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utACK 7040a20

@real-or-random real-or-random merged commit d661a93 into BlockstreamResearch:master May 8, 2024
107 checks passed
@theStack theStack deleted the fix_alternative_generator_sage_code branch May 8, 2024 10:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants