diff options
| author | markus <> | 2004-04-07 20:42:07 +0000 |
|---|---|---|
| committer | markus <> | 2004-04-07 20:42:07 +0000 |
| commit | 58c08aa241f168c84ce7cc3052454ea59a44eada (patch) | |
| tree | 1806747a3fda66041a998ca63c763fdcf722450e /src/lib/libcrypto/bn | |
| parent | 9c1aa44a1eacea897c0432e796b205b8484ff4d2 (diff) | |
| download | openbsd-58c08aa241f168c84ce7cc3052454ea59a44eada.tar.gz openbsd-58c08aa241f168c84ce7cc3052454ea59a44eada.tar.bz2 openbsd-58c08aa241f168c84ce7cc3052454ea59a44eada.zip | |
import openssl-0.9.7d
Diffstat (limited to 'src/lib/libcrypto/bn')
| -rw-r--r-- | src/lib/libcrypto/bn/asm/bn-586.pl | 2 | ||||
| -rw-r--r-- | src/lib/libcrypto/bn/asm/x86_64-gcc.c | 2 | ||||
| -rw-r--r-- | src/lib/libcrypto/bn/bn_lcl.h | 17 | ||||
| -rw-r--r-- | src/lib/libcrypto/bn/bn_lib.c | 8 | ||||
| -rw-r--r-- | src/lib/libcrypto/bn/bn_print.c | 5 |
5 files changed, 17 insertions, 17 deletions
diff --git a/src/lib/libcrypto/bn/asm/bn-586.pl b/src/lib/libcrypto/bn/asm/bn-586.pl index 33f6125920..c4de4a2bee 100644 --- a/src/lib/libcrypto/bn/asm/bn-586.pl +++ b/src/lib/libcrypto/bn/asm/bn-586.pl | |||
| @@ -11,7 +11,7 @@ require "x86asm.pl"; | |||
| 11 | &bn_div_words("bn_div_words"); | 11 | &bn_div_words("bn_div_words"); |
| 12 | &bn_add_words("bn_add_words"); | 12 | &bn_add_words("bn_add_words"); |
| 13 | &bn_sub_words("bn_sub_words"); | 13 | &bn_sub_words("bn_sub_words"); |
| 14 | &bn_sub_part_words("bn_sub_part_words"); | 14 | #&bn_sub_part_words("bn_sub_part_words"); |
| 15 | 15 | ||
| 16 | &asm_finish(); | 16 | &asm_finish(); |
| 17 | 17 | ||
diff --git a/src/lib/libcrypto/bn/asm/x86_64-gcc.c b/src/lib/libcrypto/bn/asm/x86_64-gcc.c index b97b394661..450e8e4322 100644 --- a/src/lib/libcrypto/bn/asm/x86_64-gcc.c +++ b/src/lib/libcrypto/bn/asm/x86_64-gcc.c | |||
| @@ -142,7 +142,7 @@ void bn_sqr_words(BN_ULONG *r, BN_ULONG *a, int n) | |||
| 142 | BN_ULONG bn_div_words(BN_ULONG h, BN_ULONG l, BN_ULONG d) | 142 | BN_ULONG bn_div_words(BN_ULONG h, BN_ULONG l, BN_ULONG d) |
| 143 | { BN_ULONG ret,waste; | 143 | { BN_ULONG ret,waste; |
| 144 | 144 | ||
| 145 | asm ("divq %3" | 145 | asm ("divq %4" |
| 146 | : "=a"(ret),"=d"(waste) | 146 | : "=a"(ret),"=d"(waste) |
| 147 | : "a"(l),"d"(h),"g"(d) | 147 | : "a"(l),"d"(h),"g"(d) |
| 148 | : "cc"); | 148 | : "cc"); |
diff --git a/src/lib/libcrypto/bn/bn_lcl.h b/src/lib/libcrypto/bn/bn_lcl.h index 5614bc6164..253e195e23 100644 --- a/src/lib/libcrypto/bn/bn_lcl.h +++ b/src/lib/libcrypto/bn/bn_lcl.h | |||
| @@ -433,19 +433,18 @@ void bn_sqr_comba4(BN_ULONG *r,const BN_ULONG *a); | |||
| 433 | int bn_cmp_words(const BN_ULONG *a,const BN_ULONG *b,int n); | 433 | int bn_cmp_words(const BN_ULONG *a,const BN_ULONG *b,int n); |
| 434 | int bn_cmp_part_words(const BN_ULONG *a, const BN_ULONG *b, | 434 | int bn_cmp_part_words(const BN_ULONG *a, const BN_ULONG *b, |
| 435 | int cl, int dl); | 435 | int cl, int dl); |
| 436 | #if 0 | 436 | #ifdef BN_RECURSION |
| 437 | /* bn_mul.c rollback <appro> */ | 437 | void bn_mul_recursive(BN_ULONG *r, BN_ULONG *a, BN_ULONG *b, int n2, |
| 438 | void bn_mul_recursive(BN_ULONG *r,BN_ULONG *a,BN_ULONG *b,int n2, | 438 | BN_ULONG *t); |
| 439 | int dna,int dnb,BN_ULONG *t); | 439 | void bn_mul_part_recursive(BN_ULONG *r, BN_ULONG *a, BN_ULONG *b, int tn, |
| 440 | void bn_mul_part_recursive(BN_ULONG *r,BN_ULONG *a,BN_ULONG *b, | 440 | int n, BN_ULONG *t); |
| 441 | int n,int tna,int tnb,BN_ULONG *t); | ||
| 442 | #endif | ||
| 443 | void bn_sqr_recursive(BN_ULONG *r,const BN_ULONG *a, int n2, BN_ULONG *t); | ||
| 444 | void bn_mul_low_normal(BN_ULONG *r,BN_ULONG *a,BN_ULONG *b, int n); | ||
| 445 | void bn_mul_low_recursive(BN_ULONG *r,BN_ULONG *a,BN_ULONG *b,int n2, | 441 | void bn_mul_low_recursive(BN_ULONG *r,BN_ULONG *a,BN_ULONG *b,int n2, |
| 446 | BN_ULONG *t); | 442 | BN_ULONG *t); |
| 447 | void bn_mul_high(BN_ULONG *r,BN_ULONG *a,BN_ULONG *b,BN_ULONG *l,int n2, | 443 | void bn_mul_high(BN_ULONG *r,BN_ULONG *a,BN_ULONG *b,BN_ULONG *l,int n2, |
| 448 | BN_ULONG *t); | 444 | BN_ULONG *t); |
| 445 | void bn_sqr_recursive(BN_ULONG *r,const BN_ULONG *a, int n2, BN_ULONG *t); | ||
| 446 | #endif | ||
| 447 | void bn_mul_low_normal(BN_ULONG *r,BN_ULONG *a,BN_ULONG *b, int n); | ||
| 449 | 448 | ||
| 450 | #ifdef __cplusplus | 449 | #ifdef __cplusplus |
| 451 | } | 450 | } |
diff --git a/src/lib/libcrypto/bn/bn_lib.c b/src/lib/libcrypto/bn/bn_lib.c index fa0ff485ad..e1660450bc 100644 --- a/src/lib/libcrypto/bn/bn_lib.c +++ b/src/lib/libcrypto/bn/bn_lib.c | |||
| @@ -145,11 +145,11 @@ char *BN_options(void) | |||
| 145 | { | 145 | { |
| 146 | init++; | 146 | init++; |
| 147 | #ifdef BN_LLONG | 147 | #ifdef BN_LLONG |
| 148 | sprintf(data,"bn(%d,%d)",(int)sizeof(BN_ULLONG)*8, | 148 | BIO_snprintf(data,sizeof data,"bn(%d,%d)", |
| 149 | (int)sizeof(BN_ULONG)*8); | 149 | (int)sizeof(BN_ULLONG)*8,(int)sizeof(BN_ULONG)*8); |
| 150 | #else | 150 | #else |
| 151 | sprintf(data,"bn(%d,%d)",(int)sizeof(BN_ULONG)*8, | 151 | BIO_snprintf(data,sizeof data,"bn(%d,%d)", |
| 152 | (int)sizeof(BN_ULONG)*8); | 152 | (int)sizeof(BN_ULONG)*8,(int)sizeof(BN_ULONG)*8); |
| 153 | #endif | 153 | #endif |
| 154 | } | 154 | } |
| 155 | return(data); | 155 | return(data); |
diff --git a/src/lib/libcrypto/bn/bn_print.c b/src/lib/libcrypto/bn/bn_print.c index 5f46b1826c..0d942603b1 100644 --- a/src/lib/libcrypto/bn/bn_print.c +++ b/src/lib/libcrypto/bn/bn_print.c | |||
| @@ -119,6 +119,7 @@ char *BN_bn2dec(const BIGNUM *a) | |||
| 119 | } | 119 | } |
| 120 | if ((t=BN_dup(a)) == NULL) goto err; | 120 | if ((t=BN_dup(a)) == NULL) goto err; |
| 121 | 121 | ||
| 122 | #define BUF_REMAIN (num+3 - (size_t)(p - buf)) | ||
| 122 | p=buf; | 123 | p=buf; |
| 123 | lp=bn_data; | 124 | lp=bn_data; |
| 124 | if (t->neg) *(p++)='-'; | 125 | if (t->neg) *(p++)='-'; |
| @@ -139,12 +140,12 @@ char *BN_bn2dec(const BIGNUM *a) | |||
| 139 | /* We now have a series of blocks, BN_DEC_NUM chars | 140 | /* We now have a series of blocks, BN_DEC_NUM chars |
| 140 | * in length, where the last one needs truncation. | 141 | * in length, where the last one needs truncation. |
| 141 | * The blocks need to be reversed in order. */ | 142 | * The blocks need to be reversed in order. */ |
| 142 | sprintf(p,BN_DEC_FMT1,*lp); | 143 | BIO_snprintf(p,BUF_REMAIN,BN_DEC_FMT1,*lp); |
| 143 | while (*p) p++; | 144 | while (*p) p++; |
| 144 | while (lp != bn_data) | 145 | while (lp != bn_data) |
| 145 | { | 146 | { |
| 146 | lp--; | 147 | lp--; |
| 147 | sprintf(p,BN_DEC_FMT2,*lp); | 148 | BIO_snprintf(p,BUF_REMAIN,BN_DEC_FMT2,*lp); |
| 148 | while (*p) p++; | 149 | while (*p) p++; |
| 149 | } | 150 | } |
| 150 | } | 151 | } |
