Tizen 2.0 Release
[external/nettle.git] / ChangeLog
1 2010-07-25  Niels Möller  <nisse@lysator.liu.se>
2
3         * Released nettle-2.1.
4
5         * configure.ac: Use camellia-crypt-internal.asm, if available.
6         Bumped soname to libnettle.so.4, and reset LIBNETTLE_MINOR to
7         zero.
8
9         * x86/machine.m4 (LREG, HREG): Moved macros here, from... 
10         * x86/aes.m4: ...here.
11
12         * x86/camellia-crypt-internal.asm: New file.
13
14         * nettle.texinfo: Updated and expanded section on DSA.
15         Document aes_invert_key, and camellia. Added missing functions
16         rsa_sha512_verify and rsa_sha512_verify_digest.
17
18         * camellia.h (struct camellia_ctx): Eliminate the two unused
19         subkeys, and renumber the remaining ones.       
20         * camellia-crypt-internal.c (_camellia_crypt): Updated for
21         renumbered subkeys.
22         * camellia-set-encrypt-key.c (camellia_set_encrypt_key): Likewise.
23         * camellia-set-decrypt-key.c (camellia_invert_key): Likewise.
24
25         * camellia-set-encrypt-key.c (camellia_set_encrypt_key): Inline
26         the expansion of camellia_setup128 and camellia_setup256, keeping
27         the unexpanded key in scalar variables.
28         (camellia_setup128): Deleted.
29         (camellia_setup256): Deleted.
30
31 2010-07-24  Niels Möller  <nisse@lysator.liu.se>
32
33         * camellia-set-encrypt-key.c (camellia_set_encrypt_key): Reduced
34         code size, no complete loop unroll. Use one loop for each phase of
35         the post-processing.
36
37         * testsuite/camellia-test.c: New tests for camellia_invert_key.
38         * testsuite/aes-test.c: New tests for aes_invert_key.
39
40         * aes.h (aes_invert_key): Declare it.
41
42         * aes-set-decrypt-key.c (aes_invert_key): New function, key
43         inversion code extracted from aes_set_decrypt_key.
44         (aes_set_decrypt_key): Use aes_invert_key.
45
46         * camellia-set-encrypt-key.c (camellia_setup128): Generate
47         unmodified subkeys according to the spec. Moved clever combination
48         of subkeys to camellia_set_encrypt_key.
49         (camellia_setup256): Likewise.
50         (camellia_set_encrypt_key): Moved subkey post-processing code
51         here, and reduce code duplication between 128-bit keys and larger
52         keys.
53
54         * camellia.c: Deleted file, split into several new files...
55         * camellia-table.c (_camellia_table): New file with the constant
56         sbox tables.
57         * camellia-set-encrypt-key.c: New file.
58         (camellia_setup128): Generate unmodified subkeys according to the
59         spec. Moved clever combination of subkeys to camellia_set_encrypt_key.
60         (camellia_setup256): Likewise.
61
62         * camellia-set-decrypt-key.c: New file.
63         (camellia_invert_key): Key inversion function.
64         (camellia_set_decrypt_key): New key setup function.
65         * camellia-internal.h: New file.
66         * camellia-crypt.c (camellia_crypt): New file, new wrapper
67         function passing the sbox table to _camellia_crypt.
68         * camellia-crypt-internal.c (_camellia_crypt): New file, with main
69         encrypt/decrypt function.
70         * Makefile.in (nettle_SOURCES): Updated list of camellia source files.  
71         (DISTFILES): Added camellia-internal.h.
72
73 2010-07-20  Niels Möller  <nisse@lysator.liu.se>
74
75         * camellia-meta.c: Use _NETTLE_CIPHER_SEP_SET_KEY.
76
77         * camellia.h (struct camellia_ctx): Replaced flag camellia128 by
78         expanded key length nkeys.
79
80         * camellia.c (camellia_set_encrypt_key): Renamed, from...
81         (camellia_set_key): ... old name.
82         (camellia_invert_key): New function.
83         (camellia_set_decrypt_key): New function, using
84         camellia_invert_key.
85         (camellia_crypt): Renamed, from...
86         (camellia_encrypt): ... old name.
87         (camellia_decrypt): Deleted, no longer needed. camellia_crypt used
88         for both encryption and decryption.
89
90         * nettle-meta.h (_NETTLE_CIPHER_SEP_SET_KEY): New macro.
91
92         * dsa-keygen.c: Removed unnecessary include of memxor.h.
93
94         * camellia.c: Rewrote to use 64-bit type for subkeys and use
95         64-bit operations throughout. Performance on x86_32, when compiled
96         with gcc-4.4.4, is reduced by roughly 15%, this should be fixed
97         later.
98
99         * camellia.h (struct camellia_ctx): Use type uint64_t for subkeys.
100
101 2010-07-07  Niels Möller  <nisse@lysator.liu.se>
102
103         * aes.h (aes_encrypt, aes_decrypt): Declare ctx argument as const.
104         Also updated implementation.
105         * blowfish.h (blowfish_encrypt, blowfish_decrypt): Likewise.
106         * cast128.h (cast128_encrypt, cast128_decrypt): Likewise.
107         * serpent.h (serpent_encrypt, serpent_decrypt): Likewise.
108         * twofish.h (twofish_encrypt, twofish_decrypt): Likewise.
109
110         * testsuite/Makefile.in (TS_NETTLE_SOURCES): Added
111         camellia-test.c.
112
113         * examples/nettle-benchmark.c: Added camellia ciphers.
114
115         * Makefile.in (nettle_SOURCES): Added camellia.c and
116         camellia-meta.c.
117         (HEADERS): Added camellia.h.
118
119         * nettle-meta.h (nettle_camellia128): Declare.
120         (nettle_camellia192): Likewise.
121         (nettle_camellia256): Likewise.
122
123         * camellia-meta.c: New file.
124
125         * camellia.h: Rewrote interface to match nettle conventions.
126
127         * camellia.c: Converted to nettle conventions.
128         (camellia_encrypt128, camellia_encrypt256): Unified to new
129         function...
130         (camellia_encrypt): ...New function, with a loop doing 6
131         regular rounds, one FL round and one FLINV round per iteration,
132         with iteration count depending on the key size.
133
134         (camellia_decrypt128, camellia_decrypt256): Similarly unified
135         as...
136         (camellia_decrypt): ...New function, analogous to
137         camellia_encrypt.
138
139 2010-07-06  Niels Möller  <nisse@lysator.liu.se>
140
141         * camellia.c, camellia.h: New files, copied from
142         http://info.isl.ntt.co.jp/crypt/eng/camellia/dl/camellia-LGPL-1.2.0.tar.gz.
143
144         * testsuite/camellia-test.c: New file.
145
146 2010-07-05  Niels Möller  <nisse@lysator.liu.se>
147
148         * nettle.texinfo: Document new conventions for weak key and des
149         parity checks. Document des_check_parity.
150
151         * testsuite/des-test.c (test_weak): Don't check the deleted status
152         attribute.
153
154         * des-compat.c (des_key_sched): Rewrote error checking logic for
155         the case of non-zero des_check_key.
156
157         * des3.c (des3_set_key): Changed weak key detection logic.
158         Complete key setup also for weak keys, and don't set the status
159         attribute.
160
161         * des.c (des_set_key): New iteration logic, to keep key pointer
162         unchanged. Moved weak key check to the end, and don't set the
163         status attribute.
164         (des_encrypt): Ignore status attribute.
165         (des_decrypt): Likewise.
166
167         * des.h (enum des_error): Deleted.
168         (struct des_ctx): Deleted status attribute.
169         (struct des3_ctx): Likewise.
170
171         * blowfish.c (initial_ctx): Deleted status value.
172         (blowfish_encrypt): Ignore status attribute.
173         (blowfish_decrypt): Likewise.
174         (blowfish_set_key): return result from weak key check, without
175         setting the status attribute.
176
177         * blowfish.h (enum blowfish_error): Deleted.
178         (struct blowfish_ctx): Deleted status attribute.
179
180         * Makefile.in (des_headers): Deleted parity.h.
181
182 2010-06-30  Niels Möller  <nisse@lysator.liu.se>
183
184         * testsuite/des-test.c (test_des): New function.
185         (test_weak): New function.
186         (test_main): Use test_des and test_weak. Added tests for all the
187         weak keys. Added some tests with invalid (to be ignored) parity
188         bits.
189
190         * des.c (parity_16): New smaller parity table.
191         (des_check_parity): New function.
192         (des_fix_parity): Use parity_16.
193         (des_weak_p): New weak-key detection. Ignores parity bits, and
194         uses a hash table.
195         (des_set_key): Deleted parity checking code. Replaced old weak-key
196         detection code by a call to des_weak_p.
197
198 2010-06-04  Niels Möller  <nisse@lysator.liu.se>
199
200         * testsuite/testutils.c (test_dsa_key): Updated for new name
201         DSA_SHA1_MIN_P_BITS.
202
203         * dsa-keygen.c (dsa_generate_keypair): Use DSA_SHA1_MIN_P_BITS and
204         DSA_SHA256_MIN_P_BITS.
205
206         * dsa.h (DSA_MIN_P_BITS, DSA_Q_OCTETS, DSA_Q_BITS): Renamed to...
207         (DSA_SHA1_MIN_P_BITS, DSA_SHA1_Q_OCTETS, DSA_SHA1_Q_BITS): New
208         names.
209
210         * sexp2dsa.c (dsa_keypair_from_sexp_alist): New argument q_bits.
211         Renamed parameter limit to p_max_bits.
212         (dsa_sha1_keypair_from_sexp): Renamed, was dsa_keypair_from_sexp.
213         Updated to call dsa_keypair_from_sexp_alist with the new argument.
214         (dsa_sha256_keypair_from_sexp): New function.
215         (dsa_signature_from_sexp): New argument q_bits.
216
217         * der2dsa.c (dsa_params_from_der_iterator): Enforce 160-bit limit
218         on q. Renamed parameter limit to p_max_bits.
219         (dsa_openssl_private_key_from_der_iterator): Enforce 160-bit limit
220         on q and x. Renamed parameter limit to p_max_bits.
221
222 2010-06-03  Niels Möller  <nisse@lysator.liu.se>
223
224         * testsuite/dsa-test.c (test_main): Added test for dsa-sha256.
225
226 2010-06-02  Niels Möller  <nisse@lysator.liu.se>
227
228         * testsuite/dsa-test.c (test_main): Provide expected value of the
229         signature.
230
231         * testsuite/testutils.c (test_dsa160): Added argument for expected
232         signature.
233         (test_dsa256): Likewise.
234
235 2010-06-01  Niels Möller  <nisse@lysator.liu.se>
236
237         * testsuite/rsa-keygen-test.c (test_main): Updated expected
238         signatures.
239
240         * examples/random-prime.c (main): Updated for nettle_random_prime
241         change.
242         * testsuite/random-prime-test.c (test_main): Likewise.
243
244         * rsa-keygen.c (bignum_random_prime): Deleted function.
245         (rsa_generate_keypair): Use new nettle_random_prime. Generate
246         secret factors p and q with the two most significant bits set.
247
248         * dsa-keygen.c (dsa_generate_keypair): Updated for changes in
249         nettle_random_prime and _nettle_generate_pocklington_prime. Invoke
250         progress callback.
251
252         * bignum-random-prime.c (_nettle_generate_pocklington_prime): New
253         argument top_bits_set, to optionally generate primes with the two
254         most significant bits set. Reordered argument list.
255         (nettle_random_prime): Likewise, added top_bits_set argument.
256         Invoke progress callback when a prime is generated.
257
258 2010-05-26  Niels Möller  <nisse@lysator.liu.se>
259
260         * dsa-keygen.c (dsa_generate_keypair): Use
261         _nettle_generate_pocklington_prime. Deleted old key generation
262         code.
263
264         * bignum-random-prime.c (_nettle_generate_pocklington_prime): Also
265         return the used r. Updated caller.
266
267         * examples/random-prime.c (main): Allow sizes down to 3 bits.
268
269         * bignum-random-prime.c (_nettle_generate_pocklington_prime): New
270         function. Rely on mpz_probab_prime_p (for lack of a trial division
271         function) for trial division.
272         (nettle_random_prime): Rewritten. Uses the prime table for the
273         smallest sizes, then trial division using a new set of tables, and
274         then Maurer's algorithm, calling the new
275         _nettle_generate_pocklington_prime for the final search.
276
277 2010-05-25  Niels Möller  <nisse@lysator.liu.se>
278
279         * testsuite/dsa-test.c (test_main): Updated for dsa testing
280         changes.
281
282         * testsuite/dsa-keygen-test.c (test_main): Test dsa256.
283
284         * testsuite/testutils.h (struct nettle_mac): New struct, currently
285         unused.
286
287         * testsuite/testutils.c (test_mac): New function (currently not
288         used).
289         (test_dsa): Replaced by two new functions...
290         (test_dsa160): New function.
291         (test_dsa256): New function.
292         (test_dsa_key): New argument q_size.
293         (DSA_VERIFY): Generalized.
294
295         * dsa-keygen.c (dsa_generate_keypair): Rewritten, now generating
296         primes using Pocklington's theorem. Takes both p_size and q_size
297         as arguments.
298
299 2010-05-20  Niels Möller  <nisse@lysator.liu.se>
300
301         * bignum-random-prime.c (miller_rabin_pocklington): Fixed broken
302         logic when Miller-rabin succeeds early.
303
304 2010-04-09  Niels Möller  <nisse@lysator.liu.se>
305
306         * bignum-next-prime.c: Include stdlib.h, needed for alloca on
307         freebsd.
308         * hmac.c: Likewise.
309
310         * examples/Makefile.in (SOURCES): Added random-prime.c.
311
312         * examples/random-prime.c: New program.
313
314         * testsuite/Makefile.in (TS_NETTLE_SOURCES): Moved
315         knuth-lfib-test.c, cbc-test.c, ctr-test.c, hmac-test.c here, from
316         TS_HOGWEED_SOURCES.
317         (TS_HOGWEED_SOURCES): Added random-prime-test.c.
318
319         * testsuite/random-prime-test.c: New test case.
320
321         * examples/next-prime.c (main): With no command line arguments.
322         exit after dislaying usage message.
323
324         * examples/io.c (simple_random): Free buffer when done.
325
326         * configure.ac: Changed message, say CC is the recommended
327         way to configure the ABI.
328
329         * bignum-random.c: Deleted test of HAVE_LIBGMP.
330         * bignum.c: Likewise.
331         * sexp2bignum.c: Likewise.
332
333         * Makefile.in (hogweed_SOURCES): Added bignum-random-prime.c.
334
335         * bignum-random-prime.c (nettle_random_prime): New file, new
336         function.
337
338 2010-03-31  Niels Möller  <nisse@lysator.liu.se>
339
340         * examples/nettle-benchmark.c (main): Benchmark sha224.
341
342 2010-03-30  Niels Möller  <nisse@lysator.liu.se>
343
344         * testsuite/testutils.c (DSA_VERIFY): Updated for dsa_sha1_verify
345         rename.
346         (test_dsa): Check return value from dsa_sha1_sign.
347
348         * Makefile.in (hogweed_SOURCES): Added dsa-sha1-sign.c,
349         dsa-sha1-verify.c, dsa-sha256-sign.c, and dsa-sha256-verify.c.
350
351         * dsa.h: Updated and added dsa declarations.
352
353         * dsa-sha256-verify.c (dsa_sha256_verify_digest): New file, new
354         function.
355         (dsa_sha256_verify): New function.
356         * dsa-sha256-sign.c (dsa_sha256_sign_digest): New file, new
357         function.
358         (dsa_sha256_sign): New function.
359
360         * dsa-sha1-verify.c (dsa_sha1_verify_digest): New file. Moved and
361         renamed function, from dsa_verify_digest, rewrote to use
362         _dsa_verify.
363         (dsa_sha1_verify): Analogous change, renamed from dsa_verify.
364         * dsa-sha1-sign.c (dsa_sha1_sign_digest): New file. Moved and
365         renamed function, from dsa_sign_digest, rewrote to use _dsa_sign,
366         and added return value.
367         (dsa_sha1_sign): Analogous change, renamed from dsa_sign.
368
369         * dsa-verify.c (_dsa_verify): New general verification function,
370         for any hash.
371         * dsa-sign.c (_dsa_sign): New general signing function, for any
372         hash. Returns success code, like the rsa signture functions.
373
374 2010-03-29  Niels Möller  <nisse@lysator.liu.se>
375
376         * configure.ac (ABI): Attempt to use a better, ABI-dependant,
377         default value for libdir.
378
379         * x86/md5-compress.asm: Fixed function name in epilogue.
380
381         * asm.m4 (EPILOGUE): Use . to refer to current address.
382
383         * configure.ac (ABI): Detect which ABI the compiler is using.
384         On x86_64, also check for __arch64__.
385
386 2010-03-28  Niels Möller  <nisse@lysator.liu.se>
387
388         * configure.ac (asm_path): For x86_64, check if compiler is
389         generating 32-bit code.
390
391 2010-03-27  Niels Möller  <nisse@lysator.liu.se>
392
393         * testsuite/hmac-test.c (test_main): Rewrote rest of tests to use
394         HMAC_TEST, and added more tests from Daniel Kahn Gillmor and from
395         RFC 4231.
396
397         * Makefile.in (nettle_SOURCES): Added hmac-sha224.c and
398         hmac-sha384.c.
399
400         * hmac.h: Added declarations of hmac-sha224 and hmac-sha384.
401
402         * hmac-sha224.c: New file.
403
404 2010-03-26  Niels Möller  <nisse@lysator.liu.se>
405
406         * testsuite/hmac-test.c (HMAC_TEST): New macro.
407         (test_main): Use HMAC_TEST for the md5 and sha1 tests, and add
408         test vectors from Daniel Kahn Gillmor.
409
410         * testsuite/Makefile.in (TS_NETTLE_SOURCES): Added sha224-test.c.
411
412         * Makefile.in (nettle_SOURCES): Added sha224-meta.c and
413         write-be32.c.
414         (DISTFILES): Added nettle-write.h.
415
416         * sha.h: Added declarations for sha224. Some are aliases for the
417         corresponding sha256 definition.
418
419         * sha256.c (sha256_digest): Use _nettle_write_be32.
420         (sha224_init): New function.
421         (sha224_digest): New function.
422
423         * sha1.c (sha1_digest): Use _nettle_write_be32.
424
425         * nettle-internal.h (NETTLE_MAX_HASH_BLOCK_SIZE)
426         (NETTLE_MAX_HASH_DIGEST_SIZE): Increased, to take sha512 into
427         account.
428
429         * nettle-write.h: New file.
430
431         * write-be32.c (_nettle_write_be32): New file, new function.
432
433         * sha224-meta.c: New file.
434
435 2010-03-25  Niels Möller  <nisse@lysator.liu.se>
436
437         * hmac-sha384.c: New file.
438
439         * testsuite/sha224-test.c: New file.
440
441         * testsuite/md4-test.c (test_main): More test vectors, provided by
442         Daniel Kahn Gillmor.
443         * testsuite/md5-test.c (test_main): Likewise.
444         * testsuite/sha1-test.c (test_main): Likewise.
445         * testsuite/sha256-test.c (test_main): Likewise.
446         * testsuite/sha384-test.c (test_main): Likewise.
447         * testsuite/sha512-test.c (test_main): Likewise.
448
449         * configure.ac: Bumped version numbers. Package version
450         nettle-2.1, library versions libnettle.so.3.1, libhogweed.so.2.0.
451
452         * examples/nettle-benchmark.c (main): Benchmark sha384.
453
454         * testsuite/Makefile.in (TS_NETTLE_SOURCES): Added sha384-test.c.
455
456         * testsuite/sha384-test.c: New file.
457
458         * Makefile.in (nettle_SOURCES): Added sha384-meta.c.
459
460         * sha384-meta.c: New file.
461
462         * sha.h: Added declarations for sha384. Some are aliases for the
463         corresponding sha512 definition.
464
465         * sha512.c (sha512_write_digest): New function.
466         (sha512_digest): Use it.
467         (sha384_init): New function.
468         (sha384_digest): New function.
469
470 2010-03-24  Niels Möller  <nisse@lysator.liu.se>
471
472         * sha512.c: (sha512_digest): Simplified handling of any final
473         partial word of the digest.
474
475         * sha512.c: Reorganized to use _nettle_sha512_compress.
476
477         * sha512-compress.c (_nettle_sha512_compress): Compression
478         function extracted from sha512.c to a new file.
479
480         * Makefile.in (nettle_SOURCES): Added sha256-compress.c and
481         sha512-compress.c.
482
483         * sha256.c: Reorganized to use _nettle_sha256_compress.
484
485         * sha256-compress.c (_nettle_sha256_compress): Compression
486         function extracted from sha256.c to a new file.
487
488         * examples/nettle-benchmark.c (main): Benchmark sha512.
489
490         * rsa-keygen.c (rsa_generate_keypair): Ensure that bit size of e
491         is less than bit size of n, and check for the unlikely case p = q.
492
493         * rsa.h (RSA_MINIMUM_N_OCTETS, RSA_MINIMUM_N_BITS): Reduced, to
494         correspond to pkcs#1 encryption of single byte messagees.
495
496         * pgp-encode.c (pgp_put_rsa_sha1_signature): Check return value
497         from rsa_sha1_sign.
498         * rsa-compat.c (R_SignFinal): Likewise.
499
500         * rsa-md5-sign.c (rsa_md5_sign): Check and propagate return value
501         from pkcs1_rsa_md5_encode.
502         (rsa_md5_sign_digest): Check and propagate return value from
503         pkcs1_rsa_md5_encode_digest.
504         * rsa-md5-verify.c (rsa_md5_verify): Check return value from
505         pkcs1_rsa_md5_encode.
506         (rsa_md5_verify_digest): Check return value from
507         pkcs1_rsa_md5_encode_digest.
508         * rsa-sha1-sign.c: Analogous changes.
509         * rsa-sha1-verify.c: Analogous changes.
510         * rsa-sha256-sign.c: Analogous changes.
511         * rsa-sha256-verify.c: Analogous changes.
512         * rsa-sha512-sign.c: Analogous changes.
513         * rsa-sha512-verify.c: Analogous changes.
514
515         * pkcs1-rsa-md5.c (pkcs1_rsa_md5_encode)
516         (pkcs1_rsa_md5_encode_digest): Added return value. Check and
517         propagate return value from pkcs1_signature_prefix.
518         * pkcs1-rsa-sha256.c (pkcs1_rsa_sha256_encode)
519         (pkcs1_rsa_sha256_encode_digest): Likewise.
520         * pkcs1-rsa-sha1.c (pkcs1_rsa_sha1_encode)
521         (pkcs1_rsa_sha1_encode_digest): Likewise.
522         * pkcs1-rsa-sha512.c (pkcs1_rsa_sha512_encode)
523         (pkcs1_rsa_sha512_encode_digest): Likewise.
524
525         * pkcs1.c (pkcs1_signature_prefix): Interface change, take both
526         the total size and digest size as arguments, and return a status
527         code to say if the size was large enough.
528
529         * testsuite/Makefile.in: Added hogweed dependency for the test
530         programs.
531
532 2010-03-23  Niels Möller  <nisse@lysator.liu.se>
533
534         * testsuite/rsa-test.c (test_main): Test signing with sha512.
535
536         * testsuite/testutils.c (test_rsa_sha512): New function.
537
538         * Makefile.in (hogweed_SOURCES): Added pkcs1-rsa-sha512.c,
539         rsa-sha512-sign.c and rsa-sha512-verify.c.
540
541         * rsa.h: Added prototypes for sha512-related functions.
542         (RSA_MINIMUM_N_OCTETS, RSA_MINIMUM_N_BITS): Increased.
543         * pkcs1.h: Added prototypes for sha512-related functions.
544
545         * rsa-sha512-verify.c: New file.
546         * rsa-sha512-sign.c: New file.
547         * pkcs1-rsa-sha512.c: New file.
548
549 2010-03-22  Niels Möller  <nisse@lysator.liu.se>
550
551         * Makefile.in (nettle_SOURCES): Added hmac-sha512.c.
552
553         * testsuite/hmac-test.c (test_main): Added test cases for
554         hmac-sha512.
555
556         * hmac.h: Declare functions sha512-related functions.
557         * hmac-sha512.c (hmac_sha512_set_key): New file.
558
559         Basic sha512 support.
560         * testsuite/Makefile.in (TS_NETTLE_SOURCES): Added sha512-test.c.
561         * testsuite/sha512-test.c: New file.
562
563         * macros.h (READ_UINT64, WRITE_UINT64): New macros.
564
565         * Makefile.in (nettle_SOURCES): Added sha512.c and sha512-meta.c.
566         * sha.h: Added sha512-related declarations.
567         * nettle-meta.h: Likewise.
568         * sha512-meta.c: New file.
569         * sha512.c: New file.
570
571 2010-03-06  Niels Möller  <nisse@lysator.liu.se>
572
573         * Makefile.in (distdir): Include x86_64 assembler files.
574
575 2010-01-20  Niels Möller  <nisse@lysator.liu.se>
576
577         * configure.ac: Check for mpz_powm_sec.
578
579 2010-01-13  Niels Möller  <nisse@lysator.liu.se>
580
581         * Makefile.in ($(LIBHOGWEED_FORLINK)): Depend on
582         $(LIBNETTLE_FORLINK).
583
584         * configure.ac (LIBHOGWEED_LIBS): Added -lnettle -lgmp for the
585         default case. Follows debian, and also makes dlopen of
586         libhogweed.so work, without having to use RTLD_GLOBAL.
587         (LIBHOGWEED_LINK): Added -L., to find our libnettle.so.
588
589 2009-10-21  Niels Möller  <nisse@lysator.liu.se>
590
591         * tools/Makefile.in (pkcs1-conv$(EXEEXT)): Added dependency on
592         ../libhogweed.a.
593
594 2009-10-19  Niels Möller  <nisse@lysator.liu.se>
595
596         * tools/pkcs1-conv.c: Updated for dsa/der interface change.
597
598         * der2dsa.c (dsa_public_key_from_der_iterators): Split into two
599         new functions...
600         (dsa_params_from_der_iterator): New function.
601         (dsa_public_key_from_der_iterator): New function.
602         (dsa_openssl_private_key_from_der_iterator): Renamed, was
603         dsa_private_key_from_der_iterator.
604         (dsa_openssl_private_key_from_der): Likewise.
605         * dsa.h: Corresponding changees to prototypes and #defines.
606
607 2009-10-12  Niels Möller  <nisse@lysator.liu.se>
608
609         * sexp-format.c: Removed conditioning on HAVE_LIBGMP.
610
611         * tools/pkcs1-conv.c: Support for DSA keys, contributed by Magnus
612         Holmgren.
613
614         * Makefile.in (hogweed_SOURCES): Added dsa2sexp.c and der2dsa.c.
615
616         * der2dsa.c: New file, contributed by Magnus Holmgren.
617         * dsa2sexp.c: Likewise.
618         * dsa.h: Added prototypes.
619
620         * configure.ac (LIBHOGWEED_MINOR): Bumped libhogweed minor
621         version, now it's 1.1.
622
623         * testsuite/rsa2sexp-test.c (test_main): Updated testcase for
624         "rsa-pkcs1".
625
626 2009-10-11  Niels Möller  <nisse@lysator.liu.se>
627
628         * rsa2sexp.c (rsa_keypair_to_sexp): Changed default algorithm name
629         to "rsa-pkcs1".
630
631 2009-09-20  Niels Möller  <nisse@lysator.liu.se>
632
633         * x86/sha1-compress.asm: Improved performance by 17% on AMD K7,
634         by letting loopmix scramble the instruction order.
635
636 2009-09-15  Niels Möller  <nisse@lysator.liu.se>
637
638         * x86/sha1-compress.asm: Cleanup, removing old cruft. Slight
639         improvement to ROUND_F1_NOEXP. Slight reduction of
640         dependency-chains.
641
642 2009-08-25  Niels Möller  <nisse@lysator.liu.se>
643
644         * x86/sha1-compress.asm: Eliminated tmp variable for f3 rounds.
645
646         * examples/nettle-benchmark.c (bench_sha1_compress): New function,
647         for precise benchmarking of the compression function.
648
649 2009-06-08  Niels Möller  <nisse@lysator.liu.se>
650
651         * Released nettle-2.0.
652
653 2009-06-04  Niels Möller  <nisse@lysator.liu.se>
654
655         * configure.ac: Set version to 2.0
656
657 2009-05-30  Niels Möller  <nisse@lysator.liu.se>
658
659         * Makefile.in (.texinfo.info): Don't use a temporary output file
660         $@T, trust makeinfo to remove output file on errors.
661
662 2009-05-19  Niels Möller  <nisse@lysator.liu.se>
663
664         * nettle.texinfo: Changed license to public domain.
665
666 2009-05-11  Niels Möller  <nisse@lysator.liu.se>
667
668         * nettle.texinfo: Fixes from Karl Berry. Added some more index
669         terms.
670
671 2009-03-06  Niels Möller  <nisse@lysator.liu.se>
672
673         * x86_64/aes-encrypt-internal.asm: Reduced unrolling. Keep state
674         in %eax--%edx only.
675         * x86_64/aes-decrypt-internal.asm: Likewise.
676
677         * x86_64/aes.m4 (MOVE_HREG): Deleted, no longer needed.
678         (AES_STORE): Reduced offsets.
679         (AES_ROUND): Use HREG directly, not MOVE_HREG.
680
681         * x86_64/aes-decrypt-internal.asm: Rearrange register allocation.
682         Put SA--SD in %eax--%edx, so the second byte can be accessed as
683         %ah-%dh. TD is not needed, SD can be reused. Use the register that
684         is saved for the outer loop counter, getting it off the stack.
685         * x86_64/aes-encrypt-internal.asm: Likewise.
686
687         * x86_64/aes.m4 (HREG, MOVE_HREG): New macros.
688         (XREG): Fixed bug in handling of %r8 and %r9.
689         (AES_ROUND): Use MOVE_HREG.
690
691 2009-02-10  Niels Möller  <nisse@lysator.liu.se>
692
693         * base16-meta.c (base16_encode_update_wrapper): Mark ctx argument
694         as UNUSED.
695
696         * testsuite/sexp-conv-test: Updated testcases for improved
697         handling of comments.
698
699         * tools/sexp-conv.c (sexp_convert_item): Use sexp_put_soft_newline
700         to terminate comments, and modify indentation for the case that a
701         list starts with a comment.
702
703         * tools/output.c (sexp_output_init): Initialize soft_newline.
704         (sexp_put_raw_char): Clear soft_newline.
705         (sexp_put_newline): Check and reset soft_newline.
706         (sexp_put_soft_newline): New function.
707
708         * tools/output.h (struct sexp_output): Removed union with single
709         element, and updated all users. New attribute soft_newline.
710
711 2008-12-22  Niels Möller  <nisse@lysator.liu.se>
712
713         * Makefile.in ($(des_headers)): Create files in $(srcdir).
714
715 2008-11-28  Niels Möller  <nisse@lysator.liu.se>
716
717         * testsuite/cxx-test.cxx: Include <cstdio>.
718
719 2008-11-22  Niels Möller  <nisse@lysator.liu.se>
720
721         * yarrow256.c (yarrow256_fast_reseed): Set ctx->seeded = 1, so
722         that it is set if and only if the aes context has been initialized
723         with aes_set_encrypt_key.
724         (yarrow256_seed): No need to set ctx->seeded here.
725         (yarrow256_update): Likewise.
726
727 2008-11-04  Niels Möller  <nisse@lysator.liu.se>
728
729         * examples/next-prime.c (main): Avoid using gmp_fprintf, to stay
730         compatible with gmp-3.1.
731
732 2008-11-01  Niels Möller  <nisse@lysator.liu.se>
733
734         * nettle.texinfo: Updated for 2.0. New section on linking.
735
736         * nettle-types.h, nettle-meta.h: Moved all typedefs for function
737         types to nettle-types.h. Use non-pointer types, so that the types
738         can be used to declare functions. Updated all users.
739
740 2008-10-31  Niels Möller  <nisse@lysator.liu.se>
741
742         * testsuite/yarrow-test.c (test_main): Updated for seed file
743         changes.
744
745         * sha-example.c (display_hex): Use %02x, not %2x.
746
747 2008-10-30  Niels Möller  <nisse@lysator.liu.se>
748
749         * tools/sexp-conv.c (main): Fixed file locking.
750
751 2008-10-25  Niels Möller  <nisse@lysator.liu.se>
752
753         * configure.ac: Set version to 2.0rc1.
754
755         * examples/Makefile.in (next-prime$(EXEEXT)): Added -lnettle to
756         linker.
757
758 2008-10-24  Niels Möller  <nisse@lysator.liu.se>
759
760         * sha256.c (ROUND): Simplified macro.
761
762         * yarrow256.c (yarrow256_fast_reseed): Renamed (was
763         yarrow_fast_reseed) and made non-static. Don't generate seed file
764         here, let the application use yarrow256_random instead.
765         (yarrow256_slow_reseed): Renamed (was yarrow_slow_reseed) and made
766         non-static.
767         (yarrow256_force_reseed): Deleted function, use
768         yarrow256_slow_reseed instead. For backwards compatibility,
769         yarrow.h defines yarrow256_force_reseed as an alias for that
770         function.
771
772         * yarrow.h (struct yarrow256_ctx): Deleted seed_file buffer.
773
774 2008-09-17  Niels Möller  <nisse@lysator.liu.se>
775
776         * x86/arcfour-crypt.asm: Improved loop logic, and unrolled
777         loop twice. Gave a modest speedup.
778
779 2008-09-15  Niels Möller  <nisse@lysator.liu.se>
780
781         * yarrow256.c (yarrow256_seed): Disallow length == 0.
782
783         * base64-decode.c (decode_table): Added vertical tab (VT) and form
784         feed (FF) as white space characters.
785
786         * x86_64/aes-decrypt-internal.asm: New file.
787
788 2008-09-13  Niels Möller  <nisse@lysator.liu.se>
789
790         * x86/aes-encrypt-internal.asm: Replaced pushl and popl in the
791         loop with movl. Eliminated redundant movl.
792         * x86/aes-decrypt-internal.asm: Likewise.
793
794         * x86_64/aes.m4: New file.
795
796         * x86/aes-encrypt-internal.asm: Updated for AES_FINAL_ROUND. Only
797         three times through the substitution loop.
798         * x86/aes-decrypt-internal.asm: Likewise.
799         * x86_64/aes-encrypt-internal.asm: Likewise.
800
801         * x86/aes.m4 (AES_FINAL_ROUND): Do the substitution on the least
802         significant byte here.
803
804         * x86/aes-encrypt-internal.asm: Updated use of AES_SUBST_BYTE. USe
805         decl for outer loop.
806         * x86/aes-decrypt-internal.asm: Likewise.
807
808         * x86/aes.m4 (LREG, HREG): New macros.
809         (AES_SUBST_BYTE): Take state registers as argument. Use LREG to
810         get the corresponding byte register.
811         (AES_ROUND): Use movzbl together with LREG and HREG.
812         (AES_SUBST_BYTE): Likewise.
813
814 2008-09-10  Niels Möller  <nisse@lysator.liu.se>
815
816         * x86_64/sha1-compress.asm: Avoid using registers %rbx and %rbp,
817         which must be preserved.
818
819 2008-09-08  Niels Möller  <nisse@lysator.liu.se>
820
821         * Makefile.in (stamp-h.in): Use $(AUTOHEADER).
822
823         * x86_64/sha1-compress.asm: New x86_64 assembler, based on the x86
824         version.
825
826         * configure.ac (asm_path): Set up asm_path for x86_64.
827
828         * x86_64/machine.m4: New file, new directory.
829
830 2008-08-28  Niels Möller  <nisse@lysator.liu.se>
831
832         * examples/eratosthenes.c (main): Rewrote block-wise sieving to
833         use less memory. New options -s and -v.
834
835 2008-08-27  Niels Möller  <nisse@lysator.liu.se>
836
837         * testsuite/sexp-conv-test (print_raw, print_nl): Use printf.
838         Updated testcases with comments; comments are now preserved.
839
840         * tools/sexp-conv.c (sexp_convert_item): Keep comments in advanced
841         output.
842         (parse_options): New --lock option.
843         (main): Optionally lock output file.
844
845         * tools/parse.c (sexp_check_token): Removed check for "any" token.
846         All callers specify the token they expect.
847         (sexp_parse): Pass on comment tokens.
848
849         * tools/output.c (sexp_put_data): Made non-static.
850
851         * tools/input.c (sexp_get_comment): New function.
852         (sexp_get_token): Use sexp_get_comment.
853
854         * tools/misc.h (enum sexp_token): Start enumeration with zero, zero
855         is no longer used to mean any type. New type SEXP_COMMENT.
856
857         * configure.ac: Check for fcntl file locking.
858
859 2008-08-26  Niels Möller  <nisse@lysator.liu.se>
860
861         * Makefile.in (tags-here): Put TAGS file in the source directory.
862         * examples/Makefile.in (tags): Likewise.
863         * testsuite/Makefile.in (tags): Likewise.
864         * tools/Makefile.in (tags): Likewise.
865
866 2008-02-29  Niels Möller  <nisse@lysator.liu.se>
867
868         * examples/Makefile.in (SOURCES): Added next-prime.c.
869
870 2008-01-05  Niels Möller  <nisse@lysator.liu.se>
871
872         * examples/Makefile.in (TARGETS): Added eratosthenes and next-prime.
873         (next-prime, eratosthenes): New rules.
874         (nettle-benchmark): Don't rely on $@.
875
876         * examples/eratosthenes.c (find_first_one): Optimized, using
877         slightly larger table.
878         (main): Use atol, rather than atoi.
879
880         * testsuite/symbols-test: Check symbols also in libhogweed.
881
882         * examples/next-prime.c: New file.
883         Deleted code for detailed timing.
884
885         * Makefile.in (hogweed_SOURCES): Added bignum-next-prime.c.
886         (DISTFILES): Added prime-list.h.
887         (hogweed_OBJS): Removed $(LIBOBJS).
888
889         * bignum-next-prime.c (nettle_next_prime): Renamed function, for
890         name space reasons. Was bignum_next_prime. Updated call in
891         rsa-keygen.c.
892         (primes): Use prime-list.h.
893         (nettle_next_prime): Skip Fermat test. Use mpz_millerrabin
894         directly, rather than mpz_probab_prime_p, when the former is
895         available.
896
897         * bignum.h (nettle_next_prime): New prototype.
898
899         * rsa-keygen.c (bignum_next_prime): Deleted, moved to
900         bignum-next-prime.c. Call with a larger prime limit, this improves
901         the running time of lsh-keygen by roughly 25%.
902
903         * prime-list.h: List of odd primes < 2^16.
904
905         * configure.ac: Check for sizeof(long).
906
907 2008-01-03  Niels Möller  <nisse@lysator.liu.se>
908
909         * examples/nettle-benchmark.c (main): Removed incorrect UNUSED
910         from declaration.
911
912         * bignum-next-prime.c: Moved the bignum_next_prime function to a
913         separate file.
914
915 2007-09-08  Niels Möller  <nisse@lysator.liu.se>
916
917         * sparc64/aes-encrypt-internal.asm: The directory with the aes.m4
918         include file was renamed from "sparc" to "sparc32". Updated include.
919         * sparc64/aes-decrypt-internal.asm: Likewise.
920         * sparc32/aes-encrypt-internal.asm: Likewise.
921         * sparc32/aes-decrypt-internal.asm: Likewise.
922
923 2007-09-07  Niels Möller  <nisse@lysator.liu.se>
924
925         * examples/read_rsa_key.c: Include stdlib.h.
926
927 2007-06-02  Niels Möller  <nisse@lysator.liu.se>
928
929         * Makefile.in: Typo fixes to install targets, spotted by Magnus
930         Holmgren.
931
932 2007-05-14  Niels Möller  <niels@s3.kth.se>
933
934         * configure.ac: Fixed copy-and-paste errors in shared library
935         name setup.
936
937         * config.make.in (LIBNETTLE_SONAME, LIBHOGWEED_SONAME): Define.
938
939         * Makefile.in (libnettle.so, libhogweed.so): Fixed rules.
940
941         * Makefile.in: Split nettle library into two files, libnettle.a
942         and libhogweed.a, and similarly for the shared libraries.
943
944         * configure.ac: Bumped nettle so-versions to 3.0. Set hogweed
945         so-versions to 1.0. New makefile conditionals IF_SHARED and
946         IF_HOGWEED. Renamed WITH_PUBLIC_KEY to WITH_HOGWEED. Deleted
947         SHLIBTARGET, SHLIBINSTALL, RSA_EXAMPLES and RSA_TOOLS.
948
949         * config.make.in: Updated for hogweed split.
950
951         * C source files: Don't use WITH_PUBLIC_KEY / WITH_HOGWEED, the
952         Makefile sorts out which files should be compiled.
953
954         * pgp.h: Include bignum.h, don't pretend to work without bignums.
955
956         * pgp-encode.c (pgp_put_mpi, pgp_put_public_rsa_key)
957         (pgp_put_rsa_sha1_signature): Define unconditionally. Removed the
958         checking of HAVE_LIBGMP and WITH_PUBLIC_KEY.
959
960         * examples/io.h: Use WITH_HOGWEED, not WITH_PUBLIC_KEY.
961         * examples/io.c (read_rsa_key): Deleted, moved to...
962         * examples/read_rsa_key.c: New file, extracted from io.c.
963
964         * examples/Makefile.in: Use IF_HOGWEED instead of RSA_EXAMPLES.
965         Link appropriate programs with -lhogweed.
966         (SOURCES): Added read_rsa_key.c.
967
968         * tools/Makefile.in (pkcs1-conv): Use IF_HOGWEED, not @RSA_TOOLS@,
969         for configuration. Link with -lhogweed.
970
971         * testsuite/testutils.h: Use WITH_HOGWEED, not WITH_PUBLIC_KEY.
972         * testsuite/testutils.c: Likewise.
973
974         * testsuite/Makefile.in (TS_NETTLE_SOURCES, TS_HOGWEED_SOURCES):
975         Separate test cases using nettle and those also using hogweed.
976
977 2007-04-05  Niels Möller  <nisse@lysator.liu.se>
978
979         * Moved in CVS tree. Also renamed directory sparc to sparc32.
980
981 2007-02-24  Niels Möller  <nisse@lysator.liu.se>
982
983         * Makefile.in (clean-here): Remove .lib directory.
984         (distclean-here): Remove machine.m4.
985
986 2006-12-05  Niels Möller  <nisse@lysator.liu.se>
987
988         * configure.ac: AC_PREREQ 2.61, for AC_PROG_MKDIR_P.
989
990         * config.make.in (datarootdir): New directory variable (for
991         autoconf-2.61).
992
993 2006-11-28  Niels Möller  <nisse@lysator.liu.se>
994
995         * configure.ac: Bumped version to 1.16.
996
997         * Released nettle-1.15.
998
999 2006-11-27  Niels Möller  <nisse@lysator.liu.se>
1000
1001         * NEWS: New entry for nettle-1.15.
1002
1003         * configure.ac (SHLIBMINOR): Bumped version. Library name is now
1004         libnettle.so.2.6.
1005
1006         * sha256.c: Changed copyright notice to use the LGPL.
1007
1008         * Makefile.in (DISTFILES): Added COPYING.LIB.
1009
1010         * COPYING.LIB: New file (previously only the plain GPL was
1011         included in the distribution).
1012
1013         * nettle.texinfo: Updated vor nettle-1.15.
1014
1015         * testsuite/rsa-test.c (test_main): Use test_rsa_sha256.
1016         * testsuite/testutils.c (test_rsa_sha256): New function.
1017
1018         * testsuite/Makefile.in (DISTFILES): Replaces rfc1750.txt by
1019         gold-bug.txt.
1020
1021         * rsa.h (rsa_sha256_sign, rsa_sha256_verify)
1022         (rsa_sha256_sign_digest, rsa_sha256_verify_digest): New declarations.
1023         (RSA_MINIMUM_N_OCTETS, RSA_MINIMUM_N_BITS): Increased to
1024         62 octets and  489 bits, respectively, for supporting sha256.
1025
1026         * pkcs1.h (pkcs1_rsa_sha256_encode)
1027         (pkcs1_rsa_sha256_encode_digest): New declarations and name
1028         mangling symbols.
1029
1030         * Makefile.in (nettle_SOURCES): Added pkcs1-rsa-sha256.c,
1031         rsa-sha256-sign.c, rsa-sha256-verify.c.
1032
1033         * pkcs1-rsa-sha256.c, rsa-sha256-sign.c, rsa-sha256-verify.c: New
1034         files.
1035
1036         * COPYING, INSTALL, install-sh, texinfo.tex: Updated files, from
1037         automake-1.10.
1038
1039 2006-11-27  Niels Möller  <niels@s3.kth.se>
1040
1041         * tools/Makefile.in (install): Use MKDIR_P to create installation
1042         directory. Install only one file at a time.
1043
1044         * Makefile.in (MKDIR_P): Use MKDIR_P for creating installation
1045         directories.
1046
1047         * configure.ac: Use AC_PROG_MKDIR_P.
1048
1049 2006-11-24  Niels Möller  <nisse@lysator.liu.se>
1050
1051         * testsuite/yarrow-test.c (test_main): Use gold-bug.txt as input
1052         file, instead of rfc1750.txt.
1053
1054         * testsuite/gold-bug.txt: New test input file for yarrow-test.
1055         The copyright on this short story by Edgar Allan Poe has expired.
1056
1057         * testsuite/rfc1750.txt: Deleted file. Debian considers RFC:s
1058         non-free, and it was expired anyway. Replaced by gold-bug.txt.
1059
1060 2006-11-24  Niels Möller  <niels@s3.kth.se>
1061
1062         * Almost all header files: Added C++ guards.
1063
1064         * configure.ac: Test if the system has any C++ compiler.
1065
1066         * config.make.in (CXX, CXXFLAGS, COMPILE_CXX, LINK_CXX): New variables.
1067
1068         * testsuite/Makefile.in: New variables TS_C and TS_CXX. Setup for
1069         compiling the C++ file cxx-test.cxx.
1070
1071         * testsuite/cxx-test.cxx: New testcase, trying to use nettle from
1072         a C++ program.
1073
1074 2006-08-28  Niels Möller  <niels@s3.kth.se>
1075
1076         * index.html: Added section on language bindings.
1077
1078 2006-06-10  Niels Möller  <niels@s3.kth.se>
1079
1080         * configure.ac: Darwin shared library support, from Grant
1081         Robinsson.
1082
1083 2006-05-18  Niels Möller  <nisse@lysator.liu.se>
1084
1085         * src/nettle/x86/aes.asm: Deleted unused file.
1086
1087         * aes-decrypt.c (_aes_decrypt_table): Deleted the indexing array,
1088         previously commented out.
1089         * aes-encrypt-table.c (_aes_encrypt_table): Likewise.
1090
1091         * Makefile.in (.texinfo.info, .dvi.ps): Use more quotes with
1092         basename.
1093         (install-here, install-shared, install-info, install-headers): Use
1094         plain mkdir, not $(INSTALL) -d.
1095
1096 2006-05-16  Niels Möller  <niels@s3.kth.se>
1097         Merged from the lsh experimental branch.
1098
1099 2006-04-26  Niels Möller  <nisse@lysator.liu.se>
1100
1101         * examples/rsa-decrypt.c: Don't include "getopt.h", since it's not used.
1102         * examples/nettle-benchmark.c: Include "getopt.h".
1103
1104         * examples/Makefile.in (GETOPT_OBJS): New variable.
1105         (rsa-keygen, rsa-encrypt, nettle-benchmark): Depend on and link
1106         with $(GETOPT_OBJS).
1107
1108         * x86/aes-decrypt-internal.asm: Use ALIGN.
1109         * x86/aes-encrypt-internal.asm: Likewise.
1110         * x86/arcfour-crypt.asm: Likewise.
1111         * x86/md5-compress.asm: Likewise.
1112         * x86/sha1-compress.asm: Likewise.
1113
1114         * config.m4.in (ASM_ALIGN_LOG): Substitute.
1115         * configure.ac (ASM_ALIGN_LOG): Check if .align directive is
1116         logarithmic.
1117         * asm.m4 (ALIGN): New macro. Takes a logarithmic argument, and
1118         expands to a .align directive.
1119
1120 2006-04-21  Niels Möller  <nisse@lysator.liu.se>
1121
1122         * nettle.texinfo (Public-key algorithms): Say that the public key
1123         operations are undocumented, not unsupported. Reported by Jeronimo
1124         Pellegrini.
1125
1126 2006-04-08  Niels Möller  <nisse@lysator.liu.se>
1127
1128         * tools/pkcs1-conv.c (read_pem): Fixed c99-style declaration.
1129         Reported by Henrik Grubbström.
1130
1131 2006-01-31  Niels Möller  <niels@s3.kth.se>
1132
1133         * examples/rsa-verify.c: Fixed typo in usage message.
1134
1135 2005-12-05  Niels Möller  <nisse@lysator.liu.se>
1136
1137         * configure.ac: Bumped version to 1.15,
1138
1139         * Released nettle-1.14.
1140
1141         * NEWS: Updated for 1.14.
1142
1143         * configure.ac (SHLIBMINOR): Increased minor number. Library
1144         version is now libnettle.so.2.5, soname still libnettle.so.2.
1145
1146 2005-11-28  Niels Möller  <nisse@lysator.liu.se>
1147
1148         * config.make.in (INSTALL): Don't substitute INSTALL, INSTALL_DATA
1149         and friends here, to get a correct a relative filename for
1150         install-sh when used in tools/Makefile.
1151
1152         * tools/Makefile.in (INSTALL): Substitute INSTALL, INSTALL_DATA
1153         and friends here.
1154         * Makefile.in (INSTALL): Likewise.
1155
1156 2005-11-27  Niels Möller  <nisse@lysator.liu.se>
1157
1158         * Makefile.in (.texinfo.pdf): New rule. Avoid dependency on
1159         intermediate .dvi and .ps files.
1160
1161         * testsuite/Makefile.in (clean): Delete sha1-huge-test.
1162
1163         * Makefile.in (install-info, install-headers): Don't use $< and
1164         $?; Solaris make doesn't support them in explicit rules.
1165
1166 2005-11-26  Niels Möller  <nisse@lysator.liu.se>
1167
1168         * testsuite/Makefile.in: Include .test-rules.make, which contains
1169         the rules for all the test executables.
1170         (test-rules): New rule, to update this file.
1171         (DISTFILES): Added $(EXTRA_SOURCES).
1172
1173         * testsuite/.test-rules.make: Automatically generated file for
1174         building the test programs.
1175
1176 2005-11-25  Niels Möller  <nisse@lysator.liu.se>
1177
1178         * configure.ac: Disable assembler when compiling with rntcl.
1179
1180         * tools/Makefile.in (pkcs1_conv_SOURCES): New variable.
1181         (pkcs1-conv): Link with getopt.o and getopt1.o.
1182
1183         * Makefile.in (aesdata, desdata, shadata): Use explicit rules for
1184         executables.
1185
1186         * testsuite/Makefile.in: Use %-rules for building the -test
1187         executables, in addition to the suffix rules. Hopefully, this
1188         should make all of GNU make, BSD make and Solaris make happy.
1189         Use $(EXEEXT) and $(OBJEXT) more consistently.
1190
1191         * examples/Makefile.in: Use explicit rules for all executable
1192         targets. Use $(EXEEXT) and $(OBJEXT) more consistently.
1193
1194 2005-11-25  Niels Möller  <niels@s3.kth.se>
1195
1196         * testsuite/Makefile.in: Avoid using single-suffix rule to build
1197         executables.
1198
1199 2005-11-24  Niels Möller  <niels@s3.kth.se>
1200
1201         * Makefile.in (distdir): Use [ -f, not [ -e, since the latter
1202         is less portable, and not supported by Solaris /bin/sh.
1203
1204 2005-11-23  Niels Möller  <niels@s3.kth.se>
1205
1206         * testsuite/Makefile.in (DISTFILES): Added teardown-env.
1207         * testsuite/teardown-env: New file. Delete files created by the
1208         testsuite.
1209
1210 2005-11-21  Niels Möller  <nisse@lysator.liu.se>
1211
1212         * testsuite/testutils.c (main): Fixed check for -v option. Spotted
1213         by Goran K.
1214
1215 2005-11-21  Niels Möller  <niels@s3.kth.se>
1216
1217         * ctr.h (CTR_CTX, CTR_CRYPT): Fixed bugs, spotted by Goran K.
1218
1219 2005-11-20  Niels Möller  <nisse@lysator.liu.se>
1220
1221         * Makefile.in (nettle_SOURCES): Added der2rsa.c.
1222
1223         * testsuite/Makefile.in (TS_SH): Added pkcs1-conv-test.
1224
1225         * tools/Makefile.in (TARGETS): Added @RSA_TOOLS@.
1226         (SOURCES): Added pkcs1-conv.c.
1227         (pkcs1-conv): New rule.
1228
1229         * tools/pkcs1-conv.c: New program.
1230
1231         * testsuite/pkcs1-conv-test: New file.
1232
1233         * examples/rsa-verify-test: Use rsa-sign to create signature.
1234
1235         * examples/io.c (read_file): Fixed spelling in error message.
1236
1237         * rsa.h (rsa_public_key_from_der_iterator)
1238         (rsa_private_key_from_der_iterator, rsa_keypair_from_der): Declare
1239         functions.
1240
1241         * der2rsa.c: New file.
1242
1243         * der-iterator.c (asn1_der_iterator_init): Initialize length and
1244         data.
1245         (asn1_der_iterator_next): Support for lengths >= 0x80.
1246         (asn1_der_decode_constructed_last, asn1_der_decode_bitstring)
1247         (asn1_der_decode_bitstring_last): New functions.
1248         (asn1_der_get_bignum): Check for non-mininal encodings.
1249
1250         * configure.ac (RSA_TOOLS): New substituted variable. Includes
1251         pkcs1-conv, when public-key support is enabled.
1252
1253         * bignum.h (nettle_asn1_der_get_bignum): Include nettle_-prefix in
1254         declaration.
1255
1256         * asn1.h: Added name mangling defines, and a few new declarations.
1257
1258 2005-11-13  Niels Möller  <nisse@lysator.liu.se>
1259
1260         * Makefile.in (nettle_SOURCES): Added der-iterator.c.
1261         (HEADERS): Added asn1.h.
1262
1263         * bignum.h (asn1_der_get_bignum): Declare function.
1264
1265         * der-iterator.c: New file.
1266         * asn1.h: New file.
1267
1268 2005-11-07  Niels Möller  <nisse@lysator.liu.se>
1269
1270         * examples/nettle-benchmark.c: Check HAVE_UNISTD_H.
1271
1272         * examples/Makefile.in (TARGETS): Use $(EXEEXT).
1273         * tools/Makefile.in (TARGETS, sexp-conv, nettle-lfib-stream): Likewise.
1274
1275         * configure.ac: Use $host_cpu, not $host, when setting up the
1276         assembler path. Use $host_os, not uname, when setting up shared
1277         library flags.
1278
1279         * Makefile.in (des.$(OBJEXT)): Use OBJEXT.
1280
1281         * config.guess, config.sub: In the CVS tree, moved files to the
1282         lsh top-level directory.
1283
1284 2005-10-23  Niels Möller  <nisse@lysator.liu.se>
1285
1286         * sparc64/arcfour-crypt.asm: New file, almost the same as
1287         sparc/arcfour-crypt.asm.
1288
1289         * examples/nettle-benchmark.c (display): Use two decimal places.
1290
1291         * sparc/arcfour-crypt.asm: Reorganized. Main loop unrolled four
1292         times. Uses aligned 32-bit write accesses at DST. Still uses 8-bit
1293         read accesses at SRC; could be improved int he case that SRC and
1294         DST have compatible alignment.
1295
1296 2005-10-19  Niels Möller  <niels@s3.kth.se>
1297
1298         * testsuite/arcfour-test.c (test_main): New testcase with 512
1299         bytes of data.
1300
1301 2005-10-19  Niels Möller  <nisse@lysator.liu.se>
1302
1303         * sparc/arcfour-crypt.asm: Fixed bug, spotted by Mikael Kalms. We
1304         must order the store at [CTX+I] before the load of [CTX+SI+SJ].
1305
1306 2005-10-18  Niels Möller  <nisse@lysator.liu.se>
1307
1308         * sparc/arcfour-crypt.asm: Special unrolled code if SRC and DST
1309         have compatible alignment. Improves performance by 20%, but I'm
1310         not sure it's worth the extra complexity.
1311
1312         * bignum.c (nettle_mpz_from_octets): Removed sign argument. If
1313         mpz_import is available, define nettle_mpz_from_octets as a macro
1314         calling mpz_import.
1315         (nettle_mpz_from_octets): Start by setting x to zero; callers no
1316         longer need to do that.
1317         (nettle_mpz_set_str_256_s): New logic for the handling of negative
1318         numbers. Convert in the same way as for positive numbers, and then
1319         subtract the appropriate power of two.
1320
1321 2005-10-17  Niels Möller  <nisse@lysator.liu.se>
1322
1323         * bignum.c (nettle_mpz_from_octets): Improved loop. Removed the
1324         digit temporary (suggested by Torbjörn Granlund).
1325
1326         * sparc/arcfour-crypt.asm: Improved instruction scheduling.
1327
1328         * sparc/arcfour-crypt.asm: Bugfix, use lduh and stuh.
1329
1330         * sparc/arcfour-crypt.asm: New file.
1331
1332         * sparc64/aes.asm: Deleted unused file.
1333
1334         * x86/arcfour-crypt.asm: Use ARCFOUR_I and ARCFOUR_J
1335         * asm.m4 (ARCFOUR): New struct.
1336
1337 2005-10-17  Niels Möller  <niels@s3.kth.se>
1338
1339         * aes-internal.h (struct aes_table): Deleted idx and sparc_idx
1340         arrays.
1341         * aes-encrypt-table.c (_aes_encrypt_table): Likewise.
1342         * aes-decrypt.c (_aes_decrypt_table): Likewise.
1343         * asm.m4 (AES): Likewise
1344
1345 2005-10-16  Niels Möller  <nisse@lysator.liu.se>
1346
1347         * tools/input.c (sexp_get_char): Use unsigned for the done flag.
1348
1349         * sparc64/aes-encrypt-internal.asm: Include sparc/aes.m4.
1350         * sparc64/aes-decrypt-internal.asm: Likewise.
1351
1352         * sparc64/machine.m4: Use .register pseudo op to say that we use
1353         %g2 and %g3 as scratch registers.
1354
1355         * sparc/aes-encrypt-internal.asm: Explicitly include sparc/aes.m4.
1356         * sparc/aes-decrypt-internal.asm: Likewise.
1357
1358         * sparc/aes.m4: New file. Moved aes-related macros here...
1359         * sparc/machine.m4: ... removed aes macros.
1360
1361         * x86/aes-encrypt-internal.asm: Explicitly include x86/aes.m4.
1362         * x86/aes-decrypt-internal.asm: Likewise.
1363
1364         * x86/aes.m4: New file. Moved aes-related macros here, from...
1365         * x86/machine.m4: ... removed aes macros.
1366
1367         * sparc64/aes-encrypt-internal.asm: New file.
1368         * sparc64/aes-decrypt-internal.asm: New file.
1369
1370         * sparc64/machine.m4: Include the same aes macros used for
1371         sparc32.
1372         (BIAS): Define magic stack bias constant.
1373
1374         * sparc/aes-encrypt-internal.asm, sparc/aes-decrypt-internal.asm:
1375         Reduced frame size to 104 bytes, since we no longer need wtxt and
1376         tmp on the stack.
1377
1378         * sparc/aes.asm: Deleted old aes implementation.
1379
1380         * sparc/aes-decrypt-internal.asm: New file.
1381
1382         * sparc/machine.m4: Don't use m4 eval, instead rely on the
1383         assembler's arithmetic.
1384
1385         * sparc/machine.m4 (AES_FINAL_ROUND): Better scheduling, by
1386         interleaving independent operations.
1387
1388         * sparc/machine.m4 (TMP3): A third temporary register.
1389         (AES_FINAL_ROUND): Prepared for scheduling.
1390
1391         * sparc/machine.m4 (AES_ROUND): Deleted unused argument T. Updated
1392         all calls in aes-encrypt-internal.asm.
1393
1394         * sparc/machine.m4 (AES_ROUND): New loop invariants T0-T3, to
1395         avoid the additions of the AES_TABLEx constants in the inner loop.
1396
1397         * sparc/machine.m4 (AES_ROUND): Better scheduling, by
1398         interleaving independent operations.
1399
1400         * sparc/machine.m4 (AES_ROUND): Alternate between using TMP1 and
1401         TMP2, to prepare for scheduling.
1402
1403         * sparc/aes-encrypt-internal.asm: Renamed Ti -> Xi.
1404
1405         * sparc/aes-encrypt-internal.asm: Fixed bugs. Now passes the
1406         testsuite.
1407
1408         * sparc/machine.m4 (AES_ROUND, AES_FINAL_ROUND): Bugfixes. Put
1409         NOPs in the load dely slots.
1410
1411         * sparc/aes-encrypt-internal.asm: Implemented. Not yet working,
1412         and not optimized.
1413
1414         * sparc/machine.m4: Use TMP1 and TMP2, so we don't need to pass
1415         them as arguments.
1416         (AES_FINAL_ROUND): New macro.
1417
1418 2005-10-15  Niels Möller  <nisse@lysator.liu.se>
1419
1420         * configure.ac (OBJDUMP): Substitute the program false if objdump
1421         is not found.
1422
1423         * asm.m4 (PROLOGUE): Use TYPE_FUNCTION.
1424
1425         * config.m4.in: Substitute ASM_TYPE_FUNCTION as TYPE_FUNCTION.
1426
1427         * configure.ac (ASM_ELF_STYLE): Check for %function and #function,
1428         but not for @function.
1429         (ASM_TYPE_FUNCTION): New substituted variable.
1430
1431         * configure.ac (ASM_ELF_STYLE): Fixed .type foo,@function statement
1432         used when checking for pseudo operations.
1433
1434         * sparc/machine.m4 (AES_LOAD, AES_ROUND): Started writing new AES
1435         macros.
1436
1437         * sparc/aes-encrypt-internal.asm: New file.
1438
1439 2005-10-14  Niels Möller  <nisse@lysator.liu.se>
1440
1441         * x86/aes-decrypt.asm, x86/aes-encrypt.asm: Deleted files.
1442
1443         * x86/aes-decrypt-internal.asm: New file.
1444
1445         * x86/machine.m4: Changed AES macros, to handle a table register.
1446         Also take more of the used registers as argument.
1447
1448         * x86/aes-encrypt-internal.asm: Rewritten to match new interface,
1449         with the table pointer as an argument. Unlike the old code, this
1450         should really be position independent.
1451
1452         * configure.ac: When looking for assembler files, link in
1453         aes-encrypt-internal.asm and aes-decrypt-internal.asm. Don't look
1454         for aes.asm, aes-encrypt.asm and aes-decrypt.asm.
1455
1456         * configure.ac (OBJDUMP): Use AC_CHECK_TOOL to check for objdump.
1457         (ASM_MARK_NOEXEC_STACK): Use $OBJDUMP when examining the object file.
1458
1459         * Makefile.in (nettle_SOURCES): Removed aes.c,
1460         aes-decrypt-table.c. Added aes-decrypt-internal.c and aes-encrypt-internal.c.
1461
1462         * aes.c, aes-decrypt-table.c: Deleted files.
1463
1464         * aes-decrypt.c (_aes_decrypt_table): Moved table here, and made
1465         static.
1466
1467         * aes-internal.h (_aes_decrypt_table): Don't declare, it's no
1468         longer globally visible.
1469
1470         * aes-decrypt-internal.c (_nettle_aes_decrypt): New AES decryption
1471         function, analogous to _nettle_aes_encrypt.
1472
1473 2005-10-14  Niels Möller  <niels@s3.kth.se>
1474
1475         * aes-internal.h (AES_ROUND, AES_FINAL_ROUND): New macros.
1476
1477         * aes-encrypt-internal.c (_nettle_aes_encrypt): New AES encryption
1478         function, avoiding the table-based indexing.
1479
1480         * sha1-compress.c: Added debugging code.
1481         * md5-compress.c: Likewise.
1482
1483 2005-10-13  Niels Möller  <niels@s3.kth.se>
1484
1485         * config.m4.in (ASM_MARK_NOEXEC_STACK): Use a diversion, to
1486         substitute the value of ASM_MARK_NOEXEC_STACK at the end of each
1487         assembler file.
1488
1489         * configure.ac (ASM_MARK_NOEXEC_STACK): Check if the C compiler
1490         generates a .note.GNU-stack section. If so, we should do the same
1491         in our assembler files.
1492
1493         * sparc64/aes.asm: New file. Copy of sparc/aes.asm, with minor
1494         changes to the stack frame layout. Patch contributed by Henrik
1495         Grubbström. Not yet tested.
1496
1497         * x86/md5-compress.asm: Skip copying of input to the stack, and
1498         don't allocate space for it.
1499         (F1): Fixed bug.
1500
1501         * testsuite/md5-test.c: Document intermediate values for first
1502         test case.
1503
1504         * configure.ac (asm_path): Check for sparc64, and use sparc64
1505         subdirectory. Link in md5-compress.asm, if it exists.
1506
1507 2005-10-13  Niels Möller  <nisse@lysator.liu.se>
1508
1509         * x86/md5-compress.asm (REF): Fixed calculation of offset.
1510
1511 2005-10-12  Niels Möller  <nisse@lysator.liu.se>
1512
1513         * x86/machine.m4 (OFFSET): Moved macro, used to be in...
1514         * x86/sha1-compress.asm (OFFSET): ... removed macro.
1515
1516         * x86/md5-compress.asm: New file, with first attempt at md5
1517         assembler. Not yet working.
1518
1519 2005-10-11  Niels Möller  <nisse@lysator.liu.se>
1520
1521         * Makefile.in (nettle_SOURCES): Added md5-compress.c.
1522
1523         * md5.c: Reorganized to use _nettle_md5_compress, in analogy with
1524         sha1.c.
1525
1526         * md5-compress.c (_nettle_md5_compress): New file and new function.
1527
1528 2005-10-10  Niels Möller  <niels@s3.kth.se>
1529
1530         * testsuite/Makefile.in (EXTRA_SOURCES, EXTRA_TARGETS): New
1531         variables, for test cases that are not run by default.
1532
1533         * testsuite/sha1-huge-test.c (test_main): New test case, with a
1534         very large sha1 input.
1535
1536         * testsuite/testutils.c (test_hash_large): New function.
1537
1538         * sha1.c (sha1_block): Deleted function; inlined where used.
1539         (SHA1_INCR): New macro for incrementing the block count.
1540
1541 2005-10-06  Niels Möller  <nisse@lysator.liu.se>
1542
1543         * configure.ac: Bumped version to 1.14.
1544
1545         * Released nettle-1.13.
1546
1547         * configure.ac: Check for openssl/aes.h.
1548
1549         * Makefile.in (distdir): Use a loop to pick up the contents of
1550         $(DISTFILES) from source and build directories. For some reason,
1551         $? failed to find stamp-h.in in the source directory.
1552
1553 2005-10-05  Niels Möller  <nisse@lysator.liu.se>
1554
1555         * x86/aes-decrypt.asm: Use C_NAME(_nettle_aes_decrypt_table) when
1556         using the AES_SUBST_BYTE macro. Use PROLOGUE and EPILOGUE.
1557         * x86/sha1-compress.asm: Use PROLOGUE and EPILOGUE.
1558         * x86/arcfour-crypt.asm: Likewise.
1559         * x86/aes-encrypt.asm: Likewise.
1560
1561         * config.m4.in (ELF_STYLE): Substitute configure's ASM_ELF_STYLE.
1562
1563         * asm.m4 (PROLOGUE, EPILOGUE): New macros, checking the value of
1564         ELF_STYLE. So far, used and tested only for the x86 assembler
1565         files, and needed to make the assembler happy both with ELF
1566         (linux, solaris) and COFF (windows).
1567
1568         * configure.ac (NM): Use AC_CHECK_TOOL to check for nm.
1569         (ASM_SYMBOL_PREFIX): Use $NM when examining the object file.
1570         (ASM_ELF_STYLE): New variable. Set to 'yes' if assembling a file
1571         with ELF-style .type and .size pseudo ops works.
1572
1573         * Makefile.in (TARGETS, DISTFILES): Added nettle.pdf.
1574         (.texinfo.dvi, .dvi.ps, .ps.pdf): New targets, to build nettle.pdf.
1575         (DOCTARGETS): New variable with targets that shouldn't be deleted
1576         by make clean.
1577         (maintainer-clean-here): New target. Deletes generated
1578         documentation files.
1579
1580         * nettle.texinfo: Define AUTHOR with accents, when running in TeX
1581         mode, which doesn't handle latin-1 properly. Set UPDATED-FOR to
1582         1.13. Updated copyright years, and introduced a COPYRIGHT-YEARS
1583         symbol. Updated copyright section, to mention assembler
1584         implementations.
1585         (Cipher modes): Transformed the Cipher Block Chaining to a section
1586         Cipher modes, describing both CBC and the new CTR mode.
1587
1588         * src/nettle/x86/aes_tables.asm: Deleted unused file.
1589
1590         * x86/aes.asm: Deleted contents. This file is needed just to
1591         override aes.c, which isn't needed for the x86 implementation.
1592
1593         * configure.ac (SHLIBMINOR): Increased minor number. Library
1594         version is now libnettle.so.2.4, soname still libnettle.so.2.
1595
1596         * examples/nettle-benchmark.c (main): Reordered hash benchmarks.
1597
1598         * x86/sha1-compress.asm (EXPAND): Use % 16 instead of & 15 to
1599         compute offsets mod 16, since m4 on FreeBSD 49.RELEASE and NetBSD
1600         doesn't implement & correctly in eval.
1601
1602 2005-10-03  Niels Möller  <nisse@lysator.liu.se>
1603
1604         * x86/sha1-compress.asm (OFFSET): New macro.
1605         (F3): Eliminated a movl.
1606         (ROUND): New argument, for k. When using F3, it's TMP3, on the
1607         stack, otherwise, it is kept in TMP2, a register.
1608
1609 2005-10-03  Niels Möller  <niels@s3.kth.se>
1610
1611         * examples/nettle-openssl.c: Use correct block sizes for openssl
1612         ciphers.
1613
1614         * examples/nettle-benchmark.c: Also display cycles per block.
1615
1616 2005-10-02  Niels Möller  <nisse@lysator.liu.se>
1617
1618         * sha1-compress.c (_nettle_sha1_compress): Updated to new
1619         interface. Now responsible for byte conversion.
1620
1621         * x86/sha1-compress.asm (_nettle_sha1_compress): Do byte order
1622         conversion, and store the input data on the stack. This leaves one
1623         more register free for other uses.
1624
1625         * examples/nettle-benchmark.c: Now display cycles/byte, if the -f
1626         option is used to say what the clock frequency is.
1627
1628         * sha1.c (sha1_block): Don't convert data from uint8_t to
1629         uint32_t, that's now the responsibility of _nettle_sha1_compress.
1630
1631         * sha.h (_nettle_sha1_compress): Changed interface. Second
1632         argument is now a pointer to the input data in unaligned,
1633         big-endian form.
1634
1635 2005-09-28  Niels Möller  <niels@s3.kth.se>
1636
1637         * sha1.c (sha1_final): Call sha1_block, don't call the compression
1638         function _nettle_sha1_compress directly.
1639
1640         * nettle-internal.h (nettle_openssl_md5)
1641         (nettle_openssl_sha1): Declare.
1642
1643         * examples/nettle-benchmark.c (main): Benchmark openssl md5 and
1644         sha1.
1645
1646         * examples/nettle-openssl.c (nettle_openssl_md5)
1647         (nettle_openssl_sha1): Added glue for openssl hash functions.
1648
1649         * nettle-internal.h (nettle_openssl_aes128, nettle_openssl_aes192)
1650         (nettle_openssl_aes256, nettle_openssl_arcfour128): Declare.
1651
1652         * examples/nettle-benchmark.c: Check WITH_OPENSSL, not
1653         HAVE_LIBCRYPTO. Benchmark openssl's aes and arcfour code.
1654
1655         * examples/nettle-openssl.c: Updated openssl des glue to use the
1656         new openssl des interface. Added glue for arcfour and aes.
1657
1658 2005-09-27  Niels Möller  <nisse@lysator.liu.se>
1659
1660         * nettle.texinfo (RSA): Improved text about the RSA patent.
1661         Use @documentencoding ISO-8859-1.
1662
1663 2005-09-07  Niels Möller  <niels@s3.kth.se>
1664
1665         * tools/sexp-conv.c (parse_options): New option --raw-hash, for
1666         compatibility with lsh-1.x. Equivalent to --hash.
1667
1668 2005-09-06  Niels Möller  <niels@s3.kth.se>
1669
1670         * tools/sexp-conv.c (main): With --hash, output a newline after
1671         each hash.
1672
1673 2005-07-02  Niels Möller  <nisse@lysator.liu.se>
1674
1675         * testsuite/Makefile.in (TS_SOURCES): Added ctr-test.c.
1676
1677         * testsuite/testutils.c (test_cipher_ctr): New function.
1678
1679         * testsuite/ctr-test.c: New file.
1680
1681         * testsuite/cbc-test.c (test_main): Use static const for msg.
1682
1683         * Makefile.in (nettle_SOURCES): Added ctr.c.
1684         (HEADERS): Added ctr.h.
1685         (HEADERS): Added nettle-types.h.
1686         (INSTALL_HEADERS): Install nettle-stdint.h.
1687         (distclean-here): Delete nettle-stdint.h, not nettle-types.h.
1688
1689         * ctr.c (ctr_crypt): New file, new function.
1690
1691         * memxor.c (memxor3): New function, suggested by Adam Langley.
1692
1693         * nettle-internal.h (NETTLE_MAX_CIPHER_BLOCK_SIZE): New constant.
1694
1695         * nettle.texinfo (Cipher functions): Fixed typo in prototype for
1696         arctwo_encrypt (noticed by Adam Langley).
1697
1698         * nettle-meta.h: No longer needs to include cbc.h.
1699
1700         * cbc.h (nettle_crypt_func): Moved typedef to nettle-types.h.
1701         (CBC_ENCRYPT, CBC_DECRYPT): Deleted older #if:ed out versions.
1702
1703         * configure.ac (AX_CREATE_STDINT_H): Use the file name
1704         nettle-stdint.h, not nettle-types.h.
1705
1706         * nettle-types.h: New file. Automatically generated declarations
1707         are now in nettle-stdint.h.
1708
1709 2005-03-17  Niels Möller  <niels@s3.kth.se>
1710
1711         * config.guess: Support Solaris on x86_64. Fix by Henrik
1712         Grubbström.
1713
1714 2005-01-03  Niels Möller  <niels@s3.kth.se>
1715
1716         * examples/io.h: Include RSA declarations only when public key
1717         algorithms are enabled. Problem reported by Meilof Veeningen
1718         <meilof@gmail.com>.
1719
1720 2004-12-07  Niels Möller  <nisse@lysator.liu.se>
1721
1722         * Makefile.in: Install directories, using $(INSTALL) -d, only if
1723         they don't exist already.
1724
1725 2004-12-05  Niels Möller  <nisse@lysator.liu.se>
1726
1727         * config.make.in (.PRECIOUS): Reverted earlier change. We need
1728         .PRECIOUS to stop GNU make from deleting object files for the test
1729         programs.
1730
1731 2004-12-02  Niels Möller  <nisse@lysator.liu.se>
1732
1733         * Makefile.in (.SUFFIXES): Moved from Makefile.in to...
1734         * config.make.in (.SUFFIXES): ... here. This helps compilation
1735         with BSD make.
1736         * testsuite/Makefile.in (.SUFFIXES): Deleted target.
1737
1738         * config.make.in (.c): Disable default rule for BSD-make.
1739
1740         * Makefile.in (all check install uninstall)
1741         (clean distclean mostlyclean maintainer-clean): Don't use the -C
1742         flag when invoking make, for compatibility with Solaris make.
1743
1744 2004-12-02  Niels Möller  <niels@s3.kth.se>
1745
1746         * Makefile.in (aesdata, desdata): Commented out the explicit
1747         targets.
1748         (shadata): Avoid using $< in non-pattern rule.
1749
1750 2004-12-01  Niels Möller  <nisse@lysator.liu.se>
1751
1752         * config.make.in: Added a default target.
1753
1754 2004-11-29  Niels Möller  <nisse@lysator.liu.se>
1755
1756         * testsuite/Makefile.in: Use .$(OBJEXT). Explicitly set .SUFFIXES.
1757
1758         * Makefile.in: Use .$(OBJEXT).
1759
1760 2004-11-28  Niels Möller  <nisse@lysator.liu.se>
1761
1762         * tools/Makefile.in (nettle-lfib-stream): Avoid using $< in
1763         non-suffix rule.
1764
1765         * Makefile.in (distdir): Handle absolute $distdir.
1766         Avoid using the GNU extension $^.
1767
1768         * examples/Makefile.in: Avoid using the GNU extension $^.
1769         * tools/Makefile.in: Likewise.
1770         * testsuite/Makefile.in: Likewise.
1771
1772 2004-11-24  Niels Möller  <niels@s3.kth.se>
1773
1774         * configure.ac: Fixed typo, preventing the creation of dependency
1775         files.
1776
1777 2004-11-23  Niels Möller  <nisse@lysator.liu.se>
1778
1779         * Makefile.in: Use DEP_INCLUDE.
1780         * tools/Makefile.in: Likewise.
1781         * testsuite/Makefile.in: Likewise.
1782         * examples/Makefile.in: Likewise.
1783
1784         * configure.ac (dummy-dep-files): Generate only of dependency
1785         tracking is enabled.
1786
1787 2004-11-18  Niels Möller  <nisse@lysator.liu.se>
1788
1789         * Makefile.in (clean-here): The clean target should not delete the
1790         dependency files. Moved to the distclean target.
1791         * examples/Makefile.in: Likewise.
1792         * testsuite/Makefile.in: Likewise.
1793         * tools/Makefile.in: Likewise.
1794
1795         * configure.ac (ASM_SYMBOL_PREFIX): Fixed test.
1796         (dummy-dep-files): Added quotes to sed command.
1797
1798 2004-11-17  Niels Möller  <nisse@lysator.liu.se>
1799
1800         * testsuite/symbols-test: Try plain nm if nm -g doesn't work.
1801
1802         * x86/sha1-compress.asm: Use C_NAME for global symbols.
1803         * x86/aes-encrypt.asm: Likewise.
1804         * x86/aes-decrypt.asm: Likewise.
1805         * x86/arcfour-crypt.asm: Likewise.
1806
1807         * Makefile.in (config.m4): New rule.
1808
1809         * config.m4.in (C_NAME): New macro.
1810
1811         * configure.ac (ASM_SYMBOL_PREFIX): Check if global symbols have a
1812         leading underscore.
1813
1814 2004-11-16  Niels Möller  <nisse@lysator.liu.se>
1815
1816         * Deleted getopt.c, getopt.h and getopt1.c from the CVS tree. Link
1817         them from shared copies in lsh/misc instead.
1818
1819 2004-11-14  Niels Möller  <nisse@lysator.liu.se>
1820
1821         * Makefile.in (DEP_FILES): Try include with only one macro
1822         argument to be expanted.
1823
1824         * configure.ac (dummy-dep-files): Create dummy dependency files,
1825         so that they can be included by the makefiles.
1826
1827 2004-11-13  Niels Möller  <nisse@lysator.liu.se>
1828
1829         * Makefile.in: Don't use -include, as it's GNU make specific.
1830         * examples/Makefile.in, tools/Makefile.in, testsuite/Makefile.in:
1831         Likewise.
1832
1833         * examples/nettle-openssl.c: Check WITH_OPENSSL, not HAVE_LIBCRYPTO.
1834
1835         * configure.ac: Check for individual openssl headers blowfish.h,
1836         cast.h, des.h. Renamed symbol HAVE_LIBCRYPTO to WITH_OPENSSL. New
1837         configure option --disable-openssl.
1838
1839 2004-11-04  Niels Möller  <nisse@lysator.liu.se>
1840
1841         * configure.ac: Bumped version to 1.13.
1842
1843         * Released nettle-1.12.
1844
1845 2004-11-04  Niels Möller  <niels@s3.kth.se>
1846
1847         * nettle.texinfo (UPDATED-FOR): Bumped to 1.12.
1848
1849 2004-11-02  Niels Möller  <nisse@lysator.liu.se>
1850
1851         * nettle.texinfo (Cipher functions): Updated AES documentation,
1852         for aes_set_encrypt_key and aes_set_decrypt_key.
1853         (UPDATED-FOR): Set to 1.11. I think the manual should be updated
1854         with all user-visible changes.
1855
1856         * aclocal.m4 (LSH_DEPENDENCY_TRACKING): Need extra quoting in case
1857         pattern. (This file really lives in the lsh tree, as
1858         lsh/acinclude.m4. For a complete ChangeLog, see lsh/Changelog).
1859
1860 2004-10-26  Niels Möller  <nisse@lysator.liu.se>
1861
1862         * configure.ac: Bumped version to 1.12.
1863
1864         * Released nettle-1.11.
1865
1866         * Makefile.in (clean-here): Delete *.s files.
1867         (PRE_CPPFLAGS): Use this variable, not INCLUDES. Removed
1868         -I$(srcdir).
1869
1870         * x86/arcfour-crypt.asm: Use movzbl when extending %cl to 32 bits.
1871
1872 2004-10-24  Niels Möller  <nisse@lysator.liu.se>
1873
1874         * x86/arcfour-crypt.asm: Reverted the latest two changes; update
1875         bost src and dst pointers in the loop, and use plain addb when
1876         updating j. These two previous changes slowed the code down on AMD
1877         Duron.
1878
1879 2004-10-21  Niels Möller  <nisse@lysator.liu.se>
1880
1881         * Makefile.in (install-shared): Use $(INSTALL_PROGRAM).
1882
1883         * configure.ac (SHLIBMINOR): Updated, shared library version is
1884         now libnettle.so.2.3, soname still libnettle.so.2.
1885
1886         * Makefile.in (DISTFILES): Added asm.m4.
1887
1888 2004-10-21  Niels Möller  <niels@s3.kth.se>
1889
1890         * examples/Makefile.in: Deleted all configure-related rules,
1891         except the one rebuilding this Makefile. One should run make at
1892         top level if other configure related files change.
1893         * tools/Makefile.in: Likewise.
1894         * testsuite/Makefile.in: Likewise.
1895
1896         * configure.ac: Replaced AC_OUTPUT(list...) with an AC_OUTPUT
1897         without arguments, and AC_CONFIG_FILES listing the files.
1898
1899         * Makefile.in: Changed the assembler rules as suffix rules.
1900         Rewrote the configure-related rules, mostly based on the example
1901         in the autoconf manual.
1902
1903 2004-10-20  Niels Möller  <nisse@lysator.liu.se>
1904
1905         * examples/nettle-openssl.c (NCOMPAT): Disable openssl backwards
1906         compatibility.
1907
1908         * config.make.in: Insert $(PRE_CPPFLAGS) and $(PRE_LDFLAGS) before
1909         $(CPPFLAGS) and $(LDFLAGS). This mechanism replaces $(INCLUDES).
1910
1911         * examples/Makefile.in (PRE_CPPFLAGS, PRE_LDFLAGS): Use these
1912         flags to get -I.. and -L.. early on the command line.
1913         * testsuite/Makefile.in: Likewise
1914         * tools/Makefile.in: Likewise.
1915
1916 2004-10-20  Niels Möller  <niels@s3.kth.se>
1917
1918         * Makefile.in: In the assembler rules, there's no need to look in
1919         $(srcdir) for the input file.
1920
1921         * x86/arcfour-crypt.asm: Reduced inner loop by one instruction, by
1922         precomputing the offset between src and dst.
1923
1924         * tools/Makefile.in (.c.$(OBJEXT)): Removed redundant -I.. flag.
1925
1926         * x86/arcfour-crypt.asm (nettle_arcfour_crypt): Replaced addb ->
1927         addl + andl $0xff, improving speed on PPro by another 15%.
1928
1929 2004-10-20  Niels Möller  <nisse@lysator.liu.se>
1930
1931         * tools/Makefile.in (install): Support DESTDIR.
1932         (uninstall): New target.
1933
1934         * testsuite/Makefile.in (uninstall): New dummy target.
1935
1936         * config.sub: Copied from automake-1.8.5.
1937
1938         * examples/Makefile.in (SOURCES): Added rsa-sign.c and rsa-verify.c.
1939         (DISTFILES): Added getopt.h.
1940         (install uninstall): New dummy targets.
1941
1942         * config.make.in (.PHONY): Added more targets.
1943
1944         * Makefile.in (.texinfo.info, .texinfo.html): New targets. Added
1945         support for uninstall and DESTDIR. Various fixes to install and
1946         distcheck.
1947
1948         * examples/Makefile.in (INCLUDES): Added -I flags.
1949         (distdir): Use $^ to refer to the files.
1950         (distclean): New target.
1951         * testsuite/Makefile.in: Likewise.
1952         * tools/Makefile.in: Likewise.
1953
1954         * Makefile.in (INCLUDES): Need -I flags for VPATH build.
1955         (clean distclean mostlyclean maintainer-clean): Clean
1956         subdirectories first.
1957         (DISTFILES): Added a bunch of files.
1958         (des_headers): Added desCore rules.
1959         (install-here): Split off target install-headers, which uses $^ to
1960         refer to the files.
1961         (distdir): Use $^ to refer to the files.
1962         distcheck): Fixes.
1963
1964         * config.make.in (COMPILE): Add $(INCLUDE) to the line.
1965
1966 2004-10-19  Niels Möller  <nisse@lysator.liu.se>
1967
1968         Stop using automake. Replaced each Makefile.am with a hand-written
1969         Makefile.in.
1970         * configure.ac: New output variable CCPIC_MAYBE. New output file
1971         config.make. Replaced automake constructions.
1972         * .bootstrap: Don't run aclocal and automake.
1973         * config.make.in: New file, with shared Makefile variables and rules.
1974
1975 2004-10-18  Niels Möller  <nisse@lysator.liu.se>
1976
1977         * x86/arcfour-crypt.asm (nettle_arcfour_crypt): Replace incb ->
1978         incl + andl, to improve speed on PPro and PII. Suggested by
1979         Fredrik Olsson.
1980
1981 2004-10-08  Niels Möller  <niels@s3.kth.se>
1982
1983         * examples/rsa-encrypt-test: Avoid reading and executing a file at
1984         the same time.
1985         * examples/setup-env: Likewise.
1986
1987 2004-10-06  Niels Möller  <niels@s3.kth.se>
1988
1989         * testsuite/symbols-test: Ignore __i686.get_pc_thunk.bx and
1990         similar symbols.
1991
1992 2004-10-05  Niels Möller  <nisse@lysator.liu.se>
1993
1994         * twofish.c (q_table): Use a const pointer array.
1995
1996         * sexp2dsa.c (dsa_keypair_from_sexp_alist): Use a const pointer
1997         array for the keywords.
1998         (dsa_signature_from_sexp): Likewise.
1999         * sexp2rsa.c (rsa_keypair_from_sexp_alist): Likewise.
2000         (rsa_keypair_from_sexp): Likewise.
2001
2002         * sexp.c (sexp_iterator_check_types): Use an argument of type
2003         "const uint8_t * const *" for the types list.
2004         (sexp_iterator_assoc): Likewise, for the keys list.
2005
2006         * list-obj-sizes.awk: Fixes to handle multiple .data and .rodata
2007         sections. Also fixed to handle the last file correctly.
2008
2009 2004-09-23  Niels Möller  <nisse@lysator.liu.se>
2010
2011         * configure.ac (SHLIBLINK, SHLIBLIBS): On cygwin, linking needs
2012         -Wl,--whole-archive $(OBJECTS) -Wl,--no-whole-archive $(LIBS).
2013
2014 2004-09-22  Niels Möller  <niels@s3.kth.se>
2015
2016         * configure.ac: Setup SHLIBFORLINK and friends for cygwin.
2017
2018         * list-obj-sizes.awk: Strip *_a-prefix from all file names.
2019
2020         * Makefile.am (libnettle_a_SOURCES): List only .c files. Headers
2021         moved to noinst_HEADERS.
2022         (SHLIBOBJECTS): Substitute from libnettle_a_SOURCES, not
2023         am_libnettle_a_OBJECTS, since the latter includes
2024         libnettle_a-prefixes with some automake versions.
2025         (SHLIBSONAME): Check if this name is empty, which is the case on
2026         cygwin, before using it.
2027
2028 2004-08-31  Niels Möller  <nisse@lysator.liu.se>
2029
2030         * configure.ac: New command line option --disable-pic. Use
2031         LSH_CCPIC.
2032
2033         * Makefile.am (libnettle_a_CFLAGS): Added $(CCPIC), to attempt to
2034         build also the static library as position independent code.
2035
2036 2004-08-24  Niels Möller  <nisse@lysator.liu.se>
2037
2038         * des-compat.c (des_cbc_cksum): Pad input with NUL's, if it's not
2039         an integral number of blocks.
2040
2041 2004-08-24  Niels Möller  <niels@s3.kth.se>
2042
2043         * testsuite/arctwo-test.c, arctwo.h, arctwo.c
2044         (arctwo_set_key_ekb): Fixed typo; it should be "ekb", not "ebk".
2045
2046         Integrated arctwo patch from Simon Josefsson.
2047         * testsuite/Makefile.am (noinst_PROGRAMS): Added arctwo-test.
2048
2049         * Makefile.am (libnettleinclude_HEADERS): Added arctwo.h.
2050         (libnettle_a_SOURCES): Added arctwo.c, arctwo.h and arctwo-meta.c.
2051
2052         * nettle-meta.h (nettle_arctwo40, nettle_arctwo64)
2053         (nettle_arctwo64, nettle_arctwo_gutmann128): Declare ciphers.
2054
2055         * arctwo-meta.c, arctwo.c, arctwo.h, testsuite/arctwo-test.c: New
2056         files.
2057
2058         * macros.h (LE_READ_UINT16, LE_WRITE_UINT16): New macros.
2059
2060 2004-08-23  Niels Möller  <nisse@lysator.liu.se>
2061
2062         * testsuite/md5-test.c (test_main): Added collision, found in 2004.
2063         (test_main): Added second collision.
2064
2065 2004-08-23  Niels Möller  <niels@s3.kth.se>
2066
2067         * testsuite/md5-test.c (test_main): Added first half of a
2068         collision test case.
2069
2070         * des-compat.c (des_cbc_cksum): Changed input argument to be of
2071         type const uint8_t * (was const des_cblock *).
2072
2073         * des-compat.h (const_des_cblock): New bogus type. Disabled use of
2074         const, for compatibility with openssl.
2075
2076 2004-06-08  Niels Möller  <niels@s3.kth.se>
2077
2078         * aesdata.c: Renamed log and ilog to gf2_log and gf2_exp.
2079
2080 2004-04-07  Niels Möller  <nisse@lysator.liu.se>
2081
2082         * aes-set-encrypt-key.c (log, ilog): Deleted unused tables.
2083
2084         * aes-set-decrypt-key.c (gf2_log, gf2_exp, mult): Renamed tables,
2085         were log and ilog.
2086
2087 2004-03-20  Niels Möller  <nisse@lysator.liu.se>
2088
2089         * configure.ac: Use AC_CONFIG_AUX_DIR([.]).
2090
2091 2004-03-18  Niels Möller  <niels@s3.kth.se>
2092
2093         * examples/io.c (read_file): Display a message if fopen fails.
2094
2095 2004-03-05  Niels Möller  <nisse@lysator.liu.se>
2096
2097         * Released nettle-1.10.
2098
2099         * configure.ac (SHLIBMINOR): Shared library version is now 2.2.
2100
2101 2004-03-04  Niels Möller  <nisse@lysator.liu.se>
2102
2103         * testsuite/symbols-test: Pass -g flag to nm.
2104
2105 2004-03-02  Niels Möller  <nisse@lysator.liu.se>
2106
2107         * configure.ac: Fixed EXEEXT workaround.
2108
2109 2004-03-02  Niels Möller  <niels@s3.kth.se>
2110
2111         * configure.ac: Added workaround to get the correct $(EXEEXT)=''
2112         when compiling with rntcl.
2113
2114 2004-03-02  Niels Möller  <nisse@lysator.liu.se>
2115
2116         * testsuite/Makefile.am (noinst_PROGRAMS): Put test program list
2117         here, to let automake add $(EXEEXT).
2118
2119         * configure.ac (RSA_EXAMPLES): Append $(EXEEXT) to the filenames.
2120
2121 2004-03-01  Niels Möller  <nisse@lysator.liu.se>
2122
2123         * examples/rsa-keygen.c, examples/rsa-encrypt.c,
2124         examples/rsa-decrypt.c: Include "getopt.h" instead of <unistd.h>.
2125
2126         * examples/Makefile.am (rsa_encrypt_SOURCES, rsa_decrypt_SOURCES)
2127         (rsa_keygen_SOURCES): Added getopt.h, getopt.c and getopt1.c.
2128
2129         * examples/getopt.h, examples/getopt.c, examples/getopt1.c: New
2130         files.
2131
2132         * testsuite/des-compat-test.c: Don't include <unistd.h>.
2133
2134         * testsuite/testutils.c (main): Don't use getopt. Then we don't
2135         need to include <unistd.h>.
2136
2137 2004-03-01  Niels Möller  <niels@s3.kth.se>
2138
2139         * config.guess: Copied from automake-1.8.2. Hacked to recognize
2140         Windows_NT (and Windows_95 and Windows_98) running on "x86" and
2141         "686".
2142
2143         * install-sh: Removed from CVS repository. Let automake supply it.
2144
2145 2004-02-26  Niels Möller  <nisse@lysator.liu.se>
2146
2147         * nettle-meta.h (nettle_crypt_func): Typedef moved to cbc.h.
2148         Include cbc.h instead.
2149
2150         * des-compat.c: Reverted const change, now all the des_key_sched
2151         arguments are not const. This is also what openssl's interface
2152         looks like.
2153         (cbc_crypt_func): Deleted typedef, use nettle_crypt_func instead.
2154
2155         * cbc.h (nettle_crypt_func): Moved typedef here.
2156         * cbc.c (cbc_encrypt, cbc_decrypt_internal, cbc_decrypt): Use it
2157         for typing the f argument. Reverted the const change, for
2158         compatibility with nettle_crypt_func.
2159
2160 2004-02-25  Niels Möller  <nisse@lysator.liu.se>
2161
2162         * testsuite/des-compat-test.c: Use des_cblock for typing more of
2163         the variables. Use const. Got rid of most of the explicit casts.
2164         Disabled the input/output alignment tests.
2165
2166         * des.c (des_encrypt, des_decrypt): Use a const context pointer.
2167         * des3.c (des3_encrypt, des3_decrypt): Likewise.
2168
2169         * cbc.c (cbc_encrypt, cbc_decrypt): Use a _const_ void *ctx argument.
2170
2171         * des-compat.c: Use const for all unchanged arguments.
2172         (des_key_sched): Use a copy of the key if we need to fix the
2173         parity.
2174
2175         * testsuite/des-compat-test.c (C_Block, Key_schedule): Deleted
2176         defines. Deleted some of the explicit casts.
2177
2178         * des-compat.c (des_cbc_cksum): Dereference DST pointer.
2179
2180 2004-02-25  Niels Möller  <niels@s3.kth.se>
2181
2182         * pgp.h: Include nettle-types.h.
2183
2184 2004-02-24  Niels Möller  <nisse@lysator.liu.se>
2185
2186         * testsuite/symbols-test: Allow symbols starting with double
2187         underscores, like on darwin.
2188
2189 2004-02-17  Niels Möller  <niels@s3.kth.se>
2190
2191         * Makefile.am: Protected %-rules used for building pure objects,
2192         and for assembler files, by automake conditionals. Needed for
2193         makes such as tru64's, which tries to understand %-patterns, but
2194         doesn't get it right.
2195         (SUFFIXES): Added .html.
2196         (.texinfo.html): Rewrote rule to use a traditional suffix target.
2197
2198         * configure.ac (enable_assembler): Explicitly set
2199         enable_assembler=no, on architectures where we have no assembler
2200         files.
2201         (ENABLE_ASSEMBLER, ENABLE_SHARED): New automake conditionals.
2202
2203         * testsuite/testutils.c (xalloc): xalloc(0) should work also on
2204         systems where malloc(0) returns NULL.
2205
2206 2004-02-16  Niels Möller  <niels@s3.kth.se>
2207
2208         * Makefile.am (%.o: %.asm): Added comment about OSF1 make problem.
2209
2210 2004-02-15  Niels Möller  <nisse@lysator.liu.se>
2211
2212         * testsuite/testutils.h: #include nettle-types.h instead of
2213         inttypes.h.
2214
2215 2004-02-12  Niels Möller  <nisse@lysator.liu.se>
2216
2217         * examples/rsa-encrypt-test: Use -r option when invoking
2218         rsa-encrypt. Needed for the test to work on systems with no
2219         /dev/urandom.
2220
2221 2004-02-12  Niels Möller  <niels@s3.kth.se>
2222
2223         * configure.ac (CPPFLAGS, LDFLAGS): No spaces after -I and -L, as
2224         some C compilers, in particular True64 cc, don't like that.
2225
2226 2004-02-08  Niels Möller  <nisse@lysator.liu.se>
2227
2228         * configure.ac: Bumped version number to 1.10.
2229
2230 2004-02-07  Niels Möller  <nisse@lysator.liu.se>
2231
2232         * Released nettle-1.9.
2233
2234         * configure.ac (SHLIBMINOR): Bumped, library version is now 2.1.
2235
2236         * testsuite/sexp-format-test.c: Include bignum.h only if HAVE_LIBGMP.
2237         * testsuite/rsa-encrypt-test.c: Include rsa.h only if WITH_PUBLIC_KEY.
2238         * testsuite/pkcs1-test.c: Include pkcs1.h only if WITH_PUBLIC_KEY.
2239
2240         * pgp-encode.c [!HAVE_LIBGMP]: Kludge around the pgp.h's
2241         dependency on gmp.h.
2242         (pgp_put_mpi): Condition on HAVE_LIBGMP.
2243
2244         * pgp.h: Don't include bignum.h, to make it possible to compile
2245         the non-bignum parts of pgp-encode.c without bignum support. Needs
2246         to be fixed properly before the pgp interface is advertised.
2247
2248         * tools/sexp-conv.c (xalloc): New function.
2249         (main): Use xalloc.
2250
2251         * tools/output.c (sexp_put_digest): Use TMP_DECL instead of alloca.
2252
2253         * testsuite/testutils.c (xalloc): New function. Made all other
2254         functions use xalloc instead of alloca.
2255
2256         * examples/rsa-keygen.c (main): Use xalloc for allocation.
2257         * examples/rsa-encrypt.c (write_bignum): Likewise.
2258         * examples/rsa-decrypt.c (read_bignum): Likewise.
2259         * testsuite/yarrow-test.c (open_file): Likewise.
2260         * testsuite/rsa-encrypt-test.c (test_main): Likewise.
2261         * testsuite/bignum-test.c (test_bignum): Likewise.
2262
2263         * examples/nettle-openssl.c: When calling des_key_sched and
2264         des_ecb_encrypt, cst arguments to (void *). Openssl's typedefs
2265         des_cblock and const_des_cblock are too broken.
2266
2267         * examples/nettle-benchmark.c (xalloc): New function. Use instead
2268         of alloca, for better portability.
2269
2270         * examples/io.c (xalloc): New function.
2271
2272         * Makefile.am (nodist_libnettleinclude_HEADERS): nettle-types.h
2273         should not be distributed.
2274
2275 2004-02-06  Niels Möller  <niels@s3.kth.se>
2276
2277         * x86/sha1-compress.asm: Rename round -> ROUND.
2278
2279         * x86/sha1-compress.asm: Store the magic constants on stack.
2280         Accessing them via %esp should be a little faster than using large
2281         immediate operands.
2282
2283         * Makefile.am (EXTRA_DIST, DISTCLEANFILES): Handle
2284         sha1-compress.asm.
2285
2286         * configure.ac: Use assembler file sha1-compress.asm if available.
2287
2288         * x86/sha1-compress.asm (EXPAND): Fixed the rotation part of the
2289         data expansion.
2290
2291 2004-02-06  Niels Möller  <nisse@lysator.liu.se>
2292
2293         * x86/sha1-compress.asm: Assembler implementation of
2294         sha1_compress. (Not yet working).
2295
2296         * Makefile.am (libnettle_a_SOURCES): Added sha1-compress.c.
2297
2298         * sha1.c (sha1_transform): Function renamed to sha1_compress, and
2299         moved to...
2300         * sha1-compress.c: ... New file.
2301
2302 2004-02-05  Niels Möller  <nisse@lysator.liu.se>
2303
2304         * examples/rsa-encrypt.c (process_file): Copy the leftover to the
2305         start of the buffer, when preparing for the final processing.
2306
2307         * examples/nettle-benchmark.c (bench_hash, time_hash): New functions.
2308         (main): Benchmark hash functions too.
2309         (BENCH_BLOCK): Increased 10K.
2310         (BENCH_INTERVAL): Decreased to 0.25s.
2311
2312         * examples/nettle-benchmark.c (time_function): Loop around calling
2313         f, until 1s has elapsed. Returns seconds per call. Updated bench
2314         functions to not loop themselves.
2315         (display): Updated MB/s calculation.
2316
2317         * testsuite/arcfour-test.c (test_main): Use test_cipher_stream.
2318
2319         * testsuite/testutils.c (test_cipher_stream): New function, that
2320         tries dividing the input into varying size blocks before
2321         processing.
2322
2323         * x86/arcfour-crypt.asm (nettle_arcfour_crypt): Bug fix, half of
2324         the S array swap was forgotten.
2325         * arcfour.c (arcfour_stream): Likewise.
2326         * arcfour-crypt.c (arcfour_crypt): Likewise.
2327
2328 2004-02-05  Niels Möller  <niels@s3.kth.se>
2329
2330         * x86/arcfour-crypt.asm (nettle_arcfour_crypt): Must store the new
2331         i, j at the end of the loop.
2332
2333         * Makefile.am (EXTRA_DIST): Make sure x86 assembler files are
2334         distributed.
2335         (DISTCLEANFILES): And that the symlinks and .s files are deleted.
2336
2337         * x86/aes-encrypt.asm, x86/aes-decrypt.asm, x86/arcfour-crypt.asm:
2338         Fixed debug information.
2339
2340         * x86/arcfour-crypt.asm: New file. About three times faster than
2341         the optimized C code.
2342
2343         * configure.ac: Use assembler file arcfour-crypt.asm if available.
2344
2345         * arcfour.c (arcfour_crypt): Moved function too...
2346         * arcfour-crypt.c (arcfour_crypt): New file.
2347
2348         * arcfour.c (arcfour_crypt): Optimization suggested by Jonas
2349         Walldén. Makes arcfour up to 50% faster on x86 and ppc, and
2350         probably on other architectures as well.
2351
2352 2004-01-31  Niels Möller  <nisse@lysator.liu.se>
2353
2354         * configure.ac (AX_CREATE_STDINT_H): Also look for uint32_t and
2355         friends in sys/types.h.
2356
2357 2004-01-11  Niels Möller  <nisse@harpo.hack.org>
2358
2359         * Makefile.am (libnettleinclude_HEADERS): Added bignum.h,
2360         memxor.h, pkcs1.h and rsa-compat.h.
2361
2362         * configure.ac: Bumped version to 1.9.
2363
2364 2004-01-10  Niels Möller  <nisse@harpo.hack.org>
2365
2366         * Released nettle-1.8.
2367
2368         * examples/teardown-env: Delete more test files.
2369
2370         * nettle.texinfo (Hash functions): Documented md2 and md4.
2371
2372         * configure.ac (SHLIBMAJOR): Bumped to 2.
2373
2374 2004-01-09  Niels Möller  <nisse@harpo.hack.org>
2375
2376         * examples/rsa-encrypt-test: New testcase.
2377
2378         * examples/rsa-encrypt.c, examples/rsa-session.h: Expanded the
2379         comment describing the file format, and moved to rsa-session.h.
2380
2381         * examples/rsa-decrypt.c (process_file): Finished this function.
2382         (main): Initialize x. Check the size of the session key after rsa
2383         decryption.
2384
2385         * examples/io.c (write_string): Treat short item count as an error.
2386
2387 2004-01-08  Niels Möller  <niels@s3.kth.se>
2388
2389         * index.html: Added instructions for CVS access.
2390
2391         * dsa-keygen.c (dsa_nist_gen): Fixed declaration/statement order.
2392
2393         * rsa-keygen.c (bignum_next_prime): Fixed off-by-one error when
2394         comparing input to the largest listed prime. General cleanup, as
2395         prime_limit > 0 always. Use TMP_DECL and TMP_ALLOC.
2396
2397         * nettle-internal.h (TMP_DECL, TMP_ALLOC): New macros. When alloca
2398         is unavailable, they work by allocating a fix amount of stack and
2399         imposing a hard limit on what can be allocated. Updated all users
2400         of alloca.
2401
2402 2004-01-07  Niels Möller  <nisse@harpo.hack.org>
2403
2404         * nettle-types.h: New (generated) file, to be used instead of
2405         including <inttypes.h> directly. Updated all users of inttypes.h.
2406
2407         * Makefile.am (DISTCLEANFILES, libnettleinclude_HEADERS): Added
2408         nettle-types.h.
2409
2410         * configure.ac (AX_CREATE_STDINT_H): Create nettle-types.h.
2411
2412 2003-11-16  Niels Möller  <nisse@harpo.hack.org>
2413
2414         * yarrow256.c (yarrow256_seed): Use const for the seed_file input.
2415
2416 2003-11-12  Niels Möller  <niels@s3.kth.se>
2417
2418         * list-obj-sizes.awk: New function for decoding hex values, with a
2419         new function hex2int. Also implemented calculation of total
2420         storage, removed the dependence on the .comment section, and use
2421         the $FILTER environment variable as a regexp for restricting the
2422         object files that are considered.
2423
2424 2003-09-21  Niels Möller  <nisse@cuckoo.hack.org>
2425
2426         * testsuite/rsa-encrypt-test.c (test_main): Don't use gmp_printf,
2427         as it seems it's only available with the newer gmp. Use
2428         mpz_out_str instead.
2429
2430 2003-09-19  Niels Möller  <niels@s3.kth.se>
2431
2432         * examples/Makefile.am (EXTRA_DIST): Added rsa-session.h.
2433
2434         * tools/nettle-lfib-stream.c: New tool, which outputs a sequence
2435         of pseudorandom (non-cryptographic) bytes, using Knuth's lagged
2436         fibonacci generator.
2437
2438         * examples/rsa-decrypt.c: Fixes to get the file to compile. It
2439         won't work yet.
2440
2441         * examples/Makefile.am (EXTRA_PROGRAMS): Added rsa-encrypt and
2442         rsa-decrypt.
2443
2444         * examples/io.c (write_file): New function.
2445         (write_string): Simplified error check, it's no real point in
2446         calling ferror unless we also call fflush.
2447
2448         * examples/rsa-keygen.c (main): Check return value from
2449         simple_random.
2450
2451         * examples/rsa-decrypt.c, examples/rsa-encrypt.c,
2452         examples/rsa-session.h: New files, demonstrating rsa encryption
2453         and decryption.
2454
2455         * configure.ac (RSA_EXAMPLES): Added rsa-encrypt and rsa-decrypt.
2456
2457 2003-09-01  Niels Möller  <nisse@cuckoo.hack.org>
2458
2459         * testsuite/testutils.c (print_hex): Use const.
2460
2461 2003-08-30  Niels Möller  <niels@s3.kth.se>
2462
2463         * md2.c, md2.h: Added reference to RFC 1319.
2464         * md4.c, md4.h: Added reference to RFC 1320
2465
2466 2003-08-26  Niels Möller  <niels@s3.kth.se>
2467
2468         * Makefile.am: Added md2 and md5 files. Deleted the print-path
2469         hack.
2470
2471         * configure.ac: Bumped version to 1.8.
2472
2473         * testsuite/testutils.c (test_rsa_set_key_1): New function.
2474         * testsuite/rsa-test.c (test_main): Use it.
2475
2476         * testsuite/dsa-keygen-test.c: Deleted definition of UNUSED, it's
2477         now in config.h.
2478         * testsuite/rsa-keygen-test.c: Likewise.
2479
2480         * testsuite/Makefile.am (TS_PROGS): Added rsa-encrypt-test,
2481         md4-test, and md2-test.
2482
2483         * testsuite/rsa-encrypt-test.c, testsuite/md4-test.c,
2484         testsuite/md2-test.c: New test cases.
2485
2486         * nettle-meta.h: Declare nettle_md2 and nettle_md4.
2487
2488         * md5.c: Reorderd functions, putting md5_final at the end.
2489
2490         * md2.c, md2.h, md2-meta.c: New files, implemented md2.
2491         * md4.c, md4.h, md4-meta.c: New files, implemented md4.
2492
2493 2003-08-17  Niels Möller  <nisse@cuckoo.hack.org>
2494
2495         * desCode.h (des_keymap, des_bigmap): Deleted extern declarations,
2496         they conficted with the static definition in des.c. Reported by
2497         Simon Josefsson.
2498
2499         * des.c (DesSmallFipsEncrypt, DesSmallFipsDecrypt): Moved
2500         definitions after the definition of the des_kemap array.
2501
2502 2003-08-11  Niels Möller  <nisse@cuckoo.hack.org>
2503
2504         * rsa-encrypt.c (rsa_encrypt): Bugfix contributed by
2505         leg@terra.com.br.
2506
2507 2003-06-10  Niels Möller  <niels@s3.kth.se>
2508
2509         * Makefile.am (EXTRA_DIST): Distribute sha-example.c.
2510
2511 2003-06-05  Niels Möller  <nisse@lysator.liu.se>
2512
2513         * Makefile.am (DISTCLEANFILES): Delete .s files.
2514
2515 2003-05-27  Niels Möller  <nisse@cuckoo.hack.org>
2516
2517         * testsuite/symbols-test: And allow symbols that start at the
2518         beginning of the line, as output by AIX nm.
2519
2520 2003-05-26  Niels Möller  <nisse@cuckoo.hack.org>
2521
2522         * testsuite/symbols-test: Allow symbols to start with a dot.
2523
2524 2003-05-14  Niels Möller  <niels@s3.kth.se>
2525
2526         * pgp.h (enum pgp_subpacket_tag): Copied values from RFC 2440.
2527         Renamed PGP_SUBPACKET_ISSUER to PGP_SUBPACKET_ISSUER_KEY_ID.
2528
2529 2003-05-13  Niels Möller  <nisse@cuckoo.hack.org>
2530
2531         * pgp.h: Do proper namemangling for pgp_put_public_rsa_key and
2532         pgp_put_rsa_sha1_signature.
2533
2534         * pgp-encode.c (pgp_put_mpi): Fixed nettle_mpz_get_str_256 call.
2535
2536 2003-05-12  Niels Möller  <nisse@cuckoo.hack.org>
2537
2538         * rsa2openpgp.c (rsa_keypair_to_openpgp): Some bugfixes.
2539
2540         * pgp.h (enum pgp_subpacket_tag): New enum. Definition is bogus
2541         and needs to be fixed.
2542         Added forward declarations of structs, and prototypes for
2543         pgp_put_public_rsa_key and pgp_put_rsa_sha1_signature.
2544
2545         * pgp-encode.c (pgp_put_mpi): Take a const mpz_t argument. Gugfix,
2546         use nettle_mpz_get_str_256.
2547         (pgp_put_public_rsa_key, pgp_put_rsa_sha1_signature):
2548         Constification. Some bugfixes.
2549
2550         * Use "config.h", not <config.h>.
2551
2552         * Reordered includes in most or all .c-files. All should now
2553         include config.h.
2554
2555 2003-05-12  Niels Möller  <niels@s3.kth.se>
2556
2557         * configure.ac: Use LSH_FUNC_ALLOCA.
2558
2559 2003-04-25  Niels Möller  <niels@s3.kth.se>
2560
2561         * Makefile.am (libnettle_a_SOURCES): Added hmac-sha256.c.
2562
2563         * testsuite/hmac-test.c (test_main): Added tests for hmac-sha256,
2564         from draft-ietf-ipsec-ciph-sha-256-01.txt.
2565
2566         * hmac-sha256.c (hmac_sha256_digest): New file.
2567
2568 2003-04-22  Niels Möller  <nisse@cuckoo.hack.org>
2569
2570         * sha-example.c (display_hex): Simplified by using printf better.
2571
2572         * nettle.texinfo (Example): Use @verbatiminclude to include the
2573         example program.
2574
2575         * sha-example.c: Example program, for inclusion in the manual.
2576         Fixed bugs reported by Mark Arking.
2577
2578 2003-04-14  Niels Möller  <niels@s3.kth.se>
2579
2580         * x86/aes-encrypt.asm (nettle_aes_encrypt): Fixed references to
2581         _nettle_aes_encrypt_table.
2582         * x86/aes-decrypt.asm (nettle_aes_decrypt): Fixed references to
2583         _nettle_aes_decrypt_table.
2584
2585 2003-04-12  Niels Möller  <nisse@cuckoo.hack.org>
2586
2587         * testsuite/Makefile.am (TS_SH): New test case symbols-test.
2588         (EXTRA_PROGRAMS): Added testutils, as a kludge to
2589         get automake to track dependencies for testutils.o.
2590
2591         * x86/aes-encrypt.asm (nettle_aes_encrypt): Renamed function to
2592         use the nettle_ prefix.
2593         * x86/aes-decrypt.asm (nettle_aes_decrypt): Likewise.
2594         * sparc/aes.asm (_nettle_aes_crypt): Likewise.
2595
2596         * examples/Makefile.am (EXTRA_PROGRAMS): Add "io", as a kludge to
2597         get automake to track dependencies for io.o.
2598         (LDADD): Added ../libnettle.a, for the dependency.
2599
2600         * des-compat.c: Use names with the nettle_ prefix when using
2601         Nettle's des functions.
2602
2603         * base16-meta.c (base16_encode_update): Need to undef before
2604         redefining.
2605
2606         * New name mangling, to reduce the risk of link collisions. All
2607         functions (except memxor) now use a nettle_ or _nettle prefix when
2608         seen by the linker. For most functions, the header file that
2609         declares a function also use #define to provide a shorter more
2610         readable name without the prefix.
2611
2612 2003-03-11  Niels Möller  <nisse@cuckoo.hack.org>
2613
2614         * Released nettle-1.7.
2615
2616         * configure.ac: Bumped version to 1.7.
2617
2618         * nettle.texinfo (DSA): New section.
2619         (RSA): Updated documentation.
2620
2621 2003-03-02  Niels Möller  <nisse@cuckoo.hack.org>
2622
2623         * examples/nettle-benchmark.c (time_cipher): Don't use GNU C
2624         non-constant initializers.
2625
2626 2003-02-23  Niels Moller  <nisse@carduelis>
2627
2628         * configure.ac: Use LSH_GCC_ATTRIBUTES.
2629
2630 2003-02-19  Niels Möller  <nisse@cuckoo.hack.org>
2631
2632         * acinclude.m4: Deleted file from cvs, use a link to lsh's
2633         acinclude.m4 instead.
2634
2635 2003-02-16  Niels Möller  <nisse@cuckoo.hack.org>
2636
2637         * Makefile.am (libnettleinclude_HEADERS): Added macros.h.
2638
2639         * tools/Makefile.am (EXTRA_DIST): Added getopt.h.
2640
2641 2003-02-14  Niels Möller  <niels@s3.kth.se>
2642
2643         * Makefile.am (print_path): Added target to print the used PATH,
2644         for debugging.
2645         (print-path): Moved dependency to all-local.
2646
2647 2003-02-11  Niels Möller  <niels@s3.kth.se>
2648
2649         * buffer.c (nettle_buffer_copy): Bug fix, it didn't return any
2650         value.
2651
2652 2003-02-11  Niels Möller  <nisse@cuckoo.hack.org>
2653
2654         * testsuite/sexp-format-test.c (test_main): Added test for %( and
2655         %).
2656
2657         * sexp-format.c (sexp_vformat): Handle %( and %).
2658
2659         * realloc.c (nettle_xrealloc): Fixed out-of-memory check.
2660
2661         * configure.ac (SHLIBMAJOR): Bumped version number to 1.
2662
2663         * buffer.c (nettle_buffer_init_realloc): New function.
2664         * buffer-init.c (nettle_buffer_init): Use nettle_buffer_init_realloc.
2665
2666 2003-02-10  Niels Möller  <nisse@cuckoo.hack.org>
2667
2668         * testsuite/sexp-format-test.c (test_main): New test with tokens
2669         in the format string.
2670         (test_main): Test space-searated literals too.
2671
2672         * rsa2sexp.c (rsa_keypair_to_sexp): New argument ALGORITHM_NAME.
2673         * examples/rsa-keygen.c (main): Updated call to rsa_keypair_to_sexp.
2674         * testsuite/rsa2sexp-test.c (test_main): Likewise.
2675
2676         * sexp-format.c (sexp_vformat): Allow whitespace in format string.
2677
2678         * rsa2sexp.c (rsa_keypair_to_sexp): Use literals with sexp_format.
2679
2680         * sexp-format.c (format_string): New function.
2681         (sexp_vformat): Implemented support for literals in the format
2682         string.
2683
2684 2003-02-06  Niels Möller  <nisse@lysator.liu.se>
2685
2686         * testsuite/sexp-conv-test (print_raw, print_nl): New functions.
2687         The testfunctions use these instead of using echo directly.
2688         Use the test input '3:"\x' instead of '2:"\', to be friendlier to
2689         sysv echo.
2690
2691 2003-02-05  Niels Möller  <nisse@lysator.liu.se>
2692
2693         * des-compat.h (des_set_key): Different name mangling, if this
2694         file is included, des_set_key should refer to a function that
2695         behaves like openssl's.
2696
2697         * des-compat.c (des_key_sched, des_is_weak_key): Use the name
2698         nettle_des_set_key for referring to Nettle's function.
2699
2700         * des.h (des_set_key): Name mangling, linker symbols should use a
2701         "nettle_" prefix, and this one collided with openssl. Perhaps all
2702         symbols should be mangled in a similar way, but that's for later.
2703
2704         * configure.ac (LDFLAGS): --with-lib-path should add to LDFLAGS,
2705         not replace it.
2706
2707 2003-01-30  Niels Möller  <nisse@cuckoo.hack.org>
2708
2709         * tools/output.c (sexp_put_string): Fixed handling of escapable
2710         characters. The code generated random escape sequences for
2711         characters in the 0x10-0x1f range.
2712
2713         * testsuite/sexp-conv-test: More tests for hex and base64 input
2714         and output.
2715
2716 2003-01-30  Niels Möller  <niels@s3.kth.se>
2717
2718         * sexp2bignum.c (nettle_mpz_set_sexp): Call sexp_iterator_next on
2719         success. That means the iterator argument can't be const.
2720
2721 2003-01-29  Niels Möller  <niels@s3.kth.se>
2722
2723         * tools/Makefile.am (LDADD): Add libnettle.a, for the dependency.
2724
2725 2003-01-27  Niels Möller  <nisse@cuckoo.hack.org>
2726
2727         * sexp2dsa.c (dsa_signature_from_sexp): New function.
2728
2729         RSA renaming. Updated all callers.
2730         * rsa-sign.c (rsa_private_key_init, rsa_private_key_clear)
2731         (rsa_private_key_prepare): Renamed functions.
2732         * rsa.c (rsa_public_key_init, rsa_public_key_clear)
2733         (rsa_public_key_prepare): Renamed functions.
2734
2735 2003-01-23  Niels Möller  <nisse@cuckoo.hack.org>
2736
2737         * Makefile.am (libnettle_a_SOURCES): Added new rsa and pkcs1
2738         files. Removed old rsa_md5.c and rsa_sha1.c.
2739
2740         * testsuite/Makefile.am (TS_PROGS): Added pkcs1-test.
2741
2742         * dsa-verify.c (dsa_verify_digest): New function.
2743         (dsa_verify): Most of the code moved to dsa_verify_digest, which
2744         is used here.
2745         * dsa-sign.c (dsa_sign_digest): New function.
2746         (dsa_sign): Most of the code moved to dsa_sign_digest, which is
2747         used here.
2748         * dsa.c (_dsa_hash): Deleted function.
2749
2750         * rsa_md5.c, rsa_sha1.c: Deleted files, contents spread over
2751         several files for signing and verification.
2752         * rsa-sign.c, rsa-sha1-verify.c, rsa-sha1-sign.c,
2753         rsa-md5-verify.c, rsa-md5-sign.c:  New files.
2754
2755         * rsa-sha1-verify.c (rsa_sha1_verify_digest): New function.
2756         * rsa-sha1-sign.c (rsa_sha1_sign_digest):  New function.
2757         * rsa-md5-verify.c (rsa_md5_verify_digest):  New function.
2758         * rsa-md5-sign.c (rsa_md5_sign_digest):  New function.
2759         * rsa-verify.c (_rsa_verify): New file, new function.
2760
2761         * rsa.c (_rsa_check_size): Renamed from rsa_check_size, and made
2762         non-static. Private key functions moved to rsa-sign.c.
2763
2764         * pkcs1.c, pkcs1.h, pkcs1-rsa-md5.c, pkcs1-rsa-sha1.c: New files.
2765         (pkcs1_signature_prefix): New function.
2766
2767         * testsuite/pkcs1-test.c: New test.
2768
2769 2003-01-22  Niels Möller  <niels@s3.kth.se>
2770
2771         * examples/Makefile.am (nettle_benchmark_LDADD): Use
2772         OPENSSL_LIBFLAGS.
2773
2774         * configure.ac (OPENSSL_LIBFLAGS): If libcrypto is found, add
2775         -lcrypto to OPENSSL_LIBFLAGS, not the plain LDFLAGS.
2776
2777 2003-01-20  Niels Möller  <nisse@cuckoo.hack.org>
2778
2779         * testsuite/Makefile.am (CLEANFILES): Delete test.in, test1.out
2780         and test2.out.
2781
2782 2003-01-17  Niels Möller  <niels@s3.kth.se>
2783
2784         * examples/Makefile.am (AM_CPPFLAGS): Use AM_CPPFLAGS instead of
2785         AM_CFLAGS.
2786         * testsuite/Makefile.am (AM_CPPFLAGS): Likewise.
2787
2788 2003-01-16  Niels Möller  <niels@s3.kth.se>
2789
2790         * testsuite/Makefile.am (check): Can't use quotes around
2791         $(srcdir).
2792
2793 2003-01-14  Niels Möller  <nisse@lysator.liu.se>
2794
2795         * testsuite/Makefile.am (check): Don't use "run-tests" as a
2796         target, as it's confused with the file with the same name.
2797
2798         * .bootstrap: Added missing #! /bin/sh.
2799
2800 2003-01-12  Niels Möller  <nisse@cuckoo.hack.org>
2801
2802         * buffer.c (nettle_buffer_reset): New function.
2803         (nettle_buffer_copy): New function.
2804
2805         * tools/input.c, tools/input.h, tools/output.c, tools/output.h,
2806         tools/parse.c, tools/parse.h, tools/misc.c, tools/misc.h: Moved
2807         parts ov sexp-conv.c to separate files
2808
2809         * tools/sexp-conv.c (sexp_convert_list): Inlined into
2810         sexp_convert_item.
2811
2812         * tools/sexp-conv.c (struct sexp_input): Deleted string attribute.
2813         Changed all related functions to take a struct nettle_buffer *
2814         argument instead.
2815         (struct sexp_compound_token): New struct.
2816         (sexp_compound_token_init, sexp_compound_token_clear): New
2817         functions.
2818         (struct sexp_parser): Added a struct sexp_compound_token
2819         attribute, as a temporary measure.
2820         (sexp_parse): Take a struct sexp_compound_token * as argument.
2821         Updated all callers. Simplified handling of display types and
2822         transport encoding.
2823
2824         * tools/sexp-conv.c (struct sexp_parser): Renamed struct (was
2825         struct sexp_parse_state). Added input pointer. Updated users to
2826         not pass around both parser and input.
2827         (sexp_check_token): handle token == 0.
2828         (sexp_parse): Simplified a little by calling sexp_check_token
2829         unconditionally.
2830
2831         * tools/sexp-conv.c (sexp_convert_string): Deleted function.
2832         (sexp_skip_token): Likewise.
2833
2834         * tools/sexp-conv.c (enum sexp_token): New constant SEXP_DISPLAY.
2835         Start constants from 1, to keep 0 free for special uses.
2836         (struct sexp_parse_state): New struct for keeping track of parser
2837         state.
2838         (sexp_parse_init): New function.
2839         (sexp_check_token): New function, replacing sexp_skip_token.
2840         (sexp_parse): New function.
2841         (sexp_convert_item): Simplified by using sexp_parse.
2842         (sexp_convert_list): Use sexp_parse.
2843         (main): Likewise.
2844
2845 2003-01-08  Niels Möller  <niels@s3.kth.se>
2846
2847         * tools/sexp-conv.c (parse_options): Initialize prefer_hex.
2848
2849 2003-01-07  Niels Möller  <nisse@cuckoo.hack.org>
2850
2851         * Makefile.am (des_headers): Refer to the desdata binary using
2852         $(EXEEXT).
2853
2854 2003-01-01  Niels Möller  <nisse@cuckoo.hack.org>
2855
2856         * testsuite/sexp-conv-test: New tests for hex and base64 literal
2857         output.
2858
2859         * tools/sexp-conv.c (sexp_put_string): Print binary strings using
2860         either hex or base 64 (in advanced mode).
2861         (parse_options): Implemented -s hex, for output using hex rather
2862         than base64.
2863
2864 2002-12-30  Niels Möller  <nisse@cuckoo.hack.org>
2865
2866         * testsuite/rsa2sexp-test.c: Don't include rsa.h (done by
2867         testutils.h, if enabled).
2868         * testsuite/sexp2rsa-test.c: Likewise.
2869
2870         * rsa-decrypt.c: Make compilation conditional on WITH_PUBLIC_KEY.
2871         * rsa-encrypt.c: Likewise.
2872         * rsa-compat.c: Likewise.
2873
2874 2002-12-04  Niels Möller  <niels@s3.kth.se>
2875
2876         * testsuite/Makefile.am (LDADD): Added path to ../libnettle.a,
2877         which is redundant except for the dependency.
2878
2879 2002-12-04  Niels Möller  <nisse@cuckoo.hack.org>
2880
2881         * testsuite/sexp-format-test.c (test_main): Use %0s instead of %z.
2882         New test for %t.
2883
2884         * sexp-format.c (format_length_string): Deleted function.
2885         (format_string): Deleted function.
2886         (sexp_vformat): New %t specifier, formatting an optional display
2887         type. Deleted %z specifier. Instead, introduced a new modifier "0"
2888         that can be used with %s, %l and %t, which says that the data is
2889         NUL-terminated.
2890
2891         * rsa2sexp.c (rsa_keypair_to_sexp): Use %0s rather than %z, when
2892         formatting s-expressions.
2893
2894         * buffer.c (nettle_buffer_grow): Fixed assertion.
2895
2896 2002-11-22  Niels Möller  <niels@s3.kth.se>
2897
2898         * buffer.c: Include assert.h.
2899
2900 2002-11-21  Niels Möller  <nisse@cuckoo.hack.org>
2901
2902         * testsuite/testutils.c (print_hex): Add line breaks.
2903
2904         * Makefile.am (libnettleinclude_HEADERS): Added realloc.h.
2905         (libnettle_a_SOURCES): Added buffer-init.c and realloc.c.
2906
2907         * sexp.c (sexp_iterator_exit_lists): New function, #if:ed out for
2908         now.
2909
2910         * desdata.c: Include config.h, to get definition of UNUSED.
2911         * shadata.c: Likewise.
2912
2913         * buffer.c (nettle_buffer_grow): New function, replacing
2914         grow_realloc.
2915         (nettle_buffer_clear): Rewritten to use buffer->realloc.
2916
2917         * buffer.h (struct nettle_buffer): Replaced the GROW function
2918         pointer with a nettle_realloc_func pointer and a
2919         void *realloc_ctx.
2920         (NETTLE_BUFFER_GROW): Deleted macro, use function instead.
2921
2922         * buffer-init.c (nettle_buffer_init): Moved to a separate file.
2923
2924         * realloc.c (nettle_realloc): New function.
2925         (nettle_xrealloc): New function.
2926
2927         * realloc.h (nettle_realloc_func): New typedef.
2928
2929         * configure.ac: Check for gcc:s __attribute__.
2930
2931 2002-11-16  Niels Möller  <nisse@cuckoo.hack.org>
2932
2933         * sexp2dsa.c, sexp2rsa.c: (macro GET): Check sign of parsed
2934         numbers.
2935
2936         * sexp2bignum.c (nettle_mpz_set_sexp): In the first check against
2937         limit, added some margin to allow for sign octets.
2938
2939 2002-11-15  Niels Möller  <nisse@cuckoo.hack.org>
2940
2941         * testsuite/testutils.h (LDATA): Use sizeof instead of strlen. Now
2942         handles strings including NUL-characters. But works only with
2943         literals and character arrays, no char pointers.
2944         (LLENGTH): New macro, computing length the same way as LDATA.
2945
2946         * testsuite/sexp-test.c (test_main): Test sexp_iterator_get_uint32.
2947
2948         * testsuite/sexp-format-test.c (test_main): Check that %i and %b
2949         generate leading zeroes when needed. Check that %b handles
2950         negative numbers.
2951
2952         * testsuite/rsa2sexp-test.c (test_main): Updated test, one leading
2953         zero is needed in the private key expression. In verbose mode,
2954         print the generated keys.
2955
2956         * testsuite/sexp2rsa-test.c (test_main): Added a leading zero in
2957         the private key expression.
2958
2959         * testsuite/bignum-test.c (test_bignum): Use
2960         nettle_mpz_init_set_str_256_s.
2961         (test_size): New function.
2962         (test_main): Test size computation and formatting of negative
2963         numbers.
2964
2965         * sexp2bignum.c (nettle_mpz_set_sexp): Use
2966         nettle_mpz_set_str_256_s, to handle negative numbers correctly.
2967
2968         * sexp-format.c (sexp_vformat): For %i, output a leading zero when
2969         needed to get a correct, positive, sign. For %b, use
2970         nettle_mpz_sizeinbase_256_s, to handle negative numbers properly.
2971
2972         * bignum.c (nettle_mpz_sizeinbase_256_s): New function.
2973         (nettle_mpz_sizeinbase_256_u): New name, was
2974         nettle_mpz_sizeinbase_256. Updated all callers.
2975         (nettle_mpz_to_octets): New function.
2976         (nettle_mpz_get_str_256): Handle negative numbers.
2977         (nettle_mpz_from_octets): New function.
2978         (nettle_mpz_set_str_256_u): New name, was nettle_mpz_set_str_256.
2979         (nettle_mpz_init_set_str_256_u): New name, was
2980         nettle_mpz_init_set_str_256.
2981         (nettle_mpz_set_str_256_s): New function, handling negative two's
2982         complement numbers.
2983         (nettle_mpz_init_set_str_256_s): And an init variant.
2984
2985         * sexp.c (sexp_iterator_get_uint32): New function.
2986
2987 2002-11-10  Niels Möller  <nisse@cuckoo.hack.org>
2988
2989         * testsuite/sexp-conv-test: Use input files without any trailing
2990         newline character, in order to stress the end of file handling.
2991
2992         * tools/sexp-conv.c (sexp_get_token_string): Fixed end of file
2993         handling.
2994         (sexp_get_string): Fixed end of encoding/end of file handling.
2995         (parse_options): Check for negative width and complain.
2996
2997         * tools/sexp-conv.c: Use supplied getopt.
2998         (werror): New function.
2999         (sexp_output_hash_init): New function.
3000         (sexp_put_char): Made base64 linebreaking configurable.
3001         Implemented hashing.
3002         (sexp_put_code_start, sexp_put_code_end): Don't output any
3003         delimiters here.
3004         (sexp_put_string): Output base64 delimiters.
3005         (sexp_put_digest): New function.
3006         (sexp_convert_item): Output transport delimiters.
3007         (sexp_convert_file): Deleted function, folded with main.
3008         (parse_options): New function.
3009         (main): Implemented --hash and --once, needed by lsh-authorize.
3010
3011         * sexp.h (struct sexp_iterator): New field start.
3012
3013         * sexp.c (sexp_iterator_subexpr): New function.
3014         (sexp_iterator_parse): Initialize ITERATOR->start.
3015
3016         * sexp-format.c (sexp_vformat): Abort if format string contains
3017         unhandled characters.
3018
3019 2002-11-08  Niels Möller  <niels@s3.kth.se>
3020
3021         * des-compat.c (des_ecb3_encrypt): Don't use struct initialization
3022         (c89 doesn't allow non-constant initializers). Reported by James
3023         Ralston.
3024         (des_ede3_cbc_encrypt): Likewise.
3025
3026         * examples/nettle-openssl.c: Moved from the top-level directory.
3027         Should *not* be included in the nettle library.
3028
3029 2002-11-08  Niels Möller  <nisse@cuckoo.hack.org>
3030
3031         * testsuite/testutils.c (test_dsa_key): Bugfix for renamed DSA
3032         constant (noted by James Ralston).
3033
3034 2002-11-07  Niels Möller  <niels@s3.kth.se>
3035
3036         * testsuite/run-tests: Copied new version rom lsh/src/testsuite.
3037         This version handles test scripts located in $srcdir.
3038
3039         * examples/Makefile.am (AM_CFLAGS): We need -I$(top_srcdir).
3040         * tools/Makefile.am (AM_CFLAGS): Likewise.
3041         * testsuite/Makefile.am (AM_CFLAGS): Likewise.
3042
3043 2002-11-07  Niels Möller  <nisse@cuckoo.hack.org>
3044
3045         * Makefile.am (SUBDIRS): Added tools.
3046         (libnettle_a_SOURCES): Added sexp-transport-format.c,
3047         sexp2bignum.c, sexp2dsa.c.
3048
3049         * sexp2dsa.c (dsa_keypair_from_sexp_alist, dsa_keypair_from_sexp):
3050         New file, new functions.
3051
3052         * rsa2sexp.c (rsa_keypair_to_sexp): %s -> %z renaming.
3053
3054         * sexp-transport.c (sexp_transport_iterator_first): Fixed bug,
3055         length was mishandled.
3056
3057         * sexp-transport-format.c (sexp_transport_format,
3058         sexp_transport_vformat): New file, new functions.
3059
3060         * sexp-format.c (sexp_format): Return length of output. Allow
3061         buffer == NULL, and only compute the needed length in this case.
3062         Renamed %s to %z. New format specifiers %s, %i, and %l.
3063         (sexp_vformat): New function.
3064         (format_prefix): Rewrote to not use snprintf.
3065
3066         * sexp2rsa.c (rsa_keypair_from_sexp): New limit argument. Use
3067         nettle_mpz_set_sexp.
3068
3069         * dsa-keygen.c (dsa_generate_keypair): Added some newlines to
3070         progress display. Use DSA_P_MIN_BITS.
3071
3072         * dsa.h (DSA_MIN_P_BITS): New constant (was DSA_MINIMUM_BITS).
3073         (DSA_Q_OCTETS, DSA_Q_BITS): New constants.
3074         (dsa_keypair_from_sexp_alist, dsa_keypair_from_sexp): New
3075         prototypes.
3076
3077         * configure.ac: Output tools/Makefile.
3078
3079         * sexp2bignum.c (nettle_mpz_set_sexp): New file, and new function.
3080         Moved from sexp2rsa.c:get_value.
3081
3082         * examples/io.c (read_rsa_key): New limit argument in
3083         call of rsa_keypair_from_sexp_alist.
3084
3085         * examples/Makefile.am (noinst_PROGRAMS): Removed sexp-conv.
3086
3087         * tools/sexp-conv.c: Moved file from examples directory.
3088
3089         * testsuite/Makefile.am (TS_SH): New variable. Added
3090         sexp-conv-test.
3091
3092         * testsuite/testutils.h (LDUP): New macro.
3093
3094         * testsuite/sexp2rsa-test.c (test_main): New limit argument in
3095         call of rsa_keypair_from_sexp_alist.
3096
3097         * testsuite/sexp-test.c (test_main): Added test for lengths with
3098         more than one digit. Added tests for transport mode decoding.
3099
3100         * testsuite/sexp-format-test.c (test_main): Added tests for %i and
3101         %l.
3102
3103         * testsuite/sexp-conv-test: Moved test from examples directory.
3104         Updated path to sexp-conv, now in ../tools/sexp-conv.
3105
3106 2002-11-03  Niels Möller  <nisse@cuckoo.hack.org>
3107
3108         * sexp-format.c, sexp_format.c: Renamed sexp_format.c to
3109         sexp-format.c.
3110         * Makefile.am (libnettle_a_SOURCES): Renamed sexp_format.c to
3111         sexp-format.c.
3112
3113         * examples/Makefile.am: Don't set CFLAGS or CPPFLAGS explicitly,
3114         let automake handle that.
3115         * testsuite/Makefile.am: Likewise.
3116
3117         * sexp2rsa.c (rsa_keypair_from_sexp_alist): New function.
3118         (rsa_keypair_from_sexp): Use it.
3119
3120 2002-11-01  Niels Möller  <niels@s3.kth.se>
3121
3122         * examples/Makefile.am (LDADD): Use -lnettle, instead of an
3123         explicit filename libnettle.a, so that we will use the shared
3124         library, if it exists.
3125         (AM_LDFLAGS): Added -L.., so we can find -lnettle.
3126         (run-tests): Set LD_LIBRARY_PATH to ../.lib, when running the
3127         testsuite.
3128         * testsuite/Makefile.am: Similar changes.
3129
3130         * Makefile.am (LIBOBJS): Put @LIBOBJS@ into the make variable
3131         LIBOBJS.
3132         (CLEANFILES): Delete libnettle.so.
3133         (clean-local): Delete the .lib linkfarm.
3134         ($(SHLIBFORLINK)): When building libnettle.so, create a link from
3135         .lib/$SHLIBSONAME. Needed at runtime, for the testsuite.
3136
3137 2002-11-01  Niels Möller  <nisse@lysator.liu.se>
3138
3139         * configure.ac: Fixed definitions using SHLIBMAJOR and SHLIBMINOR.
3140         Also AC_SUBST SHLIBMAJOR and SHLIBMINOR. Reported by James
3141         Ralston.
3142
3143 2002-10-31  Niels Möller  <niels@s3.kth.se>
3144
3145         * examples/sexp-conv.c(sexp_put_list_start): Deleted function.
3146         (sexp_put_list_end): Likewise.
3147         (sexp_put_display_start): Likewise.
3148         (sexp_put_display_end): Likewise.
3149         (sexp_puts): Likewise.
3150
3151         * examples/sexp-conv.c (sexp_get_quoted_string): Deleted function.
3152         Merged with sexp_get_String.
3153         (sexp_get_hex_string): Likewise.
3154         (sexp_get_base64_string): Likewise.
3155         (sexp_get_string): Do hex and base64 decoding.
3156
3157         * examples/sexp-conv.c (enum sexp_char_type): New enum, for end
3158         markers in the input strem.
3159         (struct sexp_input): Deleted LEVEL attribute. Deleted all usage of
3160         it.
3161         (sexp_get_raw_char): Use INPUT->c and INPUT->ctype to store
3162         results. Deleted OUT argument.
3163         (sexp_get_char): Likewise. Also removed the
3164         INPUT->coding->decode_final call, for symmetry.
3165         (sexp_input_end_coding): Call INPUT->coding->decode_final.
3166         (sexp_next_char): New function.
3167         (sexp_push_char): New function.
3168         (sexp_get_token_char): Deleted function.
3169         (sexp_get_quoted_char): Simplified. Deleted output argument.
3170         (sexp_get_quoted_string): Simplified.
3171         (sexp_get_base64_string): Likewise.
3172         (sexp_get_token_string): Likewise.
3173         (sexp_get_string_length): Skip the character that terminates the
3174         string.
3175         (sexp_get_token): Cleared upp calling conventions. Always consume
3176         the final character of the token.
3177         (sexp_convert_list): Take responsibility for converting the start
3178         and end of the list.
3179         (sexp_convert_file): Call sexp_get_char first, to get the token
3180         reading started.
3181         (sexp_convert_item): Cleared up calling conventions. Should be
3182         called with INPUT->token being the first token of the expression,
3183         and returns with INPUT->token being the final token of the
3184         expression. Return value changed to void..
3185
3186         * examples/sexp-conv-test: Added test for transport mode input.
3187
3188         * examples/sexp-conv.c (sexp_get_char): Use the nettle_armor
3189         interface for decoding.
3190         (sexp_input_start_coding): New function.
3191         (sexp_input_end_coding): New function.
3192         (sexp_get_base64_string): Rewrote to use sexp_input_start_coding
3193         and sexp_input_end_coding.
3194         (sexp_get_token): Generate SEXP_TRANSPORT_START tokens.
3195         (sexp_convert_list): Lists are ended only by SEXP_LIST_END.
3196         (sexp_convert_item): Implemented transport mode, using
3197         sexp_input_start_coding and sexp_input_end_coding.
3198
3199 2002-10-30  Niels Möller  <nisse@cuckoo.hack.org>
3200
3201         * Makefile.am: Added base16 files.
3202
3203         * examples/sexp-conv-test: New tests for transport output.
3204
3205         * examples/sexp-conv.c: Deleted hex functions, moved to Nettle's
3206         base16 files.
3207         (struct sexp_output): Represent the current encoding as a
3208         nettle_armor pointer and a state struct.
3209         (sexp_output_init): Deleted MODE argument. Now passed to functions
3210         that need it.
3211         (sexp_get_char): Updated to new base64 conventions.
3212         (sexp_get_base64_string): Likewise.
3213         (sexp_put_raw_char): New function.
3214         (sexp_put_newline): Use sexp_put_raw_char.
3215         (sexp_put_char): Use nettle_armor interface for encoding data.
3216         Use OUTPUT->coding_indent for line breaking, so the INDENT
3217         argument was deleted.
3218         (sexp_put_code_start): New function, replacing sexp_put_base64_start.
3219         (sexp_put_code_end): New function, replacing sexp_put_base64_end.
3220         (sexp_put_data): Deleted argument INDENT.
3221         (sexp_puts): Likewise.
3222         (sexp_put_length): Likewise.
3223         (sexp_put_list_start): Likewise.
3224         (sexp_put_list_end): Likewise.
3225         (sexp_put_display_start): Likewise.
3226         (sexp_put_display_end): Likewise.
3227         (sexp_put_string): Likewise. Also changed base64 handling.
3228         (sexp_convert_string): Deleted argument INDENT. New argument
3229         MODE_OUT.
3230         (sexp_convert_list): New argument MODE_OUT.
3231         (sexp_convert_file): Likewise.
3232         (sexp_convert_item): Likewise. Also handle output in transport
3233         mode.
3234         (match_argument): Simple string comparison.
3235         (main): Adapted to above changes.
3236
3237         * testsuite/testutils.c (test_armor): Allocate a larger buffer
3238         CHECK, to make decode_update happy. Updated to new base64
3239         conventions.
3240
3241         * testsuite/base64-test.c (test_main): Fixed overlap test to not
3242         change the base64 before decoding. Updated to new base64
3243         conventions.
3244
3245         * testsuite/Makefile.am (TS_PROGS): Added base16-test.
3246
3247         * testsuite/base16-test.c: New test.
3248
3249         * sexp-transport.c (sexp_transport_iterator_first): Updated to new
3250         conventions for base64_decode_update and base64_decode_final.
3251
3252         * nettle-meta.h: Updated ascii armor declarations. New declaration
3253         for nettle_base16.
3254
3255         * base64-decode.c (base64_decode_single): Return -1 on error.
3256         Also keep track of the number of padding characters ('=') seen.
3257         (base64_decode_update): New argument dst_length. Return -1 on error.
3258         (base64_decode_status):  Renamed function...
3259         (base64_decode_final): ... to this.
3260
3261         * base64.h (struct base64_decode_ctx): Deleted STATUS attribute.
3262         Added PADDING attribute.
3263
3264         * base16.h, base16-encode.c, base16-decode.c, base16-meta.c: New
3265         files.
3266
3267 2002-10-28  Niels Möller  <nisse@cuckoo.hack.org>
3268
3269         * examples/sexp-conv.c (struct hex_decode_ctx): New hex decoding
3270         functions.
3271         (sexp_get_raw_char): New function.
3272         (sexp_get_char): Use sexp_get_raw_char.
3273
3274 2002-10-26  Niels Möller  <nisse@cuckoo.hack.org>
3275
3276         * examples/sexp-conv.c (sexp_put_length): Bugfix, don't output any
3277         leading zero.
3278         (main): Implemented -s option.
3279
3280         * examples/sexp-conv-test: Test for echo -n vs echo '\c'. Added a
3281         few tests for canonical output.
3282
3283 2002-10-25  Niels Möller  <niels@s3.kth.se>
3284
3285         * examples/sexp-conv.c (struct sexp_input): Deleted the mode from
3286         the state, that should be passed as argument to relevant
3287         functions. Instead, introduces enum sexp_coding, to say if base64
3288         coding is in effect.
3289         (struct sexp_output): Added coding attribute.
3290         (sexp_put_char): Use output->coding.
3291         (sexp_put_base64_start): Likewise.
3292         (sexp_put_base64_end): Likewise.
3293
3294         * base64-decode.c (base64_decode_single): Simplified, got rid of
3295         the done variable.
3296
3297 2002-10-25  Niels Möller  <nisse@cuckoo.hack.org>
3298
3299         * examples/sexp-conv.c (sexp_put_newline): Return void, die on
3300         error.
3301         (sexp_put_char, sexp_put_data, sexp_puts, sexp_put_length,
3302         sexp_put_base64_start, sexp_put_base64_end, sexp_put_string,
3303         sexp_put_list_start, sexp_put_list_end, sexp_put_display_start,
3304         sexp_put_display_end, sexp_convert_string, sexp_convert_list,
3305         sexp_skip_token): Likewise.
3306         (sexp_convert_item): Die on error.
3307
3308 2002-10-24  Niels Möller  <nisse@cuckoo.hack.org>
3309
3310         * examples/sexp-conv-test: Doesn't need echo -n anymore.
3311
3312         * examples/sexp-conv.c (die): New function.
3313         (struct sexp_input): Deleted field ITEM.
3314         (sexp_get_char): Die on failure, never return -1.
3315         (sexp_get_quoted_char): Likewise.
3316         (sexp_get_quoted_string): Die on failure, no returned value.
3317         (sexp_get_base64_string): Likewise.
3318         (sexp_get_token_string): Likewise.
3319         (sexp_get_string): Likewise.
3320         (sexp_get_string_length): Likewise.
3321         (sexp_get_token): Likewise.
3322         (sexp_convert_string): Adapted to sexp_get_token.
3323         (sexp_convert_list): Likewise.
3324         (sexp_convert_file): New function.
3325         (main): Use sexp_convert_file.
3326
3327 2002-10-23  Niels Möller  <nisse@cuckoo.hack.org>
3328
3329         * examples/Makefile.am (TS_PROGS): Added sexp-conv-test.
3330
3331         * examples/sexp-conv.c (sexp_input_init): Initialize input->string
3332         properly.
3333         (sexp_get_char): Fixed non-transport case.
3334         (sexp_get_quoted_char): Fixed default case.
3335         (sexp_get_token): Loop over sexp_get_char (needed for handling of
3336         white space). Don't modify input->level. Fixed the code that skips
3337         comments.
3338         (sexp_put_char): Fixed off-by-one bug in assertion.
3339         (sexp_put_string): Fixed escape handling for output of quoted
3340         strings.
3341         (sexp_convert_list): Prettier output, hanging indent after the
3342         first list element.
3343         (sexp_skip_token): New function.
3344         (sexp_convert_item): Use sexp_skip_token to skip the end of a
3345         "[display-type]".
3346
3347 2002-10-22  Niels Möller  <nisse@cuckoo.hack.org>
3348
3349         * examples/sexp-conv-test: New test program.
3350
3351         * examples/Makefile.am (noinst_PROGRAMS): Added sexp-conv.
3352
3353         * examples/sexp-conv.c (sexp_convert_list): New function.
3354         (sexp_convert_item): New function.
3355         (main): New function. Compiles and runs now, but doesn't work.
3356
3357         * base64-decode.c (base64_decode_single): New function.
3358         (base64_decode_update): Use base64_decode_single.
3359
3360         * examples/sexp-conv.c: Added output functions.
3361
3362 2002-10-21  Pontus Sköld  <pont@soua.net>
3363
3364         * base64-encode.c (base64_encode_raw): Fixed null statement
3365         amongst variable declarations, broke compilation for non C99
3366         compilers.
3367
3368 2002-10-21  Niels Möller  <nisse@lysator.liu.se>
3369
3370         * examples/sexp-conv.c: New sexp conversion program.
3371
3372 2002-10-21  Niels Möller  <niels@s3.kth.se>
3373
3374         * Makefile.am (libnettle_a_SOURCES): Added
3375         sexp-format-transport.c.
3376
3377         * sexp-transport.c (sexp_transport_iterator_first): New file and
3378         function.
3379         * sexp.h (sexp_transport_iterator_first): Added protoype.
3380
3381         * sexp.c (sexp_iterator_next): Abort if iterator type is boogus.
3382
3383 2002-10-19  Niels Möller  <nisse@cuckoo.hack.org>
3384
3385         * testsuite/testutils.c (test_armor): Updated to new armor
3386         conventions.
3387
3388         * testsuite/base64-test.c (test_main): Test BASE64_ENCODE_LENGTH
3389         and BASE64_DECODE_LENGTH. Updated test of base64_encode_raw (used
3390         to be base64_encode).
3391
3392         * base64.h (BASE64_ENCODE_LENGTH, BASE64_DECODE_LENGTH): Fixed and
3393         documented macros.
3394
3395         * base64-meta.c (base64_encode_length, base64_decode_length): New
3396         functions, corresponding to the macros with the same name.
3397
3398         * Makefile.am (libnettle_a_SOURCES): base64.c replaced by
3399         base64-encode.c and base64-decode.c.
3400
3401         * pgp-encode.c (pgp_armor): Use new base64 conventions.
3402
3403         * nettle-meta.h: Updated nettle_armor definitions.
3404
3405         * base64.h: Major reorganization.
3406
3407         * base64.c: Deleted file, contents moved to base64-encode.c or
3408         base64-decode.c.
3409
3410         * base64-encode.c: New file. New supporting both encode-at-once
3411         and streamed operation.
3412
3413         * base64-decode.c: New file.
3414
3415 2002-10-09  Niels Möller  <nisse@cuckoo.hack.org>
3416
3417         * testsuite/Makefile.am (TS_PROGS): Added dsa-keygen-test.
3418
3419         * dsa-keygen.c: Call the progress callback only if it's non-NULL.
3420
3421         * Makefile.am (libnettle_a_SOURCES): Added bignum-random.c and
3422         dsa-keygen.c.
3423
3424         * testsuite/testutils.c (test_dsa_key): New function to sanity
3425         check a dsa keypair.
3426
3427         * testsuite/dsa-test.c (test_main): Call dsa_test_key.
3428
3429         * testsuite/dsa-keygen-test.c: New test case.
3430
3431         * dsa.h (DSA_MINIMUM_BITS): New constant.
3432
3433         * bignum.h (nettle_mpz_random, nettle_mpz_random_size): Added
3434         prototypes.
3435
3436         * dsa-keygen.c: New file.
3437
3438         * bignum-random.c: New file.
3439         (nettle_mpz_random): New function, moved from...
3440         * dsa-sign.c (nettle_mpz_random): ... here. Also changed argument
3441         ordering and updated callers.
3442
3443         * bignum-random.c: (nettle_mpz_random_size): New function, renamed
3444         and moved here from...
3445         * rsa-keygen.c (bignum_random_size): ... here. Updated all
3446         callers.
3447
3448         * testsuite/testutils.c (test_dsa): Needs both public and private
3449         key as arguments.
3450
3451         * testsuite/dsa-test.c (test_main): Updated to changes of the
3452         private key struct.
3453
3454         * testsuite/Makefile.am (TS_PROGS): Added dsa-test.
3455
3456         * rsa-decrypt.c (rsa_decrypt): Constification.
3457         * rsa-encrypt.c (rsa_encrypt): Likewise.
3458         * rsa.c (rsa_compute_root): Likewise.
3459         * rsa_md5.c (rsa_md5_sign): Likewise.
3460         (rsa_md5_verify): Likewise.
3461         * rsa_sha1.c (rsa_sha1_sign): Likewise.
3462         (rsa_sha1_verify): Likewise.
3463
3464         * dsa-verify.c (dsa_verify): Use const for the public key
3465         argument.
3466
3467         * dsa-sign.c (dsa_sign): Needs the public key as argument, in
3468         addition to the private key. Use const.
3469
3470         * dsa.h (struct dsa_private_key): Don't include the public
3471         information here.
3472         * dsa.c (dsa_private_key_init, dsa_private_key_clear): Updated to
3473         new struct dsa_private_key.
3474
3475         * dsa-sign.c (dsa_sign): Bugfix, added missing mpz_init call.
3476
3477         * Makefile.am (libnettle_a_SOURCES): Added dsa files.
3478         (libnettleinclude_HEADERS): Added dsa.h.
3479
3480         * testsuite/testutils.c (test_dsa): New function.
3481
3482         * testsuite/dsa-test.c: New test.
3483
3484         * dsa.h, dsa.c, dsa-sign.c, dsa-verify.c: New files.
3485
3486         * nettle-meta.h: Moved the nettle_random_func and
3487         nettle_progress_func typedefs here...
3488         * rsa.h: ... from here.
3489
3490 2002-10-07  Niels Möller  <nisse@cuckoo.hack.org>
3491
3492         * sexp.h (enum sexp_type): Deleted SEXP_START.
3493
3494         * sexp.c (sexp_iterator_parse): New function, similar to the old
3495         sexp_iterator_next, but independent of the previous value of the
3496         iterator->type.
3497         (sexp_iterator_first): Use sexp_iterator_parse.
3498         (sexp_iterator_next): Likewise.
3499         (sexp_iterator_enter_list): Use sexp_iterator_parse. SEXP_START
3500         not needed anymore.
3501         (sexp_iterator_exit_list): Likewise.
3502
3503 2002-10-06  Niels Möller  <nisse@cuckoo.hack.org>
3504
3505         * sexp2rsa.c (get_value): No need to call sexp_iterator_next
3506         anymore.
3507
3508         * sexp.c (sexp_iterator_assoc): Advance the iterator to the
3509         element after a matching tag, before recording it.
3510         * testsuite/sexp-test.c (test_main): Updated test.
3511
3512         * testsuite/sexp-test.c (test_main): No need to call
3513         sexp_iterator_next after sexp_iterator_exit_list.
3514
3515         * sexp2rsa.c (rsa_keypair_from_sexp): No need to call
3516         sexp_iterator_next anymore.
3517
3518         * sexp.c (sexp_iterator_next): Updated to new sexp_iterator_exit_list.
3519         (sexp_iterator_exit_list): Return with iterator pointing to the
3520         element after the list.
3521         (sexp_iterator_check_type): Call sexp_iterator_next before
3522         returning.
3523         (sexp_iterator_check_types): Likewise.
3524         (sexp_iterator_assoc): Rearranged calls of sexp_iterator_next.
3525
3526         * sexp.c (sexp_iterator_enter_list): Call sexp_iterator_next to
3527         get to the first element of the list. Updated callers.
3528
3529         * base64.c (base64_encode_group): New function, used by openpgp
3530         armoring code.
3531
3532         * Makefile.am: Added openpgp files.
3533
3534         * sexp2rsa.c (rsa_keypair_from_sexp): Use sexp_iterator_first.
3535         * testsuite/sexp-test.c (test_main): Likewise.
3536
3537         * sexp.c (sexp_iterator_init): Made this function static.
3538         (sexp_iterator_first): New, friendlier, initialization function.
3539
3540         * pgp-encode.c: New file. Functions for writing openpgp data
3541         packets.
3542
3543         * pgp.h: New file, with pgp related declarations.
3544
3545         * rsa2openpgp.c (rsa_keypair_to_openpgp): New file, new function.
3546
3547 2002-10-04  Niels Möller  <niels@s3.kth.se>
3548
3549         * examples/rsa-keygen.c: Use malloc, instead of asprintf.
3550
3551 2002-10-03  Niels Möller  <nisse@cuckoo.hack.org>
3552
3553         * Released nettle-1.6.
3554
3555         * NEWS: Note the aes api change.
3556
3557         * examples/Makefile.am (EXTRA_DIST): Distribute setup-env and
3558         teardown-env.
3559
3560 2002-10-02  Niels Möller  <nisse@cuckoo.hack.org>
3561
3562         * examples/rsa-keygen.c (main): Comment on the lax security of the
3563         private key file.
3564
3565         * index.html: Added link to mailing list.
3566
3567 2002-10-02  Niels Möller  <niels@s3.kth.se>
3568
3569         * Makefile.am: Fixed assembler rules, and shared libraries.
3570
3571         * configure.ac: Fixed the enable-shared option.
3572
3573 2002-10-01  Niels Möller  <nisse@cuckoo.hack.org>
3574
3575         * configure.ac: New option --enable-shared, and a first attempt at
3576         building a shared library (*without* using libtool).
3577
3578         * Makefile.am: A first attempt at rules for building a shared
3579         libnettle.so.
3580
3581 2002-10-01  Niels Möller  <niels@s3.kth.se>
3582
3583         * examples/run-tests (test_program): Use basename.
3584
3585         * examples/teardown-env: Delete some more files.
3586
3587         * examples/run-tests (test_program): Strip directory part of
3588         displayed name.
3589
3590         * examples/Makefile.am (TS_PROGS): New variable. Run tests.
3591
3592         * examples/io.c (read_file): Bug fix, used to overwrite pointer.
3593
3594         * examples/rsa-keygen.c (main): Bug fix, private key wasn't
3595         written properly.
3596
3597         * testsuite/Makefile.am: Some cleanup of make check.
3598
3599         * examples/setup-env, examples/teardown-env: Test environment scripts.
3600         * examples/rsa-verify-test, examples/rsa-sign-test: New test cases.
3601
3602         * examples/run-tests: New file (copied from lsh testsuite).
3603
3604         * examples/Makefile.am: Use EXTRA_PROGRAMS and @RSA_EXAMPLES@.
3605
3606         * examples/rsa-sign.c: No need to include config.h. Use werror
3607         instead of fprintf.
3608         * examples/rsa-verify.c: Likewise.
3609         * examples/rsa-keygen.c: Likewise.
3610
3611         * examples/io.h: Forward declare struct rsa_public_key and struct
3612         rsa_private_key, to avoid dependences on config.h.
3613
3614         * configure.ac (RSA_EXAMPLES): New substituted variable,
3615         controlling which example programs to build.
3616
3617         * examples/rsa-verify.c: New example program.
3618
3619         * examples/rsa-keygen.c: Use functions from io.c.
3620         * examples/rsa-sign.c: Likewise.
3621
3622         * examples/Makefile.am (noinst_PROGRAMS): Added rsa-verify.
3623         (LDADD): Added io.o.
3624
3625         * configure.ac: New define WITH_PUBLIC_KEY, and new configure flag
3626         --disable-public-key. Updated rsa-files to check for that, rather
3627         than for HAVE_LIBGMP.
3628
3629         * examples/io.c, examples/io.c: New files. Miscellaneous functions
3630         used by the example programs.
3631
3632         * base64.h (BASE64_DECODE_LENGTH): Comment fix.
3633
3634 2002-09-30  Niels Möller  <nisse@cuckoo.hack.org>
3635
3636         * sexp2rsa.c (rsa_keypair_from_sexp): Bugfix: Call
3637         rsa_prepare_public_key and rsa_prepare_private_key.
3638
3639         * examples/Makefile.am (noinst_PROGRAMS): Added rsa-sign.
3640
3641         * examples/rsa-sign.c: New example program.
3642
3643         * testsuite/base64-test.c (test_main): Test encoding and decoding
3644         in place.
3645
3646         * base64.c (base64_encode): Encode from the end of the data
3647         towards the start, in order to support overlapping areas.
3648         (base64_encode): Broke out some common code from the switch..
3649
3650 2002-09-30  Niels Möller  <niels@s3.kth.se>
3651
3652         * sexp_format.c (sexp_format): Don't mix code and declarations.
3653
3654 2002-09-29  Niels Möller  <nisse@cuckoo.hack.org>
3655
3656         * testsuite/Makefile.am (TS_PROGS): Added buffer-test
3657         sexp-format-test rsa2sexp-test sexp2rsa-test.
3658
3659
3660         * testsuite/sexp-test.c (test_main): Updated calls to
3661         sexp_iterator_assoc.
3662
3663         * testsuite/testutils.h (MEMEQH): New macro.
3664
3665         * testsuite/sexp2rsa-test.c: New test.
3666         * testsuite/sexp-format-test.c: New test.
3667         * testsuite/rsa2sexp-test.c: New test.
3668         * testsuite/buffer-test.c: New test.
3669
3670         * testsuite/testutils.c (test_rsa_key): Copied this function
3671         from...
3672         testsuite/rsa-keygen-test.c: ... here.
3673
3674         * examples/rsa-keygen.c: New file.
3675
3676         * Makefile.am: Added new source files and headers buffer.h,
3677         buffer.c, sexp_format.c, sexp2rsa.c, rsa2sexp.c.
3678
3679         * rsa.h (rsa_keypair_to_sexp, rsa_keypair_from_sexp): New
3680         prototypes.
3681
3682         * rsa2sexp.c, sexp2rsa.c: New files.
3683
3684         * sexp.c (sexp_iterator_assoc): Don't enter the list, associate
3685         keys within the current list. Still exit the list when done.
3686         (sexp_iterator_assoc): Represent keys as plain NUL-terminated
3687         strings.
3688         (sexp_iterator_check_type, sexp_iterator_check_types): New
3689         functions.
3690
3691         * sexp_format.c: New file, implementing an sexp canonical syntax
3692         formatter.
3693
3694         * buffer.c, buffer.h: New files, implementing a bare-bones string
3695         stream.
3696
3697         * bignum.c (nettle_mpz_sizeinbase_256): New function.
3698
3699 2002-09-28  Niels Möller  <nisse@cuckoo.hack.org>
3700
3701         * sexp.c (sexp_iterator_assoc): Return 0 for missing or duplicate
3702         keys. Now passes all the tests.
3703
3704         * sexp.c (sexp_iterator_simple): Bugfixes. Check earlier that
3705         length doesn't grow too large.
3706         (sexp_iterator_next): Skip the current list only if type is
3707         SEXP_LIST. Handle ')'.
3708         (sexp_iterator_enter_list): Set type to SEXP_START.
3709         (sexp_iterator_exit_list): Likewise. Don't skip the ')' here.
3710         (sexp_iterator_assoc): Bug fix.
3711
3712         * testsuite/sexp-test.c (test_main): Reordered sexp_iterator_assoc
3713         tests.
3714
3715         * nettle.texinfo (Randomness): Documented that yarrow256_init can
3716         be called with a zero number of sources.
3717
3718         * testsuite/testutils.h (ASSERT): New macro.
3719
3720         * testsuite/sexp-test.c: Test sexp parser.
3721
3722         * Makefile.am (SUBDIRS): Added sexp files.
3723
3724         * sexp.c, sexp.h: New files, implementing an sexp-parser.
3725
3726 2002-08-27  Niels Möller  <niels@s3.kth.se>
3727
3728         * Makefile.am (DISTCLEANFILES): make distclean should delete the
3729         assembler-related symlinks.
3730
3731 2002-08-26  Niels Möller  <nisse@cuckoo.hack.org>
3732
3733         * Makefile.am (%.o: %.asm): Create an empty (and unused)
3734         dependency file, to make the make/automake dependency tracking
3735         happier.
3736
3737 2002-07-18  Niels Möller  <niels@s3.kth.se>
3738
3739         * examples/nettle-benchmark.c (main): Try openssl's ciphers as
3740         well, if available.
3741
3742         * Makefile.am (libnettle_a_SOURCES): Added nettle-openssl.c.
3743
3744         * nettle-openssl.c: New file.
3745
3746         * nettle-internal.h: Declare openssl glue ciphers.
3747
3748         * des-compat.h: Extra name-mangling, to avoid collisions in case a
3749         program links with both nettle and libcrypto (the nettle-benchmark
3750         program does).
3751
3752         * configure.ac: Don't use -ggdb3 with gcc-2.96.
3753         Check for openssl's libcrypto (for benchmarking).
3754
3755 2002-05-16  Niels Möller  <nisse@cuckoo.hack.org>
3756
3757         * sparc/aes.asm: Deleted registers i and t3.
3758         (_aes_crypt): Moved some registers around. We now use input
3759         registers only for arguments, local registers for loop invariants,
3760         output registers for temporaries and loop variables, and no global
3761         registers at all.
3762
3763         * sparc/aes.asm (AES_FINAL_ROUND): New macro.
3764         (_aes_crypt): Use AES_FINAL_ROUND for the first word of the final
3765         round.
3766         (_aes_crypt): And for the rest of the final round.
3767         (AES_FINAL_ROUND): Don't update dst, just access it offseted by i.
3768         (_aes_crypt): Add 16 to dst at the end of the final round.
3769         (AES_ROUND): Use ldub, not ld + and, to get the third byte
3770         of wtxt.
3771         (AES_ROUND): Use ldub, not lduh + and, to get the second
3772         byte of a word.
3773         (AES_ROUND): Reordered instructions, so that we can save one
3774         register.
3775         (AES_ROUND): Eliminated use of t3.
3776         (AES_FINAL_ROUND): Eliminated ands.
3777         (AES_FINAL_ROUND): Reordered, so that we can save one register.
3778         (AES_FINAL_ROUND): Eliminated t3.
3779         (AES_LOAD): New macro.
3780         (_aes_crypt): Unrolled source loop.
3781         (_aes_crypt): Use AES_LOAD macro.
3782         (_aes_crypt): Deleted cruft from the old source loop.
3783         (AES_LOAD): Eliminated t3.
3784
3785 2002-05-15  Niels Möller  <nisse@cuckoo.hack.org>
3786
3787         * sparc/aes.asm (AES_ROUND): New macro.
3788         (_aes_crypt): Use AES_ROUND for first word of the
3789         round function.
3790         (_aes_crypt): And for the rest of the round function.
3791
3792         * sparc/aes.asm (_aes_crypt): Deleted a bunch of additions,
3793         after accessing IDX1.
3794
3795         * aes-internal.h (struct aes_table): sparc_idx[0] should now
3796         contain index values shifted by the size of a word, and with 2
3797         added. This saves some additions in the sparc assembler code.
3798         Updates aes-encrypt-table.c and aes-decrypt-table.c.
3799
3800         * sparc/aes.asm (_aes_crypt): Unrolled final loop, preparing for
3801         optimizations.
3802         (_aes_crypt): Eliminated i from forst copy of the loop. Some
3803         cleanup.
3804         (_aes_crypt): And from second copy.
3805         (_aes_crypt): And from third.
3806         (_aes_crypt): And fourth.
3807         (_aes_crypt): Eliminated updates of i from the loop.
3808         (_aes_crypt): Access IDX1 and IDX3 through the T pointer, saving
3809         two registers.
3810
3811         * aes-internal.h (struct aes_table): Renamed the shift_idx field
3812         to sparc_idx, as it will be tweaked to improve the sparc code.
3813         Also reduced its size to [2][4].
3814         (IDX_FACTOR): Deleted constant.
3815         * aes-encrypt-table.c (_aes_encrypt_table): Adapted initializer of
3816         sparc_idx.
3817         * aes-decrypt-table.c (_aes_decrypt_table): Likewise.
3818         * asm.m4: Deleted AES_SIDX2, to match struct aes_table.
3819
3820         * sparc/aes.asm (_aes_crypt): Unrolled the inner loop, preparing
3821         for optimizations suggested by Marcus Comstedt.
3822         (_aes_crypt): Eliminated i from the first copy of the inner loop.
3823         (_aes_crypt): And from the second copy.
3824         (_aes_crypt): And from the third copy.
3825         (_aes_crypt): And from the fourth copy.
3826         (_aes_crypt): Renamed .Linner_loop to .Lround_loop.
3827         (_aes_crypt): Eliminated the loop variable i from the unrolled
3828         loop.
3829         (_aes_crypt): Deleted moves of constants into t2.
3830
3831 2002-05-15  Niels Möller  <niels@s3.kth.se>
3832
3833         * x86/aes-encrypt.asm (aes_encrypt): Use AES_SUBST_BYTE.
3834         * x86/aes-decrypt.asm (aes_decrypt): Likewise.
3835         (aes_decrypt): Use AES_STORE.
3836         (aes_decrypt): Deleted first xchgl instruction into, permuting the
3837         AES_ROUND calls instead.
3838         (aes_decrypt): Likewise for the final round.
3839         (aes_decrypt): Got rid if the xchgl instruction after the final
3840         round, folding it into the final round.
3841
3842         * x86/machine.m4: Renamed AES_LAST_ROUND to AES_FINAL_ROUND.
3843         Updated users.
3844
3845         * x86/aes-decrypt.asm (aes_decrypt): Use the AES_LOAD macro.
3846         (aes_decrypt): Start using AES_ROUND.
3847         (aes_decrypt): Use AES_LAST_ROUND.
3848
3849         * x86/aes-decrypt.asm (aes_decrypt): Moved function to a separate
3850         file...
3851         * x86/aes.asm: ... from here.
3852
3853         * x86/aes.asm (aes_decrypt): Use _aes_decrypt_table instead of
3854         itbl1-4. Commented out the inclusion of aes_tables.asm.
3855         (aes_decrypt): Use _aes_decrypt_table instead of isbox.
3856
3857
3858         * x86/aes-decrypt.asm: New file, empty at the start.
3859
3860         * Makefile.am (libnettle_a_SOURCES): Added aes-decrypt-table.c.
3861
3862         * aes-decrypt.c (_aes_decrypt_table): Moved from this file...
3863         * aes-decrypt-table.c (_aes_decrypt_table): ... to a new file.
3864
3865         * testsuite/aes-test.out: New file, with the output of
3866         testsuite/aes-test, when aes.c has been compiled with debugging
3867         printouts of intermediate state.
3868
3869 2002-05-15  Niels Möller  <nisse@cuckoo.hack.org>
3870
3871         * sparc/aes.asm: (_aes_crypt): Restore %fp at end of function, to
3872         make %fp available for other uses.
3873
3874         * sparc/aes.asm: The frame setup was broken. Tried to fix it.
3875         Reverted to revision 1.70 + minor changes from the head revision.
3876
3877         * x86/aes-encrypt.asm (aes_encrypt): Use test instead of cmpl $0,.
3878
3879         * x86/machine.m4 (AES_SUBST_BYTE): New macro.
3880
3881         * sparc/aes.asm: wtxt needs no register of it's own, as its
3882         pointed to by %sp. %g5 moved to %l0, the register previously
3883         allocated for wtxt, so that we stay clean of the reserved %g
3884         registers.
3885
3886 2002-05-14  Niels Möller  <nisse@cuckoo.hack.org>
3887
3888         * sparc/aes.asm: Avoid using %g6 and %g7, as they are reserved for
3889         operating sytem use. Use %i5 and %o7 instead. Also moved %g4 to %g1.
3890         (_aes_crypt): Allocate only 32 bytes local storage on the stack.
3891         Calculate wtxt and tmp using offsets from %sp, not %fp.
3892
3893 2002-05-14  Niels Möller  <niels@s3.kth.se>
3894
3895         * x86/aes-encrypt.asm (aes_encrypt): Replaced first quarter of the
3896         round function with an invocation of AES_ROUND.
3897         (aes_encrypt): Similarly for the second column.
3898         (aes_encrypt): Similarly for the rest of the round function.
3899
3900         * x86/machine.m4 (AES_ROUND): New macro.
3901
3902         * x86/aes-encrypt.asm (aes_encrypt): Use AES_LOAD macro.
3903
3904         * x86/machine.m4 (AES_LOAD): New macro.
3905
3906         * x86/aes-encrypt.asm (aes_encrypt): Use AES_STORE.
3907
3908         * x86/machine.m4 (AES_STORE): New macro.
3909
3910         * x86/aes-encrypt.asm (aes_encrypt): Use the AES_LAST_ROUND macro
3911         for the first column of the final round.
3912         (aes_encrypt): Similarly for the second column.
3913         (aes_encrypt): Similarly for the third and fourth column.
3914
3915         (aes_encrypt): Deleted xchgl instruction in final round, by
3916         reordering the second and fourth round.
3917
3918         * x86/machine.m4 (AES_LAST_ROUND): New macro.
3919
3920         * x86/aes-encrypt.asm (aes_encrypt): Move code here...
3921         * x86/aes.asm: ...from here.
3922
3923         * x86/aes.asm: Use addl and subl, not add and sub. Replaced
3924         references to dtbl1-4 with references to _aes_encrypt_table.
3925
3926         * configure.ac (asm_path): Enable x86 assembler.
3927
3928         * x86/aes.asm (aes_decrypt): Adapted to the current interface.
3929         Notably, the order of the subkeys was reversed. Single block
3930         encrypt/decrypt works now.
3931         (aes_encrypt, aes_decrypt): Added an outer loop, so that we can
3932         encrypt more than one block at a time.
3933
3934 2002-05-07  Niels Möller  <niels@s3.kth.se>
3935
3936         * configure.ac: Generate config.m4.
3937
3938         * x86/aes.asm: Use C for comments, include the tables using
3939         include_src, and commented out the key setup functions.
3940         Fixed the processing of the first handling of the round function.
3941         Now, encryption of a single block works! Multiple blocks, and
3942         decryption, is still broken.
3943
3944         * x86/machine.m4: New file (empty).
3945
3946         * x86/aes-encrypt.asm: New file, empty for now.
3947
3948         * Makefile.am (%.asm): Added asm.m4, machine.m4 and config.m4 to
3949         the m4 command line.
3950         (libnettle_a_SOURCES): Added aes-encrypt-table.c.
3951
3952         * sparc/aes.asm: No need to include asm.m4, that is taken care of
3953         by the Makefile.
3954
3955         * config.m4.in: New file, configuration for asm.m4.
3956
3957         * asm.m4 (C, include_src): New macros.
3958
3959         * aes-encrypt-table.c: New file, table moved out from
3960         aes-encrypt.c.
3961
3962 2002-05-06  Niels Möller  <niels@s3.kth.se>
3963
3964         * configure.ac (CFLAGS): Don't enable -Waggregate-return.
3965
3966 2002-05-05  Niels Möller  <nisse@lysator.liu.se>
3967
3968         * configure.ac: Pass no arguments to AM_INIT_AUTOMAKE.
3969
3970 2002-05-05  Niels Möller  <nisse@cuckoo.hack.org>
3971
3972         * configure.ac: Update for automake-1.6.
3973
3974         * configure.ac: Renamed file, used to be configure.in.
3975
3976 2002-03-20  Niels Möller  <nisse@cuckoo.hack.org>
3977
3978         * testsuite/run-tests (test_program): Added missing single quote.
3979
3980 2002-03-20  Niels Möller  <nisse@lysator.liu.se>
3981
3982         * testsuite/run-tests (test_program): Test the exit status of the
3983         right process.
3984
3985 2002-03-19  Pontus Sköld  <pont@it.uu.se>
3986
3987         * testsuite/run-tests: Removed /bin/bashisms to use with /bin/sh.
3988
3989 2002-03-18  Niels Möller  <nisse@cuckoo.hack.org>
3990
3991         * rsa-keygen.c (rsa_generate_keypair): Output a newline after a
3992         non-empty line of 'e':s (bad e was chosen, try again).
3993
3994 2002-03-16  Niels Möller  <nisse@cuckoo.hack.org>
3995
3996         * configure.in (asm_path): AC_CONFIG_LINKS adds $srcdir
3997         automatically.
3998
3999 2002-03-14  Niels Möller  <nisse@cuckoo.hack.org>
4000
4001         * sparc/aes.asm, x86/aes.asm: Added copyright notice.
4002
4003         * Makefile.am (libnettle_a_SOURCES): Added aes-internal.h.
4004         (EXTRA_DIST): Added assembler files.
4005
4006         * configure.in (asm_path): Use $srcdir when looking for the files.
4007         * configure.in (asm_path): For now, disable x86 assembler code.
4008         Bumped version to 1.6.
4009
4010 2002-02-25  Niels Möller  <nisse@cuckoo.hack.org>
4011
4012         * sparc/aes.asm (_aes_crypt): Moved increment of src into the
4013         source_loop. Also fixed stop condition, the loop was run 5 times,
4014         not 4, as it should.
4015         (_aes_crypt): Use src directly when accessing the source data,
4016         don't use %o5.
4017         (_aes_crypt): Renamed variables in source_loop.
4018         (_aes_crypt): Changed stop condition in source_loop to not depend
4019         on i. Finally reduced the source_loop to 16 instructions. Also
4020         increased the alignment of the code to 16.
4021         (_aes_crypt): In final_loop, use preshifted indices.
4022         (_aes_crypt): In final_loop, construct the result in t0. Use t0-t3
4023         for intermediate values.
4024         (_aes_crypt): In final_loop, use the register idx.
4025         (_aes_crypt): In final_loop, keep i multiplied by 4. Use key to
4026         get to the current roundkey.
4027         (_aes_crypt): In final_loop, use i for indexing.
4028         (_aes_crypt): Update dst in the output loop. This yields a delay
4029         slot that isn't filled yet.
4030         (_aes_crypt): Decrement round when looping, saving yet some
4031         instructions.
4032         (_aes_crypt): Reformatted code as blocks of four instructions
4033         each.
4034         (_aes_crypt): Copy the addresses of the indexing tables into
4035         registers at the start. No more need for the idx register.
4036         (_aes_crypt): Deleted idx register.
4037         (_aes_crypt): Some peep hole optimizations, duplicating some
4038         instructions to fill nop:s, and put branch instructions on even
4039         word addresses.
4040
4041 2002-02-22  Niels Möller  <nisse@cuckoo.hack.org>
4042
4043         * sparc/aes.asm (_aes_crypt): Moved some more additions out of the
4044         inner loop, using additional registers.
4045         (_aes_crypt): Deleted one more addition from the inner loop, by
4046         using the subkey pointer.
4047
4048 2002-02-19  Niels Möller  <nisse@cuckoo.hack.org>
4049
4050         * configure.in (asm_path): Renamed "path" to "asm_path". Also look
4051         for a machine.m4.
4052
4053 2002-02-16  Niels Möller  <nisse@cuckoo.hack.org>
4054
4055         * sparc/aes.asm: Use that IDX2(j) == j ^ 2
4056
4057         * Makefile.am (libnettle_a_SOURCES): Reordered aes-decrypt.c and
4058         aes-encrypt.c. For some strange reason it makes the benchmark go
4059         faster...
4060
4061         * sparc/aes.asm (_aes_crypt): Use double-buffering, and no
4062         separate loop for adding the round key.
4063         (round): Keep round index muliplied by 16, so it can be used
4064         directly for indexing the subkeys.
4065         (_aes_crypt): In the final loop, use ctx+round to access the
4066         subkeys, no need for an extra register.
4067
4068 2002-02-15  Niels Möller  <nisse@cuckoo.hack.org>
4069
4070         * sparc/aes.asm (_aes_crypt): Renaming variables, allocating
4071         locals starting from %l0.
4072         (_aes_crypt): Consistently use %l4, aka i, as the variable for the
4073         innermost loops.
4074         (_aes_crypt): Moved reading of ctx->nrounds out of the loop.
4075         (_aes_crypt): In final_loop, deleted a redundant mov, and use i as
4076         loop variable.
4077         (_aes_crypt): Started renumbering registers in the inner loop. The
4078         computation for the table[j] sub-expression should be kept in
4079         register %o[j].
4080         (_aes_crypt): Renamed more variables in the inner loop. Now the
4081         primary variables are t0, t1, t2, t3.
4082
4083         * sparc/aes.asm (_aes_crypt): Swapped register %i0 and %o5, %i1
4084         and %o0, %i2 and %o4, %i3 and %o3, %i4 and %o2.
4085         (_aes_crypt): wtxt was stored in both %l1 and %l2 for the entire
4086         function. Freed %l2 for other uses.
4087         (_aes_crypt): Likewise for tmp, freeing register %o1.
4088
4089         * sparc/machine.m4: New file, for sparc-specific macros.
4090
4091         * sparc/aes.asm (_aes_crypt): Hacked the source_loop, to get rid
4092         of yet another redundant loop variable, and one instruction.
4093         (_aes_crypt): Strength reduce loop variable in the
4094         inner loop, getting rid of one register.
4095         (_aes_crypt): Use pre-shifted indices (aes_table.idx_shift), to
4096         avoid some shifts in the inner loop.
4097         (_aes_crypt): Don't check for nrounds==0 at the start of the loop.
4098
4099         * asm.m4: Define and use structure-defining macros.
4100
4101         * Makefile.am (%.asm): Use a GNU pattern rule, to make %.o depend
4102         on both %.asm and asm.m4.
4103
4104         * aes-internal.h (struct aes_table): New subtable idx_shift.
4105         Updated tables in aes_encrypt.c and aes_decrypt.c.
4106
4107         * asm.m4: Use eval to compute values.
4108
4109         * sparc/aes.asm (_aes_crypt): Deleted commented out old version of
4110         the code.
4111
4112         * asm.m4: Added constants for individual rows of the aes table.
4113
4114         * aes.c (IDX0, IDX1, IDX2, IDX3): New macros, encapsualting the
4115         structure of the idx table.
4116
4117         * asm.m4: Define various aes struct offsets.
4118
4119         * testsuite/cbc-test.c (test_cbc_bulk): Use aes_set_encrypt_key
4120         and aes_set_decrypt_key.
4121
4122         * sparc/aes.asm (_aes_crypt): Use symbolic names for the fucntion
4123         arguments.
4124
4125 2002-02-14  Niels Möller  <nisse@cuckoo.hack.org>
4126
4127         * sparc/aes.asm: Copied gcc assembler code for _aes_crypt.
4128
4129         * aesdata.c: New program for generating AES-related tables.
4130
4131         * testsuite/testutils.c (print_hex): New function (moved from
4132         yarrow-test.c).
4133
4134         * testsuite/rsa-keygen-test.c (progress): Declare the ctx argument
4135         as UNUSED.
4136
4137         * testsuite/cbc-test.c (test_cbc_bulk): New function, testing CBC
4138         with larger blocks.
4139
4140         * yarrow256.c: Replaced uses of aes_set_key with
4141         aes_set_encrypt_key.
4142
4143         * nettle-meta.h (_NETTLE_CIPHER_SEP): New macro, useful for
4144         algorithms with separate encyption and decryption key setup.
4145
4146         * aes-internal.h (struct aes_table): New structure, including all
4147         constant tables needed by the unified encryption or decryption
4148         function _aes_crypt.
4149
4150         * aes.c (_aes_crypt): New function, which unifies encryption and
4151         decryption.
4152
4153         AES key setup now uses two separate functions for setting
4154         encryption and decryption keys. Applications that don't do
4155         decryption need no inverted subkeys and no code to generate them.
4156         Similarly, the tables (about 4K each for encryption and
4157         decryption), are put into separate files.
4158
4159         * aes.h (struct aes_ctx): Deleted space for inverse subkeys. For
4160         decryption, the inverse subkeys replace the normal subkeys, and
4161         they are stored _in the order they are used_.
4162
4163         * aes-set-key.c (aes_set_key): Deleted file, code moved...
4164         * aes-set-decrypt-key.c, aes-set-encrypt-key.c: New files,
4165         separated normal and inverse key setup.
4166
4167         * aes-tables.c: Deleted, tables moved elsewhere...
4168         * aes-encrypt.c, aes-decrypt.c: New files; moved encryption and
4169         decryption funktions, and needed tables, into separate files.
4170
4171 2002-02-13  Niels Möller  <nisse@cuckoo.hack.org>
4172
4173         * aes.c (aes_encrypt): Don't unroll the innerloop.
4174         (aes_encrypt): Don't unroll the loop for the final round.
4175         (aes_decrypt): Likewise, no loop unrolling.
4176
4177         * aes-set-key.c (aes_set_key): Reversed the order of the inverted
4178         subkeys. They are now stored in the same order as they are used.
4179
4180         * aes-tables.c (itable): New bigger table, generated by aesdata.c.
4181
4182         * aes.c (aes_decrypt): Rewrote to use the bigger tables.
4183
4184 2002-02-12  Niels Möller  <nisse@cuckoo.hack.org>
4185
4186         * aes.c (aes_encrypt): Interleave computation and output in the
4187         final round.
4188
4189         * aes-internal.h (AES_SMALL): New macro.
4190
4191         * aes.c (aes_encrypt): Optionally use smaller rotating inner loop.
4192
4193         * aes-tables.c (dtbl): Replaced with table generated by aesdata.
4194
4195         * aes.c (aes_encrypt): Rewrite, now uses larger tables in order to
4196         avoid rotates.
4197
4198         * sparc/aes.asm (aes_encrypt): Strength reduced on j, getting rid
4199         of one register and one instruction in the inner loop.
4200
4201         * sparc/aes.asm (idx, aes_encrypt): Multiplied tabled values by 4,
4202         making it possible to get rid of some shifts in the inner loop.
4203
4204         * configure.in: Fixed spelling of --enable-assembler. Commented
4205         out debug echo:s.
4206
4207         * asm.m4: New file. For now, only doing changequote and changecom.
4208
4209         * sparc/aes.asm (aes_encrypt): Added comments.
4210         (aes_encrypt): Cut off redundant instruction per block, also
4211         saving one redundant register pointing to idx.
4212         (idx_row): New macro. Include asm.m4.
4213
4214 2002-02-11  Niels Möller  <nisse@cuckoo.hack.org>
4215
4216         * sparc/aes.asm (key_addition_8to32): Cleaned up.
4217         Deleted gcc-generated debugging information.
4218
4219         * sparc/aes.asm (key_addition32): First attempt at optimization.
4220         Made it slower ;-)
4221
4222         * sparc/aes.asm (key_addition32): Unrolled loop, gained 4%
4223         speed, payed four instructions compared to gcc
4224         generated code.
4225
4226         * Makefile.am (.asm.o): New rule for assembling via m4.
4227         (libnettle_a_SOURCES): Added new rsa and aes files.
4228
4229         * configure.in: New command line option --enable-assembler.
4230         Selects assembler code depending on the host system.
4231
4232         * rsa-decrypt.c, rsa-encrypt.c: New files for rsa pkcs#1
4233         encryption.
4234
4235         * aes-set-key.c, aes-tables.c: New files, split off from aes.c.
4236         Tables are now not static, but use a _aes_ prefix on their names.
4237
4238         * aes-internal.h: New file.
4239
4240         * cast128-meta.c (_NETTLE_CIPHER_FIX): Use _NETTLE_CIPHER_FIX.
4241
4242         * cbc.c (cbc_decrypt_internal): New function, doing the real CBC
4243         procesing and requiring that src != dst.
4244         (cbc_decrypt): Use cbc_decrypt_internal. If src == dst, use a
4245         buffer of limited size to copy the ciphertext.
4246
4247         * nettle-internal.c (nettle_blowfish128): Fixed definition, with
4248         key size in bits.
4249
4250         * nettle-meta.h (_NETTLE_CIPHER_FIX): New macro, suitable for
4251         ciphers with a fixed key size.
4252
4253         * examples/nettle-benchmark.c (display): New function for
4254         displaying the results, including MB/s figures.
4255
4256         * sparc/aes.asm: New file. Not yet tuned in any way (it's just the
4257         code generated by gcc).
4258
4259 2002-02-11  Niels Möller  <nisse@lysator.liu.se>
4260
4261         * x86/aes.asm, x86/aes_tables.asm: New assembler implementation by
4262         Rafael Sevilla.
4263
4264 2002-02-06  Niels Möller  <nisse@cuckoo.hack.org>
4265
4266         Applied patch from Dan Egnor improving the base64 code.
4267         * base64.h (BASE64_ENCODE_LENGTH): New macro.
4268         (struct base64_ctx): New context struct, for decoding.
4269         (BASE64_DECODE_LENGTH): New macro.
4270         * base64.c (base64_decode_init): New function.
4271         (base64_decode_update): New function, replacing base64_decode.
4272         Takes a struct base64_ctx argument.
4273         * nettle-meta.h: Updated nettle_armor, and related typedefs and
4274         macros.
4275         * testsuite/testutils.c (test_armor): Updated.
4276         * configure.in: Use AC_PREREQ(2.50).
4277
4278 2002-02-01  Niels Möller  <nisse@cuckoo.hack.org>
4279
4280         * Released nettle-1.5.
4281
4282 2002-01-31  Niels Möller  <nisse@cuckoo.hack.org>
4283
4284         * acinclude.m4: Commented out gmp-related macros, they're probably
4285         not needed anymore.
4286
4287 2002-01-31  Niels Möller  <nisse@lysator.liu.se>
4288
4289         * configure.in: Added command line options --with-lib-path and
4290         --with-include-path. Use the RPATH-macros to get correct flags for
4291         linking the test programs with gmp.
4292
4293         * acinclude.m4: New file.
4294
4295 2002-01-31  Niels Möller  <nisse@cuckoo.hack.org>
4296
4297         * nettle.texinfo (Randomness): New subsection on Yarrow.
4298
4299 2002-01-30  Niels Möller  <nisse@cuckoo.hack.org>
4300
4301         * nettle.texinfo (Randomness): New chapter.
4302         Spell checking and ispell configuration.
4303
4304         * md5.c: Added reference to RFC 1321.
4305
4306 2002-01-24  Niels Möller  <nisse@cuckoo.hack.org>
4307
4308         * nettle.texinfo (Public-key algorithms): Minor fixes.
4309
4310 2002-01-22  Niels Möller  <nisse@cuckoo.hack.org>
4311
4312         * nettle.texinfo (Nettle soup): New chapter.
4313         (Hash functions): New subsection on struct nettle_hash.
4314         (Hash functions): New subsection on struct nettle_cipher.
4315         (Keyed hash functions): New section, describing MAC:s and HMAC.
4316         (Public-key algorithms): New chapter.
4317
4318         * testsuite/testutils.c (test_armor): New function.
4319
4320         * testsuite/base64-test.c: New testcase.
4321
4322         * testsuite/Makefile.am (TS_PROGS): Added base64-test.
4323
4324         * nettle-meta.h (struct nettle_armor): New struct.
4325
4326         * configure.in: Bumped version to 1.5.
4327
4328         * Makefile.am (libnettle_a_SOURCES): Added base64 files, and some
4329         missing header files.
4330
4331         * base64.c, base64.h, base64-meta.c: New files, hacked by Dan
4332         Egnor.
4333
4334 2002-01-16  Niels Möller  <nisse@cuckoo.hack.org>
4335
4336         * testsuite/yarrow-test.c: Deleted ran_array code, use
4337         knuth-lfib.h instead.
4338
4339         * testsuite/testutils.c (test_rsa_md5, test_rsa_sha1): Moved
4340         functions here...
4341         * testsuite/rsa-test.c: ...from here.
4342
4343         * testsuite/rsa-keygen-test.c: New file.
4344
4345         * testsuite/knuth-lfib-test.c: New file.
4346
4347         * Makefile.am (libnettle_a_SOURCES): Added knuth-lfib.c and
4348         rsa-keygen.c.
4349
4350         * rsa-keygen.c: New file.
4351
4352         * rsa.h (RSA_MINIMUM_N_OCTETS): New constant.
4353         (RSA_MINIMUM_N_BITS): New constant.
4354         (nettle_random_func, nettle_progress_func): New typedefs. Perhaps
4355         they don't really belong in this file.
4356         (rsa_generate_keypair): Added progress-callback argument.
4357
4358         * macros.h (READ_UINT24, WRITE_UINT24, READ_UINT16, WRITE_UINT16):
4359         New macros.
4360
4361         * knuth-lfib.c, knuth-lfib.h: New files, implementing a
4362         non-cryptographic prng.
4363
4364 2002-01-15  Niels Möller  <nisse@cuckoo.hack.org>
4365
4366         * hmac-sha1.c: New file.
4367
4368 2002-01-14  Niels Möller  <nisse@cuckoo.hack.org>
4369
4370         * configure.in: Bumped version to 1.1.
4371
4372         * testsuite/hmac-test.c (test_main): Added hmac-sha1 test cases.
4373
4374         * rsa.c (rsa_init_private_key, rsa_clear_private_key): Handle d.
4375
4376         * rsa.h (struct rsa_private_key): Reintroduced d attribute, to be
4377         used only for key generation output.
4378         (rsa_generate_keypair): Wrote a prototype.
4379
4380         * Makefile.am (libnettle_a_SOURCES): Added hmac-sha1.c and
4381         nettle-internal.h.
4382
4383         * des.c: Use static const for all tables.
4384         (des_set_key): Use a new const * variable for the parity
4385         procesing, for constness reasons.
4386
4387         * list-obj-sizes.awk: New file.
4388
4389         * nettle-internal.c, nettle-internal.h: New files.
4390
4391         * testsuite/Makefile.am (TS_PROGS): Added hmac-test. Deleted old
4392         m4-stuff.
4393
4394         * testsuite/testutils.h (LDATA): Moved this macro here,...
4395         * testsuite/rsa-test.c: ... from here.
4396
4397         * testsuite/hmac-test.c: New file.
4398
4399         * hmac.h: General cleanup. Added declarations of hmac-md5,
4400         hmac-sha1 and hmac-sha256.
4401
4402         * hmac.c: Bug fixes.
4403
4404         * hmac-md5.c: First working version.
4405
4406         * Makefile.am (libnettle_a_SOURCES): Added hmac.c and hmac-md5.c.
4407         (libnettleinclude_HEADERS): Added hmac.h.
4408
4409         * testsuite/rsa-test.c: Also test a 777-bit key.
4410
4411         * rsa.c (rsa_check_size): Changed argument to an mpz_t. Updated
4412         callers.
4413         (rsa_prepare_private_key): Compute the size of the key by
4414         computing n = p * q.
4415
4416         * rsa-compat.c: Adapted to new private key struct.
4417         * rsa_md5.c: Likesize.
4418         * rsa_sha1.c: Likesize.
4419
4420         * rsa.c (rsa_check_size): New function, for computing and checking
4421         the size of the modulo in octets.
4422         (rsa_prepare_public_key): Usa rsa_check_size.
4423         (rsa_init_private_key): Removed code handling n, e and d.
4424         (rsa_clear_private_key): Likewise.
4425         (rsa_compute_root): Always use CRT.
4426
4427         * rsa.h (struct rsa_private_key): Deleted public key and d from
4428         the struct, as they are not needed. Added size attribute.
4429
4430 2002-01-12  Niels Möller  <nisse@cuckoo.hack.org>
4431
4432         * Makefile.am: Added *-meta files.
4433
4434         * rsa.c (rsa_init_public_key): New function.
4435         (rsa_clear_public_key): Likewise.
4436         (rsa_init_private_key): Likewise.
4437         (rsa_clear_private_key): Likewise.
4438
4439         * aes-meta.c: New file.
4440         * arcfour-meta.c: New file.
4441         * cast128-meta.c: New file.
4442         * serpent-meta.c: New file.
4443         * twofish-meta.c: New file.
4444
4445         * examples/nettle-benchmark.c: Use the interface in nettle-meta.h.
4446
4447 2002-01-11  Niels Möller  <nisse@cuckoo.hack.org>
4448
4449         Don't use m4 for generating test programs, it's way overkill. Use
4450         the C preprocessor instead.
4451         * testsuite/*-test.c: New file.
4452
4453         * hmac.c, hmac.h, hmac-md5.c: New files.
4454
4455         Defined structures describing the algoriths. Useful for code that
4456         wants to treat an algorithm as a black box.
4457         * nettle-meta.h, md5-meta.c, sha1-meta.c, sha256-meta.c: New
4458         files.
4459
4460 2002-01-09  Niels Möller  <nisse@cuckoo.hack.org>
4461
4462         * rsa-compat.c: Updated for new md5 and rsa conventions.
4463
4464         * rsa_md5.c: Represent a signature as an mpz_t, not a string.
4465         Updated calls of md5 functions.
4466         * rsa_sha1.c: Likewise.
4467
4468         * rsa.c (rsa_prepare_public_key): Renamed function, was
4469         rsa_init_public_key.
4470         (rsa_prepare_private_key): Renamed function, was
4471         rsa_init_private_key.
4472
4473         * nettle.texinfo (Hash functions): Update for the changed
4474         interface without *_final. Document sha256.
4475
4476         * testsuite/md5-test.m4, testsuite/sha1-test.m4,
4477         testsuite/sha256-test.m4, testsuite/yarrow-test.c: Updated for new
4478         hash function interface.
4479
4480         * yarrow256.c: Removed calls of sha256_final and and some calls of
4481         sha256_init.
4482
4483         * md5-compat.c (MD5Final): Call only md5_digest.
4484
4485         * md5.c (md5_digest): Call md5_final and md5_init.
4486         (md5_final): Declared static.
4487         sha1.c, sha256.c: Analogous changes.
4488
4489         * bignum.c (nettle_mpz_get_str_256): Declare the input argument
4490         const.
4491
4492 2001-12-14  Niels Möller  <nisse@cuckoo.hack.org>
4493
4494         * Makefile.am (EXTRA_DIST): Added $(des_headers). Changed
4495         dependencies for $(des_headers) to depend only on the source file
4496         desdata.c, not on the executable.
4497
4498 2001-12-12  Niels Möller  <nisse@cuckoo.hack.org>
4499
4500         * testsuite/yarrow-test.c (main): Updated testcase to match fixed
4501         generator. Send verbose output to stdout, not stderr.
4502
4503         * yarrow256.c (yarrow_slow_reseed): Bug fix, update the fast pool
4504         with the digest of the slow pool.
4505         (yarrow256_init): Initialize seed_file and counter to zero, to
4506         ease debugging.
4507
4508 2001-12-07  Niels Möller  <nisse@cuckoo.hack.org>
4509
4510         * bignum.c (nettle_mpz_get_str_256): Fixed handling of leading
4511         zeroes.
4512
4513 2001-12-05  Niels Möller  <nisse@cuckoo.hack.org>
4514
4515         * testsuite/yarrow-test.c (main): Updated test to match the fixed
4516         key event estimator.
4517
4518         * yarrow_key_event.c (yarrow_key_event_estimate): Fixed handling
4519         of timing info.
4520
4521         * nettle.texinfo (Copyright): Say that under certain
4522         circumstances, Nettle can be used as if under the LGPL.
4523
4524         * README: Added a paragraph on copyright.
4525
4526 2001-11-15  Niels Möller  <nisse@cuckoo.hack.org>
4527
4528         * yarrow256.c (yarrow256_force_reseed): New function.
4529
4530 2001-11-14  Niels Möller  <nisse@ehand.com>
4531
4532         * testsuite/yarrow-test.c (main): Use yarrow256_is_seeded.
4533
4534         * yarrow256.c (yarrow256_needed_sources): New function.
4535         (yarrow256_is_seeded): New function.
4536         (yarrow256_update): Use yarrow256_needed_sources.
4537
4538 2001-11-14  Niels Möller  <nisse@cuckoo.hack.org>
4539
4540         * testsuite/yarrow-test.out: Updated, to match the seed-file aware
4541         generator.
4542
4543         * testsuite/yarrow-test.c: Updated expected_output. Check the seed
4544         file contents at the end.
4545
4546         * yarrow256.c (yarrow256_seed): New function.
4547         (yarrow_fast_reseed): Create new seed file contents.
4548
4549 2001-11-13  Niels Möller  <nisse@cuckoo.hack.org>
4550
4551         * yarrow.h: Deleted yarrow160 declarations.
4552
4553 2001-11-02  Niels Möller  <nisse@ehand.com>
4554
4555         * yarrow256.c (yarrow256_init): Fixed order of code and
4556         declarations.
4557
4558 2001-10-30  Niels Möller  <nisse@ehand.com>
4559
4560         * rsa-compat.h: Added real prototypes and declarations.
4561
4562         * Makefile.am (libnettle_a_SOURCES): Added rsa-compat.h and
4563         rsa-compat.c.
4564
4565         * rsa-compat.c: New file, implementing RSA ref signature and
4566         verification functions.
4567
4568         * configure.in: Check for libgmp. Deleted tests for SIZEOF_INT and
4569         friends.
4570
4571         * rsa_sha1.c: New file, PKCS#1 rsa-sha1 signatures.
4572         * rsa_md5.c: New file, PKCS#1 rsa-md5 signatures.
4573
4574         * rsa.c: New file with general rsa functions.
4575
4576         * Makefile.am (libnettle_a_SOURCES): Added rsa and bignum files.
4577
4578         * bignum.c, bignum.h: New file, with base256 functions missing in
4579         gmp.
4580
4581         * testsuite/Makefile.am: Added bignum-test.
4582
4583         * testsuite/run-tests (test_program): Check the xit code more
4584         carefully, and treat 77 as skip. This convention was borrowed from
4585         autotest.
4586
4587         * testsuite/macros.m4: New macro SKIP which exits with code 77.
4588
4589         * testsuite/bignum-test.m4: New file.
4590
4591 2001-10-15  Niels Möller  <nisse@ehand.com>
4592
4593         * testsuite/Makefile.am (EXTRA_DIST): Include rfc1750.txt in the
4594         distribution.
4595
4596 2001-10-14  Niels Möller  <nisse@cuckoo.hack.org>
4597
4598         * testsuite/des-test.m4: Added testcase taken from applied
4599         cryptography.
4600
4601         * testsuite/yarrow-test.c: Use sha256 instead of sha1 for checking
4602         input and output. Updated the expected values.
4603
4604         * yarrow256.c (YARROW_RESEED_ITERATIONS): New constant.
4605         (yarrow_iterate): New function.
4606         (yarrow_fast_reseed): Call yarrow_iterate.
4607
4608         * testsuite/yarrow-test.c: Added verbose flag, disabled by
4609         default.
4610
4611 2001-10-12  Niels Möller  <nisse@ehand.com>
4612
4613         * examples/nettle-benchmark.c: Added more ciphers.
4614
4615         * Makefile.am (SUBDIRS): Added the examples subdir.
4616
4617         * configure.in: Output examples/Makefile.
4618
4619 2001-10-12  Niels Möller  <nisse@cuckoo.hack.org>
4620
4621         * examples/nettle-benchmark.c: New benchmarking program.
4622
4623 2001-10-10  Niels Möller  <nisse@ehand.com>
4624
4625         * testsuite/yarrow-test.c: Open rfc1750.txt. Hash input and
4626         output, and compare to expected values.
4627
4628         * testsuite/Makefile.am (CFLAGS): Don't disable optimization.
4629         (run-tests): Set srcdir in the environment when running run-tests.
4630
4631         * testsuite/rfc1750.txt: Added this rfc as test input for yarrow.
4632
4633         * yarrow_key_event.c (yarrow_key_event_estimate): Check if
4634         previous is zero.
4635         (yarrow_key_event_init): Initialize previous to zero.
4636
4637         * yarrow256.c: Added debug some output.
4638
4639         * testsuite/yarrow-test.c (main): Better output of entropy
4640         estimates at the end.
4641
4642 2001-10-09  Niels Möller  <nisse@ehand.com>
4643
4644         * testsuite/Makefile.am (TS_PROGS): Added yarrow-test.
4645
4646         * testsuite/yarrow-test.c: New file.
4647
4648         * yarrow256.c (yarrow256_init): Initialize the sources.
4649         (yarrow256_random): Fixed loop condition.
4650
4651         * yarrow.h (YARROW_KEY_EVENT_BUFFER): New constant.
4652
4653         * yarrow_key_event.c: New file.
4654
4655         * Makefile.am (libnettle_a_SOURCES): Added yarrow_key_event.c.
4656
4657 2001-10-08  Niels Möller  <nisse@cuckoo.hack.org>
4658
4659         * yarrow.h (struct yarrow_key_event_ctx): New struct.
4660
4661         * yarrow256.c (yarrow_fast_reseed): Generate two block of output
4662         using the old key and feed into the pool.
4663
4664         * yarrow.h (struct yarrow256_ctx): Deleted buffer, index and
4665         block_count.
4666
4667         * yarrow256.c (yarrow_fast_reseed): New function.
4668         (yarrow_slow_reseed): New function.
4669         (yarrow256_update): Check seed/reseed thresholds.
4670         (yarrow_gate): New function, extracted from
4671         yarrow_generate_block_with_gate which was deleted.
4672         (yarrow_generate_block_with_gate): Deleted function.
4673         (yarrow256_random): Don't buffer any output, instead gate after
4674         each request.
4675         (YARROW_GATE_THRESHOLD): Deleted constant.
4676
4677 2001-10-07  Niels Möller  <nisse@cuckoo.hack.org>
4678
4679         * Makefile.am: Added yarrow files.
4680
4681         * yarrow256.c: New file, implementing Yarrow. Work in progress.
4682
4683         * sha256.c: New file, implementing sha256.
4684
4685         * testsuite/Makefile.am (CFLAGS): Added sha256-test.
4686
4687         * testsuite/sha256-test.m4: New testcases for sha256.
4688
4689         * shadata.c: New file, for generating sha256 constants.
4690
4691         * sha.h: Renamed sha1.h to sha.h, and added declarations for
4692         sha256.
4693
4694 2001-10-05  Niels Möller  <nisse@ehand.com>
4695
4696         * testsuite/aes-test.m4: Added a comment with NIST test vectors.
4697
4698 2001-10-04  Niels Möller  <nisse@ehand.com>
4699
4700         * rsa.h, rsa-compat.h, yarrow.h: New files.
4701
4702 2001-09-25  Niels Möller  <nisse@cuckoo.hack.org>
4703
4704         * Released version 1.0.
4705
4706 2001-09-25  Niels Möller  <nisse@ehand.com>
4707
4708         * sha1.c: Include stdlib.h, for abort.
4709
4710         * md5.c: Include string.h, for memcpy.
4711
4712         * testsuite/Makefile.am (M4_FILES): New variable. Explicitly list
4713         those C source files that should be generated by m4.
4714
4715         * configure.in: Changed package name from "libnettle" to "nettle".
4716
4717         * Makefile.am (EXTRA_DIST): Added .bootstrap.
4718
4719         * AUTHORS: Added a reference to the manual.
4720
4721 2001-09-25  Niels Möller  <nisse@lysator.liu.se>
4722
4723         * des-compat.c (des_cbc_cksum): Bug fix, local variable was
4724         declared in the middle of a block.
4725
4726 2001-09-19  Niels Möller  <nisse@cuckoo.hack.org>
4727
4728         * nettle.texinfo (Compatibility functions): New section,
4729         mentioning md5-compat.h and des-compat.h.
4730
4731 2001-09-18  Niels Möller  <nisse@ehand.com>
4732
4733         * index.html: New file.
4734
4735 2001-09-16  Niels Möller  <nisse@cuckoo.hack.org>
4736
4737         * nettle.texinfo: Added description of des3. Minor fixes.
4738
4739         * testsuite/des-compat-test.c (cbc_data): Shorten to 32 bytes (4
4740         blocks), the last block of zeroes wasn't used anyway.
4741
4742         * des-compat.c (des_compat_des3_decrypt): Decrypt in the right
4743         order.
4744         (des_ncbc_encrypt): Bug fixed.
4745         (des_cbc_encrypt): Rewritten as a wrapper around des_ncbc_encrypt.
4746
4747 2001-09-14  Niels Möller  <nisse@ehand.com>
4748
4749         * testsuite/des-compat-test.c: New file, copied from libdes
4750         (freeswan). All implemented functions but des_cbc_cksum seems to
4751         work now.
4752
4753         * testsuite/Makefile.am (TS_PROGS): Added des-compat-test.
4754
4755         * des-compat.c: Added libdes typedef:s. Had to remove all use of
4756         const in the process.
4757         (des_check_key): New global variable, checked by des_set_key.
4758
4759         * des.c (des_set_key): Go on and expand the key even if it is
4760         weak.
4761
4762         * des-compat.c (des_cbc_cksum): Implemented.
4763         (des_key_sched): Fixed return values.
4764
4765 2001-09-11  Niels Möller  <nisse@cuckoo.hack.org>
4766
4767         * Makefile.am: Added des-compat.c and des-compat.h
4768
4769         * des-compat.c: Bugfixes, more functions implemented.
4770
4771         * des-compat.h: Define DES_ENCRYPT and DES_DECRYPT. Bugfixes.
4772
4773 2001-09-10  Niels Möller  <nisse@ehand.com>
4774
4775         * nettle.texinfo (Copyright): Added copyright information for
4776         serpent.
4777         (Miscellaneous functions): Started writing documentation on the CBC
4778         functions.
4779         (Cipher Block Chaining): This section more or less complete now.
4780
4781 2001-09-09  Niels Möller  <nisse@cuckoo.hack.org>
4782
4783         * testsuite/cbc-test.m4: Record intermediate values in a comment.
4784         * testsuite/des3-test.m4: Likewise.
4785
4786         * testsuite/aes-test.m4: Added test case that appeared broken in
4787         the cbc test.
4788
4789         * cbc.c (cbc_encrypt): Bug fix, encrypt block *after* XOR:ing the
4790         iv.
4791
4792         * Makefile.am (libnettleinclude_HEADERS): Added cbc.h. Deleted
4793         des3.h.
4794         (libnettle_a_SOURCES): Added des3.c.
4795
4796         * testsuite/Makefile.am (TS_PROGS): Added des3-test and cbc-test.
4797
4798         * testsuite/cbc-test.m4: New testcase.
4799
4800         * testsuite/des3-test.m4: New testcase.
4801
4802         * cbc.h (CBC_CTX): New macro.
4803         (CBC_ENCRYPT): New macro.
4804         (CBC_DECRYPT): New macro.
4805
4806         * des.c (des_fix_parity): New function.
4807
4808         * des3.c: New file, implementing triple des.
4809
4810 2001-09-06  Niels Möller  <nisse@cuckoo.hack.org>
4811
4812         * cbc.c, cbc.h: New files, for general CBC encryption.
4813
4814         * des-compat.h: Added some prototypes.
4815
4816 2001-09-05  Niels Möller  <nisse@ehand.com>
4817
4818         * testsuite/Makefile.am (TS_PROGS): Added md5-compat-test.
4819
4820         * README: Copied introduction from the manual.
4821
4822         * configure.in: Bumped version to 1.0.
4823
4824         * Makefile.am (libnettleinclude_HEADERS): Added missing includes.
4825         (libnettle_a_SOURCES): Added md5-compat.c and md5-compat.h.
4826
4827         * md5-compat.c, md5-compat.h: New files, implementing an RFC
4828         1321-style interface.
4829
4830 2001-09-02  Niels Möller  <nisse@cuckoo.hack.org>
4831
4832         * twofish.c (twofish_decrypt): Fixed for();-bug in the block-loop.
4833         Spotted by Jean-Pierre.
4834         (twofish_encrypt): Likewise.
4835
4836 2001-07-03  Niels Möller  <nisse@ehand.com>
4837
4838         * testsuite/testutils.c: Include string.h.
4839
4840         * twofish.c: Include string.h.
4841
4842 2001-06-17  Niels Möller  <nisse@lysator.liu.se>
4843
4844         * Makefile.am (des_headers): Dont use $(srcdir)/-prefixes as that
4845         seems to break with GNU make 3.79.1.
4846
4847         * testsuite/testutils.c, testsuite/testutils.h: Use <inttypes.h>,
4848         not <stdint.h>.
4849         Include <stdlib.h>.
4850
4851 2001-06-17  Niels Möller  <nisse@cuckoo.hack.org>
4852
4853         * Use <inttypes.h>, not <stdint.h>.
4854
4855         * blowfish.h (BLOWFISH_MAX_KEY_SIZE): Fixed, should be 56.
4856
4857         * Fixed copyright notices.
4858
4859         * Makefile.am (libnettle_a_SOURCES): Added desinfo.h and
4860         desCode.h.
4861         (info_TEXINFOS): Added manual.
4862         (EXTRA_DIST): Added nettle.html.
4863         (%.html): Added rule for building nettle.html.
4864
4865         * nettle.texinfo: New manual.
4866
4867         * configure.in: Bumped version to 0.2.
4868
4869         * testsuite/Makefile.am (TS_PROGS): Added cast128 test.
4870
4871         * Added CAST128.
4872
4873         * testsuite/serpent-test.m4: Added a few rudimentary tests
4874         extracted from the serpent package.
4875
4876         * twofish.c: Adapted to nettle. Made constant tables const.
4877         Deleted bytes_to_word and word_to_bytes; use LE_READ_UINT32 and
4878         LE_WRITE_UINT32 instead.
4879         (twofish_selftest): Deleted. Moved the tests to the external
4880         testsuite.
4881         (twofish_set_key): Don't silently truncate too large keys.
4882
4883         * sha1.c (sha1_update): Use unsigned for length.
4884
4885         * serpent.c (serpent_set_key): Read the key backwards. Fixed
4886         padding (but there are no test vectors for key_size not a multiple
4887         of 4).
4888         (serpent_encrypt): Read and write data in the strange order used
4889         by the reference implementation.
4890         (serpent_decrypt): Likewise.
4891
4892         * macros.h (FOR_BLOCKS): New macro, taken from lsh.
4893
4894         * blowfish.h (struct blowfish_ctx): Use a two-dimensional array
4895         for s.
4896
4897         * blowfish.c (initial_ctx): Arrange constants into a struct, to
4898         simplify key setup.
4899         (F): Deleted all but one definitions of the F function/macro.
4900         Added a context argument, and use that to find the subkeys.
4901         (R): Added context argument, and use that to find the subkeys.
4902         (blowfish_set_key): Some simplification.
4903
4904         (encrypt): Deleted code for non-standard number of rounds. Deleted
4905         a bunch of local variables. Using the context pointer for
4906         everything should consume less registers.
4907         (decrypt): Likewise.
4908
4909         * Makefile.am (libnettle_a_SOURCES): Added twofish.
4910
4911 2001-06-16  Niels Möller  <nisse@cuckoo.hack.org>
4912
4913         * testsuite/blowfish-test.m4: Fixed test.
4914
4915         * Added twofish implementation.
4916
4917         * blowfish.h (struct blowfish_ctx): Use the correct size for the p
4918         array.
4919
4920 2001-06-15  Niels Möller  <nisse@ehand.com>
4921
4922         * testsuite/blowfish-test.m4: Fixed testcase, use correct key
4923         length.
4924
4925         * Makefile.am (libnettle_a_SOURCES): Added blowfish files.
4926         ($(des_headers)): Strip directory part when passing file name to
4927         desdata.
4928
4929         * testsuite/blowfish-test.m4: Added one test, from GNUPG.
4930
4931         * Created blowfish.c and blowfish.h (from GNUPG via LSH). Needs
4932         more work.
4933
4934         * aes.h: Fixed copyright notice to not mention GNU MP. XXX: Review
4935         all nettle copyrights.
4936
4937         * testsuite/Makefile.am (TS_PROGS): Added tests for twofish and
4938         blowfish.
4939
4940 2001-06-13  Niels Möller  <nisse@ehand.com>
4941
4942         * Makefile.am (libnettle_a_SOURCES): Added serpent files.
4943
4944 2001-06-12  Niels Möller  <nisse@cuckoo.hack.org>
4945
4946         * des.c (des_encrypt, des_decrypt): Assert that the key setup was
4947         successful.
4948
4949         * testsuite/Makefile.am (TS_PROGS): Added tests for des and sha1.
4950
4951         * testsuite/sha1-test.m4: New file.
4952
4953         * testsuite/des-test.m4: New file.
4954
4955         * Added sha1 files.
4956
4957         * Added desCore files.
4958
4959         * Makefile.am: Added desCore and sha1.
4960
4961 2001-04-17  Niels Möller  <nisse@cuckoo.hack.org>
4962
4963         * install-sh: Copied the standard install script.
4964
4965         * testsuite/Makefile.am (CFLAGS): Disable optimization. Add
4966         $(top_srcdir) to the include path.
4967         (EXTRA_DIST): Added testutils.h, testutils.c and run-tests.
4968         (run-tests): Fixed path to run-tests.
4969
4970         * Makefile.am (EXTRA_DIST): Added memxor.h.
4971         (libnettleinclude_HEADERS): Install headers in
4972         $(libnettleincludedir).
4973
4974 2001-04-13  Niels Möller  <nisse@cuckoo.hack.org>
4975
4976         * Initial checkin.