projects
/
oweals
/
openssl.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
bfe30e4
)
Some 'const's for BNs.
author
Bodo Möller
<bodo@openssl.org>
Thu, 3 Feb 2000 01:26:07 +0000
(
01:26
+0000)
committer
Bodo Möller
<bodo@openssl.org>
Thu, 3 Feb 2000 01:26:07 +0000
(
01:26
+0000)
crypto/bn/bn.h
patch
|
blob
|
history
crypto/bn/bn_prime.c
patch
|
blob
|
history
crypto/bn/bn_word.c
patch
|
blob
|
history
doc/crypto/BN_add_word.pod
patch
|
blob
|
history
doc/crypto/bn.pod
patch
|
blob
|
history
diff --git
a/crypto/bn/bn.h
b/crypto/bn/bn.h
index 63fb9cc6e808e76bc16f015582840c73d1b916b3..417f3706fb81d13e1f6be04b9ae44ae3ddb9caca 100644
(file)
--- a/
crypto/bn/bn.h
+++ b/
crypto/bn/bn.h
@@
-356,7
+356,7
@@
int BN_div(BIGNUM *dv, BIGNUM *rem, const BIGNUM *m, const BIGNUM *d,
BN_CTX *ctx);
int BN_mul(BIGNUM *r, BIGNUM *a, BIGNUM *b, BN_CTX *ctx);
int BN_sqr(BIGNUM *r, BIGNUM *a,BN_CTX *ctx);
BN_CTX *ctx);
int BN_mul(BIGNUM *r, BIGNUM *a, BIGNUM *b, BN_CTX *ctx);
int BN_sqr(BIGNUM *r, BIGNUM *a,BN_CTX *ctx);
-BN_ULONG BN_mod_word(BIGNUM *a, BN_ULONG w);
+BN_ULONG BN_mod_word(
const
BIGNUM *a, BN_ULONG w);
BN_ULONG BN_div_word(BIGNUM *a, BN_ULONG w);
int BN_mul_word(BIGNUM *a, BN_ULONG w);
int BN_add_word(BIGNUM *a, BN_ULONG w);
BN_ULONG BN_div_word(BIGNUM *a, BN_ULONG w);
int BN_mul_word(BIGNUM *a, BN_ULONG w);
int BN_add_word(BIGNUM *a, BN_ULONG w);
diff --git
a/crypto/bn/bn_prime.c
b/crypto/bn/bn_prime.c
index efc053ecf691bf41506de77d5f4894a7f81c34f6..0f07c222fa0e1ae9c6cea35ead17295934af5fbe 100644
(file)
--- a/
crypto/bn/bn_prime.c
+++ b/
crypto/bn/bn_prime.c
@@
-121,8
+121,8
@@
*/
#include "bn_prime.h"
*/
#include "bn_prime.h"
-static int witness(BIGNUM *w,
BIGNUM *a, BIGNUM *a1, BIGNUM *a1_odd, int k
,
- BN_CTX *ctx, BN_MONT_CTX *mont);
+static int witness(BIGNUM *w,
const BIGNUM *a, const BIGNUM *a1
,
+
const BIGNUM *a1_odd, int k,
BN_CTX *ctx, BN_MONT_CTX *mont);
static int probable_prime(BIGNUM *rnd, int bits);
static int probable_prime_dh(BIGNUM *rnd, int bits,
BIGNUM *add, BIGNUM *rem, BN_CTX *ctx);
static int probable_prime(BIGNUM *rnd, int bits);
static int probable_prime_dh(BIGNUM *rnd, int bits,
BIGNUM *add, BIGNUM *rem, BN_CTX *ctx);
@@
-223,7
+223,7
@@
int BN_is_prime_fasttest(const BIGNUM *a, int checks,
BN_CTX *ctx = NULL;
BIGNUM *A1, *A1_odd, *check; /* taken from ctx */
BN_MONT_CTX *mont = NULL;
BN_CTX *ctx = NULL;
BIGNUM *A1, *A1_odd, *check; /* taken from ctx */
BN_MONT_CTX *mont = NULL;
- BIGNUM *A;
+
const
BIGNUM *A;
if (checks == BN_prime_checks)
checks = BN_prime_checks_for_size(BN_num_bits(a));
if (checks == BN_prime_checks)
checks = BN_prime_checks_for_size(BN_num_bits(a));
@@
-247,9
+247,10
@@
int BN_is_prime_fasttest(const BIGNUM *a, int checks,
/* A := abs(a) */
if (a->neg)
{
/* A := abs(a) */
if (a->neg)
{
- A = &(ctx->bn[ctx->tos++]);
- BN_copy(A, a);
- A->neg = 0;
+ BIGNUM *t = &(ctx->bn[ctx->tos++]);
+ BN_copy(t, a);
+ t->neg = 0;
+ A = t;
}
else
A = a;
}
else
A = a;
@@
-318,8
+319,8
@@
err:
return(ret);
}
return(ret);
}
-static int witness(BIGNUM *w,
BIGNUM *a, BIGNUM *a1, BIGNUM *a1_odd, int k
,
- BN_CTX *ctx, BN_MONT_CTX *mont)
+static int witness(BIGNUM *w,
const BIGNUM *a, const BIGNUM *a1
,
+
const BIGNUM *a1_odd, int k,
BN_CTX *ctx, BN_MONT_CTX *mont)
{
if (!BN_mod_exp_mont(w, w, a1_odd, a, ctx, mont)) /* w := w^a1_odd mod a */
return -1;
{
if (!BN_mod_exp_mont(w, w, a1_odd, a, ctx, mont)) /* w := w^a1_odd mod a */
return -1;
diff --git
a/crypto/bn/bn_word.c
b/crypto/bn/bn_word.c
index c0cfbc67970130e513771956c44cb1aeacb6ce27..73157a7d43fda6711572abe34dd28a11b0855a42 100644
(file)
--- a/
crypto/bn/bn_word.c
+++ b/
crypto/bn/bn_word.c
@@
-60,7
+60,7
@@
#include "cryptlib.h"
#include "bn_lcl.h"
#include "cryptlib.h"
#include "bn_lcl.h"
-BN_ULONG BN_mod_word(BIGNUM *a, BN_ULONG w)
+BN_ULONG BN_mod_word(
const
BIGNUM *a, BN_ULONG w)
{
#ifndef BN_LLONG
BN_ULONG ret=0;
{
#ifndef BN_LLONG
BN_ULONG ret=0;
diff --git
a/doc/crypto/BN_add_word.pod
b/doc/crypto/BN_add_word.pod
index ee02e9892050a1d9abb99baf700094bd71832d2e..1c3c629f7f535456c66ae536bdef4106856e3b8a 100644
(file)
--- a/
doc/crypto/BN_add_word.pod
+++ b/
doc/crypto/BN_add_word.pod
@@
-17,7
+17,7
@@
functions on BIGNUMs with integers
BN_ULONG BN_div_word(BIGNUM *a, BN_ULONG w);
BN_ULONG BN_div_word(BIGNUM *a, BN_ULONG w);
- BN_ULONG BN_mod_word(BIGNUM *a, BN_ULONG w);
+ BN_ULONG BN_mod_word(
const
BIGNUM *a, BN_ULONG w);
=head1 DESCRIPTION
=head1 DESCRIPTION
diff --git
a/doc/crypto/bn.pod
b/doc/crypto/bn.pod
index 823561fa8dcf9c2e03e6fa5ea794051c7a57e8ae..c1cb2f61fd99a35491dce38cdfde0951a31bbd35 100644
(file)
--- a/
doc/crypto/bn.pod
+++ b/
doc/crypto/bn.pod
@@
-43,7
+43,7
@@
bn - Multiprecision integer arithmetics
int BN_sub_word(BIGNUM *a, BN_ULONG w);
int BN_mul_word(BIGNUM *a, BN_ULONG w);
BN_ULONG BN_div_word(BIGNUM *a, BN_ULONG w);
int BN_sub_word(BIGNUM *a, BN_ULONG w);
int BN_mul_word(BIGNUM *a, BN_ULONG w);
BN_ULONG BN_div_word(BIGNUM *a, BN_ULONG w);
- BN_ULONG BN_mod_word(BIGNUM *a, BN_ULONG w);
+ BN_ULONG BN_mod_word(
const
BIGNUM *a, BN_ULONG w);
int BN_cmp(BIGNUM *a, BIGNUM *b);
int BN_ucmp(BIGNUM *a, BIGNUM *b);
int BN_cmp(BIGNUM *a, BIGNUM *b);
int BN_ucmp(BIGNUM *a, BIGNUM *b);
@@
-63,7
+63,7
@@
bn - Multiprecision integer arithmetics
BIGNUM *BN_generate_prime(BIGNUM *ret,int bits,int safe,BIGNUM *add,
BIGNUM *rem,void (*callback)(int,int,void *),void *cb_arg);
BIGNUM *BN_generate_prime(BIGNUM *ret,int bits,int safe,BIGNUM *add,
BIGNUM *rem,void (*callback)(int,int,void *),void *cb_arg);
- int BN_is_prime(BIGNUM *p,int nchecks,void (*callback)(int,int,void *),
+ int BN_is_prime(
const
BIGNUM *p,int nchecks,void (*callback)(int,int,void *),
BN_CTX *ctx,void *cb_arg);
int BN_set_bit(BIGNUM *a, int n);
BN_CTX *ctx,void *cb_arg);
int BN_set_bit(BIGNUM *a, int n);