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
Toggle navigation
Open sidebar
BC
public
external
mbedtls
Commits
1f82b041
Commit
1f82b041
authored
Dec 06, 2013
by
Manuel Pégourié-Gonnard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adapt ecp_group_free() to static constants
parent
73cc01d7
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
10 deletions
+11
-10
include/polarssl/ecp.h
include/polarssl/ecp.h
+1
-1
library/ecp.c
library/ecp.c
+8
-9
library/ecp_curves.c
library/ecp_curves.c
+2
-0
No files found.
include/polarssl/ecp.h
View file @
1f82b041
...
...
@@ -136,7 +136,7 @@ typedef struct
mpi
N
;
/*!< 1. the order of G, or 2. unused */
size_t
pbits
;
/*!< number of bits in P */
size_t
nbits
;
/*!< number of bits in 1. P, or 2. private keys */
unsigned
int
h
;
/*!<
unused
*/
unsigned
int
h
;
/*!<
internal: 1 if the constants are static
*/
int
(
*
modp
)(
mpi
*
);
/*!< function for fast reduction mod P */
int
(
*
t_pre
)(
ecp_point
*
,
void
*
);
/*!< unused */
int
(
*
t_post
)(
ecp_point
*
,
void
*
);
/*!< unused */
...
...
library/ecp.c
View file @
1f82b041
...
...
@@ -277,18 +277,17 @@ void ecp_group_free( ecp_group *grp )
{
size_t
i
;
/* FIXME WIP */
if
(
grp
->
id
!=
0
)
return
;
if
(
grp
==
NULL
)
return
;
mpi_free
(
&
grp
->
P
);
mpi_free
(
&
grp
->
A
);
mpi_free
(
&
grp
->
B
);
ecp_point_free
(
&
grp
->
G
);
mpi_free
(
&
grp
->
N
);
if
(
grp
->
h
!=
1
)
{
mpi_free
(
&
grp
->
P
);
mpi_free
(
&
grp
->
A
);
mpi_free
(
&
grp
->
B
);
ecp_point_free
(
&
grp
->
G
);
mpi_free
(
&
grp
->
N
);
}
if
(
grp
->
T
!=
NULL
)
{
...
...
library/ecp_curves.c
View file @
1f82b041
...
...
@@ -485,6 +485,8 @@ static int ecp_group_load( ecp_group *grp,
grp
->
pbits
=
mpi_msb
(
&
grp
->
P
);
grp
->
nbits
=
mpi_msb
(
&
grp
->
N
);
grp
->
h
=
1
;
return
(
0
);
}
...
...
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