Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • nettle/nettle
  • briansmith/nettle
  • ajlawrence/nettle
  • mhoffmann/nettle
  • devnexen/nettle
  • wiml/nettle
  • lumag/nettle
  • michaelweiser/nettle
  • aberaud/nettle
  • mamonet/nettle
  • npocs/nettle
  • babelouest/nettle
  • ueno/nettle
  • rth/nettle
14 results
Show changes
Commits on Source (2940)
*.d
*.po
*.s
*.tar.gz
*.tar.gz.asc
.lib
Makefile
aesdata
config.cache
config.h
config.h.in
config.log
config.m4
config.make
config.status
configure
desdata
keymap.h
nettle-stdint.h
nettle.aux
nettle.cp
nettle.cps
nettle.dvi
nettle.fn
nettle.html
nettle.info*
nettle.ky
nettle.log
nettle.pdf
nettle.pg
nettle.ps
nettle.toc
nettle.tp
nettle.tps
nettle.vr
nettle.vrs
parity.h
rotors.h
shadata
stamp-h
stamp-h.in
[attr]binary -text -crlf -diff -ident
* text ident
* text -ident
RCS
SCCS
CVS
CVS.adm
RCSLOG
cvslog.*
tags
TAGS
.make.state
.nse_depinfo
*~
#*
.#*
,*
_$*
*$
*.old
*.bak
*.BAK
*.orig
*.rej
.del-*
*.a
*.olb
*.o
*.obj
*.so
*.exe
*.Z
*.elc
*.ln
*.dll
*.dylib
core
/*.d
/*.po
/*.s
/*.tar.gz
/*.tar.gz.asc
/.lib
/*.asm
/Makefile
/aesdata
/config.cache
/config.h
/config.h.in
......@@ -46,9 +28,31 @@ core
/config.make
/config.status
/configure
/autom4te.cache
/stamp-h
/stamp-h.in
/*.pc
/machine.m4
/aesdata
/desdata
/eccdata
/*.stamp
/gcmdata
/shadata
/twofishdata
/keymap.h
/nettle-stdint.h
/parity.h
/rotors.h
/ecc-curve25519.h
/ecc-curve448.h
/ecc-gost-gc256b.h
/ecc-gost-gc512a.h
/ecc-secp192r1.h
/ecc-secp224r1.h
/ecc-secp256r1.h
/ecc-secp384r1.h
/ecc-secp521r1.h
/version.h
/nettle.aux
/nettle.cp
/nettle.cps
......@@ -66,8 +70,5 @@ core
/nettle.tps
/nettle.vr
/nettle.vrs
/parity.h
/rotors.h
/shadata
/stamp-h
/stamp-h.in
/libhogweed.map
/libnettle.map
variables:
BUILDENV_NATIVE_IMAGE: gnutls/nettle-build-images:buildenv-native
BUILDENV_CLANG_IMAGE: gnutls/nettle-build-images:buildenv-clang
BUILDENV_CROSS_IMAGE: gnutls/nettle-build-images:buildenv-cross
GET_SOURCES_ATTEMPTS: "3"
# "Native" means x86-64; no jobs run on anything else.
.native-build:
image: $CI_REGISTRY/$BUILDENV_NATIVE_IMAGE
script:
- ./.bootstrap
- './configure $EXTRA_CONFIGURE_ARGS --disable-documentation'
- 'make -j$(nproc)'
- 'make -j$(nproc) check $EXTRA_CHECK_TARGET'
tags:
- saas-linux-small-amd64
except:
- tags
variables:
NETTLE_TEST_SEED: '0'
artifacts:
expire_in: 1 week
when: always
paths:
- "config.log"
native/fat:
extends: .native-build
variables:
EXTRA_CHECK: check-fat
native/no-fat:
extends: .native-build
variables:
EXTRA_CONFIGURE_ARGS: '--disable-fat'
native/no-static:
extends: .native-build
variables:
EXTRA_CONFIGURE_ARGS: '--disable-static'
native/no-shared:
extends: .native-build
variables:
EXTRA_CONFIGURE_ARGS: '--disable-static'
native/32-bit:
extends: .native-build
variables:
EXTRA_CONFIGURE_ARGS: '--enable-mini-gmp'
CC: 'gcc -m32'
CXX: '/bin/false'
native/mini-gmp:
extends: .native-build
variables:
EXTRA_CONFIGURE_ARGS: '--enable-mini-gmp'
native/c89:
extends: .native-build
variables:
EXTRA_CONFIGURE_ARGS: '--disable-assembler'
CC: '$CI_PROJECT_DIR/misc/c89'
native/extra-asserts:
extends: .native-build
variables:
EXTRA_CONFIGURE_ARGS: '--enable-extra-asserts'
native/ndebug:
extends: .native-build
variables:
EXTRA_CONFIGURE_ARGS: 'CPPFLAGS=-DNDEBUG --disable-assembler'
native/ubsan:
extends: .native-build
variables:
EXTRA_CONFIGURE_ARGS: '--disable-assembler'
CFLAGS: '-fsanitize=undefined -fno-sanitize-recover -g -O2'
CXXFLAGS: '-fsanitize=undefined -fno-sanitize-recover -g -O2'
native/asan:
extends: .native-build
variables:
EXTRA_CONFIGURE_ARGS: '--disable-assembler'
CFLAGS: '-fsanitize=address -g -O2'
CXXFLAGS: '-fsanitize=address -g -O2'
build/static-analyzers:
image: $CI_REGISTRY/$BUILDENV_CLANG_IMAGE
script:
- ./.bootstrap
- scan-build ./configure --disable-documentation --disable-assembler
- scan-build --status-bugs -o scan-build-lib make -j$(nproc)
tags:
- saas-linux-small-amd64
except:
- tags
artifacts:
expire_in: 1 week
when: on_failure
paths:
- scan-build-lib/*
build/gnutls:
image: $CI_REGISTRY/$BUILDENV_NATIVE_IMAGE
script:
- ./.bootstrap &&
./configure --disable-documentation --prefix="$(pwd)/local" --libdir="$(pwd)/local/lib" &&
make -j4 && make install
- git clone --depth 1 --branch master https://gitlab.com/gnutls/gnutls.git gnutls-git
- cd gnutls-git && git submodule update --init && ./bootstrap &&
./configure PKG_CONFIG_PATH="$(pwd)/../local/lib/pkgconfig" CPPFLAGS="-I$(pwd)/../local/include"
LDFLAGS="-L$(pwd)/../local/lib -Wl,-rpath,$(pwd)/../local/lib"
--disable-cxx --disable-guile --without-p11-kit --disable-doc &&
make -j$(nproc) && make -j $(nproc) check
tags:
- saas-linux-small-amd64
except:
- tags
artifacts:
expire_in: 1 week
when: on_failure
paths:
- gnutls-git/guile/tests/*.log
- gnutls-git/tests/*.log
- gnutls-git/*.log
- gnutls-git/tests/*/*.log
- gnutls-git/tests/suite/*/*.log
remote/s390x:
image: $CI_REGISTRY/$BUILDENV_NATIVE_IMAGE
before_script:
# File created as world-readable by gitlab ci machinery.
- chmod 0600 $SSH_PRIVATE_KEY
- ssh -o 'StrictHostKeyChecking no' -i "$SSH_PRIVATE_KEY" "$S390X_ACCOUNT"
"mkdir -p ci-work/$CI_PIPELINE_IID"
script:
- echo $CI_PIPELINE_IID
- ./.bootstrap &&
./configure && make PACKAGE_VERSION=snapshot dist &&
ls -l *.tar.gz
- cat nettle-snapshot.tar.gz |
ssh -o 'StrictHostKeyChecking no' -i "$SSH_PRIVATE_KEY" "$S390X_ACCOUNT"
"cd ci-work/$CI_PIPELINE_IID && tar xzf -"
- ssh -o 'StrictHostKeyChecking no' -i "$SSH_PRIVATE_KEY" "$S390X_ACCOUNT"
"cd ci-work/$CI_PIPELINE_IID/nettle-snapshot && ./configure --disable-documentation --enable-s390x-msa"
- ssh -o 'StrictHostKeyChecking no' -i "$SSH_PRIVATE_KEY" "$S390X_ACCOUNT"
"cd ci-work/$CI_PIPELINE_IID/nettle-snapshot && make"
- ssh -o 'StrictHostKeyChecking no' -i "$SSH_PRIVATE_KEY" "$S390X_ACCOUNT"
"cd ci-work/$CI_PIPELINE_IID/nettle-snapshot && NETTLE_TEST_SEED=0 make check"
after_script:
- ssh -o 'StrictHostKeyChecking no' -i "$SSH_PRIVATE_KEY" "$S390X_ACCOUNT"
"rm -rf ci-work/$CI_PIPELINE_IID"
only:
variables:
- $SSH_PRIVATE_KEY != ""
- $S390X_ACCOUNT != ""
tags:
- saas-linux-small-amd64
except:
- tags
.cross-build:
image: $CI_REGISTRY/$BUILDENV_CROSS_IMAGE
script:
- build=$(dpkg-architecture -qDEB_HOST_GNU_TYPE)
- host="${CI_JOB_NAME#cross/}"
# Not setting CC_FOR_BUILD paired with qemu-user/binfmt somehow causes
# config.guess to detect the target as the build platform and not activate
# cross-compile mode, even though --build is given.
- export CC_FOR_BUILD="gcc"
- export CC="$host-gcc"
# Disable C++, to not depend on cross g++.
- export CXX=/bin/false
- ./.bootstrap
- ./configure --disable-documentation $EXTRA_CONFIGURE_ARGS --build=$build --host=$host
- make -j$(nproc)
- make EMULATOR=${EMULATOR} -j$(nproc) check
- make EMULATOR=${EMULATOR} -j$(nproc) check-fat
tags:
- saas-linux-small-amd64
except:
- tags
variables:
NETTLE_TEST_SEED: '0'
artifacts:
expire_in: 1 week
when: always
paths:
- "config.log"
cross/arm-linux-gnueabihf:
extends: .cross-build
variables:
EMULATOR: qemu-arm
cross/aarch64-linux-gnu:
extends: .cross-build
variables:
EMULATOR: qemu-aarch64
# Setting QEMU_LD_PREFIX works around the error "qemu-ppc64: Could not
# open '/lib64/ld64.so.1".
cross/powerpc64-linux-gnu:
extends: .cross-build
variables:
EXTRA_CONFIGURE_ARGS: '--enable-mini-gmp'
QEMU_LD_PREFIX: /usr/powerpc64-linux-gnu
EMULATOR: qemu-ppc64
cross/powerpc64le-linux-gnu:
extends: .cross-build
variables:
EMULATOR: qemu-ppc64le
# Disable assembly files, because current qemu doesn't support all
# needed instructions.
cross/s390x-linux-gnu:
extends: .cross-build
variables:
EXTRA_CONFIGURE_ARGS: '--disable-assembler'
EMULATOR: qemu-s390x
cross/sparc64-linux-gnu:
extends: .cross-build
variables:
EXTRA_CONFIGURE_ARGS: '--enable-mini-gmp'
QEMU_LD_PREFIX: /usr/sparc64-linux-gnu
EMULATOR: qemu-sparc64
Please see the Nettle manual.
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 -- 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
GNU LESSER GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
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.
This diff is collapsed.
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
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
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
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
......@@ -15,7 +15,7 @@ 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 Library General Public License instead.) You can apply it to
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
......@@ -55,8 +55,8 @@ 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
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
......@@ -110,7 +110,7 @@ above, provided that you also meet all of these conditions:
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
......@@ -168,7 +168,7 @@ 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
......@@ -225,7 +225,7 @@ 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
......@@ -255,7 +255,7 @@ 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
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
......@@ -277,9 +277,9 @@ 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
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
......@@ -303,17 +303,16 @@ the "copyright" line and a pointer to where the full notice is found.
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
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 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.
......@@ -336,5 +335,5 @@ necessary. Here is a sample; alter the names:
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 Library General
library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
What is Nettle? A quote from the introduction in the Nettle Manual:
What is GNU Nettle? A quote from the introduction in the Nettle Manual:
Nettle is a cryptographic library that is designed to fit easily in more
or less any context: In crypto toolkits for object-oriented languages
......@@ -14,40 +14,38 @@ What is Nettle? A quote from the introduction in the Nettle Manual:
cryptographic libraries around.
Nettle tries to avoid this problem by doing one thing, the low-level
crypto stuff, and providing a @emph{simple} but general interface to it.
crypto stuff, and providing a simple but general interface to it.
In particular, Nettle doesn't do algorithm selection. It doesn't do
memory allocation. It doesn't do any I/O.
The idea is that one can build several application and context specific
interfaces on top of Nettle, and share the code, testcases, benchmarks,
documentation, etc. For this first version, the only application using
Nettle is LSH, and it uses an object-oriented abstraction on top of the
library.
interfaces on top of Nettle, and share the code, test cases, benchmarks,
documentation, etc. Examples are the Nettle module for the Pike
language, and LSH, which both use an object-oriented abstraction on top
of the library.
Nettle 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. See the file COPYING for details. Most, but not
all, of Nettle can also be used under the terms of the GNU Lesser
General Public License; please read the Copyright section of the
manual if you want to exercise this option.
GNU Nettle is free software; you can redistribute it and/or modify it
under the terms contained in the files COPYING* (see the manual for
information on how these licenses apply).
Build nettle with the usual ./configure && make && make check && make
install. Read the manual. Mail me if you have any questions or
suggestions.
If you have downloaded a Nettle release, build it with the usual
./configure && make && make check && make install (see the INSTALL
file for further instructions). Using GNU make is strongly
recommended. Nettle's support for public key algorithms, such as RSA
and ECDSA, depends on the GNU GMP library.
You can also build Nettle from cvs, using
You can also get Nettle from git, see
http://www.lysator.liu.se/~nisse/nettle/ for current instructions. In
particular, you need to run the ./.bootstrap script after checkout and
before running ./configure.
cvs -d :pserver:anonymous@cvs.lysator.liu.se:/cvsroot/lsh login
[ empty password ]
cvs -d :pserver:anonymous@cvs.lysator.liu.se:/cvsroot/lsh co nettle
If you get it from cvs, you need to build it with
./.bootstrap && ./configure && make && make check
Read the manual. Mail me if you have any questions or suggestions.
You may want to subscribe to the nettle-bugs mailing list. See
<URL: http://lists.lysator.liu.se/mailman/listinfo/nettle-bugs>.
<URL: https://lists.lysator.liu.se/mailman3/postorius/lists/nettle-bugs.lists.lysator.liu.se/>.
See CONTRIBUTING.md for information on contibuting patches.
Happy hacking,
/Niels Möller <nisse@lysator.liu.se>
/Niels Möller <nisse@lysator.liu.se>
Public key support, analogous to that provided by RSAREF. Suggested by
Dan Egnor. Signatures are done now, but RSA encryption is still
missing. References:
http://download.gale.org/rsaref20.tar.Z
http://www.openssl.org/docs/crypto/evp.html
http://www.openssl.org/docs/crypto/rsa.html
More feedback modes, in order of decreasing priority: CBC-MAC, OFB,
and CFB. Suggested by Rafael 'Dido' Sevilla. References:
http://csrc.nist.gov/encryption/modes/Recommendation/Modes01.pdf
Valgrind reports errors on the des-compat test program. Investigate.
Change the convention for declaring function pointers. Instead of for
example
typedef void *
nettle_realloc_func(void *ctx, void *p, unsigned length);
use
typedef void
nettle_realloc_func(void *ctx, void *p, unsigned length);
The make rules for building position independent *_p.o files doesn't
get dependencies right.
This diff is collapsed.
/* aes-decrypt-internal.c
*
* Decryption function for the aes/rijndael block cipher.
*/
/* nettle, low-level cryptographics library
*
* Copyright (C) 2002 Niels Mller
*
* The nettle library is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2.1 of the License, or (at your
* option) any later version.
*
* The nettle library 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 Lesser General Public
* License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with the nettle library; see the file COPYING.LIB. If not, write to
* the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
* MA 02111-1307, USA.
*/
Decryption function for the aes/rijndael block cipher.
Copyright 2002, 2013 Niels Möller
This file is part of GNU Nettle.
GNU Nettle is free software: you can redistribute it and/or
modify it under the terms of either:
* the GNU Lesser General Public License as published by the Free
Software Foundation; either version 3 of the License, or (at your
option) any later version.
or
* 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.
or both in parallel, as here.
GNU Nettle 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 copies of the GNU General Public License and
the GNU Lesser General Public License along with this program. If
not, see http://www.gnu.org/licenses/.
*/
#if HAVE_CONFIG_H
# include "config.h"
......@@ -32,36 +40,47 @@
#include "aes-internal.h"
#include "macros.h"
/* For fat builds */
#if HAVE_NATIVE_aes_decrypt
void
_nettle_aes_decrypt_c(unsigned rounds, const uint32_t *keys,
const struct aes_table *T,
size_t length, uint8_t *dst,
const uint8_t *src);
#define _nettle_aes_decrypt _nettle_aes_decrypt_c
#endif
void
_nettle_aes_decrypt(const struct aes_ctx *ctx,
_nettle_aes_decrypt(unsigned rounds, const uint32_t *keys,
const struct aes_table *T,
unsigned length, uint8_t *dst,
size_t length, uint8_t *dst,
const uint8_t *src)
{
FOR_BLOCKS(length, dst, src, AES_BLOCK_SIZE)
{
uint32_t w0, w1, w2, w3; /* working ciphertext */
uint32_t t0, t1, t2, t3;
unsigned round;
const uint32_t *p;
unsigned i;
/* Get clear text, using little-endian byte order.
* Also XOR with the first subkey. */
w0 = LE_READ_UINT32(src) ^ ctx->keys[0];
w1 = LE_READ_UINT32(src + 4) ^ ctx->keys[1];
w2 = LE_READ_UINT32(src + 8) ^ ctx->keys[2];
w3 = LE_READ_UINT32(src + 12) ^ ctx->keys[3];
w0 = LE_READ_UINT32(src) ^ keys[0];
w1 = LE_READ_UINT32(src + 4) ^ keys[1];
w2 = LE_READ_UINT32(src + 8) ^ keys[2];
w3 = LE_READ_UINT32(src + 12) ^ keys[3];
for (round = 1; round < ctx->nrounds; round++)
for (i = 1, p = keys - 4; i < rounds; i++, p -= 4)
{
t0 = AES_ROUND(T, w0, w3, w2, w1, ctx->keys[4*round]);
t1 = AES_ROUND(T, w1, w0, w3, w2, ctx->keys[4*round + 1]);
t2 = AES_ROUND(T, w2, w1, w0, w3, ctx->keys[4*round + 2]);
t3 = AES_ROUND(T, w3, w2, w1, w0, ctx->keys[4*round + 3]);
/* FIXME: We could unrolling the loop twice, to avoid these
assignments. If all eight variables fit in registers, that
should give a speedup. */
t0 = AES_ROUND(T, w0, w3, w2, w1, p[0]);
t1 = AES_ROUND(T, w1, w0, w3, w2, p[1]);
t2 = AES_ROUND(T, w2, w1, w0, w3, p[2]);
t3 = AES_ROUND(T, w3, w2, w1, w0, p[3]);
/* We could unroll the loop twice, to avoid these
assignments. If all eight variables fit in registers,
that should give a slight speedup. */
w0 = t0;
w1 = t1;
w2 = t2;
......@@ -70,14 +89,14 @@ _nettle_aes_decrypt(const struct aes_ctx *ctx,
/* Final round */
t0 = AES_FINAL_ROUND(T, w0, w3, w2, w1, ctx->keys[4*round]);
t1 = AES_FINAL_ROUND(T, w1, w0, w3, w2, ctx->keys[4*round + 1]);
t2 = AES_FINAL_ROUND(T, w2, w1, w0, w3, ctx->keys[4*round + 2]);
t3 = AES_FINAL_ROUND(T, w3, w2, w1, w0, ctx->keys[4*round + 3]);
t0 = AES_FINAL_ROUND(T, w0, w3, w2, w1, p[0]);
t1 = AES_FINAL_ROUND(T, w1, w0, w3, w2, p[1]);
t2 = AES_FINAL_ROUND(T, w2, w1, w0, w3, p[2]);
t3 = AES_FINAL_ROUND(T, w3, w2, w1, w0, p[3]);
LE_WRITE_UINT32(dst, t0);
LE_WRITE_UINT32(dst + 8, t2);
LE_WRITE_UINT32(dst + 4, t1);
LE_WRITE_UINT32(dst + 8, t2);
LE_WRITE_UINT32(dst + 12, t3);
}
}
/* aes-decrypt.c
*
* Decryption function for aes/rijndael block cipher.
*/
/* aes-decrypt-table.c
/* nettle, low-level cryptographics library
*
* Copyright (C) 2002 Niels Mller
*
* The nettle library is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2.1 of the License, or (at your
* option) any later version.
*
* The nettle library 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 Lesser General Public
* License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with the nettle library; see the file COPYING.LIB. If not, write to
* the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
* MA 02111-1307, USA.
*/
Decryption function for aes/rijndael block cipher.
Copyright (C) 2002, 2013 Niels Möller
This file is part of GNU Nettle.
GNU Nettle is free software: you can redistribute it and/or
modify it under the terms of either:
* the GNU Lesser General Public License as published by the Free
Software Foundation; either version 3 of the License, or (at your
option) any later version.
or
* 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.
or both in parallel, as here.
GNU Nettle 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 copies of the GNU General Public License and
the GNU Lesser General Public License along with this program. If
not, see http://www.gnu.org/licenses/.
*/
#if HAVE_CONFIG_H
# include "config.h"
#endif
#include <assert.h>
#include <stdlib.h>
#include "aes-internal.h"
static const struct aes_table
_aes_decrypt_table =
const struct aes_table
_nettle_aes_decrypt_table =
{ /* isbox */
{
0x52,0x09,0x6a,0xd5,0x30,0x36,0xa5,0x38,
......@@ -69,7 +77,7 @@ _aes_decrypt_table =
0xe1,0x69,0x14,0x63,0x55,0x21,0x0c,0x7d,
},
{ /* itable */
{
{
0x50a7f451,0x5365417e,0xc3a4171a,0x965e273a,
0xcb6bab3b,0xf1459d1f,0xab58faac,0x9303e34b,
0x55fa3020,0xf66d76ad,0x9176cc88,0x254c02f5,
......@@ -332,16 +340,6 @@ _aes_decrypt_table =
0x397101a8,0x08deb30c,0xd89ce4b4,0x6490c156,
0x7b6184cb,0xd570b632,0x48745c6c,0xd04257b8,
},
#endif /* !AES_SMALL */
#endif /* !AES_SMALL */
}
};
void
aes_decrypt(struct aes_ctx *ctx,
unsigned length, uint8_t *dst,
const uint8_t *src)
{
assert(!(length % AES_BLOCK_SIZE) );
_aes_decrypt(ctx, &_aes_decrypt_table,
length, dst, src);
}
/* aes-encrypt-internal.c
*
* Encryption function for the aes/rijndael block cipher.
*/
/* nettle, low-level cryptographics library
*
* Copyright (C) 2002 Niels Möller
*
* The nettle library is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2.1 of the License, or (at your
* option) any later version.
*
* The nettle library 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 Lesser General Public
* License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with the nettle library; see the file COPYING.LIB. If not, write to
* the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
* MA 02111-1307, USA.
*/
Encryption function for the aes/rijndael block cipher.
Copyright (C) 2002, 2013 Niels Möller
This file is part of GNU Nettle.
GNU Nettle is free software: you can redistribute it and/or
modify it under the terms of either:
* the GNU Lesser General Public License as published by the Free
Software Foundation; either version 3 of the License, or (at your
option) any later version.
or
* 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.
or both in parallel, as here.
GNU Nettle 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 copies of the GNU General Public License and
the GNU Lesser General Public License along with this program. If
not, see http://www.gnu.org/licenses/.
*/
#if HAVE_CONFIG_H
# include "config.h"
......@@ -32,36 +40,46 @@
#include "aes-internal.h"
#include "macros.h"
/* For fat builds */
#if HAVE_NATIVE_aes_encrypt
void
_nettle_aes_encrypt_c(unsigned rounds, const uint32_t *keys,
const struct aes_table *T,
size_t length, uint8_t *dst,
const uint8_t *src);
#define _nettle_aes_encrypt _nettle_aes_encrypt_c
#endif
void
_nettle_aes_encrypt(const struct aes_ctx *ctx,
_nettle_aes_encrypt(unsigned rounds, const uint32_t *keys,
const struct aes_table *T,
unsigned length, uint8_t *dst,
size_t length, uint8_t *dst,
const uint8_t *src)
{
FOR_BLOCKS(length, dst, src, AES_BLOCK_SIZE)
{
uint32_t w0, w1, w2, w3; /* working ciphertext */
uint32_t t0, t1, t2, t3;
unsigned round;
unsigned i;
/* Get clear text, using little-endian byte order.
* Also XOR with the first subkey. */
w0 = LE_READ_UINT32(src) ^ ctx->keys[0];
w1 = LE_READ_UINT32(src + 4) ^ ctx->keys[1];
w2 = LE_READ_UINT32(src + 8) ^ ctx->keys[2];
w3 = LE_READ_UINT32(src + 12) ^ ctx->keys[3];
w0 = LE_READ_UINT32(src) ^ keys[0];
w1 = LE_READ_UINT32(src + 4) ^ keys[1];
w2 = LE_READ_UINT32(src + 8) ^ keys[2];
w3 = LE_READ_UINT32(src + 12) ^ keys[3];
for (round = 1; round < ctx->nrounds; round++)
for (i = 1; i < rounds; i++)
{
t0 = AES_ROUND(T, w0, w1, w2, w3, ctx->keys[4*round]);
t1 = AES_ROUND(T, w1, w2, w3, w0, ctx->keys[4*round + 1]);
t2 = AES_ROUND(T, w2, w3, w0, w1, ctx->keys[4*round + 2]);
t3 = AES_ROUND(T, w3, w0, w1, w2, ctx->keys[4*round + 3]);
/* FIXME: We could unrolling the loop twice, to avoid these
assignments. If all eight variables fit in registers, that
should give a speedup. */
t0 = AES_ROUND(T, w0, w1, w2, w3, keys[4*i]);
t1 = AES_ROUND(T, w1, w2, w3, w0, keys[4*i + 1]);
t2 = AES_ROUND(T, w2, w3, w0, w1, keys[4*i + 2]);
t3 = AES_ROUND(T, w3, w0, w1, w2, keys[4*i + 3]);
/* We could unroll the loop twice, to avoid these
assignments. If all eight variables fit in registers,
that should give a slight speedup. */
w0 = t0;
w1 = t1;
w2 = t2;
......@@ -70,14 +88,14 @@ _nettle_aes_encrypt(const struct aes_ctx *ctx,
/* Final round */
t0 = AES_FINAL_ROUND(T, w0, w1, w2, w3, ctx->keys[4*round]);
t1 = AES_FINAL_ROUND(T, w1, w2, w3, w0, ctx->keys[4*round + 1]);
t2 = AES_FINAL_ROUND(T, w2, w3, w0, w1, ctx->keys[4*round + 2]);
t3 = AES_FINAL_ROUND(T, w3, w0, w1, w2, ctx->keys[4*round + 3]);
t0 = AES_FINAL_ROUND(T, w0, w1, w2, w3, keys[4*i]);
t1 = AES_FINAL_ROUND(T, w1, w2, w3, w0, keys[4*i + 1]);
t2 = AES_FINAL_ROUND(T, w2, w3, w0, w1, keys[4*i + 2]);
t3 = AES_FINAL_ROUND(T, w3, w0, w1, w2, keys[4*i + 3]);
LE_WRITE_UINT32(dst, t0);
LE_WRITE_UINT32(dst + 8, t2);
LE_WRITE_UINT32(dst + 4, t1);
LE_WRITE_UINT32(dst + 8, t2);
LE_WRITE_UINT32(dst + 12, t3);
}
}
......
/* aes-encrypt-table.c
*
* Encryption table for the aes/rijndael block cipher.
*/
/* nettle, low-level cryptographics library
*
* Copyright (C) 2002 Niels Mller
*
* The nettle library is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2.1 of the License, or (at your
* option) any later version.
*
* The nettle library 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 Lesser General Public
* License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with the nettle library; see the file COPYING.LIB. If not, write to
* the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
* MA 02111-1307, USA.
*/
Encryption table for the aes/rijndael block cipher.
Copyright (C) 2002 Niels Möller
This file is part of GNU Nettle.
GNU Nettle is free software: you can redistribute it and/or
modify it under the terms of either:
* the GNU Lesser General Public License as published by the Free
Software Foundation; either version 3 of the License, or (at your
option) any later version.
or
* 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.
or both in parallel, as here.
GNU Nettle 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 copies of the GNU General Public License and
the GNU Lesser General Public License along with this program. If
not, see http://www.gnu.org/licenses/.
*/
#if HAVE_CONFIG_H
# include "config.h"
......@@ -41,7 +49,7 @@
* consistent with the row numbering. */
const struct aes_table
_aes_encrypt_table =
_nettle_aes_encrypt_table =
{ /* sbox */
{
0x63,0x7c,0x77,0x7b,0xf2,0x6b,0x6f,0xc5,
......