projects
/
oweals
/
openssl.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
x86_64 assembly pack: keep making Windows build more robust.
[oweals/openssl.git]
/
crypto
/
bn
/
bn_lib.c
diff --git
a/crypto/bn/bn_lib.c
b/crypto/bn/bn_lib.c
index 244a430d7229dd1be92401fa888ac477aa42db75..f77fdb75fd9a075b625c0b39677f3342525a21c2 100644
(file)
--- a/
crypto/bn/bn_lib.c
+++ b/
crypto/bn/bn_lib.c
@@
-61,12
+61,15
@@
# define NDEBUG
#endif
# define NDEBUG
#endif
+#define OPENSSL_FIPSAPI
+
#include <assert.h>
#include <limits.h>
#include <stdio.h>
#include "cryptlib.h"
#include "bn_lcl.h"
#include <assert.h>
#include <limits.h>
#include <stdio.h>
#include "cryptlib.h"
#include "bn_lcl.h"
+__fips_constseg
const char BN_version[]="Big Number" OPENSSL_VERSION_PTEXT;
/* This stuff appears to be completely unused, so is deprecated */
const char BN_version[]="Big Number" OPENSSL_VERSION_PTEXT;
/* This stuff appears to be completely unused, so is deprecated */
@@
-133,34
+136,16
@@
int BN_get_params(int which)
const BIGNUM *BN_value_one(void)
{
const BIGNUM *BN_value_one(void)
{
- static BN_ULONG data_one=1L;
- static
BIGNUM const_one={
&data_one,1,1,0,BN_FLG_STATIC_DATA};
+ static
const
BN_ULONG data_one=1L;
+ static
const BIGNUM const_one={(BN_ULONG *)
&data_one,1,1,0,BN_FLG_STATIC_DATA};
return(&const_one);
}
return(&const_one);
}
-char *BN_options(void)
- {
- static int init=0;
- static char data[16];
-
- if (!init)
- {
- init++;
-#ifdef BN_LLONG
- BIO_snprintf(data,sizeof data,"bn(%d,%d)",
- (int)sizeof(BN_ULLONG)*8,(int)sizeof(BN_ULONG)*8);
-#else
- BIO_snprintf(data,sizeof data,"bn(%d,%d)",
- (int)sizeof(BN_ULONG)*8,(int)sizeof(BN_ULONG)*8);
-#endif
- }
- return(data);
- }
-
int BN_num_bits_word(BN_ULONG l)
{
int BN_num_bits_word(BN_ULONG l)
{
- static const char bits[256]={
+ __fips_constseg
+ static const unsigned char bits[256]={
0,1,2,2,3,3,3,3,4,4,4,4,4,4,4,4,
5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,
6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,
0,1,2,2,3,3,3,3,4,4,4,4,4,4,4,4,
5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,
6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,
@@
-763,7
+748,7
@@
int BN_is_bit_set(const BIGNUM *a, int n)
i=n/BN_BITS2;
j=n%BN_BITS2;
if (a->top <= i) return 0;
i=n/BN_BITS2;
j=n%BN_BITS2;
if (a->top <= i) return 0;
- return
((a->d[i]&(((BN_ULONG)1)<<j))?1:0
);
+ return
(int)(((a->d[i])>>j)&((BN_ULONG)1)
);
}
int BN_mask_bits(BIGNUM *a, int n)
}
int BN_mask_bits(BIGNUM *a, int n)