Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
BC
public
external
mbedtls
Commits
7c8934ea
Commit
7c8934ea
authored
Jun 27, 2013
by
Manuel Pégourié-Gonnard
Browse files
Add ecdsa_init and ecdsa_free
parent
bec2f45c
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
41 additions
and
0 deletions
+41
-0
include/polarssl/ecdsa.h
include/polarssl/ecdsa.h
+14
-0
library/ecdsa.c
library/ecdsa.c
+27
-0
No files found.
include/polarssl/ecdsa.h
View file @
7c8934ea
...
...
@@ -84,6 +84,20 @@ int ecdsa_verify( const ecp_group *grp,
const
unsigned
char
*
buf
,
size_t
blen
,
const
ecp_point
*
Q
,
const
mpi
*
r
,
const
mpi
*
s
);
/**
* \brief Initialize context
*
* \param ctx Context to initialize
*/
void
ecdsa_init
(
ecdsa_context
*
ctx
);
/**
* \brief Free context
*
* \param ctx Context to free
*/
void
ecdsa_free
(
ecdsa_context
*
ctx
);
/**
* \brief Checkup routine
*
...
...
library/ecdsa.c
View file @
7c8934ea
...
...
@@ -174,6 +174,33 @@ cleanup:
return
(
ret
);
}
/*
* Initialize context
*/
void
ecdsa_init
(
ecdsa_context
*
ctx
)
{
ecp_group_init
(
&
ctx
->
grp
);
mpi_init
(
&
ctx
->
d
);
ecp_point_init
(
&
ctx
->
Q
);
mpi_init
(
&
ctx
->
r
);
mpi_init
(
&
ctx
->
s
);
mpi_init
(
&
ctx
->
d
);
ctx
->
point_format
=
POLARSSL_ECP_PF_UNCOMPRESSED
;
}
/*
* Free context
*/
void
ecdsa_free
(
ecdsa_context
*
ctx
)
{
ecp_group_free
(
&
ctx
->
grp
);
mpi_free
(
&
ctx
->
d
);
ecp_point_free
(
&
ctx
->
Q
);
mpi_free
(
&
ctx
->
r
);
mpi_free
(
&
ctx
->
s
);
mpi_free
(
&
ctx
->
d
);
ctx
->
point_format
=
POLARSSL_ECP_PF_UNCOMPRESSED
;
}
#if defined(POLARSSL_SELF_TEST)
...
...
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