summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>2022-03-14 08:51:56 +0100
committerWerner Koch <wk@gnupg.org>2022-03-28 08:29:43 +0200
commit951b7d987cdb2d68a597aaea141f0c4628d0a43e (patch)
treeb86891bbde5b5c2f4eb57860d24f69fd2f8cfcf8 /doc
parent26ac5e30018f2bf0a973b3a45410e6a0c8067f0e (diff)
downloadlibgcrypt-951b7d987cdb2d68a597aaea141f0c4628d0a43e.tar.gz
doc: Typo and grammar fixes.
-- GnuPG-bug-id: 5596 Contributed-by: Mikhail Ryazanov
Diffstat (limited to 'doc')
-rw-r--r--doc/gcrypt.texi402
1 files changed, 201 insertions, 201 deletions
diff --git a/doc/gcrypt.texi b/doc/gcrypt.texi
index 8dd464b2..b02ba442 100644
--- a/doc/gcrypt.texi
+++ b/doc/gcrypt.texi
@@ -169,7 +169,7 @@ Anybody can use, modify, and redistribute it under the terms of the GNU
Lesser General Public License (@pxref{Library Copying}). Note, that
some parts (which are in general not needed by applications) are subject
to the terms of the GNU General Public License (@pxref{Copying}); please
-see the README file of the distribution for of list of these parts.
+see the README file of the distribution for the list of these parts.
@item It encapsulates the low level cryptography
Libgcrypt provides a high level interface to cryptographic
@@ -270,7 +270,7 @@ gcc -c foo.c `libgcrypt-config --cflags`
@end example
Adding the output of @samp{libgcrypt-config --cflags} to the
-compiler’s command line will ensure that the compiler can find the
+compiler's command line will ensure that the compiler can find the
Libgcrypt header file.
A similar problem occurs when linking the program with the library.
@@ -317,7 +317,7 @@ Additionally, the function defines @code{LIBGCRYPT_CFLAGS} to the
flags needed for compilation of the program to find the
@file{gcrypt.h} header file, and @code{LIBGCRYPT_LIBS} to the linker
flags needed to link the program to the Libgcrypt library. If the
-used helper script does not match the target type you are building for
+used helper script does not match the target type you are building for,
a warning is printed and the string @code{libgcrypt} is appended to the
variable @code{gpg_config_script_warn}.
@@ -567,7 +567,7 @@ initialization (i.e. before @code{gcry_check_version}).
@anchor{hardware features}
Libgcrypt makes use of certain hardware features. If the use of a
-feature is not desired it may be either be disabled by a program or
+feature is not desired, it may be disabled either by a program or
globally using a configuration file. The currently supported features
are
@@ -613,11 +613,11 @@ to be used on a single line. Empty lines, white space, and lines
prefixed with a hash mark are ignored. The file should be world
readable.
-To disable a feature specifically for a program that program must tell
+To disable a feature specifically for a program, that program must tell
it Libgcrypt before before calling @code{gcry_check_version}.
Example:@footnote{NB. Libgcrypt uses the RDRAND feature only as one
source of entropy. A CPU with a broken RDRAND will thus not
-compromise of the random number generator}
+compromise the random number generator}
@example
gcry_control (GCRYCTL_DISABLE_HWF, "intel-rdrand", NULL);
@@ -699,7 +699,7 @@ This command disables the use of the mlock call for secure memory.
Disabling the use of mlock may for example be done if an encrypted
swap space is in use. This command should be executed right after
@code{gcry_check_version}. Note that by using functions like
-gcry_xmalloc_secure and gcry_mpi_snew Libgcrypt may expand the secure
+@code{gcry_xmalloc_secure} and @code{gcry_mpi_snew} Libgcrypt may expand the secure
memory pool with memory which lacks the property of not being swapped
out to disk (but will still be zeroed out on free).
@@ -737,7 +737,7 @@ encrypted swap space.
@item GCRYCTL_TERM_SECMEM; Arguments: none
This command zeroises the secure memory and destroys the handler. The
secure memory pool may not be used anymore after running this command.
-If the secure memory pool as already been destroyed, this command has
+If the secure memory pool has already been destroyed, this command has
no effect. Applications might want to run this command from their
exit handler to make sure that the secure memory gets properly
destroyed. This command is not necessarily thread-safe but that
@@ -789,7 +789,7 @@ and clock of the application, and drain the system's entropy pool to
reduce the "up to 16 bytes" above to 0. Then the dependencies of the
initial states of the pools are completely known. Note that this is not
an issue if random of @code{GCRY_VERY_STRONG_RANDOM} quality is
-requested as in this case enough extra entropy gets mixed. It is also
+requested, as in this case enough extra entropy gets mixed. It is also
not an issue when using rndgetentropy or rndoldlinux module, because the
module guarantees to read full 16 bytes and thus there is no
way for an attacker without kernel access to control these 16 bytes.
@@ -804,7 +804,7 @@ re-opened. On non-Unix systems this control code is ignored.
@item GCRYCTL_SET_VERBOSITY; Arguments: int level
This command sets the verbosity of the logging. A level of 0 disables
-all extra logging whereas positive numbers enable more verbose logging.
+all extra logging, whereas positive numbers enable more verbose logging.
The level may be changed at any time but be aware that no memory
synchronization is done so the effect of this command might not
immediately show up in other threads. This command may even be used
@@ -832,15 +832,15 @@ This command does nothing. It exists only for backward compatibility.
This command returns true if the library has been basically initialized.
Such a basic initialization happens implicitly with many commands to get
certain internal subsystems running. The common and suggested way to
-do this basic initialization is by calling gcry_check_version.
+do this basic initialization is by calling @code{gcry_check_version}.
@item GCRYCTL_INITIALIZATION_FINISHED; Arguments: none
This command tells the library that the application has finished the
initialization.
@item GCRYCTL_INITIALIZATION_FINISHED_P; Arguments: none
-This command returns true if the command@*
-GCRYCTL_INITIALIZATION_FINISHED has already been run.
+This command returns true if the command
+@code{GCRYCTL_INITIALIZATION_FINISHED} has already been run.
@item GCRYCTL_SET_THREAD_CBS; Arguments: struct ath_ops *ath_ops
This command is obsolete since version 1.6.
@@ -860,14 +860,14 @@ proper random device.
@item GCRYCTL_PRINT_CONFIG; Arguments: FILE *stream
This command dumps information pertaining to the configuration of the
-library to the given stream. If NULL is given for @var{stream}, the log
+library to the given stream. If @code{NULL} is given for @var{stream}, the log
system is used. This command may be used before the initialization has
been finished but not before a @code{gcry_check_version}. Note that
the macro @code{estream_t} can be used instead of @code{gpgrt_stream_t}.
@item GCRYCTL_OPERATIONAL_P; Arguments: none
This command returns true if the library is in an operational state.
-This information makes only sense in FIPS mode. In contrast to other
+This information makes sense only in FIPS mode. In contrast to other
functions, this is a pure test function and won't put the library into
FIPS mode or change the internal state. This command may be used before
the initialization has been finished but not before a @code{gcry_check_version}.
@@ -894,7 +894,7 @@ already in FIPS mode, a self-test is triggered and thus the library will
be put into operational state. This command may be used before a call
to @code{gcry_check_version} and that is actually the recommended way to let an
application switch the library into FIPS mode. Note that Libgcrypt will
-reject an attempt to switch to fips mode during or after the initialization.
+reject an attempt to switch to FIPS mode during or after the initialization.
@item GCRYCTL_NO_FIPS_MODE; Arguments: none
Running this command puts the library into non-FIPS mode. This
@@ -912,7 +912,7 @@ generator. They are only advisory because libraries may not know what
an application actually wants or vice versa. Thus Libgcrypt employs a
priority check to select the actually used RNG. If an applications
selects a lower priority RNG but a library requests a higher priority
-RNG Libgcrypt will switch to the higher priority RNG. Applications
+RNG, Libgcrypt will switch to the higher priority RNG. Applications
and libraries should use these control codes before
@code{gcry_check_version}. The available generators are:
@table @code
@@ -920,7 +920,7 @@ and libraries should use these control codes before
A conservative standard generator based on the ``Continuously Seeded
Pseudo Random Number Generator'' designed by Peter Gutmann.
@item GCRY_RNG_TYPE_FIPS
-A deterministic random number generator conforming to he document
+A deterministic random number generator conforming to the document
``NIST-Recommended Random Number Generator Based on ANSI X9.31
Appendix A.2.4 Using the 3-Key Triple DES and AES Algorithms''
(2005-01-31). This implementation uses the AES variant.
@@ -1073,7 +1073,7 @@ A list of important error sources can be found in the next section.
@deftp {Data type} {gcry_error_t}
The @code{gcry_error_t} type is an alias for the @code{libgpg-error}
type @code{gpg_error_t}. An error value like this has always two
-components, an error code and an error source. Both together form the
+components: an error code and an error source. Both together form the
error value.
Thus, the error value can not be directly compared against an error
@@ -1444,7 +1444,7 @@ Fermat test on 10 candidates failed.
@item :
Restart with a new random value.
@item +
-Rabin Miller test passed.
+Rabin-Miller test passed.
@end table
@end table
@@ -1482,7 +1482,7 @@ general not recommended because the standard Libgcrypt allocation
functions are guaranteed to zeroize memory if needed.
This function may be used only during initialization and may not be
-used in fips mode.
+used in FIPS mode.
@end deftypefun
@@ -1568,7 +1568,7 @@ This is the IDEA algorithm.
@cindex Triple-DES
@cindex DES-EDE
@cindex Digital Encryption Standard
-Triple-DES with 3 Keys as EDE. The key size of this algorithm is 168 bits but
+Triple-DES with 3 keys as EDE. The key size of this algorithm is 168 bits but
you have to pass 192 bits because the most significant bits of each byte
are ignored.
@@ -1620,7 +1620,7 @@ avoid a couple of weaknesses.
@item GCRY_CIPHER_DES
@cindex DES
-Standard DES with a 56 bit key. You need to pass 64 bit but the high
+Standard DES with a 56 bit key. You need to pass 64 bits but the high
bits of each byte are ignored. Note, that this is a weak algorithm
which can be broken in reasonable time using a brute force approach.
@@ -1695,9 +1695,9 @@ Electronic Codebook mode.
@item GCRY_CIPHER_MODE_CFB
@item GCRY_CIPHER_MODE_CFB8
@cindex CFB, Cipher Feedback mode
-Cipher Feedback mode. For GCRY_CIPHER_MODE_CFB the shift size equals
+Cipher Feedback mode. For @code{GCRY_CIPHER_MODE_CFB} the shift size equals
the block size of the cipher (e.g. for AES it is CFB-128). For
-GCRY_CIPHER_MODE_CFB8 the shift size is 8 bit but that variant is not
+@code{GCRY_CIPHER_MODE_CFB8} the shift size is 8 bits but that variant is not
yet available.
@item GCRY_CIPHER_MODE_CBC
@@ -1720,12 +1720,12 @@ Counter mode.
This mode is used to implement the AES-Wrap algorithm according to
RFC-3394. It may be used with any 128 bit block length algorithm,
however the specs require one of the 3 AES algorithms. These special
-conditions apply: If @code{gcry_cipher_setiv} has not been used the
-standard IV is used; if it has been used the lower 64 bit of the IV
+conditions apply: If @code{gcry_cipher_setiv} has not been used, the
+standard IV is used; if it has been used, the lower 64 bits of the IV
are used as the Alternative Initial Value. On encryption the provided
-output buffer must be 64 bit (8 byte) larger than the input buffer;
+output buffer must be 64 bits (8 bytes) larger than the input buffer;
in-place encryption is still allowed. On decryption the output buffer
-may be specified 64 bit (8 byte) shorter than then input buffer. As
+may be specified 64 bits (8 bytes) shorter than then input buffer. As
per specs the input length must be at least 128 bits and the length
must be a multiple of 64 bits.
@@ -1751,10 +1751,10 @@ stream cipher.
@cindex OCB, OCB3
OCB is an Authenticated Encryption with Associated Data (AEAD) block
cipher mode, which is specified in RFC-7253. Supported tag lengths
-are 128, 96, and 64 bit with the default being 128 bit. To switch to
-a different tag length @code{gcry_cipher_ctl} using the command
+are 128, 96, and 64 bits with the default being 128 bits. To switch to
+a different tag length, @code{gcry_cipher_ctl} using the command
@code{GCRYCTL_SET_TAGLEN} and the address of an @code{int} variable
-set to 12 (for 96 bit) or 8 (for 64 bit) provided for the
+set to 12 (for 96 bits) or 8 (for 64 bits) provided for the
@code{buffer} argument and @code{sizeof(int)} for @code{buflen}.
Note that the use of @code{gcry_cipher_final} is required.
@@ -1835,7 +1835,7 @@ other cipher functions and returns a handle to it in `hd'. In case of
an error, an according error code is returned.
The ID of algorithm to use must be specified via @var{algo}. See
-@ref{Available ciphers}, for a list of supported ciphers and the
+@ref{Available ciphers} for a list of supported ciphers and the
according constants.
Besides using the constants directly, the function
@@ -1843,7 +1843,7 @@ Besides using the constants directly, the function
an algorithm into the according numeric ID.
The cipher mode to use must be specified via @var{mode}. See
-@ref{Available cipher modes}, for a list of supported cipher modes
+@ref{Available cipher modes} for a list of supported cipher modes
and the according constants. Note that some modes are incompatible
with some algorithms - in particular, stream mode
(@code{GCRY_CIPHER_MODE_STREAM}) only works with stream ciphers.
@@ -1875,13 +1875,13 @@ See @code{gcry_cipher_sync}.
@item GCRY_CIPHER_CBC_CTS
@cindex cipher text stealing
Enable cipher text stealing (CTS) for the CBC mode. Cannot be used
-simultaneous as GCRY_CIPHER_CBC_MAC. CTS mode makes it possible to
+simultaneously with GCRY_CIPHER_CBC_MAC. CTS mode makes it possible to
transform data of almost arbitrary size (only limitation is that it
must be greater than the algorithm's block size).
@item GCRY_CIPHER_CBC_MAC
@cindex CBC-MAC
Compute CBC-MAC keyed checksums. This is the same as CBC mode, but
-only output the last block. Cannot be used simultaneous as
+only output the last block. Cannot be used simultaneously with
GCRY_CIPHER_CBC_CTS.
@end table
@end deftypefun
@@ -1932,16 +1932,16 @@ needs to be called after setting the key.
Set the counter vector used for encryption or decryption. The counter
is passed as the buffer @var{c} of length @var{l} bytes and copied to
internal data structures. The function checks that the counter
-matches the requirement of the selected algorithm (i.e., it must be
+matches the requirement of the selected algorithm (i.e., it must have
the same size as the block size).
@end deftypefun
@deftypefun gcry_error_t gcry_cipher_reset (gcry_cipher_hd_t @var{h})
Set the given handle's context back to the state it had after the last
-call to gcry_cipher_setkey and clear the initialization vector.
+call to @code{gcry_cipher_setkey} and clear the initialization vector.
-Note that gcry_cipher_reset is implemented as a macro.
+Note that @code{gcry_cipher_reset} is implemented as a macro.
@end deftypefun
Authenticated Encryption with Associated Data (AEAD) block cipher
@@ -2067,7 +2067,7 @@ some places. The following function is used for this:
Perform the OpenPGP sync operation on context @var{h}. Note that this
is a no-op unless the context was created with the flag
-@code{GCRY_CIPHER_ENABLE_SYNC}
+@code{GCRY_CIPHER_ENABLE_SYNC}.
@end deftypefun
Some of the described functions are implemented as macros utilizing a
@@ -2079,7 +2079,7 @@ directly but there is nothing which would inhibit it:
@code{gcry_cipher_ctl} controls various aspects of the cipher module and
specific cipher contexts. Usually some more specialized functions or
macros are used for this purpose. The semantics of the function and its
-parameters depends on the the command @var{cmd} and the passed context
+parameters depends on the command @var{cmd} and the passed context
handle @var{h}. Please see the comments in the source code
(@code{src/global.c}) for details.
@end deftypefun
@@ -2096,7 +2096,7 @@ information about a cipher context or the cipher module in general.
@item GCRYCTL_GET_TAGLEN:
Return the length of the tag for an AE algorithm mode. An error is
returned for modes which do not support a tag. @var{buffer} must be
-given as NULL. On success the result is stored @var{nbytes}. The
+given as @code{NULL}. On success the result is stored @var{nbytes}. The
taglen is returned in bytes.
@end table
@@ -2157,7 +2157,7 @@ length is returned. On error @code{0} is returned. The key length is
returned as number of octets.
This is a convenience functions which should be preferred over
-@code{gcry_cipher_algo_info} because it allows for proper type
+@code{gcry_cipher_algo_info} because it allows proper type
checking.
@end deftypefun
@c end gcry_cipher_get_algo_keylen
@@ -2168,7 +2168,7 @@ This functions returns the block-length of the algorithm @var{algo}
counted in octets. On error @code{0} is returned.
This is a convenience functions which should be preferred over
-@code{gcry_cipher_algo_info} because it allows for proper type
+@code{gcry_cipher_algo_info} because it allows proper type
checking.
@end deftypefun
@c end gcry_cipher_get_algo_blklen
@@ -2186,7 +2186,7 @@ not be used to test for the availability of an algorithm.
@code{gcry_cipher_map_name} returns the algorithm identifier for the
cipher algorithm described by the string @var{name}. If this algorithm
-is not available @code{0} is returned.
+is not available, @code{0} is returned.
@end deftypefun
@deftypefun int gcry_cipher_mode_from_oid (const char *@var{string})
@@ -2256,7 +2256,7 @@ uppercase
@iftex
italics
@end iftex
-indicate parameters whereas lowercase words are literals.
+indicate parameters, whereas lowercase words are literals.
Note that all MPI (multi-precision-integers) values are expected to be in
@code{GCRYMPI_FMT_USG} format. An easy way to create S-expressions is
@@ -2312,10 +2312,10 @@ RSA secret prime @math{q} with @math{p < q}.
Multiplicative inverse @math{u = p^{-1} \bmod q}.
@end table
-For signing and decryption the parameters @math{(p, q, u)} are optional
+For signing and decryption, the parameters @math{(p, q, u)} are optional
but greatly improve the performance. Either all of these optional
parameters must be given or none of them. They are mandatory for
-gcry_pk_testkey.
+@code{gcry_pk_testkey}.
Note that OpenSSL uses slighly different parameters: @math{q < p} and
@math{u = q^{-1} \bmod p}. To use these parameters you will need to
@@ -2361,7 +2361,7 @@ DSA public key value @math{y = g^x \bmod p}.
DSA secret exponent x.
@end table
-The public key is similar with "private-key" replaced by "public-key"
+The public key is similar, with "private-key" replaced by "public-key"
and no @var{x-mpi}.
@@ -2405,9 +2405,9 @@ general only support uncompressed points, thus the first byte needs to
be @code{0x04}. However ``EdDSA'' describes its own compression
scheme which is used by default; the non-standard first byte
@code{0x40} may optionally be used to explicit flag the use of the
-algorithm’s native compression method.
+algorithm's native compression method.
-The public key is similar with "private-key" replaced by "public-key"
+The public key is similar, with "private-key" replaced by "public-key"
and no @var{d-mpi}.
If the domain parameters are well-known, the name of this curve may be
@@ -2600,14 +2600,14 @@ are known:
@itemx nocomp
@cindex comp
@cindex nocomp
-If supported by the algorithm and curve the @code{comp} flag requests
+If supported by the algorithm and curve, the @code{comp} flag requests
that points are returned in compact (compressed) representation. The
@code{nocomp} flag requests that points are returned with full
coordinates. The default depends on the the algorithm and curve. The
compact representation requires a small overhead before a point can be
-used but halves the size of a to be conveyed public key. If
-@code{comp} is used with the ``EdDSA'' algorithm the key generation
-prefix the public key with a @code{0x40} byte.
+used but halves the size of a public key to be conveyed. If
+@code{comp} is used with the ``EdDSA'' algorithm, the key generation
+prefixes the public key with a @code{0x40} byte.
@item pkcs1
@cindex PKCS1
@@ -2647,7 +2647,7 @@ domain parameters of the public or private key.
@item transient-key
@cindex transient-key
This flag is only meaningful for RSA, DSA, and ECC key generation. If
-given the key is created using a faster and a somewhat less secure
+given, the key is created using a faster and a somewhat less secure
random number generator. This flag may be used for keys which are
only used for a short time or per-message and do not require full
cryptographic strength.
@@ -2793,7 +2793,7 @@ type 2 padding, or @code{oaep} for RSA-OAEP padding.
@noindent
The function returns 0 on success or an error code. The variable at the
-address of @var{r_plain} will be set to NULL on error or receive the
+address of @var{r_plain} will be set to @code{NULL} on error or receive the
decrypted value on success. The format of @var{r_plain} is a
simple S-expression part (i.e. not a valid one) with just one MPI if
there was no @code{flags} element in @var{data}; if at least an empty
@@ -2860,10 +2860,10 @@ For DSA the input data is expected in this format:
@noindent
Here, the data to be signed is directly given as an @var{MPI}. It is
-expect that this MPI is the the hash value. For the standard DSA
+expect that this MPI is the hash value. For the standard DSA,
using a MPI is not a problem in regard to leading zeroes because the
hash value is directly used as an MPI. For better standard
-conformance it would be better to explicit use a memory string (like
+conformance it would be better to explicitly use a memory string (like
with pkcs1) but that is currently not supported. However, for
deterministic DSA as specified in RFC6979 this can't be used. Instead
the following input is expected.
@@ -3006,8 +3006,8 @@ On success the function returns 0 and stores the new context object at
@section Dedicated functions for elliptic curves.
@noindent
-The S-expression based interface is for certain operations on elliptic
-curves not optimal. Thus a few special functions are implemented to
+The S-expression based interface is not optimal for certain operations on elliptic
+curves. Thus a few special functions are implemented to
support common operations on curves with one of these assigned curve
ids:
@@ -3030,7 +3030,7 @@ Returns the length in bytes of a point on the curve with the id
@w{const unsigned char *@var{point}})
This function computes the scalar multiplication on the Montgomery
-form of the curve with id @var{curveid}. If @var{point} is NULL the
+form of the curve with id @var{curveid}. If @var{point} is @code{NULL}, the
base point of the curve is used. The caller needs to provide a large
enough buffer for @var{result} and a valid @var{scalar} and
@var{point}.
@@ -3068,7 +3068,7 @@ Note that this is implemented as a macro.
@deftypefun {unsigned int} gcry_pk_get_nbits (gcry_sexp_t @var{key})
Return what is commonly referred as the key length for the given
-public or private in @var{key}.
+public or private key in @var{key}.
@end deftypefun
@deftypefun {unsigned char *} gcry_pk_get_keygrip (@w{gcry_sexp_t @var{key}}, @w{unsigned char *@var{array}})
@@ -3118,7 +3118,7 @@ Unless you need to test for the allowed usage, it is in general better
to use the macro gcry_pk_test_algo instead.
@item GCRYCTL_GET_ALGO_USAGE:
-Return the usage flags for the given algorithm. An invalid algorithm
+Return the usage flags for the given algorithm. For an invalid algorithm
return 0. Disabled algorithms are ignored here because we
want to know whether the algorithm is at all capable of a certain usage.
@@ -3233,9 +3233,9 @@ and that the usual C prefixes are considered (e.g. 017 gives 15).
@item qbits @var{n}
-This is only meanigful for DSA keys. If it is given the DSA key is
-generated with a Q parameyer of size @var{n} bits. If it is not given
-or zero Q is deduced from NBITS in this way:
+This is only meanigful for DSA keys. If it is given, the DSA key is
+generated with a Q parameter of size @var{n} bits. If it is not given
+or zero, Q is deduced from @var{nbits} in this way:
@table @samp
@item 512 <= N <= 1024
Q = 160
@@ -3249,11 +3249,11 @@ Q = 384
Q = 512
@end table
Note that in this case only the values for N, as given in the table,
-are allowed. When specifying Q all values of N in the range 512 to
+are allowed. When specifying Q, all values of N in the range 512 to
15680 are valid as long as they are multiples of 8.
@item domain @var{list}
-This is only meaningful for DLP algorithms. If specified keys are
+This is only meaningful for DLP algorithms. If specified, keys are
generated with domain parameters taken from this list. The exact
format of this parameter depends on the actual algorithm. It is
currently only implemented for DSA using this format:
@@ -3275,7 +3275,7 @@ This is currently only implemented for RSA and DSA keys. It is not
allowed to use this together with a @code{domain} specification. If
given, it is used to derive the keys using the given parameters.
-If given for an RSA key the X9.31 key generation algorithm is used
+If given for an RSA key, the X9.31 key generation algorithm is used
even if libgcrypt is not in FIPS mode. If given for a DSA key, the
FIPS 186 algorithm is used even if libgcrypt is not in FIPS mode.
@@ -3338,7 +3338,7 @@ private and public keys are returned in one container and may be
accompanied by some miscellaneous information.
@noindent
-Here are two examples; the first for Elgamal and the second for
+Here are two examples: the first for Elgamal and the second for
elliptic curve key generation:
@example
@@ -3399,13 +3399,13 @@ Return an S-expression representing the context @var{ctx}. Depending
on the state of that context, the S-expression may either be a public
key, a private key or any other object used with public key
operations. On success 0 is returned and a new S-expression is stored
-at @var{r_sexp}; on error an error code is returned and NULL is stored
+at @var{r_sexp}; on error an error code is returned and @code{NULL} is stored
at @var{r_sexp}. @var{mode} must be one of:
@table @code
@item 0
Decide what to return depending on the context. For example if the
-private key parameter is available a private key is returned, if not a
+private key parameter is available, a private key is returned; if not, a
public key is returned.
@item GCRY_PK_GET_PUBKEY
@@ -3434,7 +3434,7 @@ function will be extended to cover more algorithms.
@node Hashing
@chapter Hashing
-Libgcrypt provides an easy and consistent to use interface for hashing.
+Libgcrypt provides an easy to use and consistent interface for hashing.
Hashing is buffered and several hash algorithms can be updated at once.
It is possible to compute a HMAC using the same routines. The
programming model follows an open/process/close paradigm and is in that
@@ -3476,7 +3476,7 @@ fade out its use if strong cryptographic properties are required.
@item GCRY_MD_RMD160
This is the 160 bit version of the RIPE message digest (RIPE-MD-160).
-Like SHA-1 it also yields a digest of 20 bytes. This algorithm share a
+Like SHA-1 it also yields a digest of 20 bytes. This algorithm shares a
lot of design properties with SHA-1 and thus it is advisable not to use
it for new protocols.
@@ -3493,7 +3493,7 @@ This is the MD4 algorithm, which yields a message digest of 16 bytes.
This algorithm has severe weaknesses and should not be used.
@item GCRY_MD_MD2
-This is an reserved identifier for MD-2; there is no implementation yet.
+This is a reserved identifier for MD-2; there is no implementation yet.
This algorithm has severe weaknesses and should not be used.
@item GCRY_MD_TIGER
@@ -3511,7 +3511,7 @@ This is another variant of TIGER with a different padding scheme.
@item GCRY_MD_HAVAL
This is an reserved value for the HAVAL algorithm with 5 passes and 160
-bit. It yields a message digest of 20 bytes. Note that there is no
+bits. It yields a message digest of 20 bytes. Note that there is no
implementation yet available.
@item GCRY_MD_SHA224
@@ -3645,7 +3645,7 @@ Create a message digest object for algorithm @var{algo}. @var{flags}
may be given as an bitwise OR of constants described below. @var{algo}
may be given as @code{0} if the algorithms to use are later set using
@code{gcry_md_enable}. @var{hd} is guaranteed to either receive a valid
-handle or NULL.
+handle or @code{NULL}.
For a list of supported algorithms, see @ref{Available hash
algorithms}.
@@ -3656,7 +3656,7 @@ The flags allowed for @var{mode} are:
@table @code
@item GCRY_MD_FLAG_SECURE
Allocate all buffers and the resulting digest in "secure memory". Use
-this is the hashed data is highly confidential.
+this if the hashed data is highly confidential.
@item GCRY_MD_FLAG_HMAC
@cindex HMAC
@@ -3675,11 +3675,11 @@ which led to a wrong result for certain input sizes and write
patterns. Using this flag emulates that bug. This may for example be
useful for applications which use Whirlpool as part of their key
generation. It is strongly suggested to use this flag only if really
-needed and if possible to the data should be re-processed using the
+needed; and if possible, the data should be re-processed using the
regular Whirlpool algorithm.
-Note that this flag works for the entire hash context. If needed
-arises it may be used to enable bug emulation for other hash
+Note that this flag works for the entire hash context. If need
+arises, it may be used to enable bug emulation for other hash
algorithms. Thus you should not use this flag for a multi-algorithm
hash context.
@@ -3758,7 +3758,7 @@ independently using the original context.
Now that we have prepared everything to calculate hashes, it is time to
-see how it is actually done. There are two ways for this, one to
+see how it is actually done. There are two ways for this: one to
update the hash with a block of memory and one macro to update the hash
by just one character. Both methods can be used on the same hash context.
@@ -3790,7 +3790,7 @@ message digest or some padding.
Finalize the message digest calculation. This is not really needed
because @code{gcry_md_read} and @code{gcry_md_extract} do this implicitly.
After this has been done no further updates (by means of @code{gcry_md_write}
-or @code{gcry_md_putc} should be done; However, to mitigate timing
+or @code{gcry_md_putc}) should be done; However, to mitigate timing
attacks it is sometimes useful to keep on updating the context after
having stored away the actual digest. Only the first call to this function
has an effect. It is implemented as a macro.
@@ -3806,7 +3806,7 @@ calculation. This function may be used as often as required but it will
always return the same value for one handle. The returned message digest
is allocated within the message context and therefore valid until the
handle is released or reset-ed (using @code{gcry_md_close} or
-@code{gcry_md_reset} or it has been updated as a mitigation measure
+@code{gcry_md_reset}) or it has been updated as a mitigation measure
against timing attacks. @var{algo} may be given as 0 to return the only
enabled message digest or it may specify one of the enabled algorithms.
The function does return @code{NULL} if the requested algorithm has not
@@ -3866,7 +3866,7 @@ at @var{digest}.
digest of a buffer. This function does not require a context and
immediately returns the message digest of the @var{length} bytes at
@var{buffer}. @var{digest} must be allocated by the caller, large
-enough to hold the message digest yielded by the the specified algorithm
+enough to hold the message digest yielded by the specified algorithm
@var{algo}. This required size may be obtained by using the function
@code{gcry_md_get_algo_dlen}.
@@ -3908,7 +3908,7 @@ Return an DER encoded ASN.1 OID for the algorithm @var{algo} in the
user allocated @var{buffer}. @var{length} must point to variable with
the available size of @var{buffer} and receives after return the
actual size of the returned OID. The returned error code may be
-@code{GPG_ERR_TOO_SHORT} if the provided buffer is to short to receive
+@code{GPG_ERR_TOO_SHORT} if the provided buffer is too short to receive
the OID; it is possible to call the function with @code{NULL} for
@var{buffer} to have it only return the required size. The function
returns 0 on success.
@@ -3987,7 +3987,7 @@ because @code{gcry_md_close} implicitly stops debugging.
@node Message Authentication Codes
@chapter Message Authentication Codes
-Libgcrypt provides an easy and consistent to use interface for generating
+Libgcrypt provides an easy to use and consistent interface for generating
Message Authentication Codes (MAC). MAC generation is buffered and interface
similar to the one used with hash algorithms. The programming model follows
an open/process/close paradigm and is in that similar to other building blocks
@@ -4233,10 +4233,10 @@ this is done using:
@deftypefun gcry_error_t gcry_mac_open (gcry_mac_hd_t *@var{hd}, int @var{algo}, unsigned int @var{flags}, gcry_ctx_t @var{ctx})
-Create a MAC object for algorithm @var{algo}. @var{flags} may be given as an
+Create a MAC object for algorithm @var{algo}. @var{flags} may be given as a
bitwise OR of constants described below. @var{hd} is guaranteed to either
-receive a valid handle or NULL. @var{ctx} is context object to associate MAC
-object with. @var{ctx} maybe set to NULL.
+receive a valid handle or @code{NULL}. @var{ctx} is context object to associate MAC
+object with. @var{ctx} maybe set to @code{NULL}.
For a list of supported algorithms, see @ref{Available MAC algorithms}.
@@ -4418,7 +4418,7 @@ from strings.
Derive a key from a passphrase. @var{keysize} gives the requested
-size of the keys in octets. @var{keybuffer} is a caller provided
+size of the key in octets. @var{keybuffer} is a caller provided
buffer filled on success with the derived key. The input passphrase
is taken from @var{passphrase} which is an arbitrary memory buffer of
@var{passphraselen} octets. @var{algo} specifies the KDF algorithm to
@@ -4488,7 +4488,7 @@ The constants for the random quality levels are of this enum type.
@table @code
@item GCRY_WEAK_RANDOM
For all functions, except for @code{gcry_mpi_randomize}, this level maps
-to GCRY_STRONG_RANDOM. If you do not want this, consider using
+to @code{GCRY_STRONG_RANDOM}. If you do not want this, consider using
@code{gcry_create_nonce}.
@item GCRY_STRONG_RANDOM
Use this level for session keys and similar purposes.
@@ -4548,7 +4548,7 @@ to parse and construct them. For detailed information, see
@uref{http://theory.lcs.mit.edu/~rivest/sexp.html}}.
@menu
-* Data types for S-expressions:: Data types related with S-expressions.
+* Data types for S-expressions:: Data types related to S-expressions.
* Working with S-expressions:: How to work with S-expressions.
@end menu
@@ -4576,9 +4576,9 @@ This is the generic function to create an new S-expression object from
its external representation in @var{buffer} of @var{length} bytes. On
success the result is stored at the address given by @var{r_sexp}.
With @var{autodetect} set to 0, the data in @var{buffer} is expected to
-be in canonized format, with @var{autodetect} set to 1 the parses any of
+be in canonized format, with @var{autodetect} set to 1 the function parses any of
the defined external formats. If @var{buffer} does not hold a valid
-S-expression an error code is returned and @var{r_sexp} set to
+S-expression, an error code is returned and @var{r_sexp} set to
@code{NULL}.
Note that the caller is responsible for releasing the newly allocated
S-expression using @code{gcry_sexp_release}.
@@ -4652,7 +4652,7 @@ sign is not a valid character in an S-expression.
@deftypefun void gcry_sexp_release (@w{gcry_sexp_t @var{sexp}})
Release the S-expression object @var{sexp}. If the S-expression is
-stored in secure memory it explicitly zeroises that memory; note that
+stored in secure memory, it explicitly zeroises that memory; note that
this is done in addition to the zeroisation always done when freeing
secure memory.
@end deftypefun
@@ -4753,7 +4753,7 @@ returned in case of a problem.
Create and return a new list form all elements except for the first one.
Note that this function may return an invalid S-expression because it
-is not guaranteed, that the type exists and is a string. However, for
+is not guaranteed that the type exists and is a string. However, for
parsing a complex S-expression it might be useful for intermediate
lists. Returns @code{NULL} on error.
@end deftypefun
@@ -4832,16 +4832,16 @@ likely want to use @code{GCRYMPI_FMT_USG}.
@w{const char *@var{list}}, ...)
Extract parameters from an S-expression using a list of parameter
-names. The names of these parameters are specified in LIST. White
+names. The names of these parameters are specified in @var{list}. White
space between the parameter names are ignored. Some special characters
and character sequences may be given to control the conversion:
@table @samp
@item +
-Switch to unsigned integer format (GCRYMPI_FMT_USG). This is the
+Switch to unsigned integer format (@code{GCRYMPI_FMT_USG}). This is the
default mode.
@item -
-Switch to standard signed format (GCRYMPI_FMT_STD).
+Switch to standard signed format (@code{GCRYMPI_FMT_STD}).
@item /
Switch to opaque MPI format. The resulting MPIs may not be used for
computations; see @code{gcry_mpi_get_opaque} for details.
@@ -4850,14 +4850,14 @@ Switch to buffer descriptor mode. See below for details.
@item %s
Switch to string mode. The expected argument is the address of a
@code{char *} variable; the caller must release that value. If the
-parameter was marked optional and is not found, NULL is stored.
+parameter was marked optional and is not found, @code{NULL} is stored.
@item %#s
Switch to multi string mode. The expected argument is the address of a
@code{char *} variable; the caller must release that value. If the
-parameter was marked optional and is not found, NULL is stored. A
+parameter was marked optional and is not found, @code{NULL} is stored. A
multi string takes all values, assumes they are strings and
concatenates them using a space as delimiter. In case a value is
-actually another list this is not further parsed but a @code{()} is
+actually another list, this is not further parsed but a @code{()} is
inserted in place of that sublist.
@item %u
Switch to unsigned integer mode. The expected argument is address of
@@ -4879,10 +4879,10 @@ If immediately following a parameter letter (no white space allowed),
that parameter is considered optional.
@end table
-In general parameter names are single letters. To use a string for a
+In general, parameter names are single letters. To use a string for a
parameter name, enclose the name in single quotes.
-Unless in buffer descriptor mode for each parameter name a pointer to
+Unless in buffer descriptor mode, for each parameter name a pointer to
an @code{gcry_mpi_t} variable is expected that must be set to
@code{NULL} prior to invoking this function, and finally a @code{NULL}
is expected. For example
@@ -4910,7 +4910,7 @@ provided descriptor is @code{NULL}, the function allocates a new
buffer and stores it at @var{data}; the other fields are set
accordingly with @var{off} set to 0. If @var{data} is not
@code{NULL}, the function assumes that the @var{data}, @var{size}, and
-@var{off} fields specify a buffer where to but the value of the
+@var{off} fields specify a buffer where to put the value of the
respective parameter; on return the @var{len} field receives the
number of bytes copied to that buffer; in case the buffer is too
small, the function immediately returns with an error code (and
@@ -5019,7 +5019,7 @@ small values (usually up to the word size of the CPU).
If @var{u} is not negative and small enough to be stored in an
@code{unsigned int} variable, store its value at @var{w}. If the
-value does not fit or is negative return GPG_ERR_ERANGE and do not
+value does not fit or is negative, return @code{GPG_ERR_ERANGE} and do not
change the value stored at @var{w}. Note that this function returns
an @code{unsigned int} so that this value can immediately be used with
the bit test functions. This is in contrast to the other "_ui"
@@ -5036,7 +5036,7 @@ Swap the values of @var{a} and @var{b}.
@w{const gcry_mpi_t @var{u}})
Set @var{u} into @var{w} and release @var{u}. If @var{w} is
-@code{NULL} only @var{u} will be released.
+@code{NULL}, only @var{u} will be released.
@end deftypefun
@deftypefun void gcry_mpi_neg (@w{gcry_mpi_t @var{w}}, @w{gcry_mpi_t @var{u}})
@@ -5063,7 +5063,7 @@ Convert the external representation of an integer stored in @var{buffer}
with a length of @var{buflen} into a newly created MPI returned which
will be stored at the address of @var{r_mpi}. For certain formats the
length argument is not required and should be passed as @code{0}. A
-@var{buflen} larger than 16 MiByte will be rejected. After a
+@var{buflen} larger than 16 MiB will be rejected. After a
successful operation the variable @var{nscanned} receives the number of
bytes actually scanned unless @var{nscanned} was given as
@code{NULL}. @var{format} describes the format of the MPI as stored in
@@ -5085,7 +5085,7 @@ with a 4 byte big endian header.
@item GCRYMPI_FMT_HEX
Stored as a string with each byte of the MPI encoded as 2 hex digits.
-Negative numbers are prefix with a minus sign and in addition the
+Negative numbers are prefixed with a minus sign and in addition the
high bit is always zero to make clear that an explicit sign ist used.
When using this format, @var{buflen} must be zero.
@@ -5103,8 +5103,8 @@ format (MSB first).
Convert the MPI @var{a} into an external representation described by
@var{format} (see above) and store it in the provided @var{buffer}
-which has a usable length of at least the @var{buflen} bytes. If
-@var{nwritten} is not NULL, it will receive the number of bytes
+which has a usable length of at least @var{buflen} bytes. If
+@var{nwritten} is not @code{NULL}, it will receive the number of bytes
actually stored in @var{buffer} after a successful operation.
@end deftypefun
@@ -5215,7 +5215,7 @@ as @code{NULL}. @var{round} is either negative for floored division
@deftypefun int gcry_mpi_gcd (@w{gcry_mpi_t @var{g}}, @w{gcry_mpi_t @var{a}}, @w{gcry_mpi_t @var{b}})
Set @var{g} to the greatest common divisor of @var{a} and @var{b}.
-Return true if the @var{g} is 1.
+Return true if @var{g} is 1.
@end deftypefun
@deftypefun int gcry_mpi_invm (@w{gcry_mpi_t @var{x}}, @w{gcry_mpi_t @var{a}}, @w{gcry_mpi_t @var{m}})
@@ -5234,10 +5234,10 @@ The next 2 functions are used to compare MPIs:
@deftypefun int gcry_mpi_cmp (@w{const gcry_mpi_t @var{u}}, @w{const gcry_mpi_t @var{v}})
-Compare the multi-precision-integers number @var{u} and @var{v}
+Compare the multi-precision-integers number @var{u} and @var{v},
returning 0 for equality, a positive value for @var{u} > @var{v} and a
negative for @var{u} < @var{v}. If both numbers are opaque values
-(cf, gcry_mpi_set_opaque) the comparison is done by checking the bit
+(cf. @code{gcry_mpi_set_opaque}), the comparison is done by checking the bit
sizes using memcmp. If only one number is an opaque value, the opaque
value is less than the other number.
@end deftypefun
@@ -5245,7 +5245,7 @@ value is less than the other number.
@deftypefun int gcry_mpi_cmp_ui (@w{const gcry_mpi_t @var{u}}, @w{unsigned long @var{v}})
Compare the multi-precision-integers number @var{u} with the unsigned
-integer @var{v} returning 0 for equality, a positive value for @var{u} >
+integer @var{v}, returning 0 for equality, a positive value for @var{u} >
@var{v} and a negative for @var{u} < @var{v}.
@end deftypefun
@@ -5330,7 +5330,7 @@ Release @var{point} and free all associated resources. Passing
@deftypefun gcry_mpi_point_t gcry_mpi_point_copy (@w{gcry_mpi_point_t @var{point}})
Allocate and return a new point object and initialize it with
-@var{point}. If @var{point} is NULL the function is identical to
+@var{point}. If @var{point} is @code{NULL}, the function is identical to
@code{gcry_mpi_point_new(0)}.
@end deftypefun
@@ -5361,7 +5361,7 @@ advantage of avoiding some extra memory allocations and copies.
Store the projective coordinates from @var{x}, @var{y}, and @var{z}
into @var{point}. If a coordinate is given as @code{NULL}, the value
-0 is used. If @code{NULL} is used for @var{point} a new point object
+0 is used. If @code{NULL} is used for @var{point}, a new point object
is allocated and returned. Returns @var{point} or the newly allocated
point object.
@end deftypefun
@@ -5372,7 +5372,7 @@ point object.
Store the projective coordinates from @var{x}, @var{y}, and @var{z}
into @var{point}. If a coordinate is given as @code{NULL}, the value
-0 is used. If @code{NULL} is used for @var{point} a new point object
+0 is used. If @code{NULL} is used for @var{point}, a new point object
is allocated and returned. The MPIs @var{x}, @var{y}, and @var{z} are
released. Using this function instead of @code{gcry_mpi_point_set}
and 3 calls to @code{gcry_mpi_release} has the advantage of avoiding
@@ -5385,7 +5385,7 @@ newly allocated point object.
@w{gcry_sexp_t @var{keyparam}}, @w{const char *@var{curvename}})
Allocate a new context for elliptic curve operations. If
-@var{keyparam} is given it specifies the parameters of the curve
+@var{keyparam} is given, it specifies the parameters of the curve
(@pxref{ecc_keyparam}). If @var{curvename} is given in addition to
@var{keyparam} and the key parameters do not include a named curve
reference, the string @var{curvename} is used to fill in missing
@@ -5408,15 +5408,15 @@ On success the function returns 0 and stores the new context object at
@w{const char *@var{name}}, @w{gcry_ctx_t @var{ctx}}, @w{int @var{copy}})
Return the MPI with @var{name} from the context @var{ctx}. If not
-found @code{NULL} is returned. If the returned MPI may later be
+found, @code{NULL} is returned. If the returned MPI may later be
modified, it is suggested to pass @code{1} to @var{copy}, so that the
function guarantees that a modifiable copy of the MPI is returned. If
@code{0} is used for @var{copy}, this function may return a constant
flagged MPI. In any case @code{gcry_mpi_release} needs to be called
-to release the result. For valid names @ref{ecc_keyparam}. If the
+to release the result. For valid names, see @ref{ecc_keyparam}. If the
public key @code{q} is requested but only the private key @code{d} is
available, @code{q} will be recomputed on the fly. If a point
-parameter is requested it is returned as an uncompressed
+parameter is requested, it is returned as an uncompressed
encoded point unless these special names are used:
@table @var
@item q@@eddsa
@@ -5429,7 +5429,7 @@ Twisted Edwards curves.
@w{const char *@var{name}}, @w{gcry_ctx_t @var{ctx}}, @w{int @var{copy}})
Return the point with @var{name} from the context @var{ctx}. If not
-found @code{NULL} is returned. If the returned MPI may later be
+found, @code{NULL} is returned. If the returned MPI may later be
modified, it is suggested to pass @code{1} to @var{copy}, so that the
function guarantees that a modifiable copy of the MPI is returned. If
@code{0} is used for @var{copy}, this function may return a constant
@@ -5465,7 +5465,7 @@ Valid names are the point parameters of an elliptic curve
Decode the point given as an MPI in @var{value} and store at
@var{result}. To decide which encoding is used the function takes a
context @var{ctx} which can be created with @code{gcry_mpi_ec_new}.
-If @code{NULL} is given for the context the function assumes a 0x04
+If @code{NULL} is given for the context, the function assumes a 0x04
prefixed uncompressed encoding. On error an error code is returned
and @var{result} might be changed.
@end deftypefun
@@ -5541,19 +5541,19 @@ Store @var{nbits} of the value @var{p} points to in @var{a} and mark
@var{a} as an opaque value (i.e. an value that can't be used for any
math calculation and is only used to store an arbitrary bit pattern in
@var{a}). Ownership of @var{p} is taken by this function and thus the
-user may not use dereference the passed value anymore. It is required
-that them memory referenced by @var{p} has been allocated in a way
+user may not dereference the passed value anymore. It is required
+that the memory referenced by @var{p} has been allocated in a way
that @code{gcry_free} is able to release it.
WARNING: Never use an opaque MPI for actual math operations. The only
-valid functions are gcry_mpi_get_opaque and gcry_mpi_release. Use
-gcry_mpi_scan to convert a string of arbitrary bytes into an MPI.
+valid functions are @code{gcry_mpi_get_opaque} and @code{gcry_mpi_release}. Use
+@code{gcry_mpi_scan} to convert a string of arbitrary bytes into an MPI.
@end deftypefun
@deftypefun gcry_mpi_t gcry_mpi_set_opaque_copy (@w{gcry_mpi_t @var{a}}, @w{const void *@var{p}}, @w{unsigned int @var{nbits}})
Same as @code{gcry_mpi_set_opaque} but ownership of @var{p} is not
-taken instead a copy of @var{p} is used.
+taken; instead a copy of @var{p} is used.
@end deftypefun
@@ -5573,7 +5573,7 @@ currently defined flags are:
Setting this flag converts @var{a} into an MPI stored in "secure
memory". Clearing this flag is not allowed.
@item GCRYMPI_FLAG_OPAQUE
-This is an internal flag, indicating the an opaque valuue and not an
+This is an internal flag, indicating that an opaque value and not an
integer is stored. This is an read-only flag; it may not be set or
cleared.
@item GCRYMPI_FLAG_IMMUTABLE
@@ -5584,7 +5584,7 @@ logged. The flag is sometimes useful for debugging.
If this flag is set, the MPI is marked as a constant and as immutable
Setting or changing the value of that MPI is ignored and an error
message is logged. Such an MPI will never be deallocated and may thus
-be used without copying. Note that using gcry_mpi_copy will return a
+be used without copying. Note that using @code{gcry_mpi_copy} will return a
copy of that constant with this and the immutable flag cleared. A few
commonly used constants are pre-defined and accessible using the
macros @code{GCRYMPI_CONST_ONE}, @code{GCRYMPI_CONST_TWO},
@@ -5613,7 +5613,7 @@ allowed flag is @code{GCRYMPI_FLAG_IMMUTABLE} but only if
@code{GCRYMPI_FLAG_CONST} is not set. If @code{GCRYMPI_FLAG_CONST} is
set, clearing @code{GCRYMPI_FLAG_IMMUTABLE} will simply be ignored.
@end deftypefun
-o
+
@deftypefun int gcry_mpi_get_flag (@w{gcry_mpi_t @var{a}}, @
@w{enum gcry_mpi_flag @var{flag}})
@@ -5630,7 +5630,7 @@ Set the multi-precision-integers @var{w} to a random non-negative number of
@var{nbits}, using random data quality of level @var{level}. In case
@var{nbits} is not a multiple of a byte, @var{nbits} is rounded up to
the next byte boundary. When using a @var{level} of
-@code{GCRY_WEAK_RANDOM} this function makes use of
+@code{GCRY_WEAK_RANDOM}, this function makes use of
@code{gcry_create_nonce}.
@end deftypefun
@@ -5661,9 +5661,9 @@ might be used to influence the prime number generation process.
@deftypefun gcry_error_t gcry_prime_group_generator (gcry_mpi_t *@var{r_g}, gcry_mpi_t @var{prime}, gcry_mpi_t *@var{factors}, gcry_mpi_t @var{start_g})
Find a generator for @var{prime} where the factorization of
-(@var{prime}-1) is in the @code{NULL} terminated array @var{factors}.
+(@var{prime} - 1) is in the @code{NULL} terminated array @var{factors}.
Return the generator as a newly allocated MPI in @var{r_g}. If
-@var{start_g} is not NULL, use this as the start for the search.
+@var{start_g} is not @code{NULL}, use this as the start for the search.
@end deftypefun
@deftypefun void gcry_prime_release_factors (gcry_mpi_t *@var{factors})
@@ -5689,10 +5689,10 @@ wrong.
@chapter Utilities
@menu
-* Memory allocation:: Functions related with memory allocation.
-* Context management:: Functions related with context management.
+* Memory allocation:: Functions related to memory allocation.
+* Context management:: Functions related to context management.
* Buffer description:: A data type to describe buffers.
-* Config reporting:: How to return Libgcrypt's configuration.
+* Config reporting:: How to check Libgcrypt's configuration.
@end menu
@@ -5703,7 +5703,7 @@ wrong.
This function tries to allocate @var{n} bytes of memory. On success
it returns a pointer to the memory area, in an out-of-core condition,
-it returns NULL.
+it returns @code{NULL}.
@end deftypefun
@deftypefun {void *} gcry_malloc_secure (size_t @var{n})
@@ -5715,7 +5715,7 @@ Like @code{gcry_malloc}, but uses secure memory.
This function allocates a cleared block of memory (i.e. initialized with
zero bytes) long enough to contain a vector of @var{n} elements, each of
size @var{m} bytes. On success it returns a pointer to the memory
-block; in an out-of-core condition, it returns NULL.
+block; in an out-of-core condition, it returns @code{NULL}.
@end deftypefun
@deftypefun {void *} gcry_calloc_secure (size_t @var{n}, size_t @var{m})
@@ -5726,9 +5726,9 @@ Like @code{gcry_calloc}, but uses secure memory.
This function tries to resize the memory area pointed to by @var{p} to
@var{n} bytes. On success it returns a pointer to the new memory
-area, in an out-of-core condition, it returns NULL. Depending on
+area, in an out-of-core condition, it returns @code{NULL}. Depending on
whether the memory pointed to by @var{p} is secure memory or not,
-gcry_realloc tries to use secure memory as well.
+@code{gcry_realloc} tries to use secure memory as well.
@end deftypefun
@deftypefun void gcry_free (void *@var{p})
@@ -5739,7 +5739,7 @@ Release the memory area pointed to by @var{p}.
@node Context management
@section Context management
-Some function make use of a context object. As of now there are only
+Some function make use of a context object. As of now, there are only
a few math functions. However, future versions of Libgcrypt may make
more use of this context object.
@@ -5756,7 +5756,7 @@ Release the context object @var{ctx} and all associated resources. A
@node Buffer description
@section Buffer description
-To help hashing non-contiguous areas of memory a general purpose data
+To help hashing non-contiguous areas of memory, a general purpose data
type is defined:
@deftp {Data type} {gcry_buffer_t}
@@ -5778,7 +5778,7 @@ of this structure are:
@end deftp
@node Config reporting
-@section How to return Libgcrypt's configuration.
+@section How to check Libgcrypt's configuration.
Although @code{GCRYCTL_PRINT_CONFIG} can be used to print
configuration options, it is sometimes necessary to check them in a
@@ -5791,12 +5791,12 @@ program. This can be accomplished by using this function:
This function returns a malloced string with colon delimited configure
options. With a value of 0 for @var{mode} this string resembles the
output of @code{GCRYCTL_PRINT_CONFIG}. However, if @var{what} is not
-NULL, only the line where the first field (e.g. "cpu-arch") matches
+@code{NULL}, only the line where the first field (e.g. "cpu-arch") matches
@var{what} is returned.
Other values than 0 for @var{mode} are not defined. The caller shall
-free the string using @code{gcry_free}. On error NULL is returned and
-ERRNO is set; if a value for WHAT is unknow ERRNO will be set to 0.
+free the string using @code{gcry_free}. On error @code{NULL} is returned and
+@code{ERRNO} is set; if a value for @var{what} is unknown, @code{ERRNO} will be set to 0.
@end deftypefun
@@ -5856,7 +5856,7 @@ the command line.
@item --binary
Print the MAC as a binary string. The default is to print the MAC
-encoded has lower case hex digits.
+encoded as lower case hex digits.
@item --version
Print version of the program and exit.
@@ -5901,8 +5901,8 @@ These two environment variables are used to enable debug output for
the rndunix entropy gatherer, which is used on systems lacking a
/dev/random device. The value of @code{GCRYPT_RNDUNIX_DBG} is a file
name or @code{-} for stdout. Debug output is the written to this
-file. By setting @code{GCRYPT_RNDUNIX_DBGALL} to any value the debug
-output will be more verbose.
+file. Setting @code{GCRYPT_RNDUNIX_DBGALL} to any value will make the debug
+output more verbose.
@item GCRYPT_RNDW32_NOPERF
@cindex GCRYPT_RNDW32_NOPERF
@@ -5924,7 +5924,7 @@ interface.
This is used to locate the socket to connect to the EGD random
daemon. The EGD can be used on system without a /dev/random to speed
up the random number generator. It is not needed on the majority of
-today's operating systems and support for EGD requires the use of a
+today's operating systems, and support for EGD requires the use of a
configure option at build time.
@end table
@@ -5990,11 +5990,11 @@ This chapter describes the internal architecture of Libgcrypt.
Libgcrypt is a function library written in ISO C-90. Any compliant
compiler should be able to build Libgcrypt as long as the target is
either a POSIX platform or compatible to the API used by Windows NT.
-Provisions have been take so that the library can be directly used from
+Provisions have been taken so that the library can be directly used from
C++ applications; however building with a C++ compiler is not supported.
Building Libgcrypt is done by using the common @code{./configure && make}
-approach. The configure command is included in the source distribution
+approach. The configure command is included in the source distribution,
and as a portable shell script it works on any Unix-alike system. The
result of running the configure script are a C header file
(@file{config.h}), customized Makefiles, the setup of symbolic links and
@@ -6025,7 +6025,7 @@ all these subsystems provide a public API; this includes the helper
subsystems like the one for S-expressions. The API style depends on the
subsystem; in general an open-use-close approach is implemented. The
open returns a handle to a context used for all further operations on
-this handle, several functions may then be used on this handle and a
+this handle, several functions may then be used on this handle, and a
final close function releases all resources associated with the handle.
@menu
@@ -6047,12 +6047,12 @@ Because public key cryptography is almost always used to process small
amounts of data (hash values or session keys), the interface is not
implemented using the open-use-close paradigm, but with single
self-contained functions. Due to the wide variety of parameters
-required by different algorithms S-expressions, as flexible way to
-convey these parameters, are used. There is a set of helper functions
+required by different algorithms, S-expressions - as flexible way to
+convey these parameters - are used. There is a set of helper functions
to work with these S-expressions.
@c see @ref{S-expression Subsystem Architecture}.
-Aside of functions to register new algorithms, map algorithms names to
+Aside from functions to register new algorithms, map algorithms names to
algorithms identifiers and to lookup properties of a key, the
following main functions are available:
@@ -6097,7 +6097,7 @@ random level.
@cindex X9.31
@cindex FIPS 186
The algorithm used for RSA and DSA key generation depends on whether
-Libgcrypt is operated in standard or in FIPS mode. In standard mode
+Libgcrypt is operating in standard or in FIPS mode. In standard mode
an algorithm based on the Lim-Lee prime number generator is used. In
FIPS mode RSA keys are generated as specified in ANSI X9.31 (1998) and
DSA keys as specified in FIPS 186-2.
@@ -6198,7 +6198,7 @@ memory buffer without the need to create an instance first.
There are also functions to query properties of algorithms or the
instance, like enabled algorithms, digest length, map algorithm names.
-it is also possible to reset an instance or to copy the current state
+It is also possible to reset an instance or to copy the current state
of an instance at any time. Debug functions to write the hashed data
to files are available as well.
@@ -6250,14 +6250,14 @@ Functions specialized for public key cryptography.
Libgcrypt provides an interface to its prime number generator. These
functions make use of the internal prime number generator which is
-required for the generation for public key key pairs. The plain prime
+required for the generation for public key pairs. The plain prime
checking function is exported as well.
The generation of random prime numbers is based on the Lim and Lee
-algorithm to create practically save primes.@footnote{Chae Hoon Lim
+algorithm to create practically safe primes.@footnote{Chae Hoon Lim
and Pil Joong Lee. A key recovery attack on discrete log-based schemes
using a prime order subgroup. In Burton S. Kaliski Jr., editor,
-Advances in Cryptology: Crypto '97, pages 249­-263, Berlin /
+Advances in Cryptology: Crypto '97, pages 249--263, Berlin /
Heidelberg / New York, 1997. Springer-Verlag. Described on page 260.}
This algorithm creates a pool of smaller primes, select a few of them
to create candidate primes of the form @math{2 * p_0 * p_1 * ... * p_n
@@ -6304,8 +6304,8 @@ requirements and the function @code{gcry_create_nonce} which is used
for weaker usages like nonces. There is also a level
@code{GCRY_WEAK_RANDOM} which in general maps to
@code{GCRY_STRONG_RANDOM} except when used with the function
-@code{gcry_mpi_randomize}, where it randomizes an
-multi-precision-integer using the @code{gcry_create_nonce} function.
+@code{gcry_mpi_randomize}, where it randomizes a
+multi-precision integer using the @code{gcry_create_nonce} function.
@noindent
There are three distinct random generators available:
@@ -6381,20 +6381,20 @@ approach. The @file{/dev/gcrypt/random.conf} config option
@subsection Description of the CSPRNG
This random number generator is loosely modelled after the one
-described in Peter Gutmann's paper: "Software Generation of
+described in Peter Gutmann's paper "Software Generation of
Practically Strong Random Numbers".@footnote{Also described in chapter
6 of his book "Cryptographic Security Architecture", New York, 2004,
ISBN 0-387-95387-6.}
A pool of 600 bytes is used and mixed using the core SHA-1 hash
-transform function. Several extra features are used to make the
+transform function. Several extra features are used to make it
robust against a wide variety of attacks and to protect against
failures of subsystems. The state of the generator may be saved to a
-file and initially seed form a file.
+file and initially seeded form a file.
-Depending on how Libgcrypt was build the generator is able to select
+Depending on how Libgcrypt was build, the generator is able to select
the best working entropy gathering module. It makes use of the slow
-and fast collection methods and requires the pool to initially seeded
+and fast collection methods and requires the pool to be initially seeded
form the slow gatherer or a seed file. An entropy estimation is used
to mix in enough data from the gather modules before returning the
actual random output. Process fork detection and protection is
@@ -6423,7 +6423,7 @@ prediction resistance.
The generator is based on contexts to utilize the same core functions
for all random levels as required by the high-level interface. All
random generators return their data in 128 bit blocks. If the caller
-requests less bits, the extra bits are not used. The key for each
+requests fewer bits, the extra bits are not used. The key for each
generator is only set once at the first time a generator context is
used. The seed value is set along with the key and again after 1000
output blocks.
@@ -6432,7 +6432,7 @@ On Unix like systems the @code{GCRY_VERY_STRONG_RANDOM} and
@code{GCRY_STRONG_RANDOM} generators are keyed and seeded using the
rndgetentropy or rndoldlinux module. With rndoldlinux module, these
generators may block until the OS kernel has collected enough entropy.
-When used with Microsoft Windows the rndw32 module is used instead.
+When used with Microsoft Windows, the rndw32 module is used instead.
The generator used for @code{gcry_create_nonce} is keyed and seeded
from the @code{GCRY_STRONG_RANDOM} generator. Thus, with rndoldlinux
@@ -6504,7 +6504,7 @@ command may be used to run all implemented self-tests at any time;
this will even run more tests than those run in FIPS mode.
If any of the self-tests fails, the library immediately returns an
-error code to the caller. If Libgcrypt is in FIPS mode the self-tests
+error code to the caller. If Libgcrypt is in FIPS mode, the self-tests
will be performed within the ``Self-Test'' state and any failure puts
the library into the ``Error'' state.
@@ -6560,28 +6560,28 @@ The following MAC algorithm tests are run during power-up:
@table @asis
@item HMAC SHA-1
-A known answer test using 9 byte of data and a 64 byte key is run.
+A known answer test using 9 bytes of data and a 64 byte key is run.
(@code{cipher/mac-hmac.c:selftests_sha1})
@item HMAC SHA-224
-A known answer test using 28 byte of data and a 4 byte key is run.
+A known answer test using 28 bytes of data and a 4 byte key is run.
(@code{cipher/mac-hmac.c:selftests_sha224})
@item HMAC SHA-256
-A known answer test using 28 byte of data and a 4 byte key is run.
+A known answer test using 28 bytes of data and a 4 byte key is run.
(@code{cipher/mac-hmac.c:selftests_sha256})
@item HMAC SHA-384
-A known answer test using 28 byte of data and a 4 byte key is run.
+A known answer test using 28 bytes of data and a 4 byte key is run.
(@code{cipher/mac-hmac.c:selftests_sha384})
@item HMAC SHA-512
-A known answer test using 28 byte of data and a 4 byte key is run.
+A known answer test using 28 bytes of data and a 4 byte key is run.
(@code{cipher/mac-hmac.c:selftests_sha512})
@item HMAC SHA3-224
@itemx HMAC SHA3-256
@itemx HMAC SHA3-384
@itemx HMAC SHA3-512
-A known answer test using 9 byte of data and a 20 byte key is run.
+A known answer test using 9 bytes of data and a 20 byte key is run.
(@code{cipher/mac-hmac.c:selftests_sha3})
@item CMAC AES
-A known answer test using 40 byte of data and a 16 byte key is run.
+A known answer test using 40 bytes of data and a 16 byte key is run.
(@code{cipher/mac-cmac.c:selftests_cmac_aes})
@end table
@@ -6680,7 +6680,7 @@ mode, the library is put into the ``Error'' state.
@item RSA
The test uses a random number 64 bits less the size of the modulus as
plaintext and runs an encryption and decryption operation in turn. The
-encrypted value is checked to not match the plaintext and the result
+encrypted value is checked to not match the plaintext, and the result
of the decryption is checked to match the plaintext.
A new random number of the same size is generated, signed and verified
@@ -6706,7 +6706,7 @@ A manual key entry feature is not implemented in Libgcrypt.
The application may requests tests at any time by means of the
@code{GCRYCTL_SELFTEST} control command. Note that using these tests
-is not FIPS conform: Although Libgcrypt rejects all application
+is not FIPS conformant: Although Libgcrypt rejects all application
requests for services while running self-tests, it does not ensure
that no other operations of Libgcrypt are still being executed. Thus,
in FIPS mode an application requesting self-tests needs to power-cycle
@@ -6766,11 +6766,11 @@ tests:
@item HMAC SHA-1
@enumerate
@item
-A known answer test using 9 byte of data and a 20 byte key is run.
+A known answer test using 9 bytes of data and a 20 byte key is run.
@item
-A known answer test using 9 byte of data and a 100 byte key is run.
+A known answer test using 9 bytes of data and a 100 byte key is run.
@item
-A known answer test using 9 byte of data and a 49 byte key is run.
+A known answer test using 9 bytes of data and a 49 byte key is run.
@end enumerate
(@code{cipher/mac-hmac.c:selftests_sha1})
@item HMAC SHA-224
@@ -6779,15 +6779,15 @@ A known answer test using 9 byte of data and a 49 byte key is run.
@itemx HMAC SHA-512
@enumerate
@item
-A known answer test using 9 byte of data and a 20 byte key is run.
+A known answer test using 9 bytes of data and a 20 byte key is run.
@item
-A known answer test using 50 byte of data and a 20 byte key is run.
+A known answer test using 50 bytes of data and a 20 byte key is run.
@item
-A known answer test using 50 byte of data and a 26 byte key is run.
+A known answer test using 50 bytes of data and a 26 byte key is run.
@item
-A known answer test using 54 byte of data and a 131 byte key is run.
+A known answer test using 54 bytes of data and a 131 byte key is run.
@item
-A known answer test using 152 byte of data and a 131 byte key is run.
+A known answer test using 152 bytes of data and a 131 byte key is run.
@end enumerate
(@code{cipher/@/mac-hmac.c:@/selftests_sha224},
@code{cipher/@/mac-hmac.c:@/selftests_sha256},
@@ -6859,7 +6859,7 @@ described in the appendix on self-tests.
@section Restrictions in FIPS Mode
@noindent
-If Libgcrypt is used in FIPS mode these restrictions are effective:
+If Libgcrypt is used in FIPS mode, these restrictions are effective:
@itemize
@item
@@ -6920,7 +6920,7 @@ Note that the CRC algorithms are not considered cryptographic algorithms
and thus are in addition available.
@item
-RSA key generation refuses to create and uyse ea key with a keysize of
+RSA key generation refuses to create and use a key with a keysize of
less than 2048 bits.
@item
@@ -6956,7 +6956,7 @@ before entering operational state.
@item
The function @code{gcry_set_allocation_handler} may not be used. In FIPS mode
-this function does not have any effect, because FIPS has a requirements for
+this function does not have any effect, because FIPS has requirements for
memory zeroization.
@item
@@ -6983,7 +6983,7 @@ not mean that any non FIPS algorithms are allowed.
@c ********************************************
@section FIPS Finite State Machine
-The FIPS mode of libgcrypt implements a finite state machine (FSM) using
+The FIPS mode of Libgcrypt implements a finite state machine (FSM) using
8 states (@pxref{tbl:fips-states}) and checks at runtime that only valid
transitions (@pxref{tbl:fips-state-transitions}) may happen.
@@ -7030,7 +7030,7 @@ will automatically transit into the Shutdown state.
@item Shutdown
Libgcrypt is about to be terminated and removed from the memory. The
-application may at this point still running cleanup handlers.
+application may at this point still run cleanup handlers.
@end table
@end float
@@ -7051,7 +7051,7 @@ Libgcrypt initialization function @code{gcry_check_version}.
@item 3
Init to Self-Test is either triggered by a dedicated API call or implicit
-by invoking a libgrypt service controlled by the FSM.
+by invoking a Libgrypt service controlled by the FSM.
@item 4
Self-Test to Operational is triggered after all self-tests passed
@@ -7063,7 +7063,7 @@ in Libgcrypt. When reaching the Shutdown state the library is
deinitialized and can't return to any other state again.
@item 6
-Shutdown to Power-off is the process of removing Libgcrypt from the
+Shutdown to Power-Off is the process of removing Libgcrypt from the
computer's memory. For obvious reasons the Power-Off state can't be
represented within Libgcrypt and thus this transition is for
documentation only.
@@ -7088,7 +7088,7 @@ after having reported the error.
@item 11
Power-On to Shutdown is an artificial state to document that Libgcrypt
-has not ye been initialized but the process is about to terminate.
+has not yet been initialized but the process is about to terminate.
@item 12
Power-On to Fatal-Error will be triggered if certain Libgcrypt functions
@@ -7111,7 +7111,7 @@ the self-tests again.
@item 17
Error to Self-Test is triggered if the application has requested to run
-self-tests to get to get back into operational state after an error.
+self-tests to get back into operational state after an error.
@item 18
Init to Error is triggered by errors in the initialization code.