Skip to content

Commit

Permalink
fix in-comment Sage code to work with Sage9.0+ (based on Python3)
Browse files Browse the repository at this point in the history
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).
  • Loading branch information
theStack committed Jun 11, 2023
1 parent 60556c9 commit 3b04d92
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/ecdsa_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@
#include "ecdsa.h"

/** Group order for secp256k1 defined as 'n' in "Standards for Efficient Cryptography" (SEC2) 2.7.1
* sage: for t in xrange(1023, -1, -1):
* sage: for t in range(1023, -1, -1):
* .. p = 2**256 - 2**32 - t
* .. if p.is_prime():
* .. print '%x'%p
* .. print('%x'%p)
* .. break
* 'fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f'
* sage: a = 0
Expand Down
6 changes: 3 additions & 3 deletions src/tests.c
Original file line number Diff line number Diff line change
Expand Up @@ -4022,9 +4022,9 @@ static void test_add_neg_y_diff_x(void) {
* # random "bad pair"
* P = C.random_element()
* Q = -int(lam) * P
* print " P: %x %x" % P.xy()
* print " Q: %x %x" % Q.xy()
* print "P + Q: %x %x" % (P + Q).xy()
* print(" P: %x %x" % P.xy())
* print(" Q: %x %x" % Q.xy())
* print("P + Q: %x %x" % (P + Q).xy())
*/
secp256k1_gej aj = SECP256K1_GEJ_CONST(
0x8d24cd95, 0x0a355af1, 0x3c543505, 0x44238d30,
Expand Down

0 comments on commit 3b04d92

Please sign in to comment.