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

The final argument to mont_select() is a size_t #576

Merged
merged 1 commit into from
Nov 20, 2021

Conversation

stefanor
Copy link
Contributor

Picked up in Ubuntu:

cc -g -O2 -ffile-prefix-map=/<<BUILDDIR>>/pycryptodome-3.11.0+dfsg1=. -flto=auto -ffat-lto-objects -fstack-protector-strong -Wformat -Werror=format-security -O3 -g -fstrict-aliasing -Wall -Werror -msse2 -Wdate-time -D_FORTIFY_SOURCE=2 -I.. -DPYCRYPTO_LITTLE_ENDIAN -DHAVE_POSIX_MEMALIGN -DHAVE_STDINT_H -DSTATIC="" -DHAVE_X86INTRIN_H -DUSE_SSE2 -DHAVE_WMMINTRIN_H -DHAVE_TMMINTRIN_H -DHAVE_UINT128  -o build/test_mont test_mont.c build/mont_32.o build/modexp_utils.o build/siphash.o
test_mont.c:8:5: error: type of ‘mont_select’ does not match original declaration [-Werror=lto-type-mismatch]
    8 | int mont_select(uint64_t *out, const uint64_t *a, const uint64_t *b, unsigned cond, unsigned words);
      |     ^
../mont.c:260:22: note: type mismatch in parameter 5
  260 | STATIC FUNC_SSE2 int mont_select(uint64_t *out, const uint64_t *a, const uint64_t *b, unsigned cond, size_t words)
      |                      ^
../mont.c:260:22: note: type ‘size_t’ should match type ‘unsigned int’
../mont.c:260:22: note: ‘mont_select’ was previously declared here
../mont.c:260:22: note: code may be misoptimized unless ‘-fno-strict-aliasing’ is used`

@Legrandin Legrandin merged commit 1e2aeb7 into Legrandin:master Nov 20, 2021
@Legrandin
Copy link
Owner

Thanks!

@stefanor stefanor deleted the mont_select-signature branch November 20, 2021 19:57
@ileanadumitrescu95
Copy link
Contributor

Hi, I have updated this patch in Debian, because the change that was previously merged has been reverted back. The function name has changed, but the type mismatch issue is still there. Below contains the current patch in Debian:

--- a/src/test/test_mont.c
+++ b/src/test/test_mont.c
@@ -5,7 +5,7 @@
 int ge(const uint64_t *x, const uint64_t *y, size_t nw);
 unsigned sub(uint64_t *out, const uint64_t *a, const uint64_t *b, size_t nw);
 void rsquare(uint64_t *r2, uint64_t *n, size_t nw);
-int mod_select(uint64_t *out, const uint64_t *a, const uint64_t *b, unsigned cond, unsigned words);
+int mod_select(uint64_t *out, const uint64_t *a, const uint64_t *b, unsigned cond, size_t words);
 
 void test_ge(void)
 {

The revision occurred during this commit.

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.

None yet

3 participants