Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Wim Lewis
nettle
Commits
bf587cd5
Commit
bf587cd5
authored
Apr 11, 2013
by
Niels Möller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replace mp_bitcnt_t by unsigned, for compatibility with older gmp versions.
parent
fb709927
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
19 additions
and
5 deletions
+19
-5
ChangeLog
ChangeLog
+6
-0
ecc-mul-a.c
ecc-mul-a.c
+4
-2
ecc-mul-g.c
ecc-mul-g.c
+3
-1
eccdata.c
eccdata.c
+3
-1
sec-modinv.c
sec-modinv.c
+3
-1
No files found.
ChangeLog
View file @
bf587cd5
2013-04-11 Niels Möller <nisse@lysator.liu.se>
* ecc-mul-a.c (ecc_mul_a): Avoid using mp_bitcnt_t, for
compatibility with older GMP versions.
* ecc-mul-g.c (ecc_mul_g): Likewise.
* eccdata.c (ecc_mul_binary): Likewise.
* sec-modinv.c (sec_modinv): Likewise.
* x86_64/sha3-permute.asm: Go via memory for moves between general
registers and xmm registers.
...
...
ecc-mul-a.c
View file @
bf587cd5
...
...
@@ -122,8 +122,10 @@ ecc_mul_a (const struct ecc_curve *ecc,
mp_limb_t
*
scratch_out
=
table
+
(
3
*
ecc
->
size
<<
ECC_MUL_A_WBITS
);
int
is_zero
=
0
;
mp_bitcnt_t
blocks
=
(
ecc
->
bit_size
+
ECC_MUL_A_WBITS
-
1
)
/
ECC_MUL_A_WBITS
;
mp_bitcnt_t
bit_index
=
(
blocks
-
1
)
*
ECC_MUL_A_WBITS
;
/* Avoid the mp_bitcnt_t type for compatibility with older GMP
versions. */
unsigned
blocks
=
(
ecc
->
bit_size
+
ECC_MUL_A_WBITS
-
1
)
/
ECC_MUL_A_WBITS
;
unsigned
bit_index
=
(
blocks
-
1
)
*
ECC_MUL_A_WBITS
;
mp_size_t
limb_index
=
bit_index
/
GMP_NUMB_BITS
;
unsigned
shift
=
bit_index
%
GMP_NUMB_BITS
;
...
...
ecc-mul-g.c
View file @
bf587cd5
...
...
@@ -66,7 +66,9 @@ ecc_mul_g (const struct ecc_curve *ecc, mp_limb_t *r,
for
(
j
=
0
;
j
*
c
<
bit_rows
;
j
++
)
{
unsigned
bits
;
mp_bitcnt_t
bit_index
;
/* Avoid the mp_bitcnt_t type for compatibility with older GMP
versions. */
unsigned
bit_index
;
/* Extract c bits from n, stride k, starting at i + kcj,
ending at i + k (cj + c - 1)*/
...
...
eccdata.c
View file @
bf587cd5
...
...
@@ -219,7 +219,9 @@ static void
ecc_mul_binary
(
const
struct
ecc_curve
*
ecc
,
struct
ecc_point
*
r
,
const
mpz_t
n
,
const
struct
ecc_point
*
p
)
{
mp_bitcnt_t
k
;
/* Avoid the mp_bitcnt_t type for compatibility with older GMP
versions. */
unsigned
k
;
assert
(
r
!=
p
);
assert
(
mpz_sgn
(
n
)
>
0
);
...
...
sec-modinv.c
View file @
bf587cd5
...
...
@@ -72,7 +72,9 @@ sec_modinv (mp_limb_t *vp, mp_limb_t *ap, mp_size_t n,
#define dp (scratch + n)
#define up (scratch + 2*n)
mp_bitcnt_t
i
;
/* Avoid the mp_bitcnt_t type for compatibility with older GMP
versions. */
unsigned
i
;
/* Maintain
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment