-
Notifications
You must be signed in to change notification settings - Fork 1.1k
build: fix clang -Wshorten-64-to-32 warnings #1801
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
base: master
Are you sure you want to change the base?
Changes from 2 commits
66452d4
3ddc5be
4a84fb7
da9db68
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -109,7 +109,7 @@ static int secp256k1_scalar_add(secp256k1_scalar *r, const secp256k1_scalar *a, | |||||||||
| secp256k1_u128_accum_u64(&t, a->d[3]); | ||||||||||
| secp256k1_u128_accum_u64(&t, b->d[3]); | ||||||||||
| r->d[3] = secp256k1_u128_to_u64(&t); secp256k1_u128_rshift(&t, 64); | ||||||||||
| overflow = secp256k1_u128_to_u64(&t) + secp256k1_scalar_check_overflow(r); | ||||||||||
| overflow = (int)secp256k1_u128_to_u64(&t) + secp256k1_scalar_check_overflow(r); | ||||||||||
| VERIFY_CHECK(overflow == 0 || overflow == 1); | ||||||||||
| secp256k1_scalar_reduce(r, overflow); | ||||||||||
|
|
||||||||||
|
|
@@ -634,7 +634,7 @@ static void secp256k1_scalar_reduce_512(secp256k1_scalar *r, const uint64_t *l) | |||||||||
| sumadd_fast(n3); | ||||||||||
| extract_fast(m5); | ||||||||||
| VERIFY_CHECK(c0 <= 1); | ||||||||||
| m6 = c0; | ||||||||||
| m6 = (uint32_t)c0; | ||||||||||
|
|
||||||||||
| /* Reduce 385 bits into 258. */ | ||||||||||
| /* p[0..4] = m[0..3] + m[4..6] * SECP256K1_N_C. */ | ||||||||||
|
|
@@ -654,7 +654,7 @@ static void secp256k1_scalar_reduce_512(secp256k1_scalar *r, const uint64_t *l) | |||||||||
| muladd_fast(m6, SECP256K1_N_C_1); | ||||||||||
| sumadd_fast(m5); | ||||||||||
| extract_fast(p3); | ||||||||||
| p4 = c0 + m6; | ||||||||||
| p4 = (uint32_t)c0 + m6; | ||||||||||
| VERIFY_CHECK(p4 <= 2); | ||||||||||
|
Comment on lines
+658
to
659
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Change made
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I ended up removing
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hm, I see. I have no idea how the algorithm works. Still, this is a bit surprising to me because that means Perhaps @sipa can provide some insights.. |
||||||||||
|
|
||||||||||
| /* Reduce 258 bits into 256. */ | ||||||||||
|
|
@@ -674,7 +674,7 @@ static void secp256k1_scalar_reduce_512(secp256k1_scalar *r, const uint64_t *l) | |||||||||
| #endif | ||||||||||
|
|
||||||||||
| /* Final reduction of r. */ | ||||||||||
| secp256k1_scalar_reduce(r, c + secp256k1_scalar_check_overflow(r)); | ||||||||||
| secp256k1_scalar_reduce(r, (unsigned int)c + secp256k1_scalar_check_overflow(r)); | ||||||||||
|
csjones marked this conversation as resolved.
|
||||||||||
| } | ||||||||||
|
|
||||||||||
| static void secp256k1_scalar_mul_512(uint64_t *l8, const secp256k1_scalar *a, const secp256k1_scalar *b) { | ||||||||||
|
|
||||||||||
Uh oh!
There was an error while loading. Please reload this page.