nettle-4.0/ 0000755 0000000 0000000 00000000000 15141166425 007603 5 ustar 00 nettle-4.0/.bootstrap 0000755 0000000 0000000 00000000043 15141166424 011620 0 ustar 00 #! /bin/sh
autoconf && autoheader
nettle-4.0/AUTHORS 0000644 0000000 0000000 00000010253 15141166424 010653 0 ustar 00 Authors of GNU Nettle
The oldest code in Nettle was copied into precursors of the Nettle
library from other public domain or LGPLv2 sources.
Steve Reid Original CAST128 implementation
Dana L. How Original DES implementation,
Colin Plumb Original MD5 implementation
Peter Gutmann Original SHA1 implementation
Andrew Kuchling Original MD2 implementation
Free Software Foundation
Holds copyrights on code ported from
libgcrypt, written by Werner Koch and others.
J.H.M. Dassen Original port of blowfish to GNU lsh, later
split off into Nettle. (This blowfish
implementation was replaced later).
Twofish tests.
Ruud de Rooij Twofish implementation for GNU lsh, later split off into Nettle.
Rafael Sevilla AES C and x86 implementation, original port of
Serpent, for GNU lsh, later split off into Nettle.
Authors of Nettle (in roughly chronological order of initial contribution)
Niels Möller Main author.
Dan Egnor Base64 conversion.
Andreas Sigfridsson Port of MD2, from Andrew Kuchling's python
cryptography toolkit.
Marcus Comstedt Implemented MD4.
D. J. Bernstein Salsa20 public domain reference implementation.
Simon Josefsson Port of Arctwo, from GnuTLS and libgcrypt. New
ports of LGPL Serpent and Blowfish code, from
libgcrypt. Port of Salsa20, based on djb's
reference. Implementation of PBKDF2 (RFC
2898) and drbg-ctr.
Henrik Grubbström AES assembly for Sparc64.
Magnus Holmgren Conversion of DSA keys from DER format to SEXP
format.
Daniel Kahn Gillmor Added the lists for nettle_get_ciphers,
nettle_get_hashes and nettle_get_armors. Test
vectors for hashes and hmac.
Nippon Telegraph and Telephone Corporation
LGPL:ed reference implementation of the
Camellia cipher.
Andrew M. (floodyberry)
The poly1305 code nettle's C implementation is
derived from.
Aleksey Kravchenko The gosthash94 implementation in rhash library.
Stefan Metzmacher, Jeremy Allison, Michael Adam
Contributed to the CMAC code, which was added
to Nettle by Nikos Mavroyanopoulos.
Nikos Mavroyanopoulos GCM implementation, RSA blinding code,
interface for general rsa-pkcs1 signatures.
Port of gosthash94 implementation from rhash. Port of
poly1305. Salsa20r12 variant. HKDF (RFC 5869)
implementation. CMAC and SIV-CMAV
implementation. CTR and GCM optimizations.
Implementation of versioned symbols. Setup of
.gitlab-ci.yml. Large number of smaller fixes.
Andres Mejia Ported Ripemd160 from libgcrypt.
Martin Storsjö Implemented m4 macrology to make x86_64
assembly files work with the windows ABI.
Several other portability improvements.
Jeronimo Pellegrini Documentation for base16 and base64 functions.
Tim Ruehsen Several smaller cleanups and bugfixes.
Fredrik Thulin Test vectors for pbkdf2-hmac-sha512.
Joachim Strömbergson Chacha implementation. Support for sha512_224
and sha512_256.
Owen Kirby Implementation of CCM mode.
Amos Jeffries Implementation of base64url encoding.
Daiki Ueno Implementation of RSA-PSS signatures,
curve448, SHA3 shake, ed448-shake256 signatures,
chacha functions for 32-bit nonce, struct
nettle_mac interface, siv-gcm, RSA-OAEP.
Dmitry Baryshkov CFB and CFB8 modes, CMAC64. gosthash94cp and
Streebog hash functions, GOST DSA signatures
and curves GC256B and GC512A. Various bug
fixes and cleanups.
Simo Sorce Side-channel silent RSA functions. XTS
implementation.
H.J. Lu Assembly annotations for Intel "Control-flow
Enforcement Technology".
Stephen R. van den Berg
Port of bcrypt.
Mamone Tarsha Kurdi Powerpc64 assembly and fat build setup,
including AES, GCM and poly1305. Arm64 assembly and fat
build setup, including AES, Chacha, GCM, SHA1,
SHA256. S390x assembly and fat build setup,
including AES, Chacha, memxor, memxor3, SHA1,
SHA256, SHA512, SHA3.
Nicolas Mora RFC 3394 keywrap, RSA-OAEP.
Tianjia Zhang SM3 hash function, SM4 block cipher.
Amitay Isaacs Powerpc64 assembly for secp192r1, secp224r1
and secp256r1.
Martin Schwenke Powerpc64 assembly for secp384r1, secp521r1,
curve25519 and curve448.
Zoltan Fridrich Balloon password hashing.
Danny Tsen Powerpc64 assembly for combined GCM-AES.
Eric Richter Powerpc64 sha256 assembly.
nettle-4.0/CONTRIBUTING.md 0000644 0000000 0000000 00000001141 15141166424 012030 0 ustar 00 # nettle -- Information about our contribution rules
# Test suite:
New functionality should be accompanied by a test case which verifies
its correctness, on successful use of the new functionality, as well as on
failure cases. The nettle test suite is run on "make check".
# Continuous Integration (CI)
We utilize a continuous integration systems, using gitlab-ci.
This is run on a repository mirror at:
https://gitlab.com/gnutls/nettle
# Sending patches
Please do not utilize the gitlab web interfaces. They are not
being followed on. Please send your patches to nettle-bugs@lists.lysator.liu.se
nettle-4.0/COPYING.LESSERv3 0000644 0000000 0000000 00000016744 15141166424 012116 0 ustar 00 GNU LESSER GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc.
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
This version of the GNU Lesser General Public License incorporates
the terms and conditions of version 3 of the GNU General Public
License, supplemented by the additional permissions listed below.
0. Additional Definitions.
As used herein, "this License" refers to version 3 of the GNU Lesser
General Public License, and the "GNU GPL" refers to version 3 of the GNU
General Public License.
"The Library" refers to a covered work governed by this License,
other than an Application or a Combined Work as defined below.
An "Application" is any work that makes use of an interface provided
by the Library, but which is not otherwise based on the Library.
Defining a subclass of a class defined by the Library is deemed a mode
of using an interface provided by the Library.
A "Combined Work" is a work produced by combining or linking an
Application with the Library. The particular version of the Library
with which the Combined Work was made is also called the "Linked
Version".
The "Minimal Corresponding Source" for a Combined Work means the
Corresponding Source for the Combined Work, excluding any source code
for portions of the Combined Work that, considered in isolation, are
based on the Application, and not on the Linked Version.
The "Corresponding Application Code" for a Combined Work means the
object code and/or source code for the Application, including any data
and utility programs needed for reproducing the Combined Work from the
Application, but excluding the System Libraries of the Combined Work.
1. Exception to Section 3 of the GNU GPL.
You may convey a covered work under sections 3 and 4 of this License
without being bound by section 3 of the GNU GPL.
2. Conveying Modified Versions.
If you modify a copy of the Library, and, in your modifications, a
facility refers to a function or data to be supplied by an Application
that uses the facility (other than as an argument passed when the
facility is invoked), then you may convey a copy of the modified
version:
a) under this License, provided that you make a good faith effort to
ensure that, in the event an Application does not supply the
function or data, the facility still operates, and performs
whatever part of its purpose remains meaningful, or
b) under the GNU GPL, with none of the additional permissions of
this License applicable to that copy.
3. Object Code Incorporating Material from Library Header Files.
The object code form of an Application may incorporate material from
a header file that is part of the Library. You may convey such object
code under terms of your choice, provided that, if the incorporated
material is not limited to numerical parameters, data structure
layouts and accessors, or small macros, inline functions and templates
(ten or fewer lines in length), you do both of the following:
a) Give prominent notice with each copy of the object code that the
Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the object code with a copy of the GNU GPL and this license
document.
4. Combined Works.
You may convey a Combined Work under terms of your choice that,
taken together, effectively do not restrict modification of the
portions of the Library contained in the Combined Work and reverse
engineering for debugging such modifications, if you also do each of
the following:
a) Give prominent notice with each copy of the Combined Work that
the Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the Combined Work with a copy of the GNU GPL and this license
document.
c) For a Combined Work that displays copyright notices during
execution, include the copyright notice for the Library among
these notices, as well as a reference directing the user to the
copies of the GNU GPL and this license document.
d) Do one of the following:
0) Convey the Minimal Corresponding Source under the terms of this
License, and the Corresponding Application Code in a form
suitable for, and under terms that permit, the user to
recombine or relink the Application with a modified version of
the Linked Version to produce a modified Combined Work, in the
manner specified by section 6 of the GNU GPL for conveying
Corresponding Source.
1) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (a) uses at run time
a copy of the Library already present on the user's computer
system, and (b) will operate properly with a modified version
of the Library that is interface-compatible with the Linked
Version.
e) Provide Installation Information, but only if you would otherwise
be required to provide such information under section 6 of the
GNU GPL, and only to the extent that such information is
necessary to install and execute a modified version of the
Combined Work produced by recombining or relinking the
Application with a modified version of the Linked Version. (If
you use option 4d0, the Installation Information must accompany
the Minimal Corresponding Source and Corresponding Application
Code. If you use option 4d1, you must provide the Installation
Information in the manner specified by section 6 of the GNU GPL
for conveying Corresponding Source.)
5. Combined Libraries.
You may place library facilities that are a work based on the
Library side by side in a single library together with other library
facilities that are not Applications and are not covered by this
License, and convey such a combined library under terms of your
choice, if you do both of the following:
a) Accompany the combined library with a copy of the same work based
on the Library, uncombined with any other library facilities,
conveyed under the terms of this License.
b) Give prominent notice with the combined library that part of it
is a work based on the Library, and explaining where to find the
accompanying uncombined form of the same work.
6. Revised Versions of the GNU Lesser General Public License.
The Free Software Foundation may publish revised and/or new versions
of the GNU Lesser General Public License from time to time. Such new
versions will be similar in spirit to the present version, but may
differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the
Library as you received it specifies that a certain numbered version
of the GNU Lesser General Public License "or any later version"
applies to it, you have the option of following the terms and
conditions either of that published version or of any later version
published by the Free Software Foundation. If the Library as you
received it does not specify a version number of the GNU Lesser
General Public License, you may choose any version of the GNU Lesser
General Public License ever published by the Free Software Foundation.
If the Library as you received it specifies that a proxy can decide
whether future versions of the GNU Lesser General Public License shall
apply, that proxy's public statement of acceptance of any version is
permanent authorization for you to choose that version for the
Library.
nettle-4.0/COPYINGv2 0000644 0000000 0000000 00000043254 15141166424 011115 0 ustar 00 GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Lesser General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
Copyright (C)
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) year name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License.
nettle-4.0/COPYINGv3 0000644 0000000 0000000 00000104516 15141166424 011115 0 ustar 00 GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc.
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
Copyright (C)
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see .
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
Copyright (C)
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
.
nettle-4.0/ChangeLog 0000644 0000000 0000000 00002054405 15141166424 011366 0 ustar 00 2026-01-31 Niels Möller
From Daiki Ueno:
* drbg-ctr-aes256.c (drbg_ctr_aes256_update): Change argument list
to take use a struct drbg_ctr_aes256_ctx, and make non-static.
Update callers.
* drbg-ctr.h (drbg_ctr_aes256_update): Declare it.
* nettle.texinfo (Randomness): Update documentation.
2026-01-29 Niels Möller
* testsuite/testutils.h (struct tstring): Change traditional
data[1] to C99 flexible array member data[].
* testsuite/testutils.c (tstring_alloc): Update allocation
accordingly.
2026-01-28 Niels Möller
* arm64: Add alignment at each function prologue.
* powerpc64/p8/sha256-compress-n.asm: Add consistent alignment.
* x86/sha1-compress.asm: Likewise.
* x86_64: Likewise, several files.
2026-01-24 Niels Möller
Copy files from https://git.savannah.gnu.org/cgit/config.git/plain/
* config.guess: Update to 2025-07-10 version.
* config.sub: Update to 2025-07-10 version.
2026-01-22 Niels Möller
* ed448-shake256-verify.c (ed448_shake256_verify): By RFC 8032,
the final octet of an ed448 signature must always be zero. Add
missing check that it indeed is zero. Reported by Oren Yomtov.
* testsuite/ed448-test.c (test_wycheproof): New testcase.
2026-01-18 Niels Möller
* nettle.texinfo (Hash functions): Update hash intro.
(Authenticated encryption): Revise intro.
(Randomness): Recommend using operating system randomness
facilities.
2026-01-14 Niels Möller
* nettle.texinfo (OCB): Update OCB documentation.
* ocb.h (struct ocb_ctx): New field tag_length, storing the size
passed to ocb_set_nonce.
* ocb.c (ocb_set_nonce): Store tag length in context.
(ocb_digest): Delete length argument. Size of digest was stored in
the context by ocb_set_nonce. Updated all callers.
* ocb-aes128.c (ocb_aes128_digest): Deleted length argument.
* non-nettle.c (ocb_aes128_t96_digest): Deleted.
* nettle.texinfo (CCM): Update CCM documentation.
* ccm.h (CCM_MIN_DIGEST_SIZE): New constant.
(struct ccm_ctx): New field tag_length, storing the size used for
constructing the IV in ccm_set_nonce.
* ccm.c (ccm_set_nonce): Check that tag length is according to
spec, and store in context.
(ccm_digest): Delete length argument. Size of digest was stored in
the context by ccm_set_nonce. Updated all callers.
* ccm-aes128.c (ccm_aes128_digest): Delete length argument.
* ccm-aes192.c (ccm_aes192_digest): Likewise.
* ccm-aes256.c: Likewise.
* testsuite/ccm-test.c (test_main): Delete test from IEEE
802.15.4-2011, C.2.2, since it uses an invalid zero tag length.
2026-01-08 Niels Möller
* ocb.c (update_offset): Deleted function, replaced with...
(ocb_mul_xk): New function.
(ocb_fill_n): Use ocb_mul_xk both in main loop and for final block.
* ocb.h (struct ocb_ctx): Change types of data_count and
message_count to uint32_t and uint64_t, respectively, from size_t.
Makes the implementation limits on the size of associated data and
cleartext be platform independent.
2026-01-02 Niels Möller
* sexp.c (sexp_iterator_exit_list): Rewrite to not recurse via
sexp_iterator_next.
2025-12-17 Niels Möller
* sexp.c (sexp_iterator_simple): Fix off-by-one error in length
check. Reported via oss-fuzz.
2025-12-15 Niels Möller
* base16-decode.c (base16_decode_update): Fix returned value on
failure, should be 0. Previous change accidentally returned -1
instead.
* base64-decode.c (base64_decode_update): Analogous fix. This
regression was reported by Robert Augusteijn.
2025-12-02 Niels Möller
Copy getopt files from current gnulib, using gnulib-tool.sh --copy-file.
* lib/getopt_int.h: New file (replacing old getopt_int.h).
* lib/getopt-ext.h: New file.
* lib/getopt-core.h: New File.
* lib/getopt.c: New file. Only change from gnulib is to wrap the
gettext.h usage inside an #ifndef _.
* lib/getopt1.c: New file.
* getopt.h: Rewritten as a wrapper for lib/getopt-core.h and
lib/getopt-ext.h.
* getopt.c: Rewritten as a wrapper for lib/getopt.c, including an
ELIDE_CODE check.
* getopt1.c: Analogous wrapper for lib/getopt1.c.
* Makefile.in (PRE_CPPFLAGS): Add -I$(srcdir), needed for #include
from files in lib/.
(gnulib_FILES): New variable.
(DISTFILES): Drop getopt_int.h, moved to lib/.
(distdir): Populate lib/ directory with $(gnulib_FILES).
2025-11-05 Niels Möller
* testsuite/slh-dsa-test.c (read_hex_file): Simplify, using
base16_decode_update.
2025-10-30 Niels Möller
* base16-decode.c (base16_decode_single): Rewrite as a call to
base16_decode_update.
(base16_decode_update): Make *dst_length an input argument, should
hold size of dst buffer. Fail if decoding would exceed this size.
Update all callers.
* base64-decode.c (base64_decode_single, base64_decode_update):
Analogous changes.
2025-10-29 Niels Möller
* base64-encode.c (base64_encode_group): Delete unused and
undocumented function.
2025-10-16 Niels Möller
Delete the undocumented nettle_armor abstraction.
* nettle-types.h (nettle_armor_length_func)
(nettle_armor_init_func, nettle_armor_encode_update_func)
(nettle_armor_encode_final_func, nettle_armor_decode_update_func)
(nettle_armor_decode_final_func): Deleted typedefs.
* nettle-meta.h (struct nettle_armor): Deleted struct.
(_NETTLE_ARMOR, _NETTLE_ARMOR_0): Deleted macros.
(nettle_get_armors, nettle_armors, nettle_base64)
(nettle_base64url, nettle_base16): Deleted declarations.
* base16-meta.c: Deleted file.
* base64-meta.c: Deleted file.
* base64url-meta.c: Deleted file.
* nettle-meta-armors.c: Deleted file.
* Makefile.in (nettle_SOURCES): Drop deleted files.
* testsuite/base16-test.c (test_base16): New more concrete test function.
(test_main): Updated to use test_base16 rather than test_armor.
* testsuite/base64-test.c (test_base64): New more concretetest
function, parameterized only by init functions to use.
(test_main): Updated to use test_base64 rather than test_armor.
* testsuite/testutils.c (test_armor): Deleted function.
* testsuite/meta-armor-test.c: Deleted file.
* testsuite/Makefile.in (TS_NETTLE_SOURCES): Drop meta-armor-test.c.
2025-10-13 Niels Möller
* tools/input.h (struct sexp_input): Replace use of struct
nette_armor, replaced with...
(struct input_coding): New simpler struct.
* tools/input.c (sexp_input_start_base64)
(sexp_input_start_base16): New functions, replacing...
(sexp_input_start_coding, sexp_input_end_coding): Deleted functions.
* tools/output.h (struct sexp_output): Replace use of struct
nettle_armor, instead use just a put_char function pointer.
* tools/output.c (sexp_put_base16_start, sexp_put_base16_end)
(sexp_put_base64_start, sexp_put_base64_end): New functions,
replacing...
(sexp_put_code_start, sexp_put_code_end): Deleted functions.
2025-10-08 Niels Möller
* tools/sexp-conv.c (list_hashes): New function.
(parse_options): Make --hash option use nettle_lookup_hash, and
change default to sha256. New option --list-hashes. Delete
obsolete option --raw-hash.
2025-10-03 Niels Möller
* tools/output.c (sexp_output_init): Add hash argument, allocate
context if non-null.
(sexp_output_hash_init): Deleted function.
* tools/sexp-conv.c (main): Update call to sexp_output_init. Free
context before exiting.
2025-10-02 Niels Möller
* tools/sexp-conv-test: Improve tests, including --hash feature.
(test_hash): New function.
2025-09-27 Niels Möller
* nettle.texinfo (SLH-DSA): Document SLH-DSA.
2025-09-24 Niels Möller
* configure.ac (CFLAGS): When using mini-gmp, define
MINI_GMP_ENABLE_FLOAT=0.
* mini-gmp.c, mini-gmp.h: Update from the GMP repository.
2025-09-18 Niels Möller
* nettle.texinfo (Using Nettle): Group the sections Example,
Conventions, Linking, and Compatibility into a new chapter.
* configure.ac: Delete unusual configure options --with-lib-path
and --with-lib-path.
(libdir): Delete logic to set the default libdir depending on ABI.
* aclocal.m4 (LSH_PATH_ADD, LSH_RPATH_ADD, LSH_RPATH_INIT)
(LSH_RPATH_FIX): Deleted now unused macros.
2025-09-15 Niels Möller
* slh-dsa-sha2-128f.c (slh_dsa_sha2_128f_root)
(slh_dsa_sha2_128f_generate_keypair, slh_dsa_sha2_128f_sign)
(slh_dsa_sha2_128f_verify): New file, new functions.
* Makefile.in (nettle_SOURCES): Add slh-dsa-sha2-128f.c.
* testsuite/slh-dsa-test.c (test_main): Add tests for slh-dsa-sha2-128f.
* examples/hogweed-benchmark.c (alg_list): Add benchmarking of slh-dsa-sha2-128f.
2025-09-14 Niels Möller
* slh-sha256.c: New file.
(_slh_hash_sha256): New slh_hash struct, and corresponding functions.
* slh-dsa-sha2-128s.c (slh_dsa_sha2_128s_root)
(slh_dsa_sha2_128s_generate_keypair, slh_dsa_sha2_128s_sign)
(slh_dsa_sha2_128s_verify): New file, new functions.
* Makefile.in (nettle_SOURCES): Add slh-sha256.c and
slh-dsa-sha2-128s.c.
* testsuite/slh-dsa-test.c (test_main): Add tests for slh_dsa_sha2_128s.
* examples/hogweed-benchmark.c (bench_slh_dsa_init_sha2_s): New
function.
(alg_list): Add benchmarking of slh-dsa-sha2-128s.
2025-09-12 Niels Möller
* slh-dsa-internal.h (slh_hash_randomizer_func)
(slh_hash_msg_digest_func, slh_hash_init_tree_func)
(slh_hash_init_hash_func, slh_hash_secret_func)
(slh_hash_node_func): New typedefs, for slh-related hash
operations.
(struct slh_hash): New struct.
(struct slh_merkle_ctx_public): Add slh_hash pointer, and use
const void * for context.
(struct slh_merkle_ctx_secret): Add scratch_ctx, needed by
xmss_leaf.
* slh-shake.c (slh_shake_init_tree): Renamed and made static.
(_slh_shake_init): ... old name.
(slh_shake_secret): Renamed and made static.
(_slh_shake): ...old name.
(slh_shake_init_hash, slh_shake_node)
(slh_shake_digest, slh_shake_randomizer)
(slh_shake_msg_digest): New functions.
( _slh_hash_shake): New slh_hash struct.
* slh-fors.c: Update for new hash abstraction.
* slh-wots.c: Likewise.
* slh-xmss.c: Likewise.
* slh-dsa.c (_slh_dsa_pure_digest, _slh_dsa_pure_rdigest): New functions.
(_slh_dsa_sign): Add slh_hash argument, and contexts allocated by caller.
(_slh_dsa_verify): Likewise.
* slh-dsa-shake-128f.c (slh_dsa_shake_128f_root): Allocate sha3
contexts, use _slh_hash_shake.
(slh_dsa_shake_128f_sign): Allocate sha3 contexts, call
_slh_dsa_pure_rdigest.
(slh_dsa_shake_128f_verify): Allocate sha3 contexts, call
_slh_dsa_pure_digest.
* slh-dsa-shake-128s.c: Analogous changes.
2025-09-09 Niels Möller
* slh-dsa-internal.h (slh_parse_digest_func): New typedef.
(struct slh_dsa_params): New function pointer parse_digest.
* slh-dsa.c (_slh_dsa_sign): Delete tree_idx and leaf_idx
arguments. Instead, call params->parse_digest to get them from the
digest. Introduce c99 mid-block declarations, for convenience.
(_slh_dsa_verify): Likewise.
* slh-dsa-128s.c: New file.
(_slh_dsa_128s_params): Params struct moved here.
(parse_digest): Corresponding function to extract tree and leaf
indices from digest.
* slh-dsa-shake-128s.c (_slh_dsa_128s_params, parse_digest): ...
old location.
* slh-dsa-128f.c: New file.
(_slh_dsa_128f_params): Params struct moved here.
(parse_digest): Corresponding function to extract tree and leaf
indices from digest.
* slh-dsa-shake-128f.c (_slh_dsa_128f_params, parse_digest): ...
old location.
* Makefile.in (nettle_SOURCES): Add slh-dsa-128s.c slh-dsa-128f.c.
2025-09-08 Niels Möller
* slh-dsa-shake-128s.c (_slh_dsa_128s_params): Renamed, from...
(_slh_dsa_shake_128s_params): ... old name.
* slh-dsa-shake-128f.c (_slh_dsa_128f_params): Renamed, from...
(_slh_dsa_shake_128f_params): ... old name.
2025-09-05 Niels Möller
* slh-dsa.h (SLH_DSA_128_SEED_SIZE, SLH_DSA_128_KEY_SIZE)
(SLH_DSA_128S_SIGNATURE_SIZE, SLH_DSA_128F_SIGNATURE_SIZE):
Renamed and updated all uses, from...
(SLH_DSA_SHAKE_128_SEED_SIZE, SLH_DSA_SHAKE_128_KEY_SIZE)
(SLH_DSA_SHAKE_128S_SIGNATURE_SIZE)
(SLH_DSA_SHAKE_128F_SIGNATURE_SIZE): ... old names.
2025-07-07 Niels Möller
* ecc-secp384r1.c (ecc_secp384r1_modp) [GMP_NUMB_BITS == 32]:
Analogous change to use assert_maybe. Report and patch by Taketo
Kabe.
2025-07-06 Niels Möller
* ecc-secp192r1.c (ecc_secp192r1_modp) [GMP_NUMB_BITS == 32]: Use
assert_maybe. This version of the function was overlooked in the
2023-11-14 change.
2025-07-03 Niels Möller
* testsuite/slh-dsa-test.c (test_main): Additional test cases,
from https://github.com/usnistgov/ACVP-Server.
2025-07-01 Niels Möller
* slh-dsa-shake-128f.c (slh_dsa_shake_128f_root)
(slh_dsa_shake_128f_generate_keypair, slh_dsa_shake_128f_sign)
(slh_dsa_shake_128f_verify): New functions.
* slh-dsa.h: Declare new functions.
(SLH_DSA_SHAKE_128F_SIGNATURE_SIZE): New constant.
* Makefile.in (nettle_SOURCES): Add slh-dsa-shake-128f.c.
* testsuite/slh-dsa-test.c (test_main): Add test for slh-dsa-shake-128f.
* testsuite/slh-dsa-shake-128f.ref: New Reference signature.
* testsuite/Makefile.in (DISTFILES): Add slh-dsa-shake-128f.ref.
* examples/hogweed-benchmark.c (bench_slh_dsa_sign): New function.
(alg_list): Add benchmarking of slh-dsa-shake128f.
2025-06-30 Niels Möller
Implement slh-dsa-shake128s.
* slh-dsa.h: New public header file.
* slh-dsa-shake-128s.c (slh_dsa_shake_128s_root)
(slh_dsa_shake_128s_generate_keypair, slh_dsa_shake_128s_sign)
(slh_dsa_shake_128s_verify): New file, new public functions.
(parse_digest): New internal function.
* slh-dsa-internal.h: New header file with internal declarations.
(slh_addr_type): New enum.
(slh_address_hash, slh_merkle_ctx_public, slh_merkle_ctx_secret)
(slh_xmss_params, slh_fors_params, slh_dsa_params): New structs.
(merkle_leaf_hash_func, merkle_node_hash_func): New typedefs.
* slh-dsa.c (_slh_dsa_randomizer, _slh_dsa_digest)
(_slh_dsa_sign, _slh_dsa_verify): New file, new functions.
* slh-fors.c (_fors_gen, fors_leaf, fors_node, fors_sign_one)
(_fors_sign, fors_verify_one, _fors_verify): New file, new functions.
* slh-merkle.c (_merkle_root, _merkle_sign, _merkle_verify): New
file, new functions.
* slh-shake.c (_slh_shake_init, _slh_shake): New file, new functions.
* slh-wots.c (wots_chain, wots_pk_init, _wots_gen)
(wots_sign_one, _wots_sign, wots_verify_one, _wots_verify): New
file, new functions.
* slh-xmss.c (xmss_leaf, xmss_node, _xmss_gen, _xmss_sign)
(_xmss_verify): New file, new functions.
* Makefile.in (nettle_SOURCES): Add slh-fors.c, slh-merkle.c,
slh-shake.c, slh-wots.c, slh-xmss.c, slh-dsa.c, and
slh-dsa-shake-128s.c.
(HEADERS): Add slh-dsa.h.
(DISTFILES): Add slh-dsa-internal.h.
* testsuite/slh-dsa-test.c: New tests.
* testsuite/slh-dsa-shake-128s.ref: Reference signature.
* testsuite/sc-slh-dsa-test: New file.
* testsuite/Makefile.in (TS_NETTLE_SOURCES): Add slh-dsa-test.c.
(TS_SC_NETTLE): Add sc-slh-dsa-test.
(DISTFILES): Add slh-dsa-shake-128s.ref.
* examples/hogweed-benchmark.c: Add benchmarking of
slh-dsa-shake128s.
(bench_alg): Change unit to sign/s and verify/s.
2025-06-27 Niels Möller
* testsuite/testutils.c (open_srcdir_file): New function.
* testsuite/yarrow-test.c (open_file): Deleted function.
(test_main): Use open_srcdir_file instead.
2025-06-26 Niels Möller
Cherry-picked from branch nettle-3.10-fixes:
* config.guess: Update to 2024-07-27 version.
* config.sub: Update to 2024-05-27 version.
Minimal patch for compilers that require prototypes, e.g., gcc-15.
* getopt.c (getenv): Delete non-prototype declaration.
* getopt.h (getopt): Declare getopt with a prototype, also for
non-glibc systems.
2025-06-24 Niels Möller
* sha-example.c (main): Update to use sha256 rather than sha1, and
new use sha256_digest interface.
2025-06-23 Niels Möller
* blowfish-bcrypt.c (ibcrypt): Simplify salt logic, eliminating a
compiler warning.
2025-06-22 Niels Möller
Delete the old "generic" HMAC API.
* hmac.h (HMAC_CTX, HMAC_SET_KEY, HMAC_DIGEST): Deleted macros.
* hmac.c (hmac_set_key, hmac_update, hmac_digest): Deleted file
and functions.
* nettle.texinfo (HMAC): Delete corresponding documentation.
Refactor HMAC. Reduces the size of HMAC contexts, sha256 reduced
from 336 bytes to 192, sha512 from 648 to 376, and sha1 from 312
to 168.
* hmac.h (_NETTLE_HMAC_CTX): New macro. The outer and inner
members no longer include any block buffers. Change all the
hmac_*_ctx structs to use the new definition.
* hmac-internal.h (_NETTLE_HMAC_DIGEST, _NETTLE_HMAC_DIGEST_U):
New file, new macros. Update all hmac_*_digest functions to use
one of these macros.
* hmac-internal.c (_nettle_hmac_set_key): New file, new function,
using the new style of context struct. Update all hmac_*_set_key
functions.
* Makefile.in (nettle_SOURCES): Add hmac-internal.c.
(DISTFILES): Add hmac-internal.h.
2025-06-22 Niels Möller
* testsuite/testutils.c (test_mac): Print name of mac algorithm on
failure.
* gosthash94.c (gosthash94_init): Trim memset call, no need to
clear block buffer.
* md2.c (md2_init): Likewise.
* nettle-types.h (_NETTLE_ALIGN16): New macro, to require 16-byte
alignment. Enabled only on platforms where uint64_t needs 8-byte
alignment. Intended to improve performance for SIMD load and
store, which on some platforms may be faster with proper
alignment. Depends on stdalign.h, defined in C11.
(union nettle_block16): Use _NETTLE_ALIGN16.
* ctr16.c (_nettle_ctr_crypt16): Update alignedness check to use
alignof(union nettle_block16).
* aes.h (struct aes128_ctx): Use _NETTLE_ALIGN16 for the array of subkeys.
(struct aes192_ctx): Likewise.
(struct aes256_ctx): Likewise.
* umac.h (_UMAC_STATE): Use _NETTLE_ALIGN16 for the l1_key array.
2025-06-02 Niels Möller
* ctr.c (ctr_fill16) [!WORDS_BIGENDIAN]: Use nettle_bswap64.
(ctr_crypt): For block size 16, always use _nettle_ctr_crypt16.
2025-05-13 Niels Möller
Reduce size of sha3 context size to 216 bytes.
* sha3.h (struct sha3_ctx): New struct, replacing all sha3_*_ctx.
(struct sha3_128_ctx, struct sha3_224_ctx, struct sha3_256_ctx, struct sha3_384_ctx)
(struct sha3_512_ctx): Redefined as aliases to sha3_ctx.
* sha3-internal.h (_NETTLE_SHA3_HASH): New macro.
* sha3.c (sha3_xor_block, sha3_absorb): Deleted functions.
(sha3_init): New function, replacing all sha3_*_init.
(_nettle_sha3_update): Updated to take a struct sha3_ctx *
argument, updated all callers.
(_nettle_sha3_update) [WORDS_BIGENDIAN]: Use only a single 64-bit
word, 8 bytes, for input buffer.
(_nettle_sha3_update) [!WORDS_BIGENDIAN]: No buffering, xor input
into state directly.
(_nettle_sha3_pad): Updated to take a struct sha3_ctx * argument,
updated all callers.
(_nettle_sha3_digest): New function.
* sha3-shake.c (_nettle_sha3_shake_output): Updated to take a
struct sha3_ctx * argument, updated all callers.
(_nettle_sha3_shake_output) [WORDS_BIGENDIAN]: Use only a single
64-bit word, 8 bytes, for buffering partial output.
(_nettle_sha3_shake_output) [!WORDS_BIGENDIAN]: No buffering, copy
output directly from state.
* shake128.c (sha3_128_init): Deleted (redefined as alias for
sha3_init in sha3.h).
* sha3-224.c (sha3_224_init): Likewise.
* sha3-256.c (sha3_256_init): Likewise.
* sha3-384.c (sha3_384_init): Likewise.
* sha3-512.c (sha3_512_init): Likewise.
* nettle-internal.h (NETTLE_MAX_HASH_CONTEXT_SIZE): Lower,
streebog512_ctx is now the largest hash context struct.
2025-04-28 Niels Möller
* bignum-random-prime.c (miller_rabin_pocklington): Adopt
mp_bitcnt_t type.
* ecc-mod-inv.c (ecc_mod_inv): Likewise.
* ecc-mul-a-eh.c (ecc_mul_a_eh): Likewise.
* ecc-mul-a.c (ecc_mul_a): Likewise.
* ecc-mul-g-eh.c (ecc_mul_g_eh): Likewise.
* ecc-mul-g.c (ecc_mul_g): Likewise.
* eccdata.c (ecc_mul_binary): Likewise.
* sha.h: Deleted file.
* nettle.texinfo: Delete all mention of sha.h.
* Makefile.in (HEADERS): Delete sha.h.
* ghosthash94.h, md*.h, ripemd160.h, sha*.h, umac.h: Delete all
_DATA_SIZE constant, they were backwards compatibility aliases for
_BLOCK_SIZE, from 2014 renaming.
* salsa20.h (salsa20_set_iv, SALSA20_IV_SIZE): Delete backwards
compatibility aliases.
* testsuite/salsa20-test.c: Update to consistently use "nonce"
names.
* yarrow.h (yarrow256_force_reseed): Deleted backwards
compatibility alias.
2025-04-27 Niels Möller
* powerpc64/p8/sha256-compress-n.asm: Use 64-bit unsigned compare
for blocks == 0 check, cmpldi instruction.
2025-04-09 Niels Möller
* testsuite/testutils.c (test_cipher): Test encrypt and
decrypt methods with varying data alignment.
2025-04-08 Niels Möller
* twofish.c (twofish_encrypt, twofish_decrypt): Avoid copying via
a uint32_t words[4] array. Speedup of 15% benchmarked on an x86_64
laptop (AMD Ryzen 5).
2025-04-02 Niels Möller
Cherry-picked from branch nettle-3.10-fixes:
* configure.ac: For ppc64, check if __VSX__ is defined, and
disable use of assembly if it isn't.
* .gitlab-ci.yml: Fix native/fat to actually run make
check-fat-override. Add an EXTRA_CHECK_TARGET variable also for
the .cross-build template, use it for check-fat-override where
applicable, and add check-fat-emulate to the powerpc64 builds.
* Makefile.in (check-fat-override): Renamed target, from...
(check-fat): ... old name.
(check-fat-emulate): New target, similar to above, but varies the
-cpu flag passed to the emulator, instead of using
NETTLE_FAT_OVERRIDE.
* configure.ac (FAT_OVERRIDE_LIST): Renamed variable, from...
(FAT_TEST_LIST): ... old name.
(FAT_EMULATE_LIST): New substituted variable. Set to "power8
power9" for fat ppc64 builds.
2025-03-24 Niels Möller
* gcm.h (GCM_TABLE_BITS): Delete constant.
(struct gcm_key): Halve the allocation size for precomputed
values, to 2048 bytes, or 128 16-byte blocks.
2025-03-18 Niels Möller
Delete the output size argument from almost all digest functions.
* chacha-poly1305.h (chacha_poly1305_digest): Delete length argument.
* cmac.h (cmac128_digest, cmac64_digest)
(CMAC128_DIGEST, cmac_aes128_digest, cmac_aes256_digest)
(cmac_des3_digest, CMAC64_DIGEST): Likewise.
* eax.h (eax_digest, eax_aes128_digest, EAX_DIGEST): Likewise.
* gcm.h (gcm_digest, gcm_aes128_digest, gcm_aes192_digest)
(gcm_aes256_digest, gcm_camellia128_digest)
(gcm_camellia256_digest, gcm_sm4_digest, GCM_DIGEST): Likewise.
* gosthash94.h (gosthash94_digest, gosthash94cp_digest): Likewise.
* hkdf.h (hkdf_extract): Likewise.
* hmac.h (hmac_digest, hmac_md5_digest, hmac_ripemd160_digest)
(hmac_sha1_digest, hmac_sha256_digest, hmac_sha224_digest)
(hmac_sha512_digest, hmac_sha384_digest, hmac_gosthash94_digest)
(hmac_gosthash94cp_digest, hmac_streebog512_digest)
(hmac_streebog256_digest, hmac_sm3_digest, HMAC_DIGEST): Likewise.
* md2.h (md2_digest): Likewise.
* md4.h (md4_digest): Likewise.
* md5.h (md5_digest): Likewise.
* poly1305.h (poly1305_aes_digest): Likewise.
* ripemd160.h (ripemd160_digest): Likewise.
* sha1.h (sha1_digest): Likewise.
* sha2.h (sha256_digest, sha224_digest, sha512_digest)
(sha384_digest, sha512_224_digest, sha512_256_digest): Likewise.
* sha3.h (sha3_224_digest, sha3_256_digest, sha3_384_digest)
(sha3_512_digest): Likewise.
* sm3.h (sm3_digest): Likewise.
* streebog.h (streebog512_digest, streebog256_digest): Likewise
* umac.h (umac32_digest, umac64_digest, umac96_digest)
(umac128_digest): Likewise.
* nettle-types.h (nettle_output_func): New typedef, same signature
as nettle_random_func.
(nettle_random_func): Redefine as alias to nettle_output_func.
(nettle_hash_digest_func): Delete length argument.
2025-03-10 Niels Möller
Delete the old deprecated DSA functions declared in dsa-compat.h.
* dsa-compat-keygen.c: Deleted.
* dsa-compat.c: Deleted.
* dsa-compat.h: Deleted.
* dsa-sha1-sign.c: Deleted.
* dsa-sha1-verify.c: Deleted.
* dsa-sha256-sign.c: Deleted.
* dsa-sha256-verify.c: Deleted.
* Makefile.in (hogweed_SOURCES): Delete source files.
(HEADERS): Delete dsa-compat.h.
* nettle.texinfo (DSA): Delete documentation of the deprecated DSA
API.
* testsuite/testutils.c (test_dsa160, test_dsa256): Update to not
depend on deprecated functions.
* testsuite/dsa-test.c (test_main): Likewise.
* testsuite/dsa-keygen-test.c (test_main): Likewise.
2025-03-09 Niels Möller
* ccm-aes128.c (ccm_aes128_encrypt_message)
(ccm_aes128_decrypt_message): Change type of ctx argument to const
struct aes128_ctx *.
* ccm-aes192.c (ccm_aes192_encrypt_message)
(ccm_aes192_decrypt_message): Change type of ctx argument to const
struct aes192_ctx *.
* ccm-aes256.c (ccm_aes256_encrypt_message)
(ccm_aes256_decrypt_message): Change type of ctx argument to const
struct aes256_ctx *.
* testsuite/ccm-test.c (test_cipher_ccm): Add tests for
ccm_aes*_message functions,
* nettle.texinfo (CCM): Update documentation.
2025-03-06 Niels Möller
* nettle-types.h (union nettle_block16): Delete deprecated
unsigned long member of this union.
* rsa-blind.c (_rsa_blind, _rsa_unblind): Delete file, delete
obsolete functions (current RSA blinding functions are not exported).
2025-03-05 Niels Möller
Delete old AES interface.
* aes.h (struct aes_ctx): Deleted.
(AES_MIN_KEY_SIZE, AES_MAX_KEY_SIZE): Deleted constants.
* gcm.h (struct gcm_aes_ctx): Deleted.
* aes-encrypt.c: Deleted file.
* aes-decrypt.c: Deleted file.
* aes-set-encrypt-key.c: Deleted file.
* aes-set-decrypt-key.c: Deleted file.
* gcm-aes.c: Deleted file.
* Makefile.in (nettle_SOURCES): Drop above files.
* nettle.texinfo: Delete corresponding documentation.
* testsuite/aes-test.c (test_invert): Generalize to take a struct
nettle_cipher and an invert function.
(test_cipher2): Deleted function.
(test_main): Delete tests of old AES interface.
* testsuite/gcm-test.c (test_main): Delete tests of struct
gcm_aes_ctx functions.
Delete incomplete and old openpgp support.
* pgp-encode.c: Deleted file.
* pgp.h: Deleted file.
* rsa2openpgp.c: Deleted file.
* rsa.h (rsa_keypair_to_openpgp): Delete declaration.
* Makefile.in (hogweed_SOURCES): Delete pgp-encode.c and rsa2openpgp.c.
(HEADERS): Delete pgp.h.
* md5-compat.c (MD5Init, MD5Update, MD5Final): Delete file and
functions. Also delete corresponding header file, tests, and
documentation.
* configure.ac: Bump version numbers, to prepare for changes that
break API or ABI. Bump package version to 4.0.
(LIBNETTLE_MAJOR, LIBNETTLE_MINOR): Bump, to 9.0.
(LIBHOGWEED_MAJOR, LIBHOGWEED_MINOR): Bump, to 7.0.
2025-03-02 Niels Möller
* powerpc64/p8/gcm-aes-decrypt.asm: Avoid using lxvb16x
instruction in powerpc64/p8 files. Reported by Sean McGovern.
* powerpc64/p8/gcm-aes-encrypt.asm: Likewise.
2025-02-09 Niels Möller
* powerpc64/p8/gcm-aes-decrypt.asm: Use stxvd2x/lxvd2x rather than
stxv/lxv for save and restore of vector registers, since the
latter instructions are not available on Power8 (ISA v2.07).
* powerpc64/p8/gcm-aes-encrypt.asm: Likewise.
2024-12-30 Niels Möller
* Released Nettle-3.10.1.
2024-12-28 Niels Möller
* testsuite/testutils.c (mark_bytes_undefined)
(mark_bytes_defined) [!HAVE_VALGRIND_MEMCHECK_H]: Add UNUSED
attribute on dummy version of these functions.
2024-12-14 Niels Möller
* configure.ac: Bump package version, to 3.10.1.
(LIBNETTLE_MINOR): Bump minor number, to 8.10.
(LIBHOGWEED_MINOR): Bump minor number, to 6.10.
2024-12-13 Niels Möller
* aclocal.m4 (NETTLE_PROG_VALGRIND): Check if executable appears
to include lsan, asan or msan symbols, and if so, don't attempt to
run valgrind.
2024-10-16 Niels Möller
* run-tests: Cleanup, guided by shellcheck warnings. Use $()
rather than `` and $(()) rather than expr.
2024-09-08 Niels Möller
From Brad Smith: Support elf_aux_info (OpenBSD and FreeBSD).
* configure.ac: Check for elf_aux_info.
* fat-arm64.c (get_arm64_features): Use elf_aux_info if available.
* fat-ppc.c (get_ppc_features): Likewise.
2024-06-23 Niels Möller
* testsuite/testutils.h (struct nettle_xof): New struct type.
* testsuite/testutils.c (test_hash): Delete support for tests with
arbitrary digest size, reverting part of 2019-12-25 change.
(test_xof): New function, test both digest and output functions.
* testsuite/shake128-test.c (test_main): Change from using
test_hash to test_xof.
* testsuite/shake256-test.c (test_incremental): Deleted function,
superseded by test_xof.
(test_main): Change from using test_hash to test_xof, delete use
of test_incremental.
2024-06-16 Niels Möller
* testsuite/testutils.c (test_mac): Add set_key function argument,
to support tests with key size != mac->key_size.
* testsuite/cmac-test.c: Update test_mac usage.
* testsuite/hmac-test.c (HMAC_TEST): Deleted macro, replace with
test_mac, passing set_key function when needed.
(test_main): Add more test vectors from RFC 4868, previously
draft-kelly-ipsec-ciph-sha2.
* hmac-gosthash94-meta.c: New file.
* nettle-meta.h (nettle_hmac_gosthash94)
(nettle_hmac_gosthash94cp): Declare.
* nettle-meta-macs.c (_nettle_macs): Add nettle_hmac_gosthash94
and nettle_hmac_gosthash94cp.
* Makefile.in (nettle_SOURCES): Add hmac-gosthash94-meta.c.
* testsuite/meta-mac-test.c: Update test.
* Released Nettle-3.10.
* examples/rsa-encrypt-test: Consistently add $EXEEXT to
executable names.
* examples/rsa-sign-test: Likewise.
* examples/rsa-verify-test: Likewise.
* examples/setup-env: Likewise.
* tools/nettle-pbkdf2-test: Likewise.
* tools/pkcs1-conv-test: Likewise
* tools/sexp-conv-test: Likewise.
* configure.ac: When cross-compiling targetting windows,
always use "wine" as EMULATOR; using "wine64" for 64-bit windows
seems no longer needed.
2024-06-15 Niels Möller
* testsuite/Makefile.in (TS_SC_NETTLE): New variable.
(DISTFILES): Unconditionally include side-channel tests,
fix accidental dependence on IF_VALGRIND.
2024-06-11 Niels Möller
* fat-arm64.c: Enable use of getauxval on android, for
__ANDROID_API__ >= 18.
2024-06-10 Niels Möller
From Eric Richter:
* powerpc64/p8/sha256-compress-n.asm: New file.
* powerpc64/fat/sha256-compress-n-2.asm: New file.
* fat-ppc.c: Add fat setup for _nettle_sha256_compress_n.
2024-06-09 Niels Möller
* ecc-internal.h (assert_maybe) [!WITH_EXTRA_ASSERTS]: Cast to
void, to avoid warnings.
2024-06-05 Niels Möller
* config.guess: Update to 2024-01-01 version.
* config.sub: Update to 2024-01-01 version.
2024-06-02 Niels Möller
* configure.ac: Bump package version, to 3.10.
(LIBNETTLE_MINOR): Bump minor number, to 8.9.
(LIBHOGWEED_MINOR): Bump minor number, to 6.9.
2024-06-01 Niels Möller
* eddsa-hash.c (_eddsa_hash): Use NETTLE_OCTET_SIZE_TO_LIMB_SIZE.
* ecc-hash.c (ecc_hash, gost_hash): Deleted file, moved functions to...
* dsa-hash.c (_nettle_dsa_hash): Change to use mpn interface
instead of mpz, replacing ecc_hash.
(_nettle_gostdsa_hash): Moved here, renamed from gost_hash.
* dsa-internal.h (_nettle_dsa_hash): Update declaration.
(_nettle_gostdsa_hash): Moved declaration here.
* ecc-internal.h (ecc_hash, gost_hash): Delete old declarations.
* gmp-glue.h (NETTLE_BIT_SIZE_TO_LIMB_SIZE): New macro.
* dsa-sign.c (dsa_sign): Adapt to _nettle_dsa_hash change.
* dsa-verify.c (dsa_verify): Likewise.
* ecc-ecdsa-sign.c (ecc_ecdsa_sign): Use _nettle_dsa_hash.
* ecc-ecdsa-verify.c (ecc_ecdsa_verify): Likewise.
* ecc-gostdsa-sign.c (ecc_gostdsa_sign): Use _nettle_gostdsa_hash.
* ecc-gostdsa-verify.c (ecc_gostdsa_verify): Likewise.
* Makefile.in (hogweed_SOURCES): Delete ecc-hash.c
2024-05-15 Niels Möller
* powerpc64/p8/gcm-aes-encrypt.asm: Reduce register usage.
* powerpc64/p8/gcm-aes-decrypt.asm: Analogous changes.
2024-04-14 Niels Möller
From Danny Tsen: Combined gcm-aes implementation for powerpc64.
* configure.ac: Define HAVE_NATIVE_gcm_aes_encrypt and
HAVE_NATIVE_gcm_aes_decrypt.
(asm_nettle_optional_list): Add gcm-aes-encrypt.asm,
gcm-aes-encrypt-2.asm, gcm-aes-decrypt.asm, and
gcm-aes-decrypt-2.asm.
* gcm-internal.h (_gcm_aes_encrypt, _gcm_aes_decrypt): Declare
internal functions, and define as dummy macros when not supported.
* gcm-aes128.c (gcm_aes128_encrypt): Use _gcm_aes_encrypt.
(gcm_aes128_decrypt): Use _gcm_aes_encrypt.
* gcm-aes192.c (gcm_aes192_encrypt, gcm_aes128_decrypt): Likewise.
* gcm-aes256.c (gcm_aes256_encrypt, gcm_aes256_decrypt): Likewise.
* Makefile.in (DISTFILES): Add gcm-internal.h.
* powerpc64/machine.m4 (GF_MUL): New macro.
* powerpc64/fat/gcm-aes-decrypt-2.asm: New file.
* powerpc64/fat/gcm-aes-encrypt-2.asm: New file.
* powerpc64/p8/gcm-aes-decrypt.asm: New file.
* powerpc64/p8/gcm-aes-encrypt.asm: New file.
* fat-setup.h (gcm_aes_crypt_func): New typedef.
* fat-ppc.c: Fat setup for gcm_aes_encrypt and gcm_aes_decrypt.
(gcm_aes_crypt_c): New nop implementation.
2024-03-29 Niels Möller
* bswap-internal.h (nettle_bswap32_n): New inline function.
(bswap32_n_if_le): New macro, to reduce code duplication.
* blowfish-bcrypt.c (bswap32_if_le_n): Deleted, usage replaced
with shared bswap32_n_if_le.
* umac-set-key.c (bswap32_if_le_n): Likewise.
2024-03-28 Niels Möller
* sha512-224-meta.c (nettle_sha512_224): Change name to
"sha512_224", with underscore rather than dash.
* sha512-256-meta.c (nettle_sha512_256): Analogous change.
* nettle-meta-hashes.c (_nettle_hashes): Add nettle_sha512_224 and
nettle_sha512_256.
* testsuite/meta-hash-test.c: Update test.
2024-03-24 Niels Möller
* testsuite/gcm-test.c (test_main): Add a test case that triggers
32-bit counter wraparound for gcm_aes256, and a larger 719 byte
message.
2024-03-28 Niels Möller
From Daiki Ueno:
* shake128.c (sha3_128_init, sha3_128_update, sha3_128_shake)
(sha3_128_shake_output): New file, new functions.
* testsuite/shake128-test.c: New testcases.
* Makefile.in (nettle_SOURCES): Add shake128.c.
* testsuite/Makefile.in (TS_NETTLE_SOURCES): Add shake128-test.c.
2024-03-24 Niels Möller
* sha3-shake.c (_nettle_sha3_shake, _nettle_sha3_shake_output):
New file, new functions. Generalizations of sha3_256_shake and
sha3_256_shake_output, respectively.
(_nettle_sha3_shake_output): Use one's complement of index,
instead of just setting high bit.
* shake256.c (sha3_256_shake, sha3_256_shake_output): Implement in
terms of calls to the new functions.
* Makefile.in (nettle_SOURCES): Add sha3-shake.c.
* sha3.c (_nettle_sha3_update): Use MD_FILL_OR_RETURN_INDEX.
(sha3_xor_block): New function, taken out from sha3_absorb.
(_nettle_sha3_pad): Call sha3_xor_block, not sha3_absorb.
* sha3-internal.h (_sha3_pad_shake): By above change, no longer
implies sha3_permute.
(_sha3_pad_hash): Update, to still include a
call to sha3_permute.
* shake256.c (sha3_256_shake, sha3_256_shake_output): Update to
call sha3_permute before generating output.
2024-03-20 Niels Möller
* testsuite/gcm-test.c (test_main): Add a test case that triggers
32-bit counter wraparound for gcm_aes128.
2024-03-10 Niels Möller
From Daiki Ueno:
* shake256.c (sha3_256_shake_output): New function, incremental
shake256 output.
* testsuite/shake256-test.c (test_incremental): New function, for
testing sha3_256_shake_output.
(test_main): Use it.
2024-03-10 Niels Möller
* poly1305-update.c (_nettle_poly1305_update): Explicitly check
for empty input and return.
* testsuite/testutils.c (test_aead): Test with associated split
data into two pieces in different ways, respecting block
boundaries. Also add a call to update(ctx, 0, NULL) in the
middle, and encrypt and decrypt calls with empty input.
2024-03-08 Niels Möller
Fix ubsan issues for empty hash updates.
* macros.h (MD_UPDATE): Check upfront if length is zero. Avoids
calling memcpy(dst, NULL, 0), which is undefined behavior.
* sha256.c (sha256_update): Likewise.
* sha3.c (_nettle_sha3_update): Likewise.
* testsuite/testutils.c (test_hash): Test with message split into
two pieces in different ways, and also add an call to update(ctx,
0, NULL) in the middle.
2024-02-16 Niels Möller
RSA-OAEP support contributed by Nicolas Mora and Daiki Ueno:
* rsa-oaep-encrypt.c (_rsa_oaep_encrypt)
(rsa_oaep_sha256_encrypt, rsa_oaep_sha384_encrypt)
(rsa_oaep_sha512_encrypt): New file, new functions.
* rsa-oaep-decrypt.c (_rsa_oaep_decrypt)
(rsa_oaep_sha256_decrypt, rsa_oaep_sha384_decrypt)
(rsa_oaep_sha512_decrypt): New file, new functions.
* rsa.h: Declare new RSA OAEP functions.
* rsa-internal.h: Declare internal RSA OAEP functions.
* oaep.c (_oaep_sec_decrypt_variable, _oaep_decode_mgf1)
(_oaep_encode_mgf1): New file, new functions.
* oaep.h: New file, declaring internal functions.
* Makefile.in (hogweed_SOURCES): Add oaep.c, rsa-oaep-encrypt.c
rsa-oaep-decrypt.c.
(DISTFILES): Add oaep.h.
* nettle.texinfo (RSA): Document RSA-OAEP functions.
* testsuite/rsa-oaep-encrypt-test.c: New tests.
* testsuite/testutils.c (test_rsa_set_key_2): New function.
* testsuite/Makefile.in (TS_HOGWEED_SOURCES): Add rsa-oaep-encrypt-test.c
(TS_SC_HOGWEED): Add sc-rsa-oaep-encrypt-test.
2024-02-02 Niels Möller
Optimize powerpc64 aes decrypt. Speedup of 80%-100%, depending on
key size, when benchmarked on Power 10:
* configure.ac (asm_replace_list): Add aes-invert-internal.asm.
(asm_nettle_optional_list): Add aes-invert-internal-2.asm.
* powerpc64/p8/aes-invert-internal.asm (_aes_invert): New file.
Implementat _aes_invert as just a memcpy.
* powerpc64/p8/aes-decrypt-internal.asm: Rework to use unmixed
encryption subkeys, which fits better with the vncipher
instruction, and eliminates lots of vxor instructions.
* powerpc64/fat/aes-invert-internal-2.asm: New file.
* aes-invert-internal.c: Check HAVE_NATIVE_aes_invert, and define
_nettle_aes_invert_c wen needed.
* fat-setup.h (aes_invert_internal_func): New typedef.
* fat-ppc.c: Add fat setup for _aes_invert.
2024-01-28 Niels Möller
* powerpc64/p8/aes-encrypt-internal.asm: Use r10-r12 consistently
for indexing, and reducing number of used callee-save registers.
* powerpc64/p8/aes-decrypt-internal.asm: Likewise.
2024-01-27 Niels Möller
* aes-invert-internal.c (_nettle_aes_invert): Don't reorder the subkeys.
* aes-decrypt-internal.c (_nettle_aes_decrypt): Updated to process
subkeys starting from the end, and let subkeys pointer point at
the subkey for the first decrypt round, located at the end of the
array.
* aes128-decrypt.c (nettle_aes128_decrypt): Updated accordingly.
* aes192-decrypt.c (nettle_aes192_decrypt): Likewise.
* aes256-decrypt.c (nettle_aes256_decrypt): Likewise.
* arm/aes.m4 (AES_LOAD_INCR): New macro, specifying desired
increment of key pointer.
* arm/aes-decrypt-internal.asm: Updated for new conventions.
* arm/v6/aes-decrypt-internal.asm: Likewise.
* arm64/crypto/aes128-decrypt.asm: Likewise.
* arm64/crypto/aes192-decrypt.asm: Likewise.
* arm64/crypto/aes256-decrypt.asm: Likewise.
* powerpc64/p8/aes-decrypt-internal.asm: Likewise.
* sparc64/aes-decrypt-internal.asm: Likewise.
* x86/aes-decrypt-internal.asm: Likewise.
* x86_64/aes-decrypt-internal.asm: Likewise.
* x86_64/aes-decrypt-internal.asm: Likewise.
* x86_64/aesni/aes128-decrypt.asm: Likewise.
* x86_64/aesni/aes192-decrypt.asm: Likewise.
* x86_64/aesni/aes256-decrypt.asm: Likewise.
2024-01-26 Niels Möller
Delete all sparc32 assembly.
* sparc32/aes-decrypt-internal.asm: Deleted file.
* sparc32/aes-encrypt-internal.asm: Deleted file.
* configure.ac: Don't enable any assembly for 32-bit sparc.
* Makefile.in (distdir): Don't distribute sparc32 files.
* sparc64/aes.m4: Moved file, from...
* sparc32/aes.m4: ... old location.
* sparc64/aes-encrypt-internal.asm: Update for location of aes.m4.
* sparc64/aes-decrypt-internal.asm: Likewise.
2024-01-23 Niels Möller
* powerpc64/machine.m4 (GHASH_REDUCE): New macro. Improve
scheduling, adding vpmsumd result last.
* powerpc64/p8/ghash-update.asm: Use GHASH_REDUCE, slightly reduce
vector register usage, simplify use of index registers.
2024-01-21 Niels Möller
* powerpc64/machine.m4 (OPN_XXY, OPN_XXXY): New macros.
* powerpc64/p8/aes-encrypt-internal.asm: Use macros for repeated
instruction patterns.
* powerpc64/p8/aes-decrypt-internal.asm: Likewise.
2023-12-27 Niels Möller
* testsuite/gcm-test.c (test_main): Additional gcm test case, with
719 byte message, contributed by Danny Tsen.
2023-12-08 Niels Möller
Delete all md5 assembly code.
* md5.c (nettle_md5_compress): Move function and related macros
here, from...
* md5-compress.c: ... deleted file.
* x86/md5-compress.asm: Deleted file.
* x86_64/md5-compress.asm: Deleted file.
* configure.ac: When checking for openssl, use AC_LINK_IFELSE to
check if needed functions really are available. Just using
AC_CHECK_LIB to check for, e.g., EVP_RSA_gen, doesn't work, since
that is a macro that depends on including openssl/rsa.h.'
2023-12-06 Niels Möller
* drbg-ctr-aes256.c (drbg_ctr_aes256_output): New helper function.
(drbg_ctr_aes256_update, drbg_ctr_aes256_random): Use it.
From Simon Josefsson:
* drbg-ctr.h (struct drbg_ctr_aes256_ctx): New context struct.
(DRBG_CTR_AES256_SEED_SIZE): New constant.
* drbg-ctr-aes256.c (drbg_ctr_aes256_update)
(drbg_ctr_aes256_init, drbg_ctr_aes256_random): New file, new functions.
* testsuite/drbg-ctr-aes256-test.c: New testcase.
* nettle.texinfo (Randomness): Document DRBG-CTR.
2023-12-05 Niels Möller
From Tim Kosse:
* fat-arm64.c (check_sysctlbyname) [__APPLE__]: New function.
(get_arm64_features) [__APPLE__]: Fix feature detection for Apple
M1 devices.
* configure.ac: In openssl tests, check for the headers actually
used by the benchmarking code, and for a subset of the relevant
functions.
* examples/nettle-openssl.c: Trim openssl includes and defines,
and use Nettle's definition of sha1 and md5 constants.
(nettle_openssl_init): Deleted.
* examples/nettle-benchmark.c (main): Delete call to nettle_openssl_init.
2023-12-04 Niels Möller
* examples/nettle-openssl.c (nettle_openssl_blowfish128)
(nettle_openssl_des, openssl_cast128_set_encrypt_key): Deleted,
since these algorithms are now available in openssl only via the
"legacy provider". Also deleted declarations and usage.
* examples/hogweed-benchmark.c (struct openssl_ctx): Unified
struct, replacing openssl_rsa_ctx and openssl_ecdsa_ctx.
(bench_openssl_init, bench_openssl_sign, bench_openssl_verify)
(bench_openssl_clear): New functions, using EVP interfaces to
signing, replacing rsa- and ecdsa-specific functions.
(bench_openssl_rsa_init, bench_openssl_ecdsa_init): Use bench_openssl_init.
2023-11-23 Niels Möller
* nettle-internal.h: Keep only declarations actually used
internally in the library.
* non-nettle.h: New file, contents extracted from
nettle-internal.h, for use in test and benchmark code.
* non-nettle.c: New file, renamed from ...
* nettle-internal.c: ... old name, deleted.
* Makefile.in (internal_SOURCES, DISTFILES): Updated accordingly.
* testsuite/Makefile.in (TEST_OBJS): Replace ../nettle-internal.o
with ../non-nettle.o, and update corresponding make rule.
* examples/Makefile.in (BENCH_OBJS): Likewise.
2023-11-22 Niels Möller
Revert part of the 2023-08-05 change.
* rsa-sec-decrypt.c (rsa_sec_decrypt): Merge with
_rsa_sec_decrypt, including input range check.
(_rsa_sec_decrypt): Deleted.
* rsa-internal.h (_rsa_sec_decrypt): Delete declaration.
* testsuite/rsa-sec-decrypt-test.c (rsa_decrypt_for_test): Always
call rsa_sec_decrypt, but don't annotate the ciphertext input as
undefined/secret.
2023-11-15 Niels Möller
* ecc-mod-arith.c (ecc_mod_addmul_1): Use assert_maybe.
* ecc-curve448.c (ecc_curve448_modp): Likewise.
* ecc-curve25519.c (ecc_curve25519_modq): Likewise.
* eddsa-hash.c (_eddsa_hash): Likewise.
* eddsa-sign.c (_eddsa_sign): Likewise.
* testsuite/curve25519-dh-test.c (test_g): Add calls to
mark_bytes_undefined and mark_bytes_defined.
(test_a): Likewise.
(test_main): Skip side-channel tests in builds with mini-gmp or
extra asserts enabled.
* testsuite/curve448-dh-test.c: Analogous changes.
* testsuite/ed448-test.c (test_one): Analogous changes.
* testsuite/ed25519-test.c: Analogous changes.
* testsuite/Makefile.in (TS_SC_HOGWEED): New make variable. Added
sc-curve25519-dh-test, sc-curve448-dh-test, sc-ed25519-test, and
sc-ed448-test to list.
* testsuite/sc-curve25519-dh-test: New testcase.
* testsuite/sc-curve448-dh-test: New testcase.
* testsuite/sc-ed448-test: New testcase.
* testsuite/sc-ed25519-test: New testcase.
2023-11-14 Niels Möller
Add a first side-channel test for the ECC code.
* configure.ac: New option --enable-extra-asserts. Enables asserts
that are disabled by default, due to conflict with tests of
side-channel silence.
(WITH_EXTRA_ASSERTS): Corresponding new define.
* ecc-internal.h (assert_maybe): Conditionally define this assert
macro, depending on WITH_EXTRA_ASSERTS.
* ecc-mod-arith.c: Convert most asserts to assert_maybe.
* ecc-mod-inv.c (ecc_mod_inv): Likewise.
* ecc-mod.c (ecc_mod): Likewise.
* ecc-pm1-redc.c (ecc_pm1_redc): Likewise.
* ecc-pp1-redc.c (ecc_pp1_redc): Likewise.
* ecc-secp192r1.c (ecc_secp192r1_modp): Likewise.
* ecc-secp384r1.c (ecc_secp384r1_modp): Likewise.
* testsuite/ecdsa-sign-test.c (test_ecdsa): Add calls to
mark_bytes_undefined and mark_bytes_defined.
(test_main): Skip side-channel tests in builds with mini-gmp or
extra asserts enabled.
* testsuite/sc-ecdsa-sign-test: New testcase.
* testsuite/Makefile.in (TS_SC): Add sc-ecdsa-sign-test.
2023-11-12 Niels Möller
* gmp-glue.h (GMP_LIMB_BITS) [NETTLE_USE_MINI_GMP]: Define as alias for
GMP_NUMB_BITS.
(is_zero_limb): Move inline function here. Add static, for
compatibility with c89. and mini-gmp builds.
* gmp-glue.c (sec_zero_p): Use is_zero_limb.
2023-11-06 Niels Möller
Avoid comparison like cnd = (x == 0) in code intended to be
side-channel silent, since to eliminate branches with some
compilers/architectures, in particular 32-bit x86 and the msvc compiler.
* nettle-internal.h (IS_ZERO_SMALL): New macro.
* memeql-sec.c (memeql_sec): Use IS_ZERO_SMALL.
* pkcs1-sec-decrypt.c (EQUAL): Likewise.
* cnd-copy.c (cnd_copy): Require that cnd argument is 1 or 0.
* ecc-mul-a.c (ecc_mul_a) [ECC_MUL_A_WBITS == 0]:
Rearrange loop to pass 0 or 1 to cnd_copy.
* ecc-mul-a-eh.c (ecc_mul_a_eh) [ECC_MUL_A_EH_WBITS == 0]:
Likewise.
* ecc-mul-a.c (ecc_mul_a) [ECC_MUL_A_WBITS > 0]: Use
IS_ZERO_SMALL, and pass 0 or 1 to cnd_copy.
* ecc-mul-g.c (ecc_mul_g): Likewise.
* ecc-internal.h (is_zero_limb): New inline function.
* eddsa-decompress.c (_eddsa_decompress): Likewise.
* ecc-gostdsa-sign.c (ecc_gostdsa_sign): Likewise.
* ecc-mod-arith.c (ecc_mod_zero_p): Likewise.
(ecc_mod_equal_p): Avoid comparison cy == 0.
* ecc-j-to-a.c (ecc_j_to_a): Avoid comparison cy == 0.
2023-10-06 Niels Möller
* testsuite/rsa-sec-decrypt-test.c (test_main): Skip side-channel
test if built with mini-gmp.
* testsuite/sc-valgrind.sh (with_valgrind): Pass
--exit-on-first-error=yes.
* aclocal.m4 (NETTLE_PROG_VALGRIND): New macro.
* configure.ac: Use it.
* testsuite/Makefile.in (TS_SH): Include side-channel tests only
if we have a working valgrind.
* misc/c89: New wrapper script to force compiling in c89 mode.
2023-10-04 Niels Möller
* bswap-internal.h (bswap32_if_be, bswap32_if_le): New macros.
* blowfish-bcrypt.c (bswap32_if_le_n): Rename, to not collide with
new macro.
(bswap32_if_le): ... old name, deleted.
* umac-set-key.c (bswap32_if_le_n): Define in the same way as for
bcrypt, replacing...
(BE_SWAP32_N): ...deleted macro.
* umac-l3.c (_nettle_umac_l3_init): Use bswap64_if_le.
* umac-l2.c (_nettle_umac_l2_init): Use bswap32_if_le.
* chacha-core-internal.c (_nettle_chacha_core): Use bswap32_if_be.
* salsa20-core-internal.c (_nettle_salsa20_core): Likewise
* umac-l2.c (_nettle_umac_l2_final): Delete redundant assignment.
2023-10-03 Niels Möller
* Makefile.in (check-fat): Reduce tests to run to TS_FAT, to speed
up tests.
* testsuite/Makefile.in (TS_FAT): Define list of tests relevant
for testing algorithm variants in fat builds.
* testsuite/ecc-mod-arith-test.c: Reduce test count, aiming to get
test to complete in roughly 0.1s.
* testsuite/ecc-mod-test.c: Likewise.
* testsuite/ecc-modinv-test.c: Likewise.
* testsuite/ecc-mul-a-test.c: Likewise.
* testsuite/ecc-redc-test.c: Likewise.
* testsuite/ecc-sqrt-test.c: Likewise.
* testsuite/eddsa-compress-test.c: Likewise.
* testsuite/poly1305-test.c: Likewise.
* testsuite/random-prime-test.c: Likewise.
* testsuite/rsa-compute-root-test.c: Likewise.
* testsuite/rsa-sec-decrypt-test.c: Likewise.
* testsuite/Makefile.in (TS_SH): Delete tools tests from list.
* tools/Makefile.in (check): Run tools tests from this target.
(TS_ALL): New variable.
(DISTFILES): Add TS_ALL files.
* testsuite/teardown-env: Deleted, intead let make clean delete
test files.
* tools/nettle-pbkdf2-test: Moved, from testseuite/.
* tools/sexp-conv-test: Likewise.
* tools/pkcs1-conv-test: Likewise.
2023-08-05 Niels Möller
* testsuite/testutils.c (mark_bytes_undefined)
(mark_bytes_defined): New functions. Update side-channel related
tests to use them.
(main): Check environment variable NETTLE_TEST_SIDE_CHANNEL.
(test_side_channel): New global variable.
* testsuite/sc-valgrind.sh (with_valgrind): New file, new shell
utility function.
* testsuite/sc-pkcs1-sec-decrypt-test: New test, for side channel
silence.
* testsuite/sc-memeql-test: Likewise.
* testsuite/sc-gcm-test: Likewise.
* testsuite/sc-cnd-memcpy-test: Likewise.
* testsuite/rsa-sec-decrypt-test: Likewise.
* rsa-sec-decrypt.c (_rsa_sec_decrypt): New internal function,
without input range checks.
(rsa_sec_decrypt): Use it.
2023-08-02 Niels Möller
* configure.ac: Replace obsoleted macros, require autoconf-2.69,
from 2012, or later.
* aclocal.m4: Likewise.
* aclocal.m4 (LSH_FUNC_STRERROR): Delete macro.
(LSH_FUNC_STRSIGNAL): Delete unused macro.
* configure.ac: Delete usage of LSH_FUNC_STRERROR.
* tools/nettle-hash.c (main): Use strerror unconditionally.
* tools/nettle-pbkdf2.c (main): Likewise.
2023-08-01 Niels Möller
* configure.ac: Delete special handling of rntcl; it should be
treated like any other cross compiler. Delete obsolete check of
ac_cv_prog_cc_stdc.
2023-06-01 Niels Möller
* Released Nettle-3.9.1.
2023-05-26 Niels Möller
* configure.ac: Bump package version, to 3.9.1.
(LIBNETTLE_MINOR): Bump minor number, to 8.8.
(LIBHOGWEED_MINOR): Bump minor number, to 6.8.
2023-05-19 Niels Möller
From Jussi Kivilinna:
* ocb.c (ocb_crypt_n): Fix broken loop logic.
* testsuite/ocb-test.c (test_main): Add test vector from libgcrypt,
with larger message, to exercise above loop.
2023-05-16 Niels Möller
* x86_64/ghash-update.asm: Use separate unaligned load
instructions (movups) to load the tabulated values, since they are
only 8-byte aligned and pand memory operands require 16-byte
alignment.
2023-05-15 Niels Möller
* eccdata.c (output_bignum_redc): Add missing mpz_clear, reported
by Noah Watkins.
(output_digits): Delete a gratuitous mpz_init.
2023-05-14 Niels Möller
* Released nettle-3.9.
2023-05-12 Niels Möller
* texinfo.tex: Delete unused file.
Copy files from https://git.savannah.gnu.org/cgit/gnulib.git/plain/build-aux/
* install-sh: Update to 2020-11-14.01 version.
* config.guess: Update to 2023-01-01 version.
* config.sub: Update to 2023-01-21 version.
2023-05-10 Niels Möller
Fix compile error in --disable-public-key configuration.
* testsuite/sha1-test.c: Add missing include of sha1.h.
* testsuite/sha256-test.c: Add missing include of sha2.h.
2023-05-07 Niels Möller
* configure.ac: Bump package version, to 3.9.
(LIBNETTLE_MINOR): Bump minor number, to 8.7 (8.6 was used for
Nettle-3.8.1).
(LIBHOGWEED_MINOR): Bump minor number, to 6.7.
2023-04-25 Niels Möller
Rework tests of SIV message functions.
* testsuite/siv-gcm-test.c (nettle_encrypt_message_func)
(nettle_decrypt_message_func): Delete typedefs.
(test_compare_results, test_cipher_siv_gcm): Delete functions.
(test_siv_gcm_aes128, test_siv_gcm_aes256): Delete macros.
(siv_gcm_aes128, siv_gcm_aes256): New algorithm structs.
(test_main): Use test_aead_message.
* testsuite/siv-cmac-test.c (nettle_encrypt_message_func)
(nettle_decrypt_message_func): Delete typedefs.
(test_compare_results, test_cipher_siv): Delete functions.
(test_siv_aes128, test_siv_aes256): Delete macros.
(siv_cmac_aes128, siv_cmac_aes256): New algorithm structs.
(test_main): Use test_aead_message.
2023-04-24 Niels Möller
Rework tests of OCB message functions.
* testsuite/testutils.c (test_aead_message): New function, for
testing AEAD message functions.
* testsuite/testutils.h (nettle_encrypt_message_func)
(nettle_decrypt_message_func): New typedefs.
(struct nettle_aead_message): New struct.
* testsuite/ocb-test.c (nettle_encrypt_message_func)
(nettle_decrypt_message_func): Deleted typedefs.
(test_compare_results): Deleted function.
(test_ocb_aes128): Deleted macro.
(struct ocb_aes128_message_key): New struct.
(ocb_aes128_set_encrypt_key_wrapper)
(ocb_aes128_set_decrypt_key_wrapper)
(ocb_aes128_encrypt_message_wrapper)
(ocb_aes128_decrypt_message_wrapper): New wrapper functions, using
above ocb_aes128_message_key for both encrypt and decrypt, and a
fix tag length of 16 octets.
(ocb_aes128_message): New algorithm struct, with above wrappers.
(test_main): Use test_aead_message.
2023-04-23 Niels Möller
* testsuite/siv-cmac-test.c: Renamed file, from...
* testsuite/siv-test.c: ... old name.
2023-04-13 Niels Möller
* ghash-update.c (gcm_gf_mul): Rewrite to avoid side-channel
leakage. Now processes the message bits one at a time, using
tabulated values of the key premultiplied by appropriate powers of
x, so that the table is accessed in a fixed sequential order.
Performance penalty, on x86_64, is roughly 3 times.
(shift_table): Deleted table.
(gcm_gf_shift_8): Deleted function.
* ghash-set-key.c (_ghash_set_key): Rewrite table generation.
* gcmdata.c: Deleted.
* Makefile.in: Delete references to gcmdata.
* x86_64/ghash-update.asm: Rewritten, similar side-channel silent
method as the C implementation, with same table layout, but using
sse2 instructions.
* testsuite/gcm-test.c (test_ghash_internal): Add valgrind
annotations, to verify that the ghash implementation makes no
data-dependent branches or memory accesses.
* examples/nettle-benchmark.c (bench_ghash_update): New function.
2023-04-03 Niels Möller
From Mamone Tarsha:
* x86_64/pclmul/ghash-update.asm: New loop to process two blocks
at a time.
* x86_64/pclmul/ghash-set-key.asm: Likewise.
2023-03-25 Niels Möller
* ocb.h (OCB_MAX_NONCE_SIZE): New constant.
2023-02-16 Niels Möller
* x86_64/sha256-compress-n.asm: Fix incorrect w64 setup. Report
and fix from Gisle Vanem.
2023-02-08 Niels Möller
* examples/nettle-benchmark.c (main): Benchmark ocb_aes128.
2023-02-07 Niels Möller
Implement OCB mode. RFC 7253.
* block-internal.h (block16_set): New function.
* ocb.c (ocb_set_key, ocb_set_nonce, ocb_update, ocb_encrypt)
(ocb_decrypt, ocb_encrypt_message, ocb_decrypt_message): New
public functions.
(MEM_ROTATE_RIGHT, MEM_MASK): New macros.
(extract, update_offset, pad_block, ocb_fill_n, ocb_crypt_n)
(ocb_checksum_n): New helper functions.
* ocb-aes128.c (ocb_aes128_set_encrypt_key)
(ocb_aes128_set_decrypt_key, ocb_aes128_set_nonce)
(ocb_aes128_update, ocb_aes128_encrypt, ocb_aes128_decrypt)
(ocb_aes128_digest, ocb_aes128_encrypt_message)
(ocb_aes128_decrypt_message): New file, new functions.
* ocb.h: Declare ocb functions.
(struct ocb_key): New struct.
(struct ocb_ctx): New struct.
(struct ocb_aes128_encrypt_key): New struct.
* Makefile.in (nettle_SOURCES): Add ocb.c ocb-aes128.c.
(HEADERS): Add ocb.h.
* nettle-internal.c (nettle_ocb_aes128)
(ocb_aes128_set_encrypt_key_wrapper)
(ocb_aes128_set_decrypt_key_wrapper)
(ocb_aes128_set_nonce_wrapper, ocb_aes128_update_wrapper)
(ocb_aes128_encrypt_wrapper, ocb_aes128_decrypt_wrapper)
(ocb_aes128_digest_wrapper): New aead algorithm, and
related wrapper functions.
* nettle-internal.h (OCB_NONCE_SIZE): New constant.
(struct ocb_aes128_ctx): New struct.
* testsuite/ocb-test.c: New tests.
* testsuite/Makefile.in (TS_NETTLE_SOURCES): Add ocb-test.c.
2023-02-06 Niels Möller
* testsuite/testutils.c (test_aead): Always use set_nonce function
pointer if non-NULL, test varying alignment, output the unexpected
data when test fails.
2022-12-05 Niels Möller
* xts-aes128.c (xts_aes128_encrypt_message)
(xts_aes128_decrypt_message): const-declare the xts_key argument.
* xts-aes256.c (xts_aes256_encrypt_message)
(xts_aes256_decrypt_message): Likewise.
2022-11-09 Niels Möller
From Mamone Tarsha:
* powerpc64/p9/poly1305-blocks.asm: New file, multi-block radix
2^44 implementation. Benchmarked to give a speedup of 3.2 times on
Power9.
* powerpc64/p9/poly1305.m4 (DEFINES_BLOCK_R64, BLOCK_R64): New
file, new macros.
* powerpc64/p9/poly1305-internal.asm: Use BLOCK_R64 macro.
* powerpc64/machine.m4 (INC_GPR, INC_VR): New macros.
* powerpc64/fat/poly1305-blocks.asm: New file.
* poly1305-update.c: Check HAVE_NATIVE_fat_poly1305_blocks, and
define _nettle_poly1305_blocks_c when needed.
* fat-ppc.c: Fat setup for _nettle_poly1305_blocks.
2022-11-07 Niels Möller
* configure.ac (ASM_FLAGS): New configure environment variable.
* aclocal.m4 (GMP_TRY_ASSEMBLE): Use $ASM_FLAGS.
* config.make.in (ASM_FLAGS): Add substitution.
* Makefile.in: Use $(ASM_FLAGS) when compiling .asm files.
2022-10-31 Niels Möller
* configure.ac: (asm_file_list): Add HAVE_NATIVE_poly1305_blocks.
(asm_nettle_optional_list): Add poly1305-blocks.asm.
* x86_64/poly1305-blocks.asm: New file.
* md-internal.h (MD_FILL_OR_RETURN_INDEX): New macro.
* poly1305-update.c (_nettle_poly1305_update): New file and
function.
* poly1305-internal.h: Declare _nettle_poly1305_blocks and
_nettle_poly1305_update.
* chacha-poly1305.c (poly1305_update): Use _nettle_poly1305_update.
* poly1305-aes.c (poly1305_aes_update): Likewise.
* Makefile.in (nettle_SOURCES): Add poly1305-update.c.
2022-10-13 Niels Möller
* gmp-glue.c (mpn_sec_tabselect) [NETTLE_USE_MINI_GMP]: Add back
here, to support mini-gmp builds. Updated signature to be
compatible with the gmp version.
* gmp-glue.h: Add declaration.
2022-10-11 Niels Möller
* sec-tabselect.c (sec_tabselect): Delete file and function. All
callers updated to use gmp's mpn_sec_tabselect instead, which is
implemented in assembly on many platforms.
2022-10-02 Niels Möller
* examples/ecc-benchmark.c (bench_curve): Add benchmarking of
modulo q inversion.
2022-09-29 Niels Möller
* ecc-ecdsa-verify.c (ecc_ecdsa_verify): Call ecc_mul_g and ecc_mul_a directly, not via
function pointers.
(ecc_ecdsa_verify_itch): Use ECC_MUL_A_ITCH
rather than ecc->mul_itch.
* ecc-gostdsa-verify.c (ecc_gostdsa_verify_itch)
(ecc_gostdsa_verify): Analogous changes.
* ecc-ecdsa-sign.c (ecc_ecdsa_sign): Call ecc_mul_g and ecc_j_to_a
directly, not via function pointers.
(ecc_ecdsa_sign_itch): Use ECC_MUL_G_ITCH rather than
ecc->mul_g_itch.
* ecc-gostdsa-sign.c (ecc_gostdsa_sign_itch, ecc_gostdsa_sign):
Analogous changes.
2022-09-28 Niels Möller
* testsuite/meta-hash-test.c (test_main): Add check of
NETTLE_MAX_HASH_BLOCK_SIZE.
* nettle-internal.h (NETTLE_MAX_HASH_BLOCK_SIZE): Increase to 144,
to accommodate sha3_224.
* testsuite/meta-cipher-test.c (test_main): Check that cipher
metadata doesn't exceed NETTLE_MAX_CIPHER_BLOCK_SIZE or
NETTLE_MAX_CIPHER_KEY_SIZE.
From Daiki Ueno:
* siv-gcm.c (siv_gcm_encrypt_message, siv_gcm_decrypt_message):
New file, implementation of SIV-GCM.
* siv-gcm.h (SIV_GCM_BLOCK_SIZE, SIV_GCM_DIGEST_SIZE)
(SIV_GCM_NONCE_SIZE): New header file, new constants and
declarations.
* siv-gcm-aes128.c (siv_gcm_aes128_encrypt_message)
(siv_gcm_aes128_decrypt_message): New file and functions.
* siv-gcm-aes256.c (siv_gcm_aes256_encrypt_message)
(siv_gcm_aes256_decrypt_message): Likewise.
* siv-ghash-set-key.c (_siv_ghash_set_key): New file, new internal
function.
* siv-ghash-update.c (_siv_ghash_update): Likewise.
* block-internal.h (block16_bswap): New inline function.
* bswap-internal.h (bswap64_if_be): New macro.
* nettle-internal.h (NETTLE_MAX_CIPHER_KEY_SIZE): New constant.
* Makefile.in (nettle_SOURCES): Add new source files.
(HEADERS): Add siv-gcm.h.
* testsuite/siv-gcm-test.c: New tests.
* testsuite/Makefile.in (TS_NETTLE_SOURCES): Add siv-gcm-test.c.
* nettle.texinfo (SIV-GCM): Documentation.
From Zoltan Fridrich:
* balloon.c (balloon, balloon_itch): Implementation of balloon
password hash.
* balloon.h: New header file.
* balloon-sha1.c (balloon_sha1): New file and function.
* balloon-sha256.c (balloon_sha256): Likewise.
* balloon-sha384.c (balloon_sha384): Likewise.
* balloon-sha512.c (balloon_sha512): Likewise.
* Makefile.in (nettle_SOURCES): Add balloon source files.
(HEADERS): Add ballon.h.
* testsuite/balloon-test.c: New tests.
* testsuite/Makefile.in (TS_NETTLE_SOURCES): Add balloon-test.c.
2022-09-14 Niels Möller
* ecc-nonsec-add-jjj.c (ecc_nonsec_add_jjj): New file and
function.
* ecc-internal.h: Declare it.
* Makefile.in (hogweed_SOURCES): Add ecc-nonsec-add-jjj.c.
* testsuite/ecc-add-test.c (test_main): Add tests for ecc_nonsec_add_jjj.
* ecc-ecdsa-verify.c (ecc_ecdsa_verify): Use ecc_nonsec_add_jjj,
to produce correct result in a corner case where point addition
needs to use point duplication. Also use ecc_j_to_a rather than
ecc->h_to_a, since ecdsa supports only weierstrass curves.
* ecc-gostdsa-verify.c (ecc_gostdsa_verify): Analogous change.
* testsuite/ecdsa-verify-test.c (test_main): Add corresponding test.
* testsuite/ecdsa-sign-test.c (test_main): And a test producing
the problematic signature.
2022-09-08 Niels Möller
* eccdata.c (string_toupper): New utility function.
(output_modulo): Move more of the per-modulo output here.
(output_curve): Remove corresponding code.
2022-08-31 Niels Möller
* bswap-internal.h (nettle_bswap64, nettle_bswap32)
(bswap64_if_le): New header file, new inline functions/macros.
* gcm.c (gcm_hash_sizes): Use bswap64_if_le, and bswap-internal.h,
replacing local definition of bswap_if_le.
* nist-keywrap.c (nist_keywrap16): Likewise.
* blowfish-bcrypt.c (swap32): Renamed function, to...
(bswap32_if_le): ...new name, rewritten to use nettle_bswap32.
Update call sites.
* Makefile.in (DISTFILES): Add bswap-internal.h.
2022-08-18 Niels Möller
* Makefile.in (HEADERS): Add sm4.h.
From Tianjia Zhang: SM4 block cipher.
* sm4.c: New file.
* sm4.h: New file.
* sm4-meta.c: New file.
* gcm-sm4.c: New file
* gcm-sm4-meta.c: New file.
* nettle.texinfo: Document SM4.
* testsuite/gcm-test.c (test_main): Add SM4 tests.
* testsuite/sm4-test.c: New file.
* configure.ac (ABI): Change mips abi check to apply only to mips64.
2022-08-17 Niels Möller
* testsuite/testutils.c (mpz_urandomm) [NETTLE_USE_MINI_GMP]: New
fallback definition when building with mini-gmp.
2022-08-16 Niels Möller
* ecc-mod-arith.c (ecc_mod_sub): Ensure that if inputs are in the
range 0 <= a, b < 2m, then output is in the same range.
* eccdata.c (output_curve): New outputs ecc_Bm2p and ecc_Bm2q.
* ecc-internal.h (struct ecc_modulo): New member Bm2m (B^size -
2m), needed by ecc_mod_sub. Update all curves.
* testsuite/ecc-mod-arith-test.c: New tests for ecc_mod_add and
ecc_mod_sub.
* eccdata.c (output_modulo): Output the limb size, delete return
value.
(output_curve): Update calls to output_modulo, other minor cleanup.
2022-08-07 Niels Möller
Delete all arcfour assembly code.
* arcfour.c (arcfour_crypt): Moved function here, from...
* arcfour-crypt.c: ... deleted file.
* sparc32/arcfour-crypt.asm: Deleted.
* sparc64/arcfour-crypt.asm: Deleted.
* x86/arcfour-crypt.asm: Deleted.
* asm.m4: Delete arcfour structure offsets.
2022-08-07 Niels Möller
Based on patch from Corentin Labbe:
* nettle.texinfo: Document sha256_compress, sha512_compress,
md5_compress and sha1_compress.
* configure.ac: Refer to nettle-types.h, rather than arcfour.c,
for AC_CONFIG_SRCDIR.
2022-08-05 Niels Möller
* nettle-internal.h: Include stdlib.h, fix alloca warnings on BSD.
* hmac.c: Delete corresponding include here, no longer needed.
* getopt.c: Include stdlib.h and unistd.h unconditionally,
similarly to the gnulib version of this file.
2022-08-04 Niels Möller
From Brad Smith:
* configure.ac: Fix 64-bit MIPS ABI check for other OS's like *BSD / Linux.
* aclocal.m4 (LSH_CCPIC): Use proper PIC flag for *BSD OS's.
* blowfish-bcrypt.c (swap32): Eliminate conflict with OpenBSD's swap32 macro.
2022-07-29 Niels Möller
* s390x/msa_x1/sha256-compress-n.asm: New file. replacing...
* s390x/msa_x1/sha256-compress.asm: ...deleted file.
* s390x/fat/sha256-compress-n-2.asm: New file. replacing...
* s390x/fat/sha256-compress-2.asm: ...deleted file.
* fat-s390x.c: Update fat setup.
2022-07-26 Niels Möller
* arm/v6/sha256-compress-n.asm: New file. replacing...
* arm/v6/sha256-compress.asm: ...deleted file.
* arm/fat/sha256-compress-n-2.asm: New file. replacing...
* arm/fat/sha256-compress-2.asm: ...deleted file.
* fat-arm.c: Update fat setup.
2022-07-11 Niels Möller
* arm64/crypto/sha256-compress-n.asm: New file. replacing...
* arm64/crypto/sha256-compress.asm: ...deleted file.
* arm64/fat/sha256-compress-n-2.asm: New file. replacing...
* arm64/fat/sha256-compress-2.asm: ...deleted file.
* fat-arm64.c: Update fat setup.
2022-07-05 Niels Möller
* md-internal.h (MD_FILL_OR_RETURN): New file, new macro.
* sha256-compress-n.c (_nettle_sha256_compress_n): New file and
function, replacing...
* sha256-compress.c (_nettle_sha256_compress): ...deleted file and
function.
* sha2-internal.h (_nettle_sha256_compress_n): Declare new function..
* sha256.c (sha256_compress): Update to use
_nettle_sha256_compress_n and MD_FILL_OR_RETURN.
* x86_64/sha256-compress-n.asm: New file. replacing...
* x86_64/sha256-compress.asm: ...deleted file.
* x86_64/sha_ni/sha256-compress-n.asm: New file. replacing...
* x86_64/sha_ni/sha256-compress.asm: ...deleted file.
* fat-setup.h (sha256_compress_n_func): New typedef, replacing...
(sha256_compress_func): ... deleted typedef.
* fat-x86_64.c: Update fat setup.
2022-06-20 Niels Möller
* testsuite/sha1-test.c (test_sha1_compress): New function.
(test_main): Add tests for compressing 0, 1 or 2 blocks.
* testsuite/sha256-test.c (test_sha256_compress): New function.
(test_main): Add tests for compressing 0, 1 or 2 blocks.
2022-06-12 Niels Möller
From Christian Weisgerber:
* fat-arm64.c (get_arm64_features): Enable runtime feature
detection for openbsd.
2022-06-09 Niels Möller
* md5.h (md5_compress): New public name for compression function.
* sha1.h (sha1_compress): Likewise.
Based on patches from Corentin Labbe:
* sha2.h: Declare new functions.
* sha256.c (sha256_compress): New function.
(COMPRESS): Updated to use sha256_compress.
(sha256_write_digest): Use sha256_compress directly.
* sha512.c (sha512_compress): New function.
(COMPRESS): Updated to use sha512_compress.
(sha512_write_digest): Use sha512_compress directly.
2022-06-02 Niels Möller
* Released nettle-3.8.
2022-05-23 Niels Möller
* Makefile.in (OPT_SOURCES): Add missing file fat-arm64.c.
* config.guess: Update to 2022-05-08 version.
* config.sub: Update to 2022-01-03 version.
2022-05-20 Niels Möller
* configure.ac: Bump package version, to 3.8.
(LIBNETTLE_MINOR): Bump minor number, to 8.5.
(LIBHOGWEED_MINOR): Bump minor number, to 6.5.
2022-05-05 Niels Möller
* nettle.texinfo (CBC): Document cbc_aes128_encrypt,
cbc_aes192_encrypt and cbc_aes256_encrypt.
2022-04-28 Niels Möller
* nettle.texinfo (Copyright): Deleted incomplete and out of date
list of authors. Replaced by...
* AUTHORS: New updated list of authors and contributions.
2022-02-23 Niels Möller
Analogous s390x update, by Mamone Tarsha:
* fat-s390x.c (fat_init): Update fat init for new _ghash_set_key
and _ghash_update functions, delete setup for old gcm functions.
* s390x/fat/ghash-update-2.asm: New file.
* s390x/fat/ghash-set-key-2.asm: New file.
* s390x/fat/gcm-hash.asm: Deleted.
* s390x/msa_x4/gcm-hash.asm: Deleted, split into two new files...
* s390x/msa_x4/ghash-update.asm: New file.
* s390x/msa_x4/ghash-set-key.asm: New file
2022-02-22 Niels Möller
* fat-ppc.c (fat_init): Update fat init for new _ghash_set_key
and _ghash_update functions, delete setup for old gcm functions.
* powerpc64/fat/ghash-update-2.asm: New file.
* powerpc64/fat/ghash-set-key-2.asm: New file.
* powerpc64/fat/gcm-hash.asm: Deleted.
* powerpc64/p8/gcm-hash.asm: Deleted, split into two new files...
* powerpc64/p8/ghash-update.asm: New file.
* powerpc64/p8/ghash-set-key.asm: New file
2022-02-21 Niels Möller
* fat-arm64.c (fat_init): Update fat init for new _ghash_set_key
and _ghash_update functions, delete setup for old gcm functions.
* arm64/fat/ghash-update-2.asm: New file.
* arm64/fat/ghash-set-key-2.asm: New file.
* arm64/fat/gcm-hash.asm: Deleted.
* ghash-update.c (_nettle_ghash_update_c): New name, for fat builds.
* arm64/crypto/gcm-hash.asm: Deleted, split into two new files...
* arm64/crypto/ghash-set-key.asm: New file.
* arm64/crypto/ghash-update.asm: New file.
2022-02-19 Niels Möller
* fat-x86_64.c (fat_init): Update fat init for new _ghash_set_key
and _ghash_update functions, delete setup for old gcm functions.
* fat-setup.h (ghash_set_key_func, ghash_update_func): New
typedefs.
(gcm_init_key_func, gcm_hash_func): Deleted typedefs.
* x86_64/fat/ghash-update.asm: New file.
* x86_64/fat/ghash-update-2.asm: New file.
* x86_64/fat/ghash-set-key-2.asm: New file.
* x86_64/fat/gcm-hash.asm: Deleted.
* ghash-set-key.c (_nettle_ghash_set_key_c): New name, for fat
builds.
* configure.ac (asm_nettle_optional_list): Add ghash-set-key-2.asm
ghash-update-2.asm.
* ghash-set-key.c (_ghash_digest): Deleted, and also deleted
assembly implementations.
* gcm.c (gcm_digest): Replace call to _ghash_digest with block16_xor.
* x86_64/pclmul/gcm-hash.asm: Deleted, split into two new files...
* x86_64/pclmul/ghash-set-key.asm: New file.
* x86_64/pclmul/ghash-update.asm: New file.
* configure.ac (asm_replace_list): Add ghash-set-key.asm ghash-update.asm.
(asm_nettle_optional_list): Delete gcm-hash.asm gcm-hash8.asm.
* x86_64/ghash-update.asm: New file, based on old gcm-hash8.asm,
but without any handling of partial blocks.
* x86_64/gcm-hash8.asm: Deleted.
* ghash-set-key.c (_ghash_digest): Moved function from...
* ghash-update.c (_ghash_digest): ...old location.
2022-02-18 Niels Möller
* block-internal.h (block16_zero): New function.
* ghash-internal.h: New file, declaring new internal ghash interface.
* gcm-internal.h: Deleted file.
* ghash-update.c (gcm_gf_shift_8): Moved here (from gcm.c)
(gcm_gf_mul): Likewise.
(_ghash_update): New function, extracted from _nettle_gcm_hash_c.
(_ghash_digest): New function.
* ghash-set-key.c (_ghash_set_key): New file and function.
Extracted from _nettle_gcm_init_key_c and _nettle_gcm_set_key.
* gcm.c (INC32): Deleted macro, used in only one place.
(gcm_set_key): Update to use _ghash_set_key.
(gcm_hash): Renamed, was _gcm_hash, and implemented in terms of
_ghash_update.
(bswap_if_le): New function (copied from nist-keywrap.c).
(gcm_hash_sizes): Use bswap_if_le and _ghash_update.
(gcm_set_iv): Updated to use gcm_hash and block16_zero.
(gcm_digest): Use _ghash_digest.
* testsuite/gcm-test.c (test_ghash_internal): Updated to use
_ghash_set_key and _ghash_update.
* Makefile.in (nettle_SOURCES): Add ghash-set-key.c ghash-update.c.
(DISTFILES): Replaced gcm-internal.h with ghash-internal.h.
2022-02-17 Niels Möller
* gcm.c: Require that GCM_TABLE_BITS == 8. Delete old code for
GCM_TABLE_BITS == 0 and GCM_TABLE_BITS == 4.
* gcm-internal.h: Delete checks for GCM_TABLE_BITS != 8.
* fat-x86_64.c: Likewise.
* fat-s390x.c: Likewise.
* fat-ppc.c: Likewise.
* fat-arm64.c: Likewise.
2022-02-15 Niels Möller
* fat-x86_64.c: Add fat setup for gcm.
* x86_64/fat/gcm-hash.asm: New file.
* Makefile.in (distdir): Add x86_64/pclmul directory.
* configure.ac: New configure option --enable-x86-pclmul.
(asm_path): Add x86_64/pclmul, if above option is set.
* x86_64/pclmul/gcm-hash.asm: New file, initial implementation of
GCM using the pclmulqdq instructions.
2022-02-08 Niels Möller
* gcm-internal.h (_gcm_hash): Arrange so that this is an alias for
the appropriate implementation. Updated all users.
* gcm.c (_nettle_gcm_set_key): New internal function, intended to
make tests of internal ghash functions easier.
(gcm_set_key): Use it.
* testsuite/gcm-test.c (test_ghash_internal): New function.
(test_main): Add tests of internal ghash functions, with keys
corresponding to various single-bit polynomials.
2022-01-28 Niels Möller
* testsuite/poly1305-test.c (poly1305_internal): Renamed function,
was test_poly1305_internal.
(test_poly1305_internal): New helper function.
(test_fixed): New function, to test internal functions with fixed
test inputs.
(test_random): Use test_poly1305_internal.
(test_main): Call test_fixed.
* misc/poly1305-gen-example.pike: Program to generate poly1305
inputs with a given digest.
2022-01-27 Niels Möller
* x86_64/poly1305-internal.asm: Rewrote. Rearrange folding, so
that all the multiply instructions needed to process a block are
independent of each other. Measured speedup of 16% on AMD zen2 and
28% on Intel broadwell, and expected to be generally faster.
* asm.m4 (P1305): Rearrange struct contents, to fit 64-bit entries
S0 and H2. Total struct size unchanged.
2022-01-25 Niels Möller
Chacha implementation for arm64, contributed by Mamone Tarsha.
* arm64/chacha-core-internal.asm: New file.
* arm64/chacha-2core.asm: New file.
* arm64/chacha-4core.asm: New file
2022-01-24 Niels Möller
* powerpc64/ecc-secp224r1-modp.asm: New file, contributed by
Amitay Isaacs.
* powerpc64/ecc-curve25519-modp.asm: New file, contributed by
Martin Schwenke & Alastair D´Silva
* powerpc64/ecc-curve448-modp.asm: New file, contributed by Martin
Schwenke & Amitay Isaacs.
2022-01-23 Niels Möller
* testsuite/poly1305-test.c (test_poly1305_internal): New function.
(ref_poly1305_internal): New function.
(test_random): New function.
(test_main): Call test_random.
Arrange so that GMP or mini-gmp is always available for tests.
* testsuite/testutils.h [!WITH_HOGWEED]: Include mini-gmp.h.
* testsuite/testutils.c [!WITH_HOGWEED]: Include mini-gmp.c.
2022-01-21 Niels Möller
* powerpc64/ecc-secp192r1-modp.asm: New file, contributed by
Amitay Isaacs.
* powerpc64/ecc-secp384r1-modp.asm: New file, contributed by
Martin Schwenke, Amitay Isaacs & Alastair D´Silva.
* powerpc64/ecc-secp521r1-modp.asm: New file, contributed by
Martin Schwenke & Alastair D´Silva.
2022-01-17 Niels Möller
* testsuite/testutils.c (test_ecc_point_valid_p): New function,
moved from...
* testsuite/ecdsa-keygen-test.c (ecc_valid_p): ... old copy.
* testsuite/gostdsa-keygen-test.c (ecc_valid_p): ... old copy.
* testsuite/testutils.h: Declare it.
(test_randomize) [NETTLE_USE_MINI_GMP]: Use inline function rather
than macro for dummy definition, to avoid compile time warnings.
2022-01-10 Niels Möller
* powerpc64/ecc-secp256r1-redc.asm: Reduce number of registers
used, eliminating save and restore of callee-save registers.
Speedup of 7% reported for POWER9 (and marginal speedup of secp256
sign and verify operations).
2022-01-04 Niels Möller
* configure.ac (ELFV2_ABI): New substituted variable, set on
powerpc64 based on the _CALL_ELF define.
* config.m4.in (ELFV2_ABI): Substituted here.
* powerpc64/machine.m4: Use ELFV2_ABI rather than WORDS_BIGENDIAN
to select abi flavor. Intended to support ppc64be + musl, which,
unlike other big-endian configurations, uses ELFv2.
2021-12-09 Niels Möller
* x86_64/ecc-secp256r1-redc.asm: New folding scheme with one less
carry propagation phase, and fewer registers, avoiding save and
restore of callee-save registers. 17% speedup of this function on
AMD Ryzen 5, resulting in a modest improvement in ecdsa
performance.
* powerpc64/ecc-secp256r1-redc.asm: New file, contributed by
Amitay Isaacs.
2021-11-29 Niels Möller
From Tianjia Zhang: SM3 hash function.
* sm3.h: New file.
* sm3.c: New file.
* sm3-meta.c: New file.
* hmac-sm3.c: New file.
* hmac-sm3-meta.c: New file.
* testsuite/sm3-test.c: New file.
* nettle.texinfo: Document SM3.
2021-11-19 Niels Möller
* gmp-glue.c (mpz_limbs_cmp): Deleted function. Usage replaced
with mpz_roinit_n and mpz_cmp.
(mpz_limbs_read_n): Deleted function. Usage in tests only,
replaced with mpz_limbs_copy.
2021-11-15 Niels Möller
* testsuite/eddsa-compress-test.c (test_main): Use test_randomize.
* testsuite/ecc-redc-test.c (test_main): Likewise.
* testsuite/ecc-mul-g-test.c (test_main): Likewise.
* testsuite/ecc-mul-a-test.c (test_main): Likewise.
* testsuite/ecc-modinv-test.c (test_modulo): Trim allocation for
result area.
(test_main): Use test_randomize.
* testsuite/ecc-sqrt-test.c (test_sqrt): Trim allocation.
(test_sqrt_ratio): Trim allocation. Fix sqrt_ratio test for v = 0,
failure is expected.
(test_main): Use test_randomize.
2021-11-13 Niels Möller
* testsuite/testutils.c (get_random_seed): Move function here.
(test_randomize): New function.
* testsuite/ecc-mod-test.c (get_random_seed): Delete old copy.
(test_main): Use test_randomize.
* testsuite/rsa-compute-root-test.c (get_random_seed): Delete old copy.
(test_main): Use test_randomize.
* ecc-secp224r1.c (ecc_secp224r1_sqrt): Fix result for zero
input, which needs handling as a special case in the
Tonelli-Shanks algorithm.
* testsuite/ecc-sqrt-test.c (test_sqrt_ratio): Check that sqrt(0)
returns 0.
(test_sqrt_ratio): Check that sqrt (0/1) returns 0.
2021-11-11 Niels Möller
* eccdata.c (output_curve): Output ecc_sqrt_z and ECC_SQRT_E only
when computed. Fixes uninitialized value bug from previous change.
* ecc-secp384r1.c (ecc_mod_pow_288m32m1): New function.
(ecc_secp384r1_inv): Use ecc_mod_pow_288m32m1.
(ecc_secp384r1_sqrt): Likewise.
* eccdata.c (output_curve): Delete generation of unused values
ecc_sqrt_t and ECC_SQRT_T_BITS.
2021-11-10 Niels Möller
* eccdata.c (output_bignum_redc): New function.
(output_curve): Generate both redc and non-redc versions of
ecc_sqrt_z. Fixes secp224r1 sqrt, in configs using redc.
2021-11-08 Niels Möller
Square root functions, based on patch by Wim Lewis.
* ecc-internal.h (ecc_mod_sqrt_func): New typedef.
(struct ecc_modulo): Add sqrt function pointer and sqrt_itch.
Update all curve definitions.
* ecc-secp192r1.c (ECC_SECP192R1_SQRT_ITCH): New constant.
(ecc_secp192r1_sqrt): New function.
* ecc-secp256r1.c (ecc_secp256r1_sqrt): New function.
* ecc-secp384r1.c (ecc_secp384r1_sqrt): New function.
* ecc-secp521r1.c (ecc_secp521r1_sqrt): New function.
* ecc-secp224r1.c (ecc_secp224r1_sqrt): New function, using
Tonelli-Shanks' algorithm.
* testsuite/ecc-sqrt-test.c (test_sqrt): New function.
(test_sqrt_ratio): Renamed function (was test_modulo).
(test_main): Test sqrt function, for curves that define it.
* ecc-secp224r1.c (ecc_mod_pow_127m1): New function.
2021-11-07 Niels Möller
* ecc-internal.h (struct ecc_modulo): Renamed sqrt_itch to
sqrt_ratio_itch.
* eddsa-decompress.c (_eddsa_decompress_itch): Updated.
* ecc-curve448.c (ECC_CURVE448_SQRT_RATIO_ITCH): Renamed, from ...
(ECC_CURVE448_SQRT_ITCH): ... old name.
(ecc_curve448_sqrt_ratio): Renamed, from ...
(ecc_curve448_sqrt): ... old name.
(_nettle_curve448): Updated.
* ecc-curve25519.c (ECC_25519_SQRT_RATIO_ITCH): Renamed, from ...
(ECC_25519_SQRT_ITCH): ... old name
(ecc_curve25519_sqrt_ratio): Renamed, from ...
(ecc_curve25519_sqrt): ... old name.
(_nettle_curve25519): Updated.
* ecc-internal.h (ecc_mod_sqrt_ratio_func): Renamed typedef...
(ecc_mod_sqrt_func): ... from old name.
(struct ecc_modulo): Renamed corresponding function pointer to
sqrt_ratio. Updated all uses.
2021-10-28 Niels Möller
* ecc-mod-arith.c (ecc_mod_equal_p): New function, moved from
ecc-modinv-test.c. Based on patch by Wim Lewis.
* testsuite/ecc-modinv-test.c (mod_eq_p): Deleted, replaced with ecc_mod_equal_p.
2021-10-26 Niels Möller
* ecc-mod-arith.c (ecc_mod_zero_p): New function.
* ecc-curve25519.c (ecc_curve25519_zero_p): Use it.
* ecc-curve448.c (ecc_curve448_zero_p): Deleted, usage replaced
with ecc_mod_zero_p.
* testsuite/ecc-modinv-test.c (mod_eq_p): Rewritten to use
ecc_mod_zero_p, and require that one input is canonically reduced.
(zero_p): Deleted, usage replaced with ecc_mod_zero_p.
2021-10-23 Niels Möller
* gmp-glue.c (sec_zero_p): New function.
* ecc-curve25519.c (ecc_curve25519_zero_p): Use it.
* ecc-curve448.c (ecc_curve448_zero_p): Use it.
* ecc-random.c (ecdsa_in_range): Use it.
(zero_p): Delete static function.
2021-10-22 Niels Möller
* ecc-secp256r1.c: Rework ad-hoc reduction functions. In
particular, arranged to always use single-limb quotients, no q2
quotient carry.
(ecc_secp256r1_modp): Reimplemented, closer to 2/1 division,
(ecc_secp256r1_modq): Reimplemented, closer to divappr2 division.
2021-10-06 Niels Möller
* testsuite/ecc-mod-test.c: Extend tests to give better coverage
of corner cases, with input close to a multiple of the modulo.
2021-09-21 Niels Möller
* Makefile.in (nettle.pdf): Generate pdf manual using texi2pdf,
rather than texi2dvi + dvips + ps2pdf, which makes hyperlinks work
better.
* nettle.texinfo: Delete explicit node pointers in nettle.texinfo
Instead, rely on makeinfo's automatic pointer creation.
(Cipher functions): Split into nodes, with proper menu.
2021-09-14 Niels Möller
* cbc.h (cbc_aes128_encrypt, cbc_aes192_encrypt)
(cbc_aes256_encrypt): Change interface, take cipher context
pointer and iv as separate arguments. Update C and x86_64
implementations and corresponding glue code.
* testsuite/testutils.c (test_aead): Test encrypt/decrypt with
message split into pieces.
2021-09-12 Niels Möller
* Merged CBC-AES changes into master branch.
2021-09-09 Niels Möller
Implementation of CBC-AES for x86_64 aesni. Roughly 40%-50%
speedup benchmarked on Ryzen 5.
* x86_64/aesni/cbc-aes128-encrypt.asm: New file.
* x86_64/aesni/cbc-aes192-encrypt.asm: New file.
* x86_64/aesni/cbc-aes256-encrypt.asm: New file.
* x86_64/fat/cbc-aes128-encrypt-2.asm: New file.
* x86_64/fat/cbc-aes192-encrypt-2.asm: New file.
* x86_64/fat/cbc-aes256-encrypt-2.asm: New file.
* configure.ac (asm_nettle_optional_list, asm_replace_list): Add
new asm files.
* fat-setup.h (cbc_aes128_encrypt_func, cbc_aes192_encrypt_func)
(cbc_aes256_encrypt_func): New typedefs.
* fat-x86_64.c (fat_init): Use new functions, when aesni is available
2021-09-08 Niels Möller
* cbc-aes128-encrypt.c (nettle_cbc_aes128_encrypt): New file and
function.
* cbc-aes192-encrypt.c (cbc_aes192_set_encrypt_key): New file.
* cbc-aes256-encrypt.c (cbc_aes256_set_encrypt_key): New file.
* cbc.h (cbc_aes128_ctx, struct cbc_aes192_ctx, cbc_aes256_ctx):
New context structs. Declare new functions.
* Makefile.in (nettle_SOURCES): Add new files.
* nettle-internal.c (nettle_cbc_aes128, nettle_cbc_aes192)
(nettle_cbc_aes256): New algorithm structs, for tests and
benchmarking.
* testsuite/testutils.c (test_aead): Skip tests of decryption and
authentication, if corresponding function pointers are NULL.
* testsuite/cbc-test.c (test_main): Add tests of new cbc
functions.
* examples/nettle-benchmark.c (time_aead): Skip decrypt benchmark,
if corresponding function pointer is NULL.
2021-09-09 Niels Möller
* x86_64/fat/cpuid.asm: Fix usage of W64_ENTRY and W64_EXIT, to
make fat builds work on 64-bit windows.
2021-08-16 Niels Möller
S390x functions for sha1, sha256 and sha512, from Mamone Tarsha:
* s390x/msa/sha1-compress.asm: New file.
* s390x/msa_x1/sha256-compress.asm: Likewise.
* s390x/msa_x2/sha512-compress.asm: Likewise.
* s390x/fat/sha1-compress-2.asm: Likewise.
* s390x/fat/sha256-compress-2.asm: Likewise.
* s390x/fat/sha512-compress-2.asm: Likewise.
* fat-s390x.c: Update fat setup.
* Makefile.in (distdir): Add s390x/msa_x1.
2021-08-10 Niels Möller
* x86_64/aesni/aes128-encrypt.asm: New file, with 2-way loop.
* x86_64/aesni/aes128-decrypt.asm: Likewise.
* x86_64/aesni/aes192-encrypt.asm: Likewise.
* x86_64/aesni/aes192-decrypt.asm: Likewise.
* x86_64/aesni/aes256-encrypt.asm: Likewise.
* x86_64/aesni/aes256-decrypt.asm: Likewise.
* x86_64/aesni/aes-encrypt-internal.asm: Deleted.
* x86_64/aesni/aes-decrypt-internal.asm: Deleted.
* x86_64/fat/: Corresponding new and deleted files.
* fat-x86_64.c: Update fat setup accordingly.
2021-08-09 Niels Möller
Arm64 AES functions, from Mamone Tarsha:
* arm64/crypto/aes128-decrypt.asm: New file.
* arm64/crypto/aes128-encrypt.asm: New file.
* arm64/crypto/aes192-decrypt.asm: New file.
* arm64/crypto/aes192-encrypt.asm: New file.
* arm64/crypto/aes256-decrypt.asm: New file.
* arm64/crypto/aes256-encrypt.asm: New file.
* arm64/fat/aes128-decrypt-2.asm: New file.
* arm64/fat/aes128-encrypt-2.asm: New file.
* arm64/fat/aes192-decrypt-2.asm: New file.
* arm64/fat/aes192-encrypt-2.asm: New file.
* arm64/fat/aes256-decrypt-2.asm: New file.
* arm64/fat/aes256-encrypt-2.asm: New file.
* configure.ac: Add aes to arm64 FAT_TEST_LIST.
* fat-arm64.c: Update fat setup.
2021-08-06 Niels Möller
S390x xor functions, from Mamone Tarsha:
* configure.ac: New configure option --enable-s390x-vf.
* fat-s390x.c: Fat setup for memxor3.
* s390x/vf/memxor3.asm: New file.
* s390x/memxor.asm: New file.
* s390x/machine.m4 (XOR_LEN): New macro.
* s390x/fat/memxor3-2.asm: New file.
2021-07-24 Niels Möller
Merged s390x code.
GCM and fat build support for s390x, contributed by Mamone Tarsha:
* s390x/machine.m4: New file.
* s390x/msa_x4/gcm-hash.asm: New file.
* fat-s390x.c: New file.
* s390x/fat/cpu-facility.asm: New file.
* s390x/fat/: New wrapper files for aes and gcm assembly.
2021-07-21 Niels Möller
* Makefile.in (OPT_SOURCES): Add fat-s390x.c.
2021-05-09 Niels Möller
Implementation of AES using s390x "message security assist"
extensions. Contributed by Mamone Tarsha:
* s390x/msa_x1/aes128-decrypt.asm: New file.
* s390x/msa_x1/aes128-encrypt.asm: New file.
* s390x/msa_x1/aes128-set-decrypt-key.asm: New file.
* s390x/msa_x1/aes128-set-encrypt-key.asm: New file.
* s390x/msa_x2/aes192-decrypt.asm: New file.
* s390x/msa_x2/aes192-encrypt.asm: New file.
* s390x/msa_x2/aes192-set-decrypt-key.asm: New file.
* s390x/msa_x2/aes192-set-encrypt-key.asm: New file.
* s390x/msa_x2/aes256-decrypt.asm: New file.
* s390x/msa_x2/aes256-encrypt.asm: New file.
* s390x/msa_x2/aes256-set-decrypt-key.asm: New file.
* s390x/msa_x2/aes256-set-encrypt-key.asm: New file.
* configure.ac: Renamed option to --enable-s390x-msa. Enables both
mas_x1 and msa_x2.
(asm_replace_list): Add more aes files.
* Makefile.in (distdir): Add s390x/msa_x1 s390x/msa_x2 directories.
2021-04-01 Niels Möller
Move aes128_encrypt and similar functions to their own files. To
make it easier for assembly implementations to override specific
AES variants.
* aes-decrypt.c: Split file, keep only legacy function aes_decrypt here.
* aes-decrypt-table.c (_nettle_aes_decrypt_table): New file, moved
table here.
* aes128-decrypt.c (aes128_decrypt): New file, moved function here.
* aes192-decrypt.c (aes192_decrypt): New file, moved function here.
* aes256-decrypt.c (aes256_decrypt): New file, moved function here.
* aes-encrypt.c: Split file, keep only legacy function aes_encrypt here.
* aes128-encrypt.c (aes128_encrypt): New file, moved function here.
* aes192-encrypt.c (aes192_encrypt): New file, moved function here.
* aes256-encrypt.c (aes256_encrypt): New file, moved function here.
* Makefile.in (nettle_SOURCES): Add new files.
2021-03-28 Niels Möller
Initial config for s390x, contributed by Mamone Tarsha.
* configure.ac: Add flag --enable-s390x-msa-x1. Add ABI check for
s390x, and setup asm_path.
* Makefile.in (distdir): Add s390x directory.
* s390x/README: New file
2021-07-08 Niels Möller
* configure.ac (FAT_TEST_LIST): Add sha2 to aarch64 fat tests.
From Mamone Tarsha:
* arm64/fat/sha256-compress-2.asm: New file.
* arm64/crypto/sha256-compress.asm: New file.
* fat-arm64.c: Add setup for nettle_sha1_compress.
2021-06-30 Niels Möller
* configure.ac (FAT_TEST_LIST): Add sha1 to aarch64 fat tests.
From Mamone Tarsha:
* fat-arm64.c: Add setup for nettle_sha1_compress.
* arm64/fat/sha1-compress-2.asm: New file.
2021-06-01 Niels Möller
From Mamone Tarsha:
* arm64/crypto/sha1-compress.asm: New file.
2021-05-17 Niels Möller
Bug fixes merged from from 3.7.3 release (starting from 2021-05-06).
* rsa-decrypt-tr.c (rsa_decrypt_tr): Check up-front that input is
in range.
* rsa-sec-decrypt.c (rsa_sec_decrypt): Likewise.
* rsa-decrypt.c (rsa_decrypt): Likewise.
* testsuite/rsa-encrypt-test.c (test_main): Add tests with input > n.
2021-05-14 Niels Möller
* rsa-sign-tr.c (rsa_sec_blind): Delete mn argument.
(_rsa_sec_compute_root_tr): Delete mn argument, instead require
that input size matches key size. Rearrange use of temporary
storage, to support in-place operation, x == m. Update all
callers.
* rsa-decrypt-tr.c (rsa_decrypt_tr): Make zero-padded copy of
input, for calling _rsa_sec_compute_root_tr.
* rsa-sec-decrypt.c (rsa_sec_decrypt): Likewise.
* testsuite/rsa-encrypt-test.c (test_main): Test calling all of
rsa_decrypt, rsa_decrypt_tr, and rsa_sec_decrypt with zero input.
2021-05-06 Niels Möller
* pkcs1-sec-decrypt.c (_pkcs1_sec_decrypt): Check that message
length is valid, for given key size.
* testsuite/rsa-sec-decrypt-test.c (test_main): Add test cases for
calls to rsa_sec_decrypt specifying a too large message length.
2021-05-23 Niels Möller
From Nicolas Mora: Implement aes key wrap and key unwrap (RFC 3394).
* nist-keywrap.c (bswap_if_le, nist_keywrap16, nist_keyunwrap16)
(aes128_keywrap, aes192_keywrap, aes256_keywrap)
(aes128_keyunwrap, aes192_keyunwrap, aes256_keyunwrap): New file,
new functions.
* nist-keywrap.h: New header file.
* Makefile.in (nettle_SOURCES): Add nist-keywrap.c.
(HEADERS): Add nist-keywrap.h.
* testsuite/aes-keywrap-test.c (test_main): New tests.
* testsuite/Makefile.in (TS_NETTLE_SOURCES): Add aes-keywrap-test.c.
2021-04-13 Niels Möller
* powerpc64/p8/aes-encrypt-internal.asm (SWAP_MASK): Change macro
name to use all uppercase.
* powerpc64/p8/aes-decrypt-internal.asm (SWAP_MASK): Likewise.
2021-04-11 Niels Möller
* config.guess: Update to 2021-01-25 version, from savannah's
config.git. Needed to recognize M1 Macs.
* config.sub: Similarly update to 2021-03-10 version.
2021-03-24 Niels Möller
* .gitlab-ci.yml: Add remote tests for s390x.
2021-03-22 Niels Möller
Arm64 improvements, including fat build support. Contributed by
Mamone Tarsha:
* configure.ac (asm_path): Setup for arm64 fat builds.
* fat-arm64.c: New file.
* fat-arm64.c: New file.
* arm64/fat/gcm-hash.asm: New file.
* arm64/crypto/gcm-hash.asm: Improved docs. Use m4 macros rather
than as macros.
(LOAD_REV_PARTIAL_BLOCK): New macro.
* arm64/README: Improved docs.
2021-03-21 Niels Möller
* Released nettle-3.7.2 with ecc bug-fixes only.
* NEWS: NEWS entries for 3.7.2.
2021-03-13 Niels Möller
* gostdsa-vko.c (gostdsa_vko): Use ecc_mod_mul_canonical to
compute the scalar used for ecc multiplication.
* eddsa-hash.c (_eddsa_hash): Ensure result is canonically
reduced. Two of the three call sites need that.
* ecc-gostdsa-verify.c (ecc_gostdsa_verify): Use ecc_mod_mul_canonical
to compute the scalars used for ecc multiplication.
* ecc-ecdsa-sign.c (ecc_ecdsa_sign): Ensure s output is reduced to
canonical range.
* ecc-ecdsa-verify.c (ecc_ecdsa_verify): Use ecc_mod_mul_canonical
to compute the scalars used for ecc multiplication.
* testsuite/ecdsa-verify-test.c (test_main): Add test case that
triggers an assert on 64-bit platforms, without above fix.
* testsuite/ecdsa-sign-test.c (test_main): Test case generating
the same signature.
2021-03-13 Niels Möller
* eddsa-verify.c (equal_h): Use ecc_mod_mul_canonical.
2021-03-11 Niels Möller
* ecc-mod-arith.c (ecc_mod_mul_canonical, ecc_mod_sqr_canonical):
New functions.
* ecc-internal.h: Declare and document new functions.
* curve448-eh-to-x.c (curve448_eh_to_x): Use ecc_mod_sqr_canonical.
* curve25519-eh-to-x.c (curve25519_eh_to_x): Use ecc_mod_mul_canonical.
* ecc-eh-to-a.c (ecc_eh_to_a): Likewise.
* ecc-j-to-a.c (ecc_j_to_a): Likewise.
* ecc-mul-m.c (ecc_mul_m): Likewise.
2021-03-04 Niels Möller
Merged initial arm64 code.
2021-02-03 Niels Möller
* arm64/crypto/gcm-hash.asm: Renamed directory, moved file,...
* arm64/v8/gcm-hash.asm: ... old name.
2021-02-02 Niels Möller
* arm64/v8/gcm-hash.asm: Add ".arch armv8-a+crypto" directive.
Supported by both GNU as and clang (the latter at least from
version 3.9.1).
* configure.ac: Don't add -march=armv8-a+crypto to CFLAGS.
2021-01-31 Niels Möller
* arm64/v8/gcm-hash.asm: New file, contributed by Maamoun TK and
Michael Weiser.
* arm64/README: New file. Document endianness issues, contributed
by Michael Weiser.
2021-02-17 Niels Möller
* Released Nettle-3.7.1.
2021-02-15 Niels Möller
* examples/nettle-openssl.c (nettle_openssl_arcfour128): Deleted
glue to openssl arcfour.
(openssl_arcfour128_set_encrypt_key)
(openssl_arcfour128_set_decrypt_key): Deleted.
* nettle-internal.h: Deleted declaration.
* examples/nettle-benchmark.c (aeads): Delete benchmarking.
2021-02-13 Niels Möller
* configure.ac: Bump package version, to 3.7.1.
(LIBNETTLE_MINOR): Bump minor number, to 8.2.
(LIBHOGWEED_MINOR): Bump minor number, to 6.2.
2021-02-10 Niels Möller
* chacha-crypt.c (_nettle_chacha_crypt_4core): Fix for the case
that counter increment should be 3 (129 <= message length <= 192).
(_nettle_chacha_crypt32_4core): Likewise.
* testsuite/chacha-test.c (test_chacha_rounds): New function, for
tests with non-standard round count. Extracted from _test_chacha.
(_test_chacha): Deleted rounds argument. Reorganized crypt/crypt32
handling. When testing message prefixes of varying length, also
encrypt the remainder of the message, to catch errors in counter
value update.
(test_main): Add a few tests with large messages (16 blocks, 1024
octets), to improve test coverage for _nettle_chacha_crypt_4core
and _nettle_chacha_crypt32_4core.
2021-01-25 Niels Möller
* arm/neon/salsa20-core-internal.asm: Deleted file. This ARM Neon
implementation reportedly gave a speedup of 45% on Cortex A9,
compared to the C implementation, when it was added back in 2013.
That appears to no longer be the case with more recent processors
and compilers. And it's even significantly slower than the C
implementation on some platforms, including the Raspberry Pi 4.
With the introduction of salsa20-2core.asm, performance of this
function is also less important.
* arm/neon/chacha-core-internal.asm: Deleted file, for analogous reasons.
* arm/fat/salsa20-core-internal-2.asm: Deleted file.
* arm/fat/chacha-core-internal-2.asm: Deleted file.
* fat-arm.c (_nettle_salsa20_core, _nettle_chacha_core): Delete fat setup.
2021-01-31 Niels Möller
New variants, contributed by Nicolas Mora.
* pbkdf2-hmac-sha384.c (pbkdf2_hmac_sha384): New file and function.
* pbkdf2-hmac-sha512.c (pbkdf2_hmac_sha512): New file and function.
* testsuite/pbkdf2-test.c (test_main): Corresponding tests.
2021-01-20 Niels Möller
* ecc-ecdsa-verify.c (ecc_ecdsa_verify): Fix corner case with
all-zero hash. Reported by Guido Vranken.
* testsuite/ecdsa-verify-test.c: Add corresponding test case.
2021-01-10 Niels Möller
* fat-ppc.c: Don't use __GLIBC_PREREQ in the same preprocessor
conditional as defined(__GLIBC_PREREQ), but move to a nested #if
conditional. Fixes compile error on OpenBSD/powerpc64, reported by
Jasper Lievisse Adriaanse.
2021-01-04 Niels Möller
* Released Nettle-3.7.
2020-12-27 Niels Möller
* configure.ac: Enable fat build by default.
2020-12-26 Niels Möller
* NEWS: News entries for Nettle-3.7.
* Makefile.in (distdir): Distribute the README files in assembly
directories.
* configure.ac: Bump package version, to 3.7.
(LIBNETTLE_MINOR): Bump minor number, to 8.1.
(LIBHOGWEED_MINOR): Bump minor number, to 6.1.
2020-12-21 Niels Möller
From Mamone Tarsha:
* fat-ppc.c: Check glibc version, and use getauxval only when available.
2020-12-12 Niels Möller
* powerpc64/p7/chacha-4core.asm: More interleaving of independent
instructions, gives slight speedup on Power9.
2020-12-01 Niels Möller
* powerpc64/p7/chacha-4core.asm: Use protected zone below stack
pointer to save registers, without modifying the stack pointer.
(QR): Instruction level interleaving in the main loop, written by
Torbjörn Granlund.
2020-11-30 Niels Möller
* m4-utils.m4 (m4_unquote): New macro, copied from GMP's
mpn/asm-defs.m4.
* chacha-crypt.c: (_nettle_chacha_crypt_4core)
(_nettle_chacha_crypt32_4core): New functions.
(_nettle_chacha_crypt_2core, _nettle_chacha_crypt32_2core):
Deleted, no longer needed.
* chacha-internal.h: Add prototypes for _nettle_chacha_4core and
related functions.
* configure.ac (asm_nettle_optional_list): Add chacha-4core.asm.
* powerpc64/fat/chacha-4core.asm: New file.
* powerpc64/p7/chacha-4core.asm: New file.
* fat-ppc.c (fat_init): When altivec is available, use
_nettle_chacha_crypt_4core and _nettle_chacha_crypt32_4core
instead of _2core variants.
* chacha-crypt.c (_nettle_chacha_crypt32_3core): Fix bug in
handling of counter; this function should not propagate any carry.
* aes-internal.h: Delete name mangling of internal symbols. Update
all internal references to use _nettle prefix.
* camellia-internal.h: Likewise.
* chacha-internal.h: Likewise.
* ctr-internal.h: Likewise.
* dsa-internal.h: Likewise.
* gost28147-internal.h: Likewise.
* poly1305-internal.h: Likewise.
* salsa20-internal.h: Likewise.
* sha3-internal.h: Likewise.
* umac-internal.h: Likewise.
2020-11-26 Niels Möller
Enable powerpc64 gcm code in fat builds. Based on patch
contributed by Mamone Tarsha:
* powerpc64/fat/gcm-hash.asm: New file.
* configure.ac: Add HAVE_NATIVE_fat_gcm_init_key and
HAVE_NATIVE_fat_gcm_hash.
* gcm.c (gcm_init_key): Renamed, to ...
(_nettle_gcm_init_key_c): ... new name. Add fat setup conditionals.
(gcm_hash): Renamed, to...
(_nettle_gcm_hash_c): ... new name. Add fat setup conditionals.
* fat-setup.h (gcm_init_key_func, gcm_hash_func): New typedefs.
* fat-ppc.c: Select implementations of _nettle_gcm_init_key and _nettle_gcm_hash.
* gcm-internal.h: New file.
* Makefile.in (DISTFILES): Add gcm-internal.h.
* powerpc64/p8/gcm-hash.asm: New file, contributed by Mamone
Tarsha. Implements _nettle_gcm_init_key and _nettle_gcm_hash.
2020-11-28 Niels Möller
* powerpc64/p7/chacha-2core.asm: Simplify counter carry handling
using the vaddcuw instruction.
Merge changes by Marco Bodrato and Torbjorn Granlund, from the
gmp/mini-gmp copy of this file.
* run-tests: Delete special handling of zero arguments. Update
WINEPATH, instead of overwriting it.
2020-11-27 Niels Möller
* aclocal.m4: Replace some calls to exit with return, since exit
requires stdlib.h. Including patch contributed by Adrien Béraud.
* testsuite/version-test.c: Include version.h. Patch contributed
by Brian Smith.
2020-11-25 Niels Möller
* powerpc64/p7/chacha-2core.asm: Add byte swapping of output, for
big-endian builds.
2020-11-24 Niels Möller
Enable ppc chacha_2core in fat builds.
* configure.ac: Add HAVE_NATIVE_fat_chacha_2core.
* chacha-crypt.c: Check HAVE_NATIVE_fat_chacha_2core.
* chacha-internal.h (_chacha_crypt_2core, _chacha_crypt32_2core):
Add declarations.
* fat-ppc.c (fat_init): Use _nettle_chacha_crypt_2core and
_nettle_chacha_crypt32_2core when altivec is available.
* powerpc64/fat/chacha-2core.asm: New file, including p7 version.
2020-11-23 Niels Möller
* powerpc64/p7/chacha-2core.asm: New file.
* chacha-crypt.c (_chacha_crypt_2core, _chacha_crypt32_2core): New
variants of chacha_crypt, using _chacha_2core to do two blocks at
a time.
* chacha-internal.h (_chacha_2core, _chacha_2core32): Add declarations.
* configure.ac (asm_nettle_optional_list): Add chacha-2core.asm.
2020-11-14 Niels Möller
* ecc-mod-inv.c (ecc_mod_inv): Use passed in scratch for all
scratch needs, don't use memory after the result area.
* ecc-ecdsa-sign.c (ecc_ecdsa_sign): Update invert call.
* ecc-ecdsa-verify.c (ecc_ecdsa_verify): Likewise.
* ecc-eh-to-a.c (ecc_eh_to_a): Likewise.
* ecc-j-to-a.c (ecc_j_to_a): Likewise.
* ecc-gostdsa-verify.c (ecc_gostdsa_verify): Likewise.
* curve25519-eh-to-x.c (curve25519_eh_to_x): Likewise.
* curve448-eh-to-x.c (curve448_eh_to_x): Update invert call, and
reduce scratch need from 9*size to 5*size.
* ecc-internal.h (ECC_MOD_INV_ITCH, ECC_J_TO_A_ITCH)
(ECC_EH_TO_A_ITCH): Update accordingly, but no change in total
scratch need.
2020-11-13 Niels Möller