File: ChangeLog

package info (click to toggle)
nettle 3.5.1+really3.4.1-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 8,012 kB
  • sloc: ansic: 51,527; asm: 12,157; sh: 3,632; makefile: 846; cpp: 71; awk: 7
file content (11081 lines) | stat: -rw-r--r-- 376,038 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
4027
4028
4029
4030
4031
4032
4033
4034
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
4065
4066
4067
4068
4069
4070
4071
4072
4073
4074
4075
4076
4077
4078
4079
4080
4081
4082
4083
4084
4085
4086
4087
4088
4089
4090
4091
4092
4093
4094
4095
4096
4097
4098
4099
4100
4101
4102
4103
4104
4105
4106
4107
4108
4109
4110
4111
4112
4113
4114
4115
4116
4117
4118
4119
4120
4121
4122
4123
4124
4125
4126
4127
4128
4129
4130
4131
4132
4133
4134
4135
4136
4137
4138
4139
4140
4141
4142
4143
4144
4145
4146
4147
4148
4149
4150
4151
4152
4153
4154
4155
4156
4157
4158
4159
4160
4161
4162
4163
4164
4165
4166
4167
4168
4169
4170
4171
4172
4173
4174
4175
4176
4177
4178
4179
4180
4181
4182
4183
4184
4185
4186
4187
4188
4189
4190
4191
4192
4193
4194
4195
4196
4197
4198
4199
4200
4201
4202
4203
4204
4205
4206
4207
4208
4209
4210
4211
4212
4213
4214
4215
4216
4217
4218
4219
4220
4221
4222
4223
4224
4225
4226
4227
4228
4229
4230
4231
4232
4233
4234
4235
4236
4237
4238
4239
4240
4241
4242
4243
4244
4245
4246
4247
4248
4249
4250
4251
4252
4253
4254
4255
4256
4257
4258
4259
4260
4261
4262
4263
4264
4265
4266
4267
4268
4269
4270
4271
4272
4273
4274
4275
4276
4277
4278
4279
4280
4281
4282
4283
4284
4285
4286
4287
4288
4289
4290
4291
4292
4293
4294
4295
4296
4297
4298
4299
4300
4301
4302
4303
4304
4305
4306
4307
4308
4309
4310
4311
4312
4313
4314
4315
4316
4317
4318
4319
4320
4321
4322
4323
4324
4325
4326
4327
4328
4329
4330
4331
4332
4333
4334
4335
4336
4337
4338
4339
4340
4341
4342
4343
4344
4345
4346
4347
4348
4349
4350
4351
4352
4353
4354
4355
4356
4357
4358
4359
4360
4361
4362
4363
4364
4365
4366
4367
4368
4369
4370
4371
4372
4373
4374
4375
4376
4377
4378
4379
4380
4381
4382
4383
4384
4385
4386
4387
4388
4389
4390
4391
4392
4393
4394
4395
4396
4397
4398
4399
4400
4401
4402
4403
4404
4405
4406
4407
4408
4409
4410
4411
4412
4413
4414
4415
4416
4417
4418
4419
4420
4421
4422
4423
4424
4425
4426
4427
4428
4429
4430
4431
4432
4433
4434
4435
4436
4437
4438
4439
4440
4441
4442
4443
4444
4445
4446
4447
4448
4449
4450
4451
4452
4453
4454
4455
4456
4457
4458
4459
4460
4461
4462
4463
4464
4465
4466
4467
4468
4469
4470
4471
4472
4473
4474
4475
4476
4477
4478
4479
4480
4481
4482
4483
4484
4485
4486
4487
4488
4489
4490
4491
4492
4493
4494
4495
4496
4497
4498
4499
4500
4501
4502
4503
4504
4505
4506
4507
4508
4509
4510
4511
4512
4513
4514
4515
4516
4517
4518
4519
4520
4521
4522
4523
4524
4525
4526
4527
4528
4529
4530
4531
4532
4533
4534
4535
4536
4537
4538
4539
4540
4541
4542
4543
4544
4545
4546
4547
4548
4549
4550
4551
4552
4553
4554
4555
4556
4557
4558
4559
4560
4561
4562
4563
4564
4565
4566
4567
4568
4569
4570
4571
4572
4573
4574
4575
4576
4577
4578
4579
4580
4581
4582
4583
4584
4585
4586
4587
4588
4589
4590
4591
4592
4593
4594
4595
4596
4597
4598
4599
4600
4601
4602
4603
4604
4605
4606
4607
4608
4609
4610
4611
4612
4613
4614
4615
4616
4617
4618
4619
4620
4621
4622
4623
4624
4625
4626
4627
4628
4629
4630
4631
4632
4633
4634
4635
4636
4637
4638
4639
4640
4641
4642
4643
4644
4645
4646
4647
4648
4649
4650
4651
4652
4653
4654
4655
4656
4657
4658
4659
4660
4661
4662
4663
4664
4665
4666
4667
4668
4669
4670
4671
4672
4673
4674
4675
4676
4677
4678
4679
4680
4681
4682
4683
4684
4685
4686
4687
4688
4689
4690
4691
4692
4693
4694
4695
4696
4697
4698
4699
4700
4701
4702
4703
4704
4705
4706
4707
4708
4709
4710
4711
4712
4713
4714
4715
4716
4717
4718
4719
4720
4721
4722
4723
4724
4725
4726
4727
4728
4729
4730
4731
4732
4733
4734
4735
4736
4737
4738
4739
4740
4741
4742
4743
4744
4745
4746
4747
4748
4749
4750
4751
4752
4753
4754
4755
4756
4757
4758
4759
4760
4761
4762
4763
4764
4765
4766
4767
4768
4769
4770
4771
4772
4773
4774
4775
4776
4777
4778
4779
4780
4781
4782
4783
4784
4785
4786
4787
4788
4789
4790
4791
4792
4793
4794
4795
4796
4797
4798
4799
4800
4801
4802
4803
4804
4805
4806
4807
4808
4809
4810
4811
4812
4813
4814
4815
4816
4817
4818
4819
4820
4821
4822
4823
4824
4825
4826
4827
4828
4829
4830
4831
4832
4833
4834
4835
4836
4837
4838
4839
4840
4841
4842
4843
4844
4845
4846
4847
4848
4849
4850
4851
4852
4853
4854
4855
4856
4857
4858
4859
4860
4861
4862
4863
4864
4865
4866
4867
4868
4869
4870
4871
4872
4873
4874
4875
4876
4877
4878
4879
4880
4881
4882
4883
4884
4885
4886
4887
4888
4889
4890
4891
4892
4893
4894
4895
4896
4897
4898
4899
4900
4901
4902
4903
4904
4905
4906
4907
4908
4909
4910
4911
4912
4913
4914
4915
4916
4917
4918
4919
4920
4921
4922
4923
4924
4925
4926
4927
4928
4929
4930
4931
4932
4933
4934
4935
4936
4937
4938
4939
4940
4941
4942
4943
4944
4945
4946
4947
4948
4949
4950
4951
4952
4953
4954
4955
4956
4957
4958
4959
4960
4961
4962
4963
4964
4965
4966
4967
4968
4969
4970
4971
4972
4973
4974
4975
4976
4977
4978
4979
4980
4981
4982
4983
4984
4985
4986
4987
4988
4989
4990
4991
4992
4993
4994
4995
4996
4997
4998
4999
5000
5001
5002
5003
5004
5005
5006
5007
5008
5009
5010
5011
5012
5013
5014
5015
5016
5017
5018
5019
5020
5021
5022
5023
5024
5025
5026
5027
5028
5029
5030
5031
5032
5033
5034
5035
5036
5037
5038
5039
5040
5041
5042
5043
5044
5045
5046
5047
5048
5049
5050
5051
5052
5053
5054
5055
5056
5057
5058
5059
5060
5061
5062
5063
5064
5065
5066
5067
5068
5069
5070
5071
5072
5073
5074
5075
5076
5077
5078
5079
5080
5081
5082
5083
5084
5085
5086
5087
5088
5089
5090
5091
5092
5093
5094
5095
5096
5097
5098
5099
5100
5101
5102
5103
5104
5105
5106
5107
5108
5109
5110
5111
5112
5113
5114
5115
5116
5117
5118
5119
5120
5121
5122
5123
5124
5125
5126
5127
5128
5129
5130
5131
5132
5133
5134
5135
5136
5137
5138
5139
5140
5141
5142
5143
5144
5145
5146
5147
5148
5149
5150
5151
5152
5153
5154
5155
5156
5157
5158
5159
5160
5161
5162
5163
5164
5165
5166
5167
5168
5169
5170
5171
5172
5173
5174
5175
5176
5177
5178
5179
5180
5181
5182
5183
5184
5185
5186
5187
5188
5189
5190
5191
5192
5193
5194
5195
5196
5197
5198
5199
5200
5201
5202
5203
5204
5205
5206
5207
5208
5209
5210
5211
5212
5213
5214
5215
5216
5217
5218
5219
5220
5221
5222
5223
5224
5225
5226
5227
5228
5229
5230
5231
5232
5233
5234
5235
5236
5237
5238
5239
5240
5241
5242
5243
5244
5245
5246
5247
5248
5249
5250
5251
5252
5253
5254
5255
5256
5257
5258
5259
5260
5261
5262
5263
5264
5265
5266
5267
5268
5269
5270
5271
5272
5273
5274
5275
5276
5277
5278
5279
5280
5281
5282
5283
5284
5285
5286
5287
5288
5289
5290
5291
5292
5293
5294
5295
5296
5297
5298
5299
5300
5301
5302
5303
5304
5305
5306
5307
5308
5309
5310
5311
5312
5313
5314
5315
5316
5317
5318
5319
5320
5321
5322
5323
5324
5325
5326
5327
5328
5329
5330
5331
5332
5333
5334
5335
5336
5337
5338
5339
5340
5341
5342
5343
5344
5345
5346
5347
5348
5349
5350
5351
5352
5353
5354
5355
5356
5357
5358
5359
5360
5361
5362
5363
5364
5365
5366
5367
5368
5369
5370
5371
5372
5373
5374
5375
5376
5377
5378
5379
5380
5381
5382
5383
5384
5385
5386
5387
5388
5389
5390
5391
5392
5393
5394
5395
5396
5397
5398
5399
5400
5401
5402
5403
5404
5405
5406
5407
5408
5409
5410
5411
5412
5413
5414
5415
5416
5417
5418
5419
5420
5421
5422
5423
5424
5425
5426
5427
5428
5429
5430
5431
5432
5433
5434
5435
5436
5437
5438
5439
5440
5441
5442
5443
5444
5445
5446
5447
5448
5449
5450
5451
5452
5453
5454
5455
5456
5457
5458
5459
5460
5461
5462
5463
5464
5465
5466
5467
5468
5469
5470
5471
5472
5473
5474
5475
5476
5477
5478
5479
5480
5481
5482
5483
5484
5485
5486
5487
5488
5489
5490
5491
5492
5493
5494
5495
5496
5497
5498
5499
5500
5501
5502
5503
5504
5505
5506
5507
5508
5509
5510
5511
5512
5513
5514
5515
5516
5517
5518
5519
5520
5521
5522
5523
5524
5525
5526
5527
5528
5529
5530
5531
5532
5533
5534
5535
5536
5537
5538
5539
5540
5541
5542
5543
5544
5545
5546
5547
5548
5549
5550
5551
5552
5553
5554
5555
5556
5557
5558
5559
5560
5561
5562
5563
5564
5565
5566
5567
5568
5569
5570
5571
5572
5573
5574
5575
5576
5577
5578
5579
5580
5581
5582
5583
5584
5585
5586
5587
5588
5589
5590
5591
5592
5593
5594
5595
5596
5597
5598
5599
5600
5601
5602
5603
5604
5605
5606
5607
5608
5609
5610
5611
5612
5613
5614
5615
5616
5617
5618
5619
5620
5621
5622
5623
5624
5625
5626
5627
5628
5629
5630
5631
5632
5633
5634
5635
5636
5637
5638
5639
5640
5641
5642
5643
5644
5645
5646
5647
5648
5649
5650
5651
5652
5653
5654
5655
5656
5657
5658
5659
5660
5661
5662
5663
5664
5665
5666
5667
5668
5669
5670
5671
5672
5673
5674
5675
5676
5677
5678
5679
5680
5681
5682
5683
5684
5685
5686
5687
5688
5689
5690
5691
5692
5693
5694
5695
5696
5697
5698
5699
5700
5701
5702
5703
5704
5705
5706
5707
5708
5709
5710
5711
5712
5713
5714
5715
5716
5717
5718
5719
5720
5721
5722
5723
5724
5725
5726
5727
5728
5729
5730
5731
5732
5733
5734
5735
5736
5737
5738
5739
5740
5741
5742
5743
5744
5745
5746
5747
5748
5749
5750
5751
5752
5753
5754
5755
5756
5757
5758
5759
5760
5761
5762
5763
5764
5765
5766
5767
5768
5769
5770
5771
5772
5773
5774
5775
5776
5777
5778
5779
5780
5781
5782
5783
5784
5785
5786
5787
5788
5789
5790
5791
5792
5793
5794
5795
5796
5797
5798
5799
5800
5801
5802
5803
5804
5805
5806
5807
5808
5809
5810
5811
5812
5813
5814
5815
5816
5817
5818
5819
5820
5821
5822
5823
5824
5825
5826
5827
5828
5829
5830
5831
5832
5833
5834
5835
5836
5837
5838
5839
5840
5841
5842
5843
5844
5845
5846
5847
5848
5849
5850
5851
5852
5853
5854
5855
5856
5857
5858
5859
5860
5861
5862
5863
5864
5865
5866
5867
5868
5869
5870
5871
5872
5873
5874
5875
5876
5877
5878
5879
5880
5881
5882
5883
5884
5885
5886
5887
5888
5889
5890
5891
5892
5893
5894
5895
5896
5897
5898
5899
5900
5901
5902
5903
5904
5905
5906
5907
5908
5909
5910
5911
5912
5913
5914
5915
5916
5917
5918
5919
5920
5921
5922
5923
5924
5925
5926
5927
5928
5929
5930
5931
5932
5933
5934
5935
5936
5937
5938
5939
5940
5941
5942
5943
5944
5945
5946
5947
5948
5949
5950
5951
5952
5953
5954
5955
5956
5957
5958
5959
5960
5961
5962
5963
5964
5965
5966
5967
5968
5969
5970
5971
5972
5973
5974
5975
5976
5977
5978
5979
5980
5981
5982
5983
5984
5985
5986
5987
5988
5989
5990
5991
5992
5993
5994
5995
5996
5997
5998
5999
6000
6001
6002
6003
6004
6005
6006
6007
6008
6009
6010
6011
6012
6013
6014
6015
6016
6017
6018
6019
6020
6021
6022
6023
6024
6025
6026
6027
6028
6029
6030
6031
6032
6033
6034
6035
6036
6037
6038
6039
6040
6041
6042
6043
6044
6045
6046
6047
6048
6049
6050
6051
6052
6053
6054
6055
6056
6057
6058
6059
6060
6061
6062
6063
6064
6065
6066
6067
6068
6069
6070
6071
6072
6073
6074
6075
6076
6077
6078
6079
6080
6081
6082
6083
6084
6085
6086
6087
6088
6089
6090
6091
6092
6093
6094
6095
6096
6097
6098
6099
6100
6101
6102
6103
6104
6105
6106
6107
6108
6109
6110
6111
6112
6113
6114
6115
6116
6117
6118
6119
6120
6121
6122
6123
6124
6125
6126
6127
6128
6129
6130
6131
6132
6133
6134
6135
6136
6137
6138
6139
6140
6141
6142
6143
6144
6145
6146
6147
6148
6149
6150
6151
6152
6153
6154
6155
6156
6157
6158
6159
6160
6161
6162
6163
6164
6165
6166
6167
6168
6169
6170
6171
6172
6173
6174
6175
6176
6177
6178
6179
6180
6181
6182
6183
6184
6185
6186
6187
6188
6189
6190
6191
6192
6193
6194
6195
6196
6197
6198
6199
6200
6201
6202
6203
6204
6205
6206
6207
6208
6209
6210
6211
6212
6213
6214
6215
6216
6217
6218
6219
6220
6221
6222
6223
6224
6225
6226
6227
6228
6229
6230
6231
6232
6233
6234
6235
6236
6237
6238
6239
6240
6241
6242
6243
6244
6245
6246
6247
6248
6249
6250
6251
6252
6253
6254
6255
6256
6257
6258
6259
6260
6261
6262
6263
6264
6265
6266
6267
6268
6269
6270
6271
6272
6273
6274
6275
6276
6277
6278
6279
6280
6281
6282
6283
6284
6285
6286
6287
6288
6289
6290
6291
6292
6293
6294
6295
6296
6297
6298
6299
6300
6301
6302
6303
6304
6305
6306
6307
6308
6309
6310
6311
6312
6313
6314
6315
6316
6317
6318
6319
6320
6321
6322
6323
6324
6325
6326
6327
6328
6329
6330
6331
6332
6333
6334
6335
6336
6337
6338
6339
6340
6341
6342
6343
6344
6345
6346
6347
6348
6349
6350
6351
6352
6353
6354
6355
6356
6357
6358
6359
6360
6361
6362
6363
6364
6365
6366
6367
6368
6369
6370
6371
6372
6373
6374
6375
6376
6377
6378
6379
6380
6381
6382
6383
6384
6385
6386
6387
6388
6389
6390
6391
6392
6393
6394
6395
6396
6397
6398
6399
6400
6401
6402
6403
6404
6405
6406
6407
6408
6409
6410
6411
6412
6413
6414
6415
6416
6417
6418
6419
6420
6421
6422
6423
6424
6425
6426
6427
6428
6429
6430
6431
6432
6433
6434
6435
6436
6437
6438
6439
6440
6441
6442
6443
6444
6445
6446
6447
6448
6449
6450
6451
6452
6453
6454
6455
6456
6457
6458
6459
6460
6461
6462
6463
6464
6465
6466
6467
6468
6469
6470
6471
6472
6473
6474
6475
6476
6477
6478
6479
6480
6481
6482
6483
6484
6485
6486
6487
6488
6489
6490
6491
6492
6493
6494
6495
6496
6497
6498
6499
6500
6501
6502
6503
6504
6505
6506
6507
6508
6509
6510
6511
6512
6513
6514
6515
6516
6517
6518
6519
6520
6521
6522
6523
6524
6525
6526
6527
6528
6529
6530
6531
6532
6533
6534
6535
6536
6537
6538
6539
6540
6541
6542
6543
6544
6545
6546
6547
6548
6549
6550
6551
6552
6553
6554
6555
6556
6557
6558
6559
6560
6561
6562
6563
6564
6565
6566
6567
6568
6569
6570
6571
6572
6573
6574
6575
6576
6577
6578
6579
6580
6581
6582
6583
6584
6585
6586
6587
6588
6589
6590
6591
6592
6593
6594
6595
6596
6597
6598
6599
6600
6601
6602
6603
6604
6605
6606
6607
6608
6609
6610
6611
6612
6613
6614
6615
6616
6617
6618
6619
6620
6621
6622
6623
6624
6625
6626
6627
6628
6629
6630
6631
6632
6633
6634
6635
6636
6637
6638
6639
6640
6641
6642
6643
6644
6645
6646
6647
6648
6649
6650
6651
6652
6653
6654
6655
6656
6657
6658
6659
6660
6661
6662
6663
6664
6665
6666
6667
6668
6669
6670
6671
6672
6673
6674
6675
6676
6677
6678
6679
6680
6681
6682
6683
6684
6685
6686
6687
6688
6689
6690
6691
6692
6693
6694
6695
6696
6697
6698
6699
6700
6701
6702
6703
6704
6705
6706
6707
6708
6709
6710
6711
6712
6713
6714
6715
6716
6717
6718
6719
6720
6721
6722
6723
6724
6725
6726
6727
6728
6729
6730
6731
6732
6733
6734
6735
6736
6737
6738
6739
6740
6741
6742
6743
6744
6745
6746
6747
6748
6749
6750
6751
6752
6753
6754
6755
6756
6757
6758
6759
6760
6761
6762
6763
6764
6765
6766
6767
6768
6769
6770
6771
6772
6773
6774
6775
6776
6777
6778
6779
6780
6781
6782
6783
6784
6785
6786
6787
6788
6789
6790
6791
6792
6793
6794
6795
6796
6797
6798
6799
6800
6801
6802
6803
6804
6805
6806
6807
6808
6809
6810
6811
6812
6813
6814
6815
6816
6817
6818
6819
6820
6821
6822
6823
6824
6825
6826
6827
6828
6829
6830
6831
6832
6833
6834
6835
6836
6837
6838
6839
6840
6841
6842
6843
6844
6845
6846
6847
6848
6849
6850
6851
6852
6853
6854
6855
6856
6857
6858
6859
6860
6861
6862
6863
6864
6865
6866
6867
6868
6869
6870
6871
6872
6873
6874
6875
6876
6877
6878
6879
6880
6881
6882
6883
6884
6885
6886
6887
6888
6889
6890
6891
6892
6893
6894
6895
6896
6897
6898
6899
6900
6901
6902
6903
6904
6905
6906
6907
6908
6909
6910
6911
6912
6913
6914
6915
6916
6917
6918
6919
6920
6921
6922
6923
6924
6925
6926
6927
6928
6929
6930
6931
6932
6933
6934
6935
6936
6937
6938
6939
6940
6941
6942
6943
6944
6945
6946
6947
6948
6949
6950
6951
6952
6953
6954
6955
6956
6957
6958
6959
6960
6961
6962
6963
6964
6965
6966
6967
6968
6969
6970
6971
6972
6973
6974
6975
6976
6977
6978
6979
6980
6981
6982
6983
6984
6985
6986
6987
6988
6989
6990
6991
6992
6993
6994
6995
6996
6997
6998
6999
7000
7001
7002
7003
7004
7005
7006
7007
7008
7009
7010
7011
7012
7013
7014
7015
7016
7017
7018
7019
7020
7021
7022
7023
7024
7025
7026
7027
7028
7029
7030
7031
7032
7033
7034
7035
7036
7037
7038
7039
7040
7041
7042
7043
7044
7045
7046
7047
7048
7049
7050
7051
7052
7053
7054
7055
7056
7057
7058
7059
7060
7061
7062
7063
7064
7065
7066
7067
7068
7069
7070
7071
7072
7073
7074
7075
7076
7077
7078
7079
7080
7081
7082
7083
7084
7085
7086
7087
7088
7089
7090
7091
7092
7093
7094
7095
7096
7097
7098
7099
7100
7101
7102
7103
7104
7105
7106
7107
7108
7109
7110
7111
7112
7113
7114
7115
7116
7117
7118
7119
7120
7121
7122
7123
7124
7125
7126
7127
7128
7129
7130
7131
7132
7133
7134
7135
7136
7137
7138
7139
7140
7141
7142
7143
7144
7145
7146
7147
7148
7149
7150
7151
7152
7153
7154
7155
7156
7157
7158
7159
7160
7161
7162
7163
7164
7165
7166
7167
7168
7169
7170
7171
7172
7173
7174
7175
7176
7177
7178
7179
7180
7181
7182
7183
7184
7185
7186
7187
7188
7189
7190
7191
7192
7193
7194
7195
7196
7197
7198
7199
7200
7201
7202
7203
7204
7205
7206
7207
7208
7209
7210
7211
7212
7213
7214
7215
7216
7217
7218
7219
7220
7221
7222
7223
7224
7225
7226
7227
7228
7229
7230
7231
7232
7233
7234
7235
7236
7237
7238
7239
7240
7241
7242
7243
7244
7245
7246
7247
7248
7249
7250
7251
7252
7253
7254
7255
7256
7257
7258
7259
7260
7261
7262
7263
7264
7265
7266
7267
7268
7269
7270
7271
7272
7273
7274
7275
7276
7277
7278
7279
7280
7281
7282
7283
7284
7285
7286
7287
7288
7289
7290
7291
7292
7293
7294
7295
7296
7297
7298
7299
7300
7301
7302
7303
7304
7305
7306
7307
7308
7309
7310
7311
7312
7313
7314
7315
7316
7317
7318
7319
7320
7321
7322
7323
7324
7325
7326
7327
7328
7329
7330
7331
7332
7333
7334
7335
7336
7337
7338
7339
7340
7341
7342
7343
7344
7345
7346
7347
7348
7349
7350
7351
7352
7353
7354
7355
7356
7357
7358
7359
7360
7361
7362
7363
7364
7365
7366
7367
7368
7369
7370
7371
7372
7373
7374
7375
7376
7377
7378
7379
7380
7381
7382
7383
7384
7385
7386
7387
7388
7389
7390
7391
7392
7393
7394
7395
7396
7397
7398
7399
7400
7401
7402
7403
7404
7405
7406
7407
7408
7409
7410
7411
7412
7413
7414
7415
7416
7417
7418
7419
7420
7421
7422
7423
7424
7425
7426
7427
7428
7429
7430
7431
7432
7433
7434
7435
7436
7437
7438
7439
7440
7441
7442
7443
7444
7445
7446
7447
7448
7449
7450
7451
7452
7453
7454
7455
7456
7457
7458
7459
7460
7461
7462
7463
7464
7465
7466
7467
7468
7469
7470
7471
7472
7473
7474
7475
7476
7477
7478
7479
7480
7481
7482
7483
7484
7485
7486
7487
7488
7489
7490
7491
7492
7493
7494
7495
7496
7497
7498
7499
7500
7501
7502
7503
7504
7505
7506
7507
7508
7509
7510
7511
7512
7513
7514
7515
7516
7517
7518
7519
7520
7521
7522
7523
7524
7525
7526
7527
7528
7529
7530
7531
7532
7533
7534
7535
7536
7537
7538
7539
7540
7541
7542
7543
7544
7545
7546
7547
7548
7549
7550
7551
7552
7553
7554
7555
7556
7557
7558
7559
7560
7561
7562
7563
7564
7565
7566
7567
7568
7569
7570
7571
7572
7573
7574
7575
7576
7577
7578
7579
7580
7581
7582
7583
7584
7585
7586
7587
7588
7589
7590
7591
7592
7593
7594
7595
7596
7597
7598
7599
7600
7601
7602
7603
7604
7605
7606
7607
7608
7609
7610
7611
7612
7613
7614
7615
7616
7617
7618
7619
7620
7621
7622
7623
7624
7625
7626
7627
7628
7629
7630
7631
7632
7633
7634
7635
7636
7637
7638
7639
7640
7641
7642
7643
7644
7645
7646
7647
7648
7649
7650
7651
7652
7653
7654
7655
7656
7657
7658
7659
7660
7661
7662
7663
7664
7665
7666
7667
7668
7669
7670
7671
7672
7673
7674
7675
7676
7677
7678
7679
7680
7681
7682
7683
7684
7685
7686
7687
7688
7689
7690
7691
7692
7693
7694
7695
7696
7697
7698
7699
7700
7701
7702
7703
7704
7705
7706
7707
7708
7709
7710
7711
7712
7713
7714
7715
7716
7717
7718
7719
7720
7721
7722
7723
7724
7725
7726
7727
7728
7729
7730
7731
7732
7733
7734
7735
7736
7737
7738
7739
7740
7741
7742
7743
7744
7745
7746
7747
7748
7749
7750
7751
7752
7753
7754
7755
7756
7757
7758
7759
7760
7761
7762
7763
7764
7765
7766
7767
7768
7769
7770
7771
7772
7773
7774
7775
7776
7777
7778
7779
7780
7781
7782
7783
7784
7785
7786
7787
7788
7789
7790
7791
7792
7793
7794
7795
7796
7797
7798
7799
7800
7801
7802
7803
7804
7805
7806
7807
7808
7809
7810
7811
7812
7813
7814
7815
7816
7817
7818
7819
7820
7821
7822
7823
7824
7825
7826
7827
7828
7829
7830
7831
7832
7833
7834
7835
7836
7837
7838
7839
7840
7841
7842
7843
7844
7845
7846
7847
7848
7849
7850
7851
7852
7853
7854
7855
7856
7857
7858
7859
7860
7861
7862
7863
7864
7865
7866
7867
7868
7869
7870
7871
7872
7873
7874
7875
7876
7877
7878
7879
7880
7881
7882
7883
7884
7885
7886
7887
7888
7889
7890
7891
7892
7893
7894
7895
7896
7897
7898
7899
7900
7901
7902
7903
7904
7905
7906
7907
7908
7909
7910
7911
7912
7913
7914
7915
7916
7917
7918
7919
7920
7921
7922
7923
7924
7925
7926
7927
7928
7929
7930
7931
7932
7933
7934
7935
7936
7937
7938
7939
7940
7941
7942
7943
7944
7945
7946
7947
7948
7949
7950
7951
7952
7953
7954
7955
7956
7957
7958
7959
7960
7961
7962
7963
7964
7965
7966
7967
7968
7969
7970
7971
7972
7973
7974
7975
7976
7977
7978
7979
7980
7981
7982
7983
7984
7985
7986
7987
7988
7989
7990
7991
7992
7993
7994
7995
7996
7997
7998
7999
8000
8001
8002
8003
8004
8005
8006
8007
8008
8009
8010
8011
8012
8013
8014
8015
8016
8017
8018
8019
8020
8021
8022
8023
8024
8025
8026
8027
8028
8029
8030
8031
8032
8033
8034
8035
8036
8037
8038
8039
8040
8041
8042
8043
8044
8045
8046
8047
8048
8049
8050
8051
8052
8053
8054
8055
8056
8057
8058
8059
8060
8061
8062
8063
8064
8065
8066
8067
8068
8069
8070
8071
8072
8073
8074
8075
8076
8077
8078
8079
8080
8081
8082
8083
8084
8085
8086
8087
8088
8089
8090
8091
8092
8093
8094
8095
8096
8097
8098
8099
8100
8101
8102
8103
8104
8105
8106
8107
8108
8109
8110
8111
8112
8113
8114
8115
8116
8117
8118
8119
8120
8121
8122
8123
8124
8125
8126
8127
8128
8129
8130
8131
8132
8133
8134
8135
8136
8137
8138
8139
8140
8141
8142
8143
8144
8145
8146
8147
8148
8149
8150
8151
8152
8153
8154
8155
8156
8157
8158
8159
8160
8161
8162
8163
8164
8165
8166
8167
8168
8169
8170
8171
8172
8173
8174
8175
8176
8177
8178
8179
8180
8181
8182
8183
8184
8185
8186
8187
8188
8189
8190
8191
8192
8193
8194
8195
8196
8197
8198
8199
8200
8201
8202
8203
8204
8205
8206
8207
8208
8209
8210
8211
8212
8213
8214
8215
8216
8217
8218
8219
8220
8221
8222
8223
8224
8225
8226
8227
8228
8229
8230
8231
8232
8233
8234
8235
8236
8237
8238
8239
8240
8241
8242
8243
8244
8245
8246
8247
8248
8249
8250
8251
8252
8253
8254
8255
8256
8257
8258
8259
8260
8261
8262
8263
8264
8265
8266
8267
8268
8269
8270
8271
8272
8273
8274
8275
8276
8277
8278
8279
8280
8281
8282
8283
8284
8285
8286
8287
8288
8289
8290
8291
8292
8293
8294
8295
8296
8297
8298
8299
8300
8301
8302
8303
8304
8305
8306
8307
8308
8309
8310
8311
8312
8313
8314
8315
8316
8317
8318
8319
8320
8321
8322
8323
8324
8325
8326
8327
8328
8329
8330
8331
8332
8333
8334
8335
8336
8337
8338
8339
8340
8341
8342
8343
8344
8345
8346
8347
8348
8349
8350
8351
8352
8353
8354
8355
8356
8357
8358
8359
8360
8361
8362
8363
8364
8365
8366
8367
8368
8369
8370
8371
8372
8373
8374
8375
8376
8377
8378
8379
8380
8381
8382
8383
8384
8385
8386
8387
8388
8389
8390
8391
8392
8393
8394
8395
8396
8397
8398
8399
8400
8401
8402
8403
8404
8405
8406
8407
8408
8409
8410
8411
8412
8413
8414
8415
8416
8417
8418
8419
8420
8421
8422
8423
8424
8425
8426
8427
8428
8429
8430
8431
8432
8433
8434
8435
8436
8437
8438
8439
8440
8441
8442
8443
8444
8445
8446
8447
8448
8449
8450
8451
8452
8453
8454
8455
8456
8457
8458
8459
8460
8461
8462
8463
8464
8465
8466
8467
8468
8469
8470
8471
8472
8473
8474
8475
8476
8477
8478
8479
8480
8481
8482
8483
8484
8485
8486
8487
8488
8489
8490
8491
8492
8493
8494
8495
8496
8497
8498
8499
8500
8501
8502
8503
8504
8505
8506
8507
8508
8509
8510
8511
8512
8513
8514
8515
8516
8517
8518
8519
8520
8521
8522
8523
8524
8525
8526
8527
8528
8529
8530
8531
8532
8533
8534
8535
8536
8537
8538
8539
8540
8541
8542
8543
8544
8545
8546
8547
8548
8549
8550
8551
8552
8553
8554
8555
8556
8557
8558
8559
8560
8561
8562
8563
8564
8565
8566
8567
8568
8569
8570
8571
8572
8573
8574
8575
8576
8577
8578
8579
8580
8581
8582
8583
8584
8585
8586
8587
8588
8589
8590
8591
8592
8593
8594
8595
8596
8597
8598
8599
8600
8601
8602
8603
8604
8605
8606
8607
8608
8609
8610
8611
8612
8613
8614
8615
8616
8617
8618
8619
8620
8621
8622
8623
8624
8625
8626
8627
8628
8629
8630
8631
8632
8633
8634
8635
8636
8637
8638
8639
8640
8641
8642
8643
8644
8645
8646
8647
8648
8649
8650
8651
8652
8653
8654
8655
8656
8657
8658
8659
8660
8661
8662
8663
8664
8665
8666
8667
8668
8669
8670
8671
8672
8673
8674
8675
8676
8677
8678
8679
8680
8681
8682
8683
8684
8685
8686
8687
8688
8689
8690
8691
8692
8693
8694
8695
8696
8697
8698
8699
8700
8701
8702
8703
8704
8705
8706
8707
8708
8709
8710
8711
8712
8713
8714
8715
8716
8717
8718
8719
8720
8721
8722
8723
8724
8725
8726
8727
8728
8729
8730
8731
8732
8733
8734
8735
8736
8737
8738
8739
8740
8741
8742
8743
8744
8745
8746
8747
8748
8749
8750
8751
8752
8753
8754
8755
8756
8757
8758
8759
8760
8761
8762
8763
8764
8765
8766
8767
8768
8769
8770
8771
8772
8773
8774
8775
8776
8777
8778
8779
8780
8781
8782
8783
8784
8785
8786
8787
8788
8789
8790
8791
8792
8793
8794
8795
8796
8797
8798
8799
8800
8801
8802
8803
8804
8805
8806
8807
8808
8809
8810
8811
8812
8813
8814
8815
8816
8817
8818
8819
8820
8821
8822
8823
8824
8825
8826
8827
8828
8829
8830
8831
8832
8833
8834
8835
8836
8837
8838
8839
8840
8841
8842
8843
8844
8845
8846
8847
8848
8849
8850
8851
8852
8853
8854
8855
8856
8857
8858
8859
8860
8861
8862
8863
8864
8865
8866
8867
8868
8869
8870
8871
8872
8873
8874
8875
8876
8877
8878
8879
8880
8881
8882
8883
8884
8885
8886
8887
8888
8889
8890
8891
8892
8893
8894
8895
8896
8897
8898
8899
8900
8901
8902
8903
8904
8905
8906
8907
8908
8909
8910
8911
8912
8913
8914
8915
8916
8917
8918
8919
8920
8921
8922
8923
8924
8925
8926
8927
8928
8929
8930
8931
8932
8933
8934
8935
8936
8937
8938
8939
8940
8941
8942
8943
8944
8945
8946
8947
8948
8949
8950
8951
8952
8953
8954
8955
8956
8957
8958
8959
8960
8961
8962
8963
8964
8965
8966
8967
8968
8969
8970
8971
8972
8973
8974
8975
8976
8977
8978
8979
8980
8981
8982
8983
8984
8985
8986
8987
8988
8989
8990
8991
8992
8993
8994
8995
8996
8997
8998
8999
9000
9001
9002
9003
9004
9005
9006
9007
9008
9009
9010
9011
9012
9013
9014
9015
9016
9017
9018
9019
9020
9021
9022
9023
9024
9025
9026
9027
9028
9029
9030
9031
9032
9033
9034
9035
9036
9037
9038
9039
9040
9041
9042
9043
9044
9045
9046
9047
9048
9049
9050
9051
9052
9053
9054
9055
9056
9057
9058
9059
9060
9061
9062
9063
9064
9065
9066
9067
9068
9069
9070
9071
9072
9073
9074
9075
9076
9077
9078
9079
9080
9081
9082
9083
9084
9085
9086
9087
9088
9089
9090
9091
9092
9093
9094
9095
9096
9097
9098
9099
9100
9101
9102
9103
9104
9105
9106
9107
9108
9109
9110
9111
9112
9113
9114
9115
9116
9117
9118
9119
9120
9121
9122
9123
9124
9125
9126
9127
9128
9129
9130
9131
9132
9133
9134
9135
9136
9137
9138
9139
9140
9141
9142
9143
9144
9145
9146
9147
9148
9149
9150
9151
9152
9153
9154
9155
9156
9157
9158
9159
9160
9161
9162
9163
9164
9165
9166
9167
9168
9169
9170
9171
9172
9173
9174
9175
9176
9177
9178
9179
9180
9181
9182
9183
9184
9185
9186
9187
9188
9189
9190
9191
9192
9193
9194
9195
9196
9197
9198
9199
9200
9201
9202
9203
9204
9205
9206
9207
9208
9209
9210
9211
9212
9213
9214
9215
9216
9217
9218
9219
9220
9221
9222
9223
9224
9225
9226
9227
9228
9229
9230
9231
9232
9233
9234
9235
9236
9237
9238
9239
9240
9241
9242
9243
9244
9245
9246
9247
9248
9249
9250
9251
9252
9253
9254
9255
9256
9257
9258
9259
9260
9261
9262
9263
9264
9265
9266
9267
9268
9269
9270
9271
9272
9273
9274
9275
9276
9277
9278
9279
9280
9281
9282
9283
9284
9285
9286
9287
9288
9289
9290
9291
9292
9293
9294
9295
9296
9297
9298
9299
9300
9301
9302
9303
9304
9305
9306
9307
9308
9309
9310
9311
9312
9313
9314
9315
9316
9317
9318
9319
9320
9321
9322
9323
9324
9325
9326
9327
9328
9329
9330
9331
9332
9333
9334
9335
9336
9337
9338
9339
9340
9341
9342
9343
9344
9345
9346
9347
9348
9349
9350
9351
9352
9353
9354
9355
9356
9357
9358
9359
9360
9361
9362
9363
9364
9365
9366
9367
9368
9369
9370
9371
9372
9373
9374
9375
9376
9377
9378
9379
9380
9381
9382
9383
9384
9385
9386
9387
9388
9389
9390
9391
9392
9393
9394
9395
9396
9397
9398
9399
9400
9401
9402
9403
9404
9405
9406
9407
9408
9409
9410
9411
9412
9413
9414
9415
9416
9417
9418
9419
9420
9421
9422
9423
9424
9425
9426
9427
9428
9429
9430
9431
9432
9433
9434
9435
9436
9437
9438
9439
9440
9441
9442
9443
9444
9445
9446
9447
9448
9449
9450
9451
9452
9453
9454
9455
9456
9457
9458
9459
9460
9461
9462
9463
9464
9465
9466
9467
9468
9469
9470
9471
9472
9473
9474
9475
9476
9477
9478
9479
9480
9481
9482
9483
9484
9485
9486
9487
9488
9489
9490
9491
9492
9493
9494
9495
9496
9497
9498
9499
9500
9501
9502
9503
9504
9505
9506
9507
9508
9509
9510
9511
9512
9513
9514
9515
9516
9517
9518
9519
9520
9521
9522
9523
9524
9525
9526
9527
9528
9529
9530
9531
9532
9533
9534
9535
9536
9537
9538
9539
9540
9541
9542
9543
9544
9545
9546
9547
9548
9549
9550
9551
9552
9553
9554
9555
9556
9557
9558
9559
9560
9561
9562
9563
9564
9565
9566
9567
9568
9569
9570
9571
9572
9573
9574
9575
9576
9577
9578
9579
9580
9581
9582
9583
9584
9585
9586
9587
9588
9589
9590
9591
9592
9593
9594
9595
9596
9597
9598
9599
9600
9601
9602
9603
9604
9605
9606
9607
9608
9609
9610
9611
9612
9613
9614
9615
9616
9617
9618
9619
9620
9621
9622
9623
9624
9625
9626
9627
9628
9629
9630
9631
9632
9633
9634
9635
9636
9637
9638
9639
9640
9641
9642
9643
9644
9645
9646
9647
9648
9649
9650
9651
9652
9653
9654
9655
9656
9657
9658
9659
9660
9661
9662
9663
9664
9665
9666
9667
9668
9669
9670
9671
9672
9673
9674
9675
9676
9677
9678
9679
9680
9681
9682
9683
9684
9685
9686
9687
9688
9689
9690
9691
9692
9693
9694
9695
9696
9697
9698
9699
9700
9701
9702
9703
9704
9705
9706
9707
9708
9709
9710
9711
9712
9713
9714
9715
9716
9717
9718
9719
9720
9721
9722
9723
9724
9725
9726
9727
9728
9729
9730
9731
9732
9733
9734
9735
9736
9737
9738
9739
9740
9741
9742
9743
9744
9745
9746
9747
9748
9749
9750
9751
9752
9753
9754
9755
9756
9757
9758
9759
9760
9761
9762
9763
9764
9765
9766
9767
9768
9769
9770
9771
9772
9773
9774
9775
9776
9777
9778
9779
9780
9781
9782
9783
9784
9785
9786
9787
9788
9789
9790
9791
9792
9793
9794
9795
9796
9797
9798
9799
9800
9801
9802
9803
9804
9805
9806
9807
9808
9809
9810
9811
9812
9813
9814
9815
9816
9817
9818
9819
9820
9821
9822
9823
9824
9825
9826
9827
9828
9829
9830
9831
9832
9833
9834
9835
9836
9837
9838
9839
9840
9841
9842
9843
9844
9845
9846
9847
9848
9849
9850
9851
9852
9853
9854
9855
9856
9857
9858
9859
9860
9861
9862
9863
9864
9865
9866
9867
9868
9869
9870
9871
9872
9873
9874
9875
9876
9877
9878
9879
9880
9881
9882
9883
9884
9885
9886
9887
9888
9889
9890
9891
9892
9893
9894
9895
9896
9897
9898
9899
9900
9901
9902
9903
9904
9905
9906
9907
9908
9909
9910
9911
9912
9913
9914
9915
9916
9917
9918
9919
9920
9921
9922
9923
9924
9925
9926
9927
9928
9929
9930
9931
9932
9933
9934
9935
9936
9937
9938
9939
9940
9941
9942
9943
9944
9945
9946
9947
9948
9949
9950
9951
9952
9953
9954
9955
9956
9957
9958
9959
9960
9961
9962
9963
9964
9965
9966
9967
9968
9969
9970
9971
9972
9973
9974
9975
9976
9977
9978
9979
9980
9981
9982
9983
9984
9985
9986
9987
9988
9989
9990
9991
9992
9993
9994
9995
9996
9997
9998
9999
10000
10001
10002
10003
10004
10005
10006
10007
10008
10009
10010
10011
10012
10013
10014
10015
10016
10017
10018
10019
10020
10021
10022
10023
10024
10025
10026
10027
10028
10029
10030
10031
10032
10033
10034
10035
10036
10037
10038
10039
10040
10041
10042
10043
10044
10045
10046
10047
10048
10049
10050
10051
10052
10053
10054
10055
10056
10057
10058
10059
10060
10061
10062
10063
10064
10065
10066
10067
10068
10069
10070
10071
10072
10073
10074
10075
10076
10077
10078
10079
10080
10081
10082
10083
10084
10085
10086
10087
10088
10089
10090
10091
10092
10093
10094
10095
10096
10097
10098
10099
10100
10101
10102
10103
10104
10105
10106
10107
10108
10109
10110
10111
10112
10113
10114
10115
10116
10117
10118
10119
10120
10121
10122
10123
10124
10125
10126
10127
10128
10129
10130
10131
10132
10133
10134
10135
10136
10137
10138
10139
10140
10141
10142
10143
10144
10145
10146
10147
10148
10149
10150
10151
10152
10153
10154
10155
10156
10157
10158
10159
10160
10161
10162
10163
10164
10165
10166
10167
10168
10169
10170
10171
10172
10173
10174
10175
10176
10177
10178
10179
10180
10181
10182
10183
10184
10185
10186
10187
10188
10189
10190
10191
10192
10193
10194
10195
10196
10197
10198
10199
10200
10201
10202
10203
10204
10205
10206
10207
10208
10209
10210
10211
10212
10213
10214
10215
10216
10217
10218
10219
10220
10221
10222
10223
10224
10225
10226
10227
10228
10229
10230
10231
10232
10233
10234
10235
10236
10237
10238
10239
10240
10241
10242
10243
10244
10245
10246
10247
10248
10249
10250
10251
10252
10253
10254
10255
10256
10257
10258
10259
10260
10261
10262
10263
10264
10265
10266
10267
10268
10269
10270
10271
10272
10273
10274
10275
10276
10277
10278
10279
10280
10281
10282
10283
10284
10285
10286
10287
10288
10289
10290
10291
10292
10293
10294
10295
10296
10297
10298
10299
10300
10301
10302
10303
10304
10305
10306
10307
10308
10309
10310
10311
10312
10313
10314
10315
10316
10317
10318
10319
10320
10321
10322
10323
10324
10325
10326
10327
10328
10329
10330
10331
10332
10333
10334
10335
10336
10337
10338
10339
10340
10341
10342
10343
10344
10345
10346
10347
10348
10349
10350
10351
10352
10353
10354
10355
10356
10357
10358
10359
10360
10361
10362
10363
10364
10365
10366
10367
10368
10369
10370
10371
10372
10373
10374
10375
10376
10377
10378
10379
10380
10381
10382
10383
10384
10385
10386
10387
10388
10389
10390
10391
10392
10393
10394
10395
10396
10397
10398
10399
10400
10401
10402
10403
10404
10405
10406
10407
10408
10409
10410
10411
10412
10413
10414
10415
10416
10417
10418
10419
10420
10421
10422
10423
10424
10425
10426
10427
10428
10429
10430
10431
10432
10433
10434
10435
10436
10437
10438
10439
10440
10441
10442
10443
10444
10445
10446
10447
10448
10449
10450
10451
10452
10453
10454
10455
10456
10457
10458
10459
10460
10461
10462
10463
10464
10465
10466
10467
10468
10469
10470
10471
10472
10473
10474
10475
10476
10477
10478
10479
10480
10481
10482
10483
10484
10485
10486
10487
10488
10489
10490
10491
10492
10493
10494
10495
10496
10497
10498
10499
10500
10501
10502
10503
10504
10505
10506
10507
10508
10509
10510
10511
10512
10513
10514
10515
10516
10517
10518
10519
10520
10521
10522
10523
10524
10525
10526
10527
10528
10529
10530
10531
10532
10533
10534
10535
10536
10537
10538
10539
10540
10541
10542
10543
10544
10545
10546
10547
10548
10549
10550
10551
10552
10553
10554
10555
10556
10557
10558
10559
10560
10561
10562
10563
10564
10565
10566
10567
10568
10569
10570
10571
10572
10573
10574
10575
10576
10577
10578
10579
10580
10581
10582
10583
10584
10585
10586
10587
10588
10589
10590
10591
10592
10593
10594
10595
10596
10597
10598
10599
10600
10601
10602
10603
10604
10605
10606
10607
10608
10609
10610
10611
10612
10613
10614
10615
10616
10617
10618
10619
10620
10621
10622
10623
10624
10625
10626
10627
10628
10629
10630
10631
10632
10633
10634
10635
10636
10637
10638
10639
10640
10641
10642
10643
10644
10645
10646
10647
10648
10649
10650
10651
10652
10653
10654
10655
10656
10657
10658
10659
10660
10661
10662
10663
10664
10665
10666
10667
10668
10669
10670
10671
10672
10673
10674
10675
10676
10677
10678
10679
10680
10681
10682
10683
10684
10685
10686
10687
10688
10689
10690
10691
10692
10693
10694
10695
10696
10697
10698
10699
10700
10701
10702
10703
10704
10705
10706
10707
10708
10709
10710
10711
10712
10713
10714
10715
10716
10717
10718
10719
10720
10721
10722
10723
10724
10725
10726
10727
10728
10729
10730
10731
10732
10733
10734
10735
10736
10737
10738
10739
10740
10741
10742
10743
10744
10745
10746
10747
10748
10749
10750
10751
10752
10753
10754
10755
10756
10757
10758
10759
10760
10761
10762
10763
10764
10765
10766
10767
10768
10769
10770
10771
10772
10773
10774
10775
10776
10777
10778
10779
10780
10781
10782
10783
10784
10785
10786
10787
10788
10789
10790
10791
10792
10793
10794
10795
10796
10797
10798
10799
10800
10801
10802
10803
10804
10805
10806
10807
10808
10809
10810
10811
10812
10813
10814
10815
10816
10817
10818
10819
10820
10821
10822
10823
10824
10825
10826
10827
10828
10829
10830
10831
10832
10833
10834
10835
10836
10837
10838
10839
10840
10841
10842
10843
10844
10845
10846
10847
10848
10849
10850
10851
10852
10853
10854
10855
10856
10857
10858
10859
10860
10861
10862
10863
10864
10865
10866
10867
10868
10869
10870
10871
10872
10873
10874
10875
10876
10877
10878
10879
10880
10881
10882
10883
10884
10885
10886
10887
10888
10889
10890
10891
10892
10893
10894
10895
10896
10897
10898
10899
10900
10901
10902
10903
10904
10905
10906
10907
10908
10909
10910
10911
10912
10913
10914
10915
10916
10917
10918
10919
10920
10921
10922
10923
10924
10925
10926
10927
10928
10929
10930
10931
10932
10933
10934
10935
10936
10937
10938
10939
10940
10941
10942
10943
10944
10945
10946
10947
10948
10949
10950
10951
10952
10953
10954
10955
10956
10957
10958
10959
10960
10961
10962
10963
10964
10965
10966
10967
10968
10969
10970
10971
10972
10973
10974
10975
10976
10977
10978
10979
10980
10981
10982
10983
10984
10985
10986
10987
10988
10989
10990
10991
10992
10993
10994
10995
10996
10997
10998
10999
11000
11001
11002
11003
11004
11005
11006
11007
11008
11009
11010
11011
11012
11013
11014
11015
11016
11017
11018
11019
11020
11021
11022
11023
11024
11025
11026
11027
11028
11029
11030
11031
11032
11033
11034
11035
11036
11037
11038
11039
11040
11041
11042
11043
11044
11045
11046
11047
11048
11049
11050
11051
11052
11053
11054
11055
11056
11057
11058
11059
11060
11061
11062
11063
11064
11065
11066
11067
11068
11069
11070
11071
11072
11073
11074
11075
11076
11077
11078
11079
11080
11081
2018-12-04  Niels Möller  <nisse@lysator.liu.se>

	* Released nettle-3.4.1.

2018-11-28  Niels Möller  <nisse@lysator.liu.se>

	* configure.ac: Update GMP check. Check for the function
	mpn_sec_div_r, available since GMP-6.0.0.

	* testsuite/rsa-encrypt-test.c (test_main): Fix allocation of
	decrypted storage. Update test of rsa_decrypt, to allow clobbering
	of all of the passed in message area.

	* pkcs1-decrypt.c (pkcs1_decrypt): Rewrite as a wrapper around
	_pkcs1_sec_decrypt_variable. Improves side-channel silence of the
	only caller, rsa_decrypt.

	* Makefile.in (DISTFILES): Add rsa-internal.h, needed for make
	dist. Patch from Simo Sorce.

	* rsa-internal.h: Add include of rsa.h.

2018-11-27  Niels Möller  <nisse@lysator.liu.se>

	* rsa-sec-compute-root.c (sec_mul, sec_mod_mul, sec_powm): New
	local helper functions, with their own itch functions.
	(_rsa_sec_compute_root_itch, _rsa_sec_compute_root): Rewrote to
	use helpers, for clarity.

2018-11-26  Niels Möller  <nisse@lysator.liu.se>

	* testsuite/rsa-compute-root-test.c (generate_keypair): Simplify
	selection of psize and qsize, and fix so that qsize is used.
	(test_main): Add outer loop, to test with more than one key.
	Deallocate storage before exiting.

2018-11-25  Niels Möller  <nisse@lysator.liu.se>

	* testsuite/rsa-compute-root-test.c: Renamed, from ...
	* testsuite/rsa-sec-compute-root-test.c: ... old name.

	* rsa.h (rsa_sec_compute_root_tr): Deleted declaration, moved to ...
	* rsa-internal.h (_rsa_sec_compute_root_tr): ... new location.
	* rsa-sign-tr.c (_rsa_sec_compute_root_tr): Renamed, from...
	(rsa_sec_compute_root_tr): ... old name. Updated callers.
	(cnd_mpn_zero): Use a volatile-declared mask variable.

	* testsuite/testutils.c (mpz_urandomb) [NETTLE_USE_MINI_GMP]: Fix
	masking of most significant bits.

	* rsa-decrypt-tr.c (rsa_decrypt_tr): Use
	NETTLE_OCTET_SIZE_TO_LIMB_SIZE.

	* testsuite/rsa-sec-decrypt-test.c (rsa_decrypt_for_test): Tweak
	valgrind marking, and document potential leakage of lowest and
	highest bits of p and q.

	* rsa-sec-compute-root.c (_rsa_sec_compute_root): Avoid calls to
	mpz_sizeinbase, since that potentially leaks most significant bits
	of private key parameters a and b.

	* testsuite/pkcs1-sec-decrypt-test.c (pkcs1_decrypt_for_test): Fix
	valgrind marking of return value.

	Merged below changes from Simo Sorce, to make RSA private key
	operations side-channel silent.

2018-11-08  Simo Sorce  <simo@redhat.com>

	* rsa-sign.c (rsa_compute_root) [!NETTLE_USE_MINI_GMP]: Use
	_rsa_sec_compute_root.

	* testsuite/rsa-sec-compute-root-test.c: Add more tests for new
	side-channel silent functions.

	* rsa-sign.c (rsa_private_key_prepare): Check that qn + cn >= pn,
	since that is required for one of the GMP calls in
	_rsa_sec_compute_root.

	* rsa-decrypt-tr.c: Switch to use side-channel silent functions.

	* pkcs1-sec-decrypt.c (_pkcs1_sec_decrypt_variable): New private
	function. Variable size version for backwards compatibility.

	* testsuite/rsa-sec-decrypt-test.c: Adds more tests.

	* rsa-sec-decrypt.c (rsa_sec_decrypt): New function.
	Fixed length side-channel silent version of rsa-decrypt.
	* testsuite/rsa-encrypt-test.c: add tests for the new fucntion.

	* testsuite/pkcs1-sec-decrypt-test.c: Adds tests for
	_pkcs1_sec_decrypt.

	* gmp-glue.c (mpn_get_base256): New function.

	* pkcs1-sec-decrypt.c (_pkcs1_sec_decrypt): New private function.
	Fixed length side-channel silent version of pkcs1-decrypt.

	* cnd-memcpy.c (cnd_memcpy): New function.
	* memops.h: Declare it.
	* testsuite/cnd-memcpy-test.c: New test case.

	* rsa-sign-tr.c (rsa_sec_compute_root_tr): New function that uses
	_rsa_sec_compute_root, as well as side-channel silent RSA
	blinding.
	(rsa_compute_root_tr) Rewritten as a wrapper around
	rsa_sec_compute_root_tr.
	(rsa_sec_blind, rsa_sec_unblind, sec_equal, rsa_sec_check_root)
	(cnd_mpn_zero): New helper functions.
	(rsa_sec_compute_root_tr) [NETTLE_USE_MINI_GMP]: Defined as a not
	side-channel silent wrapper around rsa_compute_root_tr, and the
	latter function left unchanged.

	* rsa-sec-compute-root.c (_rsa_sec_compute_root_itch)
	(_rsa_sec_compute_root): New file, new private functions.
	Side-channel silent version of rsa_compute_root.
	* rsa-internal.h: New header file with declarations.

	* gmp-glue.h (NETTLE_OCTET_SIZE_TO_LIMB_SIZE): New macro.

2018-11-24  Niels Möller  <nisse@lysator.liu.se>

	* configure.ac: Bump package version to 3.4.1.
	(LIBNETTLE_MINOR): Bump library version to 6.5.
	(LIBHOGWEED_MINOR): Bump library version to 4.5.

2018-06-17  Niels Möller  <nisse@lysator.liu.se>

	Backported from master branch.
	* aclocal.m4 (NETTLE_CHECK_IFUNC): Fix quoting. Patch contributed
	by Dmitry Eremin-Solenikov.
	* testsuite/symbols-test: Exclude ____chkstk_darwin symbols,
	produced by Apple's Xcode 10 compiler. Patch contributed by
	Dominyk Tiller.

2018-02-18  Niels Möller  <nisse@lysator.liu.se>

	Backported from master branch.
	* testsuite/Makefile.in (TS_NETTLE_SOURCES): Moved pss-mgf1-test.c...
	(TS_HOGWEED_SOURCES): ...to here. Fixes link failure in builds
	without public-key support.

2018-01-16  Niels Möller  <nisse@lysator.liu.se>

	Backported from master branch.
	* tools/pkcs1-conv.c (convert_file): Add missing break statements.

2018-10-10  Niels Möller  <nisse@lysator.liu.se>

	Backported from master branch.
	* aes-set-encrypt-key.c: Add missing include of stdlib.h.
	* des-compat.c: Likewise.

2018-08-09  Niels Möller  <nisse@lysator.liu.se>

	Backported from master branch.
	* nettle-internal.c (des_set_key_wrapper, des3_set_key_wrapper)
	(blowfish128_set_key_wrapper): Wrapper functions, to avoid cast
	between incompatible function types (which gcc-8 warns about).
	Wrappers are expected to compile to a single jmp instruction.

	* des-compat.c (des_compat_des3_encrypt)
	(des_compat_des3_decrypt): Change length argument type to size_t.

2017-11-19  Niels Möller  <nisse@lysator.liu.se>

	* Released nettle-3.4.

2017-11-12  Niels Möller  <nisse@lysator.liu.se>

	* configure.ac: Update check of GMP_NUMB_BITS declaration in
	assembly files. Was broken by rename of configure variable
	GMP_NUMB_BITS --> NUMB_BITS.

2017-11-11  Niels Möller  <nisse@lysator.liu.se>

	* nettle.texinfo: Document nettle_get_hashes, nettle_get_ciphers
	and nettle_get_aeads, and replace nettle_secp_256r1 by
	nettle_get_secp_256r1. Update version numbers. Delete ancient
	setting of ispell-skip-region-alist as an emacs file-local
	variable.

2017-11-08  Niels Möller  <nisse@lysator.liu.se>

	* ecc-curve.h (nettle_secp_192r1, nettle_secp_224r1)
	(nettle_secp_256r1, nettle_secp_384r1, nettle_secp_521r1): Delete
	macro wrappers, partially reverting below 2017-04-09 change. They
	didn't work at all for applications that only see a forward
	declaration of struct ecc_curve. Instead, we will have to make an
	ABI and API break and delete these symbols, when the size of
	struct ecc_curve is increased.

2017-11-05  Niels Möller  <nisse@lysator.liu.se>

	* configure.ac Bump package version to 3.4.
	(LIBNETTLE_MINOR): Bump library version to 6.4.
	(LIBHOGWEED_MINOR): Bump library version to 4.4.

2017-10-23  Niels Möller  <nisse@lysator.liu.se>

	* examples/Makefile.in (check): Also set DYLD_LIBRARY_PATH in the
	environment, to support Mac OSX shared libraries.
	* testsuite/Makefile.in (LD_LIBRARY_PATH): Likewise.

2017-10-23  Niels Möller  <nisse@lysator.liu.se>

	Merge API fixes, starting at 2017-01-12.

2017-04-09  Niels Möller  <nisse@lysator.liu.se>

	* ecc-curve.h (nettle_get_secp_192r1, nettle_get_secp_224r1)
	(nettle_get_secp_256r1, nettle_get_secp_384r1)
	(nettle_get_secp_521r1): New functions, returning a pointer to
	corresponding structure.
	(nettle_secp_192r1, nettle_secp_224r1, nettle_secp_256r1)
	(nettle_secp_384r1, nettle_secp_521r1): Redefined as macros,
	calling the corresponding function.

	* nettle-meta.h (nettle_ciphers, nettle_aeads, nettle_armors): New
	macros, analogous to below change to nettle_hashes.

	* nettle-meta-ciphers.c (nettle_get_ciphers): New function.

	* nettle-meta-aeads.c (nettle_get_aeads): New function.

	* nettle-meta-armors.c (nettle_get_armors): New function.

2017-01-12  Niels Möller  <nisse@lysator.liu.se>

	* tools/nettle-hash.c (find_algorithm): Deleted function.
	(main): Replaced by call to nettle_lookup_hash.

	* testsuite/meta-hash-test.c (test_main): Use nettle_lookup_hash.

	* nettle-meta.h (nettle_hashes): New macro, expanding to a call to
	nettle_get_hashes. Direct access to the array causes the array
	size to leak into the ABI, since a plain un-relocatable executable
	linking with libnettle.so gets copy relocations for any referenced
	data items in the shared library.

	* nettle-meta-hashes.c (nettle_get_hashes): New function.

2017-10-16  Niels Möller  <nisse@lysator.liu.se>

	CFB support, contributed by Dmitry Eremin-Solenikov.
	* cfb.c (cfb_encrypt, cfb_decrypt): New file, new functions.
	* cfb.h: New header file.
	(CFB_CTX, CFB_SET_IV, CFB_ENCRYPT, CFB_DECRYPT): New macros.
	* Makefile.in (nettle_SOURCES): Add cfb.c.
	(HEADERS): Add cfb.h.
	* testsuite/cfb-test.c: New test case.
	* testsuite/testutils.c (test_cipher_cfb): New function.
	* nettle.texinfo (CFB): Documentation.

2017-10-16  Niels Möller  <nisse@lysator.liu.se>

	* aclocal.m4 (GMP_PROG_CC_FOR_BUILD): Add -g when compiling with
	gcc.

2017-09-27  Niels Möller  <nisse@lysator.liu.se>

	Merged armor-signedness branch, starting 2017-08-27.

2017-09-24  Niels Möller  <nisse@lysator.liu.se>

	* tools/pkcs1-conv.c (base64_decode_in_place): New helper
	function.
	(decode_base64): Use it.

	* sexp-transport-format.c (base64_encode_in_place): New helper
	function.
	(sexp_transport_vformat): Use it.

	* testsuite/base64-test.c (test_fuzz_once): Update to use char
	type where appropriate.
	(test_main): Use helper functions base64_encode_in_place and
	base64_decode_in_place (copied to this file).

	* testsuite/testutils.c (tstring_data): Use uint8_t for data
	argument.
	* testsuite/testutils.h (SDATA): Use US macro to cast data
	argument.

2017-08-27  Niels Möller  <nisse@lysator.liu.se>

	* base64-encode.c (base64_encode_raw, base64_encode_group)
	(base64_encode_single, base64_encode_update)
	(base64_encode_final): Change type of destination to char *.
	* base16-encode.c (base16_encode_single, base16_encode_update):
	Likewise.
	* base64-decode.c (base64_decode_single, base64_decode_update):
	Change type of source argument to const char *. Update (almost)
	all callers.
	* base16-decode.c (base16_decode_single, base16_decode_update):
	Likewise.
	* nettle-types.h (nettle_armor_encode_update_func)
	(nettle_armor_encode_final_func, nettle_armor_decode_update_func):
	Corresponding updates to typedefs.

2017-09-14  Niels Möller  <nisse@lysator.liu.se>

	* hkdf.c: Delete unneeded includes. Use Nettle licensing notice.
	* hkdf.h: Include only nettle-types.h, not nettle-meta.h.

	* ecc-mod.c (ecc_mod): Workaround to silence a false positive from
	the clang static analyzer.

2017-09-12  Niels Möller  <nisse@lysator.liu.se>

	* testsuite/testutils.h (mpn_zero_p): Avoid redefining mpn_zero_p
	when building with mini-gmp. Since the mini-gmp update, this
	function is defined by mini-gmp, causing link errors if nettle is
	configured with --enable-mini-gmp --disable-shared. Reported by
	Tim Rühsen.

2017-09-09  Daiki Ueno  <dueno@redhat.com>

	* testsuite/ecc-mul-g-test.c (test_main): Fixed mpn_cmp call.
	* testsuite/ecc-mul-a-test.c (test_main): Likewise.
	* eccdata.c (ecc_point_out): Write to given stream, instead of
	stderr.
	* eccdata.c (output_curve): In curve448, the bit size of the order
	is slightly smaller than the one of p's. Adjust ecc_Bmodq_shifted
	accordingly.

2017-09-09  Niels Möller  <nisse@lysator.liu.se>

	* mini-gmp.c: Updated mini-gmp from the gmp repository, latest
	change from 2017-07-23.
	* mini-gmp.h: Likewise.

2017-09-06  Niels Möller  <nisse@lysator.liu.se>

	* hkdf.c (hkdf_expand): Eliminate a (signed) ssize_t variable, use
	break rather than return at loop termination.

2017-09-06  Niels Möller  <nisse@lysator.liu.se>

	HKDF implementation, contributed by Nikos Mavrogiannopoulos.
	* hkdf.c (hkdf_extract, hkdf_expand): New file, new functions.
	* hkdf.h: New file.
	* Makefile.in (nettle_SOURCES): Add hkdf.c.
	(HEADERS): Add hkdf.h.
	* testsuite/hkdf-test.c: Tests for hkdf-sha256 and hkdf-sha1.
	* testsuite/Makefile.in (TS_NETTLE_SOURCES): Added hkdf-test.c.
	* nettle.texinfo (Key derivation functions): Document HKDF.

2017-09-04  Andreas Schneider  <asn@samba.org>

	* fat-arm.c: Add missing define for _GNU_SOURCE.

2017-08-27  Niels Möller  <nisse@lysator.liu.se>

	* configure.ac (GMP_NUMB_BITS): Set to dummy value "n/a" in
	mini-gmp builds.
	(NUMB_BITS): New substituted variable which always holds the
	configured value.
	* Makefile.in (GMP_NUMB_BITS): Renamed variable...
	(NUMB_BITS): ...new name
	* config.make.in: Update corresponding substitution.

2017-08-26  Niels Möller  <nisse@lysator.liu.se>

	* ecc-mod-inv.c (ecc_mod_inv): Add missing assert. Fixes a
	"dead increment" warning from the clang static analyzer.

2017-08-26  Niels Möller  <nisse@lysator.liu.se>

	* examples/nettle-openssl.c (struct openssl_cipher_ctx): New
	struct. Use everywhere, instead of typing EVP_CIPHER_CTX pointers
	directly.

	* configure.ac: Update openssl-related tests. Checks for
	cipher-specific headers are replaced by a check for openssl/evp.h,
	and the check for the BF_ecb_encrypt function is replaced by a
	check for EVP_CIPHER_CTX_new.

2017-08-03  Daniel P. Berrange  <berrange@redhat.com>

	* examples/nettle-openssl.c: Rewritten to use openssl's EVP APIs.
	The older cipher-specific functions always use openssl's generic
	software implementation, while the EVP functions enables
	platform-specific code, e.g., using the x86 AES-NI instructions.
	(nettle_openssl_init): New function.

2017-07-18  Niels Möller  <nisse@lysator.liu.se>

	* ecc-add-eh.c (ecc_add_eh): Fix in-place operation by reordering
	two multiplies. Previously, in-place operation resulted in an
	invalid call to mpn_mul with overlapping operands. Reported by
	Sergei Trofimovich.

2017-06-09  Niels Möller  <nisse@lysator.liu.se>

	* pss.c (pss_verify_mgf1): Check for m being too large, fixing an
	assertion failure for certain invalid signatures. Based on a patch
	contributed by Daiki Ueno.

	* testsuite/rsa-pss-sign-tr-test.c (test_main): Add test case
	contributed by Daiki Ueno. Problem originally found by oss-fuzz,
	see https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=2132.
	That problem report is currently embargoed, but will hopefully be
	public in a month or two.

2017-05-23  Niels Möller  <nisse@lysator.liu.se>

	Rework the previous change, which had the unintended effect of
	always regenerating .test-rules.make after ./configure is run.
	* testsuite/Makefile.in (test-rules.stamp): New stamp file target,
	depend on Makefile.in, and run $(MAKE) test-rules.
	(.test-rules.make): Add a level of indirection, by depending on
	test-rules.stamp.

2017-05-20  Niels Möller  <nisse@lysator.liu.se>

	* testsuite/Makefile.in (test-rules): Use $(srddir)/-prefix for
	.test-rules.make target, and change dependency from Makefile.in to
	Makefile.

2017-05-17  Nikos Mavrogiannopoulos  <nmav@redhat.com>

	* testsuite/Makefile.in: Ensure .test-rules.make is regenerated
	when Makefile.in is modified.

2017-04-09  Niels Möller  <nisse@lysator.liu.se>

	* testsuite/dlopen-test.c (main): Call dlclose, to fix memory leak
	on success.

	* testsuite/pss-test.c: Delete magic to let valgrind to check if
	pss_encode_mgf1 is side-channel silent with respect to the salt
	and digest inputs. It turns out that the most significant bits of
	the padded bignum, and hence its size, depends on these inputs.
	Which results in a data-dependent branch in the normalization code
	of at the end of gmp's mpz_import.

2017-04-04  Niels Möller  <nisse@lysator.liu.se>

	* pss.c (pss_verify_mgf1): Use const for input mpz_t argument.
	(pss_encode_mgf1): Avoid unnecessary memset and xor operations.

	Merged RSA-PSS support, contributed by Daiki Ueno.
	* pss-mgf1.h, pss.h: New header files.
	* pss-mgf1.c (pss_mgf1): New file and function.
	* pss.c (pss_encode_mgf1, pss_verify_mgf1): New file and
	functions.
	* rsa-verify.c (_rsa_verify_recover): New function.
	* rsa-pss-sha256-sign-tr.c: (rsa_pss_sha256_sign_digest_tr): New
	file and function.
	* rsa-pss-sha256-verify.c (rsa_pss_sha256_verify_digest): New
	file and function.
	* rsa-pss-sha512-sign-tr.c (rsa_pss_sha384_sign_digest_tr)
	(rsa_pss_sha512_sign_digest_tr): New file and functions.
	* rsa-pss-sha512-verify.c (rsa_pss_sha384_verify_digest)
	(rsa_pss_sha512_verify_digest): New file and functions.
	* rsa.h: Prototypes for new functions.
	* testsuite/rsa-pss-sign-tr-test.c: New test case.
	* testsuite/pss-test.c: New test case.
	* testsuite/pss-mgf1-test.c: New test case.
	* Makefile.in, testsuite/Makefile.in: Added new files.
	* nettle.texinfo: Documentation of rsa-pss functions.

2017-03-20  Niels Möller  <nisse@lysator.liu.se>

	* nettle-internal.h (NETTLE_MAX_HASH_CONTEXT_SIZE): New constant.
	* testsuite/meta-hash-test.c (test_main): Add sanity check for
	NETTLE_MAX_HASH_CONTEXT_SIZE.

	* tools/nettle-hash.c (list_algorithms): Also display the internal
	context size.

2017-01-03  Nikos Mavrogiannopoulos <nmav@redhat.com>

	* ecdsa-verify.c (ecdsa_verify): Eliminated memory leak on error
	path.

2016-10-10  Niels Möller  <nisse@lysator.liu.se>

	* write-be32.c (_nettle_write_be32): Use const for source argument.
	* write-le32.c (_nettle_write_le32): Likewise.
	* write-le64.c (_nettle_write_le64): Likewise.
	* nettle-write.h: Update prototypes.

2016-10-01  Niels Möller  <nisse@lysator.liu.se>

	* Released nettle-3.3.

2016-09-13  Niels Möller  <nisse@lysator.liu.se>

	* nettle-meta-hashes.c (nettle_hashes): Added SHA3 hashes.
	Reported missing by Thomas Walter.
	* testsuite/meta-hash-test.c: Update test accordingly.

2016-09-07  Niels Möller  <nisse@lysator.liu.se>

	* nettle.texinfo (Elliptic curves): Split into sub-nodes.
	(Miscellaneous functions): Document memeql_sec.
	* NEWS: Mention memeql_sec.

2016-09-06  Niels Möller  <nisse@lysator.liu.se>

	* NEWS: Update for 3.3.

	* configure.ac: Bump package version to 3.3.
	(LIBNETTLE_MINOR): Bump library version to 6.3.
	(LIBHOGWEED_MINOR): Bump library version to 4.3.

2016-09-05  Niels Möller  <nisse@lysator.liu.se>

	* curve25519.h (NETTLE_CURVE25519_RFC7748): New preprocessor
	constant.
	* nettle.texinfo: Document it.

2016-09-03  Niels Möller  <nisse@lysator.liu.se>

	* config.make.in (.SUFFIXES): Delete no longer used .p$(OBJEXT).

	* sexp.h (TOKEN_CHAR): Delete macro and declaration of
	sexp_token_chars. They belong in tools/misc.h, not here.

	* examples/ecc-benchmark.c (die): Deleted unused function.

	* testsuite/testutils.h (US): New macro, for unsigned string
	literals.
	(LDATA): Use the US macro, to eliminate pointer signedness
	warnings.

	* testsuite/eddsa-verify-test.c (test_eddsa): Use LDATA.
	* testsuite/pbkdf2-test.c (test_main): Likewise.
	* testsuite/pkcs1-test.c (test_main): Likewise.

	* testsuite/md5-compat-test.c (test_main): Use US macro.

	* testsuite/sexp-test.c (test_main): Use const char * for assoc
	keys. Overlooked in 2016-08-16 change.

	* testsuite/yarrow-test.c (test_main): Fix pointer
	signednesss warnings.
	* testsuite/sexp-format-test.c (test_main): Likewise.
	* testsuite/rsa-encrypt-test.c (test_main): Likewise.
	* tools/nettle-lfib-stream.c (main): Likewise.
	* tools/output.c (sexp_put_string): Likewise.

	* testsuite/testutils.c (test_armor): Change ascii argument to
	const char *.
	* testsuite/base16-test.c (test_main): Use LDATA for the non-ascii
	argument to test_armor.
	* testsuite/base64-test.c (test_main): Likewise.

	* tools/nettle-pbkdf2.c (main): Fix some pointer signedness warning.
	* tools/nettle-hash.c (hash_file): Likewise.

	* examples/rsa-decrypt.c (process_file): Use memeql_sec to check
	the digest.

	* memeql-sec.c (memeql_sec): New public function, moved from...
	* ccm.c (memeql_sec): ... previous location.

	* memops.h: New header file, generalizing memxor.h.

	* testsuite/memeql-test.c (test_main): New test case.
	(memeql_sec_for_test): Wrapper to get valgrind to check for
	side-channel silence.

2016-08-29  Niels Möller  <nisse@lysator.liu.se>

	* sexp-format.c (strlen_u8): New helper function.
	(sexp_vformat): Use uint8_t * for strings instead of char *.

2016-08-16  Niels Möller  <nisse@lysator.liu.se>

	* examples/io.c (hash_file): Use uint8_t for buffer.

	* sexp.c (sexp_iterator_check_type, sexp_iterator_check_types)
	(sexp_iterator_assoc): Use const char * for caller's expression
	types. Updated all callers.

	* rsa2openpgp.c (rsa_keypair_to_openpgp): Added cast to const
	uint8_t *.

	* pgp-encode.c (write_string): New helper function, replacing...
	(WRITE): ... deleted macro.

	* examples/io.c (write_data): Renamed, and use const void * for
	the input data. Updated all callers.
	(write_string): ... old name.
	(write_file): Use const void * for the input data.

2016-08-05  Niels Möller  <nisse@lysator.liu.se>

	* examples/hogweed-benchmark.c: Use uint8_t for curve25519 values.
	(bench_rsa_init): Use unsigned char for sexp strings.
	(bench_dsa_init): Likewise.
	(hash_string): Delete length argument, calling strlen instead.
	Cast string to const uint8_t *. Updated callers.

	* examples/io.c (read_file): Use size_t for sizes, and uint8_t for
	the contents.

2016-08-04  Niels Möller  <nisse@lysator.liu.se>

	* dsa-sign.c (dsa_sign): Return failure if p is even, so that an
	invalid key doesn't result in a crash inside mpz_powm_sec.

	* rsa-sign-tr.c (rsa_compute_root_tr): Return failure if any of p,
	q or n is even, to avoid crashing inside mpz_powm_sec. Invalid
	keys with even modulo are rejected by rsa_public_key_prepare and
	rsa_private_key_prepare, but some applications, notably gnutls,
	don't use them.

2016-07-31  Niels Möller  <nisse@lysator.liu.se>

	* rsa.c (_rsa_check_size): Check that n is odd. Otherwise, using
	an invalid key may crash in mpz_powm_sec. Problem reported by
	Hanno Böck.

2016-07-13  Niels Möller  <nisse@lysator.liu.se>

	* bignum.c (nettle_mpz_from_octets): Unconditionally use
	mpz_import.
	* gmp-glue.c (mpn_copyd, mpn_copyi, mpn_zero): Deleted
	compatibility definitions for older versions of GMP.
	* gmp-glue.h (mpn_sqr): Deleted compatibility definition.
	* testsuite/testutils.c (mpz_combit): Deleted compatibility
	definition.

2016-07-12  Niels Möller  <nisse@lysator.liu.se>

	* configure.ac: Check for mpz_powm_sec, and require GMP-5.0 or
	later.
	* bignum.h (mpz_powm_sec): Fall back to plain mpz_powm for
	mini-gmp build.
	* dsa-sign.c (dsa_sign): Use mpz_powm_sec.
	* rsa-sign.c (rsa_compute_root): Likewise.
	* rsa-sign-tr.c (rsa_blind, rsa_compute_root_tr): Likewise.
	* rsa-blind.c (_rsa_blind): Likewise.

2016-05-02  Niels Möller  <nisse@lysator.liu.se>

	* nettle.texinfo: Update Curve25519 documentation.

	* testsuite/curve25519-dh-test.c: Test that inputs bits which must
	be ignored really are ignored.

2016-04-25  Niels Möller  <nisse@lysator.liu.se>

	* curve25519-mul.c (curve25519_mul): Ignore top bit of the input x
	coordinate, as required by RFC 7748.

2016-03-30  Niels Möller  <nisse@lysator.liu.se>

	From Nikos Mavrogiannopoulos.
	* configure.ac: Change dll names to follow the libtool convention
	with only major version number in the name.

2016-03-15  Niels Möller  <nisse@lysator.liu.se>

	* twofish.c (gf_multiply): Change return value to uint32_t, to
	make shifting of the return value well defined, without any type
	casts. Fixes an undefined shift in compute_s, reported by Nikos
	Mavrogiannopoulos.
	(h_byte): Deleted type casts.

	* blowfish.c (blowfish_encrypt, blowfish_decrypt): Use READ_UINT32
	macro. Fixes an undefined shift, reported by Nikos
	Mavrogiannopoulos.

	From Nikos Mavrogiannopoulos.
	* configure.ac (HOGWEED_EXTRA_SYMBOLS): Add "mp_*", when building
	with mini-gmp.
	* des.c (des_weak_p): Check that the hash value is in the proper
	range before using it. Fixes an out-of-bounds read.

2016-03-14  Niels Möller  <nisse@lysator.liu.se>

	* getopt.c (_getopt_internal_r): Fix c99-ism, move declarations to
	top of block. Reported by Henrik Grubbström.

2016-02-16  Niels Möller  <nisse@lysator.liu.se>

	* tools/input.c (sexp_get_string_length): Process advanced string
	syntax only when in advanced mode. Fixes an assertion failure
	reported by Hanno Böck, for input where advanced syntax is
	improperly wrapped inside transport syntax.

	* tools/parse.c (sexp_parse): Fail with an error message for
	unexpected ']' characters. Fixes crash reported by Hanno Böck.
	Also handle SEXP_DISPLAY (internal error) explicitly, without a
	default clause.

2016-01-28  Niels Möller  <nisse@lysator.liu.se>

	* Released nettle-3.2.

2016-01-26  Niels Möller  <nisse@lysator.liu.se>

	* tools/nettle-pbkdf2.c (main): Fix handling of unrecognized
	options. Bug reported by Dongsheng Zhang. Display usage message
	and exit non-zero. Also added "Usage: "-prefix to the message.
	* tools/nettle-hash.c (usage): New function, extracted from main.
	(main): Analogous fix for unrecognized options.

2016-01-23  Niels Möller  <nisse@lysator.liu.se>

	* nettle.texinfo: Set UPDATED-FOR to 3.2.

2016-01-21  Niels Möller  <nisse@lysator.liu.se>

	* .gitlab-ci.yml: New file. Configuration for gitlab's continuous
	integration system.

2016-01-20  Niels Möller  <nisse@lysator.liu.se>

	* testsuite/dlopen-test.c (main): Mark arguments as UNUSED.

	* testsuite/Makefile.in (clean): Delete dlopen-test.

	* configure.ac: Bump package version, to nettle-3.2.
	(LIBNETTLE_MINOR, LIBHOGWEED_MINOR): Bump minor versions, to
	libnettle.so.6.2 and and libhogweed.so.4.2.

2016-01-10  Niels Möller  <nisse@lysator.liu.se>

	* base64-encode.c (encode_raw): Use const uint8_t * for the
	alphabet argument.

	* nettle.texinfo (RSA): Document the rsa_pkcs1_verify and
	rsa_pkcs1_sign functions, and the new rsa_*_tr functions.

2015-12-18  Niels Möller  <nisse@lysator.liu.se>

	* testsuite/testutils.h: Fix include order, system headers before
	nettle headers. Always include version.h, needed by
	version-test.c. It was included indirectly via bignum.h, but only
	if configured with publickey support.

	* configure.ac (IF_DLOPEN_TEST): Fixed shell conditional.

	* testsuite/ecc-mod-test.c (test_main): Handle random seeding if
	NETTLE_TEST_SEED is set in the environment.

2015-12-15  Niels Möller  <nisse@lysator.liu.se>

	* x86_64/ecc-384-modp.asm: Fixed carry propagation bug. Problem
	reported by Hanno Böck. Simplified the folding to always use
	non-negative carry, the old code attempted to add in a carry which
	could be either positive or negative, but didn't get that case
	right.

2015-12-10  Niels Möller  <nisse@lysator.liu.se>

	* ecc-256.c (ecc_256_modp): Fixed carry propagation bug. Problem
	reported by Hanno Böck.
	(ecc_256_modq): Fixed another carry propagation bug.

2015-11-23  Niels Möller  <nisse@lysator.liu.se>

	* nettle.texinfo: Document rsa_encrypt, rsa_decrypt and
	rsa_decrypt_tr. Text contributed by Andy Lawrence.

2015-11-15  Niels Möller  <nisse@lysator.liu.se>

	* rsa.h (_rsa_blind, _rsa_unblind): Mark as deprecated.

2015-09-17  Niels Möller  <nisse@lysator.liu.se>

	* rsa-md5-sign-tr.c (rsa_md5_sign_tr, rsa_md5_sign_digest_tr): New
	file, new functions.
	* rsa-sha1-sign-tr.c (rsa_sha1_sign_tr, rsa_sha1_sign_digest_tr):
	Likewise.
	* rsa-sha256-sign-tr.c (rsa_sha256_sign_tr)
	(rsa_sha256_sign_digest_tr): Likewise.
	* rsa-sha512-sign-tr.c (rsa_sha512_sign_tr)
	(rsa_sha512_sign_digest_tr): Likewise.
	* rsa.h: Added corresponding prototypes.
	* Makefile.in (hogweed_SOURCES): Added new files.

	* testsuite/testutils.c (SIGN): Extend macro to test new
	functions, and the rsa_*_sign_digest functions. Updated callers.

2015-09-14  Niels Möller  <nisse@lysator.liu.se>

	* rsa-decrypt-tr.c (rsa_decrypt_tr): Use rsa_compute_root_tr.
	Mainly for simplicity and consistency, I'm not aware of any CRT
	fault attacks on RSA decryption.

	* testsuite/rsa-encrypt-test.c (test_main): Added test with
	invalid private key.

	* rsa-sign-tr.c (rsa_compute_root_tr): New file and function.
	* rsa.h: Declare it.
	* rsa-pkcs1-sign-tr.c (rsa_pkcs1_sign_tr): Use rsa_compute_root_tr.
	(rsa_verify_res): Deleted, replaced by rsa_compute_root_tr.
	* testsuite/rsa-sign-tr-test.c (test_rsa_sign_tr): Check that
	signature argument is unchanged on failure.
	* Makefile.in (hogweed_SOURCES): Added rsa-sign-tr.c.

2015-09-07  Niels Möller  <nisse@lysator.liu.se>

	* testsuite/rsa-sign-tr-test.c: Drop include of nettle-internal.h.
	(test_main): Fix incorrect use of sizeof, and use LDATA macro.

	From Nikos Mavrogiannopoulos.
	* rsa-pkcs1-sign-tr.c (rsa_verify_res): New function.
	(rsa_pkcs1_sign_tr): Check result of private key operation, to
	protect against hardware or software errors leaking the private
	key.
	* testsuite/rsa-sign-tr-test.c: New testcase.

2015-09-06  Niels Möller  <nisse@lysator.liu.se>

	* nettle.texinfo: Updated SHA3 documentation.

2015-09-02  Niels Möller  <nisse@lysator.liu.se>

	* testsuite/dlopen-test.c: New test program, exposing the problem
	with ifunc and RTLD_NOW.

	* testsuite/Makefile.in (TS_ALL): Conditionally add dlopen-test.
	(SOURCES): Added dlopen-test.c.
	(dlopen-test): New target, unlike other test programs, *not*
	linked with -lnettle.

	* configure.ac: Check for dlfcn.h and the dlopen function.
	(IF_DLOPEN_TEST): New substituted variable, true if dlopen is
	available and we are building a shared library.

	* fat-setup.h: Disable use of ifunc, since it breaks dlopen with
	RTLD_NOW.

2015-08-25  Niels Möller  <nisse@lysator.liu.se>

	* NEWS: Started on entries for Nettle-3.2.

	* sha3.h (NETTLE_SHA3_FIPS202): New preprocessor constant.

2015-08-24  Niels Möller  <nisse@lysator.liu.se>

	* testsuite/sha3.awk: Document origin of test vectors.

	From Nikos Mavrogiannopoulos.
	* sha3.c (_sha3_pad): Update for NIST version.
	* testsuite/sha3-224-test.c: Updated test vectors.
	* testsuite/sha3-256-test.c: Likewise.
	* testsuite/sha3-384-test.c: Likewise.
	* testsuite/sha3-512-test.c: Likewise.

2015-06-03  Niels Möller  <nisse@lysator.liu.se>

	* arm/neon/chacha-core-internal.asm: New file. 55% speedup over C
	version on Cortex-A9.

2015-05-19  Niels Möller  <nisse@lysator.liu.se>

	* configure.ac: ABI detection (n32 or n64) on Irix, and
	appropriate default for libdir. Patch from Klaus Ziegler.

2015-05-12  Niels Möller  <nisse@lysator.liu.se>

	* version.c (nettle_version_major, nettle_version_minor): New
	file. New functions, returning the value of the corresponding
	preprocessor constant.
	* Makefile.in (nettle_SOURCES): Added version.c.
	* testsuite/version-test.c: New testcase.
	* testsuite/Makefile.in (TS_NETTLE_SOURCES): Added version-test.c.

2015-04-29  Niels Möller  <nisse@lysator.liu.se>

	* arm/v6/sha256-compress.asm: Fix syntax error in offset
	addressing. Spotted by Jukka Ukkonen.
	* arm/v6/aes-decrypt-internal.asm: Drop %-prefix on r12 register.
	* arm/v6/aes-encrypt-internal.asm: Likewise.

2015-04-24  Niels Möller  <nisse@lysator.liu.se>

	* Released nettle-3.1.1.

	* configure.ac: Bump package version, to nettle-3.1.1.
	(LIBNETTLE_MINOR, LIBHOGWEED_MINOR): Bump minor versions, to
	libnettle.so.6.1 and and libhogweed.so.4.1.

2015-04-22  Niels Möller  <nisse@lysator.liu.se>

	* x86_64/gcm-hash8.asm: Use ".value" instead of ".short", since
	the latter is not supported by the Sun/Oracle assembler.

2015-04-13  Niels Möller  <nisse@lysator.liu.se>

	* configure.ac: Fix shell quoting in test of GMP_NUMB_BITS asm
	compatibility. Reported by Edward Sheldrake.

2015-04-07  Niels Möller  <nisse@lysator.liu.se>

	* Released nettle-3.1.

2015-03-31  Niels Möller  <nisse@lysator.liu.se>

	* x86_64/ecc-224-modp.asm: Require that GMP_NUMB_BITS == 64.
	* x86_64/ecc-521-modp.asm: Likewise. Note that the other
	ecc-*-modp.asm files happen to work fine on x86_64, with either 32
	or 64 bits.

	* asm.m4 (GMP_NUMB_BITS): New macro, expanding to nothing.

	* configure.ac: Move tests for compiler characteristics,
	libraries, and GMP_NUMB_BITS, before assembler-related tests.
	For files in $asm_hogweed_optional_list, check if they declare
	a GMP_NUMB_BITS requirement, and skip files which are incompatible
	with the configuration. Needed for --enable-mini-gmp om w64.

	* Makefile.in (clean-here): Unconditionally delete *.a (including
	stub libraries like *.dll.a).

2015-03-30  Niels Möller  <nisse@lysator.liu.se>

	* version.h.in (GMP_NUMB_BITS) [NETTLE_USE_MINI_GMP]: Move
	definition here (uses configure substitution).
	* bignum.h (GMP_NUMB_BITS): ...old location.

	* nettle.texinfo: Updated version number.
	(Installation): Document some more configure options.

	* testsuite/symbols-test: Look for NETTLE_USE_MINI_GMP in
	version.h, not bignum.h. Allow leading underscore on mini-gmp
	symbols.

2015-03-26  Niels Möller  <nisse@lysator.liu.se>

	* Makefile.in (PRE_CPPFLAGS): Drop -I$(srcdir), no longer needed.
	(HEADERS): Added bignum.h. Removed version.h.
	(INSTALL_HEADERS): Added version.h.
	(DISTFILES): Removed bignum.h.in.
	(bignum.h): Deleted make target.
	(distclean-here): Don't delete bignum.h.

	* configure.ac: No longer generate bignum.h.

	* bignum.h: Renamed. Removed substitution of NETTLE_USE_MINI_GMP,
	and include version.h instead.
	* bignum.h.in: ... old name.

	* version.h.in (NETTLE_USE_MINI_GMP): Substitute here.

2015-03-25  Niels Möller  <nisse@lysator.liu.se>

	* configure.ac (MAJOR_VERSION, MINOR_VERSION): Tweak sed
	expressions, to tolerate version suffixes.

	* Makefile.in (distdir): Include assembly files from the new
	x86_64/aesni, x86_64/fat, and arm/fat directories.

	* ed25519-sha512-pubkey.c: Fix stack overwrite. The digest array
	must have room for a complete sha512 digest.

2015-03-19  Niels Möller  <nisse@lysator.liu.se>

	* Makefile.in (OPT_HOGWEED_SOURCES): Deleted make variable.
	(nettle_SOURCES, hogweed_SOURCES): Don't include optional sources
	here.
	(OPT_SOURCES): New variable.
	(SOURCES): Include OPT_SOURCES.
	(DISTFILES): Drop mini-gmp.c here, included via OPT_SOURCES.
	(nettle_OBJS, hogweed_OBJS): Add the object files corresponding to
	the optional source files included in the build.

	* ecc-curve.h (nettle_curve25519): Removed public declaration.
	* ecc-internal.h (_nettle_curve25519): New location, new name.
	Updated all users.

	* nettle.texinfo: Updated EdDSA documentation.

	* Makefile.in (DISTFILES): Added version.h.in, libnettle.map.in,
	and libhogweed.map.in (latter two patch by Nikos).
	(version.h): New make target.
	(distclean-here): Added version.h, libnettle.map, and
	libhogweed.map.

	From Nikos Mavrogiannopoulos.
	* configure.ac (MAJOR_VERSION, MINOR_VERSION): New substituted
	variables.
	* version.h.in: New file, defining version numbers.

2015-03-18  Niels Möller  <nisse@lysator.liu.se>

	EdDSA interface change, use plain strings to represent keys.
	* eddsa.h (_ED25519_LIMB_SIZE): Deleted constant.
	(struct ed25519_private_key, ed25519_public_key): Deleted.
	* eddsa-expand.c (_eddsa_expand_key): Don't compute the public
	key.
	(_eddsa_expand_key_itch): Deleted function.
	* eddsa-pubkey.c (_eddsa_public_key, _eddsa_public_key_itch): New
	file, new functions.
	* ed25519-sha512-pubkey.c (ed25519_sha512_public_key): New file
	and function.
	* ed25519-sha512-verify.c (ed25519_sha512_set_public_key): Deleted
	function.
	(ed25519_sha512_verify): Use a string to represent the public key.
	* ed25519-sha512-sign.c (ed25519_sha512_set_private_key): Deleted
	function.
	(ed25519_sha512_sign): Use strings for the input key pair.
	* Makefile.in (hogweed_SOURCES): Added eddsa-pubkey.c and
	ed25519-sha512-pubkey.c.
	* testsuite/eddsa-sign-test.c (test_eddsa_sign): Adapt to
	_eddsa_expand_key changes, and use _eddsa_public_key.
	* testsuite/ed25519-test.c (test_one): Test
	ed25519_sha512_public_key, and adapt to new ed25519 interface.

2015-03-14  Niels Möller  <nisse@lysator.liu.se>

	* ccm.c (memeql_sec): New function, more side-channel silent than
	memcmp.
	(ccm_decrypt_message): Use it.

2015-03-12  Niels Möller  <nisse@lysator.liu.se>

	* base64.h (struct base64_encode_ctx): Micro optimization of
	struct layout, saving a few bytes.
	(struct base64_decode_ctx): Likewise.
	* base16.h (struct base16_decode_ctx): Likewise.

	* nettle.texinfo (ASCII encoding): Document base64url functions.

2015-03-10  Niels Möller  <nisse@lysator.liu.se>

	* nettle.texinfo: Update documentation of curve25519_mul. Say that
	the output is undefined for points belonging to the twist rather
	than the proper curve.

	* curve25519-mul.c (curve25519_mul): Changed return type to void.
	* curve25519.h (curve25519_mul): Updated prototype.
	* examples/hogweed-benchmark.c (bench_curve25519_mul): Drop check
	of curve25519_mul return value.
	* testsuite/curve25519-dh-test.c (test_a): Likewise.

2015-02-26  Niels Möller  <nisse@lysator.liu.se>

	* nettle.texinfo: Document curve25519 and eddsa.

2015-02-10  Niels Möller  <nisse@lysator.liu.se>

	* base64url-meta.c (nettle_base64url): New file.
	* nettle-meta.h (nettle_base64url): Declare it.
	* nettle-meta-armors.c (nettle_armors): Added nettle_base64url.
	* testsuite/meta-armor-test.c: Updated testcase.
	* testsuite/base64-test.c (test_main): Additional tests, using
	nettle_base64url.
	* Makefile.in (nettle_SOURCES): Added base64url-meta.c.

	Base-64 generalization to support RFC4648 URL safe alphabet,
	contributed by Amos Jeffries.
	* base64url-decode.c (base64url_decode_init): New file and
	function.
	* base64url-encode.c (base64url_encode_init): New file and
	function.
	* Makefile.in (nettle_SOURCES): Added base64url-encode.c and
	base64url-decode.c.
	* base64.h: Declare new functions.
	* testsuite/base64-test.c (test_fuzz): Test base64url encoding and
	decoding.

	* base64.h (struct base64_encode_ctx): Added pointer to alphabet.
	(struct base64_decode_ctx): Added pointer to decoding table.
	* base64-decode.c (base64_decode_init): Initialize table pointer.
	Moved definition of table to local scope.
	(base64_decode_single): Use the context's decoding table.
	* base64-encode.c (ENCODE): Added alphabet argument. Updated all
	uses.
	(encode_raw): New static function, like base64_encode_raw
	but with an alphabet argument.
	(base64_encode_raw): Call encode_raw.
	(base64_encode_init): Initialize alphabet pointer.
	(base64_encode_single, base64_encode_update, base64_encode_final):
	Use the context's alphabet.

2015-02-09  Niels Möller  <nisse@lysator.liu.se>

	* base64-encode.c (base64_encode): Deleted old #if:ed out
	function.

	* testsuite/base64-test.c (test_fuzz_once, test_fuzz): Additional
	tests, based on contribution by Amos Jeffries.

2015-02-05  Niels Möller  <nisse@lysator.liu.se>

	* configure.ac (LIBHOGWEED_MAJOR): Undo latest bump, 4 should be
	enough (previous release, nettle-3.0, used 3).

2015-01-30  Niels Möller  <nisse@lysator.liu.se>

	Update chacha-poly1305 for draft-irtf-cfrg-chacha20-poly1305-08.
	* chacha-poly1305.h (CHACHA_POLY1305_NONCE_SIZE): Increase to 12
	bytes, i.e., CHACHA_NONCE96_SIZE.
	* chacha-poly1305.c (chacha_poly1305_set_nonce): Use
	chacha_set_nonce96.
	(poly1305_pad): New function.
	(chacha_poly1305_encrypt): Use poly1305_pad.
	(chacha_poly1305_digest): Call poly1305_pad, and format length
	fields as a single poly1305 block.

	* chacha-set-nonce.c (chacha_set_nonce96): New function.
	* chacha.h (CHACHA_NONCE96_SIZE): New constant.
	* testsuite/chacha-test.c: Add test for chacha with 96-bit nonce.

2015-01-27  Niels Möller  <nisse@lysator.liu.se>

	* ecc.h: Deleted declarations of unused itch functions. Moved
	declarations of internal functions to...
	* ecc-internal.h: ...new location. Also added a leading under
	score on the symbols.
	(ecc_a_to_j, ecc_j_to_a, ecc_eh_to_a, ecc_dup_jj, ecc_add_jja)
	(ecc_add_jjj, ecc_dup_eh, ecc_add_eh, ecc_add_ehh, ecc_mul_g)
	(ecc_mul_a, ecc_mul_g_eh, ecc_mul_a_eh): Affected functions.

2015-01-26  Niels Möller  <nisse@lysator.liu.se>

	* ecc-add-eh.c (ecc_add_eh_itch): Deleted.
	* ecc-add-ehh.c (ecc_add_ehh_itch): Deleted.
	* ecc-add-jja.c (ecc_add_jja_itch): Deleted.
	* ecc-add-jjj.c (ecc_add_jjj_itch): Deleted.
	* ecc-dup-eh.c (ecc_dup_eh_itch): Deleted.
	* ecc-dup-jj.c (ecc_dup_jj_itch): Deleted.
	* ecc-eh-to-a.c (ecc_eh_to_a_itch): Deleted.
	* ecc-j-to-a.c (ecc_j_to_a_itch): Deleted.
	* ecc-mul-a-eh.c (ecc_mul_a_eh_itch): Deleted.
	* ecc-mul-a.c (ecc_mul_a_itch): Deleted.
	* ecc-mul-g-eh.c (ecc_mul_g_eh_itch): Deleted.
	* ecc-mul-g.c (ecc_mul_g_itch): Deleted.

2015-01-25  Niels Möller  <nisse@lysator.liu.se>

	* arm/fat/sha1-compress-2.asm: New file.
	* arm/fat/sha256-compress-2.asm: Likewise.
	* fat-arm.c (fat_init): Setup for use of additional v6 assembly
	functions.

	* sha1-compress.c: Prepare for fat build with C and assembly
	implementations.
	* sha256-compress.c: Likewise.

	* fat-setup.h (sha1_compress_func, sha256_compress_func): New typedefs.

	* configure.ac (asm_nettle_optional_list): Added
	sha1-compress-2.asm and sha256-compress-2.asm, and corresponding
	HAVE_NATIVE_*.

	From Martin Storsjö:
	* arm: Add .arch directives for armv6. This allows building these
	files as part of a fat build, even if the assembler by default
	targets a lower architecture version.

2015-01-23  Niels Möller  <nisse@lysator.liu.se>

	* fat-setup.h (DEFINE_FAT_FUNC): Check value of function pointer,
	before calling fat_init. Should be correct even without memory
	barrier.
	* fat-x86_64.c (fat_init): Deleted static variable initialized.
	The checks of the relevant pointer in DEFINE_FAT_FUNC is more
	robust.
	* fat-arm.c (fat_init): Likewise.

2015-01-21  Niels Möller  <nisse@lysator.liu.se>

	* fat-arm.c (fat_init): Setup for use of neon assembly functions.

	* arm/fat/salsa20-core-internal-2.asm: New file.
	* arm/fat/sha3-permute-2.asm: New file.
	* arm/fat/sha512-compress-2.asm: New file.
	* arm/fat/umac-nh-2.asm: New file.
	* arm/fat/umac-nh-n-2.asm: New file.

	* salsa20-core-internal.c: Prepare for fat build with C and
	assembly implementations.
	* sha512-compress.c: Likewise.
	* sha3-permute.c: Likewise.
	* umac-nh.c: Likewise.
	* umac-nh-n.c: Likewise.

	* configure.ac (asm_nettle_optional_list): Added more *-2.asm
	files, and corresponding HAVE_NATIVE_* defines. Recognize PROLOGUE
	macro in asm files, also when not at the start of the line.

2015-01-20  Niels Möller  <nisse@lysator.liu.se>

	* fat-arm.c (get_arm_features): Check NETTLE_FAT_OVERRIDE
	environment variable.

	* fat-x86_64.c (get_x86_features): New function. Check
	NETTLE_FAT_OVERRIDE environment variable.
	(fat_init): Use it.

	* fat-setup.h (secure_getenv) [!HAVE_SECURE_GETENV]: Dummy
	definition, returning NULL.
	(ENV_OVERRIDE): New constant.

	* configure.ac: Check for secure_getenv function.

2015-01-19  Niels Möller  <nisse@lysator.liu.se>

	* configure.ac: Fat library setup for arm.
	* fat-arm.c: New file.
	* arm/fat/aes-encrypt-internal.asm: New files.
	* arm/fat/aes-encrypt-internal-2.asm: New file.
	* arm/fat/aes-decrypt-internal.asm: New file.
	* arm/fat/aes-decrypt-internal-2.asm: New file.

	* Makefile.in (DISTFILES): Added fat-setup.h.

	* fat-setup.h: New file, declarations moved from...
	* fat-x86_64.c: ... old location

2015-01-17  Niels Möller  <nisse@lysator.liu.se>

	* fat-x86_64.c (DECLARE_FAT_FUNC, DEFINE_FAT_FUNC)
	(DECLARE_FAT_FUNC_VAR): New macros, to define needed resolver and
	wrapper functions.

	* config.m4.in (SYMBOL_PREFIX): Define from from autoconf
	ASM_SYMBOL_PREFIX.
	(C_NAMS): move definition to...
	* asm.m4 (C_NAME): Define here, also take fat_transform.
	(fat_suffix): Replaced by...
	(fat_transform): New macro, taking symbol name as argument.
	Updated all uses of fat_suffix.
	* fat-x86_64.c: Updated for internal "_nettle" prefix on
	cpu-specific memxor functions.

	* fat-x86_64.c: Set up for sse2 vs non-sse2 memxor. Patch by Nikos
	Mavrogiannopoulos.
	* configure.ac (asm_nettle_optional_list): Added memxor-2.asm.
	* x86_64/fat/memxor-2.asm: New file.
	* x86_64/fat/memxor.asm: New file.

	* x86_64/memxor.asm: Use ifdef, not ifelse, for testing USE_SSE2.

2015-01-16  Niels Möller  <nisse@lysator.liu.se>

	* configure.ac (OPT_NETTLE_SOURCES): New substituted variable.
	(asm_path): Fixed x86_64 fat setup. Include only x86_64 and
	x86_64/fat in the asm_path. Put fat-x86_64.c in
	OPT_NETTLE_SOURCES, with no symlinking.

	* fat-x86_64.c: Renamed,...
	* x86_64/fat/fat.c: ... from old name.

2015-01-13  Niels Möller  <nisse@lysator.liu.se>

	* x86_64/fat/fat.c: For constructor hack, check
	HAVE_GCC_ATTRIBUTE, not __GNUC__. Also support sun compilers, as
	suggested by Nikos Mavrogiannopoulos, and attch the constructor
	attribute directly to fat_init.
	(fat_constructor): Deleted wrapper function.

	* x86_64/fat/fat.c: New file, initialization for x86_64 fat
	library.

	* x86_64/fat/cpuid.asm (_nettle_cpuid): New file and function.

	* x86_64/fat/aes-encrypt-internal.asm: New file, including
	x86_64/aes-encrypt-internal.asm, after setting fat_suffix to
	_x86_64.
	* x86_64/fat/aes-decrypt-internal.asm: New file, analogous setup.
	* x86_64/fat/aes-encrypt-internal-2.asm: New file, including
	x86_64/aesni/aes-encrypt-internal.asm, after setting fat_suffix to
	_aesni.
	* x86_64/fat/aes-decrypt-internal.asm-2: New file, analogous
	setup.

	* configure.ac: New command line option --enable-fat.
	(asm_nettle_optional_list): Added cpuid.asm, fat.c,
	aes-encrypt-internal-2.asm, and aes-decrypt-internal-2.asm.

	* asm.m4 (fat_suffix): New suffix added to symbol names.

	* x86_64/aesni/aes-encrypt-internal.asm: Use explicit .byte
	sequences for aes instructions, don't rely on assembler support.
	* x86_64/aesni/aes-decrypt-internal.asm: Likewise.

	* aclocal.m4 (NETTLE_CHECK_IFUNC): New macro, checking for ifunc
	and settting HAVE_LINK_IFUNC if working.
	* configure.ac: Use it.

2015-01-12  Niels Möller  <nisse@lysator.liu.se>

	* asm.m4 (DECLARE_FUNC): New macro, extracted from PROLOGUE.
	(PROLOGUE): Use it.

	* configure.ac (OPT_NETTLE_OBJS, OPT_HOGWEED_OBJS): Renamed
	substituted variables, and list the object files rather than
	source files.
	(OPT_ASM_NETTLE_SOURCES, OPT_ASM_HOGWEED_SOURCES): ...Old names.
	* Makefile.in (OPT_NETTLE_OBJS, OPT_HOGWEED_OBJS): Use new
	variables.

2015-01-11  Niels Möller  <nisse@lysator.liu.se>

	* x86_64/aesni/aes-decrypt-internal.asm: New file.
	* x86_64/aesni/aes-encrypt-internal.asm: New file.
	* configure.ac: New configure flag --enable-x86-aesni.

	* aclocal.m4 (LSH_RPATH_INIT): Handle freebsd, in the same way as
	gnu/linux, with -Wl,-rpath,.

	Merged memxor-reorg changes, starting at 2014-10-23.

2015-01-10  Niels Möller  <nisse@lysator.liu.se>

	* arm/memxor.asm (memxor3): Moved to new file.
	* arm/memxor3.asm: New file.

2014-11-24  Niels Möller  <nisse@lysator.liu.se>

	* x86_64/memxor3.asm (memxor3): New file, code moved from old
	memxor.asm.
	* x86_64/memxor.asm (memxor): Rewritten, no longer jumps into
	memxor3.

	* configure.ac (asm_replace_list): Added memxor.asm and
	memxor3.asm.

2014-10-23  Niels Möller  <nisse@lysator.liu.se>

	* configure.ac (IF_ASM): New substituted variable.
	* testsuite/Makefile.in (VALGRIND): Allow partial loads only when
	build includes assembly files.

	* memxor-internal.h (READ_PARTIAL): New macro.
	* memxor.c (memxor_different_alignment): Avoid out-of-bounds
	reads, corresponding to valgrind's --partial-loads-ok. Use
	READ_PARTIAL.
	* memxor3.c: Analogous changes for unaligned operations.

	* configure.ac (asm_replace_list): Deleted memxor.asm, now
	incompatible with the memxor/memxor3 split.

	* memxor3.c: New file, split off from memxor.c.
	* memxor-internal.h: New file, declarations shared by memxor.c and
	memxor3.c.
	* memxor.c: memxor3 functions moved out from this file.
	* Makefile.in (nettle_SOURCES): Added memxor3.c.
	(DISTFILES): Added memxor-internal.h.

	* memxor.c (memxor_common_alignment, memxor_different_alignment)
	(memxor): Change loop order, iterate from the end.
	(memxor3_common_alignment): Unroll twice.
	(word_t): On x86_64, unconditionally define as uint64_t, to get 64
	bits also in M$ windows. Replaced all uses of SIZEOF_LONG.

2014-12-12  Niels Möller  <nisse@lysator.liu.se>

	* cbc.h (CBC_ENCRYPT, CBC_DECRYPT): Make type-checking hack
	stricter, warn if type of length argument is smaller than size_t.
	* ctr.h (CTR_CRYPT): Likewise.
	* eax.h (EAX_SET_KEY, EAX_SET_NONCE, EAX_UPDATE, EAX_ENCRYPT)
	(EAX_DECRYPT, EAX_DIGEST): Likewise.
	* gcm.h (GCM_SET_KEY, GCM_ENCRYPT, GCM_DECRYPT, GCM_DIGEST):
	Likewise.

2014-12-08  Niels Möller  <nisse@lysator.liu.se>

	* aclocal.m4 (LD_VERSION_SCRIPT): Linker scripts no longer located
	in the source tree.

	* configure.ac (LIBNETTLE_MAJOR): Bump major number, now 6.
	(LIBHOGWEED_MAJOR): Bump major number, now 5.

	From Nikos Mavrogiannopoulos. Support for versioned symbols.
	* aclocal.m4 (LD_VERSION_SCRIPT): New macro. Substitute
	EXTRA_LINKER_FLAGS and EXTRA_HOGWEED_LINKER_FLAGS.
	* configure.ac: Use LD_VERSION_SCRIPT. Generate libnettle.map
	and libhogweed.map.
	(HOGWEED_EXTRA_SYMBOLS): New substituted variable.
	* libnettle.map.in: New file, libnettle.so linker script
	* libhogweed.map.in: New file, libhogweed.so linker script.
	* Makefile.in ($(LIBNETTLE_FORLINK)): Use EXTRA_LINKER_FLAGS.
	($(LIBHOGWEED_FORLINK)): Use EXTRA_HOGWEED_LINKER_FLAGS.

2014-11-24  Niels Möller  <nisse@lysator.liu.se>

	* gcm.h (GCM_SET_KEY): Rename macro argument KEY to avoid
	collision with a struct tag. Spotted by Nikos Mavrogiannopoulos.

	* testsuite/eddsa-verify-test.c (test_eddsa): Fixed test case bug,
	showing up as use of uninitialized data with valgrind.

2014-10-23  Niels Möller  <nisse@lysator.liu.se>

	* examples/nettle-benchmark.c (time_memxor): Allocate buffers as
	arrays of unsigned long, for more reliable alignment.

2014-10-22  Niels Möller  <nisse@lysator.liu.se>

	* configure.ac: Check for getline function.
	* testsuite/ed25519-test.c (getline) [!HAVE_GETLINE]: Fallback
	definition.

	* Makefile.in (clean-here): Unconditionally delete .so and .dll
	files.
	(IMPLICIT_TARGETS): Deleted variable.

2014-10-21  Niels Möller  <nisse@lysator.liu.se>

	* testsuite/ed25519-test.c: New test case. Optionally reads the
	file pointed to by $ED25519_SIGN_INPUT.

	* testsuite/testutils.c (tstring_hex): Rewrite, using Nettle's
	base16 functions.
	(decode_hex, decode_hex_length): Deleted functions.

2014-10-20  Niels Möller  <nisse@lysator.liu.se>

	* eddsa.h (ED25519_KEY_SIZE): New constant.
	(ED25519_SIGNATURE_SIZE): New constant.
	(struct ed25519_private_key): New struct.
	(struct ed25519_public_key): New struct.

	* ed25519-sha512-sign.c (ed25519_sha512_set_private_key)
	(ed25519_sha512_sign): New file and functions.
	* ed25519-sha512-verify.c (ed25519_sha512_set_public_key)
	(ed25519_sha512_verify): New file and functions.
	* Makefile.in (hogweed_SOURCES): Added ed25519-sha512-sign.c and
	ed25519-sha512-verify.c.


2014-10-18  Niels Möller  <nisse@lysator.liu.se>

	* eddsa-verify.c (_eddsa_verify): Change argument order, putting A
	before ctx.
	* eddsa.h: Updated prototype.
	* testsuite/eddsa-verify-test.c (test_eddsa): Updated
	_eddsa_verify calls.

2014-10-14  Niels Möller  <nisse@lysator.liu.se>

	* eddsa-verify.c (equal_h): New function.
	(_eddsa_verify): Use it for a proper point compare, replacing an
	ecc_add_ehh.

	* testsuite/eddsa-verify-test.c: New testcase.
	* testsuite/Makefile.in (TS_HOGWEED_SOURCES): Added
	eddsa-verify-test.c.

	* eddsa-verify.c (_eddsa_verify, eddsa_verify_itch): New file, new
	functions.
	* eddsa.h: Declare new functions.
	* Makefile.in (hogweed_SOURCES): Added eddsa-verify.c.

2014-10-08  Niels Möller  <nisse@lysator.liu.se>

	* testsuite/eddsa-sign-test.c (test_eddsa_sign): Use
	_eddsa_expand_key, and check its public key output.

	* eddsa-expand.c (_eddsa_expand_key): New file, new function.
	* eddsa.h (_eddsa_expand_key): Declare it.
	* Makefile.in (hogweed_SOURCES): Added eddsa-expand.c.

	* eddsa-sign.c: Drop unneeded include of nettle-internal.h.

2014-10-04  Niels Möller  <nisse@lysator.liu.se>

	* testsuite/eddsa-sign-test.c: New testcase.
	* testsuite/Makefile.in (TS_HOGWEED_SOURCES): Added
	eddsa-sign-test.c.

	* eddsa-sign.c (_eddsa_sign, _eddsa_sign_itch): New file, new
	functions.
	* eddsa-hash.c (_eddsa_hash): New file and function.
	* eddsa.h: Declare new functions.
	* Makefile.in (hogweed_SOURCES): Added eddsa-hash.c and
	eddsa-sign.c.

2014-10-03  Niels Möller  <nisse@lysator.liu.se>

	* testsuite/ecc-redc-test.c [NETTLE_USE_MINI_GMP]: Enable test.
	(test_main): Replace gmp_fprintf calls.
	* testsuite/ecc-mul-a-test.c: Likewise.
	* testsuite/ecc-mul-g-test.c: Likewise.

	* testsuite/ecc-modinv-test.c [NETTLE_USE_MINI_GMP]: Enable test.
	(ref_modinv): Use mpz_gcdext, instead of mpn_gcdext.
	(test_modulo): Replace gmp_fprintf calls.

	* testsuite/ecc-mod-test.c [NETTLE_USE_MINI_GMP]: Enable test.
	(ref_mod): Use mpz_mod and mpz_limbs_copy, instead of mpn_tdiv_qr.
	(test_modulo): Replace gmp_fprintf calls by plain fprintf and
	mpn_out_str.

	* testsuite/testutils.c (mpn_out_str): New function, needed to
	replace uses of gmp_fprintf.

	* testsuite/ecc-sqrt-test.c (mpz_ui_kronecker)
	[NETTLE_USE_MINI_GMP]: New fallback definition when building with
	mini-gmp.
	* testsuite/testutils.c (gmp_randinit_default)
	[NETTLE_USE_MINI_GMP]: Likewise.
	(mpz_urandomb): Likewise.
	* testsuite/testutils.h (gmp_randstate_t) [NETTLE_USE_MINI_GMP]:
	Fallback typedef, using knuth_lfib_ctx.

2014-10-02  Niels Möller  <nisse@lysator.liu.se>

	* testsuite/eddsa-compress-test.c: New testcase.
	* testsuite/Makefile.in (TS_HOGWEED_SOURCES): Added
	eddsa-compress-test.c.

	* eddsa-decompress.c (_eddsa_decompress): New file, new function.
	* eddsa-compress.c (_eddsa_compress): New file, new function.
	* eddsa.h: New file.
	* Makefile.in (HEADERS): Added eddsa.h.
	(hogweed_SOURCES): Added eddsa-compress.c and eddsa-decompress.c.

	* testsuite/ecc-sqrt-test.c: New test case.
	* testsuite/Makefile.in (TS_HOGWEED_SOURCES): Added
	ecc-sqrt-test.c.

	* ecc-25519.c (PHIGH_BITS): Always define this constant.
	(ecc_25519_zero_p): New function.
	(ecc_25519_sqrt): Take a ratio u/v as input. Added scratch
	argument. Made static.
	* ecc-internal.h (ecc_mod_sqrt_func): New typedef.
	(struct ecc_modulo): Added sqrt_itch and sqrt function pointer.
	Updated all instances.
	(ecc_25519_sqrt): Deleted declaration, function now static.

2014-09-24  Niels Möller  <nisse@lysator.liu.se>

	* curve25519.h [__cplusplus]: Fixed extern "C" block.

2014-09-23  Niels Möller  <nisse@lysator.liu.se>

	* ecc-hash.c (ecc_hash): Changed argument type from struct
	ecc_curve to struct ecc_modulo. Updated callers.
	* testsuite/ecdsa-sign-test.c (test_main): Updated curve25519
	signature s. Changed since the hash value is truncated a few bits
	more, to match the size of q.
	* testsuite/ecdsa-verify-test.c (test_main): Likewise.

	* testsuite/ecc-modinv-test.c (zero_p): New function, checking for
	zero modulo p.
	(test_modulo): Use zero_p. Switch to dynamic allocation. Updated
	for larger modinv result area, and use invert_itch.

	* ecc-25519.c (ecc_mod_pow_2kp1): Renamed, and take a struct
	ecc_modulo * as argument.
	(ecc_modp_powm_2kp1): ... old name.
	(ecc_mod_pow_252m3): New function, extracted from ecc_25519_sqrt.
	(ecc_25519_inv): New modp invert function, about 5.5 times faster
	then ecc_mod_inv.
	(ecc_25519_sqrt): Use ecc_mod_pow_252m3.
	(nettle_curve25519): Point to ecc_25519_inv. Updated p.invert_itch
	and h_to_a_itch.

	* ecc-internal.h (struct ecc_modulo): New field invert_itch.
	Updated all implementations.
	(ECC_EH_TO_A_ITCH): Updated, and take invert itch as an argument.
	* ecc-eh-to-a.c (ecc_eh_to_a_itch): Take invert scratch into account.

	* testsuite/testutils.c (test_ecc_mul_h): Use ecc->h_to_a_itch.

	* ecc-mod-inv.c (ecc_mod_inv): Interface change, make ap input
	const, and require 2n limbs at rp. Preparing for powm-based
	alternative implementations. Drop #if:ed out code and dp
	temporary. Updated all callers, more complicated cases described
	below.
	* ecc-internal.h (typedef ecc_mod_inv_func): Added const to input
	argument.
	(ECC_MOD_INV_ITCH): Renamed, was ECC_MODINV_ITCH, and reduced to
	2*n.
	* ecc-ecdsa-verify.c (ecc_ecdsa_verify): Overhauled allocation,
	putting mod_inv scratch at the end.

2014-09-22  Niels Möller  <nisse@lysator.liu.se>

	* ecc-random.c (ecc_mod_random): Renamed, and take a const struct
	ecc_modulo * as argument. Updated callers.
	(ecc_modq_random): ... old name.

	* ecc-mod-arith.c: New file, replacing ecc-modp.c and ecc-modq.c.
	All functions take a struct ecc_modulo as argument.
	(ecc_mod_add, ecc_mod_sub, ecc_mod_mul_1, ecc_mod_addmul_1)
	(ecc_mod_submul_1, ecc_mod_mul, ecc_mod_sqr): New functions,
	replacing the corresponding ecc_modp_* functions. For convenience,
	old names are defined as macros wrapping the new functions.
	* ecc-modp.c: Deleted file.
	* ecc-modq.c: Deleted file.
	* Makefile.in (hogweed_SOURCES): Updated accordingly.

	* testsuite/ecc-redc-test.c (test_main): Relaxed tests for which
	tests to run.

	* testsuite/ecc-modinv-test.c (test_modulo): New function, same
	organization as in ecc-mod-test.c below.

	* testsuite/ecc-mod-test.c (test_modulo): New function, testing
	one modulo. Replacing...
	(test_curve): ... old function.
	(test_main): Invoke test_modulo for p and q of each curve.

	* ecc-internal.h (ecc_mod_inv_func): New typedef.
	(struct ecc_modulo): Added mp1h constant and invert function
	pointer. Updated all callers.
	* ecc-modp.c (ecc_modp_inv): Deleted wrapper function.
	* ecc-modq.c (ecc_modq_inv): Deleted wrapper function.

	* ecc-mod-inv.c (ecc_mod_inv): Renamed file and function. Also
	take a struct ecc_modulo * as argument.
	* sec-modinv.c (sec_modinv): ... the old names. Deleted.
	* Makefile.in (hogweed_SOURCES): Updated accordingly.

	* examples/ecc-benchmark.c (bench_modinv_powm, bench_curve):
	Updated benchmarking of mpn_sec_powm.

	* ecc-internal.h (struct ecc_curve): Deleted redc function
	pointer. Use only reduce pointer, which is redc or modp as
	applicable. Updated all users.
	(struct ecc_modulo): Moved mod and reduce function pointers to
	this struct.

	* ecc-generic-modp.c (ecc_generic_modp): Deleted file and
	function. We no longer need a wrapper around ecc_mod.
	* ecc-generic-modq.c (ecc_generic_modq): Likewise deleted.
	* Makefile.in (hogweed_SOURCES): Removed ecc-generic-modp.c and
	ecc-generic-modq.c.

	* ecc-internal.h (typedef ecc_mod_func): Take a const struct
	ecc_modulo * argument, not const struct ecc_curve *. Updated all
	implementations and all callers.

	* ecc-mod.c (ecc_mod): Use struct ecc_modulo to specify the
	modulo. Drop input size argument, always reduce from 2*size to
	size.

	* ecc-internal.h (struct ecc_modulo): New struct, collecting
	constants needed for modulo arithmetic.
	(struct ecc_curve): Use struct ecc_modulo for p and q arithmetic.
	Updated all ecc-related files.

2014-09-17  Niels Möller  <nisse@lysator.liu.se>

	* gmp-glue.c (mpn_get_base256_le): Fixed missing update of rn
	counter, making the function clear some bytes beyond the end of
	the output buffer. The bug triggered a make check failure on ARM.

	* testsuite/testutils.c (ecc_curves): Include curve25519 in list.
	(test_ecc_mul_a): Include reference points for curve25519 (with
	Edwards coordinates). Allow n == 0 and n == 1, comparing to zero
	and the generator, respectively.
	* testsuite/ecc-add-test.c (point_zero_p): Deleted function.
	(test_main): Replace calls to point_zero_p by calls to
	test_ecc_mul_h with n == 0.
	* testsuite/ecc-dup-test.c: Likewise.

	* testsuite/ecc-modinv-test.c (mpn_zero_p): Moved function, to...
	* testsuite/testutils.c (mpn_zero_p): New location. Also make
	non-static.

	* testsuite/ecdsa-keygen-test.c (ecc_valid_p): Add special case
	for curve25519.

	* testsuite/ecc-mul-a-test.c (test_main): Fix point negation to
	support curve25519.
	* testsuite/ecc-mul-g-test.c (test_main): Likewise.

	* ecc-a-to-eh.c (ecc_a_to_eh_itch, ecc_a_to_eh): Deleted file and
	functions.
	* ecc.h: Deleted corresponding declarations.
	* ecc-internal.h (ECC_A_TO_EH_ITCH): Deleted macro.
	* Makefile.in (hogweed_SOURCES): Removed ecc-a-to-eh.c.

	* testsuite/ecdh-test.c (test_main): Update curve25519 test to use
	Edwards coordinates.
	* testsuite/ecdsa-sign-test.c (test_main): Likewise.
	* testsuite/ecdsa-verify-test.c (test_main): Likewise.

	* ecc-point.c (ecc_point_set): Use Edwards rather than Montgomery
	curve.

	* ecc-mul-a-eh.c (ecc_mul_a_eh, table_init): Take an Edwards point
	as input, not a Montgomery point. Hence, use ecc_a_to_j, not
	ecc_a_to_eh.

	* ecc-eh-to-a.c (ecc_eh_to_a): Just convert to affine coordinates,
	don't transform from Edwards to Montgomery form. Also reduces
	scratch need slightly.
	* ecc-internal.h (ECC_EH_TO_A_ITCH): Reduced.

	* ecdsa-keygen.c (ecdsa_generate_keypair): Use struct ecc_curve
	function pointers.

	* testsuite/curve25519-dup-test.c: Deleted file. In the way for
	conversion to Edwards coordinate convention, and in the end
	the tests will be done by ecc-dup-test.c.
	* testsuite/curve25519-add-test.c: Similarly deleted.
	* testsuite/Makefile.in (TS_HOGWEED_SOURCES): Removed
	curve25519-dup-test.c and curve25519-add-test.c.

2014-09-16  Niels Möller  <nisse@lysator.liu.se>

	* testsuite/ecc-add-test.c: New generalized testcase, to replace
	curve25519-add-test.c.
	* testsuite/ecc-dup-test.c: New generalized testcase, to replace
	curve25519-dup-test.c.
	* testsuite/Makefile.in (TS_HOGWEED_SOURCES): Added ecc-add-test.c
	and ecc-dup-test.c.

2014-09-14  Niels Möller  <nisse@lysator.liu.se>

	* testsuite/ecc-mul-a-test.c (test_main): Use struct ecc_curve
	function pointers.
	* testsuite/ecc-mul-g-test.c (test_main): Likewise.

2014-09-09  Niels Möller  <nisse@lysator.liu.se>

	* curve25519-mul.c (curve25519_mul): Switch to use Montgomery
	ladder. About 20% faster than current Edwards curve operations.
	Difference is expected to shrink when Edwards operations are
	optimized to take advantage of the twist, but it seems unlikely to
	get significantly faster than the Montgomery ladder.

	* gmp-glue.c (cnd_swap): Moved function here, made non-static.
	Changed cnd type to mp_limb_t, for consistency with GMP
	mpn_cnd_add_n.
	* sec-modinv.c (cnd_swap): ... old location.
	* gmp-glue.h (cnd_swap): Declare function.

2014-09-06  Niels Möller  <nisse@lysator.liu.se>

	* examples/hogweed-benchmark.c (bench_curve25519_mul_g)
	(bench_curve25519_mul, bench_curve25519): New functions.
	(main): Added benchmarking of curve25519 functions.

2014-09-03  Niels Möller  <nisse@lysator.liu.se>

	* Makefile.in: Revert 2013-02-06 Makefile changes: use a single
	rule for transforming .asm to .o, and drop include of asm.d.
	Possible now since we generate a single object file from each asm
	file. This change also helps Solaris' make recognize .asm files.
	* config.make.in (.SUFFIXES): Drop .s from list.
	* configure.ac: Delete code to generate asm.d.

	* Makefile.in: Delete all uses of *.po files, use the same object
	files for both shared and static libraries.
	* configure.ac (dummy-dep-files): Don't create any .po.d files.

	* aclocal.m4 (LSH_CCPIC): Don't substitute CCPIC here, let
	configure.ac do that if needed.

	* configure.ac (CCPIC_MAYBE, SHLIBCFLAGS): Deleted substituted
	variables. Instead, use CCPIC directly when compiling all library
	files.
	(CCPIC): Set to empty, if --disable-pic is used.

	* config.make.in (SHLIBCFLAGS, CCPIC_MAYBE): Deleted.
	(COMPILE, COMPILE_CXX): Drop CCPIC. New variable EXTRA_CFLAGS,
	which can be set by individual Makefiles.

	* Makefile.in (EXTRA_CFLAGS): Set using CCPIC.
	Also delete all uses of CCPIC_MAYBE and SHLIBCFLAGS.

2014-09-02  Niels Möller  <nisse@lysator.liu.se>

	* curve25519-eh-to-x.c (curve25519_eh_to_x): New file, new
	function. The curve25519 transform currently done by ecc_eh_to_a,
	but which should eventually be eliminted from that function.
	* Makefile.in (hogweed_SOURCES): Added curve25519-eh-to-x.c.
	* ecc-internal.h (curve25519_eh_to_x): Declare it.

	* curve25519-mul.c (curve25519_mul): Use it.
	* curve25519-mul-g.c (curve25519_mul_g): Likewise. Also introduce
	local variable ecc, and use ecc->mul_g_itch.

2014-08-29  Niels Möller  <nisse@lysator.liu.se>

	* testsuite/testutils.c (test_ecc_mul_j): Renamed, to ...
	(test_ecc_mul_h): ... new name. Use ecc->h_to_a function pointer.
	Updated callers.

	* examples/ecc-benchmark.c (bench_add_jjj): Renamed, to ...
	(bench_add_hhh): ... new name. Use ecc->add_hhh function pointer.
	(bench_add_ehh): Deleted.
	(bench_curve): Use bench_add_hhh for all curves. Use ecc->mul_itch
	for scratch size.

	Switch the curve25519 implementation to use the isomorphism to the
	twisted Edwards curve which is used for Ed25519 signatures.
	* eccdata.c (ecc_curve_init): Tweaked the transformation constant
	for the isomorphism between curve25519 and the twisted Edwards
	curve.
	* ecc-add-ehh.c (ecc_add_ehh): Updated formulas for the twist curve.
	* ecc-add-eh.c (ecc_add_eh): Likewise.
	* ecc-dup-eh.c (ecc_dup_eh): Likewise.

2014-08-28  Niels Möller  <nisse@lysator.liu.se>

	* ecdsa-verify.c (ecdsa_verify): Drop include of ecc-internal.h,
	use ecc_size function instead.

	* ecc-ecdsa-verify.c (ecc_ecdsa_verify): Use the struct ecc_curve
	function pointers: mul, mul_g, add_hhh, h_to_a.

	* ecc-internal.h (ECC_ECDSA_VERIFY_ITCH): Deleted macro. Needed
	scratch depends on curve type, not just size.
	(ecc_add_func): New typedef.
	(struct ecc_curve): New function pointer add_hhh, and constant
	add_hhh_itch. Updated all instances.

	* ecdsa-verify.c (ecdsa_verify): Use the ecc_ecdsa_verify_itch
	function, not the corresponding macro.
	* ecc-ecdsa-verify.c (ecc_ecdsa_verify_itch): Take ecc->mul_itch
	into account. Also reduce to 5*ecc->size + ecc->mul_itch.

	* testsuite/ecdsa-sign-test.c (test_main): Added test for the
	obscure case of ecdsa using curve25519.
	* testsuite/ecdsa-verify-test.c (test_main): Likewise (depends on
	above changes).

	* ecc-ecdsa-sign.c (ecc_ecdsa_sign): Use mul_g and h_to_a function
	pointers. Implies (obscure) support for curve25519.

	* ecc-25519.c (ecc_25519_modq): Access q via the ecc struct.

	* ecc-eh-to-a.c (ecc_eh_to_a): Analogous change as for ecc_j_to_a.
	The modulo q case (op == 2) is hardcoded for curve25519.

	* ecc-j-to-a.c (ecc_j_to_a): For curves using redc, always convert
	back from redc form. When producing x coordinate only, optionally
	reduce it modulo q. Completely changes the meaning of the "flags"
	argument, and renames it to "op". Update all users of this
	function or ecc->h_to_a.

	* ecc-ecdsa-sign.c (ecc_ecdsa_sign): Use new ecc_j_to_a modulo q
	feature.
	* ecc-ecdsa-verify.c (ecc_ecdsa_verify): Likewise.

	* testsuite/symbols-test: Regexp fixes, to better filter out
	get_pc_thunk functions.

	* ecc-generic-redc.c (ecc_generic_redc): Deleted file and
	function. Split into...
	* ecc-pp1-redc.c (ecc_pp1_redc): New file and function.
	* ecc-pm1-redc.c (ecc_pm1_redc): New file and function.
	* ecc-internal.h: Updated declarations.
	* Makefile.in (hogweed_SOURCES): Replace ecc-generic-redc.c by
	ecc-pp1-redc.c and ecc-pm1-redc.c.
	* ecc-192.c: Use ecc_pp1_redc (benchmarking only).
	* ecc-224.c: Use ecc_pm1_redc when applicable.
	* ecc-256.c: Use ecc_pp1_redc when applicable.
	* ecc-384.c: Use ecc_pp1_redc (benchmarking only).
	* ecc-521.c: Use ecc_pp1_redc (benchmarking only).
	* testsuite/ecc-redc-test.c (test_main): Replace use of
	ecc_generic_redc by ecc_pp1_redc and ecc_pm1_redc.

	* eccdata.c (output_curve): Don't output ecc_redc_g.
	* ecc-internal.h (struct ecc_curve): Deleted unused field redc_g.
	Updated all instances.

2014-08-27  Niels Möller  <nisse@lysator.liu.se>

	* ecc-modq.c (ecc_modq_inv): Use q_bit_size.

	* ecc-internal.h (struct ecc_curve): New field q_bit_size. Updated
	all instances.

	* configure.ac: Bumped package version number to 3.1.
	(LIBHOGWEED_MAJOR): Bumped library version to 4.0.

	Merged curve25519 changes (starting at 2014-07-04).
	* Makefile.in (clean-here): Added ecc-25519.h.

2014-08-26  Niels Möller  <nisse@lysator.liu.se>

	* examples/ecc-benchmark.c (bench_mul_g, bench_mul_a): Use struct
	ecc_curve function pointers.
	(bench_mul_g_eh, bench_mul_a_eh): Deleted.
	(bench_curve): Make modq benchmark unconditional. Use bench_mul_g
	and bench_mul_a also for curve25519.

	* testsuite/ecc-mod-test.c (test_curve): Make modq test
	unconditional, partially reverting 2014-07-04 change.

	* ecc-25519.c (ecc_25519_modq): New function.

	* eccdata.c (output_curve): Precomputation for curve25519 mod q.

	* mini-gmp.c (mpz_abs_sub_bit): Do full normalization, needed in
	case the most significant bit is cleared.

2014-08-25  Niels Möller  <nisse@lysator.liu.se>

	* testsuite/ecdh-test.c (set_point): Check return value of
	ecc_point_set.
	(test_main): Enable curve25519 test.

	* ecc-point-mul-g.c (ecc_point_mul_g): Use ecc->mul_g and
	ecc->h_to_a function pointers.
	* ecc-point-mul.c (ecc_point_mul): Use the ecc->mul and
	ecc->h_to_a function pointers.

	* ecc-internal.h (ecc_mul_g_func, ecc_mul_func, ecc_h_to_a_func):
	New typedefs.
	(struct ecc_curve): New function pointers mul, mul_g, h_to_a, and
	constans for their scratch requirements. Updated all instances.

	* ecc-point.c (ecc_point_set): Handle curve25519 as a special
	case, when checking if the point is on the curve.

2014-08-24  Niels Möller  <nisse@lysator.liu.se>

	* testsuite/ecdh-test.c: Test ecc_point_mul and ecc_point_mul_g,
	using test data generated by ecc-ref.gp. Tests for all curves
	except curve25519, which doesn't yet work with the general
	ecc_point interface.

	* testsuite/Makefile.in (TS_HOGWEED_SOURCES): Added ecdh-test.c.

	* misc/ecc-ref.gp: Script to generate ECDH test data.

2014-08-23  Niels Möller  <nisse@lysator.liu.se>

	* ecc-a-to-j.c (ecc_a_to_j): Deleted INITIAL argument.
	* ecc.h (ecc_a_to_j): Updated prototype.
	* ecc-mul-a.c (ecc_mul_a, table_init): Updated calls to ecc_a_to_j.

	* ecc-mul-a.c (ecc_mul_a): Deleted INITIAL argument, all callers,
	except the tests, pass 1. Updated all callers.
	(table_init): Likewise deleted INITIAL.
	* ecc.h (ecc_mul_a): Updated prototype.
	* testsuite/ecc-mul-a-test.c (test_main): Deleted tests for
	ecc_mul_a with INITIAL == 0.

	* ecc-internal.h (struct ecc_curve): Reordered struct, moved
	function pointers before pointers to bignum constants.

	* sec-modinv.c (sec_modinv): Document that for a == 0 (mod m), we
	should produce the "inverse" 0.

	* testsuite/ecc-modinv-test.c (test_main): Check that ecc_modp_inv
	produces 0 if a == 0 or a == p.

2014-08-22  Niels Möller  <nisse@lysator.liu.se>

	* x86_64/ecc-25519-modp.asm: New file. Assembly implementation,
	initial version yields 30% speedup of ecc_25519_modp. Early
	folding eliminates one pass of carry propagation, and yields
	almost 20% additional speedup.

	* ecc-25519.c [HAVE_NATIVE_ecc_25519_modp]: Use assembly version
	if available.

	* configure.ac (asm_hogweed_optional_list): Added ecc-25519-modp.asm.
	Also add HAVE_NATIVE_ecc_25519_modp to config.h.in.

2014-08-19  Niels Möller  <nisse@lysator.liu.se>

	* examples/ecc-benchmark.c (bench_curve): Support benchmarking of
	curve25519, for now handled as a special case.
	(curves): Added nettle_curve25519.
	(bench_dup_eh, bench_add_eh, bench_add_ehh, bench_mul_g_eh): New
	functions.

2014-08-18  Niels Möller  <nisse@lysator.liu.se>

	* testsuite/curve25519-dh-test.c (test_a): Use curve25519_mul.
	(test_main): Use little-endian inputs for test_a.
	(curve25519_sqrt, curve_25519): Deleted static helper functions,
	no longer needed.

	* curve25519-mul.c (curve25519_mul): New file and function.
	* curve25519.h (curve25519_mul): Declare it.
	* Makefile.in (hogweed_SOURCES): Added curve25519-mul.c.

	* curve25519-mul-g.c (curve25519_mul_g): Renamed file and
	function, updated callers.
	* curve25519-base.c (curve25519_base): ... old names.
	* Makefile.in (hogweed_SOURCES): Updated for rename.

	* eccdata.c (output_curve): Compute constants needed for
	Shanks-Tonelli.
	* ecc-25519.c (ecc_modp_powm_2kp1, ecc_25519_sqrt): New functions.
	* ecc-internal.h (ecc_25519_sqrt): Declare it.

2014-08-06  Niels Möller  <nisse@lysator.liu.se>

	* testsuite/curve25519-dh-test.c (test_g): Use curve25519_base.
	(test_main): Use little-endian inputs for test_g.

	* curve25519-base.c (curve25519_base): New file, new function.
	Analogous to NaCl's crypto_scalarmult_base.
	* curve25519.h: New file.
	* Makefile.in (hogweed_SOURCES): Added curve25519-base.c.
	(HEADERS): Added curve25519.h.

	* gmp-glue.c (mpn_set_base256_le, mpn_get_base256_le): New functions.
	* gmp-glue.h: Declare them.

2014-08-02  Niels Möller  <nisse@lysator.liu.se>

	* testsuite/curve25519-dh-test.c (curve25519_sqrt): Fixed memory
	leak, a mpz_clear call was missing.

	* ecc-internal.h (ECC_MUL_A_EH_WBITS): Set to 4, to enable
	window-based scalar multiplication.

	* ecc-mul-a-eh.c (table_init) [ECC_MUL_A_EH_WBITS > 0]: Fixed
	initialization of TABLE(1).

2014-07-29  Niels Möller  <nisse@lysator.liu.se>

	* ecc-internal.h (ECC_MUL_A_EH_WBITS): New constant.
	(ECC_A_TO_EH_ITCH, ECC_MUL_A_EH_ITCH): New macros.
	* ecc-a-to-eh.c (ecc_a_to_eh, ecc_a_to_eh_itch): New file, new
	functions.
	* ecc-mul-a-eh.c: New file.
	(ecc_mul_a_eh): New function. The case [ECC_MUL_A_EH_WBITS > 0]
	not yet working).
	(ecc_mul_a_eh_itch): New function.
	* ecc.h: Declare new functions.
	* Makefile.in (hogweed_SOURCES): Added ecc-a-to-eh.c and
	ecc-mul-a-eh.c.

	* testsuite/curve25519-dh-test.c (curve25519_sqrt): New function.
	(curve_25519): Use ecc_mul_a_eh.
	(test_a): New function.
	(test_main): Test construction of shared secret, using scalar
	multiplication with points other than the fix generator.

2014-07-26  Niels Möller  <nisse@lysator.liu.se>

	* ecc-add-ehh.c (ecc_add_ehh): Reduce scratch need.
	* ecc-internal.h (ECC_ADD_EHH_ITCH): Reduced to 7*size.

2014-07-23  Niels Möller  <nisse@lysator.liu.se>

	* testsuite/curve25519-dh-test.c: New test case, based on
	draft-josefsson-tls-curve25519-05 test vectors.
	* testsuite/Makefile.in (TS_HOGWEED_SOURCES): Added curve25519-dh-test.c.

2014-07-18  Niels Möller  <nisse@lysator.liu.se>

	* ecc-mul-g-eh.c (ecc_mul_g_eh, ecc_mul_g_eh_itch): New file and
	functions. Untested.
	* ecc.h (ecc_mul_g_eh_itch): Declare new functions.
	* ecc-internal.h (ECC_MUL_G_EH_ITCH): New macro.
	* Makefile.in (hogweed_SOURCES): Added ecc-mul-g-eh.c.

2014-07-17  Niels Möller  <nisse@lysator.liu.se>

	* ecc-add-eh.c (ecc_add_eh): Reduce scratch need.
	* ecc-internal.h (ECC_ADD_EH_ITCH): Reduced to 6*size.

	* testsuite/curve25519-dup-test.c (test_main): Free allocated
	storage.

2014-07-15  Niels Möller  <nisse@lysator.liu.se>

	* ecc-add-eh.c (ecc_add_eh, ecc_add_eh_itch): New file, new
	functions.
	* ecc.h: Declare new functions.
	* ecc-internal.h (ECC_ADD_EH_ITCH): New macro.
	* Makefile.in (hogweed_SOURCES): Added ecc-add-eh.c.
	* testsuite/curve25519-add-test.c (test_main): Test ecc_add_eh.
	Additional test for g2+g2. Free allocated storage.

2014-07-14  Niels Möller  <nisse@lysator.liu.se>

	* testsuite/curve25519-add-test.c: New test case.
	* testsuite/Makefile.in (TS_HOGWEED_SOURCES): Added
	curve25519-add-test.c.

	* ecc-add-ehh.c (ecc_add_ehh, ecc_add_ehh_itch): New file, new
	functions.
	* ecc.h (ecc_add_ehh, ecc_add_ehh_itch): Declare them.
	* ecc-internal.h (ECC_ADD_EHH_ITCH): New macro.
	* Makefile.in (hogweed_SOURCES): Added ecc-add-ehh.c.

	* ecc-25519.c (nettle_curve25519): Use ecc_d instead of ecc_b.

	* eccdata.c: For curve25519, output the Edwards curve constant,
	ecc_d = (121665/121666) mod p.

	* testsuite/curve25519-dup-test.c (test_main): Add test for 4g.
	Delete some left-over debug output.

2014-07-11  Niels Möller  <nisse@lysator.liu.se>

	* misc/ecc-formulas.tex: Some ECC notes.

	* testsuite/curve25519-dup-test.c: New testcase.
	* testsuite/Makefile.in (TS_HOGWEED_SOURCES): Added
	curve25519-dup-test.c.

	* testsuite/testutils.c (test_ecc_point): Made non-static.
	* testsuite/testutils.h (struct ecc_ref_point): Moved here, from
	testutils.h.
	(test_ecc_point): Declare it.

	* ecc-dup-eh.c (ecc_dup_eh, ecc_dup_eh_itch): New file, new functions.
	* ecc-eh-to-a.c (ecc_eh_to_a, ecc_eh_to_a_itch): New file, new
	functions.
	* ecc.h: Declare new functions.
	* ecc-internal.h (ECC_EH_TO_A_ITCH, ECC_DUP_EH_ITCH): New macros.
	* Makefile.in (hogweed_SOURCES): Added ecc-dup-eh.c and
	ecc-eh-to-a.c.

	* ecc-internal.h (struct ecc_curve): New constant edwards_root.
	* ecc-192.c (nettle_secp_192r1): Updated accordingly, additional
	NULL pointer.
	* ecc-224.c (nettle_secp_224r1): Likewise.
	* ecc-256.c (nettle_secp_256r1): Likewise.
	* ecc-384.c (nettle_secp_384r1): Likewise.
	* ecc-521.c (nettle_secp_521r1): Likewise.
	* ecc-25519.c (nettle_curve25519): Initialize new constant.

	* eccdata.c (ecc_curve_init): For curve 25519, use correct
	constant for edwards coordinate transform, and output the constant
	as ecc_edwards.

2014-07-06  Niels Möller  <nisse@lysator.liu.se>

	* eccdata.c: Use separate is_zero flag to represent the neutral
	element.
	(output_point, output_point_redc): Unified to a single function,
	with a use_redc flag argument. Also support conversion to Edwards
	form.
	(ecc_curve_init_str): New argument for Edwards curve conversion
	constant.

2014-07-04  Niels Möller  <nisse@lysator.liu.se>

	Started curve25519 branch.
	* ecc-25519.c: New file.
	(ecc_25519_modp): New function.
	(nettle_curve25519): New curve.

	* ecc-curve.h (nettle_curve25519): Declare it.

	* Makefile.in (hogweed_SOURCES): Added ecc-25519.c.
	(ecc-25519.h): New generated file. Add as explicit dependency for
	ecc-25519.o.

	* testsuite/ecc-mod-test.c (test_curve): New function, extracted
	from test_main. Tolerate NULL modq function pointer.
	(test_main): Use test_curve, iterate over supported curves, and
	also test curve_25519 for the new modp function.

2014-08-23  Niels Möller  <nisse@lysator.liu.se>

	* ecc-modp.c (ecc_modp_sub_1): Deleted unused function.
	* ecc-internal.h: Deleted corresponding declaration.

	* examples/nettle-benchmark.c (time_cipher): Fixed memset calls,
	amending the totally broken change from 2014-02-06.

2014-07-02  Niels Möller  <nisse@lysator.liu.se>

	* eccdata.c (ecc_dup): Use mpz_submul_ui, now available in
	mini-gmp.
	(ecc_type): New enum, for Weierstrass and Montgomery curves
	(ecc_curve): New field type.
	(ecc_dup): Support montgomery curves.
	(ecc_add): Likewise.
	(ecc_curve_init_str): New argument, for the curve type.
	(ecc_curve_init): Pass curve type to all ecc_curve_init_str calls.
	Recognize curve25519, for bit_size 255.
	(output_modulo): Deleted assert, which isn't true for curve25519.

2014-06-30  Niels Möller  <nisse@lysator.liu.se>

	* camellia-absorb.c: Include <limits.h>, needed for correct use of
	HAVE_NATIVE_64_BIT. Reported and debugged by Magnus Holmgren.
	Fixes debian build failure on s390x.

2014-06-26  Niels Möller  <nisse@lysator.liu.se>

	From Martin Storsjö:
	* configure.ac (IF_NOT_SHARED): New substituted variable.
	* hogweed.pc.in: Use @LIBS@, instead of hardcoding -lgmp. When
	shared libraries are disabled, move needed libraries from
	Requires.private: to Requires: and from Libs.private: to Libs:.

 	From Nikos Mavrogiannopoulos.
	* examples/hogweed-benchmark.c (bench_alg): Tolerate alg->init
	returning NULL.
	(bench_openssl_ecdsa_init): Return NULL if
	EC_KEY_new_by_curve_name fails, indicating the curve is not
	supported.

2014-06-25  Niels Möller  <nisse@lysator.liu.se>

	Support for building with mini-gmp instead of the real GMP. Loosely
	based on work by Nikos Mavrogiannopoulos.
	* configure.ac: New command line option --enable-mini-gmp. Also
	disable all libgmp-related checks when enabled.
	(NETTLE_USE_MINI_GMP): New substituted variable.
	(LIBHOGWEED_LIBS): Use $(LIBS) instead of -lgmp.
	(IF_MINI_GMP): New Makefile conditional.
	(GMP_NUMB_BITS): Alternative test for the mini-gmp case.
	Substituted also in bignum.h.
	(HAVE_MPZ_POWM_SEC): Drop this unused check.

	* bignum.h: Renamed, to...
	* bignum.h.in: New name.
	(NETTLE_USE_MINI_GMP): Substituted by configure.
	(GMP_NUMB_BITS): Substituted by configure, for the mini-gmp case.

	* Makefile.in (OPT_HOGWEED_SOURCES): New variable, value
	conditional on @IF_MINI_GMP@.
	(hogweed_SOURCES): Add $(OPT_HOGWEED_SOURCES).
	(PRE_CPPFLAGS): Add -I$(srcdir).
	(HEADERS): Delete bignum.h.
	(INSTALL_HEADERS): Add bignum.h. Also add mini-gmp.h, if mini-gmp
	is enabled.
	(DISTFILES): Added bignum.h.in.
	(bignum.h): New target.
	(distclean-here): Delete bignum.h.

	* examples/ecc-benchmark.c (modinv_gcd) [NETTLE_USE_MINI_GMP]:
	Disable this benchmark.
	(mpn_random) [NETTLE_USE_MINI_GMP]: Provide a simple implementation.

	* testsuite/ecc-mod-test.c [NETTLE_USE_MINI_GMP]: Skip test, it
	depends on gmp_randstate_t.
	* testsuite/ecc-modinv-test.c [NETTLE_USE_MINI_GMP]: Likewise.
	* testsuite/ecc-mul-a-test.c [NETTLE_USE_MINI_GMP]: Likewise.
	* testsuite/ecc-mul-g-test.c [NETTLE_USE_MINI_GMP]: Likewise.
	* testsuite/ecc-redc-test.c [NETTLE_USE_MINI_GMP]: Likewise.

	Various preparations for mini-gmp support.
	* testsuite/bignum-test.c: Use WITH_HOGWEED instead of HAVE_LIBGMP
	for preprocessor conditionals.
	* testsuite/testutils.h: Likewise.
	* testsuite/sexp-format-test.c: Likewise.

	* testsuite/ecdsa-keygen-test.c (test_main): Use printf,
	mpz_out_str and write_mpn instead of gmp_fprintf.
	* testsuite/ecdsa-sign-test.c (test_ecdsa): Likewise.
	* testsuite/ecdsa-verify-test.c (test_ecdsa): Likewise.

	* dsa.h: Include bignum.h instead of gmp.h.
	* ecc-internal.h: Likewise.
	* ecc.h: Likewise.
	* gmp-glue.h: Likewise.
	* pkcs1.h: Likewise.
	* rsa.h: Likewise.

	* testsuite/testutils.c (die): Use plain vfprintf, not
	gmp_vfprintf.
	(write_mpn): New function.
	(test_ecc_point): Use it, replacing gmp_fprintf.
	* testsuite/testutils.h (write_mpn): Declare it.

	* der-iterator.c: Deleted HAVE_LIBGMP conditionals.

2014-06-07  Niels Möller  <nisse@lysator.liu.se>

	* Released nettle-3.0.

2014-06-04  Niels Möller  <nisse@lysator.liu.se>

	* NEWS: List des-compat.h as a candidate for removal in the next
	release.

	* testsuite/des-compat-test.c (test_main): Fixed out of bounds
	memory read, reported by Nikos Mavrogiannopoulos.

	* nettle-write.h: Include <stddef.h>, fixing compilation on
	freebsd.

	* aclocal.m4 (ac_stdint): Fixed "unsinged" typo, spotted by Andy
	Goth.

2014-06-01  Niels Möller  <nisse@lysator.liu.se>

	* x86_64/gcm-hash8.asm: Pass correct argument count to W64_EXIT.
	* x86_64/camellia-crypt-internal.asm: Pass correct argument count
	to W64_ENTRY and W64_EXIT.

	* x86_64/machine.m4 [W64_ABI]: Fix for the case of 6 function
	arguments. Also push %rdi unconditionally, and use aligned
	accesses for save and restore %xmm registers (movdqa).

2014-05-31  Niels Möller  <nisse@lysator.liu.se>

	* configure.ac: Check for COFF type directives.
	(ASM_COFF_STYLE): New substituted variable.
	* config.m4.in: Set COFF_STYLE from configure.
	* asm.m4 (PROLOGUE): Use COFF type directive, if enabled by
	configure. Fixes problem with windows dll linking.

	* asm.m4: Deleted unused offsets for struct aes_ctx.

2014-05-28  Niels Möller  <nisse@lysator.liu.se>

	* testsuite/nettle-pbkdf2-test: Delete carriage return characters
	from output.

	* configure.ac (LIBHOGWEED_LIBS): Be explicit and link
	libhogweed.so with libnettle.so, not -lnettle.
	(LIBHOGWEED_LINK): Drop -L. flag, no longer needed, and previously
	not at the correct position in the link command line.

2014-05-27  Niels Möller  <nisse@lysator.liu.se>

	* examples/ecc-benchmark.c: If mpn_sec_powm is available,
	benchmark it, for modinv.
	(bench_modinv_powm): New function.
	(bench_curve): Use it.

2014-05-22  Niels Möller  <nisse@lysator.liu.se>

	From Claudio Bley:
	* Makefile.in ($(des_headers)): Use the EXEEXT_FOR_BUILD.

2014-05-15  Niels Möller  <nisse@lysator.liu.se>

	* NEWS: Updated with library version numbers.

	* configure.ac (dummy-dep-files): Use simpler and more portable
	sed expression. Problem reported by Peter Eriksson.
	(LIBHOGWEED_MAJOR): Bumped shared library version to 3.0.
	(LIBHOGWEED_MINOR): Reset to zero. Also increased the package
	version number to 3.0.

	* getopt.c: Don't use gettext.

2014-05-14  Niels Möller  <nisse@lysator.liu.se>

	* testsuite/nettle-pbkdf2-test: Avoid the bash construction
	${#foo}.

	* getopt.c: Copied from glibc tree, tag glibc-2.19.
	* getopt.h: Likewise.
	* getopt1.c: Likewise.
	* getopt_int.h: New file, also copied from glibc.
	* Makefile.in (DISTFILES): Added getopt_int.h.

2014-05-09  Niels Möller  <nisse@lysator.liu.se>

	* mini-gmp.c: Updated, use version from gmp-6.0.0.
	* mini-gmp.h: Likewise.

	* testsuite/Makefile.in (all): Drop dependency on $(TARGETS), to
	delay building of test programs until make check.

2014-05-08  Niels Möller  <nisse@lysator.liu.se>

	* nettle.texinfo (nettle_aead abstraction): Document nettle_aead.

	* Makefile.in (nettle_SOURCES): Added nettle-meta-aeads.c.
	* nettle-meta.h (nettle_aeads): Declare array.
	* nettle-meta-aeads.c (nettle_aeads): New file, new array.
	* testsuite/meta-aead-test.c: New test case.
	* testsuite/Makefile.in (TS_NETTLE_SOURCES): Added
	meta-aead-test.c.

	* aclocal.m4 (GMP_PROG_CC_FOR_BUILD): If CC_FOR_BUILD is gcc, add
	-O option. This makes eccdata twice as fast.

2014-05-06  Niels Möller  <nisse@lysator.liu.se>

	* nettle.texinfo: Document SHA3 and ChaCha-Poly1305 as
	experimental.

2014-05-05  Niels Möller  <nisse@lysator.liu.se>

	* nettle.texinfo (POLY1305): Document poly1305-aes.
	(Authenticated encryption): Move AEAD algorithms to their own
	section.
	(RSA, DSA, ECDSA): Change some subsections to subsubsections.
	(ChaCha-Poly1305): Document ChaCha-Poly1305.

2014-05-04  Niels Möller  <nisse@lysator.liu.se>

	* nettle.texinfo (DSA): Document new DSA interface.
	(Salsa20): Update salsa20 docs.
	(ChaCha): Document ChaCha.

2014-05-03  Niels Möller  <nisse@lysator.liu.se>

	* configure.ac: Check for SIZEOF_SIZE_T.
	* ccm.c (ccm_set_nonce): Skip code for 64-bit encoding when size_t
	is only 32 bits.

	* nettle.texinfo (CCM): Document new ccm macros and constants.
	Describe ccm restrictions.

	* ccm.h (CCM_DIGEST_SIZE): New constant.

2014-04-30  Niels Möller  <nisse@lysator.liu.se>

	* ccm.c (CCM_IV_MAX_SIZE, CCM_IV_MIN_SIZE): Deleted, replaced by
	public constants CCM_MIN_NONCE_SIZE and CCM_MAX_NONCE_SIZE.
	(ccm_build_iv): Updated for above rename.
	(CCM_L_MAX_SIZE): Deleted, no longer used.

	* ccm.h (CCM_MIN_NONCE_SIZE, CCM_MAX_NONCE_SIZE): New constants.
	(CCM_MAX_MSG_SIZE): New macro.

2014-04-27  Niels Möller  <nisse@lysator.liu.se>

	* nettle.texinfo (Cipher modes): Subsection on AEAD constructions.
	(GCM): Update GCM documentation, including functions for
	gcm_aes128, gcm_camellia128, ...

2014-04-26  Niels Möller  <nisse@lysator.liu.se>

	* nettle.texinfo: Update for introduction of nettle_cipher_func.
	(GCM): Document GCM_DIGEST_SIZE.
	(UMAC): Document new UMAC constants.
	(Keyed hash functions): Make HMAC and UMAC their own info nodes.
	(EAX): Document EAX.

	* umac.h (UMAC_MIN_NONCE_SIZE, UMAC_MAX_NONCE_SIZE): New
	constants.

2014-04-25  Niels Möller  <nisse@lysator.liu.se>

	* All hash-related files: Renamed all _DATA_SIZE constants to
	_BLOCK_SIZE, for consistency. Old names kept for backwards
	compatibility.

	* nettle.texinfo (CCM): Documentation for CCM mode, contributed by
	Owen Kirby.

	* testsuite/ccm-test.c (test_cipher_ccm): And tests.

	* ccm.c (ccm_decrypt_message): Change length argument, should now
	be clear text (dst) length.
	* ccm-aes128.c (ccm_aes128_decrypt_message): Likewise.
	* ccm-aes192.c (ccm_aes192_decrypt_message): Likewise.
	* ccm-aes256.c (ccm_aes256_decrypt_message): Likewise.
	* ccm.h: Updated prototypes.

2014-04-22  Niels Möller  <nisse@lysator.liu.se>

	* nettle.texinfo (Recommended hash functions): Document additional
	sha512 variants.

	* sha2.h (sha512_224_ctx, sha512_256_ctx): New aliases for the
	sha512_ctx struct tag.

2014-04-17  Niels Möller  <nisse@lysator.liu.se>

	* examples/Makefile.in (SOURCES): Deleted next-prime.c (forgotten
	in 2014-04-13 change).

2014-04-16  Niels Möller  <nisse@lysator.liu.se>

	* testsuite/ccm-test.c (test_cipher_ccm): Deleted check for NULL
	authdata.

	* sha3-224.c (sha3_224_init): Pass pointer to context struct, not
	pointer to first element, to memset.
	* sha3-256.c (sha3_256_init): Likewise.
	* sha3-384.c (sha3_384_init): Likewise.
	* sha3-512.c (sha3_512_init): Likewise.

	* examples/eratosthenes.c (vector_alloc): Use sizeof(*vector)
	instead of explicit type in malloc call.
	(vector_init): Make constant explicitly unsigned long.

	* tools/input.c (sexp_get_quoted_char): Deleted useless for loop.

2014-04-13  Niels Möller  <nisse@lysator.liu.se>

	* rsa-compat.c: Deleted file.
	* rsa-compat.h: Deleted file.
	* Makefile.in (hogweed_SOURCES): Deleted rsa-compat.c.
	(HEADERS): Deleted rsa-compat.h.

	* examples/next-prime.c: Deleted file.
	* bignum-next-prime.c (nettle_next_prime): Deleted file and
	function.
	* prime-list.h: Deleted file.
	* bignum.h (nettle_next_prime): Deleted prototype.
	* Makefile.in (hogweed_SOURCES): Deleted bignum-next-prime.c.
	(DISTFILES): Deleted prime-list.h.
	* examples/Makefile.in (HOGWEED_TARGETS): Deleted next-prime, and
	corresponding make target.

2014-04-12  Niels Möller  <nisse@lysator.liu.se>

	* nettle.texinfo (Copyright): Updated licensing info.
	* README: Likewise.

	* Makefile.in (DISTFILES): Distribute new COPYING* files.

	* COPYING.LESSERv3: New file.
	* COPYINGv3: New file.
	* COPYING.LIB: Deleted.
	* COPYINGv2: New name for GPL version 2 file.
	* COPYING: Old name, deleted.

	* Update license headers for LGPL3+ and GPL2+ dual licensing.

2014-04-11  Niels Möller  <nisse@lysator.liu.se>

	* testsuite/testutils.c (test_aead): Use aead->digest_size.

	* configure.ac: Skip GMP tests if public key support is disabled.

	* eax.c (block16_xor): Fixed bug effecting 32-bit platforms.

	* Makefile.in (DISTFILES): Deleted memxor.c, already included via
	nettle_SOURCES.
	* tools/Makefile.in (SOURCES): Add nettle-pbkdf2.c.

2014-04-10  Niels Möller  <nisse@lysator.liu.se>

	From Nikos Mavrogiannopoulos:
	* examples/hogweed-benchmark.c (bench_openssl_ecdsa_init): Support
	for secp192r1 and secp256r1.
	(alg_list): Add them.

2014-04-09  Niels Möller  <nisse@lysator.liu.se>

	* examples/nettle-benchmark.c (main): Benchmark sha512_224 and
	sha512_256.

	* testsuite/sha512-224-test.c: New file.
	* testsuite/sha512-256-test.c: New file.
	* testsuite/Makefile.in (TS_NETTLE_SOURCES): Added new files.

	* nettle-meta.h (nettle_sha512_224, nettle_sha512_256): Declare.
	* sha512-224-meta.c (nettle_sha512_224): New file, new nettle_hash.
	* sha512-256-meta.c (nettle_sha512_256): New file, new nettle_hash.

	* sha2.h (SHA512_224_DIGEST_SIZE, SHA512_224_DATA_SIZE)
	(SHA512_256_DIGEST_SIZE, SHA512_256_DATA_SIZE): New constants.

	* sha512.c (sha512_256_digest): Typo fix, call sha512_256_init.

	* testsuite/testutils.c (test_hash): Removed redundant init call.
	Tests that digest implies init.

2014-03-28  Niels Möller  <nisse@lysator.liu.se>

	* testsuite/dsa-keygen-test.c (test_main): Explicitly use
	dsa_compat_generate_keypair.
	(test_main): Test dsa_generate_params and dsa_generate_keypair
	with a large q; p_bits = 1024, q_bits = 768.

	* testsuite/testutils.h: Undo dsa-compat.h name mangling.

	* dsa-keygen.c (dsa_generate_keypair): New interface, generating
	only a keypair, and no new parameters.
	* dsa-compat-keygen.c (dsa_compat_generate_keypair): New file.
	Moved old key generation function here. Use dsa_generate_keypair.

2014-03-27  Niels Möller  <nisse@lysator.liu.se>

	* dsa-compat.c (dsa_public_key_init, dsa_public_key_clear)
	(dsa_private_key_init, dsa_private_key_clear): : Move deprecated
	DSA functions to a separate file...
	* dsa.c: ...from here.
	* dsa-compat.h: New file, declaring deprecated DSA interface.
	Include in corresponding C files.
	* Makefile.in (hogweed_SOURCES): Add dsa-compat.c.
	(HEADERS): Add dsa-compat.h.

	* dsa-gen-params.c (dsa_generate_params): New file and function,
	extracted from DSA key generation.
	* dsa-keygen.c (dsa_generate_keypair): Use dsa_generate_params.

2014-03-26  Niels Möller  <nisse@lysator.liu.se>

	* der2dsa.c (dsa_params_from_der_iterator): Converted to new DSA
	interface. Allow q_size == 0, meaning any q < p is allowed.
	Additional validity checks.
	(dsa_public_key_from_der_iterator): Converted to new DSA
	interface. Also check that the public value is in the correct
	range.
	(dsa_openssl_private_key_from_der_iterator): Converted
	to new DSA interface. Additional validity checks.
	(dsa_openssl_private_key_from_der): Converted to new DSA
	interface.
	* tools/pkcs1-conv.c (convert_dsa_private_key): Update to use
	struct dsa_params, and adapt to the der decoding changes.
	(convert_public_key): Likewise.

	* examples/hogweed-benchmark.c: Update dsa benchmarking to use new
	DSA interface.

	* dsa.c (dsa_params_init, dsa_params_clear): New functions.
	(dsa_public_key_init): Use dsa_params_init.
	(dsa_public_key_clear): Use dsa_params_clear.

	* sexp2dsa.c (dsa_keypair_from_sexp_alist): Converted to new DSA
	interface. Allow q_size == 0, meaning any q < p is allowed.
	Additional validity checks.
	(dsa_sha1_keypair_from_sexp, dsa_sha256_keypair_from_sexp):
	Converted to new DSA interface.

	* dsa2sexp.c (dsa_keypair_to_sexp): Converted to new DSA
	interface.
	* tools/pkcs1-conv.c: Updated uses of dsa_keypair_to_sexp.

	* dsa.h (struct dsa_params): New struct.

	* dsa-sign.c (dsa_sign): Use struct dsa_params, with key as a
	separate mpz_t.
	* dsa-verify.c (dsa_verify): Likewise.
	* dsa-sha1-verify.c (dsa_sha1_verify_digest, dsa_sha1_verify): Use
	dsa_verify, cast the struct dsa_public_key * input to a struct
	dsa_params *
	* dsa-sha256-verify.c (dsa_sha256_verify_digest)
	(dsa_sha256_verify): Likewise.
	* dsa-sha1-sign.c (dsa_sha1_sign_digest, dsa_sha1_sign): Likewise
	use dsa_sign, with a cast from struct dsa_public_key * to struct
	dsa_params *.
	* dsa-sha256-sign.c (dsa_sha256_sign_digest, dsa_sha256_sign):
	Likewise.

	* testsuite/testutils.c (test_dsa_verify): Use struct dsa_params.
	(test_dsa_key): Likewise.
	* testsuite/dsa-test.c (test_main): Adapt to test_dsa_key and
	test_dsa_verify changes.
	* testsuite/dsa-keygen-test.c (test_main): Adapt to
	test_dsa_key change.

	* testsuite/testutils.c (test_dsa_sign): #if out, currently
	unused.

2014-03-23  Niels Möller  <nisse@lysator.liu.se>

	From Owen Kirby:
	* ccm.c: New file.
	* ccm.h: New file.
	* ccm-aes128.c: New file.
	* ccm-aes192.c: New file.
	* ccm-aes256.c: New file.
	* Makefile.in (nettle_SOURCES): Added ccm source files.
	(HEADERS): Added ccm.h.
	* testsuite/ccm-test.c: New file.
	* testsuite/Makefile.in (TS_NETTLE_SOURCES): Added ccm-test.c.

2014-03-20  Niels Möller  <nisse@lysator.liu.se>

	From Joachim Strömbergson:
	* sha512.c (K): Indentation fix.
	(sha512_224_init, sha512_224_digest, sha512_256_init)
	(sha512_256_digest): New functions.
	* sha2.h: Add prototypes.
	(sha512_224_update, sha512_256_update): New aliases for
	sha512_update.

2014-03-18  Niels Möller  <nisse@lysator.liu.se>

	* examples/nettle-benchmark.c (main): Add benchmarking of arcfour,
	salsa20 and chacha, via time_aead.

	* nettle-internal.c (nettle_arcfour128): Define, as a struct
	nettle_aead (with NULL set_nonce, update, and digest methods).
	* examples/nettle-openssl.c (nettle_openssl_arcfour128): Likewise.
	* nettle-internal.h (nettle_arcfour128)
	(nettle_openssl_arcfour128): Declare.

	* nettle-types.h (nettle_cipher_func): New typedef, similar to
	nettle_crypt_func, but with a const context, intended for block
	ciphers.
	* nettle-meta.h (struct nettle_cipher): Use the nettle_cipher_func
	type.
	* Many other files affected: aes*-meta.c, camellia*-meta.c,
	cast128-meta.c, serpent-meta.c, twofish-meta.c, cbc.[ch],
	ctr.[ch], ctr.[ch], des-compat.c, eax.[ch], gcm*.[ch],
	nettle-internal.*, testsuite/aes-test.c,
	examples/nettle-benchmark.c, examples/nettle-openssl.c.

2014-03-16  Niels Möller  <nisse@lysator.liu.se>

	* chacha-set-key.c: Include string.h.

	* arcfour-meta.c: Deleted file.
	* nettle-meta.h (nettle_arcfour128): Deleted declaration.
	* nettle-meta-ciphers.c (nettle_ciphers): Deleted
	nettle_arcfour128 from list.
	* Makefile.in (nettle_SOURCES): Deleted arcfour-meta.c.
	* examples/nettle-openssl.c (nettle_openssl_arcfour128): Deleted.
	* testsuite/meta-cipher-test.c: Adjust test for removal of
	nettle_arcfour128.

2014-03-15  Niels Möller  <nisse@lysator.liu.se>

	* examples/nettle-benchmark.c (struct bench_aead_info): New
	struct.
	(bench_aead_crypt, bench_aead_update, init_nonce, time_aead): New
	functions, for benchmarking aead algorithms.
	(time_gcm, time_eax): Deleted functions.
	(main): Use time_aead to benchmark gcm, eax and chacha-poly1305.

	* salsa20.h (SALSA20_NONCE_SIZE): Renamed constant, old name
	SALSA20_IV_SIZE kept as an alias.
	(salsa20_set_nonce): Update prototype for the 2014-01-20 rename.

	* Makefile.in (.asm.s): Add dependencies.
	(.s.o, .s.po): Empty any dependency .d file.

2014-03-04  Niels Möller  <nisse@lysator.liu.se>

	* testsuite/chacha-test.c (test_main): Additional test cases, for
	256-bit keys.

	* Makefile.in (nettle_SOURCES): Deleted chacha128-set-key.c and
	chacha256-set-key.c.

	* chacha.h (CHACHA256_KEY_SIZE): Deleted.
	(chacha_set_key): Updated prototype.
	* chacha256-set-key.c (chacha256_set_key): Deleted file and
	function, moved to...
	* chacha-set-key.c (chacha_set_key): Do 256-bit keys only. Deleted
	length argument. Updated all callers.

	* chacha128-set-key.c (chacha128_set_key): Deleted file and
	function. Support for 128-bit chacha keys may be reintroduced
	later, if really needed.
	* chacha.h: Deleted chacha128-related declarations.
	* chacha-set-key.c (chacha_set_key): Drop support for 128-bit
	keys.
	* testsuite/chacha-test.c (test_main): #if:ed out all tests with
	128-bit keys.

2014-02-16  Niels Möller  <nisse@lysator.liu.se>

	* gcm.h: Declarations for gcm-camellia256.
	* gcm-camellia256.c: New file.
	* gcm-camellia256-meta.c: New file.
	* nettle-meta.h (nettle_gcm_camellia256): Declare.
	* Makefile.in (nettle_SOURCES): Added gcm-camellia256.c and
	gcm-camellia256-meta.c.
	* testsuite/gcm-test.c (test_main): Test cases for
	nettle_gcm_camellia256.

	* gcm.h: Include camellia.h. Declarations for gcm-camellia128.
	* gcm-camellia128.c: New file.
	* gcm-camellia128-meta.c: New file.
	* nettle-meta.h (nettle_gcm_camellia128): Declare.
	* Makefile.in (nettle_SOURCES): Added gcm-camellia128.c and
	gcm-camellia128-meta.c.
	* testsuite/gcm-test.c (test_main): Test cases for
	nettle_gcm_camellia128. From Nikos Mavrogiannopoulos.

2014-02-13  Niels Möller  <nisse@lysator.liu.se>

	* Makefile.in (nettle_SOURCES): Added eax-aes128.c
	eax-aes128-meta.c.
	* examples/nettle-benchmark.c: Include eax.h.
	* nettle-meta.h (nettle_eax_aes128): Declare, moved from
	nettle-internal.h.
	* eax.h: Declare eax_aes128_ctx and related functions. Moved from
	nettle-internal.h
	(EAX_IV_SIZE): New constant.
	* eax-aes128-meta.c (nettle_eax_aes128): Moved definition to new
	file.
	* eax-aes128.c (eax_aes128_set_key, eax_aes128_set_nonce)
	(eax_aes128_update, eax_aes128_encrypt, eax_aes128_decrypt)
	(eax_aes128_digest): Moved functions to a new file.
	* nettle-internal.c: ... from old location.
	* nettle-internal.h: Moved eax declarations elsewhere.

	* tools/nettle-pbkdf2.c (main): Added missing deallocation.

2014-02-12  Niels Möller  <nisse@lysator.liu.se>

	* chacha-poly1305.h: New file.
	* chacha-poly1305.c: New file.
	* chacha-poly1305-meta.c (nettle_chacha_poly1305): New file, new
	aead algorithm.
	* nettle-meta.h (nettle_chacha_poly1305): Declare.

	* Makefile.in (nettle_SOURCES): Added chacha-poly1305.c and
	chacha-poly1305-meta.c.
	(HEADERS): Added chacha-poly1305.h.

	* testsuite/Makefile.in (TS_NETTLE_SOURCES): Added
	chacha-poly1305-test.c.
	* testsuite/chacha-poly1305-test.c: New file.

	* nettle-meta.h (struct nettle_aead): New generalized version
	if this struct.
	(nettle_gcm_aes128, nettle_gcm_aes192, nettle_gcm_aes256)
	(nettle_eax_aes128): Declare, moved from nettle-internal.h.
	* nettle-internal.h (struct nettle_aead): Deleted struct, moved to
	nettle-meta.h. Deleted declarations of unused instances.
	(_NETTLE_AEAD): Deleted macro.
	* nettle-internal.c (nettle_eax_aes128): Updated for new
	nettle_aead struct.
	(nettle_gcm_aes128, nettle_gcm_aes192, nettle_gcm_aes256):
	Deleted, moved to new files.
	* gcm-aes128-meta.c (nettle_gcm_aes128): Moved to new file,
	updated for new nettle_aead struct.
	* gcm-aes192-meta.c (nettle_gcm_aes192): Likewise.
	* gcm-aes256-meta.c (nettle_gcm_aes256): Likewise.
	* testsuite/testutils.c (test_aead): Take alternative set_nonce
	function as argument, and use it when nonce size differs from
	aead->nonce_length.
	* testsuite/testutils.h (test_aead): Updated prototype.
	* testsuite/gcm-test.c (nettle_gcm_unified_aes128): Updated for
	new nettle_aead struct.
	(test_main): Pass additional argument to test_aead.
	* testsuite/eax-test.c (test_main): Pass additional NULL argument
	to test_aead.

	* eax.h (EAX_DIGEST_SIZE): New constant.
	* gcm.h (GCM_DIGEST_SIZE): Likewise.

2014-02-10  Niels Möller  <nisse@lysator.liu.se>

	* chacha-set-nonce.c (chacha_set_nonce): Renamed file and
	function, updated callers and Makefile.in.
	* chacha-set-iv.c (chacha_set_iv): ... from old names.

2014-02-08  Niels Möller  <nisse@lysator.liu.se>

	* testsuite/chacha-test.c (test_chacha): For 20 rounds, use
	chacha_crypt, and test varying the message length.
	(test_main): Add second key stream block, for all testcases with
	20 rounds.

	* chacha-crypt.c (chacha_crypt): Fixed block counter update.

2014-02-07  Niels Möller  <nisse@lysator.liu.se>

	* nettle.texinfo (ASCII encoding): Document that
	base16_encode_update and base64_encode_update now uses dst_length
	as an output only.

	* testsuite/base64-test.c (test_main): Updated
	base64_decode_update test case.

	* sexp-transport.c (sexp_transport_iterator_first): For
	base64_decode_update, omit initialization of coded_length.
	* examples/base64dec.c (main): Likewise.
	* examples/base16dec.c (main): Likewise, for base16_decode_update.

	* base64-decode.c (base64_decode_update): Use *dst_length for
	output only. Don't require callers to pass a sane value.
	* base16-decode.c (base16_decode_update): Likewise.

2014-02-06  Niels Möller  <nisse@lysator.liu.se>

	* NEWS: List _set_key incompatibilities.

	* nettle-meta.h (_NETTLE_CIPHER_SEP, _NETTLE_CIPHER_SEP_SET_KEY)
	(_NETTLE_CIPHER_FIX, _NETTLE_CIPHER): Deleted unused macros.

	* nettle-internal.c (nettle_blowfish128): Deleted only use of
	_NETTLE_CIPHER.

	* blowfish.c (blowfish128_set_key): New function.
	* blowfish.h (BLOWFISH128_KEY_SIZE): New constant.

	* cast128-meta.c (nettle_cast128): Deleted only use of
	_NETTLE_CIPHER_FIX.

	* examples/nettle-benchmark.c (time_cipher): Fixed memset calls.

2014-01-30  Niels Möller  <nisse@lysator.liu.se>

	* Makefile.in (nettle_SOURCES): Arrange in alphabetic order.

	* nettle.texinfo: Updated, document size_t for length arguments.
	Document new AES and Camellia interfaces.

	* ecc-size.c (ecc_bit_size): New function.
	* ecc.h (ecc_bit_size): Declare it.

2014-01-29  Niels Möller  <nisse@lysator.liu.se>

	* nettle-types.h (typedef nettle_set_key_func): Deleted length
	argument.

	* arctwo.c (arctwo40_set_key, arctwo64_set_key)
	(arctwo128_set_key, arctwo128_set_key_gutmann): New functions.
	* arctwo.h: Declare them.
	* arctwo-meta.c (ARCTWO): New macro.
	(nettle_arctwo40, nettle_arctwo64, nettle_arctwo128)
	(nettle_arctwo_gutmann128): Use new _set_key functions.

	* arcfour.h (ARCFOUR128_KEY_SIZE): New constant.
	* arcfour.c (arcfour128_set_key): New function.
	* arcfour-meta.c (nettle_arcfour128): Use arcfour128_set_key and
	ARCFOUR128_KEY_SIZE.

	* cast128.c (cast5_set_key): Renamed, was cast128_set_key.
	(cast128_set_key): New definition, with fixed key size.
	* cast128.h (CAST128_MIN_KEY_SIZE, CAST128_MAX_KEY_SIZE): Renamed
	constants, to...
	(CAST5_MIN_KEY_SIZE, CAST5_MAX_KEY_SIZE): ... new names.

	* eax.h (EAX_SET_KEY): Deleted length argument.

	* aes128-meta.c: Deleted _set_key wrappers.
	* aes192-meta.c: Likewise.
	* aes256-meta.c: Likewise.
	* camellia128-meta.c: Likewise.
	* camellia192-meta.c: Likewise.
	* camellia256-meta.c: Likewise.

	* gcm-aes128.c (gcm_aes128_set_key): Deleted length argument.
	* gcm-aes192.c (gcm_aes192_set_key): Likewise.
	* gcm-aes256.c (gcm_aes256_set_key): Likewise.
	* gcm.h: Updated prototypes.

	* serpent-set-key.c (serpent128_set_key, serpent192_set_key)
	(serpent256_set_key): New functions.
	* serpent.h: Declare new functions.
	(SERPENT128_KEY_SIZE, SERPENT192_KEY_SIZE)
	(SERPENT256_KEY_SIZE): New constants.
	* serpent-meta.c (SERPENT): New macro.
	(nettle_serpent128, nettle_serpent192, nettle_serpent256): Use new
	_set_key functions.

	* twofish-set-key.c (twofish128_set_key, twofish192_set_key)
	(twofish256_set_key): New functions.
	* twofish.h: Declare new functions.
	(TWOFISH128_KEY_SIZE, TWOFISH192_KEY_SIZE)
	(TWOFISH256_KEY_SIZE): New constants.
	* twofish-meta.c (TWOFISH): New macro.
	(nettle_twofish128, nettle_twofish192, nettle_twofish256): Use new
	_set_key functions.

	* nettle-internal.h (struct nettle_aead): Use
	nettle_hash_update_func for the set_iv function pointer.

	* nettle-internal.c (des_set_key_hack, des3_set_key_hack): Deleted
	wrapper functions.
	(chacha_set_key_hack): Deleted length argument. Use
	chacha256_set_key.
	(salsa20_set_key_hack): Deleted length argument. Use
	salsa20_256_set_key.
	(nettle_unified_aes128, nettle_unified_aes192)
	(nettle_unified_aes256): Deleted, moved to test program.
	(eax_aes128_set_key): Deleted length argument. Use EAX_SET_KEY.

	* examples/nettle-benchmark.c: Updated for _set_key changes.
	* examples/nettle-openssl.c: Likewise.
	* testsuite/testutils.c: Likewise.
	* testsuite/gcm-test.c: Likewise.

	* testsuite/aes-test.c (UNIFIED_AES): New macro. Moved glue for
	testing the old aes interface (struct aes_ctx) here.

	* testsuite/arcfour-test.c (test_arcfour): New function, for key
	sizes != 128 bits.
	(test_main): Use it.

	* testsuite/blowfish-test.c (test_blowfish): New function.
	(test_main): Use it. Also deleted old #if:ed out code.

	* testsuite/cast128-test.c (test_cast5): New function.
	(test_main): Use it, for 40-bit and 80-bit tests.

	* testsuite/serpent-test.c (test_serpent): New function.
	(test_main): Use it.

2014-01-27  Niels Möller  <nisse@lysator.liu.se>

	* eax.h (struct eax_key, struct eax_ctx): Use union
	nettle_block16, for alignment.
	* eax.c: Updated everything to use nettle_block16.
	(block16_xor): New function.

	* examples/nettle-benchmark.c (time_eax): New function.
	(main): Use it.

	* x86_64/chacha-core-internal.asm: Use pshufhw + pshuflw for the
	16-bit rotate.

	* configure.ac (asm_replace_list): Added chacha-core-internal.asm.
	* x86_64/chacha-core-internal.asm: New file.

	* examples/nettle-benchmark.c (main): Add benchmarking of chacha.
	* nettle-internal.c (nettle_chacha): New const struct, for the
	benchmark.

	Chacha implementation, based on contribution by Joachim
	Strömbergson.
	* chacha.h: New file.
	* chacha256-set-key.c (chacha256_set_key): New file and function.
	* chacha128-set-key.c (chacha128_set_key): New file and function.
	* chacha-set-key.c (chacha_set_key): New file and function.
	* chacha-set-iv.c (chacha_set_iv): New file and function.
	* chacha-core-internal.c (_chacha_core): New file and function.
	* chacha-crypt.c (chacha_crypt): New file and function.
	* Makefile.in (nettle_SOURCES): Added chacha files.
	(HEADERS): Added chacha.h.
	* testsuite/chacha-test.c: New file.
	* testsuite/Makefile.in (TS_NETTLE_SOURCES): Added chacha-test.c.

2014-01-26  Niels Möller  <nisse@lysator.liu.se>

	* nettle-internal.h (_NETTLE_AEAD_FIX): Renamed to...
	(_NETTLE_AEAD): ... new name, and deleted old definition. Also use
	_set_nonce instead of _set_iv.
	* nettle-internal.c (nettle_gcm_aes128, nettle_gcm_aes192)
	(nettle_gcm_aes256): Define in terms of new interface.
	(nettle_eax_aes128): Updated for _NETTLE_AEAD changes.

	* testsuite/gcm-test.c (test_gcm_hash): Likewise use struct
	gcm_aes128_ctx.
	(test_main): Added a testcase using the old interface based on
	struct gcm_aes_ctx.

	* examples/nettle-benchmark.c (time_gcm): Update to use new struct
	gcm_aes128_ctx. Also use name "gcm-aes128" in output.

	* gcm.h: New interface for gcm_aes128, gcm_aes192, gcm_aes256,
	using the new AES interface.
	(GCM_CTX): Reorder fields, putting the cipher context
	last.

	* Makefile.in (nettle_SOURCES): Added gcm-aes128.c, gcm-aes192.c,
	and gcm-aes256.c.

	* gcm-aes128.c: New file.
	* gcm-aes192.c: New file
	* gcm-aes256.c: New file.

2014-01-25  Niels Möller  <nisse@lysator.liu.se>

	* gcm.h (GCM_SET_KEY): Deleted length argument.
	* gcm-aes.c (gcm_aes_set_key): Use aes_set_encrypt_key and
	gcm_set_key, can no longer use GCM_SET_KEY macro.

2014-01-23  Niels Möller  <nisse@lysator.liu.se>

	* testsuite/gcm-test.c (test_main): Use the correct
	nettle_gcm_aes128/192/256 object.

2014-01-21  Niels Möller  <nisse@lysator.liu.se>

	Merged camellia-reorg changes (starting at 2013-10-07).

2013-10-10  Niels Möller  <nisse@lysator.liu.se>

	* Makefile.in (nettle_SOURCES): Updated list of camellia files.

	* testsuite/camellia-test.c (test_invert): Updated for new
	camellia interface.

	* camellia.h: Reorganized camellia interface, with distinct
	context structs and functions for camellia128 and camellia256.

	* camellia-meta.c: Deleted file.
	* camellia256-meta.c: New file.
	* camellia192-meta.c: New file.
	* camellia128-meta.c: New file.

	* camellia-set-decrypt-key.c: Deleted file, code moved to:
	* camellia128-set-decrypt-key.c: New file.
	(camellia128_invert_key, camellia128_set_decrypt_key): New
	functions.
	* camellia256-set-decrypt-key.c: New file.
	(camellia256_invert_key, camellia256_set_decrypt_key)
	(camellia192_set_decrypt_key): New functions.
	* camellia-invert-key.c (_camellia_invert_key): New file and
	function.

	* camellia-set-encrypt-key.c: Deleted file, code moved to:
	* camellia128-set-encrypt-key.c: New file.
	(camellia128_set_encrypt_key): New function.
	* camellia256-set-encrypt-key.c: New file.
	(_camellia256_set_encrypt_key, camellia256_set_encrypt_key)
	(camellia192_set_encrypt_key): New functions.
	* camellia-absorb.c (_camellia_absorb): New file and function.
	* camellia-internal.h: Moved key schedule macros here.

	* camellia-crypt.c: Deleted file, code moved to:
	* camellia128-crypt.c (camellia128_crypt): New file and function.
	* camellia256-crypt.c (camellia256_crypt): New file and function.

2013-10-07  Niels Möller  <nisse@lysator.liu.se>

	* configure.ac: Delete check for ALIGNOF_UINT64_T, no longer
	needed.
	* config.m4.in: Likewise delete ALIGNOF_UINT64_T.

	* camellia-crypt.c (camellia_crypt): Updated call to
	_camellia_crypt.
	* camellia-internal.h (_camellia_crypt): Updated prototype.
	* camellia-crypt-internal.c (_camellia_crypt): Take separate
	arguments for rounds and subkey array.
	* x86_64/camellia-crypt-internal.asm: Likewise.	Also corrected
	.file pseudo-ops.
	* x86/camellia-crypt-internal.asm: Likewise.

2014-01-20  Niels Möller  <nisse@lysator.liu.se>

	* poly1305-internal.c (poly1305_digest): Use union nettle_block16
	for s argument.
	* poly1305-aes.c (poly1305_aes_digest): Update for poly1305_digest
	change.

	Merged poly1305 changes (starting at 2013-11-08).
	* x86_64/poly1305-internal.asm: Update to new interface.
	poly1305_digest much simplified.

	* poly1305.h (struct poly1305_ctx): Moved block and index
	fields...
	(struct poly1305_aes_ctx): ... to here.
	* asm.m4: Delete also from the assembly definition of struct
	poly1305_ctx.

	* poly1305-internal.c (poly1305_digest): Don't do final padding
	here, leave that to caller. Add digest to the provided nonce s,
	and deleted length and dst arguments. Also reset h0-h4 to zero
	when done.
	(_poly1305_block): Renamed, from...
	(poly1305_block): ...old name.

	* poly1305-aes.c (poly1305_aes_update): New function.
	(poly1305_aes_digest): Update for poly1305_digest changes, do
	final padding here.

	* poly1305.c (poly1305_update): Deleted file and function. Moved
	to poly1305-aes.c.
	* Makefile.in (nettle_SOURCES): Deleted poly1305.c.

2014-01-17  Niels Möller  <nisse@lysator.liu.se>

	* poly1305-internal.c (poly1305_block): Additional argument with
	the high bit.
	(poly1305_block_internal): Deleted function, code moved into the
	poly1305_block.
	(poly1305_digest): Simplified padding code, call poly1305_block
	with high bit 0.
	* poly1305.h (poly1305_block): Update prototype.
	* poly1305.c (poly1305_update): Call poly1305_block with high bit 1.
	* x86_64/poly1305-internal.asm (poly1305_block): Handle new
	argument.

	* poly1305.h (struct poly1305_ctx): Moved nonce field from here...
	(struct poly1305_aes_ctx): ... to here.
	* poly1305-aes.c (poly1305_aes_set_nonce, poly1305_aes_digest):
	Updated for above.
	* poly1305.c (poly1305_set_nonce): Deleted function.
	* asm.m4: Delete nonce also from the assembly definition of struct
	poly1305_ctx.

2014-01-16  Niels Möller  <nisse@lysator.liu.se>

	* poly1305-aes.c: Include poly1305.h. Rewrite functions without
	using the POLY1305_* macros.

	* Makefile.in (HEADERS): Deleted poly1305-aes.h.

	* poly1305.h (POLY1305_CTX, POLY1305_SET_KEY, POLY1305_SET_NONCE)
	(POLY1305_DIGEST): Deleted macros. Only implemented variant is
	poly1305-aes.
	(POLY1305_DIGEST_SIZE, POLY1305_BLOCK_SIZE, POLY1305_KEY_SIZE):
	New constants.
	(POLY1305_AES_KEY_SIZE, POLY1305_AES_DIGEST_SIZE): Moved here,
	from poly1305-aes.h.
	(struct poly1305_aes_ctx): Likewise.
	(poly1305_aes_set_key, poly1305_aes_set_nonce)
	(poly1305_aes_update, poly1305_aes_digest): Likewise.
	* poly1305-aes.h: Deleted file, declarations moved to poly1305.h.
	Update all users.

	* poly1305-internal.c (s2, s3, s4): Fixed macros.

	* poly1305-aes.h (struct poly1305_aes_ctx): Replace struct aes_ctx
	by struct aes128_ctx.
	* poly1305-aes.c (poly1305_aes_set_key, poly1305_aes_digest):
	Update to use aes128_* functions.
	* poly1305.h (POLY1305_SET_KEY): Drop key size argument when
	calling set_key.

2013-12-19  Niels Möller  <nisse@lysator.liu.se>

	* poly1305-aes.h (poly1305_aes_update): Define as an alias for
	poly1305_update, using preprocessor and a type cast.

	* poly1305-aes.c (poly1305_aes_update): Deleted function.

	* poly1305.h (poly1305_update): Declare.
	(_POLY1305_BLOCK, POLY1305_UPDATE): Deleted macros.

	* poly1305.c (poly1305_update): New function.

2013-11-21  Niels Möller  <nisse@lysator.liu.se>

	* x86_64/poly1305-internal.asm: New file. Almost a factor of two
	speedup.

	* configure.ac (asm_replace_list): Added poly1305-internal.asm.

	* asm.m4: Define struct offsets for 64-bit poly1305_ctx.

	* poly1305.h (POLY1305_DIGEST): Pass the encrypted nonce as an
	additional argument to poly1305_digest.
	(struct poly1305_ctx): Introduce unions, to support either 26-bit
	or 64-bit implementation.

	* poly1305-internal.c (poly1305_digest): Added s argument.

	* poly1305.c (poly1305_set_s): Deleted function.

2013-11-12  Niels Möller  <nisse@lysator.liu.se>

	* poly1305-internal.c: New file, for poly1305 functions depending
	on the internal mod (2^130 - 5) representation.
	(poly1305_block_internal): New helper function.
	(poly1305_block, poly1305_digest): Use it.

2013-11-08  Nikos Mavrogiannopoulos  <nmav@gnutls.org>

	* poly1305.h: New file.
	* poly1305.c: New file.
	* poly1305-aes.h: New file.
	* poly1305-aes.c: New file.
	* Makefile.in (nettle_SOURCES): Added poly1305-aes.c and poly1305.c.
	(HEADERS): Added poly1305-aes.h and poly1305.h.

	* testsuite/poly1305-test.c: New file.
	* testsuite/Makefile.in (TS_NETTLE_SOURCES): Added poly1305-test.c.

	* examples/nettle-benchmark.c (time_poly1305_aes): New function.
	(main): Benchmark poly1305.

2014-01-20  Niels Möller  <nisse@lysator.liu.se>

	* Makefile.in (nettle_SOURCES): Added salsa20-set-nonce.c,
	salsa20-128-set-key.c, and salsa20-256-set-key.c.

	* salsa20.h: Declare new functions.
	(SALSA20_128_KEY_SIZE, SALSA20_256_KEY_SIZE): New constants.
	(salsa20_set_iv): Define as an alias for salsa20_set_nonce.

	* salsa20-set-key.c (salsa20_set_key): Use salsa20_128_set_key and
	salsa20_256_set_key.
	(salsa20_set_iv): Renamed and moved...
	* salsa20-set-nonce.c (salsa20_set_nonce): ... new file, new name.

	* salsa20-256-set-key.c (salsa20_256_set_key): New file and
	function.
	* salsa20-128-set-key.c (salsa20_128_set_key): New file and
	function.

2014-01-13  Niels Möller  <nisse@lysator.liu.se>

	* nettle-types.h (union nettle_block16): New type, replacing union
	gcm_block.
	* gcm.h (union gcm_block): Deleted. Replaced by nettle_block16.
	* gcm.c: Replaced all use of gcm_block by nettle_block16.

2014-01-04  Niels Möller  <nisse@lysator.liu.se>

	* config.guess: Updated to 2014-01-01 version, from
	git://git.sv.gnu.org/config.git.
	* config.sub: Likewise.

	* testsuite/memxor-test.c [HAVE_VALGRIND_MEMCHECK_H] (test_mark):
	New function.
	(test_memxor, test_memxor3): Use test_mark to tell valgrind the
	start and end of src and destination areas.

	* configure.ac: Check for valgrind/memcheck.h.

	* testsuite/Makefile.in (VALGRIND): Added --partial-loads-ok=yes,
	needed for the way unaligned data is handled in, e.g., memxor.

2014-01-03  Niels Möller  <nisse@lysator.liu.se>

	* shadata.c (main): Zero-pad output values to 8 hex digits.
	* sha256.c (K): Updated table.

2013-12-17  Niels Möller  <nisse@lysator.liu.se>

	* configure.ac (ASM_RODATA): New substituted variable. Needed for
	portability to darwin.
	* config.m4.in: Define RODATA, using configure variable ASM_RODATA
	* x86_64/gcm-hash8.asm: Use RODATA macro.

	* bignum-random-prime.c (_nettle_generate_pocklington_prime): Use
	stronger variants of Pocklington's theorem, to allow p0 of size
	down to bits/3.

2013-12-15  Niels Möller  <nisse@lysator.liu.se>

	* nettle-internal.h (NETTLE_MAX_BIGNUM_BITS)
	(NETTLE_MAX_BIGNUM_SIZE): Deleted arbitrary limits.

2013-12-15  Nikos Mavrogiannopoulos <nmav@redhat.com>

	Introduced TMP_GMP_ALLOC macro for temporary allocations of
	potentially large data, e.g, sized as an RSA key.
	* gmp-glue.h (TMP_GMP_DECL, TMP_GMP_ALLOC, TMP_GMP_FREE): New
	macros.
	* gmp-glue.c (gmp_alloc, gmp_free): New functions.
	* bignum-next-prime.c (nettle_next_prime): Use TMP_GMP_ALLOC.
	* bignum-random.c (nettle_mpz_random_size): Likewise.
	* pkcs1-decrypt.c (pkcs1_decrypt): Likewise.
	* pkcs1-encrypt.c (pkcs1_encrypt): Likewise.
	* pkcs1-rsa-digest.c (pkcs1_rsa_digest_encode): Likewise.
	* pkcs1-rsa-sha512.c (pkcs1_rsa_sha512_encode)
	(pkcs1_rsa_sha512_encode_digest): Likewise.
	* pkcs1-rsa-sha256.c (pkcs1_rsa_sha256_encode)
	(pkcs1_rsa_sha256_encode_digest): Likewise.
	* pkcs1-rsa-sha1.c (pkcs1_rsa_sha1_encode)
	(pkcs1_rsa_sha1_encode_digest): Likewise.
	* pkcs1-rsa-md5.c (pkcs1_rsa_md5_encode)
	(pkcs1_rsa_md5_encode_digest): Likewise.

2013-12-14  Niels Möller  <nisse@lysator.liu.se>

	* x86_64/gcm-hash8.asm: Use .short rather than .hword, for
	compatibility with apple's assembler.

2013-12-03  Niels Möller  <nisse@lysator.liu.se>

	* x86_64/sha1-compress.asm: Reorganized, to get closer to the x86
	version. No difference in running time.

	* configure.ac (dummy-dep-files): Don't overwrite any existing
	dependency files.

	* x86_64/md5-compress.asm: New file, similar to the x86 version.
	35% speedup on AMD, 15% speedup on Intel.

2013-11-25  Niels Möller  <nisse@lysator.liu.se>

	* testsuite/dsa-test.c (test_main): Additional tests from NIST
	test vectors.

	* testsuite/testutils.c (test_dsa_sign, test_dsa_verify): New
	functions, supporting arbitrary digest size.

	* testsuite/testutils.h (ASSERT): Improved failure message.

	* dsa-verify.c (dsa_verify): Renamed, from _dsa_verify.
	* dsa-sign.c (dsa_sign): Renamed, from _dsa_sign.

2013-11-24  Niels Möller  <nisse@lysator.liu.se>

	* testsuite/dsa-keygen-test.c (test_main): Test generating a
	key with 224-bit q.

	* dsa-verify.c (_dsa_verify): Use _dsa_hash.

	* dsa-sign.c (_dsa_sign): Use _dsa_hash. Fix memory leak in
	error case, spotted by Nikos.

	* dsa-keygen.c (dsa_generate_keypair): Allow q_bits == 224.

	* dsa-hash.c (_dsa_hash): New file and function. Allows digest
	sizes not matching the bitsize of q.
	* dsa.h (_dsa_hash): Declare it.
	* Makefile.in (hogweed_SOURCES): Added dsa-hash.c.

2013-11-23  Niels Möller  <nisse@lysator.liu.se>

	* configure.ac: Check also for openssl/ecdsa.h.

2013-10-05  Niels Möller  <nisse@lysator.liu.se>

	* Makefile.in (nettle_SOURCES): Added eax.c.
	(HEADERS): Added eax.h.

	* testsuite/Makefile.in (TS_NETTLE_SOURCES): Added eax-test.c.

	* testsuite/eax-test.c: New file.

	* nettle-internal.c (nettle_eax_aes128): New aead algorithm.
	(eax_aes128_set_key, eax_aes128_set_nonce, eax_aes128_update)
	(eax_aes128_encrypt, eax_aes128_decrypt, eax_aes128_digest): New
	functions.

	* eax.c: New file.
	* eax.h: New file.

	* aes.h: Fixed typo in name mangling for new aes functions.

2013-09-28  Niels Möller  <nisse@lysator.liu.se>

	* Merge aes-reorg branch. Changes below,
	dated 2013-05-17 - 2013-08-13.

2013-08-13  Niels Möller  <nisse@lysator.liu.se>

	* yarrow.h (struct yarrow256_ctx): Use aes256_ctx, not aes_ctx.
	* yarrow256.c: Adapted to use new aes256 interface.

2013-08-07  Niels Möller  <nisse@lysator.liu.se>

	* umac.h (_UMAC_STATE): Use struct aes128_ctx, not aes_ctx.
	* umac-set-key.c (umac_kdf, _umac_set_key): Use aes128 interface.
	* umac32.c (umac32_digest): Likewise.
	* umac64.c (umac64_digest): Likewise.
	* umac96.c (umac96_digest): Likewise.
	* umac128.c (umac128_digest): Likewise.

2013-06-25  Niels Möller  <nisse@lysator.liu.se>

	* aes-meta.c: Deleted file.

	Analogous changes for new aes192 and aes256 interface.

	* aes.h (struct aes128_ctx): New aes128 declarations.
	* aes-decrypt.c (aes128_decrypt): New function.
	* aes-encrypt.c (aes128_encrypt): New function.
	* aes128-meta.c: New file.
	* aes128-set-encrypt-key.c (aes128_set_encrypt_key): New file and
	function.
	* aes128-set-decrypt-key.c (aes128_set_decrypt_key)
	(aes128_invert_key): New file and functions.
	* Makefile.in (nettle_SOURCES): Added aes128-set-encrypt-key.c,
	aes128-set-decrypt-key.c and aes128-meta.c.

	* nettle-internal.c (nettle_unified_aes128): For testing the old
	AES interface.
	* testsuite/aes-test.c (test_cipher2): New function.
	(test_main): Test both nettle_aes128 and nettle_unified_aes128.

2013-05-22  Niels Möller  <nisse@lysator.liu.se>

	* Makefile.in (nettle_SOURCES): Added aes-invert-internal.c and
	aes-set-key-internal.c.

	* aes.h (AES128_KEY_SIZE, _AES128_ROUNDS): New constants.
	Similarly also for aes192 and aes256.

	* aes-internal.h: Declare new functions.

	* aes-set-key-internal.c (_aes_set_key): New file and funxtion
	extracted from aes_set_encrypt_key.
	* aes-set-encrypt-key.c (aes_set_encrypt_key): Use _aes_set_key.

	* aes-invert-internal.c (_aes_invert): New file and function,
	extracted from aes_invert_key.
	* aes-set-decrypt-key.c (aes_invert_key): Use _aes_invert.

	* arm/v6/aes-encrypt-internal.asm: Adapted to new interface.
	Unfortunately, 4% slowdown on Cortex-A9, for unknown reason.
	* arm/v6/aes-decrypt-internal.asm: Likewise.
	* arm/aes-encrypt-internal.asm: Adapted to new interface.
	* arm/aes-decrypt-internal.asm: Likewise.

2013-05-21  Niels Möller  <nisse@lysator.liu.se>

	* sparc32/aes-encrypt-internal.asm: Adapted to new interface.
	* sparc32/aes-decrypt-internal.asm: Likewise.
	* sparc64/aes-encrypt-internal.asm: Likewise.
	* sparc64/aes-decrypt-internal.asm: Likewise.

	* x86/aes-encrypt-internal.asm: Adapted to new interface.
	* x86/aes-decrypt-internal.asm: Likewise.

2013-05-20  Niels Möller  <nisse@lysator.liu.se>

	* x86_64/aes-encrypt-internal.asm: Adapted to new interface.
	* x86_64/aes-decrypt-internal.asm: Likewise.

2013-05-17  Niels Möller  <nisse@lysator.liu.se>

	* aes.h (struct aes_ctx): Renamed nrounds to rounds, and moved
	first in the structure.
	* aes-set-encrypt-key.c (aes_set_encrypt_key): Updated for renaming.
	* aes-set-decrypt-key.c (aes_invert_key): Likewise.

	* aes-encrypt-internal.c (_nettle_aes_encrypt): Take rounds and
	subkeys as separate arguments, not a struct aes_ctx *. Updated
	callers.
	* aes-decrypt-internal.c (_nettle_aes_decrypt): Likewise.
	* aes-internal.h: Updated prototypes.

	* Start of aes-reorg changes.

2013-09-28  Niels Möller  <nisse@lysator.liu.se>

	* md4.h (struct md4_ctx): Use single uint64_t variable for block
	count.
	* md4.c: Use new block count variable.
	* md5.c, md5.h (struct md5_ctx): Likewise.
	* ripemd160.c, ripemd160.h (struct ripemd160_ctx): Likewise.
	* sha1.c, sha1.h (struct sha1_ctx): Likewise.
	* sha256.c, sha2.h (struct sha256_ctx): Likewise.

	* testsuite/testutils.c (test_hash_large): Added simple progress
	indicator.

	* macros.h (MD_PAD): Use size argument, don't depend on
	sizeof of the count field(s).

2013-09-22  Niels Möller  <nisse@lysator.liu.se>

	* x86_64/gcm-hash8.asm: New file.
	* x86_64/gcm-gf-mul-8.asm: Deleted.

	* configure.ac (asm_nettle_optional_list): Look for gcm-hash8.asm,
	not gcm-gf-mul-8.asm.
	* gcm.c [HAVE_NATIVE_gcm_hash8]: Make use of (optional) assembly
	implementation.

2013-09-21  Niels Möller  <nisse@lysator.liu.se>

	* Makefile.in (des.po): Add same dependencies as for des.o.
	Reported by Vincent Torri.

2013-09-20  Niels Möller  <nisse@lysator.liu.se>

	* testsuite/gcm-test.c: Added tests with associated data of
	varying size.

	* testsuite/testutils.c (tstring_alloc): Add NUL-termination.

2013-09-18  Niels Möller  <nisse@lysator.liu.se>

	* Makefile.in: New stampfiles, libnettle.stamp and
	libhogweed.stamp, updated when both static and shared libraries
	are rebuilt. Used as link dependencies in subdirectories.
	* examples/Makefile.in: Make executable targets depend on
	../libnettle.stamp and libhogweed.stamp, not directly on the
	static library files.
	* testsuite/Makefile.in: Likewise.
	* tools/Makefile.in: Likewise.

2013-09-09  Niels Möller  <nisse@lysator.liu.se>

	* gcm.c [HAVE_NATIVE_gcm_gf_mul_8]: Make use of (optional)
	assembly implementation.

	* configure.ac: Support optional assembly files for both nettle
	and hogweed. Replaced OPT_ASM_SOURCES with OPT_ASM_NETTLE_SOURCES,
	OPT_ASM_HOGWEED_SOURCES, and asm_optional_list with
	asm_nettle_optional_list and asm_hogweed_optional_list.
	(asm_nettle_optional_list): Added gcm-gf-mul-8.asm.

2013-06-25  Niels Möller  <nisse@lysator.liu.se>

	* testsuite/gcm-test.c: Deleted redundant include of aes.h.

	* testsuite/testutils.c (test_aead): Allow digest size smaller
	than the block size.

	* tools/nettle-pbkdf2.c: New command line tool.
	* tools/Makefile.in (TARGETS): Added nettle-pbkdf2.
	(nettle-pbkdf2$(EXEEXT)): New target.
	* testsuite/nettle-pbkdf2-test: New test case.
	* testsuite/Makefile.in (TS_SH): Added nettle-pbkdf2-test.

	* tools/nettle-hash.c (digest_file): Use stack allocation for the
	small hex output buffer.

	* examples/io.c (MIN): Deleted unused macro.

2013-05-21  Niels Möller  <nisse@lysator.liu.se>

	From nettle-2.7-fixes branch:
	* Makefile.in (distdir): Distribute files in arm/v6 subdirectory.

2013-05-20  Niels Möller  <nisse@lysator.liu.se>

	* arm/v6/sha1-compress.asm: Moved into v6 directory, since it uses
	the v6 instruction uadd8, sel and rev.
	* arm/v6/sha256-compress.asm: Likewise.

	* nettle-types.h: Include <stddef.h>, for size_t.

2013-05-17  Niels Möller  <nisse@lysator.liu.se>

	* macros.h (ROTL32, ROTL64): Avoid undefined behaviour for zero
	rotation count. Unfortunately makes CAST128 a bit slower with
	gcc-4.6.3.

	* ecc-j-to-a.c (ecc_j_to_a): Fixed ecc_modp_mul call, to avoid
	invalid overlap of arguments to mpn_mul_n. Problem tracked down by
	Magnus Holmgren.

2013-05-16  Niels Möller  <nisse@lysator.liu.se>

	* arm/aes-encrypt-internal.asm: New file, for pre-v6 processors.
	* arm/aes-decrypt-internal.asm: New file, likewise.

	* arm/aes.m4 (AES_FINAL_ROUND_V5): Variant without using uxtb.
	(AES_FINAL_ROUND_V6): New name, updated callers.
	(AES_FINAL_ROUND): ... old name. Also eliminated one uxtb
	instruction.
	(AES_ENCRYPT_ROUND, AES_DECRYPT): Moved macros to the
	files using them.

	* arm/v6/aes-encrypt-internal.asm: Use ALIGN macro. Use 16-byte
	alignment for loops.
	* arm/v6/aes-decrypt-internal.asm: Likewise. Also added a nop
	which mysteriously improves benchmark performance on Cortex-A9.

2013-05-15  Niels Möller  <nisse@lysator.liu.se>

	* configure.ac (asm_path): Handle armv6 and armv7 differently from
	older ARMs. Add the arm/v6 directory to asm_path when appropriate.

	* arm/v6/aes-encrypt-internal.asm: Moved into v6 directory. Uses
	the uxtb instruction which is not available for older ARMs.
	* arm/v6/aes-decrypt-internal.asm: Likewise.

2013-05-03  Niels Möller  <nisse@lysator.liu.se>

	* cast128.c: Adapt to new struct cast128_ctx.
	(cast128_set_key): Rewrite, eliminating lots of conditions and
	some false warnings.

	* cast128.h (struct cast128_ctx): Separate the small 5-bit
	rotation subkeys and the larger 32-bit masking subkeys.

2013-05-02  Niels Möller  <nisse@lysator.liu.se>

	* testsuite/testutils.c (mpz_combit): Renamed. Define only if not
	provided GMP. Updated all uses.
	(mpz_togglebit): ... old name.

	* sexp-format.c (sexp_vformat): Use type mpz_srcptr rather
	than the old MP_INT *.

2013-04-26  Niels Möller  <nisse@lysator.liu.se>

	* Many files: Use size_t rather than unsigned for data sizes.
	* x86_64/aes-encrypt-internal.asm: Accept 64-bit length.
	* x86_64/aes-decrypt-internal.asm: Likewise.

2013-04-25  Niels Möller  <nisse@lysator.liu.se>

	* configure.ac: Changed version number, to 2.8.
	(LIBNETTLE_MAJOR): Bumped major number, following
	nettle_memxor ABI break.
	(LIBNETTLE_MINOR): Reset to zero.

	* examples/hogweed-benchmark.c: Add benchmarking of OpenSSL's RSA
	functions.
	(all functions): Deleted unneeded casts.

2013-04-24  Niels Möller  <nisse@lysator.liu.se>

	* nettle.texinfo (Miscellaneous functions): Updated memxor
	prototype. Document memxor3.

	* salsa20-crypt.c (salsa20_crypt): Deleted cast of memxor
	argument, no longer needed.
	* salsa20r12-crypt.c (salsa20r12_crypt): Likewise.
	* sha3.c (sha3_absorb): Likewise.

	* memxor.h: Updated prototypes. Drop include of nettle-types.h.

	* memxor.c: Include nettle-types.h, for uintptr_t. Replace all
	internal uses of uint8_t by plain char.
	(memxor): Use void * rather than uint8_t * for
	arguments.
	(memxor3): Likewise.

	* x86_64/memxor.asm: Added nettle_ prefix to symbols.
	* arm/memxor.asm: Likewise.

	* testsuite/symbols-test: Don't allow memxor functions without
	nettle prefix,

	* memxor.h (memxor3): Added name mangling to add "nettle_" prefix
	to memxor and memxor3 symbols.

	* Makefile.in (nettle_OBJS): Deleted $(LIBOBJS), and also deleted
	LIBOBJS substitution.
	(nettle_SOURCES): Added memxor.c, to include it in the library
	unconditionally.

	* configure.ac: Deleted AC_REPLACE_FUNCS for memxor.

	* Released nettle-2.7.

2013-04-23  Niels Möller  <nisse@lysator.liu.se>

	From Martin Storsjö:
	* x86_64/sha256-compress.asm: Add forgotten W64_EXIT.
	* x86_64/sha512-compress.asm: Likewise.
	* x86_64/salsa20-crypt.asm (Lpartial): Don't return via W64_EXIT
	within this subfunction.
	* x86_64/machine.m4 (W64_ENTRY): Use movdqu instead of movdqa for
	saving xmm registers, since the stack is not guaranteed to be
	16-byte aligned on win64. Take pushed xmm registers into account
	when reading the fifth parameter from the stack.

	* Makefile.in: Consistently use EXEEXT_FOR_BUILD.

2013-04-21  Niels Möller  <nisse@lysator.liu.se>

	* Makefile.in (DISTFILES): Added mini-gmp.c and mini-gmp.h.
	(distdir): Use find, for identifying assembly files to copy.

2013-04-18  Niels Möller  <nisse@lysator.liu.se>

	* configure.ac: Recognize cpu type "arm*", not just "armv7*'.

	* arm/aes-encrypt-internal.asm: Updated include of aes.m4.
	* arm/aes-decrypt-internal.asm: Likewise.

	* Makefile.in (distdir): Updated for ARM reorganization.

	* configure.ac (asm_path): Generalized, can now be a list of
	directories. On ARM, check for neon instructions, and add arm/neon
	if appropriate. New command line options
	--enable-arm-neon/--disable-arm-neon, for overriding the default.

	arm/neon: New subdirectory, for assembly files making use of neon
	instructions.

	arm: Renamed directory, from...
	armv7: ...old name.

	* aclocal.m4 (NETTLE_CHECK_ARM_NEON): New macro.

	* nettle.texinfo (Keyed hash functions): Document UMAC.

	* umac.h (UMAC32_DIGEST_SIZE, UMAC64_DIGEST_SIZE)
	(UMAC96_DIGEST_SIZE, UMAC128_DIGEST_SIZE): New constants.
	(UMAC_DATA_SIZE): New name, for consistency with hash functions.
	Updated all uses.
	(UMAC_BLOCK_SIZE): ... old name.

2013-04-17  Niels Möller  <nisse@lysator.liu.se>

	* examples/nettle-benchmark.c (main): Benchmark salsa20r12.

	* nettle-internal.c (nettle_salsa20r12): Cipher struct for
	benchmarking only.
	* nettle-internal.h (nettle_salsa20): Declare it.

	* Makefile.in (eccdata): Depend on mini-gmp files. Drop -lgmp.

	* eccdata.c: Use mini-gmp, to avoid gmp dependency and associated
	configure tests for the *build* system. Replaced mpz_submul_ui by
	mpz_mul_ui + mpz_sub, and gmp_printf and gmp_fprintf by calls to
	mpz_out_str.

	* mini-gmp.h, mini-gmp.c: New files, copied from gmp-5.1.1.

2013-04-16  Niels Möller  <nisse@lysator.liu.se>

	* umac-set-key.c (BE_SWAP32_N): Fixed dummy definition used for
	big-endian systems.

	* Makefile.in (TARGETS): Deleted eccdata, it should be build only
	when public key support is enabled.
	(clean-here): Exlicitly list it here.

	* asm.m4 (m4_log2): New macro, similar to the one in gmp.
	(ALIGN): Changed to take alignment in bytes. Updated all callers,
	currently used only in x86 and x86_64 files.

	* umac.h (umac32_ctx, umac64_ctx, umac96_ctx, umac128_ctx): Make
	block count an uint64_t. Reorder some elements to put short values
	together.
	* umac-l2.c (_umac_l2, _umac_l2_final): Make count argument an uint64_t.
	(_umac_l2): Deleted redundant memcpy.
	(_umac_l2, _umac_l2_final): Store input buffer at end of the
	poly64/poly128 state. Deleted l1_out from corresponding context
	structs, and updated all callers.

	* configure.ac: Changed version number to 2.7.
	(LIBNETTLE_MINOR): Bumped library version, to 4.6.
	(LIBHOGWEED_MINOR): And to 2.4.

	* Makefile.in (distdir): Include files from armv7 subdirectory.

	* x86_64/umac-nh-n.asm: New file, 3.5 time speedup.

	* umac32.c (umac32_digest): Fix nonce caching.
	* umac64.c (umac64_digest): Likewise.

	* testsuite/umac-test.c (test_incr): New function.
	(test_main): Test nonce increment.

	* misc/umac/umac.py: UMAC reference implementation.
	* misc/umac/rijndael.py: AES implementation used by umac.py.
	* misc/umac/mkvectors: Script to generate UMAC test vectors.
	* misc/umac/vectors.out: Generated test vectors.

	* umac32.c (umac32_digest): Fix nonce increment, use INCREMENT
	macro.
	* umac64.c (umac64_digest): Likewise.
	* umac96.c (umac96_digest): Likewise.
	* umac128.c (umac128_digest): Likewise.

	* macros.h (INCREMENT): Allow size == 1.

2013-04-15  Niels Möller  <nisse@lysator.liu.se>

	* x86_64/umac-nh.asm: New file. 4.4 time speedup.

	* armv7/umac-nh-n.asm: New file. 2.0-2.3 time speedup.

	* testsuite/umac-test.c (test_align): Fixed memory leak.

2013-04-12  Niels Möller  <nisse@lysator.liu.se>

	* armv7/umac-nh.asm: New file. 2.4 time speedup.

	* armv7/machine.m4 (D0REG, D1REG): New macros.

	* configure.ac (asm_replace_list): Added umac-nh.asm and
	umac-nh-n.asm.

	* testsuite/umac-test.c: Test different alignments for the
	message.

2013-04-11  Niels Möller  <nisse@lysator.liu.se>

	* umac-nh-n.c (_umac_nh_n): Rewrote as a single pass over the
	message data.

	* examples/nettle-benchmark.c (time_umac): New function.
	(main): Call it.

	* umac-set-key.c (_umac_set_key): Drop byteswapping of l3_key2, it
	can be xored directly to the pad in native byteorder.
	* umac-l3.c (_umac_l3): Drop key_2 argument, let caller do that
	xor. Updated all callers.
	* umac32.c (umac32_digest): Adapt to l3 changes.
	* umac64.c (umac64_digest): Likewise.
	* umac96.c (umac96_digest): Likewise.
	* umac128.c (umac128_digest): Likewise.

	Initial implementation of umac.
	* umac.h: New file.
	* umac-nh.c: New file.
	* umac-nh-n.c: New file.
	* umac-poly64.c: New file.
	* umac-poly128.c: New file.
	* umac-l2.c: New file.
	* umac-l3.c: New file.
	* Makefile.in (nettle_SOURCES): Added umac source files.
	(HEADERS): Added umac.h.
	* testsuite/umac-test.c: New file.
	* testsuite/Makefile.in (TS_NETTLE_SOURCES): Added umac-test.c.

	* ecc-mul-a.c (ecc_mul_a): Avoid using mp_bitcnt_t, for
	compatibility with older GMP versions.
	* ecc-mul-g.c (ecc_mul_g): Likewise.
	* eccdata.c (ecc_mul_binary): Likewise.
	* sec-modinv.c (sec_modinv): Likewise.

	* x86_64/sha3-permute.asm: Go via memory for moves between general
	registers and xmm registers.

2013-04-06  Niels Möller  <nisse@lysator.liu.se>

	From Edgar E. Iglesias:
	* sha3.c (_sha3_update): Fix condition for when the block buffer
	is full.

2013-04-04  Niels Möller  <nisse@lysator.liu.se>

	* ecc-point.c (ecc_point_get): Allow NULL x or y, ignore
	corresponding coordinate.

	* nettle.texinfo (Elliptic curves): Document high-level ECDSA
	support.

	From Martin Storsjö. Fallback functions for older GMP releases.
	* gmp-glue.c (mpn_copyd, mpn_copyi, mpn_zero): New functions.
	* gmp-glue.h: Declare them.
	(mpn_sqr): Fallback macro.

	* gmp-glue.h (cnd_add_n, cnd_sub_n): Moved here, define in terms
	of mpn_cnd_add_n and mpn_sub_n if available, otherwise in terms of
	mpn_addmul_1 and mpn_submul_1. This seems to be an improvement for
	subtraction, but more questionable for addition.

	* ecc-internal.h: Include gmp-glue.h. Deleted corresponding
	include in all files using ecc-internal.h.
	(cnd_add_n, cnd_sub_n): Moved from here.

2013-04-03  Niels Möller  <nisse@lysator.liu.se>

	* ecc-point-mul-g.c (ecc_point_mul_g): New file and function.
	* ecc-point-mul.c (ecc_point_mul): New file and function.
	* ecc.h: Updated declarations and name mangling.
	* Makefile.in (hogweed_SOURCES): Added ecc-point-mul.c and
	ecc-point-mul-g.c.

	* testsuite/salsa20-test.c (test_main): Tests for salsa20r12,
	contributed by Nikos Mavrogiannopoulos.

2013-03-26  Niels Möller  <nisse@lysator.liu.se>

	* armv7/salsa20-core-internal.asm: New file. 45% speedup.

2013-03-25  Niels Möller  <nisse@lysator.liu.se>

	From Martin Storsjö:
	* examples/timing.c: New file, extracted from nettle-benchmark.c.
	* examples/timing.h: New file.
	* examples/Makefile.in (SOURCES): Added timing.c.
	(DISTFILES): Added timing.h.
	(BENCH_OBJS, ECC_BENCH_OBJS, HOGWEED_BENCH_OBJS): Added timing.o.
	* examples/nettle-benchmark.c: Use timing.h.
	* examples/hogweed-benchmark.c: Likewise.
	* examples/ecc-benchmark.c: Likewise.

	From Nikos Mavrogiannopoulos:
	* salsa20r12-crypt.c (salsa20r12_crypt): New file and function.
	* salsa20.h (salsa20r12_crypt): Declare.
	* Makefile.in (nettle_SOURCES): Added salsa20r12-crypt.c.

	From Martin Storsjö:
	* examples/hogweed-benchmark.c: Include local headers.
	* testsuite/ecdsa-keygen-test.c: Likewise.
	* x86_64/sha3-permute.asm: Workaround for Apple's assembler; write
	movq instructions as movd.

	* Makefile.in (hogweed_PURE_OBJS): Don't include OPT_ASM_SOURCES
	twice.

2013-03-15  Niels Möller  <nisse@lysator.liu.se>

	* armv7/sha3-permute.asm: New file. 4.5 time speedup.

	* armv7/machine.m4 (QREG): New macro.

2013-03-14  Niels Möller  <nisse@lysator.liu.se>

	* configure.ac (asm_replace_list): Added sha3-permute.asm,
	revering 2012-12-30 change. 34% speedup on intel i5, from 2190
	cycles for the C implementation down to 1630.

	* armv7/sha512-compress.asm: Optimized. Keep expanded data in
	registers, exploit parallelism. Another 70% speedup.

	* testsuite/sha512-test.c (test_main): Additional test vectors,
	including some longer than 128 bytes.

2013-03-13  Niels Möller  <nisse@lysator.liu.se>

	* armv7/sha512-compress.asm: New file, using neon instructions.
	2.3 time speedup.

	* configure.ac (asm_replace_list): Added sha512-compress.asm.
	* x86_64/machine.m4 (OFFSET64): New macro.
	* x86_64/sha512-compress.asm: New file, 20% speedup.

	* sha512-compress.c (ROUND): Eliminated a temporary, analogous to
	sha256 change below.

	* x86_64/sha256-compress.asm: New file, 16% speedup (benchmarked
	on intel i5).

2013-03-11  Niels Möller  <nisse@lysator.liu.se>

	* armv7/sha256-compress.asm: New file, 25% speedup.

	* configure.ac (asm_replace_list): Added sha256-compress.asm.

	* sha256-compress.c (ROUND): Eliminated a temporary.

	* armv7/sha1-compress.asm: New file, 9% speedup.

	* testsuite/testutils.c (test_hash): Test different alignments for
	the hash input.

2013-03-08  Niels Möller  <nisse@lysator.liu.se>

	* armv7/aes-decrypt-internal.asm: New file, 15% speedup.
	* armv7/aes-encrypt-internal.asm: New file, 25% speedup.
	* armv7/aes.m4: New file.

2013-03-07  Niels Möller  <nisse@lysator.liu.se>

	* gmp-glue.c (mpz_limbs_cmp): Don't use PTR and SIZ macros.

	* Makefile.in (aesdata, desdata, twofishdata, shadata, gcmdata)
	(eccdata): Arrange for compiling these programs for running on the
	build system, also when cross compiling everything else.

	* config.make.in (CC_FOR_BUILD, EXEEXT_FOR_BUILD): New variables.

	* configure.ac: Use GMP_PROG_CC_FOR_BUILD and
	GMP_PROG_EXEEXT_FOR_BUILD.

	* aclocal.m4 (GMP_PROG_CC_FOR_BUILD, GMP_PROG_CC_FOR_BUILD_WORKS)
	(GMP_PROG_EXEEXT_FOR_BUILD): New macros, based on GMP's.

	* aesdata.c: Deleted includes of config.h and nettle-types.h. Use
	unsigned char and unsigned long instead of stdint.h types.

	* desdata.c: Deleted includes of config.h and desCode.h.
	(main): Return 1 on invalid argument. Don't use ROR macro. Use
	unsigned long instead of uint32_t, and make it work if unsigned
	long is larger than 32 bits.

	* gcmdata.c: Deleted include of config.h and use UNUSED macro.
	* shadata.c: Likewise.

	* twofishdata.c: Deleted include of nettle-types.h. Use unsigned
	char instead of stdint.h types.

	* x86_64/ecc-521-modp.asm: New file. 2.4 time speedup.

2013-03-06  Niels Möller  <nisse@lysator.liu.se>

	* x86_64/ecc-384-modp.asm: New file, 3 time speedup.
	* x86_64/ecc-256-redc.asm: New file, 2.5 time speedup.
	* x86_64/ecc-224-modp.asm: New file, 5 time speedup over C
	version.

2013-03-05  Niels Möller  <nisse@lysator.liu.se>

	* configure.ac (asm_optional_list): Added ecc-521-modp.asm.
	* ecc-521.c: Check HAVE_NATIVE_ecc_521_modp, and use native
	version if available.
	* armv7/ecc-521-modp.asm: New file, 2 time speedup over C version.

2013-03-04  Niels Möller  <nisse@lysator.liu.se>

	* configure.ac (asm_optional_list): Added ecc-384-modp.asm. Deleted
	bogus reference to $asm_search_list.
	* ecc-384.c: Check HAVE_NATIVE_ecc_384_modp, and use native
	version if available.
	* armv7/ecc-384-modp.asm: New file, 3 time speedup over C version.

2013-03-03  Niels Möller  <nisse@lysator.liu.se>

	* ecc-256.c: Fixed definition of USE_REDC.

2013-03-01  Niels Möller  <nisse@lysator.liu.se>

	* ecc-256.c: Check HAVE_NATIVE_ecc_256_redc, and use native
	version if available.
	* armv7/ecc-256-redc.asm: New file, 4 time speedup over C version.

	* testsuite/ecc-redc-test.c: Increased test count.

	* ecc-224.c: Check HAVE_NATIVE_ecc_224_modp, and use native
	version if available.
	* armv7/ecc-224-modp.asm: New file, 4.5 time speedup over C
	version.

	* configure.ac (asm_optional_list): Added ecc-224-modp.asm.
	(OPT_ASM_SOURCES): Fixed assignment.

2013-02-28  Niels Möller  <nisse@lysator.liu.se>

	* x86_64/ecc-192-modp.asm: Reorganized to reduce number of
	additions. Use setc instruction.

	* examples/Makefile.in: Let $(HOGWEED_TARGETS) depend on
	../libhogweed.a.

	* armv7/ecc-192-modp.asm: New file. 2.5 time speedup over C
	version.

2013-02-27  Niels Möller  <nisse@lysator.liu.se>

	* ecc-192.c: Check HAVE_NATIVE_ecc_192_modp, and use native
	version if available.
	(ecc_192_modp): Fixed carry handling bug in 32-bit version.

	* x86_64/ecc-192-modp.asm: New file. 3.8 times speedup over C
	version.

	* configure.ac (OPT_ASM_SOURCES): New substituted variable.
	(asm_replace_list, asm_optional_list): New variables. For files in
	asm_optional_list, also add them to OPT_ASM_SOURCES and define
	appropriate HAVE_NATIVE_* symbols found.

	* Makefile.in (OPT_ASM_SOURCES): New variable. Used for setting
	hogweed_OBJS and hogweed_PURE_OBJS.

	* testsuite/ecc-mod-test.c: Increased test count.

	* ecc-384.c (ecc_384_modp): Fixed typo which broke carry handling
	in the 64-bit version.

	* examples/ecc-benchmark.c (bench_add_jjj): Typo fix, benchmark
	the right function.

	* gmp-glue.h: Check if GMP provides mpz_limbs_read (expected in
	next release).
	* gmp-glue.c: Use GMP's mpz_limbs_read and friends if available.
	Renamed all functions for consistency with GMP. Updated all
	callers.

2013-02-20  Niels Möller  <nisse@lysator.liu.se>

	* examples/Makefile.in (HOGWEED_TARGETS): Added
	hogweed-benchmark$(EXEEXT).
	(SOURCES): Added hogweed-benchmark.c.
	(hogweed-benchmark$(EXEEXT)): New target.

	* examples/hogweed-benchmark.c: New file.

	* ecdsa-keygen.c (ecdsa_generate_keypair): New file and function.
	* Makefile.in (hogweed_SOURCES): Added ecdsa-keygen.c.
	* testsuite/ecdsa-keygen-test.c: New testcase.
	* testsuite/Makefile.in (TS_HOGWEED_SOURCES): Added
	ecdsa-keygen-test.c.

	* nettle-internal.h (TMP_ALLOC): Added missing parentheses.

2013-02-18  Niels Möller  <nisse@lysator.liu.se>

	* testsuite/ecdsa-verify-test.c: New testcase.
	* testsuite/ecdsa-sign-test.c: New testcase.
	* testsuite/Makefile.in (TS_HOGWEED_SOURCES): Added
	ecdsa-sign-test.c and ecdsa-verify-test.c.
	* testsuite/testutils.h: Include ecdsa.h.
	(SHEX): Deleted const cast.

	* ecc-point.c: New file, struct ecc_point abstraction.
	* ecc-scalar.c: New file, struct ecc_scalar abstraction.
	* ecc-random.c (ecc_modq_random, ecc_scalar_random): New file, new
	functions.
	* ecc-hash.c (ecc_hash): New file and function.
	* ecc-ecdsa-sign.c: New file, low-level signing interface.
	* ecc-ecdsa-verify.c: New file, low-level ecdsa verify.
	* ecdsa-sign.c: (ecdsa_sign): New file and function.
	* ecdsa-verify.c (ecdsa_verify): New file and function.
	* ecdsa.h: New header file.
	* ecc.h: Declare ecc_point and ecc_scalar functions.
	* ecc-internal.h: Added declarations.
	* Makefile.in (hogweed_SOURCES): Added new source files.
	(HEADERS): Added ecdsa.h.

	* gmp-glue.c (_mpz_set_mpn): New convenience function.
	(_mpn_set_base256): New function.
	(_gmp_alloc_limbs): New function.
	(_gmp_free_limbs): New function.
	* gmp-glue.h: Corresponding declarations. Include nettle-stdinh.h.

	* examples/Makefile.in (HOGWEED_TARGETS): Renamed, was
	RSA_TARGETS. Added ecc-benchmark$(EXEEXT).
	(SOURCES): Added ecc-benchmark.c.
	(ecc-benchmark$(EXEEXT)): New target.

	* examples/ecc-benchmark.c: New file, benchmarking ecc primitives.

2013-02-15  Niels Möller  <nisse@lysator.liu.se>

	Integrate ecc_mul_a.
	* ecc-a-to-j.c: New file.
	* ecc-add-jjj.c: New file.
	* ecc-mul-a.c: New file.
	* Makefile.in (hogweed_SOURCES): Added new files.
	* testsuite/ecc-mul-a-test.c: New file.
	* testsuite/Makefile.in (TS_HOGWEED_SOURCES): Added
	ecc-mul-a-test.c.

	* testsuite/testutils.c: Removed redundant includes.
	(die): New function.

	Integrate ecc_mul_g.
	* ecc.h: New file.
	* ecc-j-to-a.c: New file.
	* ecc-size.c: New file.
	* ecc-add-jja.c: New file.
	* ecc-dup-jj.c: New file.
	* ecc-mul-g.c: New file.
	* sec-tabselect.c: New file.
	* Makefile.in (hogweed_SOURCES): Added new files.
	(HEADERS): Added ecc.h
	* testsuite/ecc-mul-g-test.c: New file.
	* testsuite/Makefile.in (TS_HOGWEED_SOURCES): Added
	ecc-mul-g-test.c.
	* testsuite/testutils.c (xalloc_limbs): New function.
	(test_mpn): New function.
	(test_ecc_point): New function.
	(test_ecc_mul_a): New function.
	(test_ecc_mul_j): New function.
	* testsuite/testutils.h: Corresponding declarations.

	Integrate ECC internals.
	* ecc-curve.h: New file.
	* ecc-internal.h: New file.
	* cnd-copy.c: New file.
	* ecc-192.c: New file.
	* ecc-224.c: New file.
	* ecc-256.c: New file.
	* ecc-384.c: New file.
	* ecc-521.c: New file.
	* ecc-generic-modp.c: New file.
	* ecc-generic-modq.c: New file.
	* ecc-generic-redc.c: New file.
	* ecc-mod.c: New file.
	* ecc-modp.c: New file.
	* ecc-modq.c: New file.
	* sec-add-1.c: New file.
	* sec-modinv.c: New file.
	* sec-sub-1.c: New file.
	* Makefile.in (hogweed_SOURCES): Added new files.
	(HEADERS): Added ecc-curve.h.
	(DISTFILES): Added ecc-internal.h.
	* testsuite/ecc-mod-test.c: New file.
	* testsuite/ecc-modinv-test.c: New file.
	* testsuite/ecc-redc-test.c: New file.
	* testsuite/testutils.c (ecc_curves): New constant array.
	* testsuite/testutils.h: Include ecc-related headers. Declare
	ecc_curves array.
	* testsuite/Makefile.in (TS_HOGWEED_SOURCES): Added ecc-mod-test.c
	ecc-modinv-test.c ecc-redc-test.c.

	* gmp-glue.c: New file, mpn <-> mpz conversions.
	* gmp-glue.h: New file.
	* Makefile.in: Added to hogweed_SOURCES and DISTFILES, respectively.

	* eccdata.c: New program, for generating ECC-related tables.
	* Makefile.in (ecc-192.h, ecc-224.h, ecc-256.h, ecc-384.h)
	(ecc-512.h): New generated files.

2013-02-19  Niels Möller  <nisse@lysator.liu.se>

	* armv7/memxor.asm (memxor): Software pipelining for the aligned
	case. Runs at 6 cycles (0.5 cycles per byte). Delayed push of
	registers until we know how many registers we need.
	(memxor3): Use 3-way unrolling also for aligned memxor3.
	Runs at 8 cycles (0.67 cycles per byte)

2013-02-14  Niels Möller  <nisse@lysator.liu.se>

	* configure.ac: Find GMP's GMP_NUMB_BITS. Substitute in Makefile.
	* config.make.in (GMP_NUMB_BITS): New variable.

	* examples/rsa-keygen.c (uint_arg): New function.
	(main): New options -s and -e, to specify key size and public
	exponent. Increased default key size to 2048.

2013-02-12  Niels Möller  <nisse@lysator.liu.se>

	* armv7/memxor.asm (memxor): Optimized aligned case, using 3-way
	unrolling.

2013-02-06  Niels Möller  <nisse@lysator.liu.se>

	* armv7/memxor.asm (memxor, memxor3): Optimized aligned case, now
	runs at 0.75 cycles/byte.

	* armv7/README: New file.
	* armv7/machine.m4: New (empty) file.
	* armv7/memxor.asm: Initial assembly implementation.

	* config.m4.in: Substitute ASM_TYPE_PROGBITS as TYPE_PROGBITS.

	* config.make.in: Added .s to the suffix list.

	* Makefile.in (.asm.s): Use a separate make target for .asm
	preprocessing. Include asm.d, which the corresponding
	dependencies.

	* configure.ac (asm_file_list): Collect assembly files into this
	variable.
	(asm.d): Make config.status write dependencies for .s files into
	asm.d.
	(ASM_ALIGN_LOG): Set to "no" when appropriate.
	(ASM_TYPE_FUNCTION): Default to "@function".
	(ASM_TYPE_PROGBITS): New substituted variable, set in the same way
	as ASM_TYPE_FUNCTION.
	(ASM_MARK_NOEXEC_STACK): Use TYPE_PROGBITS.
	(asm_path): Set up asm_path for armv7.

	* asm.m4: Use changecom to disable m4 quoting. Use divert to
	suppress output.

2013-02-05  Niels Möller  <nisse@lysator.liu.se>

	* testsuite/rsa-keygen-test.c (test_main): Updated expected
	signatures, after the nettle_mpz_random change below.
	* testsuite/dsa-test.c (test_main): Likewise. Also fixed the
	dsa256 test to actually use the expected signature.

2013-01-31  Niels Möller  <nisse@lysator.liu.se>

	* bignum-random.c (nettle_mpz_random): Increased number of extra
	bits to 64, following FIPS 186-3.

2013-01-16  Niels Möller  <nisse@lysator.liu.se>

	* Released nettle-2.6.

2013-01-12  Niels Möller  <nisse@lysator.liu.se>

	* configure.ac: Use AC_LANG_SOURCE.

2013-01-02  Niels Möller  <nisse@lysator.liu.se>

	* configure.ac (LIBNETTLE_MINOR): Bumped library version, to 4.5.
	(LIBHOGWEED_MINOR): And to 2.3.

	* examples/Makefile.in: Explicit rules for building objects in
	parent directory.
	* tools/Makefile.in: Likewise.
	* testsuite/Makefile.in: Likewise.

2013-01-01  Niels Möller  <nisse@lysator.liu.se>

	* nettle.texinfo (Recommended hash functions): Document additional
	sha3 functions.

	* examples/nettle-benchmark.c (main): Benchmark additional sha3
	functions.

2012-12-30  Niels Möller  <nisse@lysator.liu.se>

	* sha3-224.c, sha3-224-meta.c: New files.
	* sha3-384.c, sha3-384-meta.c: New files.
	* sha3-512.c, sha3-512-meta.c: New files.
	* sha3.h: Prototypes for sha3 with sizes 224, 384 and 512.
	* nettle-meta.h: Declare nettle_sha3_224, nettle_sha3_384 and
	nettle_sha3_512.
	* Makefile.in (nettle_SOURCES): Added new sha3 files.

	* testsuite/sha3-224-test.c: New file.
	* testsuite/sha3-384-test.c: New file.
	* testsuite/sha3-512-test.c: New file.
	* testsuite/Makefile.in (TS_NETTLE_SOURCES): Added new sha3 test files.

	* configure.ac: Disabled use of sha3-permute.asm.

2012-12-20  Niels Möller  <nisse@lysator.liu.se>

	From Tim Rühsen:
	* testsuite/des-compat-test.c (pt): Use proper prototype, use
	const.
	* testsuite/testutils.c (test_dsa_key): Deleted spurious
	semicolon.

2012-12-15  Niels Möller  <nisse@lysator.liu.se>

	Based on a patch from Alon Bar-Lev:
	* Makefile.in (LIBTARGETS, SHLIBTARGET): Define as empty if static
	or shared libraries, respectively, are disabled.
	(TARGETS): Deleted @IF_SHARED@ conditional, now in the definition
	of SHLIBTARGET.

	From Alon Bar-Lev:
	* configure.ac: Check for ar program. New option --disable-static.
	* config.make.in (AR): Use configured value.

2012-12-13  Niels Möller  <nisse@lysator.liu.se>

	* x86_64/sha3-permute.asm: Rewrote, to keep all state in
	registers. 2400 cycles on x86_64, only slightly faster than the
	current C code.

2012-12-09  Niels Möller  <nisse@lysator.liu.se>

	* sha3-permute.c (sha3_permute): Rewrote to do permutation in
	place. 80% speedup on x86_64, 2500 cycles.

2012-12-04  Niels Möller  <nisse@lysator.liu.se>

	* ctr.c (ctr_crypt): Fix bug reported by Tim Kosse. Don't
	increment the counter when length is zero (was broken for the
	in-place case).

	* testsuite/ctr-test.c (test_main): Added test with zero-length
	data.
	* testsuite/testutils.c (test_cipher_ctr): Check the ctr value
	after encrypt and decrypt.

2012-12-03  Niels Möller  <nisse@lysator.liu.se>

	* sha3-permute.c (sha3_permute): Optimized, to reduce number of
	passes over the data. 20% speedup on x86_64, 4700 cycles.

	* configure.ac: Added sha3-permute.asm.

	* x86_64/sha3-permute.asm: New file. 30% speedup over current C
	code, 4300 cycles.

	* nettle.texinfo (Hash functions): Split into several sections,
	separating recommended hash functions and legacy hash functions.
	Document sha3-256.

2012-12-02  Niels Möller  <nisse@lysator.liu.se>

	Split sha.h into new files sha1.h and sha2.h. Replaced all
	internal usage of sha.h in all files.
	* sha.h: Kept for compatibility, just includes both new files.
	* sha1.h: New file.
	* sha2.h: New file.
	* Makefile.in (HEADERS): Added sha1.h and sha2.h.

2012-11-28  Niels Möller  <nisse@lysator.liu.se>

	From Fredrik Thulin:
	* testsuite/pbkdf2-test.c (test_main): Add PBKDF2-HMAC-SHA512 test
	cases.

2012-11-15  Niels Möller  <nisse@lysator.liu.se>

	* sha3-permute.c (sha3_permute): Use ULL suffix on round
	constants. Avoid passing shift count 0 to ROTL64.

	* sha3.c (sha3_absorb): Fixed big-endian code. Need macros.h.

	* macros.h (LE_READ_UINT64): New macro.

2012-11-13  Niels Möller  <nisse@lysator.liu.se>

	* sha3-permute.c (sha3_permute): Micro optimizations. Partial
	unrolling. Use lookup table for the permutation. On an x86_64,
	execution time reduced from appr. 13000 cycles to appr. 6000.

	* examples/nettle-benchmark.c (TIME_CYCLES): New macro.
	(bench_sha1_compress, bench_salsa20_core): Use it.
	(bench_sha3_permute): New function.
	(main): Call bench_sha3_permute.

2012-11-12  Niels Möller  <nisse@lysator.liu.se>

	* examples/nettle-benchmark.c (main): Benchmark sha3_256.

	* sha3-permute.c: New file. Permutation function for sha3, aka
	Keccak.
	* sha3.h: New header file.
	* sha3.c: New file, absorption and padding for sha3.
	* sha3-256.c: New file.
	* sha3-256-meta.c: New file.
	* nettle-meta.h (nettle_sha3_256): Declare.
	* Makefile.in (nettle_SOURCES): Added sha3 files.
	(HEADERS): Added sha3.h.
	* testsuite/sha3.awk: New file. Script to extract test vectors.
	* testsuite/sha3-256-test.c: New file.
	* testsuite/sha3-permute-test.c: New file.
	* testsuite/Makefile.in (TS_NETTLE_SOURCES): Added
	sha3-permute-test.c and sha3-256-test.c.
	(DISTFILES): Added sha3.awk.
	* testsuite/.test-rules.make: Added sha3 targets.

	* macros.h (LE_WRITE_UINT64): New macro.
	* write-le64.c (_nettle_write_le64): New file and function.
	* nettle-write.h (_nettle_write_le64): Declare. Also deleted
	declaration of non-existent _nettle_write_be64.
	* Makefile.in (nettle_SOURCES): Added write-le64.c.

	* macros.h (ROTL64): New macro, moved from...
	* sha512-compress.c (ROTL64): ... old location, deleted.

	* serpent-internal.h [HAVE_NATIVE_64_BIT] (DROTL32): Renamed from...
	(ROTL64): ... old name.
	(DRSHIFT32): Renamed from ...
	(RSHIFT64): ... old name.
	* serpent-encrypt.c (LINEAR_TRANSFORMATION64): Updated for above
	renames.
	* serpent-decrypt.c (LINEAR_TRANSFORMATION64_INVERSE): Likewise.

2012-11-11  Niels Möller  <nisse@lysator.liu.se>

	From Nikos Mavrogiannopoulos:
	* nettle.texinfo (Hash functions): Added documentation for
	gosthash94.
	* examples/nettle-benchmark.c (main): Benchmark gosthash94.

2012-11-10  Niels Möller  <nisse@lysator.liu.se>

	* nettle.texinfo (nettle_hashes, nettle_ciphers): Use deftypevr,
	not deftypevrx. Spotted by Nikos Mavrogiannopoulos.

2012-11-08  Niels Möller  <nisse@lysator.liu.se>

	Gost hash function, ported from Aleksey Kravchenko's rhash library
	by Nikos Mavrogiannopoulos.
	* gosthash94.c: New file.
	* gosthash94.h: New file.
	* gosthash94-meta.c: New file.
	* nettle-meta.h (nettle_gosthash94): Declare.
	* Makefile.in (nettle_SOURCES): Added gosthash94.c and
	gosthash94-meta.c.
	(HEADERS): Added gosthash94.h.
	* testsuite/gosthash94-test.c: New file.
	* testsuite/Makefile.in (TS_NETTLE_SOURCES): Added
	gosthash94-test.c.

2012-10-29  Niels Möller  <nisse@lysator.liu.se>

	From Martin Storsjö:
	* configure.ac (dummy-dep-files): Avoid non-posix \|-operator in
	sed regexp.

2012-10-29  Niels Möller  <nisse@lysator.liu.se>

	* x86_64/salsa20-core-internal.asm: New file.
	* configure.ac: Added salsa20-core-internal.asm.
	* examples/nettle-benchmark.c (bench_salsa20_core): New function.

2012-10-27  Niels Möller  <nisse@lysator.liu.se>

	* testsuite/Makefile.in (TS_SOURCES, CXX_SOURCES): Include sources
	unconditionally.
	(TS_CXX): Moved @IF_CXX@ conditional here.
	(DISTFILES): Use $(SOURCES), which now includes all C source
	files. testutils.c was lost in a the 2012-09-20 change.

	* x86_64/salsa20-crypt.asm: Include x86_64/salsa20.m4.
	Make all exits go via .Lend and W64_EXIT.

	* x86_64/salsa20.m4: New file, extracted from
	x86_64/salsa20-crypt.asm.

2012-10-26  Niels Möller  <nisse@lysator.liu.se>

	* configure.ac (LIBNETTLE_LINK, LIBHOGWEED_LIBS): Add $(CFLAGS) on
	the link command line. Reported by Dennis Clarke.

2012-10-03  Niels Möller  <nisse@lysator.liu.se>

	From: Nikos Mavrogiannopoulos:
	* testsuite/testutils.c (test_hash): On failure, print the
	expected and returned hash values.

2012-09-23  Niels Möller  <nisse@lysator.liu.se>

	* Makefile.in (nettle_SOURCES): Added salsa20-core-internal.c.

	* salsa20-core-internal.c (_salsa20_core): New file and function,
	extracted from salsa20_crypt.
	* salsa20.h (_salsa20_core): Declare it.
	* salsa20-crypt.c (salsa20_crypt): Use _salsa20_core.

2012-09-21  Niels Möller  <nisse@lysator.liu.se>

	* pbkdf2.c (pbkdf2): assert that iterations > 0. Reorganized
	loops.

	* nettle.texinfo (Cipher functions): Stress that the salsa20 hash
	function is not suitable as a general hash function.

2012-09-20  Simon Josefsson  <simon@josefsson.org>

	* pbkdf2-hmac-sha1.c, pbkdf2-hmac-sha256.c: New files.
	* pbkdf2.h (pbkdf2_hmac_sha1, pbkdf2_hmac_sha256): New prototypes.
	* Makefile.in (nettle_SOURCES): Add pbkdf2-hmac-sha1.c and
	pbkdf2-hmac-sha256.c.
	* nettle.texinfo (Key derivation functions): Improve.
	* testsuite/pbkdf2-test.c (test_main): Test new functions.

2012-09-20  Niels Möller  <nisse@lysator.liu.se>

	* pbkdf2.c (pbkdf2): Reordered arguments, for consistency.
	* pbkdf2.h (PBKDF2): Analogous reordering.
	* testsuite/pbkdf2-test.c: Adapted to new argument order. Also use
	LDATA for the salt.
	* nettle.texinfo (Key derivation functions): Updated documented
	pbkdf2 prototype.

	* testsuite/Makefile.in (VALGRIND): New variable, to make valgrind
	checking easier.

	* configure.ac: New substitution IF_CXX, replacing CXX_TESTS.
	(dummy-dep-files): Handle .cxx files.

	* testsuite/Makefile.in: Use IF_CXX. Include dependency file for
	cxx-test.o.

2012-09-19  Niels Möller  <nisse@lysator.liu.se>

	From Tim Rühsen:
	* examples/rsa-encrypt.c (main): Added missing mpz_clear.
	* examples/rsa-keygen.c (main): Added missing deallocation.

	* testsuite/meta-hash-test.c (test_main): Validate
	NETTLE_MAX_HASH_DIGEST_SIZE.

	* pbkdf2.h (PBKDF2): New macro.
	* testsuite/pbkdf2-test.c: Use it.

2012-09-12  Simon Josefsson  <simon@josefsson.org>

	* NEWS: Mention addition of PBKDF2.
	* pbkdf2.c (pbkdf2): New file and function.
	* pbkdf2.h: Declare it.
	* Makefile.in (nettle_SOURCES): Add pbkdf2.c.
	(HEADERS): Add pbkdf2.h.
	* nettle.texinfo (Key derivation functions): New section.
	* testsuite/pbkdf2-test.c: New test case.
	* testsuite/Makefile.in (TS_NETTLE_SOURCES): Add pbkdf2-test.c.
	* testsuite/.test-rules.make (pbkdf2-test): New target.

2012-09-16  Niels Möller  <nisse@lysator.liu.se>

	* testsuite/: Overhaul of testsuite, affecting almost all files.
	+ Use struct tstring for allocated strings, and deallocate before
	exit.
	+ Changed most test functions to take struct tstring as arguments.
	+ Made all test_main return on success.

	* testsuite/testutils.h (struct tstring): New struct type.
	(H2, HL, MEMEQH, SUCCESS): Deleted macros.
	(SHEX, SDATA): New macros.
	(H): Redefined to track storage.

	* testsuite/testutils.c (tstring_alloc): New function.
	(tstring_clear): New function.
	(tstring_data): New function.
	(tstring_hex): New function.
	(tstring_print_hex): New function.
	(decode_hex_length): Made static.
	(decode_hex): Made static. No return value, abort on error.
	(main): Expect test_main to return, and call tstring_clear before
	exit.
	(test_dsa_key): Added missing mpz_clear.
	(test_mac): Deleted unused function.

	* testsuite/rsa2sexp-test.c (test_main): Added missing
	nettle_buffer_clear.

	* testsuite/yarrow-test.c (open_file): Don't leak filename.
	(test_main): fclose input file properly.

	* testsuite/sexp-format-test.c (test_main): Added missing calls to
	nettle_buffer_clear and mpz_clear.

	* testsuite/serpent-test.c (tstring_hex_reverse): New function,
	replacing...
	(decode_hex_reverse): ... deleted function.
	(RHEX): New macro, replacing...
	(RH, RHL): ... deleted macros.

	* testsuite/rsa2sexp-test.c (test_main): Added missing
	nettle_buffer_clear.

	* testsuite/random-prime-test.c (test_main): Added missing
	mpz_clear.

	* realloc.c (nettle_realloc): Only call libc realloc if length >
	0, otherwise call free. Fixes a small memory leak.
	(nettle_xrealloc): Likewise.

	* run-tests (test_program): Don't quote $EMULATOR; allow it to
	expand to program and arguments (e.g., valgrind).

	* tools/pkcs1-conv.c (convert_public_key): Added missing calls to
	dsa_public_key_clear and rsa_public_key_clear.
	(main): Added missing nettle_buffer_clear.

2012-09-10  Niels Möller  <nisse@lysator.liu.se>

	* examples/eratosthenes.c (main): Explicitly deallocate storage
	before exit.

	* examples/io.c (read_file): Explicitly treat an empty file as an
	error. Rearrange loop, check for short fread return value.

	* desdata.c: Don't declare printf, include <stdio.h> instead. Also
	deleted casts of printf return value.

	From Tim Rühsen:
	* examples/nettle-benchmark.c (die): Use PRINTF_STYLE attribute.
	* pgp-encode.c (pgp_put_rsa_sha1_signature): Deleted unused variable.
	* rsa2openpgp.c (rsa_keypair_to_openpgp): Likewise.
	* examples/base16enc.c (main): Deleted useless allocations.

2012-09-07  Niels Möller  <nisse@lysator.liu.se>

	* examples/nettle-benchmark.c (die): Add NORETURN attribute. Patch
	from Tim Rühsen.
	* tools/misc.h (die, werror): Use PRINTF_STYLE and NORETURN macros
	for attributes. Patch from Tim Rühsen.

	* examples/io.h (werror): Use PRINTF_STYLE macro.

2012-08-22  Niels Möller  <nisse@lysator.liu.se>

	From Sam Thursfield <sam.thursfield@codethink.co.uk>:
	* configure.ac: Make documentation optional, to avoid requiring
	TeX. New option --disable-documentation, and Makefile substitution
	IF_DOCUMENTATION.
	* Makefile.in: Use IF_DOCUMENTATION.

2012-07-12  Niels Möller  <nisse@lysator.liu.se>

	* asm.m4 (ALIGN): Use << operator rather than **, with m4 eval.
	The latter is not supported by BSD m4.

2012-07-07  Niels Möller  <nisse@lysator.liu.se>

	Copyright headers: Updated FSF address. Patch from David Woodhouse.

	* examples/Makefile.in (BENCH_LIBS): Added -lm, needed for the
	ldexp function. Reported by Anthony G. Basile.

	* configure.ac: Changed version number to 2.6.

	* Released nettle-2.5.

2012-07-05  Niels Möller  <nisse@lysator.liu.se>

	* x86_64/salsa20-crypt.asm (salsa20_crypt): Write the 64-bit movq
	instructions as "movd", since that makes the osx assembler
	happier. Assembles to the same machine code on gnu/linux.

2012-07-03  Niels Möller  <nisse@lysator.liu.se>

	* aclocal.m4 (LSH_FUNC_ALLOCA): In the config.h boilerplate,
	include malloc.h if it exists, also when compiling with gcc.
	Needed for cross-compiling with --host=i586-mingw32msvc.

	* examples/base16dec.c: Don't #include files using <nettle/...>,
	we don't want to pick up installed versions. On windows, include
	<fcntl.h>, needed for _setmode.
	* examples/base16enc.c: Likewise.
	* examples/base64dec.c: Likewise.
	* examples/base64enc.c: Likewise

	* nettle.texinfo (Cipher functions): Document Salsa20.

2012-06-25  Niels Möller  <nisse@lysator.liu.se>

	* pkcs1.c (_pkcs1_signature_prefix): Renamed function, adding a
	leading underscore. Updated all callers.

	* bignum-next-prime.c (nettle_next_prime): Consistently use the
	type nettle_random_func * (rather then just nettle_random_func)
	when passing the function pointer as argument. Similar change for
	nettle_progress_func. Should have been done for the 2.0 release,
	but a few arguments were overlooked.
	* bignum-random-prime.c (_nettle_generate_pocklington_prime)
	(nettle_random_prime): Likewise.
	* bignum-random.c (nettle_mpz_random_size, nettle_mpz_random):
	Likewise.
	* dsa-keygen.c (dsa_generate_keypair): Likewise.
	* dsa-sha1-sign.c (dsa_sha1_sign_digest, dsa_sha1_sign): Likewise.
	* dsa-sha256-sign.c (dsa_sha256_sign_digest, dsa_sha256_sign):
	Likewise.
	* dsa-sign.c (_dsa_sign): Likewise.
	* pkcs1-encrypt.c (pkcs1_encrypt): Likewise.
	* rsa-blind.c (_rsa_blind): Likewise.
	* rsa-decrypt-tr.c (rsa_decrypt_tr): Likewise.
	* rsa-encrypt.c (rsa_encrypt): Likewise.
	* rsa-keygen.c (rsa_generate_keypair): Likewise.
	* rsa-pkcs1-sign-tr.c (rsa_pkcs1_sign_tr): Likewise.

	* cbc.c (cbc_encrypt, cbc_decrypt): Similarly, use the type
	nettle_crypt_func * rather than just nettle_crypt_func.
	* ctr.c (ctr_crypt): Likewise.
	* gcm.c (gcm_set_key): Likewise.

	* testsuite/des-compat-test.c (test_main): Disable declarations of
	disabled functions and variables, to avoid warnings. No verbose
	output unless verbose flag is set.

2012-06-09  Niels Möller  <nisse@lysator.liu.se>

	* examples/Makefile.in (SOURCES): Added base16dec.c, forgotten
	earlier.

	General pkcs1 signatures, with a "DigestInfo" input. Suggested by
	Nikos Mavrogiannopoulos.
	* Makefile.in (hogweed_SOURCES): Added pkcs1-rsa-digest.c,
	rsa-pkcs1-sign.c, rsa-pkcs1-sign-tr.c, and rsa-pkcs1-verify.c.

	* pkcs1-rsa-digest.c (pkcs1_rsa_digest_encode): New file and
	function.
	* pkcs1.h: Declare it.

	* rsa-pkcs1-verify.c (rsa_pkcs1_verify): New file and function.
	* rsa-pkcs1-sign.c (rsa_pkcs1_sign): New file and function.
	* rsa-pkcs1-sign-tr.c (rsa_pkcs1_sign_tr): New file and function,
	contributed by Nikos Mavrogiannopoulos.
	* rsa.h: Declare new functions.

	* rsa.h (_rsa_blind, _rsa_unblind): Declare functions.
	* rsa-blind.c (_rsa_blind, _rsa_unblind): Functions moved to a
	separate file, renamed and made non-static. Moved from...
	* rsa-decrypt-tr.c: ... here.

2012-06-03  Niels Möller  <nisse@lysator.liu.se>

	* testsuite/pkcs1-test.c (test_main): Include leading zero in
	expected result.

	* pkcs1.c (pkcs1_signature_prefix): Return pointer to where the
	digest should be written. Let the size input be the key size in
	octets, rather then key size - 1.
	* pkcs1-rsa-*.c: Updated for above.
	* rsa-*-sign.c, rsa-*-verify.c: Pass key->size, not key->size - 1.

2012-05-18  Niels Möller  <nisse@lysator.liu.se>

	* pkcs1-encrypt.c (pkcs1_encrypt): New file and function.
	* rsa-encrypt.c (rsa_encrypt): Use pkcs1_encrypt.

2012-05-09  Niels Möller  <nisse@lysator.liu.se>

	* rsa-decrypt-tr.c (rsa_decrypt_tr): Added missing mpz_clear,
	spotted by Nikos Mavrogiannopoulos.

2012-05-07  Niels Möller  <nisse@lysator.liu.se>

	* nettle-types.h (_STDINT_HAVE_INT_FAST32_T): Define here, to
	force nettle-stdint.h to not try to define the int_fast*_t types.
	Avoids compilation problems with gnutls on SunOS-5.8, where the
	definitions here collide with gnulib's.

2012-04-23  Niels Möller  <nisse@lysator.liu.se>

	* nettle-internal.h (NETTLE_MAX_BIGNUM_SIZE): New constant. Based
	on NETTLE_MAX_BIGNUM_BITS, rounded upwards. Replaced all uses of
	NETTLE_MAX_BIGNUM_BITS.

2012-04-19  Niels Möller  <nisse@lysator.liu.se>

	* list-obj-sizes.awk: Use decimal rather than hexadecimal output.
	(hex2int): Use local variables.

2012-04-18  Niels Möller  <nisse@lysator.liu.se>

	* x86_64/salsa20-crypt.asm: New file.

2012-04-17  Niels Möller  <nisse@lysator.liu.se>

	* testsuite/salsa20-test.c (test_salsa20_stream): Check that
	salsa20_crypt doesn't write beyond the given destination area.
	(test_salsa20): Likewise.

	* salsa20-crypt.c: Renamed file, from...
	* salsa20.c: ... old name.

	* x86_64/machine.m4 (WREG): New macro.

	* salsa20.c (salsa20_hash): Deleted function, inlined into
	salsa20_crypt.
	(salsa20_set_key, salsa20_set_iv): Moved, to...
	* salsa20-set-key.c: ...new file.

2012-04-15  Niels Möller  <nisse@lysator.liu.se>

	* testsuite/salsa20-test.c (test_salsa20_stream): New function.
	(test_main): Tests for encrypting more than one block at a time.

2012-04-14  Niels Möller  <nisse@lysator.liu.se>

	* examples/io.c (write_file): Use write_string.

	* examples/Makefile.in (base64enc): New targets. Also
	added missing io.o dependency to several other targets.
	(base64dec, base16enc, base16dec): Likewise.

	* examples/base64enc.c: New file, based on example code
	contributed by Jeronimo Pellegrini.
	* examples/base64dec.c: Likewise.
	* examples/base16enc.c: Likewise.
	* examples/base16dec.c: Likewise.

	* examples/rsa-encrypt.c (process_file): Reorganized fread loop.
	(usage): New function.
	(main): Implemented --help option.

	* examples/rsa-decrypt.c (process_file): Improved error message
	for too short input file.

	* aes-set-decrypt-key.c (gf2_log, gf2_exp): Deleted tables.
	(mult, inv_mix_column): Deleted functions.
	(mtable): New table.
	(MIX_COLUMN): New macro.
	(aes_invert_key): Use MIX_COLUMN and mtable.

	* aesdata.c (compute_mtable): New table, for the inv mix column
	operation in aes_invert_key.

2012-04-13  Niels Möller  <nisse@lysator.liu.se>

	* aes-set-encrypt-key.c (aes_set_encrypt_key): Use LE_READ_UINT32.
	Tabulate the needed "round constants".
	(xtime): Deleted function.

	* aes-internal.h (SUBBYTE): Cast to uint32_t. Use B0, ..., B3
	macros.

2012-04-09  Niels Möller  <nisse@lysator.liu.se>

	Timing resistant RSA decryption, based on RSA blinding code
	contributed by Nikos Mavrogiannopoulos.
	* rsa-decrypt-tr.c (rsa_decrypt_tr): New function.
	(rsa_blind): Helper function.
	(rsa_unblind): Helper function.
	* rsa.h: Declare rsa_decrypt_tr. Some cleanups, no longer include
	nettle-meta.h, more consistent declarations of function pointer
	arguments.
	* testsuite/rsa-encrypt-test.c (test_main): Test rsa_decrypt_tr.
	Check for writes past the end of the message area.

	* Makefile.in (hogweed_SOURCES): Added pkcs1-decrypt.c.
	* rsa-decrypt.c (rsa_decrypt): Use pkcs1_decrypt.
	* pkcs1-decrypt.c (pkcs1_decrypt): New file and function,
	extracted from rsa_decrypt.

2012-04-01  Niels Möller  <nisse@lysator.liu.se>

	* salsa20.c (LE_SWAP32): Typo fix for big-endian case.
	(QROUND): New macro.
	(salsa20_hash): Use it.

2012-03-31  Niels Möller  <nisse@lysator.liu.se>

	* salsa20.c: (salsa20_set_iv): Deleted size argument, only one
	size allowed.
	(U8TO32_LITTLE): Deleted macro. Use LE_READ_UINT32 instead, which
	avoids unaligned reads.
	(salsa20_set_key): Rearranged slightly, to avoid unnecessary
	byte-to-word conversions.

	(LE_SWAP32): Renamed macro from...
	(U32TO32_LITTLE): ... old name.
	(U32TO8_LITTLE): Deleted macro.
	(salsa20_wordtobyte): Renamed function to...
	(salsa20_hash): ... new name. Changed output argument from byte
	array to word array. Use memxor3, which brings a considerable
	performance gain.

	* nettle-internal.c (salsa20_set_key_hack): Updated salsa20_set_iv
	call.
	* testsuite/salsa20-test.c (test_salsa20): Deleted iv_length
	argument, updated all calls.

	* salsa20.h (SALSA20_BLOCK_SIZE): New constant.
	(_SALSA20_INPUT_LENGTH): New constant.
	* salsa20.c: Use these constants.

	* salsa20.c (ROTL32): Deleted macro, use the one from macros.h
	instead, with reversed order of arguments.
	(ROTATE, XOR, PLUS, PLUSONE): Deleted macros, use ROTL32 and
	builtin operators directly.

	Unification of rotation macros.
	* macros.h (ROTL32): New macro, to replace (almost) all other
	rotation macros.

	* aes-set-encrypt-key.c: Include macros.h.
	(aes_set_encrypt_key): Use ROTL32.
	* aes-internal.h (ROTBYTE, ROTRBYTE): Deleted macros.

	* camellia-internal.h (ROL32): Deleted macro.
	(ROTL128): Renamed for consistency, from...
	(ROL128): ... old name.
	* camellia-crypt-internal.c: Updated for renamed rotation macros.
	* camellia-set-encrypt-key.c: Likewise.
	* cast128.c (ROL): Deleted macro.
	(F1, F2, F3): Updated to use ROTL32 (reversed order of arguments).
	Also added proper do { ... } while (0) wrappers.

	* ripemd160-compress.c (ROL32): Deleted macro.
	(R): Updated to use ROTL32 (reversed order of arguments).

	* serpent-internal.h (ROL32): Deleted macro.
	(ROTL64): Renamed (from ROL64) and reorderd arguments, for
	consistency.
	(RSHIFT64): Reordered arguments, for consistency.
	* serpent-decrypt.c: Updated for renamed rotation macros, with
	reversed argument order.
	* serpent-encrypt.c: Likewise.
	* serpent-set-key.c: Likewise.

	* sha1-compress.c (ROTL): Deleted macro, use ROTL32 instead.

	* sha256-compress.c (ROTR): Deleted macro. Replaced by ROTL32,
	with complemented shift count.
	(SHR): Deleted macro, use plain shift operator instead.

	* sha512-compress.c (ROTR): Deleted macro, replaced by...
	(ROTL64): ...new macro, with complemented shift count
	(SHR): Deleted macro, use plain shift operator instead.
	(S0, S1, s0, s1): Updated accordingly.

2012-03-30  Niels Möller  <nisse@lysator.liu.se>

	* nettle-internal.c (nettle_salsa20): Cipher struct for
	benchmarking only. Sets a fix zero IV, and ignores block size.
	* nettle-internal.h (nettle_salsa20): Declare it.

	* examples/nettle-benchmark.c (block_cipher_p): New function.
	(time_cipher): Use block_cipher_p.
	(main): Include salsa20 in benchmark.

	* Makefile.in (soname link): Fixed logic.
	(nettle_SOURCES): Removed nettle-internal.c, so that it's not
	part of the library...
	(internal_SOURCES): ...and put it here.
	* testsuite/Makefile.in (TEST_OBJS): Added ../nettle-internal.o.
	* examples/Makefile.in (BENCH_OBJS): New variable, to simplify the
	nettle-benchmark rule. Also link with ../nettle-internal.o.

2012-03-29  Niels Möller  <nisse@lysator.liu.se>

	Implementation of Salsa20, contributed by Simon Josefsson.
	* salsa20.h: New file.
	* salsa20.c: New file.
	* Makefile.in (nettle_SOURCES): Added salsa20.c
	(HEADERS): Added salsa20.h.
	* testsuite/Makefile.in (TS_NETTLE_SOURCES): Added salsa20-test.c.
	* testsuite/salsa20-test.c: New test case.

	* Makefile.in (soname links): Adding missing space before ].

2012-03-23  Niels Möller  <nisse@lysator.liu.se>

	* arcfour.h (arcfour_stream): Deleted obsolete prototype.

2012-03-05  Niels Möller  <nisse@lysator.liu.se>

	* configure.ac (enable_shared): Build shared libraries by default.

2012-03-04  Niels Möller  <nisse@lysator.liu.se>

	* configure.ac (LIBNETTLE_MINOR): Bumped library version, to 4.4.
	(LIBHOGWEED_MINOR): And to 2.2.

2012-02-27  Niels Möller  <nisse@lysator.liu.se>

	* list-obj-sizes.awk: Recognize elf64 objects.

	* Makefile.in (.texinfo.dvi): Pass -b option to texi2dvi.

	* Makefile.in (TARGETS): Added twofishdata.
	(SOURCES): Added twofishdata.c.
	(twofishdata): New rule.

	* twofish.c (q0, q1): Made const, and reformatted to match the
	twofishdata program.

	* twofishdata.c: Resurrected old file. Used to be called
	generate_q.c, when the twofish code was contributed back in 1999.

	* nettle.texinfo: Documentation for base16 and base64 encoding.
	Text contributed by Jeronimo Pellegrini
	<pellegrini@mpcnet.com.br>, back in April 2006.

2012-02-18  Niels Möller  <nisse@lysator.liu.se>

	* run-tests, getopt.c, getopt1.c, getopt.h: These files were moved
	to the top-level in the conversion to an independent git
	repository. They used to be symlinks to lsh files, from the
	subdirectories which use them.

	* Makefile.in: Build and distribute getopt files. Distribute
	run-tests script.
	* examples/Makefile.in: Adapt to getopt files and the run-tests
	script now located in the parent directory.
	* testsuite/Makefile.in: Likewise.
	* tools/Makefile.in: Likewise.

	* index.html: Converted to xhtml (from lsh repository, change
	dated 2012-02-03). Updated git instructions.

	* nettle.texinfo: Updated charset declaration.
	* misc/plan.html: Likewise.

2012-01-17  Niels Möller  <nisse@lysator.liu.se>

	* testsuite/Makefile.in (DISTFILES): Added setup-env.

	* examples/rsa-decrypt.c (main): Use _setmode rather than setmode,
	suggested by Eli Zaretskii. Affects windows builds only.
	* examples/rsa-encrypt.c: Likewise.

	* Makefile.in ($(LIBNETTLE_FORLINK)): Always create a .lib symlink
	to the library file. Use LN_S.
	($(LIBHOGWEED_FORLINK)): Likewise.

	(install-shared-nettle): Use LN_S.
	(install-shared-hogweed): Likewise.

	* configure.ac: Use AC_PROG_LN_S.
	* config.make.in (LN_S): New substitution.

	* testsuite/setup-env: New file. Wine workaround. Can't get
	../.lib into wine's dll search path, so create additional
	symlinks.
	* testsuite/teardown-env: ...and delete them here. Also delete
	file testtmp.
	* examples/setup-env: Similar links setup here.
	* examples/teardown-env: ... and deleted.

2012-01-07  Niels Möller  <nisse@lysator.liu.se>

	* examples/Makefile.in (check): Add ../.lib to PATH, like in
	testsuite/Makefile. Needed for w*ndows. Reported by Eli Zaretskii.

2011-11-25  Niels Möller  <nisse@lysator.liu.se>

	From Martin Storsjö:
	* x86_64/machine.m4 (W64_ENTRY, W64_EXIT): New macros for
	supporting W64 ABI.
	* x86_64: Updated all assembly files to use them.

	* configure.ac (W64_ABI): New variable, set when compiling for
	W64 ABI (64-bit M$ windows).
	* config.m4.in (W64_ABI): Define, from configure substitution.

2011-11-24  Niels Möller  <nisse@lysator.liu.se>

	From Martin Storsjö:
	* examples/Makefile.in (check): Pass $(EMULATOR) and $(EXEEXT) in
	the environment of run-tests.
	* examples/rsa-encrypt-test: Use $EXEEXT and $EMULATOR.
	* examples/rsa-sign-test: Likewise.
	* examples/rsa-verify-test: Likewise.
	* examples/setup-env: Likewise.

	* testsuite/Makefile.in (check): Pass $(EXEEXT) in the environment of
	run-tests.
	* testsuite/pkcs1-conv-test: Use $EXEEXT and $EMULATOR. Ignore \r
	in rsa-sign output.

	* examples/rsa-decrypt.c (main) [WIN32]: Set stdout/stdin to
	binary mode.
	* examples/rsa-encrypt.c (main): Likewise.

2011-11-24  Niels Möller  <nisse@lysator.liu.se>

	* configure.ac (HAVE_NATIVE_64_BIT): Workaround to get it set to 1
	on w64.

	* serpent-internal.h (ROL64): Use (uint64_t) 1 rather than 1L, for
	M$ w64.
	(RSHIFT64): Likewise. Also added a missing parenthesis.

2011-11-24  Niels Möller  <nisse@lysator.liu.se>

	From Martin Storsjö:
	* testsuite/symbols-test: Use $NM, falling back to nm if undefined.
	* testsuite/Makefile.in (check): Pass $(NM) in the environment of
	run-tests.
	* config.make.in (NM): Set NM.

	* testsuite/sexp-conv-test: Use $EMULATOR when running test
	programs. Also ignore \r for output in the non-canonical output
	formats.
	* testsuite/Makefile.in (check): Pass $(EMULATOR) in the
	environment of run-tests.
	* configure.ac (EMULATOR): New substituted variable. Set to wine
	or wine64 when cross compiling for windows, otherwise empty.
	* config.make.in (EMULATOR): Set from autoconf value.

2011-11-20  Niels Möller  <nisse@lysator.liu.se>

	* x86/camellia-crypt-internal.asm: Take ALIGNOF_UINT64_T into
	account when getting the offset for the subkeys. Differs between
	w32 and other systems. w32 problem identified by Martin Storsjö.

	* config.m4.in: Define ALIGNOF_UINT64_T (from configure).

	* configure.ac: Check alignment of uint64_t, and also use AC_SUBST
	for use in config.m4.in.

2011-11-19  Niels Möller  <nisse@lysator.liu.se>

	Cygwin/mingw32 improvements contributed by Martin Storsjö:
	* Makefile.in (IMPLICIT_TARGETS): New variable for DLL link
	libraries.
	(clean-here): Delete the DLL import libraries.

	* configure.ac: Setup installation of DLL files in $bindir.
	(IF_DLL, LIBNETTLE_FILE_SRC, LIBHOGWEED_FILE_SRC): New
	substitutions.

	* config.make.in (LIBNETTLE_FILE_SRC): Substitute new autoconf
	variable.
	(LIBHOGWEED_FILE_SRC): Likewise.

	* Makefile.in (install-dll-nettle, uninstall-dll-nettle): New
	target for installing the DLL file in $bindir.
	(install-shared-nettle): Conditionally
	depend on install-dll-nettle. Use LIBNETTLE_FILE_SRC.
	(uninstall-shared-nettle): Conditionally depend on
	install-dll-nettle.
	(various hogweed targets): Analogous changes.

	* configure.ac: Unify shared lib setup for cygwin and mingw.

2011-10-31  Niels Möller  <nisse@lysator.liu.se>

	* configure.ac (LIBHOGWEED_LIBS): Typo fix for the darwin case.
	Spotted by Martin Storsjö.

2011-10-25  Niels Möller  <nisse@lysator.liu.se>

	* configure.ac (LIBHOGWEED_LIBS): cygwin fix, added
	libnettle.dll.a. Reported by Volker Zell.

2011-10-18  Niels Möller  <nisse@lysator.liu.se>

	* configure.ac: Improved setup för darwin shared libraries.
	Patch contributed by Ryan Schmidt.

2011-10-03  Niels Möller  <nisse@lysator.liu.se>

	* x86_64/memxor.asm: Implemented sse2-loop. Configured at compile
	time, and currently disabled.

	* testsuite/testutils.h (ASSERT): Write message to stderr.

	* testsuite/memxor-test.c: Use 16-byte alignment for "fully
	aligned" operands.

2011-09-03  Niels Möller  <nisse@lysator.liu.se>

	* x86/camellia-crypt-internal.asm: Use "l"-suffix on instructions
	more consistently. Reportedly, freebsd and netbsd systems with
	clang are more picky about this.

	* configure.ac: Changed version number to 2.5.

	* Released nettle-2.4.

	* configure.ac (LIBNETTLE_MINOR): Bumped library version, to 4.3.

	* gcm-aes.c: Include config.h.
	* tools/nettle-lfib-stream.c: Likewise.

	* ripemd160-compress.c: Added missing include of config.h. Needed
	for correct operation on big-endian systems.

2011-09-02  Niels Möller  <nisse@amfibolit.hack.org>

	* configure.ac: Changed version number to 2.4.

	* Released nettle-2.3.

2011-08-30  Niels Möller  <nisse@lysator.liu.se>

	* testsuite/hmac-test.c: Added tests for hmac-ripemd160.

	* hmac.h: Declare hmac-ripemd160 related functions.

	* Makefile.in (nettle_SOURCES): Added hmac-ripemd160.c.

2011-08-30  Niels Möller  <nisse@amfibolit.hack.org>

	* nettle.texinfo (Hash functions): Document ripemd-160.

	* hmac-ripemd160.c: New file.

	* hmac.h: Declare hmac-ripemd160 functions.

2011-08-29  Niels Möller  <nisse@lysator.liu.se>

	* sha256.c (sha256_update): Updated MD_UPDATE call for new
	conventions.
	(sha256_write_digest): Use MD_PAD rather than MD_FINAL, and insert
	the length manually.
	* sha512.c: Analogous changes.

	* sha1.c (COMPRESS): New macro.
	(sha1_update): Updated MD_UPDATE call for new conventions.
	(sha1_digest): Use MD_PAD rather than MD_FINAL, and insert the
	length manually.

	* ripemd160.c (ripemd160_init): Use memcpy for initializing the
	state vector.
	(COMPRESS): New macro.
	(ripemd160_update): Use MD_UPDATE.
	(ripemd160_digest): Inline ripemd160_final processing. Use MD_PAD
	and _nettle_write_le32.
	(ripemd160_final): Deleted function.

	* ripemd160.h (struct ripemd160_ctx): Use a 64-bit block count.
	Renamed digest to state.

	* md5.c (md5_init): Use memcpy for initializing the state vector.
	(COMPRESS): New macro, wrapping _nettle_md5_compress.
	(md5_update): Use MD_UPDATE.
	(md5_digest): Inline md5_final processing. Use MD_PAD and
	_nettle_write_le32.
	(md5_final): Deleted.

	* md5.h (struct md5_ctx): Renamed some fields, for consistency.

	* md4.h (struct md4_ctx): Renamed some fields, for consistency.

	* md4.c (md4_init): Use memcpy for initializing the state vector.
	(md4_update): Use MD_UPDATE.
	(md4_digest): Inline md4_final processing, using MD_PAD. Use
	_nettle_write_le32.
	(md4_block): Renamed, to...
	(md4_compress): ... new name. Take ctx pinter as argument.
	(md4_final): Deleted function.

	* md2.c (md2_update): Use MD_UPDATE.

	* macros.h (MD_UPDATE): Added incr argument. Invoke compression
	function with ctx pointer as argument, rather than ctx->state.
	(MD_FINAL): Just pad, don't store length field. Renamed to MD_PAD.
	(MD_PAD): Analogous change of compression invocations.

	* sha512.c: (COMPRESS): New macro wrapping _nettle_sha512_compress.
	(sha512_update): Use MD_UPDATE.
	(sha512_final): Deleted function.
	(sha512_write_digest): Use MD_FINAL.

	* sha256.c (COMPRESS): New macro wrapping _nettle_sha256_compress.
	(SHA256_INCR): Deleted macro.
	(sha256_update): Use MD_UPDATE.
	(sha256_final): Deleted function.
	(sha256_write_digest): New function, replacing sha256_final, and
	using MD_FINAL.
	(sha256_digest): Use sha256_write_digest.
	(sha224_digest): Likewise.

	* tools/nettle-hash.c (list_algorithms): Fixed typo in header.

	* sha1.c (SHA1_DATA_LENGTH): Deleted unused macro.
	(sha1_init): Use memcpy to initialize the state vector.
	(SHA1_INCR): Deleted macro.
	(sha1_update): Use MD_UPDATE macro, to reduce code duplication.
	(sha1_digest): Use MD_FINAL macro.
	(sha1_final): Deleted function.

	* sha.h (struct sha1_ctx): Renamed attribute digest to state.

	* macros.h (MD_UPDATE): New macro.
	(MD_FINAL): New macro.

2011-08-28  Niels Möller  <nisse@lysator.liu.se>

	* ripemd160.c (ripemd160_final): Use LE_WRITE_UINT32. Deleted byte
	swapping at the end, leaving it to ripemd160_digest.
	(ripemd160_digest): Use _nettle_write_le32.

	* Makefile.in (nettle_SOURCES): Added write-le32.c.

	* md5.c (md5_digest): Use _nettle_write_le32.

	* write-le32.c (_nettle_write_le32): New file and function.

	* ripemd160-compress.c (ROL32): Renamed macro (was "rol"). Deleted
	x86 version using inline assembly; at least gcc-4.4.5 recognizes
	shift-and-or expressions which are in fact rotations.
	(_nettle_ripemd160_compress): Use LE_READ_UINT32.

	* configure.ac (LIBNETTLE_MINOR): Bumped library version, to 4.2.

	* testsuite/meta-hash-test.c: Updated for the addition of
	ripemd-160.

	* testsuite/.test-rules.make: Added rule for ripemd160-test.

	* examples/nettle-benchmark.c (main): Benchmark ripemd-160.

2011-08-28  Niels Möller  <nisse@lysator.liu.se>

	RIPEMD-160 hash function. Ported from libgcrypt by Andres Mejia.
	* testsuite/ripemd160-test.c: New file.
	* ripemd160.h: New file.
	* nettle-meta.h: Declare nettle_ripemd160.
	* ripemd160.c: New file, ported from libgcrypt.
	* ripemd160-compress.c: Likewise.
	* ripemd160-meta.c: New file.
	* testsuite/Makefile.in (TS_NETTLE_SOURCES): Added
	ripemd160-test.c.
	* nettle-meta-hashes.c (nettle_hashes): Added nettle_ripemd160.
	* Makefile.in (nettle_SOURCES): Added ripemd160.c,
	ripemd160-compress.c, and ripemd160-meta.c.
	(HEADERS): Added ripemd160.h.

2011-08-10  Niels Möller  <nisse@amfibolit.hack.org>

	* nettle.texinfo: Fixed mis-placed const in various prototypes.
	Spotted by Tatsuhiro Tsujikawa.

2011-07-24  Niels Möller  <nisse@lysator.liu.se>

	* Makefile.in (PKGCONFIG_FILES, pkgconfigdir): New variables.
	(DISTFILES): Added nettle.pc.in and hogweed.pc.in.
	(nettle.pc, hogweed.pc): New targets (invoking config.status).
	(install-pkgconfig, uninstall-pkgconfig): New targets.
	(install-here): Depend on install-pkgconfig.
	(uninstall-here): Depend on uninstall-pkgconfig.
	(distclean-here): Delete nettle.pc and hogweed.pc.

2011-07-20  Niels Möller  <nisse@lysator.liu.se>

	* configure.ac: Generate nettle.pc and hogweed.pc.

	* nettle.pc.in, hogweed.pc.in: New files.

2011-07-17  Niels Möller  <nisse@lysator.liu.se>

	* nettle-internal.h: Added missing extern declarations.

2011-07-11  Niels Möller  <nisse@lysator.liu.se>

	* configure.ac: Changed version number to 2.3.

	* Released nettle-2.2.

	* Makefile.in (DISTFILES): Distribute COPYING.LIB, not COPYING,

2011-07-07  Niels Möller  <nisse@lysator.liu.se>

	* tools/misc.h (werror): Removed incorrect noreturn attribute from
	declaration.

	* examples/io.c (read_file): Bug fix, in dependence of initial
	size on max_size.

2011-07-01  Niels Möller  <nisse@lysator.liu.se>

	* cbc.c	(CBC_BUFFER_LIMIT): Reduced to 512 bytes.
	(cbc_decrypt): For in-place operation, use overlapping memxor3 and
	eliminate a memcpy.

	* ctr.c (ctr_crypt): Reorganized to call the encryption function
	with several blocks at a time. Handle the case of a single block
	specially.

	* x86_64/memxor.asm: Added ALIGN for shifting loop. Deleted
	obsolete ifelse.

2011-06-30  Niels Möller  <nisse@lysator.liu.se>

	* configure.ac: Link in serpent-decrypt.asm, if found.

	* x86_64/serpent-decrypt.asm: Added an SSE2 loop, doing four
	blocks at a time in parallel.

	* x86_64/serpent-encrypt.asm: Include serpent.m4. Deleted a
	redundant label.

	* x86_64/serpent.m4: New file, with serpent-related macros.

2011-06-29  Niels Möller  <nisse@lysator.liu.se>

	* x86_64/serpent-decrypt.asm: Wrote main (32-bit) loop.
	(SBOX0I, SBOX1I, SBOX7I): Fixed bugs.

	* nettle.texinfo (Copyright): Updated for license change to
	LGPLv2+. Updated copyright info on serpent.

	* NEWS: Updated information for nettle-2.2.

	* x86_64/serpent-decrypt.asm: New file.

	* x86_64/serpent-encrypt.asm: Fixed .file pseudo op.

	* testsuite/testutils.c (test_cipher_ctr): Display more info on
	failure.

	* examples/nettle-benchmark.c (bench_ctr): New function.
	(time_cipher): Also benchmark CTR mode.

	* configure.ac (LIBNETTLE_MINOR): Updated library version number
	to 4.1.
	(LIBHOGWEED_MINOR): And to 2.1.

2011-06-22  Niels Möller  <nisse@lysator.liu.se>

	* configure.ac: Use pwd -P when examining lib directories.
	Link in serpent-encrypt.asm, if found.

2011-06-21  Niels Möller  <nisse@lysator.liu.se>

	* serpent-decrypt.c (SBOX3_INVERSE): Eliminated temporaries.
	(SBOX4_INVERSE): Likewise.
	(SBOX5_INVERSE): Likewise.
	(SBOX6_INVERSE): Likewise.
	(SBOX7_INVERSE): Likewise.
	(All SBOX_INVERSE-macros): Deleted type argument, and updated users.

2011-06-20  Niels Möller  <nisse@lysator.liu.se>

	* serpent-decrypt.c: Renamed arguments in sbox macros.
	(SBOX0_INVERSE): Eliminated temporaries.
	(SBOX1_INVERSE): Likewise.
	(SBOX2_INVERSE): Likewise.

	* x86_64/serpent-encrypt.asm: Added an SSE2 loop, doing four
	blocks at a time in parallel.

	* testsuite/serpent-test.c (test_main): Added some more multiple
	block tests.

2011-06-15  Niels Möller  <nisse@lysator.liu.se>

	* configure.ac (libdir): On 64-bit Linux, we used to assume that
	libraries are installed according to the FHS. Since at least
	Fedora and Gentoo follow the FHS convention, while at least Debian
	doesn't, we have to try to figure out which convention is used.

2011-06-14  Niels Möller  <nisse@lysator.liu.se>

	* x86_64/serpent-encrypt.asm: Slight simplification of loop logic.

	* x86_64/serpent-encrypt.asm: New file.

2011-06-12  Niels Möller  <nisse@lysator.liu.se>

	* testsuite/serpent-test.c (test_main): Added tests with multiple
	blocks at a time.

	* serpent-encrypt.c (SBOX6): Renamed arguments. Eliminated
	temporaries.
	(SBOX7): Likewise.
	(All SBOX-macros): Deleted type argument, and updated users.

	* configure.ac: Display summary at the end of configure..
	(asm_path): Set only if enable_assember is yes.

2011-06-10  Niels Möller  <nisse@lysator.liu.se>

	* serpent-encrypt.c (SBOX5): Renamed arguments. Eliminated
	temporaries.

2011-06-09  Niels Möller  <nisse@lysator.liu.se>

	* serpent-encrypt.c (SBOX4): Renamed arguments. Eliminated
	temporaries.

	* configure.ac (LIBNETTLE_LINK, LIBHOGWEED_LINK): Cygwin fix, from
	Vincent Torri.

2011-06-08  Niels Möller  <nisse@lysator.liu.se>

	* examples/eratosthenes.c (find_first_one): Fixed c99-style
	declaration. Reported by Sebastian Reitenbach.
	(find_first_one): Declare the lookup table as static const, and
	use unsigned char rather than unsigned..

2011-06-07  Niels Möller  <nisse@lysator.liu.se>

	* serpent-encrypt.c (SBOX0): Renamed arguments. Eliminated
	temporaries.
	(SBOX1): Likewise.
	(SBOX2): Likewise.
	(SBOX3): Likewise.

2011-06-06  Niels Möller  <nisse@lysator.liu.se>

	* Makefile.in (DISTFILES): Added serpent-internal.h.
	(nettle_SOURCES): Replaced serpent.c by serpent-set-key.c,
	serpent-encrypt.c, and serpent-decrypt.c.

	* serpent.c: Replaced by several new files.
	* serpent-set-key.c: New file.
	* serpent-encrypt.c: New file.
	* serpent-decrypt.c: New file.
	* serpent-internal.h: New file.

	* serpent.c [HAVE_NATIVE_64_BIT]: Process two blocks at a time in
	parallel. Measured speedup of 10%--25% (higher for encryption) on
	x86_64.

2011-06-01  Niels Möller  <nisse@lysator.liu.se>

	* serpent.c (ROUNDS): Deleted macro.
	(serpent_block_t): Deleted array typedef.
	(KEYXOR): New macro, replacing BLOCK_XOR.
	(BLOCK_COPY, SBOX, SBOX_INVERSE): Deleted macros.
	(LINEAR_TRANSFORMATION): Use four separate arguments.
	(LINEAR_TRANSFORMATION_INVERSE): Likewise.
	(ROUND): Take separate arguments for all input and output words.
	(ROUND_INVERSE): Likewise.
	(ROUND_LAST, ROUND_FIRST_INVERSE): Deleted macros.
	(serpent_set_key): Moved loop termination test.
	(serpent_encrypt): Rewrote with unrolling of just eight rounds,
	and without serpent_block_t.
	(serpent_decrypt): Likewise.

	* serpent.c: Added do { ... } while (0) around block macros.
	(serpent_key_t): Deleted array typedef.
	(ROL32, ROR32): Renamed macros, were rol and ror.
	(KS_RECURRENCE, KS): New macros.
	(serpent_key_pad): Renamed, from...
	(serpent_key_prepare): ...old name.
	(serpent_subkeys_generate): Deleted function.
	(serpent_set_key): Rewrote the generation of subkeys. Reduced both
	temporary storage and code size (less unrolling)

2011-05-31  Niels Möller  <nisse@lysator.liu.se>

	* testsuite/serpent-test.c (test_main): Enabled test with short,
	40-bit, key.

	* serpent.c (byte_swap_32): Deleted macro.
	(serpent_key_prepare): Use LE_READ_UINT32. Don't require aligned
	input, and support arbitrary key sizes.

2011-05-30  Simon Josefsson  <simon@josefsson.org>

	* serpent.c: Rewrite, based on libgcrypt code.  License changed
	from GPL to LGPL.
	* serpent_sboxes.h: Removed.
	* Makefile.in: Drop serpent_sboxes.h.

2011-05-31  Niels Möller  <nisse@lysator.liu.se>

	* testsuite/serpent-test.c (test_main): Added some tests for
	padding of keys of length which is not a multiple of four bytes.

2011-05-30  Simon Josefsson  <simon@josefsson.org>

	* testsuite/serpent-test.c (test_main): Add test vectors from
	libgcrypt.

2011-05-21  Niels Möller  <nisse@lysator.liu.se>

	* dsa-keygen.c (dsa_generate_keypair): Avoid double init of mpz
	variable. Spotted by Nikos Mavrogiannopoulos.

2011-05-06  Niels Möller  <nisse@lysator.liu.se>

	* configure.ac: Fix link flags for shared libraries on Solaris,
	which needs -h to set the soname. Patch contributed by Dagobert
	Michelsen.

2011-05-06  Niels Möller  <nisse@lysator.liu.se>

	* configure.ac: New configure option --enable-gcov.

	* arcfour.h (arcfour_stream): Deleted obsolete define.

2011-04-27  Niels Möller  <nisse@lysator.liu.se>

	* tools/nettle-hash.c (find_algorithm): Require exact match.

2011-04-15  Niels Möller  <nisse@lysator.liu.se>

	Reverted broken byte-order change from 2001-06-17:
	* serpent.c (serpent_set_key): Use correct byteorder.
	(serpent_encrypt): Likewise.
	(serpent_decrypt): Likewise.

	* testsuite/serpent-test.c (decode_hex_reverse): New function.
	(RH, RHL): New macros.
	(test_main): Byte reverse inputs and outputs for the testvectors
	taken from the serpent submission package. Enable test vectors
	from http://www.cs.technion.ac.il/~biham/Reports/Serpent/.

2011-03-23  Niels Möller  <nisse@lysator.liu.se>

	* tools/sexp-conv.c (xalloc): Deleted function, now it's in misc.c
	instead.

	* configure.ac: Use LSH_FUNC_STRERROR.

	* tools/Makefile.in (TARGETS): Added nettle-hash, and related
	build rules.
	(SOURCES): Added nettle-hash.c.

	* tools/misc.c (xalloc): New function.

	* tools/pkcs1-conv.c (main): Made the OPT_* constants local, and
	fixed numerical values to start with non-ASCII 0x300.

	* tools/nettle-hash.c: New file.

2011-03-23  Niels Möller  <nisse@lysator.liu.se>

	Contributed by Daniel Kahn Gillmor:
	* testsuite/Makefile.in (TS_NETTLE_SOURCES): Added
	meta-hash-test.c, meta-cipher-test.c, and meta-armor-test.c.

	* testsuite/meta-hash-test.c: New file.
	* testsuite/meta-cipher-test.c: New file.
	* testsuite/meta-armor-test.c: New file.

	* nettle.texinfo: Document nettle_hashes and nettle_ciphers.

	* nettle-meta.h: Declare algorithm lists nettle_ciphers,
	nettle_hashes, nettle_armors.

	* Makefile.in (nettle_SOURCES): Added nettle-meta-hashes.c,
	nettle-meta-ciphers.c, and nettle-meta-armors.c.

	* nettle-meta-armors.c: New file.
	* nettle-meta-ciphers.c: New file.
	* nettle-meta-hashes.c: New file.

2011-02-18  Niels Möller  <nisse@lysator.liu.se>

	* arcfour.c (arcfour_stream): Deleted function. It's not very
	useful, and neither documented nor tested.

2011-02-16  Niels Möller  <nisse@lysator.liu.se>

	* cbc.h (CBC_ENCRYPT): Avoid using NULL; we don't ensure that it
	is defined.
	(CBC_DECRYPT): Likewise.

	* gcm-aes.c (gcm_aes_set_iv): Use GCM_SET_IV.
	(gcm_aes_set_key): Deleted cast.
	(gcm_aes_encrypt): Likewise.
	(gcm_aes_decrypt): Likewise.
	(gcm_aes_digest): Likewise.
	(gcm_aes_update): One less argument to GCM_UPDATE.

	* gcm.h (GCM_SET_KEY): Added cast to nettle_crypt_func *. Help
	compiler type checking despite this cast.
	(GCM_ENCRYPT): Likewise.
	(GCM_DECRYPT): Likewise.
	(GCM_DIGEST): Likewise.
	(GCM_SET_IV): New macro, for completeness.
	(GCM_UPDATE): Deleted unused argument encrypt.

2011-02-14  Niels Möller  <nisse@lysator.liu.se>

	* nettle.texinfo: Split node on cipher modes, and started on
	the GCM documentation.

	* testsuite/gcm-test.c (test_gcm_aes): Deleted function, replaced
	by test_aead.
	(test_main): Use test_aead.

	* testsuite/testutils.c (test_aead): New function, replacing
	test_gcm_aes and before that test_cipher_gcm.

	* nettle-internal.c (nettle_gcm_aes128): New const struct.
	(nettle_gcm_aes192): Likewise.
	(nettle_gcm_aes256): Likewise.

	* nettle-internal.h (struct nettle_aead): Tentative interface for
	authenticated encryption with associated data.

	* examples/nettle-benchmark.c (time_gcm): Renamed. Updated for
	gcm_aes_auth to gcm_aes_update renaming. Benchmark both encryption
	and hashing.
	(time_gmac): ...old name.

	* nettle-internal.c (des_set_key_hack): Don't touch the bits
	parity, since thay are now ignored.
	(des3_set_key_hack): Likewise.

	* cast128-meta.c (nettle_cast128): Don't pass keysize.
	* nettle-meta.h (_NETTLE_CIPHER_FIX): Deleted keysize parameter
	derived from the appropriate constant instead.

	* testsuite/gcm-test.c (test_gcm_aes): Updated for gcm_aes_auth to
	gcm_aes_update renaming.

2011-02-13  Niels Möller  <nisse@lysator.liu.se>

	* gcm.h (GCM_UPDATE): Renamed, from...
	(GCM_AUTH): ...old name.

	* gcm-aes.c (gcm_aes_update): Renamed, from...
	(gcm_aes_auth): ...old name.

	* gcm.c (gcm_update): Renamed, and fixed an assert. From...
	(gcm_auth): ...old name.

	* gcm.h (GCM_TABLE_BITS): Increase table size to 8 bits,
	corresponding to 4 KByte of key-dependent tables.

2011-02-10  Niels Möller  <nisse@lysator.liu.se>

	* x86_64/memxor.asm: New file. Improves performance by 22% for the
	unaligned01 case and 35% for the unaligned12 case, benchmarked on
	Intel SU1400.

	* examples/nettle-benchmark.c (cgt_works_p): New function.
	(cgt_time_start): Likewise.
	(cgt_time_end): Likewise.
	(clock_time_start): Likewise.
	(clock_time_end): Likewise.
	(time_function): Read clock via function pointers time_start and
	time_end, so we can select method at runtime.
	(xalloc): Use die function.
	(main): Choose timing function. If available, try clock_gettime,
	and fall back to clock if it doesn't exist.

	* examples/nettle-benchmark.c (die): New function.
	(TIME_END, TIME_START): Check return value from clock_gettime.

	* gcm.h (union gcm_block): Use correct length for w array.

	* testsuite/gcm-test.c (test_main): Added the rest of the
	testcases from the spec.

2011-02-09  Niels Möller  <nisse@lysator.liu.se>

	* testsuite/gcm-test.c (test_main): Enabled testcases 5 and 6,
	with different IV lengths.

	* gcm-aes.c (gcm_aes_set_iv): Updated for gcm_set_iv change.

	* gcm.c (gcm_hash_sizes): New function.
	(gcm_set_iv): Added support for IVs of arbitrary size. Needed
	another argument, for the hash subkey.
	(gcm_digest): Use gcm_hash_sizes.

	* examples/nettle-benchmark.c (time_gmac): Use gcm_aes interface.

	* testsuite/gcm-test.c (test_gcm_aes): New function, replacing
	test_cipher_gcm and using the new gcm_aes interface.
	(test_main): Updated to use test_gcm_aes.
	* testsuite/testutils.c (test_cipher_gcm): Deleted function.

	* Makefile.in (nettle_SOURCES): Added gcm-aes.c.

	* gcm.c (gcm_set_key): Replaced context argument by a struct
	gcm_key *.
	(gcm_hash): Replaced context argument by a struct gcm_key * and a
	pointer to the hashing state block.
	(gcm_auth): Added struct gcm_key * argument.
	(gcm_encrypt): Likewise.
	(gcm_decrypt): Likewise.
	(gcm_digest): Likewise.

	* gcm-aes.c: New file.
	(gcm_aes_set_key): New function.
	(gcm_aes_set_iv): Likewise.
	(gcm_aes_auth): Likewise.
	(gcm_aes_encrypt): Likewise.
	(gcm_aes_decrypt): Likewise.
	(gcm_aes_digest): Likewise.

	* gcm.h (struct gcm_key): Moved the key-dependent and
	message-independent state to its own struct.
	(struct gcm_ctx): ... and removed it here.
	(GCM_CTX): New macro.
	(GCM_SET_KEY): Likewise.
	(GCM_AUTH): Likewise.
	(GCM_ENCRYPT): Likewise.
	(GCM_DECRYPT): Likewise.
	(GCM_DIGEST): Likewise.
	(struct gcm_aes_ctx): New struct.

2011-02-08  Niels Möller  <nisse@lysator.liu.se>

	* gcm.h (struct gcm_ctx): The hash key is now always an array,
	named h, with array size depending on GCM_TABLE_BITS.
	* gcm.c (gcm_gf_shift): Added a separate result argument.
	(gcm_gf_mul): Compile bitwise version only when GCM_TABLE_BITS ==
	0. Simplified interface with just two arguments pointing to
	complete blocks.
	(gcm_gf_shift_4, gcm_gf_shift_8): Renamed table-based functions, from...
	(gcm_gf_shift_chunk): ... old name.
	(gcm_gf_mul): Renamed both table-based versions and made the
	argument types compatible with the bitwise gcm_gf_mul.
	(gcm_gf_mul_chunk): ... the old name.
	(gcm_set_key): Initialize the table using adds and shifts only.
	When GCM_TABLE_BITS > 0, this eliminates the only use of the
	bitwise multiplication.
	(gcm_hash): Simplified, now that we have the same interface for
	gcm_gf_mul, regardless of table size.

	* gcm.c	(GHASH_POLYNOMIAL): Use unsigned long for this constant.
	(gcm_gf_shift_chunk): Fixed bugs for the big endian 64-bit case,
	e.g., sparc64. For both 4-bit and 8-bit tables.

	* gcm.c: Use the new union gcm_block for all gf operations.

	* gcm.h (union gcm_block): New union, used to enforce alignment.

2011-02-07  Niels Möller  <nisse@lysator.liu.se>

	* gcm.c (gcm_gf_shift_chunk) : Bug fix for little-endian 8-bit
	tables.

	* gcm.c (gcm_gf_mul_chunk): Special case first and last iteration.
	(gcm_gf_add): New function, a special case of memxor. Use it for
	all memxor calls with word-aligned 16 byte blocks. Improves
	performance to 152 cycles/byte with no tables, 28 cycles per byte
	with 4-bit tables and 10.5 cycles per byte with 8-bit tables.

	Introduced 8-bit tables. If enabled, gives gmac performance of 19
	cycles per byte (still on intel x86_64).
	* gcm.c (gcm_gf_shift_chunk): New implementation for 8-bit tables.
	(gcm_gf_mul_chunk): Likewise.
	(gcm_set_key): Generate 8-bit tables.

	* Makefile.in (SOURCES): Added gcmdata.c.

	* gcm.h (GCM_TABLE_BITS): Set to 4.

2011-02-06  Niels Möller  <nisse@lysator.liu.se>

	* Makefile.in (TARGETS): Added gcmdata.
	(gcmdata): New rule.

	Introduced 4-bit tables. Gives gmac performance of 45 cycles per
	byte (still on intel x86_64).
	* gcm.c (gcm_gf_shift): Renamed. Tweaked little-endian masks.
	(gcm_rightshift): ... old name.
	(gcm_gf_mul): New argument for the output. Added length argument
	for one of the inputs (implicitly padding with zeros).
	(shift_table): New table (in 4-bit and 8-bit versions), generated
	by gcmdata.
	(gcm_gf_shift_chunk): New function shifting 4 bits at
	a time.
	(gcm_gf_mul_chunk): New function processing 4 bits at a time.
	(gcm_set_key): Generation of 4-bit key table.
	(gcm_hash): Use tables, when available.

	* gcmdata.c (main): New file.

	* gcm.c (gcm_rightshift): Moved the reduction of the shifted out
	bit here.
	(gcm_gf_mul): Updated for gcm_rightshift change. Improves gmac
	performance to 181 cycles/byte.

	* gcm.c (gcm_gf_mul): Rewrote. Still uses the bitwise algorithm from the
	specification, but with separate byte and bit loops. Improves gmac
	performance a bit further, to 227 cycles/byte.

	* gcm.c (gcm_rightshift): Complete rewrite, to use word rather
	than byte operations. Improves gmac performance from 830 cycles /
	byte to (still poor) 268 cycles per byte on intel x86_64.

2011-02-05  Niels Möller  <nisse@lysator.liu.se>

	* examples/nettle-benchmark.c (time_gmac): New function.
	(main): Call time_gmac.

	* testsuite/Makefile.in (TS_NETTLE_SOURCES): Added gcm-test.c.

	* testsuite/testutils.c (test_cipher_gcm): New function,
	contributed by Nikos Mavrogiannopoulos.

	* testsuite/gcm-test.c: New file, contributed by Nikos
	Mavrogiannopoulos.

	* Makefile.in (nettle_SOURCES): Added gcm.c.
	(HEADERS): Added gcm.h.

	* gcm.c: New file, contributed by Nikos Mavrogiannopoulos.
	* gcm.h: New file, contributed by Nikos Mavrogiannopoulos.

	* macros.h (INCREMENT): New macro, moved from ctr.c. Deleted third
	argument.
	* ctr.c: Use INCREMENT macro from macros.h, deleted local version.

2011-01-07  Niels Möller  <nisse@lysator.liu.se>

	* testsuite/Makefile.in (check): Add ../.lib to PATH, since that's
	where w*ndows looks for dlls.

	* testsuite/testutils.c (test_cipher_stream): More debug output on
	failure.

2010-12-14  Niels Möller  <nisse@lysator.liu.se>

	* nettle-types.h: Deleted some unnecessary parenthesis from
	function typedefs.
	(nettle_realloc_func): Moved typedef here...
	* realloc.h: ...from here.

	* buffer.c (nettle_buffer_init_realloc): Use an explicit pointer
	for realloc argument.

2010-12-07  Niels Möller  <nisse@lysator.liu.se>

	* nettle.texinfo (Copyright): Updated info on blowfish.

2010-11-26  Niels Möller  <nisse@lysator.liu.se>

	Reapplied optimizations (150% speedup on x86_32) and other fixes,
	relicensing them as LGPL.
	* blowfish.c (do_encrypt): Renamed, to...
	(encrypt): ...new name.
	(F): Added context argument. Shift input explicitly, instead of
	reading individual bytes via memory.
	(R): Added context argument.
	(encrypt): Deleted a bunch of local variables. Using the context
	pointer for everything should consume less registers.
	(decrypt): Likewise.
	(initial_ctx): Arrange constants into a struct, to simplify key
	setup.
	(blowfish_set_key): Some simplification.

2010-11-26  Simon Josefsson  <simon@josefsson.org>

	* blowfish.c: New version ported from libgcrypt. License changed
	from GPL to LGPL.

2010-11-25  Niels Möller  <nisse@lysator.liu.se>

	* Makefile.in (install-shared-nettle): Use INSTALL_DATA, which
	clears the execute permission bits.
	(install-shared-hogweed): Likewise.

2010-11-16  Niels Möller  <nisse@lysator.liu.se>

	* configure.ac: Updated gmp url.

2010-11-01  Niels Möller  <nisse@lysator.liu.se>

	* tools/misc.c (werror): Don't call exit (copy&paste-error).

2010-10-26  Niels Möller  <nisse@lysator.liu.se>

	* examples/rsa-encrypt.c (main): No extra message for bad options.

	* examples/rsa-keygen.c (main): Added long options. Deleted -?,
	and fixed handling of bad options.

	* examples/next-prime.c (main): Deleted -?, and fixed handling of
	bad options.
	* examples/random-prime.c (main): Likewise.

2010-10-22  Niels Möller  <nisse@lysator.liu.se>

	* examples/nettle-benchmark.c (main): Added long options. Deleted -?,
	and fixed handling of bad options.

	* examples/eratosthenes.c (main): Added long options. Deleted -?,
	and fixed handling of bad options. Renamed -s to -q (long option
	--quiet).

	* tools/pkcs1-conv.c (main): Deleted short alias -? for --help,
	and fixed handling of bad options.
	* tools/sexp-conv.c (parse_options): Likewise.

2010-10-06  Niels Möller  <nisse@lysator.liu.se>

	* memxor.c (memxor3): Optimized.
	(memxor3_common_alignment): New function.
	(memxor3_different_alignment_b): New function.
	(memxor3_different_alignment_ab): New function.
	(memxor3_different_alignment_all): New function.

	* examples/nettle-benchmark.c (time_function): Reorganized, to
	reduce overhead.
	(time_memxor): Also benchmark memxor3.

	* x86_64/memxor.asm: New file.

	* examples/nettle-benchmark.c (overhead): New global variable.
	(time_function): Compensate for call overhead.
	(bench_nothing, time_overhead): New functions.
	(time_memxor): Tweaked src size, making it an integral number of
	words.
	(main): Call time_overhead.

2010-10-01  Niels Möller  <nisse@lysator.liu.se>

	* x86_64/camellia-crypt-internal.asm (ROUND): Reordered sbox
	lookups.

	* testsuite/memxor-test.c: Also test memxor3.

2010-09-30  Niels Möller  <nisse@lysator.liu.se>

	* configure.ac: Link in memxor.asm, if found.

	* testsuite/testutils.c (test_cipher_cbc): Print more info when
	failing.

	* testsuite/memxor-test.c (test_xor): Added verbose printout.

	* examples/nettle-benchmark.c (time_memxor): Count size of
	unsigned long as "block size" for memxor.

2010-09-24  Niels Möller  <nisse@lysator.liu.se>

	* testsuite/.test-rules.make: Added rule for memxor-test.
	* testsuite/Makefile.in (TS_NETTLE_SOURCES): Added memxor-test.c
	* testsuite/memxor-test.c: New file.

	* memxor.c (memxor_common_alignment): New function.
	(memxor_different_alignment): New function.
	(memxor): Optimized to do word-operations rather than byte
	operations.

	* configure.ac (HAVE_NATIVE_64_BIT): New config.h define.

	Partial revert of 2010-09-20 changes.
	* camellia-set-encrypt-key.c (camellia_set_encrypt_key):
	Reintroduce CAMELLIA_F_HALF_INV, for 32-bit machines.
	* camellia-crypt-internal.c (CAMELLIA_ROUNDSM): Two variants,
	differing in where addition of the key is done.
	* x86/camellia-crypt-internal.asm: Moved addition of key.

2010-09-22  Niels Möller  <nisse@lysator.liu.se>

	* examples/nettle-benchmark.c (BENCH_INTERVAL): Changed unit to
	seconds.
	(time_function): Use clock_gettime with CLOCK_PROCESS_CPUTIME_ID,
	if available. This gives better accuracy, at least on recent
	linux.
	(BENCH_INTERVAL): Reduced to 0.1 s.
	(struct bench_memxor_info): New struct.
	(bench_memxor): New function.
	(time_memxor): New function.
	(main): Use time_memxor. Added optional argument used to limit the
	algorithms being benchmarked.
	(GET_CYCLE_COUNTER): Define also for x86_64.
	(time_memxor): Improved display.

	* examples/Makefile.in (nettle-benchmark): Link using
	$(BENCH_LIBS) rather than $(LIBS).

	* configure.ac: Check for clock_gettime, and add -lrt to
	BENCH_LIBS if needed.

2010-09-20  Niels Möller  <nisse@lysator.liu.se>

	* configure.ac: Less quoting when invoking $CC, to allow CC="gcc
	-m32".

	* x86/camellia-crypt-internal.asm (ROUND): Adapted to new key
	convention, moving key xor to the end.

	* camellia-set-encrypt-key.c (CAMELLIA_F_HALF_INV): Deleted macro.
	(camellia_set_encrypt_key): Deleted the CAMELLIA_F_HALF_INV
	operations intended for moving the key xor into the middle of the
	round.

	* camellia-crypt-internal.c (CAMELLIA_ROUNDSM): Moved addition of
	key to the end, to use a 64-bit xor operation.

	* x86_64/camellia-crypt-internal.asm: New file.

	* x86_64/machine.m4 (LREG, HREG, XREG): New macros.

2010-09-17  Niels Möller  <nisse@lysator.liu.se>

	* configure.ac: Support shared libraries (dlls) with mingw32.
	Contributed by David Hoyt.

2010-07-25  Niels Möller  <nisse@lysator.liu.se>

	* configure.ac: Changed version number to nettle-2.2.

	* Released nettle-2.1.

	* configure.ac: Use camellia-crypt-internal.asm, if available.
	Bumped soname to libnettle.so.4, and reset LIBNETTLE_MINOR to
	zero.

	* x86/machine.m4 (LREG, HREG): Moved macros here, from...
	* x86/aes.m4: ...here.

	* x86/camellia-crypt-internal.asm: New file.

	* nettle.texinfo: Updated and expanded section on DSA.
	Document aes_invert_key, and camellia. Added missing functions
	rsa_sha512_verify and rsa_sha512_verify_digest.

	* camellia.h (struct camellia_ctx): Eliminate the two unused
	subkeys, and renumber the remaining ones.
	* camellia-crypt-internal.c (_camellia_crypt): Updated for
	renumbered subkeys.
	* camellia-set-encrypt-key.c (camellia_set_encrypt_key): Likewise.
	* camellia-set-decrypt-key.c (camellia_invert_key): Likewise.

	* camellia-set-encrypt-key.c (camellia_set_encrypt_key): Inline
	the expansion of camellia_setup128 and camellia_setup256, keeping
	the unexpanded key in scalar variables.
	(camellia_setup128): Deleted.
	(camellia_setup256): Deleted.

2010-07-24  Niels Möller  <nisse@lysator.liu.se>

	* camellia-set-encrypt-key.c (camellia_set_encrypt_key): Reduced
	code size, no complete loop unroll. Use one loop for each phase of
	the post-processing.

	* testsuite/camellia-test.c: New tests for camellia_invert_key.
	* testsuite/aes-test.c: New tests for aes_invert_key.

	* aes.h (aes_invert_key): Declare it.

	* aes-set-decrypt-key.c (aes_invert_key): New function, key
	inversion code extracted from aes_set_decrypt_key.
	(aes_set_decrypt_key): Use aes_invert_key.

	* camellia-set-encrypt-key.c (camellia_setup128): Generate
	unmodified subkeys according to the spec. Moved clever combination
	of subkeys to camellia_set_encrypt_key.
	(camellia_setup256): Likewise.
	(camellia_set_encrypt_key): Moved subkey post-processing code
	here, and reduce code duplication between 128-bit keys and larger
	keys.

	* camellia.c: Deleted file, split into several new files...
	* camellia-table.c (_camellia_table): New file with the constant
	sbox tables.
	* camellia-set-encrypt-key.c: New file.
	(camellia_setup128): Generate unmodified subkeys according to the
	spec. Moved clever combination of subkeys to camellia_set_encrypt_key.
	(camellia_setup256): Likewise.

	* camellia-set-decrypt-key.c: New file.
	(camellia_invert_key): Key inversion function.
	(camellia_set_decrypt_key): New key setup function.
	* camellia-internal.h: New file.
	* camellia-crypt.c (camellia_crypt): New file, new wrapper
	function passing the sbox table to _camellia_crypt.
	* camellia-crypt-internal.c (_camellia_crypt): New file, with main
	encrypt/decrypt function.
	* Makefile.in (nettle_SOURCES): Updated list of camellia source files.
	(DISTFILES): Added camellia-internal.h.

2010-07-20  Niels Möller  <nisse@lysator.liu.se>

	* camellia-meta.c: Use _NETTLE_CIPHER_SEP_SET_KEY.

	* camellia.h (struct camellia_ctx): Replaced flag camellia128 by
	expanded key length nkeys.

	* camellia.c (camellia_set_encrypt_key): Renamed, from...
	(camellia_set_key): ... old name.
	(camellia_invert_key): New function.
	(camellia_set_decrypt_key): New function, using
	camellia_invert_key.
	(camellia_crypt): Renamed, from...
	(camellia_encrypt): ... old name.
	(camellia_decrypt): Deleted, no longer needed. camellia_crypt used
	for both encryption and decryption.

	* nettle-meta.h (_NETTLE_CIPHER_SEP_SET_KEY): New macro.

	* dsa-keygen.c: Removed unnecessary include of memxor.h.

	* camellia.c: Rewrote to use 64-bit type for subkeys and use
	64-bit operations throughout. Performance on x86_32, when compiled
	with gcc-4.4.4, is reduced by roughly 15%, this should be fixed
	later.

	* camellia.h (struct camellia_ctx): Use type uint64_t for subkeys.

2010-07-07  Niels Möller  <nisse@lysator.liu.se>

	* aes.h (aes_encrypt, aes_decrypt): Declare ctx argument as const.
	Also updated implementation.
	* blowfish.h (blowfish_encrypt, blowfish_decrypt): Likewise.
	* cast128.h (cast128_encrypt, cast128_decrypt): Likewise.
	* serpent.h (serpent_encrypt, serpent_decrypt): Likewise.
	* twofish.h (twofish_encrypt, twofish_decrypt): Likewise.

	* testsuite/Makefile.in (TS_NETTLE_SOURCES): Added
	camellia-test.c.

	* examples/nettle-benchmark.c: Added camellia ciphers.

	* Makefile.in (nettle_SOURCES): Added camellia.c and
	camellia-meta.c.
	(HEADERS): Added camellia.h.

	* nettle-meta.h (nettle_camellia128): Declare.
	(nettle_camellia192): Likewise.
	(nettle_camellia256): Likewise.

	* camellia-meta.c: New file.

	* camellia.h: Rewrote interface to match nettle conventions.

	* camellia.c: Converted to nettle conventions.
	(camellia_encrypt128, camellia_encrypt256): Unified to new
	function...
	(camellia_encrypt): ...New function, with a loop doing 6
	regular rounds, one FL round and one FLINV round per iteration,
	with iteration count depending on the key size.

	(camellia_decrypt128, camellia_decrypt256): Similarly unified
	as...
	(camellia_decrypt): ...New function, analogous to
	camellia_encrypt.

2010-07-06  Niels Möller  <nisse@lysator.liu.se>

	* camellia.c, camellia.h: New files, copied from
	http://info.isl.ntt.co.jp/crypt/eng/camellia/dl/camellia-LGPL-1.2.0.tar.gz.

	* testsuite/camellia-test.c: New file.

2010-07-05  Niels Möller  <nisse@lysator.liu.se>

	* nettle.texinfo: Document new conventions for weak key and des
	parity checks. Document des_check_parity.

	* testsuite/des-test.c (test_weak): Don't check the deleted status
	attribute.

	* des-compat.c (des_key_sched): Rewrote error checking logic for
	the case of non-zero des_check_key.

	* des3.c (des3_set_key): Changed weak key detection logic.
	Complete key setup also for weak keys, and don't set the status
	attribute.

	* des.c (des_set_key): New iteration logic, to keep key pointer
	unchanged. Moved weak key check to the end, and don't set the
	status attribute.
	(des_encrypt): Ignore status attribute.
	(des_decrypt): Likewise.

	* des.h (enum des_error): Deleted.
	(struct des_ctx): Deleted status attribute.
	(struct des3_ctx): Likewise.

	* blowfish.c (initial_ctx): Deleted status value.
	(blowfish_encrypt): Ignore status attribute.
	(blowfish_decrypt): Likewise.
	(blowfish_set_key): Return result from weak key check, without
	setting the status attribute.

	* blowfish.h (enum blowfish_error): Deleted.
	(struct blowfish_ctx): Deleted status attribute.

	* Makefile.in (des_headers): Deleted parity.h.

2010-06-30  Niels Möller  <nisse@lysator.liu.se>

	* testsuite/des-test.c (test_des): New function.
	(test_weak): New function.
	(test_main): Use test_des and test_weak. Added tests for all the
	weak keys. Added some tests with invalid (to be ignored) parity
	bits.

	* des.c (parity_16): New smaller parity table.
	(des_check_parity): New function.
	(des_fix_parity): Use parity_16.
	(des_weak_p): New weak-key detection. Ignores parity bits, and
	uses a hash table.
	(des_set_key): Deleted parity checking code. Replaced old weak-key
	detection code by a call to des_weak_p.

2010-06-04  Niels Möller  <nisse@lysator.liu.se>

	* testsuite/testutils.c (test_dsa_key): Updated for new name
	DSA_SHA1_MIN_P_BITS.

	* dsa-keygen.c (dsa_generate_keypair): Use DSA_SHA1_MIN_P_BITS and
	DSA_SHA256_MIN_P_BITS.

	* dsa.h (DSA_MIN_P_BITS, DSA_Q_OCTETS, DSA_Q_BITS): Renamed to...
	(DSA_SHA1_MIN_P_BITS, DSA_SHA1_Q_OCTETS, DSA_SHA1_Q_BITS): New
	names.

	* sexp2dsa.c (dsa_keypair_from_sexp_alist): New argument q_bits.
	Renamed parameter limit to p_max_bits.
	(dsa_sha1_keypair_from_sexp): Renamed, was dsa_keypair_from_sexp.
	Updated to call dsa_keypair_from_sexp_alist with the new argument.
	(dsa_sha256_keypair_from_sexp): New function.
	(dsa_signature_from_sexp): New argument q_bits.

	* der2dsa.c (dsa_params_from_der_iterator): Enforce 160-bit limit
	on q. Renamed parameter limit to p_max_bits.
	(dsa_openssl_private_key_from_der_iterator): Enforce 160-bit limit
	on q and x. Renamed parameter limit to p_max_bits.

2010-06-03  Niels Möller  <nisse@lysator.liu.se>

	* testsuite/dsa-test.c (test_main): Added test for dsa-sha256.

2010-06-02  Niels Möller  <nisse@lysator.liu.se>

	* testsuite/dsa-test.c (test_main): Provide expected value of the
	signature.

	* testsuite/testutils.c (test_dsa160): Added argument for expected
	signature.
	(test_dsa256): Likewise.

2010-06-01  Niels Möller  <nisse@lysator.liu.se>

	* testsuite/rsa-keygen-test.c (test_main): Updated expected
	signatures.

	* examples/random-prime.c (main): Updated for nettle_random_prime
	change.
	* testsuite/random-prime-test.c (test_main): Likewise.

	* rsa-keygen.c (bignum_random_prime): Deleted function.
	(rsa_generate_keypair): Use new nettle_random_prime. Generate
	secret factors p and q with the two most significant bits set.

	* dsa-keygen.c (dsa_generate_keypair): Updated for changes in
	nettle_random_prime and _nettle_generate_pocklington_prime. Invoke
	progress callback.

	* bignum-random-prime.c (_nettle_generate_pocklington_prime): New
	argument top_bits_set, to optionally generate primes with the two
	most significant bits set. Reordered argument list.
	(nettle_random_prime): Likewise, added top_bits_set argument.
	Invoke progress callback when a prime is generated.

2010-05-26  Niels Möller  <nisse@lysator.liu.se>

	* dsa-keygen.c (dsa_generate_keypair): Use
	_nettle_generate_pocklington_prime. Deleted old key generation
	code.

	* bignum-random-prime.c (_nettle_generate_pocklington_prime): Also
	return the used r. Updated caller.

	* examples/random-prime.c (main): Allow sizes down to 3 bits.

	* bignum-random-prime.c (_nettle_generate_pocklington_prime): New
	function. Rely on mpz_probab_prime_p (for lack of a trial division
	function) for trial division.
	(nettle_random_prime): Rewritten. Uses the prime table for the
	smallest sizes, then trial division using a new set of tables, and
	then Maurer's algorithm, calling the new
	_nettle_generate_pocklington_prime for the final search.

2010-05-25  Niels Möller  <nisse@lysator.liu.se>

	* testsuite/dsa-test.c (test_main): Updated for dsa testing
	changes.

	* testsuite/dsa-keygen-test.c (test_main): Test dsa256.

	* testsuite/testutils.h (struct nettle_mac): New struct, currently
	unused.

	* testsuite/testutils.c (test_mac): New function (currently not
	used).
	(test_dsa): Replaced by two new functions...
	(test_dsa160): New function.
	(test_dsa256): New function.
	(test_dsa_key): New argument q_size.
	(DSA_VERIFY): Generalized.

	* dsa-keygen.c (dsa_generate_keypair): Rewritten, now generating
	primes using Pocklington's theorem. Takes both p_size and q_size
	as arguments.

2010-05-20  Niels Möller  <nisse@lysator.liu.se>

	* bignum-random-prime.c (miller_rabin_pocklington): Fixed broken
	logic when Miller-rabin succeeds early.

2010-04-09  Niels Möller  <nisse@lysator.liu.se>

	* bignum-next-prime.c: Include stdlib.h, needed for alloca on
	freebsd.
	* hmac.c: Likewise.

	* examples/Makefile.in (SOURCES): Added random-prime.c.

	* examples/random-prime.c: New program.

	* testsuite/Makefile.in (TS_NETTLE_SOURCES): Moved
	knuth-lfib-test.c, cbc-test.c, ctr-test.c, hmac-test.c here, from
	TS_HOGWEED_SOURCES.
	(TS_HOGWEED_SOURCES): Added random-prime-test.c.

	* testsuite/random-prime-test.c: New test case.

	* examples/next-prime.c (main): With no command line arguments.
	exit after dislaying usage message.

	* examples/io.c (simple_random): Free buffer when done.

	* configure.ac: Changed message, say CC is the recommended
	way to configure the ABI.

	* bignum-random.c: Deleted test of HAVE_LIBGMP.
	* bignum.c: Likewise.
	* sexp2bignum.c: Likewise.

	* Makefile.in (hogweed_SOURCES): Added bignum-random-prime.c.

	* bignum-random-prime.c (nettle_random_prime): New file, new
	function.

2010-03-31  Niels Möller  <nisse@lysator.liu.se>

	* examples/nettle-benchmark.c (main): Benchmark sha224.

2010-03-30  Niels Möller  <nisse@lysator.liu.se>

	* testsuite/testutils.c (DSA_VERIFY): Updated for dsa_sha1_verify
	rename.
	(test_dsa): Check return value from dsa_sha1_sign.

	* Makefile.in (hogweed_SOURCES): Added dsa-sha1-sign.c,
	dsa-sha1-verify.c, dsa-sha256-sign.c, and dsa-sha256-verify.c.

	* dsa.h: Updated and added dsa declarations.

	* dsa-sha256-verify.c (dsa_sha256_verify_digest): New file, new
	function.
	(dsa_sha256_verify): New function.
	* dsa-sha256-sign.c (dsa_sha256_sign_digest): New file, new
	function.
	(dsa_sha256_sign): New function.

	* dsa-sha1-verify.c (dsa_sha1_verify_digest): New file. Moved and
	renamed function, from dsa_verify_digest, rewrote to use
	_dsa_verify.
	(dsa_sha1_verify): Analogous change, renamed from dsa_verify.
	* dsa-sha1-sign.c (dsa_sha1_sign_digest): New file. Moved and
	renamed function, from dsa_sign_digest, rewrote to use _dsa_sign,
	and added return value.
	(dsa_sha1_sign): Analogous change, renamed from dsa_sign.

	* dsa-verify.c (_dsa_verify): New general verification function,
	for any hash.
	* dsa-sign.c (_dsa_sign): New general signing function, for any
	hash. Returns success code, like the rsa signture functions.

2010-03-29  Niels Möller  <nisse@lysator.liu.se>

	* configure.ac (ABI): Attempt to use a better, ABI-dependant,
	default value for libdir.

	* x86/md5-compress.asm: Fixed function name in epilogue.

	* asm.m4 (EPILOGUE): Use . to refer to current address.

	* configure.ac (ABI): Detect which ABI the compiler is using.
	On x86_64, also check for __arch64__.

2010-03-28  Niels Möller  <nisse@lysator.liu.se>

	* configure.ac (asm_path): For x86_64, check if compiler is
	generating 32-bit code.

2010-03-27  Niels Möller  <nisse@lysator.liu.se>

	* testsuite/hmac-test.c (test_main): Rewrote rest of tests to use
	HMAC_TEST, and added more tests from Daniel Kahn Gillmor and from
	RFC 4231.

	* Makefile.in (nettle_SOURCES): Added hmac-sha224.c and
	hmac-sha384.c.

	* hmac.h: Added declarations of hmac-sha224 and hmac-sha384.

	* hmac-sha224.c: New file.

2010-03-26  Niels Möller  <nisse@lysator.liu.se>

	* testsuite/hmac-test.c (HMAC_TEST): New macro.
	(test_main): Use HMAC_TEST for the md5 and sha1 tests, and add
	test vectors from Daniel Kahn Gillmor.

	* testsuite/Makefile.in (TS_NETTLE_SOURCES): Added sha224-test.c.

	* Makefile.in (nettle_SOURCES): Added sha224-meta.c and
	write-be32.c.
	(DISTFILES): Added nettle-write.h.

	* sha.h: Added declarations for sha224. Some are aliases for the
	corresponding sha256 definition.

	* sha256.c (sha256_digest): Use _nettle_write_be32.
	(sha224_init): New function.
	(sha224_digest): New function.

	* sha1.c (sha1_digest): Use _nettle_write_be32.

	* nettle-internal.h (NETTLE_MAX_HASH_BLOCK_SIZE)
	(NETTLE_MAX_HASH_DIGEST_SIZE): Increased, to take sha512 into
	account.

	* nettle-write.h: New file.

	* write-be32.c (_nettle_write_be32): New file, new function.

	* sha224-meta.c: New file.

2010-03-25  Niels Möller  <nisse@lysator.liu.se>

	* hmac-sha384.c: New file.

	* testsuite/sha224-test.c: New file.

	* testsuite/md4-test.c (test_main): More test vectors, provided by
	Daniel Kahn Gillmor.
	* testsuite/md5-test.c (test_main): Likewise.
	* testsuite/sha1-test.c (test_main): Likewise.
	* testsuite/sha256-test.c (test_main): Likewise.
	* testsuite/sha384-test.c (test_main): Likewise.
	* testsuite/sha512-test.c (test_main): Likewise.

	* configure.ac: Bumped version numbers. Package version
	nettle-2.1, library versions libnettle.so.3.1, libhogweed.so.2.0.

	* examples/nettle-benchmark.c (main): Benchmark sha384.

	* testsuite/Makefile.in (TS_NETTLE_SOURCES): Added sha384-test.c.

	* testsuite/sha384-test.c: New file.

	* Makefile.in (nettle_SOURCES): Added sha384-meta.c.

	* sha384-meta.c: New file.

	* sha.h: Added declarations for sha384. Some are aliases for the
	corresponding sha512 definition.

	* sha512.c (sha512_write_digest): New function.
	(sha512_digest): Use it.
	(sha384_init): New function.
	(sha384_digest): New function.

2010-03-24  Niels Möller  <nisse@lysator.liu.se>

	* sha512.c: (sha512_digest): Simplified handling of any final
	partial word of the digest.

	* sha512.c: Reorganized to use _nettle_sha512_compress.

	* sha512-compress.c (_nettle_sha512_compress): Compression
	function extracted from sha512.c to a new file.

	* Makefile.in (nettle_SOURCES): Added sha256-compress.c and
	sha512-compress.c.

	* sha256.c: Reorganized to use _nettle_sha256_compress.

	* sha256-compress.c (_nettle_sha256_compress): Compression
	function extracted from sha256.c to a new file.

	* examples/nettle-benchmark.c (main): Benchmark sha512.

	* rsa-keygen.c (rsa_generate_keypair): Ensure that bit size of e
	is less than bit size of n, and check for the unlikely case p = q.

	* rsa.h (RSA_MINIMUM_N_OCTETS, RSA_MINIMUM_N_BITS): Reduced, to
	correspond to pkcs#1 encryption of single byte messagees.

	* pgp-encode.c (pgp_put_rsa_sha1_signature): Check return value
	from rsa_sha1_sign.
	* rsa-compat.c (R_SignFinal): Likewise.

	* rsa-md5-sign.c (rsa_md5_sign): Check and propagate return value
	from pkcs1_rsa_md5_encode.
	(rsa_md5_sign_digest): Check and propagate return value from
	pkcs1_rsa_md5_encode_digest.
	* rsa-md5-verify.c (rsa_md5_verify): Check return value from
	pkcs1_rsa_md5_encode.
	(rsa_md5_verify_digest): Check return value from
	pkcs1_rsa_md5_encode_digest.
	* rsa-sha1-sign.c: Analogous changes.
	* rsa-sha1-verify.c: Analogous changes.
	* rsa-sha256-sign.c: Analogous changes.
	* rsa-sha256-verify.c: Analogous changes.
	* rsa-sha512-sign.c: Analogous changes.
	* rsa-sha512-verify.c: Analogous changes.

	* pkcs1-rsa-md5.c (pkcs1_rsa_md5_encode)
	(pkcs1_rsa_md5_encode_digest): Added return value. Check and
	propagate return value from pkcs1_signature_prefix.
	* pkcs1-rsa-sha256.c (pkcs1_rsa_sha256_encode)
	(pkcs1_rsa_sha256_encode_digest): Likewise.
	* pkcs1-rsa-sha1.c (pkcs1_rsa_sha1_encode)
	(pkcs1_rsa_sha1_encode_digest): Likewise.
	* pkcs1-rsa-sha512.c (pkcs1_rsa_sha512_encode)
	(pkcs1_rsa_sha512_encode_digest): Likewise.

	* pkcs1.c (pkcs1_signature_prefix): Interface change, take both
	the total size and digest size as arguments, and return a status
	code to say if the size was large enough.

	* testsuite/Makefile.in: Added hogweed dependency for the test
	programs.

2010-03-23  Niels Möller  <nisse@lysator.liu.se>

	* testsuite/rsa-test.c (test_main): Test signing with sha512.

	* testsuite/testutils.c (test_rsa_sha512): New function.

	* Makefile.in (hogweed_SOURCES): Added pkcs1-rsa-sha512.c,
	rsa-sha512-sign.c and rsa-sha512-verify.c.

	* rsa.h: Added prototypes for sha512-related functions.
	(RSA_MINIMUM_N_OCTETS, RSA_MINIMUM_N_BITS): Increased.
	* pkcs1.h: Added prototypes for sha512-related functions.

	* rsa-sha512-verify.c: New file.
	* rsa-sha512-sign.c: New file.
	* pkcs1-rsa-sha512.c: New file.

2010-03-22  Niels Möller  <nisse@lysator.liu.se>

	* Makefile.in (nettle_SOURCES): Added hmac-sha512.c.

	* testsuite/hmac-test.c (test_main): Added test cases for
	hmac-sha512.

	* hmac.h: Declare functions sha512-related functions.
	* hmac-sha512.c (hmac_sha512_set_key): New file.

	Basic sha512 support.
	* testsuite/Makefile.in (TS_NETTLE_SOURCES): Added sha512-test.c.
	* testsuite/sha512-test.c: New file.

	* macros.h (READ_UINT64, WRITE_UINT64): New macros.

	* Makefile.in (nettle_SOURCES): Added sha512.c and sha512-meta.c.
	* sha.h: Added sha512-related declarations.
	* nettle-meta.h: Likewise.
	* sha512-meta.c: New file.
	* sha512.c: New file.

2010-03-06  Niels Möller  <nisse@lysator.liu.se>

	* Makefile.in (distdir): Include x86_64 assembler files.

2010-01-20  Niels Möller  <nisse@lysator.liu.se>

	* configure.ac: Check for mpz_powm_sec.

2010-01-13  Niels Möller  <nisse@lysator.liu.se>

	* Makefile.in ($(LIBHOGWEED_FORLINK)): Depend on
	$(LIBNETTLE_FORLINK).

	* configure.ac (LIBHOGWEED_LIBS): Added -lnettle -lgmp for the
	default case. Follows debian, and also makes dlopen of
	libhogweed.so work, without having to use RTLD_GLOBAL.
	(LIBHOGWEED_LINK): Added -L., to find our libnettle.so.

2009-10-21  Niels Möller  <nisse@lysator.liu.se>

	* tools/Makefile.in (pkcs1-conv$(EXEEXT)): Added dependency on
	../libhogweed.a.

2009-10-19  Niels Möller  <nisse@lysator.liu.se>

	* tools/pkcs1-conv.c: Updated for dsa/der interface change.

	* der2dsa.c (dsa_public_key_from_der_iterators): Split into two
	new functions...
	(dsa_params_from_der_iterator): New function.
	(dsa_public_key_from_der_iterator): New function.
	(dsa_openssl_private_key_from_der_iterator): Renamed, was
	dsa_private_key_from_der_iterator.
	(dsa_openssl_private_key_from_der): Likewise.
	* dsa.h: Corresponding changees to prototypes and #defines.

2009-10-12  Niels Möller  <nisse@lysator.liu.se>

	* sexp-format.c: Removed conditioning on HAVE_LIBGMP.

	* tools/pkcs1-conv.c: Support for DSA keys, contributed by Magnus
	Holmgren.

	* Makefile.in (hogweed_SOURCES): Added dsa2sexp.c and der2dsa.c.

	* der2dsa.c: New file, contributed by Magnus Holmgren.
	* dsa2sexp.c: Likewise.
	* dsa.h: Added prototypes.

	* configure.ac (LIBHOGWEED_MINOR): Bumped libhogweed minor
	version, now it's 1.1.

	* testsuite/rsa2sexp-test.c (test_main): Updated testcase for
	"rsa-pkcs1".

2009-10-11  Niels Möller  <nisse@lysator.liu.se>

	* rsa2sexp.c (rsa_keypair_to_sexp): Changed default algorithm name
	to "rsa-pkcs1".

2009-09-20  Niels Möller  <nisse@lysator.liu.se>

	* x86/sha1-compress.asm: Improved performance by 17% on AMD K7,
	by letting loopmix scramble the instruction order.

2009-09-15  Niels Möller  <nisse@lysator.liu.se>

	* x86/sha1-compress.asm: Cleanup, removing old cruft. Slight
	improvement to ROUND_F1_NOEXP. Slight reduction of
	dependency-chains.

2009-08-25  Niels Möller  <nisse@lysator.liu.se>

	* x86/sha1-compress.asm: Eliminated tmp variable for f3 rounds.

	* examples/nettle-benchmark.c (bench_sha1_compress): New function,
	for precise benchmarking of the compression function.

2009-06-08  Niels Möller  <nisse@lysator.liu.se>

	* Released nettle-2.0.

2009-06-04  Niels Möller  <nisse@lysator.liu.se>

	* configure.ac: Set version to 2.0

2009-05-30  Niels Möller  <nisse@lysator.liu.se>

	* Makefile.in (.texinfo.info): Don't use a temporary output file
	$@T, trust makeinfo to remove output file on errors.

2009-05-19  Niels Möller  <nisse@lysator.liu.se>

	* nettle.texinfo: Changed license to public domain.

2009-05-11  Niels Möller  <nisse@lysator.liu.se>

	* nettle.texinfo: Fixes from Karl Berry. Added some more index
	terms.

2009-03-06  Niels Möller  <nisse@lysator.liu.se>

	* x86_64/aes-encrypt-internal.asm: Reduced unrolling. Keep state
	in %eax--%edx only.
	* x86_64/aes-decrypt-internal.asm: Likewise.

	* x86_64/aes.m4 (MOVE_HREG): Deleted, no longer needed.
	(AES_STORE): Reduced offsets.
	(AES_ROUND): Use HREG directly, not MOVE_HREG.

	* x86_64/aes-decrypt-internal.asm: Rearrange register allocation.
	Put SA--SD in %eax--%edx, so the second byte can be accessed as
	%ah-%dh. TD is not needed, SD can be reused. Use the register that
	is saved for the outer loop counter, getting it off the stack.
	* x86_64/aes-encrypt-internal.asm: Likewise.

	* x86_64/aes.m4 (HREG, MOVE_HREG): New macros.
	(XREG): Fixed bug in handling of %r8 and %r9.
	(AES_ROUND): Use MOVE_HREG.

2009-02-10  Niels Möller  <nisse@lysator.liu.se>

	* base16-meta.c (base16_encode_update_wrapper): Mark ctx argument
	as UNUSED.

	* testsuite/sexp-conv-test: Updated testcases for improved
	handling of comments.

	* tools/sexp-conv.c (sexp_convert_item): Use sexp_put_soft_newline
	to terminate comments, and modify indentation for the case that a
	list starts with a comment.

	* tools/output.c (sexp_output_init): Initialize soft_newline.
	(sexp_put_raw_char): Clear soft_newline.
	(sexp_put_newline): Check and reset soft_newline.
	(sexp_put_soft_newline): New function.

	* tools/output.h (struct sexp_output): Removed union with single
	element, and updated all users. New attribute soft_newline.

2008-12-22  Niels Möller  <nisse@lysator.liu.se>

	* Makefile.in ($(des_headers)): Create files in $(srcdir).

2008-11-28  Niels Möller  <nisse@lysator.liu.se>

	* testsuite/cxx-test.cxx: Include <cstdio>.

2008-11-22  Niels Möller  <nisse@lysator.liu.se>

	* yarrow256.c (yarrow256_fast_reseed): Set ctx->seeded = 1, so
	that it is set if and only if the aes context has been initialized
	with aes_set_encrypt_key.
	(yarrow256_seed): No need to set ctx->seeded here.
	(yarrow256_update): Likewise.

2008-11-04  Niels Möller  <nisse@lysator.liu.se>

	* examples/next-prime.c (main): Avoid using gmp_fprintf, to stay
	compatible with gmp-3.1.

2008-11-01  Niels Möller  <nisse@lysator.liu.se>

	* nettle.texinfo: Updated for 2.0. New section on linking.

	* nettle-types.h, nettle-meta.h: Moved all typedefs for function
	types to nettle-types.h. Use non-pointer types, so that the types
	can be used to declare functions. Updated all users.

2008-10-31  Niels Möller  <nisse@lysator.liu.se>

	* testsuite/yarrow-test.c (test_main): Updated for seed file
	changes.

	* sha-example.c (display_hex): Use %02x, not %2x.

2008-10-30  Niels Möller  <nisse@lysator.liu.se>

	* tools/sexp-conv.c (main): Fixed file locking.

2008-10-25  Niels Möller  <nisse@lysator.liu.se>

	* configure.ac: Set version to 2.0rc1.

	* examples/Makefile.in (next-prime$(EXEEXT)): Added -lnettle to
	linker.

2008-10-24  Niels Möller  <nisse@lysator.liu.se>

	* sha256.c (ROUND): Simplified macro.

	* yarrow256.c (yarrow256_fast_reseed): Renamed (was
	yarrow_fast_reseed) and made non-static. Don't generate seed file
	here, let the application use yarrow256_random instead.
	(yarrow256_slow_reseed): Renamed (was yarrow_slow_reseed) and made
	non-static.
	(yarrow256_force_reseed): Deleted function, use
	yarrow256_slow_reseed instead. For backwards compatibility,
	yarrow.h defines yarrow256_force_reseed as an alias for that
	function.

	* yarrow.h (struct yarrow256_ctx): Deleted seed_file buffer.

2008-09-17  Niels Möller  <nisse@lysator.liu.se>

	* x86/arcfour-crypt.asm: Improved loop logic, and unrolled
	loop twice. Gave a modest speedup.

2008-09-15  Niels Möller  <nisse@lysator.liu.se>

	* yarrow256.c (yarrow256_seed): Disallow length == 0.

	* base64-decode.c (decode_table): Added vertical tab (VT) and form
	feed (FF) as white space characters.

	* x86_64/aes-decrypt-internal.asm: New file.

2008-09-13  Niels Möller  <nisse@lysator.liu.se>

	* x86/aes-encrypt-internal.asm: Replaced pushl and popl in the
	loop with movl.	Eliminated redundant movl.
	* x86/aes-decrypt-internal.asm: Likewise.

	* x86_64/aes.m4: New file.

	* x86/aes-encrypt-internal.asm: Updated for AES_FINAL_ROUND. Only
	three times through the substitution loop.
	* x86/aes-decrypt-internal.asm: Likewise.
	* x86_64/aes-encrypt-internal.asm: Likewise.

	* x86/aes.m4 (AES_FINAL_ROUND): Do the substitution on the least
	significant byte here.

	* x86/aes-encrypt-internal.asm: Updated use of AES_SUBST_BYTE. USe
	decl for outer loop.
	* x86/aes-decrypt-internal.asm: Likewise.

	* x86/aes.m4 (LREG, HREG): New macros.
	(AES_SUBST_BYTE): Take state registers as argument. Use LREG to
	get the corresponding byte register.
	(AES_ROUND): Use movzbl together with LREG and HREG.
	(AES_SUBST_BYTE): Likewise.

2008-09-10  Niels Möller  <nisse@lysator.liu.se>

	* x86_64/sha1-compress.asm: Avoid using registers %rbx and %rbp,
	which must be preserved.

2008-09-08  Niels Möller  <nisse@lysator.liu.se>

	* Makefile.in (stamp-h.in): Use $(AUTOHEADER).

	* x86_64/sha1-compress.asm: New x86_64 assembler, based on the x86
	version.

	* configure.ac (asm_path): Set up asm_path for x86_64.

	* x86_64/machine.m4: New file, new directory.

2008-08-28  Niels Möller  <nisse@lysator.liu.se>

	* examples/eratosthenes.c (main): Rewrote block-wise sieving to
	use less memory. New options -s and -v.

2008-08-27  Niels Möller  <nisse@lysator.liu.se>

	* testsuite/sexp-conv-test (print_raw, print_nl): Use printf.
	Updated testcases with comments; comments are now preserved.

	* tools/sexp-conv.c (sexp_convert_item): Keep comments in advanced
	output.
	(parse_options): New --lock option.
	(main): Optionally lock output file.

	* tools/parse.c (sexp_check_token): Removed check for "any" token.
	All callers specify the token they expect.
	(sexp_parse): Pass on comment tokens.

	* tools/output.c (sexp_put_data): Made non-static.

	* tools/input.c (sexp_get_comment): New function.
	(sexp_get_token): Use sexp_get_comment.

	* tools/misc.h (enum sexp_token): Start enumeration with zero, zero
	is no longer used to mean any type. New type SEXP_COMMENT.

	* configure.ac: Check for fcntl file locking.

2008-08-26  Niels Möller  <nisse@lysator.liu.se>

	* Makefile.in (tags-here): Put TAGS file in the source directory.
	* examples/Makefile.in (tags): Likewise.
	* testsuite/Makefile.in (tags): Likewise.
	* tools/Makefile.in (tags): Likewise.

2008-02-29  Niels Möller  <nisse@lysator.liu.se>

	* examples/Makefile.in (SOURCES): Added next-prime.c.

2008-01-05  Niels Möller  <nisse@lysator.liu.se>

	* examples/Makefile.in (TARGETS): Added eratosthenes and next-prime.
	(next-prime, eratosthenes): New rules.
	(nettle-benchmark): Don't rely on $@.

	* examples/eratosthenes.c (find_first_one): Optimized, using
	slightly larger table.
	(main): Use atol, rather than atoi.

	* testsuite/symbols-test: Check symbols also in libhogweed.

	* examples/next-prime.c: New file.
	Deleted code for detailed timing.

	* Makefile.in (hogweed_SOURCES): Added bignum-next-prime.c.
	(DISTFILES): Added prime-list.h.
	(hogweed_OBJS): Removed $(LIBOBJS).

	* bignum-next-prime.c (nettle_next_prime): Renamed function, for
	name space reasons. Was bignum_next_prime. Updated call in
	rsa-keygen.c.
	(primes): Use prime-list.h.
	(nettle_next_prime): Skip Fermat test. Use mpz_millerrabin
	directly, rather than mpz_probab_prime_p, when the former is
	available.

	* bignum.h (nettle_next_prime): New prototype.

	* rsa-keygen.c (bignum_next_prime): Deleted, moved to
	bignum-next-prime.c. Call with a larger prime limit, this improves
	the running time of lsh-keygen by roughly 25%.

	* prime-list.h: List of odd primes < 2^16.

	* configure.ac: Check for sizeof(long).

2008-01-03  Niels Möller  <nisse@lysator.liu.se>

	* examples/nettle-benchmark.c (main): Removed incorrect UNUSED
	from declaration.

	* bignum-next-prime.c: Moved the bignum_next_prime function to a
	separate file.

2007-09-08  Niels Möller  <nisse@lysator.liu.se>

	* sparc64/aes-encrypt-internal.asm: The directory with the aes.m4
	include file was renamed from "sparc" to "sparc32". Updated include.
	* sparc64/aes-decrypt-internal.asm: Likewise.
	* sparc32/aes-encrypt-internal.asm: Likewise.
	* sparc32/aes-decrypt-internal.asm: Likewise.

2007-09-07  Niels Möller  <nisse@lysator.liu.se>

	* examples/read_rsa_key.c: Include stdlib.h.

2007-06-02  Niels Möller  <nisse@lysator.liu.se>

	* Makefile.in: Typo fixes to install targets, spotted by Magnus
	Holmgren.

2007-05-14  Niels Möller  <niels@s3.kth.se>

	* configure.ac: Fixed copy-and-paste errors in shared library
	name setup.

	* config.make.in (LIBNETTLE_SONAME, LIBHOGWEED_SONAME): Define.

	* Makefile.in (libnettle.so, libhogweed.so): Fixed rules.

	* Makefile.in: Split nettle library into two files, libnettle.a
	and libhogweed.a, and similarly for the shared libraries.

	* configure.ac: Bumped nettle so-versions to 3.0. Set hogweed
	so-versions to 1.0. New makefile conditionals IF_SHARED and
	IF_HOGWEED. Renamed WITH_PUBLIC_KEY to WITH_HOGWEED. Deleted
	SHLIBTARGET, SHLIBINSTALL, RSA_EXAMPLES and RSA_TOOLS.

	* config.make.in: Updated for hogweed split.

	* C source files: Don't use WITH_PUBLIC_KEY / WITH_HOGWEED, the
	Makefile sorts out which files should be compiled.

	* pgp.h: Include bignum.h, don't pretend to work without bignums.

	* pgp-encode.c (pgp_put_mpi, pgp_put_public_rsa_key)
	(pgp_put_rsa_sha1_signature): Define unconditionally. Removed the
	checking of HAVE_LIBGMP and WITH_PUBLIC_KEY.

	* examples/io.h: Use WITH_HOGWEED, not WITH_PUBLIC_KEY.
	* examples/io.c (read_rsa_key): Deleted, moved to...
	* examples/read_rsa_key.c: New file, extracted from io.c.

	* examples/Makefile.in: Use IF_HOGWEED instead of RSA_EXAMPLES.
	Link appropriate programs with -lhogweed.
	(SOURCES): Added read_rsa_key.c.

	* tools/Makefile.in (pkcs1-conv): Use IF_HOGWEED, not @RSA_TOOLS@,
	for configuration. Link with -lhogweed.

	* testsuite/testutils.h: Use WITH_HOGWEED, not WITH_PUBLIC_KEY.
	* testsuite/testutils.c: Likewise.

	* testsuite/Makefile.in (TS_NETTLE_SOURCES, TS_HOGWEED_SOURCES):
	Separate test cases using nettle and those also using hogweed.

2007-04-05  Niels Möller  <nisse@lysator.liu.se>

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

2007-02-24  Niels Möller  <nisse@lysator.liu.se>

	* Makefile.in (clean-here): Remove .lib directory.
	(distclean-here): Remove machine.m4.

2006-12-05  Niels Möller  <nisse@lysator.liu.se>

	* configure.ac: AC_PREREQ 2.61, for AC_PROG_MKDIR_P.

	* config.make.in (datarootdir): New directory variable (for
	autoconf-2.61).

2006-11-28  Niels Möller  <nisse@lysator.liu.se>

	* configure.ac: Bumped version to 1.16.

	* Released nettle-1.15.

2006-11-27  Niels Möller  <nisse@lysator.liu.se>

	* NEWS: New entry for nettle-1.15.

	* configure.ac (SHLIBMINOR): Bumped version. Library name is now
	libnettle.so.2.6.

	* sha256.c: Changed copyright notice to use the LGPL.

	* Makefile.in (DISTFILES): Added COPYING.LIB.

	* COPYING.LIB: New file (previously only the plain GPL was
	included in the distribution).

	* nettle.texinfo: Updated vor nettle-1.15.

	* testsuite/rsa-test.c (test_main): Use test_rsa_sha256.
	* testsuite/testutils.c (test_rsa_sha256): New function.

	* testsuite/Makefile.in (DISTFILES): Replaces rfc1750.txt by
	gold-bug.txt.

	* rsa.h (rsa_sha256_sign, rsa_sha256_verify)
	(rsa_sha256_sign_digest, rsa_sha256_verify_digest): New declarations.
	(RSA_MINIMUM_N_OCTETS, RSA_MINIMUM_N_BITS): Increased to
	62 octets and  489 bits, respectively, for supporting sha256.

	* pkcs1.h (pkcs1_rsa_sha256_encode)
	(pkcs1_rsa_sha256_encode_digest): New declarations and name
	mangling symbols.

	* Makefile.in (nettle_SOURCES): Added pkcs1-rsa-sha256.c,
	rsa-sha256-sign.c, rsa-sha256-verify.c.

	* pkcs1-rsa-sha256.c, rsa-sha256-sign.c, rsa-sha256-verify.c: New
	files.

	* COPYING, INSTALL, install-sh, texinfo.tex: Updated files, from
	automake-1.10.

2006-11-27  Niels Möller  <niels@s3.kth.se>

	* tools/Makefile.in (install): Use MKDIR_P to create installation
	directory. Install only one file at a time.

	* Makefile.in (MKDIR_P): Use MKDIR_P for creating installation
	directories.

	* configure.ac: Use AC_PROG_MKDIR_P.

2006-11-24  Niels Möller  <nisse@lysator.liu.se>

	* testsuite/yarrow-test.c (test_main): Use gold-bug.txt as input
	file, instead of rfc1750.txt.

	* testsuite/gold-bug.txt: New test input file for yarrow-test.
	The copyright on this short story by Edgar Allan Poe has expired.

	* testsuite/rfc1750.txt: Deleted file. Debian considers RFC:s
	non-free, and it was expired anyway. Replaced by gold-bug.txt.

2006-11-24  Niels Möller  <niels@s3.kth.se>

	* Almost all header files: Added C++ guards.

	* configure.ac: Test if the system has any C++ compiler.

	* config.make.in (CXX, CXXFLAGS, COMPILE_CXX, LINK_CXX): New variables.

	* testsuite/Makefile.in: New variables TS_C and TS_CXX. Setup for
	compiling the C++ file cxx-test.cxx.

	* testsuite/cxx-test.cxx: New testcase, trying to use nettle from
	a C++ program.

2006-08-28  Niels Möller  <niels@s3.kth.se>

	* index.html: Added section on language bindings.

2006-06-10  Niels Möller  <niels@s3.kth.se>

	* configure.ac: Darwin shared library support, from Grant
	Robinsson.

2006-05-18  Niels Möller  <nisse@lysator.liu.se>

	* src/nettle/x86/aes.asm: Deleted unused file.

	* aes-decrypt.c (_aes_decrypt_table): Deleted the indexing array,
	previously commented out.
	* aes-encrypt-table.c (_aes_encrypt_table): Likewise.

	* Makefile.in (.texinfo.info, .dvi.ps): Use more quotes with
	basename.
	(install-here, install-shared, install-info, install-headers): Use
	plain mkdir, not $(INSTALL) -d.

2006-05-16  Niels Möller  <niels@s3.kth.se>
	Merged from the lsh experimental branch.

2006-04-26  Niels Möller  <nisse@lysator.liu.se>

	* examples/rsa-decrypt.c: Don't include "getopt.h", since it's not used.
	* examples/nettle-benchmark.c: Include "getopt.h".

	* examples/Makefile.in (GETOPT_OBJS): New variable.
	(rsa-keygen, rsa-encrypt, nettle-benchmark): Depend on and link
	with $(GETOPT_OBJS).

	* x86/aes-decrypt-internal.asm: Use ALIGN.
	* x86/aes-encrypt-internal.asm: Likewise.
	* x86/arcfour-crypt.asm: Likewise.
	* x86/md5-compress.asm: Likewise.
	* x86/sha1-compress.asm: Likewise.

	* config.m4.in (ASM_ALIGN_LOG): Substitute.
	* configure.ac (ASM_ALIGN_LOG): Check if .align directive is
	logarithmic.
	* asm.m4 (ALIGN): New macro. Takes a logarithmic argument, and
	expands to a .align directive.

2006-04-21  Niels Möller  <nisse@lysator.liu.se>

	* nettle.texinfo (Public-key algorithms): Say that the public key
	operations are undocumented, not unsupported. Reported by Jeronimo
	Pellegrini.
<