Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Nettle
nettle
Commits
b9f98cb7
Commit
b9f98cb7
authored
Aug 23, 2014
by
Niels Möller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Reordered struct ecc_curve, moved function pointers before pointers to bignum constants.
parent
73dddcc4
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
44 additions
and
29 deletions
+44
-29
ChangeLog
ChangeLog
+3
-0
ecc-192.c
ecc-192.c
+6
-4
ecc-224.c
ecc-224.c
+6
-4
ecc-25519.c
ecc-25519.c
+6
-4
ecc-256.c
ecc-256.c
+6
-4
ecc-384.c
ecc-384.c
+6
-4
ecc-521.c
ecc-521.c
+6
-4
ecc-internal.h
ecc-internal.h
+5
-5
No files found.
ChangeLog
View file @
b9f98cb7
2014-08-23 Niels Möller <nisse@lysator.liu.se>
2014-08-23 Niels Möller <nisse@lysator.liu.se>
* ecc-internal.h (struct ecc_curve): Reordered struct, moved
function pointers before pointers to bignum constants.
* sec-modinv.c (sec_modinv): Document that for a == 0 (mod m), we
* sec-modinv.c (sec_modinv): Document that for a == 0 (mod m), we
should produce the "inverse" 0.
should produce the "inverse" 0.
...
...
ecc-192.c
View file @
b9f98cb7
...
@@ -117,16 +117,18 @@ const struct ecc_curve nettle_secp_192r1 =
...
@@ -117,16 +117,18 @@ const struct ecc_curve nettle_secp_192r1 =
ECC_REDC_SIZE
,
ECC_REDC_SIZE
,
ECC_PIPPENGER_K
,
ECC_PIPPENGER_K
,
ECC_PIPPENGER_C
,
ECC_PIPPENGER_C
,
ecc_192_modp
,
ecc_generic_redc
,
ecc_192_modp
,
ecc_generic_modq
,
ecc_p
,
ecc_p
,
ecc_b
,
ecc_b
,
ecc_q
,
ecc_q
,
ecc_g
,
ecc_g
,
ecc_redc_g
,
ecc_redc_g
,
NULL
,
NULL
,
ecc_192_modp
,
ecc_generic_redc
,
ecc_192_modp
,
ecc_generic_modq
,
ecc_Bmodp
,
ecc_Bmodp
,
ecc_Bmodp_shifted
,
ecc_Bmodp_shifted
,
ecc_pp1h
,
ecc_pp1h
,
...
...
ecc-224.c
View file @
b9f98cb7
...
@@ -63,16 +63,18 @@ const struct ecc_curve nettle_secp_224r1 =
...
@@ -63,16 +63,18 @@ const struct ecc_curve nettle_secp_224r1 =
ECC_REDC_SIZE
,
ECC_REDC_SIZE
,
ECC_PIPPENGER_K
,
ECC_PIPPENGER_K
,
ECC_PIPPENGER_C
,
ECC_PIPPENGER_C
,
ecc_224_modp
,
ecc_generic_redc
,
USE_REDC
?
ecc_generic_redc
:
ecc_224_modp
,
ecc_generic_modq
,
ecc_p
,
ecc_p
,
ecc_b
,
ecc_b
,
ecc_q
,
ecc_q
,
ecc_g
,
ecc_g
,
ecc_redc_g
,
ecc_redc_g
,
NULL
,
NULL
,
ecc_224_modp
,
ecc_generic_redc
,
USE_REDC
?
ecc_generic_redc
:
ecc_224_modp
,
ecc_generic_modq
,
ecc_Bmodp
,
ecc_Bmodp
,
ecc_Bmodp_shifted
,
ecc_Bmodp_shifted
,
ecc_pp1h
,
ecc_pp1h
,
...
...
ecc-25519.c
View file @
b9f98cb7
...
@@ -209,16 +209,18 @@ const struct ecc_curve nettle_curve25519 =
...
@@ -209,16 +209,18 @@ const struct ecc_curve nettle_curve25519 =
0
,
0
,
ECC_PIPPENGER_K
,
ECC_PIPPENGER_K
,
ECC_PIPPENGER_C
,
ECC_PIPPENGER_C
,
ecc_25519_modp
,
NULL
,
ecc_25519_modp
,
NULL
,
ecc_p
,
ecc_p
,
ecc_d
,
/* Use the Edwards curve constant. */
ecc_d
,
/* Use the Edwards curve constant. */
ecc_q
,
ecc_q
,
ecc_g
,
ecc_g
,
ecc_redc_g
,
ecc_redc_g
,
ecc_edwards
,
ecc_edwards
,
ecc_25519_modp
,
NULL
,
ecc_25519_modp
,
NULL
,
ecc_Bmodp
,
ecc_Bmodp
,
ecc_Bmodp_shifted
,
ecc_Bmodp_shifted
,
ecc_pp1h
,
ecc_pp1h
,
...
...
ecc-256.c
View file @
b9f98cb7
...
@@ -228,16 +228,18 @@ const struct ecc_curve nettle_secp_256r1 =
...
@@ -228,16 +228,18 @@ const struct ecc_curve nettle_secp_256r1 =
ECC_REDC_SIZE
,
ECC_REDC_SIZE
,
ECC_PIPPENGER_K
,
ECC_PIPPENGER_K
,
ECC_PIPPENGER_C
,
ECC_PIPPENGER_C
,
ecc_256_modp
,
ecc_256_redc
,
USE_REDC
?
ecc_256_redc
:
ecc_256_modp
,
ecc_256_modq
,
ecc_p
,
ecc_p
,
ecc_b
,
ecc_b
,
ecc_q
,
ecc_q
,
ecc_g
,
ecc_g
,
ecc_redc_g
,
ecc_redc_g
,
NULL
,
NULL
,
ecc_256_modp
,
ecc_256_redc
,
USE_REDC
?
ecc_256_redc
:
ecc_256_modp
,
ecc_256_modq
,
ecc_Bmodp
,
ecc_Bmodp
,
ecc_Bmodp_shifted
,
ecc_Bmodp_shifted
,
ecc_pp1h
,
ecc_pp1h
,
...
...
ecc-384.c
View file @
b9f98cb7
...
@@ -156,16 +156,18 @@ const struct ecc_curve nettle_secp_384r1 =
...
@@ -156,16 +156,18 @@ const struct ecc_curve nettle_secp_384r1 =
ECC_REDC_SIZE
,
ECC_REDC_SIZE
,
ECC_PIPPENGER_K
,
ECC_PIPPENGER_K
,
ECC_PIPPENGER_C
,
ECC_PIPPENGER_C
,
ecc_384_modp
,
ECC_REDC_SIZE
!=
0
?
ecc_generic_redc
:
NULL
,
ecc_384_modp
,
ecc_generic_modq
,
ecc_p
,
ecc_p
,
ecc_b
,
ecc_b
,
ecc_q
,
ecc_q
,
ecc_g
,
ecc_g
,
ecc_redc_g
,
ecc_redc_g
,
NULL
,
NULL
,
ecc_384_modp
,
ECC_REDC_SIZE
!=
0
?
ecc_generic_redc
:
NULL
,
ecc_384_modp
,
ecc_generic_modq
,
ecc_Bmodp
,
ecc_Bmodp
,
ecc_Bmodp_shifted
,
ecc_Bmodp_shifted
,
ecc_pp1h
,
ecc_pp1h
,
...
...
ecc-521.c
View file @
b9f98cb7
...
@@ -84,16 +84,18 @@ const struct ecc_curve nettle_secp_521r1 =
...
@@ -84,16 +84,18 @@ const struct ecc_curve nettle_secp_521r1 =
ECC_REDC_SIZE
,
ECC_REDC_SIZE
,
ECC_PIPPENGER_K
,
ECC_PIPPENGER_K
,
ECC_PIPPENGER_C
,
ECC_PIPPENGER_C
,
ecc_521_modp
,
ecc_generic_redc
,
ecc_521_modp
,
ecc_generic_modq
,
ecc_p
,
ecc_p
,
ecc_b
,
ecc_b
,
ecc_q
,
ecc_q
,
ecc_g
,
ecc_g
,
ecc_redc_g
,
ecc_redc_g
,
NULL
,
NULL
,
ecc_521_modp
,
ecc_generic_redc
,
ecc_521_modp
,
ecc_generic_modq
,
ecc_Bmodp
,
ecc_Bmodp
,
ecc_Bmodp_shifted
,
ecc_Bmodp_shifted
,
ecc_pp1h
,
ecc_pp1h
,
...
...
ecc-internal.h
View file @
b9f98cb7
...
@@ -102,6 +102,11 @@ struct ecc_curve
...
@@ -102,6 +102,11 @@ struct ecc_curve
unsigned
short
pippenger_k
;
unsigned
short
pippenger_k
;
unsigned
short
pippenger_c
;
unsigned
short
pippenger_c
;
ecc_mod_func
*
modp
;
ecc_mod_func
*
redc
;
ecc_mod_func
*
reduce
;
ecc_mod_func
*
modq
;
/* The prime p. */
/* The prime p. */
const
mp_limb_t
*
p
;
const
mp_limb_t
*
p
;
const
mp_limb_t
*
b
;
const
mp_limb_t
*
b
;
...
@@ -115,11 +120,6 @@ struct ecc_curve
...
@@ -115,11 +120,6 @@ struct ecc_curve
equivalent Edwards curve. */
equivalent Edwards curve. */
const
mp_limb_t
*
edwards_root
;
const
mp_limb_t
*
edwards_root
;
ecc_mod_func
*
modp
;
ecc_mod_func
*
redc
;
ecc_mod_func
*
reduce
;
ecc_mod_func
*
modq
;
/* B^size mod p. Expected to have at least 32 leading zeros
/* B^size mod p. Expected to have at least 32 leading zeros
(equality for secp_256r1). */
(equality for secp_256r1). */
const
mp_limb_t
*
Bmodp
;
const
mp_limb_t
*
Bmodp
;
...
...
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