diff options
Diffstat (limited to 'src/lib/libcrypto/man/BN_nist_mod_521.3')
-rw-r--r-- | src/lib/libcrypto/man/BN_nist_mod_521.3 | 113 |
1 files changed, 113 insertions, 0 deletions
diff --git a/src/lib/libcrypto/man/BN_nist_mod_521.3 b/src/lib/libcrypto/man/BN_nist_mod_521.3 new file mode 100644 index 0000000000..72dd4a7124 --- /dev/null +++ b/src/lib/libcrypto/man/BN_nist_mod_521.3 | |||
@@ -0,0 +1,113 @@ | |||
1 | .\" $OpenBSD: BN_nist_mod_521.3,v 1.1 2022/11/21 22:04:04 schwarze Exp $ | ||
2 | .\" | ||
3 | .\" Copyright (c) 2022 Ingo Schwarze <schwarze@openbsd.org> | ||
4 | .\" | ||
5 | .\" Permission to use, copy, modify, and distribute this software for any | ||
6 | .\" purpose with or without fee is hereby granted, provided that the above | ||
7 | .\" copyright notice and this permission notice appear in all copies. | ||
8 | .\" | ||
9 | .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES | ||
10 | .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF | ||
11 | .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR | ||
12 | .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES | ||
13 | .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN | ||
14 | .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF | ||
15 | .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | ||
16 | .\" | ||
17 | .Dd $Mdocdate: November 21 2022 $ | ||
18 | .Dt BN_NIST_MOD_521 3 | ||
19 | .Os | ||
20 | .Sh NAME | ||
21 | .Nm BN_nist_mod_192 , | ||
22 | .Nm BN_nist_mod_224 , | ||
23 | .Nm BN_nist_mod_256 , | ||
24 | .Nm BN_nist_mod_384 , | ||
25 | .Nm BN_nist_mod_521 | ||
26 | .Nd reduction modulo NIST-recommended primes | ||
27 | .Sh SYNOPSIS | ||
28 | .In openssl/bn.h | ||
29 | .Ft int | ||
30 | .Fo BN_nist_mod_192 | ||
31 | .Fa "BIGNUM *r" | ||
32 | .Fa "const BIGNUM *a" | ||
33 | .Fa "const BIGNUM *m" | ||
34 | .Fa "BN_CTX *ctx" | ||
35 | .Fc | ||
36 | .Ft int | ||
37 | .Fo BN_nist_mod_224 | ||
38 | .Fa "BIGNUM *r" | ||
39 | .Fa "const BIGNUM *a" | ||
40 | .Fa "const BIGNUM *m" | ||
41 | .Fa "BN_CTX *ctx" | ||
42 | .Fc | ||
43 | .Ft int | ||
44 | .Fo BN_nist_mod_256 | ||
45 | .Fa "BIGNUM *r" | ||
46 | .Fa "const BIGNUM *a" | ||
47 | .Fa "const BIGNUM *m" | ||
48 | .Fa "BN_CTX *ctx" | ||
49 | .Fc | ||
50 | .Ft int | ||
51 | .Fo BN_nist_mod_384 | ||
52 | .Fa "BIGNUM *r" | ||
53 | .Fa "const BIGNUM *a" | ||
54 | .Fa "const BIGNUM *m" | ||
55 | .Fa "BN_CTX *ctx" | ||
56 | .Fc | ||
57 | .Ft int | ||
58 | .Fo BN_nist_mod_521 | ||
59 | .Fa "BIGNUM *r" | ||
60 | .Fa "const BIGNUM *a" | ||
61 | .Fa "const BIGNUM *m" | ||
62 | .Fa "BN_CTX *ctx" | ||
63 | .Fc | ||
64 | .Sh DESCRIPTION | ||
65 | These functions are optimized versions of | ||
66 | .Xr BN_nnmod 3 | ||
67 | using precomputed tables. | ||
68 | They ignore their | ||
69 | .Fa m | ||
70 | argument and use the following moduli instead: | ||
71 | .Pp | ||
72 | .Bl -tag -width BN_nist_mod_521() -offset indent -compact | ||
73 | .It Fn BN_nist_mod_192 | ||
74 | .Xr BN_get0_nist_prime_192 3 | ||
75 | .It Fn BN_nist_mod_224 | ||
76 | .Xr BN_get0_nist_prime_224 3 | ||
77 | .It Fn BN_nist_mod_256 | ||
78 | .Xr BN_get0_nist_prime_256 3 | ||
79 | .It Fn BN_nist_mod_384 | ||
80 | .Xr BN_get0_nist_prime_384 3 | ||
81 | .It Fn BN_nist_mod_521 | ||
82 | .Xr BN_get0_nist_prime_521 3 | ||
83 | .El | ||
84 | .Pp | ||
85 | They reduce | ||
86 | .Fa a | ||
87 | modulo the respective prime number and place the non-negative remainder in | ||
88 | .Fa r . | ||
89 | .Pp | ||
90 | These functions are designed to save time when performing multiplications | ||
91 | in prime fields of these specific orders. | ||
92 | Consequently, if | ||
93 | .Fa a | ||
94 | is negative or larger than the square of the modulus being used, they call | ||
95 | .Xr BN_nnmod 3 | ||
96 | instead of attempting any optimization. | ||
97 | .Sh RETURN VALUES | ||
98 | These functions return 1 on success or 0 on error. | ||
99 | .Sh SEE ALSO | ||
100 | .Xr BN_get0_nist_prime_521 3 , | ||
101 | .Xr BN_nnmod 3 , | ||
102 | .Xr EC_GFp_nist_method 3 | ||
103 | .Sh STANDARDS | ||
104 | .Rs | ||
105 | .%T Digital Signature Standard (DSS) | ||
106 | .%I National Institute of Standards and Technology | ||
107 | .%R FIPS PUB 186-4 | ||
108 | .%U https://doi.org/10.6028/NIST.FIPS.186-4 | ||
109 | .%Q Information Technology Laboratory | ||
110 | .%C Gaithersburg, Maryland | ||
111 | .%D July 2013 | ||
112 | .%O Appendix D.1.2 Curves over Prime Fields | ||
113 | .Re | ||