Commit 24119d78 authored by Niels Möller's avatar Niels Möller

Moved in CVS tree. Also renamed directory sparc to sparc32.

Rev: nettle/.bootstrap:1.1
Rev: nettle/.c-style:1.1
Rev: nettle/.cvsignore:1.1
Rev: nettle/AUTHORS:1.1
Rev: nettle/COPYING:1.1
Rev: nettle/COPYING.LIB:1.1
Rev: nettle/ChangeLog:1.1
Rev: nettle/Makefile.in:1.1
Rev: nettle/NEWS:1.1
Rev: nettle/README:1.1
Rev: nettle/TODO:1.1
Rev: nettle/aes-decrypt-internal.c:1.1
Rev: nettle/aes-decrypt.c:1.1
Rev: nettle/aes-encrypt-internal.c:1.1
Rev: nettle/aes-encrypt-table.c:1.1
Rev: nettle/aes-encrypt.c:1.1
Rev: nettle/aes-internal.h:1.1
Rev: nettle/aes-meta.c:1.1
Rev: nettle/aes-set-decrypt-key.c:1.1
Rev: nettle/aes-set-encrypt-key.c:1.1
Rev: nettle/aes.h:1.1
Rev: nettle/aesdata.c:1.1
Rev: nettle/arcfour-crypt.c:1.1
Rev: nettle/arcfour-meta.c:1.1
Rev: nettle/arcfour.c:1.1
Rev: nettle/arcfour.h:1.1
Rev: nettle/arctwo-meta.c:1.1
Rev: nettle/arctwo.c:1.1
Rev: nettle/arctwo.h:1.1
Rev: nettle/asm.m4:1.1
Rev: nettle/asn1.h:1.1
Rev: nettle/base16-decode.c:1.1
Rev: nettle/base16-encode.c:1.1
Rev: nettle/base16-meta.c:1.1
Rev: nettle/base16.h:1.1
Rev: nettle/base64-decode.c:1.1
Rev: nettle/base64-encode.c:1.1
Rev: nettle/base64-meta.c:1.1
Rev: nettle/base64.h:1.1
Rev: nettle/bignum-random.c:1.1
Rev: nettle/bignum.c:1.1
Rev: nettle/bignum.h:1.1
Rev: nettle/blowfish.c:1.1
Rev: nettle/blowfish.h:1.1
Rev: nettle/buffer-init.c:1.1
Rev: nettle/buffer.c:1.1
Rev: nettle/buffer.h:1.1
Rev: nettle/cast128-meta.c:1.1
Rev: nettle/cast128.c:1.1
Rev: nettle/cast128.h:1.1
Rev: nettle/cast128_sboxes.h:1.1
Rev: nettle/cbc.c:1.1
Rev: nettle/cbc.h:1.1
Rev: nettle/config.m4.in:1.1
Rev: nettle/config.make.in:1.1
Rev: nettle/configure.ac:1.1
Rev: nettle/ctr.c:1.1
Rev: nettle/ctr.h:1.1
Rev: nettle/der-iterator.c:1.1
Rev: nettle/der2rsa.c:1.1
Rev: nettle/des-compat.c:1.1
Rev: nettle/des-compat.h:1.1
Rev: nettle/des.c:1.1
Rev: nettle/des.h:1.1
Rev: nettle/des3.c:1.1
Rev: nettle/desCode.h:1.1
Rev: nettle/descore.README:1.1
Rev: nettle/desdata.c:1.1
Rev: nettle/desinfo.h:1.1
Rev: nettle/dsa-keygen.c:1.1
Rev: nettle/dsa-sign.c:1.1
Rev: nettle/dsa-verify.c:1.1
Rev: nettle/dsa.c:1.1
Rev: nettle/dsa.h:1.1
Rev: nettle/examples/.c-style:1.1
Rev: nettle/examples/.cvsignore:1.1
Rev: nettle/examples/Makefile.in:1.1
Rev: nettle/examples/io.c:1.1
Rev: nettle/examples/io.h:1.1
Rev: nettle/examples/nettle-benchmark.c:1.1
Rev: nettle/examples/nettle-openssl.c:1.1
Rev: nettle/examples/rsa-decrypt.c:1.1
Rev: nettle/examples/rsa-encrypt-test:1.1
Rev: nettle/examples/rsa-encrypt.c:1.1
Rev: nettle/examples/rsa-keygen.c:1.1
Rev: nettle/examples/rsa-session.h:1.1
Rev: nettle/examples/rsa-sign-test:1.1
Rev: nettle/examples/rsa-sign.c:1.1
Rev: nettle/examples/rsa-verify-test:1.1
Rev: nettle/examples/rsa-verify.c:1.1
Rev: nettle/examples/setup-env:1.1
Rev: nettle/examples/teardown-env:1.1
Rev: nettle/hmac-md5.c:1.1
Rev: nettle/hmac-sha1.c:1.1
Rev: nettle/hmac-sha256.c:1.1
Rev: nettle/hmac.c:1.1
Rev: nettle/hmac.h:1.1
Rev: nettle/index.html:1.1
Rev: nettle/knuth-lfib.c:1.1
Rev: nettle/knuth-lfib.h:1.1
Rev: nettle/list-obj-sizes.awk:1.1
Rev: nettle/macros.h:1.1
Rev: nettle/md2-meta.c:1.1
Rev: nettle/md2.c:1.1
Rev: nettle/md2.h:1.1
Rev: nettle/md4-meta.c:1.1
Rev: nettle/md4.c:1.1
Rev: nettle/md4.h:1.1
Rev: nettle/md5-compat.c:1.1
Rev: nettle/md5-compat.h:1.1
Rev: nettle/md5-compress.c:1.1
Rev: nettle/md5-meta.c:1.1
Rev: nettle/md5.c:1.1
Rev: nettle/md5.h:1.1
Rev: nettle/memxor.c:1.1
Rev: nettle/memxor.h:1.1
Rev: nettle/nettle-internal.c:1.1
Rev: nettle/nettle-internal.h:1.1
Rev: nettle/nettle-meta.h:1.1
Rev: nettle/nettle-types.h:1.1
Rev: nettle/nettle.texinfo:1.1
Rev: nettle/pgp-encode.c:1.1
Rev: nettle/pgp.h:1.1
Rev: nettle/pkcs1-rsa-md5.c:1.1
Rev: nettle/pkcs1-rsa-sha1.c:1.1
Rev: nettle/pkcs1-rsa-sha256.c:1.1
Rev: nettle/pkcs1.c:1.1
Rev: nettle/pkcs1.h:1.1
Rev: nettle/realloc.c:1.1
Rev: nettle/realloc.h:1.1
Rev: nettle/rsa-compat.c:1.1
Rev: nettle/rsa-compat.h:1.1
Rev: nettle/rsa-decrypt.c:1.1
Rev: nettle/rsa-encrypt.c:1.1
Rev: nettle/rsa-keygen.c:1.1
Rev: nettle/rsa-md5-sign.c:1.1
Rev: nettle/rsa-md5-verify.c:1.1
Rev: nettle/rsa-sha1-sign.c:1.1
Rev: nettle/rsa-sha1-verify.c:1.1
Rev: nettle/rsa-sha256-sign.c:1.1
Rev: nettle/rsa-sha256-verify.c:1.1
Rev: nettle/rsa-sign.c:1.1
Rev: nettle/rsa-verify.c:1.1
Rev: nettle/rsa.c:1.1
Rev: nettle/rsa.h:1.1
Rev: nettle/rsa2openpgp.c:1.1
Rev: nettle/rsa2sexp.c:1.1
Rev: nettle/serpent-meta.c:1.1
Rev: nettle/serpent.c:1.1
Rev: nettle/serpent.h:1.1
Rev: nettle/serpent_sboxes.h:1.1
Rev: nettle/sexp-format.c:1.1
Rev: nettle/sexp-transport-format.c:1.1
Rev: nettle/sexp-transport.c:1.1
Rev: nettle/sexp.c:1.1
Rev: nettle/sexp.h:1.1
Rev: nettle/sexp2bignum.c:1.1
Rev: nettle/sexp2dsa.c:1.1
Rev: nettle/sexp2rsa.c:1.1
Rev: nettle/sha-example.c:1.1
Rev: nettle/sha.h:1.1
Rev: nettle/sha1-compress.c:1.1
Rev: nettle/sha1-meta.c:1.1
Rev: nettle/sha1.c:1.1
Rev: nettle/sha256-meta.c:1.1
Rev: nettle/sha256.c:1.1
Rev: nettle/shadata.c:1.1
Rev: nettle/sparc32/aes-decrypt-internal.asm:1.1
Rev: nettle/sparc32/aes-encrypt-internal.asm:1.1
Rev: nettle/sparc32/aes.m4:1.1
Rev: nettle/sparc32/arcfour-crypt.asm:1.1
Rev: nettle/sparc32/machine.m4:1.1
Rev: nettle/sparc64/aes-decrypt-internal.asm:1.1
Rev: nettle/sparc64/aes-encrypt-internal.asm:1.1
Rev: nettle/sparc64/arcfour-crypt.asm:1.1
Rev: nettle/sparc64/machine.m4:1.1
Rev: nettle/testsuite/.c-style:1.1
Rev: nettle/testsuite/.cvsignore:1.1
Rev: nettle/testsuite/.test-rules.make:1.1
Rev: nettle/testsuite/Makefile.in:1.1
Rev: nettle/testsuite/aes-test.c:1.1
Rev: nettle/testsuite/aes-test.out:1.1
Rev: nettle/testsuite/arcfour-test.c:1.1
Rev: nettle/testsuite/arctwo-test.c:1.1
Rev: nettle/testsuite/base16-test.c:1.1
Rev: nettle/testsuite/base64-test.c:1.1
Rev: nettle/testsuite/bignum-test.c:1.1
Rev: nettle/testsuite/blowfish-test.c:1.1
Rev: nettle/testsuite/buffer-test.c:1.1
Rev: nettle/testsuite/cast128-test.c:1.1
Rev: nettle/testsuite/cbc-test.c:1.1
Rev: nettle/testsuite/ctr-test.c:1.1
Rev: nettle/testsuite/cxx-test.cxx:1.1
Rev: nettle/testsuite/des-compat-test.c:1.1
Rev: nettle/testsuite/des-test.c:1.1
Rev: nettle/testsuite/des3-test.c:1.1
Rev: nettle/testsuite/dsa-keygen-test.c:1.1
Rev: nettle/testsuite/dsa-test.c:1.1
Rev: nettle/testsuite/gold-bug.txt:1.1
Rev: nettle/testsuite/hmac-test.c:1.1
Rev: nettle/testsuite/knuth-lfib-test.c:1.1
Rev: nettle/testsuite/md2-test.c:1.1
Rev: nettle/testsuite/md4-test.c:1.1
Rev: nettle/testsuite/md5-compat-test.c:1.1
Rev: nettle/testsuite/md5-test.c:1.1
Rev: nettle/testsuite/pkcs1-conv-test:1.1
Rev: nettle/testsuite/pkcs1-test.c:1.1
Rev: nettle/testsuite/rsa-encrypt-test.c:1.1
Rev: nettle/testsuite/rsa-keygen-test.c:1.1
Rev: nettle/testsuite/rsa-test.c:1.1
Rev: nettle/testsuite/rsa2sexp-test.c:1.1
Rev: nettle/testsuite/serpent-test.c:1.1
Rev: nettle/testsuite/sexp-conv-test:1.1
Rev: nettle/testsuite/sexp-format-test.c:1.1
Rev: nettle/testsuite/sexp-test.c:1.1
Rev: nettle/testsuite/sexp2rsa-test.c:1.1
Rev: nettle/testsuite/sha1-huge-test.c:1.1
Rev: nettle/testsuite/sha1-test.c:1.1
Rev: nettle/testsuite/sha256-test.c:1.1
Rev: nettle/testsuite/symbols-test:1.1
Rev: nettle/testsuite/teardown-env:1.1
Rev: nettle/testsuite/testutils.c:1.1
Rev: nettle/testsuite/testutils.h:1.1
Rev: nettle/testsuite/twofish-test.c:1.1
Rev: nettle/testsuite/yarrow-test.c:1.1
Rev: nettle/testsuite/yarrow-test.out:1.1
Rev: nettle/tools/.c-style:1.1
Rev: nettle/tools/.cvsignore:1.1
Rev: nettle/tools/.gdbinit:1.1
Rev: nettle/tools/Makefile.in:1.1
Rev: nettle/tools/input.c:1.1
Rev: nettle/tools/input.h:1.1
Rev: nettle/tools/misc.c:1.1
Rev: nettle/tools/misc.h:1.1
Rev: nettle/tools/nettle-lfib-stream.c:1.1
Rev: nettle/tools/output.c:1.1
Rev: nettle/tools/output.h:1.1
Rev: nettle/tools/parse.c:1.1
Rev: nettle/tools/parse.h:1.1
Rev: nettle/tools/pkcs1-conv.c:1.1
Rev: nettle/tools/sexp-conv.c:1.1
Rev: nettle/twofish-meta.c:1.1
Rev: nettle/twofish.c:1.1
Rev: nettle/twofish.h:1.1
Rev: nettle/x86/aes-decrypt-internal.asm:1.1
Rev: nettle/x86/aes-encrypt-internal.asm:1.1
Rev: nettle/x86/aes.m4:1.1
Rev: nettle/x86/arcfour-crypt.asm:1.1
Rev: nettle/x86/machine.m4:1.1
Rev: nettle/x86/md5-compress.asm:1.1
Rev: nettle/x86/sha1-compress.asm:1.1
Rev: nettle/yarrow.h:1.1
Rev: nettle/yarrow256.c:1.1
Rev: nettle/yarrow_key_event.c:1.1
parent 04e72466
#! /bin/sh
autoconf && autoheader
*.d
*.po
*.s
*.tar.gz
*.tar.gz.asc
.lib
Makefile
aesdata
autom4te.cache
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
/*.d
/*.po
/*.s
/*.tar.gz
/*.tar.gz.asc
/.lib
/Makefile
/aesdata
/autom4te.cache
/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
Please see the Nettle manual.
This diff is collapsed.
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
NEWS for the 1.15 release
Added support for PKCS#1 style RSA signatures using SHA256,
according to RFC 3447. Currently lacks interoperability
testing.
Header files are now C++ aware, so C++ programs using Nettle
should now use plain
#include <nettle/foo.h>
rather than
#extern "C" {
#include <nettle/foo.h>
}
as was the recommendation for the previous version. This
breaks source-level compatibility with C++, even though
there's full binary compatibility.
The file rfc1750.txt (which is considered non-free by debian)
has been removed from the distribution. The file was used as input
for the Yarrow testcase, and has been replaced by the short
story "The Gold-bug" by Edgar Allan Poe. Anyway, RFC 1750 is
obsoleted by RFC 4086.
Fixes for Darwin shared library support, contributed by Grant
Robinsson.
Example programs now use a supplied getopt.c.
Configure tests for assemblers with a logarithmic .align
directive.
The library is intended to be upwards binary compatible with
earlier versions. The library name is libnettle.so.2.6, soname
is still libnettle.so.2.
NEWS for the 1.14 release
Experimental support for reading keys in PKCS#1 ASN1/DER
format, and a new command line tool pkcs1-conv.
Improved MD5 performance on x86.
Fixed support for sparc64.
Reorganized AES code. Better performance for all three
implementations (C, x86 assembler, sparc assembler).
New sparc assembler for arcfour. Compared to the code
generated by gcc, the new code is about 25% faster on old
sparcs, and 6 times faster on ultrasparc.
Replaced the internal function nettle_mpz_from_octets with a
call to mpz_import, if available in the installed GMP library.
More Makefile fixes; it now seems to work to build with
the the make programs on Solaris and FreeBSD (although
--disable-dependency-tracking is required for the latter).
The library is intended to be binary compatible with earlier
versions. The library name is libnettle.so.2.5, soname is
still libnettle.so.2.
NEWS for the 1.13 release
Fixed problem with broken m4 on bsd, which resulted in
corrupted x86 assembler for sha1.
Nettle probably works on windows: I've been able to cross
compile it with ./configure --host=i586-mingw32msvc (without
public-key support), and the testsuite binaries seem to run
fine in Wine.
Implemented CTR mode.
Improved sha1 performance on x86.
Configure check to figure out if symbols in assembler files
need a leading underscore.
Improved benchmark program. Displays cycles per byte and block,
and compares with openssl (if openssl is installed).
Terminating newline in output from sexp-conv --hash.
The library is intended to be binary compatible with earlier
versions. The library name is libnettle.so.2.4. However, the
interface for the internal function _nettle_sha1_compress has
changed; any program that calls this function directly will
break.
NEWS for the 1.12 release
Fixed a bug in the configure script.
Updated the description of aes_set_encrypt_key and
aes_set_decrypt_key in the manual.
NEWS for the 1.11 release
Nettle no longer uses automake. Side effects:
* Dependency tracking is enabled only for gcc-3 (help with
supporting dependency tracking with other compilers is
appreciated).
* Makefile compatibility with make programs other than GNU
make is mostly unknown, please report any problems.
Support for arctwo.
Fixes to the libdes compatibility code. Declarations should
now match openssl/libdes better. des_cbc_cksum pads
input with NUL's, if it's not an integral number of blocks (in
general, such unreversible padding is a bad idea).
By default, also the static library is compiled as position
independent code. This is needed on some systems to make it
possible to link nettle into a dynamically loaded module. Use
the configure flag --disable-pic if this is not desired.
Stricter constness typing for the sexp_iterator_assoc and
sexp_iterator_check_types arguments.
Minor tweaks of arcfour on x86 cpu:s, to speed it up on older
x86 variants such as PII and PPro.
The shared library is intended to be binary compatible with
nettle-1.8 - nettle-1.10. Only the minor version number of the
shared library is increased. The soname is still
libnettle.so.2.
NEWS for the 1.10 release
Nettle should now compile also on Tru64, Darwin, FreeBSD and
Windows. (The only tested windows build uses the rntcl rsh
wrapper to run the command line M$ C compiler "cl". See
http://pike.ida.liu.se for those tools, I don't know all
details about the Pike team's windows setup).
There are some known testsuite failures, on Windows and on one
of the xenofarm HPUX machines, see
http://www.lysator.liu.se/~nisse/xeno-lsh/latest.html. Help
tracking these down is appreciated.
There are no new features.
This release is intended to be binary compatible with
nettle-1.8 and nettle-1.9.
NEWS for the 1.9 release
Optimized C implementation of arcfour. Optimized x86
implementations of arcfour and sha1.
Improved benchmark program.
Fixed bug in the rsa-encrypt example program.
Fixed bug in make install, some of the header files were
forgotten.
Portability fixes. Fixes to make Nettle compile on systems
without gmp. This version has been tested on GNU/Linux,
Solaris, HPUX and AIX.
The shared library is intended to be binary compatible with
nettle-1.8. Only the minor version number of the shared
library is increased.
NEWS for the 1.8 release
New example programs, demonstrating encrypting and decrypting
files using RSA, and random sessions keys for bulk encryption
and message authentication.
Support for systems that don't have alloca. On such systems,
some of Nettle's functions have arbitrary limits applied to
their input.
Uses AX_CREATE_STDINT_H, to support systems without
inttypes.h.
Support for the md2 and md4 hash functions.
New name mangling, to reduce the risk of link collisions. All
functions (except memxor) now use a nettle_ or _nettle_ prefix
when seen by the linker. For most functions, the header file
that declares a function also uses #define to provide a
shorter more readable name without the prefix.
The shared library soname for this version is libnettle.so.2.
NEWS for the 1.7 release
Implemented DSA.
Renamed RSA functions for consistency. Now it's
rsa_public_key_init, not rsa_init_public_key, etc.
Both RSA and DSA now have sign/verify functions that take the
hash digest as argument.
A rewritten and much more powerful sexp-conv program.
Other changes to the sexp code, in particular updating it to
the latest SPKI draft.
Building nettle as a shared library (ELF only) seems to work.
The version number is increased, so the library "soname" for
this release is "libnettle.so.1".
Bugfixes. Fixes for build and portability problems.
NEWS for the 1.6 release
Optimized assembler implementations of aes, for sparc and x86.
The aes interface has changed slightly. The function
aes_set_key is no more. Instead one has to use
aes_set_encrypt_key or aes_set_decrypt_key. Sorry about that.
New example programs, rsa-keygen, rsa-sign and rsa-verify,
located in the examples directory.
New configure option --enable-shared, which builds a shared
library. Not tested.
New experimental features, including sexp parsing and
formatting, and changes to base64 encoding and decoding. The
interfaces to these functions are subject to change, and are
documented only in the source code.
NEWS for the 1.5 release
RSA support. Key generation and signatures.
Support for HMAC (RFC-2104).
An implementation of the Yarrow-256 PRNG.
New sections in the manual.
Changed the interface for hash functions. The md5_digest
function is now equivalent to the old sequence of md5_final,
md5_digest, md5_init, and similarly for the other hashing
algorithms. This makes the interface simpler.
NEWS for the 1.0 release
Fixed twofish bug spotted by Jean-Pierre Stierlin.
Added des3 and cbc.
New RFC-1321-like interface in nettle/md5-compat.h, suggested
by Assar Westerlund.
New libdes-style compatibility interface in nettle/des-compat.h.
What is 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
(C++, Python, Pike, ...), in applications like LSH or GNUPG, or even in
kernel space. In most contexts, you need more than the basic
cryptographic algorithms, you also need some way to keep track of available
algorithms, their properties and variants. You often have some algorithm
selection process, often dictated by a protocol you want to implement.
And as the requirements of applications differ in subtle and not so
subtle ways, an API that fits one application well can be a pain to use
in a different context. And that is why there are so many different
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.
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.
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.
Build nettle with the usual ./configure && make && make check && make
install. Read the manual. Mail me if you have any questions or
suggestions.
You can also build Nettle from cvs, using
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
You may want to subscribe to the nettle-bugs mailing list. See
<URL: http://lists.lysator.liu.se/mailman/listinfo/nettle-bugs>.
Happy hacking,
/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.
/* 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.
*/
#if HAVE_CONFIG_H
# include "config.h"
#endif
#include <assert.h>
#include "aes-internal.h"
#include "macros.h"
void
_nettle_aes_decrypt(const struct aes_ctx *ctx,
const struct aes_table *T,
unsigned 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;
/* 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];
for (round = 1; round < ctx->nrounds; round++)
{
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. */
w0 = t0;
w1 = t1;
w2 = t2;
w3 = t3;
}
/* 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]);
LE_WRITE_UINT32(dst, t0);
LE_WRITE_UINT32(dst + 8, t2);
LE_WRITE_UINT32(dst + 4, t1);
LE_WRITE_UINT32(dst + 12, t3);
}
}
This diff is collapsed.
/* 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.
*/
#if HAVE_CONFIG_H
# include "config.h"
#endif
#include <assert.h>
#include "aes-internal.h"
#include "macros.h"
void
_nettle_aes_encrypt(const struct aes_ctx *ctx,
const struct aes_table *T,
unsigned 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;
/* 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];
for (round = 1; round < ctx->nrounds; round++)
{
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. */
w0 = t0;
w1 = t1;
w2 = t2;
w3 = t3;
}
/* Final round */
t0 = AES_FINAL_ROUND(T, w0, w1, w2, w3, ctx->keys[4*round]);
t1 = AES_FINAL_ROUND(T,</