diff options
| author | schwarze <> | 2021-12-20 15:02:13 +0000 | 
|---|---|---|
| committer | schwarze <> | 2021-12-20 15:02:13 +0000 | 
| commit | f14d20faee1233d876501169cdc7e9801e5484fd (patch) | |
| tree | df999b59360d7b816c57d645d85778fc3e53abad /src/lib/libcrypto/man | |
| parent | 822a802439865db1cb38349bf85eaa1f5ad0559f (diff) | |
| download | openbsd-f14d20faee1233d876501169cdc7e9801e5484fd.tar.gz openbsd-f14d20faee1233d876501169cdc7e9801e5484fd.tar.bz2 openbsd-f14d20faee1233d876501169cdc7e9801e5484fd.zip  | |
document BN_mod_add_quick(3), BN_mod_sub_quick(3), BN_mod_lshift(3),
BN_mod_lshift_quick(3), BN_mod_lshift1(3), and BN_mod_lshift1_quick(3)
Diffstat (limited to 'src/lib/libcrypto/man')
| -rw-r--r-- | src/lib/libcrypto/man/BN_add.3 | 118 | 
1 files changed, 115 insertions, 3 deletions
diff --git a/src/lib/libcrypto/man/BN_add.3 b/src/lib/libcrypto/man/BN_add.3 index e2f1642aa7..ab2d343321 100644 --- a/src/lib/libcrypto/man/BN_add.3 +++ b/src/lib/libcrypto/man/BN_add.3  | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | .\" $OpenBSD: BN_add.3,v 1.15 2021/12/19 18:39:32 schwarze Exp $ | 1 | .\" $OpenBSD: BN_add.3,v 1.16 2021/12/20 15:02:13 schwarze Exp $ | 
| 2 | .\" full merge up to: OpenSSL e9b77246 Jan 20 19:58:49 2017 +0100 | 2 | .\" full merge up to: OpenSSL e9b77246 Jan 20 19:58:49 2017 +0100 | 
| 3 | .\" | 3 | .\" | 
| 4 | .\" This file is a derived work. | 4 | .\" This file is a derived work. | 
| @@ -66,7 +66,7 @@ | |||
| 66 | .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED | 66 | .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED | 
| 67 | .\" OF THE POSSIBILITY OF SUCH DAMAGE. | 67 | .\" OF THE POSSIBILITY OF SUCH DAMAGE. | 
| 68 | .\" | 68 | .\" | 
| 69 | .Dd $Mdocdate: December 19 2021 $ | 69 | .Dd $Mdocdate: December 20 2021 $ | 
| 70 | .Dt BN_ADD 3 | 70 | .Dt BN_ADD 3 | 
| 71 | .Os | 71 | .Os | 
| 72 | .Sh NAME | 72 | .Sh NAME | 
| @@ -80,9 +80,15 @@ | |||
| 80 | .Nm BN_mod , | 80 | .Nm BN_mod , | 
| 81 | .Nm BN_nnmod , | 81 | .Nm BN_nnmod , | 
| 82 | .Nm BN_mod_add , | 82 | .Nm BN_mod_add , | 
| 83 | .Nm BN_mod_add_quick , | ||
| 83 | .Nm BN_mod_sub , | 84 | .Nm BN_mod_sub , | 
| 85 | .Nm BN_mod_sub_quick , | ||
| 84 | .Nm BN_mod_mul , | 86 | .Nm BN_mod_mul , | 
| 85 | .Nm BN_mod_sqr , | 87 | .Nm BN_mod_sqr , | 
| 88 | .Nm BN_mod_lshift , | ||
| 89 | .Nm BN_mod_lshift_quick , | ||
| 90 | .Nm BN_mod_lshift1 , | ||
| 91 | .Nm BN_mod_lshift1_quick , | ||
| 86 | .Nm BN_exp , | 92 | .Nm BN_exp , | 
| 87 | .Nm BN_mod_exp , | 93 | .Nm BN_mod_exp , | 
| 88 | .\" The following are public, but intentionally undocumented for now: | 94 | .\" The following are public, but intentionally undocumented for now: | 
| @@ -164,6 +170,13 @@ | |||
| 164 | .Fa "BN_CTX *ctx" | 170 | .Fa "BN_CTX *ctx" | 
| 165 | .Fc | 171 | .Fc | 
| 166 | .Ft int | 172 | .Ft int | 
| 173 | .Fo BN_mod_add_quick | ||
| 174 | .Fa "BIGNUM *r" | ||
| 175 | .Fa "const BIGNUM *a" | ||
| 176 | .Fa "const BIGNUM *b" | ||
| 177 | .Fa "const BIGNUM *m" | ||
| 178 | .Fc | ||
| 179 | .Ft int | ||
| 167 | .Fo BN_mod_sub | 180 | .Fo BN_mod_sub | 
| 168 | .Fa "BIGNUM *r" | 181 | .Fa "BIGNUM *r" | 
| 169 | .Fa "const BIGNUM *a" | 182 | .Fa "const BIGNUM *a" | 
| @@ -172,6 +185,13 @@ | |||
| 172 | .Fa "BN_CTX *ctx" | 185 | .Fa "BN_CTX *ctx" | 
| 173 | .Fc | 186 | .Fc | 
| 174 | .Ft int | 187 | .Ft int | 
| 188 | .Fo BN_mod_sub_quick | ||
| 189 | .Fa "BIGNUM *r" | ||
| 190 | .Fa "const BIGNUM *a" | ||
| 191 | .Fa "const BIGNUM *b" | ||
| 192 | .Fa "const BIGNUM *m" | ||
| 193 | .Fc | ||
| 194 | .Ft int | ||
| 175 | .Fo BN_mod_mul | 195 | .Fo BN_mod_mul | 
| 176 | .Fa "BIGNUM *r" | 196 | .Fa "BIGNUM *r" | 
| 177 | .Fa "const BIGNUM *a" | 197 | .Fa "const BIGNUM *a" | 
| @@ -187,6 +207,34 @@ | |||
| 187 | .Fa "BN_CTX *ctx" | 207 | .Fa "BN_CTX *ctx" | 
| 188 | .Fc | 208 | .Fc | 
| 189 | .Ft int | 209 | .Ft int | 
| 210 | .Fo BN_mod_lshift | ||
| 211 | .Fa "BIGNUM *r" | ||
| 212 | .Fa "const BIGNUM *a" | ||
| 213 | .Fa "int n" | ||
| 214 | .Fa "const BIGNUM *m" | ||
| 215 | .Fa "BN_CTX *ctx" | ||
| 216 | .Fc | ||
| 217 | .Ft int | ||
| 218 | .Fo BN_mod_lshift_quick | ||
| 219 | .Fa "BIGNUM *r" | ||
| 220 | .Fa "const BIGNUM *a" | ||
| 221 | .Fa "int n" | ||
| 222 | .Fa "const BIGNUM *m" | ||
| 223 | .Fc | ||
| 224 | .Ft int | ||
| 225 | .Fo BN_mod_lshift1 | ||
| 226 | .Fa "BIGNUM *r" | ||
| 227 | .Fa "const BIGNUM *a" | ||
| 228 | .Fa "const BIGNUM *m" | ||
| 229 | .Fa "BN_CTX *ctx" | ||
| 230 | .Fc | ||
| 231 | .Ft int | ||
| 232 | .Fo BN_mod_lshift1_quick | ||
| 233 | .Fa "BIGNUM *r" | ||
| 234 | .Fa "const BIGNUM *a" | ||
| 235 | .Fa "const BIGNUM *m" | ||
| 236 | .Fc | ||
| 237 | .Ft int | ||
| 190 | .Fo BN_exp | 238 | .Fo BN_exp | 
| 191 | .Fa "BIGNUM *r" | 239 | .Fa "BIGNUM *r" | 
| 192 | .Fa "const BIGNUM *a" | 240 | .Fa "const BIGNUM *a" | 
| @@ -368,6 +416,18 @@ modulo | |||
| 368 | and places the non-negative result in | 416 | and places the non-negative result in | 
| 369 | .Fa r . | 417 | .Fa r . | 
| 370 | .Pp | 418 | .Pp | 
| 419 | .Fn BN_mod_add_quick | ||
| 420 | is a variant of | ||
| 421 | .Fn BN_mod_add | ||
| 422 | that requires | ||
| 423 | .Fa a | ||
| 424 | and | ||
| 425 | .Fa b | ||
| 426 | to both be non-negative and smaller than | ||
| 427 | .Fa m . | ||
| 428 | If any of these constraints are violated, | ||
| 429 | it silently produces wrong results. | ||
| 430 | .Pp | ||
| 371 | .Fn BN_mod_sub | 431 | .Fn BN_mod_sub | 
| 372 | subtracts | 432 | subtracts | 
| 373 | .Fa b | 433 | .Fa b | 
| @@ -378,6 +438,18 @@ modulo | |||
| 378 | and places the non-negative result in | 438 | and places the non-negative result in | 
| 379 | .Fa r . | 439 | .Fa r . | 
| 380 | .Pp | 440 | .Pp | 
| 441 | .Fn BN_mod_sub_quick | ||
| 442 | is a variant of | ||
| 443 | .Fn BN_mod_sub | ||
| 444 | that requires | ||
| 445 | .Fa a | ||
| 446 | and | ||
| 447 | .Fa b | ||
| 448 | to both be non-negative and smaller than | ||
| 449 | .Fa m . | ||
| 450 | If any of these constraints are violated, | ||
| 451 | it silently produces wrong results. | ||
| 452 | .Pp | ||
| 381 | .Fn BN_mod_mul | 453 | .Fn BN_mod_mul | 
| 382 | multiplies | 454 | multiplies | 
| 383 | .Fa a | 455 | .Fa a | 
| @@ -407,6 +479,40 @@ modulo | |||
| 407 | and places the result in | 479 | and places the result in | 
| 408 | .Fa r . | 480 | .Fa r . | 
| 409 | .Pp | 481 | .Pp | 
| 482 | .Fn BN_mod_lshift | ||
| 483 | shifts | ||
| 484 | .Fa a | ||
| 485 | left by | ||
| 486 | .Fa n | ||
| 487 | bits, reduces the result modulo | ||
| 488 | .Fa m , | ||
| 489 | and places the non-negative remainder in | ||
| 490 | .Fa r | ||
| 491 | .Pq Li r=a*2^n mod m . | ||
| 492 | .Pp | ||
| 493 | .Fn BN_mod_lshift1 | ||
| 494 | shifts | ||
| 495 | .Fa a | ||
| 496 | left by one bit, reduces the result modulo | ||
| 497 | .Fa m , | ||
| 498 | and places the non-negative remainder in | ||
| 499 | .Fa r | ||
| 500 | .Pq Li r=a*2 mod m . | ||
| 501 | .Pp | ||
| 502 | .Fn BN_mod_lshift_quick | ||
| 503 | and | ||
| 504 | .Fn BN_mod_lshift1_quick | ||
| 505 | are variants of | ||
| 506 | .Fn BN_mod_lshift | ||
| 507 | and | ||
| 508 | .Fn BN_mod_lshift1 , | ||
| 509 | respectively, that require | ||
| 510 | .Fa a | ||
| 511 | to be non-negative and less than | ||
| 512 | .Fa m . | ||
| 513 | If either of these constraints is violated, they sometimes fail | ||
| 514 | and sometimes silently produce wrong results. | ||
| 515 | .Pp | ||
| 410 | .Fn BN_exp | 516 | .Fn BN_exp | 
| 411 | raises | 517 | raises | 
| 412 | .Fa a | 518 | .Fa a | 
| @@ -502,9 +608,15 @@ first appeared in SSLeay 0.9.1 and have been available since | |||
| 502 | .Pp | 608 | .Pp | 
| 503 | .Fn BN_nnmod , | 609 | .Fn BN_nnmod , | 
| 504 | .Fn BN_mod_add , | 610 | .Fn BN_mod_add , | 
| 611 | .Fn BN_mod_add_quick , | ||
| 505 | .Fn BN_mod_sub , | 612 | .Fn BN_mod_sub , | 
| 613 | .Fn BN_mod_sub_quick , | ||
| 614 | .Fn BN_mod_sqr , | ||
| 615 | .Fn BN_mod_lshift , | ||
| 616 | .Fn BN_mod_lshift_quick , | ||
| 617 | .Fn BN_mod_lshift1 , | ||
| 506 | and | 618 | and | 
| 507 | .Fn BN_mod_sqr | 619 | .Fn BN_mod_lshift1_quick | 
| 508 | first appeared in OpenSSL 0.9.7 and have been available since | 620 | first appeared in OpenSSL 0.9.7 and have been available since | 
| 509 | .Ox 3.2 . | 621 | .Ox 3.2 . | 
| 510 | .Sh BUGS | 622 | .Sh BUGS | 
