summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWan-Teh Chang <wtc@google.com>2013-04-19 17:16:39 -0700
committerWan-Teh Chang <wtc@google.com>2013-04-19 17:16:39 -0700
commit6d7849ee696bf8914807c95544d98438898f9d45 (patch)
tree913cfaa803d86eac6e4f88b24c1bfaa1b28d0f7a
parent1ef8eb9c76653ccedfcd48fb13973eea3499e290 (diff)
downloadnss-hg-6d7849ee696bf8914807c95544d98438898f9d45.tar.gz
Bug 835091: Code cleanup -- don't need to include <stdlib.h>, markNSS_3_15_BETA2
internal functions as static. r=sleevi.
-rw-r--r--lib/freebl/ecl/ecp_192.c13
-rw-r--r--lib/freebl/ecl/ecp_224.c9
-rw-r--r--lib/freebl/ecl/ecp_384.c7
-rw-r--r--lib/freebl/ecl/ecp_521.c9
4 files changed, 17 insertions, 21 deletions
diff --git a/lib/freebl/ecl/ecp_192.c b/lib/freebl/ecl/ecp_192.c
index 9a71cd894..70b717a1a 100644
--- a/lib/freebl/ecl/ecp_192.c
+++ b/lib/freebl/ecl/ecp_192.c
@@ -6,14 +6,13 @@
#include "mpi.h"
#include "mplogic.h"
#include "mpi-priv.h"
-#include <stdlib.h>
#define ECP192_DIGITS ECL_CURVE_DIGITS(192)
/* Fast modular reduction for p192 = 2^192 - 2^64 - 1. a can be r. Uses
* algorithm 7 from Brown, Hankerson, Lopez, Menezes. Software
* Implementation of the NIST Elliptic Curves over Prime Fields. */
-mp_err
+static mp_err
ec_GFp_nistp192_mod(const mp_int *a, mp_int *r, const GFMethod *meth)
{
mp_err res = MP_OKAY;
@@ -254,7 +253,7 @@ ec_GFp_nistp192_mod(const mp_int *a, mp_int *r, const GFMethod *meth)
* number of words are so small, we don't want to overhead of mp function
* calls. Uses optimized modular reduction for p192.
*/
-mp_err
+static mp_err
ec_GFp_nistp192_add(const mp_int *a, const mp_int *b, mp_int *r,
const GFMethod *meth)
{
@@ -335,7 +334,7 @@ ec_GFp_nistp192_add(const mp_int *a, const mp_int *b, mp_int *r,
* number of words are so small, we don't want to overhead of mp function
* calls. Uses optimized modular reduction for p192.
*/
-mp_err
+static mp_err
ec_GFp_nistp192_sub(const mp_int *a, const mp_int *b, mp_int *r,
const GFMethod *meth)
{
@@ -414,7 +413,7 @@ ec_GFp_nistp192_sub(const mp_int *a, const mp_int *b, mp_int *r,
/* Compute the square of polynomial a, reduce modulo p192. Store the
* result in r. r could be a. Uses optimized modular reduction for p192.
*/
-mp_err
+static mp_err
ec_GFp_nistp192_sqr(const mp_int *a, mp_int *r, const GFMethod *meth)
{
mp_err res = MP_OKAY;
@@ -428,7 +427,7 @@ ec_GFp_nistp192_sqr(const mp_int *a, mp_int *r, const GFMethod *meth)
/* Compute the product of two polynomials a and b, reduce modulo p192.
* Store the result in r. r could be a or b; a could be b. Uses
* optimized modular reduction for p192. */
-mp_err
+static mp_err
ec_GFp_nistp192_mul(const mp_int *a, const mp_int *b, mp_int *r,
const GFMethod *meth)
{
@@ -442,7 +441,7 @@ ec_GFp_nistp192_mul(const mp_int *a, const mp_int *b, mp_int *r,
/* Divides two field elements. If a is NULL, then returns the inverse of
* b. */
-mp_err
+static mp_err
ec_GFp_nistp192_div(const mp_int *a, const mp_int *b, mp_int *r,
const GFMethod *meth)
{
diff --git a/lib/freebl/ecl/ecp_224.c b/lib/freebl/ecl/ecp_224.c
index b1a3e4d72..18779ba1b 100644
--- a/lib/freebl/ecl/ecp_224.c
+++ b/lib/freebl/ecl/ecp_224.c
@@ -6,14 +6,13 @@
#include "mpi.h"
#include "mplogic.h"
#include "mpi-priv.h"
-#include <stdlib.h>
#define ECP224_DIGITS ECL_CURVE_DIGITS(224)
/* Fast modular reduction for p224 = 2^224 - 2^96 + 1. a can be r. Uses
* algorithm 7 from Brown, Hankerson, Lopez, Menezes. Software
* Implementation of the NIST Elliptic Curves over Prime Fields. */
-mp_err
+static mp_err
ec_GFp_nistp224_mod(const mp_int *a, mp_int *r, const GFMethod *meth)
{
mp_err res = MP_OKAY;
@@ -275,7 +274,7 @@ ec_GFp_nistp224_mod(const mp_int *a, mp_int *r, const GFMethod *meth)
/* Compute the square of polynomial a, reduce modulo p224. Store the
* result in r. r could be a. Uses optimized modular reduction for p224.
*/
-mp_err
+static mp_err
ec_GFp_nistp224_sqr(const mp_int *a, mp_int *r, const GFMethod *meth)
{
mp_err res = MP_OKAY;
@@ -289,7 +288,7 @@ ec_GFp_nistp224_sqr(const mp_int *a, mp_int *r, const GFMethod *meth)
/* Compute the product of two polynomials a and b, reduce modulo p224.
* Store the result in r. r could be a or b; a could be b. Uses
* optimized modular reduction for p224. */
-mp_err
+static mp_err
ec_GFp_nistp224_mul(const mp_int *a, const mp_int *b, mp_int *r,
const GFMethod *meth)
{
@@ -303,7 +302,7 @@ ec_GFp_nistp224_mul(const mp_int *a, const mp_int *b, mp_int *r,
/* Divides two field elements. If a is NULL, then returns the inverse of
* b. */
-mp_err
+static mp_err
ec_GFp_nistp224_div(const mp_int *a, const mp_int *b, mp_int *r,
const GFMethod *meth)
{
diff --git a/lib/freebl/ecl/ecp_384.c b/lib/freebl/ecl/ecp_384.c
index 5494d4ea3..4c1e85e3b 100644
--- a/lib/freebl/ecl/ecp_384.c
+++ b/lib/freebl/ecl/ecp_384.c
@@ -6,12 +6,11 @@
#include "mpi.h"
#include "mplogic.h"
#include "mpi-priv.h"
-#include <stdlib.h>
/* Fast modular reduction for p384 = 2^384 - 2^128 - 2^96 + 2^32 - 1. a can be r.
* Uses algorithm 2.30 from Hankerson, Menezes, Vanstone. Guide to
* Elliptic Curve Cryptography. */
-mp_err
+static mp_err
ec_GFp_nistp384_mod(const mp_int *a, mp_int *r, const GFMethod *meth)
{
mp_err res = MP_OKAY;
@@ -219,7 +218,7 @@ ec_GFp_nistp384_mod(const mp_int *a, mp_int *r, const GFMethod *meth)
/* Compute the square of polynomial a, reduce modulo p384. Store the
* result in r. r could be a. Uses optimized modular reduction for p384.
*/
-mp_err
+static mp_err
ec_GFp_nistp384_sqr(const mp_int *a, mp_int *r, const GFMethod *meth)
{
mp_err res = MP_OKAY;
@@ -233,7 +232,7 @@ ec_GFp_nistp384_sqr(const mp_int *a, mp_int *r, const GFMethod *meth)
/* Compute the product of two polynomials a and b, reduce modulo p384.
* Store the result in r. r could be a or b; a could be b. Uses
* optimized modular reduction for p384. */
-mp_err
+static mp_err
ec_GFp_nistp384_mul(const mp_int *a, const mp_int *b, mp_int *r,
const GFMethod *meth)
{
diff --git a/lib/freebl/ecl/ecp_521.c b/lib/freebl/ecl/ecp_521.c
index b0aba377a..7eac0f075 100644
--- a/lib/freebl/ecl/ecp_521.c
+++ b/lib/freebl/ecl/ecp_521.c
@@ -6,14 +6,13 @@
#include "mpi.h"
#include "mplogic.h"
#include "mpi-priv.h"
-#include <stdlib.h>
#define ECP521_DIGITS ECL_CURVE_DIGITS(521)
/* Fast modular reduction for p521 = 2^521 - 1. a can be r. Uses
* algorithm 2.31 from Hankerson, Menezes, Vanstone. Guide to
* Elliptic Curve Cryptography. */
-mp_err
+static mp_err
ec_GFp_nistp521_mod(const mp_int *a, mp_int *r, const GFMethod *meth)
{
mp_err res = MP_OKAY;
@@ -72,7 +71,7 @@ ec_GFp_nistp521_mod(const mp_int *a, mp_int *r, const GFMethod *meth)
/* Compute the square of polynomial a, reduce modulo p521. Store the
* result in r. r could be a. Uses optimized modular reduction for p521.
*/
-mp_err
+static mp_err
ec_GFp_nistp521_sqr(const mp_int *a, mp_int *r, const GFMethod *meth)
{
mp_err res = MP_OKAY;
@@ -86,7 +85,7 @@ ec_GFp_nistp521_sqr(const mp_int *a, mp_int *r, const GFMethod *meth)
/* Compute the product of two polynomials a and b, reduce modulo p521.
* Store the result in r. r could be a or b; a could be b. Uses
* optimized modular reduction for p521. */
-mp_err
+static mp_err
ec_GFp_nistp521_mul(const mp_int *a, const mp_int *b, mp_int *r,
const GFMethod *meth)
{
@@ -100,7 +99,7 @@ ec_GFp_nistp521_mul(const mp_int *a, const mp_int *b, mp_int *r,
/* Divides two field elements. If a is NULL, then returns the inverse of
* b. */
-mp_err
+static mp_err
ec_GFp_nistp521_div(const mp_int *a, const mp_int *b, mp_int *r,
const GFMethod *meth)
{