Skip to content

Commit 3b04d92

Browse files
committed
fix in-comment Sage code to work with Sage9.0+ (based on Python3)
Some of the C source files include Sage code in comments. This PR updates these to work with a current version based on Python3 (Sage 9.0+, see https://wiki.sagemath.org/Python3-Switch). This can be seen as a small follow-up to PR #849 (commit 13c88ef).
1 parent 60556c9 commit 3b04d92

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/ecdsa_impl.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@
1616
#include "ecdsa.h"
1717

1818
/** Group order for secp256k1 defined as 'n' in "Standards for Efficient Cryptography" (SEC2) 2.7.1
19-
* sage: for t in xrange(1023, -1, -1):
19+
* sage: for t in range(1023, -1, -1):
2020
* .. p = 2**256 - 2**32 - t
2121
* .. if p.is_prime():
22-
* .. print '%x'%p
22+
* .. print('%x'%p)
2323
* .. break
2424
* 'fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f'
2525
* sage: a = 0

src/tests.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4022,9 +4022,9 @@ static void test_add_neg_y_diff_x(void) {
40224022
* # random "bad pair"
40234023
* P = C.random_element()
40244024
* Q = -int(lam) * P
4025-
* print " P: %x %x" % P.xy()
4026-
* print " Q: %x %x" % Q.xy()
4027-
* print "P + Q: %x %x" % (P + Q).xy()
4025+
* print(" P: %x %x" % P.xy())
4026+
* print(" Q: %x %x" % Q.xy())
4027+
* print("P + Q: %x %x" % (P + Q).xy())
40284028
*/
40294029
secp256k1_gej aj = SECP256K1_GEJ_CONST(
40304030
0x8d24cd95, 0x0a355af1, 0x3c543505, 0x44238d30,

0 commit comments

Comments
 (0)