mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-11-16 12:34:29 +00:00
Compare commits
662 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f7bc6297ca | ||
|
|
13651934be | ||
|
|
f998c8119a | ||
|
|
0d903cf2d6 | ||
|
|
cfc268814a | ||
|
|
e42a701e99 | ||
|
|
77e95538dc | ||
|
|
037abdddf2 | ||
|
|
b6f2402f3f | ||
|
|
2307bc9dfa | ||
|
|
6eea3d8d4b | ||
|
|
3f74cd483b | ||
|
|
6b8eb1e936 | ||
|
|
2887612f27 | ||
|
|
b5d8be2209 | ||
|
|
533b533820 | ||
|
|
504d9c8bab | ||
|
|
35f5990e7a | ||
|
|
f289bfb388 | ||
|
|
9f84f353d0 | ||
|
|
2e89c13c1c | ||
|
|
a99cd32208 | ||
|
|
59925359ed | ||
|
|
b080f13543 | ||
|
|
0f85ead175 | ||
|
|
0a7a0a79d6 | ||
|
|
8ca40d80a9 | ||
|
|
96db5a3600 | ||
|
|
ffb228e448 | ||
|
|
7fc04bfebe | ||
|
|
464c2660ad | ||
|
|
7ee26c1b5e | ||
|
|
aa810cb926 | ||
|
|
3b2bbcb56a | ||
|
|
ad5659e93d | ||
|
|
34b194150e | ||
|
|
b9fe24962e | ||
|
|
c3acc441ac | ||
|
|
9b213e8c34 | ||
|
|
67def3c14b | ||
|
|
8d041c8e21 | ||
|
|
979e41c9da | ||
|
|
ff55eb920c | ||
|
|
992a3c8c71 | ||
|
|
6ffaa6f018 | ||
|
|
d67dcf9c74 | ||
|
|
883541bc8e | ||
|
|
c882141175 | ||
|
|
ca9edf3531 | ||
|
|
f98b675671 | ||
|
|
225f13bac2 | ||
|
|
7fcc976248 | ||
|
|
7cce089e40 | ||
|
|
5c75e5a38a | ||
|
|
40201bc253 | ||
|
|
f11912c5de | ||
|
|
75ffac21d7 | ||
|
|
bdbf347c22 | ||
|
|
c296e2cff8 | ||
|
|
6c975cd46a | ||
|
|
2bd7884ace | ||
|
|
e23eca901d | ||
|
|
0063b29cdf | ||
|
|
e10647f9c0 | ||
|
|
ee9cd40b6d | ||
|
|
fedb98c5f6 | ||
|
|
501be60574 | ||
|
|
324127837c | ||
|
|
0cb71ee9ce | ||
|
|
11fe9de0f0 | ||
|
|
0721cf102a | ||
|
|
2ec97696db | ||
|
|
0b5906d404 | ||
|
|
afd4b432f6 | ||
|
|
12a0be1e69 | ||
|
|
345819d550 | ||
|
|
ac67c39be9 | ||
|
|
da6c95edae | ||
|
|
057b38ad23 | ||
|
|
255145bde1 | ||
|
|
ee5386756d | ||
|
|
f0f2378961 | ||
|
|
5252301cb8 | ||
|
|
912445c341 | ||
|
|
4b9c4aa757 | ||
|
|
f1725afbe5 | ||
|
|
07ac1399ee | ||
|
|
f9c02d09c3 | ||
|
|
b9b64c0889 | ||
|
|
aeb03e5fa0 | ||
|
|
26d3770fad | ||
|
|
9dda62372c | ||
|
|
6568ba6eb0 | ||
|
|
283bc18d23 | ||
|
|
60537ce7cb | ||
|
|
9f5095f6bd | ||
|
|
8ffe75f665 | ||
|
|
c0abb762ff | ||
|
|
780aa7e325 | ||
|
|
f4033581b5 | ||
|
|
d3ba0aa98d | ||
|
|
d7253324cd | ||
|
|
c7b7b90cc9 | ||
|
|
2acc8f2c99 | ||
|
|
42e73b9b8f | ||
|
|
732778a971 | ||
|
|
556de14a1d | ||
|
|
c4dd17eeb5 | ||
|
|
802af0150c | ||
|
|
b514f4fa4e | ||
|
|
8ef7849199 | ||
|
|
f82953554d | ||
|
|
68fced741d | ||
|
|
cf0ed4e2ac | ||
|
|
eae4815bf3 | ||
|
|
41b5e486dd | ||
|
|
53b996077f | ||
|
|
b832d5801f | ||
|
|
f81575dcee | ||
|
|
5690221c5c | ||
|
|
51560d9a96 | ||
|
|
ea95020ffd | ||
|
|
7d6609f8db | ||
|
|
94dd3f871b | ||
|
|
fa86d4eece | ||
|
|
e9561c946c | ||
|
|
5e9787978c | ||
|
|
825b43a188 | ||
|
|
d289525e1b | ||
|
|
57cc3389a5 | ||
|
|
38cb08133d | ||
|
|
c6a4e3191e | ||
|
|
96ff3925d2 | ||
|
|
f218cf5680 | ||
|
|
cd42d2c215 | ||
|
|
b3f343fdae | ||
|
|
e5c8119b96 | ||
|
|
87243e4a16 | ||
|
|
27ff871a37 | ||
|
|
b71bb46a5b | ||
|
|
aa80622d72 | ||
|
|
a29dc8d6c6 | ||
|
|
f19497c3d6 | ||
|
|
b9f235846f | ||
|
|
28d8a27f8f | ||
|
|
717654471e | ||
|
|
02d0847567 | ||
|
|
5a6242fbd0 | ||
|
|
8af1ad9bac | ||
|
|
1b010fbaa7 | ||
|
|
3291f5a08d | ||
|
|
99d4f2c454 | ||
|
|
b4c3d91aff | ||
|
|
4c847711bd | ||
|
|
95eed0c8f3 | ||
|
|
4c3722bd76 | ||
|
|
25b911e0bd | ||
|
|
cff5cfdd4f | ||
|
|
8b5c27b679 | ||
|
|
672ae6cbb6 | ||
|
|
d3e053568d | ||
|
|
95b73d40d9 | ||
|
|
4ee2a96861 | ||
|
|
8a1450effc | ||
|
|
cfb8223232 | ||
|
|
7456c232ce | ||
|
|
267dc24bb3 | ||
|
|
067c1573c3 | ||
|
|
9bb5b40c81 | ||
|
|
a9d1ff4f5e | ||
|
|
976a9b44af | ||
|
|
34a7b0431b | ||
|
|
91b249d24b | ||
|
|
d39c0d5926 | ||
|
|
03213b9e4a | ||
|
|
8dadb6b87c | ||
|
|
693d0520bc | ||
|
|
63b3c773d5 | ||
|
|
2bf93bf925 | ||
|
|
a61db8f155 | ||
|
|
18ff880e75 | ||
|
|
3012d9b94d | ||
|
|
96e72413f7 | ||
|
|
7d169cef52 | ||
|
|
86b09bfeb9 | ||
|
|
dfdc319518 | ||
|
|
51aa373c4c | ||
|
|
acfbb7dd14 | ||
|
|
501a531d46 | ||
|
|
c37b2ca39b | ||
|
|
e4e6328300 | ||
|
|
271393b7d9 | ||
|
|
5dd77c7aeb | ||
|
|
6741592026 | ||
|
|
fd02010886 | ||
|
|
2de32c0141 | ||
|
|
f407b70dcc | ||
|
|
85fb1cc024 | ||
|
|
ca22607d14 | ||
|
|
e3263bb9b3 | ||
|
|
9e66637bec | ||
|
|
ee541a347d | ||
|
|
e0d9a274e2 | ||
|
|
d269f2027a | ||
|
|
e2f2cfa816 | ||
|
|
3b0854bf96 | ||
|
|
b3c040fc27 | ||
|
|
4f03f7d1bb | ||
|
|
b6e4854f26 | ||
|
|
d55e7e77a2 | ||
|
|
33cc3a292b | ||
|
|
99229b597b | ||
|
|
a60ce58731 | ||
|
|
ff5d3512b3 | ||
|
|
6507701fdf | ||
|
|
7d49c2190c | ||
|
|
d33a14b5fb | ||
|
|
e491610725 | ||
|
|
52e687086c | ||
|
|
162448f06b | ||
|
|
60538c7480 | ||
|
|
47f895cb34 | ||
|
|
b2e739495a | ||
|
|
3a3d061cc5 | ||
|
|
e9b5deb34a | ||
|
|
146b46df87 | ||
|
|
3d007d0b4b | ||
|
|
5fcd270398 | ||
|
|
bd9d37924d | ||
|
|
96ceb9f537 | ||
|
|
5b96cf6eea | ||
|
|
8ad9b75810 | ||
|
|
29336e35b5 | ||
|
|
f4a1a7d577 | ||
|
|
5b96c12e92 | ||
|
|
8aa5fa3459 | ||
|
|
4fe2abc792 | ||
|
|
d96dc2adb0 | ||
|
|
b0ba273489 | ||
|
|
4b26dc0614 | ||
|
|
5e47df8c01 | ||
|
|
4ce4de750a | ||
|
|
42b1688a30 | ||
|
|
583b144bc3 | ||
|
|
b4659d8872 | ||
|
|
113220628f | ||
|
|
4723209074 | ||
|
|
d45f18cc8d | ||
|
|
8426eba8e7 | ||
|
|
de7df3cfda | ||
|
|
f1a0534a56 | ||
|
|
7fa64efeeb | ||
|
|
2f6cb8a86c | ||
|
|
e92795bcc8 | ||
|
|
be8b0ed21d | ||
|
|
16ff69e873 | ||
|
|
9efb5c8b2f | ||
|
|
5cbab67186 | ||
|
|
1130a53ec8 | ||
|
|
5cd0b1e5ef | ||
|
|
f46070dc79 | ||
|
|
ef254df85f | ||
|
|
74ffdb0b89 | ||
|
|
09a89763ee | ||
|
|
b215310e63 | ||
|
|
0bb794301a | ||
|
|
911e82a909 | ||
|
|
f25503977e | ||
|
|
fa7222ab4a | ||
|
|
03c95b5950 | ||
|
|
a46f251d11 | ||
|
|
6af9b013eb | ||
|
|
82207ebffa | ||
|
|
ef7f3c5320 | ||
|
|
887fcd04f4 | ||
|
|
42cbd6a778 | ||
|
|
29a08b5e24 | ||
|
|
d59bf60ff9 | ||
|
|
6fe7e7ef67 | ||
|
|
7f7ad3d081 | ||
|
|
2283bfb0ae | ||
|
|
a5f00caf16 | ||
|
|
05a0e4379e | ||
|
|
3788026636 | ||
|
|
b17ab311af | ||
|
|
9bd5e5cf03 | ||
|
|
c8953a68cd | ||
|
|
ba6d285ea8 | ||
|
|
e101e7e437 | ||
|
|
38ae9b76bc | ||
|
|
c3dd6f6593 | ||
|
|
0f6b699eef | ||
|
|
a2089bbcf6 | ||
|
|
2346014918 | ||
|
|
33e11c72c3 | ||
|
|
d6da7b1231 | ||
|
|
0ccfdd1021 | ||
|
|
04ae37ef12 | ||
|
|
853696a991 | ||
|
|
b7eb76904a | ||
|
|
e4dbc6b770 | ||
|
|
b96016e234 | ||
|
|
5a2a8fc319 | ||
|
|
c6d8892b0d | ||
|
|
4f01401c00 | ||
|
|
0cc51d99a7 | ||
|
|
3eb212f454 | ||
|
|
84f4ae9aa0 | ||
|
|
eea669240b | ||
|
|
d4ca65f22f | ||
|
|
660162a5b8 | ||
|
|
d12ec14160 | ||
|
|
9a8da3ff38 | ||
|
|
03f9bbda52 | ||
|
|
481db56078 | ||
|
|
f843888e60 | ||
|
|
c83414ccc4 | ||
|
|
2fc4e89b98 | ||
|
|
d898d16c44 | ||
|
|
6c72f470ac | ||
|
|
d310ac4552 | ||
|
|
51ea2639a9 | ||
|
|
0bf2e615b2 | ||
|
|
6130fec60e | ||
|
|
e4f495012f | ||
|
|
888733ef79 | ||
|
|
b352be2e23 | ||
|
|
14f895478d | ||
|
|
4c9b5d88ae | ||
|
|
1e26b1875f | ||
|
|
d0323e67ae | ||
|
|
8cb6a4f032 | ||
|
|
371f6f359a | ||
|
|
3e430b3801 | ||
|
|
33351b02c9 | ||
|
|
86023aa5a6 | ||
|
|
d8c135e2dc | ||
|
|
a1b8079df1 | ||
|
|
f01bf9fdc3 | ||
|
|
a20e75082e | ||
|
|
1aaa80fba6 | ||
|
|
a56d4b998c | ||
|
|
723682f1dd | ||
|
|
a8836b5c43 | ||
|
|
a44a6fbaeb | ||
|
|
3705435417 | ||
|
|
8ae3d489fe | ||
|
|
2aa19f1a14 | ||
|
|
38e7554138 | ||
|
|
31609c7c3e | ||
|
|
42a2338f1c | ||
|
|
e95b482f56 | ||
|
|
f9072e7bac | ||
|
|
e4965ca03c | ||
|
|
2b6eb1c5ab | ||
|
|
b54158d1dc | ||
|
|
3e20aa7d60 | ||
|
|
f292243dcf | ||
|
|
3517bbdcce | ||
|
|
653fdb81d5 | ||
|
|
da93f1fc4b | ||
|
|
b4116a7c7d | ||
|
|
b3aa1e90ad | ||
|
|
6179690dc9 | ||
|
|
a3c2f45116 | ||
|
|
c861e3883d | ||
|
|
64ad1c00b5 | ||
|
|
0147415c40 | ||
|
|
39b2d049a6 | ||
|
|
4b2f9dad42 | ||
|
|
040a7c02df | ||
|
|
a320d6dffd | ||
|
|
c17c65fc09 | ||
|
|
acad916453 | ||
|
|
0d1e12522b | ||
|
|
6b3393b4b6 | ||
|
|
0416289066 | ||
|
|
ed54bc497d | ||
|
|
4b655ac3bb | ||
|
|
0028cc48c1 | ||
|
|
751103d848 | ||
|
|
5638fe28a2 | ||
|
|
3d00d47239 | ||
|
|
9001b7b77a | ||
|
|
e682aec507 | ||
|
|
00ad1a0200 | ||
|
|
2e42d7690a | ||
|
|
d2c2e3ca68 | ||
|
|
5037ecdc5c | ||
|
|
9dc39ee2a7 | ||
|
|
a22d5ff5a5 | ||
|
|
f54f21b8f6 | ||
|
|
faed443e82 | ||
|
|
b89fd7c1e3 | ||
|
|
417c3d1054 | ||
|
|
ad67be1577 | ||
|
|
c6020ae8b4 | ||
|
|
fa002f7fdd | ||
|
|
8cd71348be | ||
|
|
c2bfac68b3 | ||
|
|
0cbd5182a3 | ||
|
|
6be1ffccfb | ||
|
|
cbb14d30c5 | ||
|
|
0865907f3f | ||
|
|
9e9f9f30b1 | ||
|
|
b690b26861 | ||
|
|
dc2e20bb0a | ||
|
|
a37b947615 | ||
|
|
a2cfaa7cd9 | ||
|
|
8320dfb885 | ||
|
|
0cd79ad81d | ||
|
|
c44d12dadb | ||
|
|
b1b4b15353 | ||
|
|
b181a3af99 | ||
|
|
20eb03ed7d | ||
|
|
30bc6c01a9 | ||
|
|
40d2e74417 | ||
|
|
5aabe4f8fb | ||
|
|
dcf261a3e6 | ||
|
|
ca2191c6ee | ||
|
|
9a0f2bda55 | ||
|
|
1b7a2e40a3 | ||
|
|
2ee43fbc64 | ||
|
|
73df0ffdff | ||
|
|
6642926d43 | ||
|
|
15d10ce094 | ||
|
|
aa9ec31ba9 | ||
|
|
e46fe7c049 | ||
|
|
818abc468d | ||
|
|
63bd3ebbef | ||
|
|
dcd261bb8b | ||
|
|
7bcbef721b | ||
|
|
41fe693968 | ||
|
|
f64acd6a48 | ||
|
|
25bab250b6 | ||
|
|
bafda11518 | ||
|
|
a12ea2d212 | ||
|
|
6280324778 | ||
|
|
94607d83f9 | ||
|
|
c1353bb12d | ||
|
|
b887737c34 | ||
|
|
c09f6e6a9b | ||
|
|
dcea05a81c | ||
|
|
41a1dc62b7 | ||
|
|
0c56f5018d | ||
|
|
aedf7824cb | ||
|
|
81e141ad86 | ||
|
|
e2afb24747 | ||
|
|
0c849fa597 | ||
|
|
10fa546e60 | ||
|
|
eaacbb099a | ||
|
|
be44f8aaa7 | ||
|
|
7ec4773131 | ||
|
|
23fa077241 | ||
|
|
8ffa1b1736 | ||
|
|
013a3ef944 | ||
|
|
111283a9b2 | ||
|
|
0185643b39 | ||
|
|
1e248417bc | ||
|
|
db1a5f1553 | ||
|
|
988b0c1678 | ||
|
|
e3b5f36c3a | ||
|
|
1902d2b64a | ||
|
|
dd3fdfa9ff | ||
|
|
c63a81af99 | ||
|
|
49c602f3df | ||
|
|
ae402434f8 | ||
|
|
0e28ee90b6 | ||
|
|
42c0ae6bc8 | ||
|
|
a3095b89af | ||
|
|
8282cc0491 | ||
|
|
577ff0741d | ||
|
|
a0a96e52f2 | ||
|
|
41f92ced65 | ||
|
|
77d817ffaa | ||
|
|
7d92a29d2d | ||
|
|
117235c08a | ||
|
|
d8963209c2 | ||
|
|
aaf2d32011 | ||
|
|
6acac72ff1 | ||
|
|
d1d925ab36 | ||
|
|
18c4f8e622 | ||
|
|
a8c2c6b3b6 | ||
|
|
05e0c59da8 | ||
|
|
316b731fe9 | ||
|
|
b79d3de952 | ||
|
|
73606369c4 | ||
|
|
ed399e801e | ||
|
|
33bd63e287 | ||
|
|
245ff12be8 | ||
|
|
f9e024d7ea | ||
|
|
9ad0c17281 | ||
|
|
710a652daf | ||
|
|
f0a2688200 | ||
|
|
3fe6974bf9 | ||
|
|
574f5044a6 | ||
|
|
747a0e15fa | ||
|
|
c40370e96a | ||
|
|
63e8044d33 | ||
|
|
dac40d1677 | ||
|
|
2f754d9b0c | ||
|
|
3cbe0a724d | ||
|
|
8ceb665994 | ||
|
|
bb2093cf5d | ||
|
|
679a3c670c | ||
|
|
f522d6a2da | ||
|
|
9054485f1a | ||
|
|
08057fa77f | ||
|
|
203ae64600 | ||
|
|
92fae7d262 | ||
|
|
7d6758ee1a | ||
|
|
d04c2fa753 | ||
|
|
4578154959 | ||
|
|
0fd81d6d8e | ||
|
|
7d1292ced2 | ||
|
|
e83b93f5fc | ||
|
|
ce9c3b7413 | ||
|
|
14a190e79e | ||
|
|
1e17924fa8 | ||
|
|
a6db135add | ||
|
|
da0fff63c9 | ||
|
|
e5d9640863 | ||
|
|
4b964814de | ||
|
|
25310a6796 | ||
|
|
ad8fa53043 | ||
|
|
c9d9bddc3c | ||
|
|
5d902f2b9c | ||
|
|
18caebf1d1 | ||
|
|
65704174c9 | ||
|
|
0f6b0d3a59 | ||
|
|
4894955a08 | ||
|
|
c4eef61d39 | ||
|
|
b521d70e7e | ||
|
|
019c6417d7 | ||
|
|
5ad3b59783 | ||
|
|
2c242cdf78 | ||
|
|
c1b4fc58d2 | ||
|
|
877ce218a4 | ||
|
|
625b1a7159 | ||
|
|
0c0b54c175 | ||
|
|
08ca5dead5 | ||
|
|
b8a219b30c | ||
|
|
3b02b4c8f8 | ||
|
|
671949ad78 | ||
|
|
59f75a12f6 | ||
|
|
4444b4ee68 | ||
|
|
f11635ed91 | ||
|
|
a7c47131fa | ||
|
|
6cbbfd2eb5 | ||
|
|
fb47260e80 | ||
|
|
87049ac37c | ||
|
|
cdae14a8cb | ||
|
|
00136d4b51 | ||
|
|
d8248c49fc | ||
|
|
0ca2110982 | ||
|
|
a1145a1b78 | ||
|
|
34e7cfc2a2 | ||
|
|
e6903dac61 | ||
|
|
1cfb7b77e5 | ||
|
|
3a507bdc0c | ||
|
|
c3f9e3c5ff | ||
|
|
018f0f602a | ||
|
|
5013baa2cd | ||
|
|
04dafed839 | ||
|
|
2fd431e971 | ||
|
|
3aad6381e1 | ||
|
|
f038fd6a86 | ||
|
|
3b004f9900 | ||
|
|
62c0ae0926 | ||
|
|
c75c01ffdf | ||
|
|
c9b30b9fe7 | ||
|
|
2089f31f18 | ||
|
|
a1ef5d6fa9 | ||
|
|
59a834eb86 | ||
|
|
c04b074707 | ||
|
|
2fc9d033c6 | ||
|
|
51d9ee0c1c | ||
|
|
29ca4f1b36 | ||
|
|
0f3ae55e5d | ||
|
|
f904d26957 | ||
|
|
15ec6c87f7 | ||
|
|
686d190798 | ||
|
|
4e9374ad90 | ||
|
|
06953169ba | ||
|
|
0673f63e8d | ||
|
|
66734268f5 | ||
|
|
2e5d812022 | ||
|
|
3fbee4f0a8 | ||
|
|
64bd0689c7 | ||
|
|
6330e06975 | ||
|
|
6438027bb9 | ||
|
|
f928b0e296 | ||
|
|
f9d0a153b4 | ||
|
|
54c62d429f | ||
|
|
0158039f99 | ||
|
|
fda145278e | ||
|
|
2c562bd3d7 | ||
|
|
bb7b711ca9 | ||
|
|
a03b171992 | ||
|
|
9b153b3e06 | ||
|
|
94f178c8d1 | ||
|
|
5c5c1c406d | ||
|
|
961928b0f9 | ||
|
|
82995fd4fd | ||
|
|
4d966adc8b | ||
|
|
063c05ccad | ||
|
|
5ff880fee8 | ||
|
|
8732e8efc5 | ||
|
|
fb9662009a | ||
|
|
e08966c7e8 | ||
|
|
b4efc0439f | ||
|
|
410f5d45eb | ||
|
|
e3a868ca58 | ||
|
|
b8d265f57f | ||
|
|
39147e83a0 | ||
|
|
96ceae8edd | ||
|
|
a4a830c44d | ||
|
|
bbe48d31a4 | ||
|
|
fbadf8bee7 | ||
|
|
f9918345e1 | ||
|
|
c60973c34a | ||
|
|
64a3ab321a | ||
|
|
80f7e8cdd4 | ||
|
|
2bd7d0c1f5 | ||
|
|
2b41be4cb9 | ||
|
|
352949af42 | ||
|
|
0013028c7a | ||
|
|
4f5f527c73 | ||
|
|
b7487b8dc2 | ||
|
|
a69933782d | ||
|
|
74290b4425 | ||
|
|
a0056e8fd3 | ||
|
|
9a15f50b00 | ||
|
|
7132e88685 | ||
|
|
895ee2bb3e | ||
|
|
be7cae575d | ||
|
|
d135e45676 | ||
|
|
0527099b51 | ||
|
|
67cc013ac3 | ||
|
|
af023e8bf1 | ||
|
|
01202246da | ||
|
|
6d20e2b5cd | ||
|
|
a7fb62cb9c | ||
|
|
af623460a6 | ||
|
|
2cf9f1ac8c | ||
|
|
3762630f27 | ||
|
|
a9b8f0ca69 | ||
|
|
236683d74d | ||
|
|
3a1a500950 | ||
|
|
c08a0558c8 | ||
|
|
caf1fbc899 | ||
|
|
8c66fdbb8c | ||
|
|
b78fa80fbe | ||
|
|
7fb22e27da | ||
|
|
c79a5fe50c | ||
|
|
3b1ff85222 | ||
|
|
3b9d0819c9 | ||
|
|
08b959f143 | ||
|
|
fba04057ec | ||
|
|
37d302b8ee | ||
|
|
83fa827935 | ||
|
|
17bba16fa6 |
@@ -1,7 +0,0 @@
|
||||
Note the CyaSSL license terms are different to the FreeRTOS license terms.
|
||||
|
||||
CyaSSL is dual licensed. The files are provided here under an unmodified open
|
||||
source GNU GPL license. Commercial licenses are also available.
|
||||
See http://www.FreeRTOS.org/ssl
|
||||
|
||||
|
||||
@@ -1,78 +0,0 @@
|
||||
# includes append to these:
|
||||
SUFFIXES =
|
||||
TESTS =
|
||||
CLEANFILES =
|
||||
DISTCLEANFILES =
|
||||
bin_PROGRAMS =
|
||||
noinst_HEADERS =
|
||||
lib_LTLIBRARIES =
|
||||
man_MANS =
|
||||
noinst_LTLIBRARIES =
|
||||
noinst_PROGRAMS =
|
||||
include_HEADERS =
|
||||
nobase_include_HEADERS =
|
||||
check_PROGRAMS =
|
||||
EXTRA_HEADERS =
|
||||
BUILT_SOURCES=
|
||||
EXTRA_DIST=
|
||||
doc_DATA=
|
||||
|
||||
exampledir = $(docdir)/@PACKAGE@/example
|
||||
example_DATA=
|
||||
EXTRA_DIST+= $(example_DATA)
|
||||
|
||||
EXTRA_DIST+= $(doc_DATA)
|
||||
|
||||
ACLOCAL_AMFLAGS= -I m4 --install
|
||||
|
||||
EXTRA_DIST+= lib/dummy
|
||||
|
||||
EXTRA_DIST+= cyassl-ntru.vcproj
|
||||
EXTRA_DIST+= cyassl.vcproj
|
||||
EXTRA_DIST+= cyassl-iphone.xcodeproj/project.pbxproj
|
||||
EXTRA_DIST+= cyassl-ntru.sln
|
||||
EXTRA_DIST+= cyassl.sln
|
||||
|
||||
include cyassl/include.am
|
||||
include certs/include.am
|
||||
include certs/crl/include.am
|
||||
include doc/include.am
|
||||
include swig/include.am
|
||||
|
||||
include src/include.am
|
||||
include ctaocrypt/benchmark/include.am
|
||||
include ctaocrypt/src/include.am
|
||||
include ctaocrypt/test/include.am
|
||||
include examples/client/include.am
|
||||
include examples/server/include.am
|
||||
include examples/echoclient/include.am
|
||||
include examples/echoserver/include.am
|
||||
include testsuite/include.am
|
||||
include tests/include.am
|
||||
include sslSniffer/sslSnifferTest/include.am
|
||||
|
||||
TESTS += $(check_PROGRAMS)
|
||||
test: check
|
||||
|
||||
# !!!! first line of rule has to start with a hard (real) tab, not spaces
|
||||
egs:
|
||||
$(MAKE) examples/client/client; \
|
||||
$(MAKE) examples/echoclient/echoclient;\
|
||||
$(MAKE) examples/server/server; \
|
||||
$(MAKE) examples/echoserver/echoserver;
|
||||
|
||||
ctc:
|
||||
$(MAKE) ctaocrypt/test/testctaocrypt; \
|
||||
$(MAKE) ctaocrypt/benchmark/benchmark;
|
||||
|
||||
merge-clean:
|
||||
@find ./ | $(GREP) \.gcda | xargs rm -f
|
||||
@find ./ | $(GREP) \.gcno | xargs rm -f
|
||||
@find ./ | $(GREP) \.gz | xargs rm -f
|
||||
@find ./ | $(GREP) \.orig | xargs rm -f
|
||||
@find ./ | $(GREP) \.rej | xargs rm -f
|
||||
@find ./ | $(GREP) \.rpm | xargs rm -f
|
||||
@find ./ | $(GREP) \.THIS | xargs rm -f
|
||||
@find ./ | $(GREP) \.OTHER | xargs rm -f
|
||||
@find ./ | $(GREP) \.BASE | xargs rm -f
|
||||
@find ./ | $(GREP) \~$$ | xargs rm -f
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,723 +0,0 @@
|
||||
*** Notes, Please read ***
|
||||
|
||||
Note 1)
|
||||
CyaSSL now needs all examples and tests to be run from the CyaSSL home
|
||||
directory. This is because it finds certs and keys from ./certs/. Trying to
|
||||
maintain the ability to run each program from its own directory, the testsuite
|
||||
directory, the main directory (for make check/test), and for the various
|
||||
different project layouts (with or without config) was becoming harder and
|
||||
harder. Now to run testsuite just do:
|
||||
|
||||
./testsuite/testsuite
|
||||
|
||||
or
|
||||
|
||||
make test (when using autoconf)
|
||||
|
||||
On *nix or Windows the examples and testsuite will check to see if the current
|
||||
directory is the source directory and if so, attempt to change to the CyaSSL
|
||||
home directory. This should work in most setup cases, if not, just follow the
|
||||
beginning of the note and specify the full path.
|
||||
|
||||
|
||||
Note 2)
|
||||
CyaSSL takes a different approach to certificate verification than OpenSSL does.
|
||||
The default policy for the client is to verify the server, this means that if
|
||||
you don't load CAs to verify the server you'll get a connect error, unable to
|
||||
verify (-155). It you want to mimic OpenSSL behavior of having SSL_connect
|
||||
succeed even if verifying the server fails and reducing security you can do
|
||||
this by calling:
|
||||
|
||||
SSL_CTX_set_verify(ctx, SSL_VERIFY_NONE, 0);
|
||||
|
||||
before calling SSL_new(); Though it's not recommended.
|
||||
|
||||
*** end Note ***
|
||||
|
||||
CyaSSL Release 2.3.0 (8/10/2012)
|
||||
|
||||
Release 2.3.0 CyaSSL has bug fixes and a few new features including:
|
||||
- AES-GCM crypto and cipher suites
|
||||
- make test cipher suite checks
|
||||
- Subject AltName processing
|
||||
- Command line support for client/server examples
|
||||
- Sniffer SessionTicket support
|
||||
- SHA-384 cipher suites
|
||||
- Verify cipher suite validity when user overrides
|
||||
- CRL dir monitoring
|
||||
- DTLS Cookie support, reliability coming soon
|
||||
|
||||
The CyaSSL manual is available at:
|
||||
http://www.yassl.com/documentation/CyaSSL-Manual.pdf. For build instructions
|
||||
and comments about the new features please check the manual.
|
||||
|
||||
|
||||
|
||||
***************CyaSSL Release 2.2.0 (5/18/2012)
|
||||
|
||||
Release 2.2.0 CyaSSL has bug fixes and a few new features including:
|
||||
- Initial CRL support (--enable-crl)
|
||||
- Initial OCSP support (--enable-ocsp)
|
||||
- Add static ECDH suites
|
||||
- SHA-384 support
|
||||
- ECC client certificate support
|
||||
- Add medium session cache size (1055 sessions)
|
||||
- Updated unit tests
|
||||
- Protection against mutex reinitialization
|
||||
|
||||
|
||||
The CyaSSL manual is available at:
|
||||
http://www.yassl.com/documentation/CyaSSL-Manual.pdf. For build instructions
|
||||
and comments about the new features please check the manual.
|
||||
|
||||
|
||||
|
||||
***************CyaSSL Release 2.0.8 (2/24/2012)
|
||||
|
||||
Release 2.0.8 CyaSSL has bug fixes and a few new features including:
|
||||
- A fix for malicious certificates pointed out by Remi Gacogne (thanks)
|
||||
resulting in NULL pointer use.
|
||||
- Respond to renegotiation attempt with no_renegoatation alert
|
||||
- Add basic path support for load_verify_locations()
|
||||
- Add set Temp EC-DHE key size
|
||||
- Extra checks on rsa test when porting into
|
||||
|
||||
|
||||
The CyaSSL manual is available at:
|
||||
http://www.yassl.com/documentation/CyaSSL-Manual.pdf. For build instructions
|
||||
and comments about the new features please check the manual.
|
||||
|
||||
|
||||
|
||||
************* CyaSSL Release 2.0.6 (1/27/2012)
|
||||
|
||||
Release 2.0.6 CyaSSL has bug fixes and a few new features including:
|
||||
- Fixes for CA basis constraint check
|
||||
- CTX reference counting
|
||||
- Initial unit test additions
|
||||
- Lean and Mean Windows fix
|
||||
- ECC benchmarking
|
||||
- SSMTP build support
|
||||
- Ability to group handshake messages with set_group_messages(ctx/ssl)
|
||||
- CA cache addition callback
|
||||
- Export Base64_Encode for general use
|
||||
|
||||
The CyaSSL manual is available at:
|
||||
http://www.yassl.com/documentation/CyaSSL-Manual.pdf. For build instructions
|
||||
and comments about the new features please check the manual.
|
||||
|
||||
|
||||
|
||||
************* CyaSSL Release 2.0.2 (12/05/2011)
|
||||
|
||||
Release 2.0.2 CyaSSL has bug fixes and a few new features including:
|
||||
- CTaoCrypt Runtime library detection settings when directly using the crypto
|
||||
library
|
||||
- Default certificate generation now uses SHAwRSA and adds SHA256wRSA generation
|
||||
- All test certificates now use 2048bit and SHA-1 for better modern browser
|
||||
support
|
||||
- Direct AES block access and AES-CTR (counter) mode
|
||||
- Microchip pic32 support
|
||||
|
||||
The CyaSSL manual is available at:
|
||||
http://www.yassl.com/documentation/CyaSSL-Manual.pdf. For build instructions
|
||||
and comments about the new features please check the manual.
|
||||
|
||||
|
||||
|
||||
************* CyaSSL Release 2.0.0rc3 (9/28/2011)
|
||||
|
||||
Release 2.0.0rc3 for CyaSSL has bug fixes and a few new features including:
|
||||
- updated autoconf support
|
||||
- better make install and uninstall (uses system directories)
|
||||
- make test / make check
|
||||
- CyaSSL headers now in <cyassl/*.h>
|
||||
- CTaocrypt headers now in <cyassl/ctaocrypt/*.h>
|
||||
- OpenSSL compatibility headers now in <cyassl/openssl/*.h>
|
||||
- examples and tests all run from home diretory so can use certs in ./certs
|
||||
(see note 1)
|
||||
|
||||
So previous applications that used the OpenSSL compatibility header
|
||||
<openssl/ssl.h> now need to include <cyassl/openssl/ssl.h> instead, no other
|
||||
changes are required.
|
||||
|
||||
Special Thanks to Brian Aker for his autoconf, install, and header patches.
|
||||
|
||||
The CyaSSL manual is available at:
|
||||
http://www.yassl.com/documentation/CyaSSL-Manual.pdf. For build instructions
|
||||
and comments about the new features please check the manual.
|
||||
|
||||
************CyaSSL Release 2.0.0rc2 (6/6/2011)
|
||||
|
||||
Release 2.0.0rc2 for CyaSSL has bug fixes and a few new features including:
|
||||
- bug fixes (Alerts, DTLS with DHE)
|
||||
- FreeRTOS support
|
||||
- lwIP support
|
||||
- Wshadow warnings removed
|
||||
- asn public header
|
||||
- CTaoCrypt public headers now all have ctc_ prefix (the manual is still being
|
||||
updated to relfect this change)
|
||||
- and more.
|
||||
|
||||
This is the 2nd and perhaps final release candidate for version 2.
|
||||
Please send any comments or questions to support@yassl.com.
|
||||
|
||||
The CyaSSL manual is available at:
|
||||
http://www.yassl.com/documentation/CyaSSL-Manual.pdf. For build instructions
|
||||
and comments about the new features please check the manual.
|
||||
|
||||
***********CyaSSL Release 2.0.0rc1 (5/2/2011)
|
||||
|
||||
Release 2.0.0rc1 for CyaSSL has many new features including:
|
||||
- bug fixes
|
||||
- SHA-256 cipher suites
|
||||
- Root Certificate Verification (instead of needing all certs in the chain)
|
||||
- PKCS #8 private key encryption (supports PKCS #5 v1-v2 and PKCS #12)
|
||||
- Serial number retrieval for x509
|
||||
- PBKDF2 and PKCS #12 PBKDF
|
||||
- UID parsing for x509
|
||||
- SHA-256 certificate signatures
|
||||
- Client and server can send chains (SSL_CTX_use_certificate_chain_file)
|
||||
- CA loading can now parse multiple certificates per file
|
||||
- Dynamic memory runtime hooks
|
||||
- Runtime hooks for logging
|
||||
- EDH on server side
|
||||
- More informative error codes
|
||||
- More informative logging messages
|
||||
- Version downgrade more robust (use SSL_v23*)
|
||||
- Shared build only by default through ./configure
|
||||
- Compiler visibility is now used, internal functions not polluting namespace
|
||||
- Single Makefile, no recursion, for faster and simpler building
|
||||
- Turn on all warnings possible build option, warning fixes
|
||||
- and more.
|
||||
|
||||
Because of all the new features and the multiple OS, compiler, feature-set
|
||||
options that CyaSSL allows, there may be some configuration fixes needed.
|
||||
Please send any comments or questions to support@yassl.com.
|
||||
|
||||
The CyaSSL manual is available at:
|
||||
http://www.yassl.com/documentation/CyaSSL-Manual.pdf. For build instructions
|
||||
and comments about the new features please check the manual.
|
||||
|
||||
****************** CyaSSL Release 1.9.0 (3/2/2011)
|
||||
|
||||
Release 1.9.0 for CyaSSL adds bug fixes, improved TLSv1.2 through testing and
|
||||
better hash/sig algo ids, --enable-webServer for the yaSSL embedded web server,
|
||||
improper AES key setup detection, user cert verify callback improvements, and
|
||||
more.
|
||||
|
||||
The CyaSSL manual offering is included in the doc/ directory. For build
|
||||
instructions and comments about the new features please check the manual.
|
||||
|
||||
Please send any comments or questions to support@yassl.com.
|
||||
|
||||
****************** CyaSSL Release 1.8.0 (12/23/2010)
|
||||
|
||||
Release 1.8.0 for CyaSSL adds bug fixes, x509 v3 CA signed certificate
|
||||
generation, a C standard library abstraction layer, lower memory use, increased
|
||||
portability through the os_settings.h file, and the ability to use NTRU cipher
|
||||
suites when used in conjunction with an NTRU license and library.
|
||||
|
||||
The initial CyaSSL manual offering is included in the doc/ directory. For
|
||||
build instructions and comments about the new features please check the manual.
|
||||
|
||||
Please send any comments or questions to support@yassl.com.
|
||||
|
||||
Happy Holidays.
|
||||
|
||||
|
||||
********************* CyaSSL Release 1.6.5 (9/9/2010)
|
||||
|
||||
Release 1.6.5 for CyaSSL adds bug fixes and x509 v3 self signed certificate
|
||||
generation.
|
||||
|
||||
For general build instructions see doc/Building_CyaSSL.pdf.
|
||||
|
||||
To enable certificate generation support add this option to ./configure
|
||||
./configure --enable-certgen
|
||||
|
||||
An example is included in ctaocrypt/test/test.c and documentation is provided
|
||||
in doc/CyaSSL_Extensions_Reference.pdf item 11.
|
||||
|
||||
********************** CyaSSL Release 1.6.0 (8/27/2010)
|
||||
|
||||
Release 1.6.0 for CyaSSL adds bug fixes, RIPEMD-160, SHA-512, and RSA key
|
||||
generation.
|
||||
|
||||
For general build instructions see doc/Building_CyaSSL.pdf.
|
||||
|
||||
To add RIPEMD-160 support add this option to ./configure
|
||||
./configure --enable-ripemd
|
||||
|
||||
To add SHA-512 support add this option to ./configure
|
||||
./configure --enable-sha512
|
||||
|
||||
To add RSA key generation support add this option to ./configure
|
||||
./configure --enable-keygen
|
||||
|
||||
Please see ctaocrypt/test/test.c for examples and usage.
|
||||
|
||||
For Windows, RIPEMD-160 and SHA-512 are enabled by default but key generation is
|
||||
off by default. To turn key generation on add the define CYASSL_KEY_GEN to
|
||||
CyaSSL.
|
||||
|
||||
|
||||
************* CyaSSL Release 1.5.6 (7/28/2010)
|
||||
|
||||
Release 1.5.6 for CyaSSL adds bug fixes, compatibility for our JSSE provider,
|
||||
and a fix for GCC builds on some systems.
|
||||
|
||||
For general build instructions see doc/Building_CyaSSL.pdf.
|
||||
|
||||
To add AES-NI support add this option to ./configure
|
||||
./configure --enable-aesni
|
||||
|
||||
You'll need GCC 4.4.3 or later to make use of the assembly.
|
||||
|
||||
************** CyaSSL Release 1.5.4 (7/7/2010)
|
||||
|
||||
Release 1.5.4 for CyaSSL adds bug fixes, support for AES-NI, SHA1 speed
|
||||
improvements from loop unrolling, and support for the Mongoose Web Server.
|
||||
|
||||
For general build instructions see doc/Building_CyaSSL.pdf.
|
||||
|
||||
To add AES-NI support add this option to ./configure
|
||||
./configure --enable-aesni
|
||||
|
||||
You'll need GCC 4.4.3 or later to make use of the assembly.
|
||||
|
||||
*************** CyaSSL Release 1.5.0 (5/11/2010)
|
||||
|
||||
Release 1.5.0 for CyaSSL adds bug fixes, GoAhead WebServer support, sniffer
|
||||
support, and initial swig interface support.
|
||||
|
||||
For general build instructions see doc/Building_CyaSSL.pdf.
|
||||
|
||||
To add support for GoAhead WebServer either --enable-opensslExtra or if you
|
||||
don't want all the features of opensslExtra you can just define GOAHEAD_WS
|
||||
instead. GOAHEAD_WS can be added to ./configure with CFLAGS=-DGOAHEAD_WS or
|
||||
you can define it yourself.
|
||||
|
||||
To look at the sniffer support please see the sniffertest app in
|
||||
sslSniffer/sslSnifferTest. Build with --enable-sniffer on *nix or use the
|
||||
vcproj files on windows. You'll need to have pcap installed on *nix and
|
||||
WinPcap on windows.
|
||||
|
||||
A swig interface file is now located in the swig directory for using Python,
|
||||
Java, Perl, and others with CyaSSL. This is initial support and experimental,
|
||||
please send questions or comments to support@yassl.com.
|
||||
|
||||
When doing load testing with CyaSSL, on the echoserver example say, the client
|
||||
machine may run out of tcp ephemeral ports, they will end up in the TIME_WAIT
|
||||
queue, and can't be reused by default. There are generally two ways to fix
|
||||
this. 1) Reduce the length sockets remain on the TIME_WAIT queue or 2) Allow
|
||||
items on the TIME_WAIT queue to be reused.
|
||||
|
||||
|
||||
To reduce the TIME_WAIT length in OS X to 3 seconds (3000 milliseconds)
|
||||
|
||||
sudo sysctl -w net.inet.tcp.msl=3000
|
||||
|
||||
In Linux
|
||||
|
||||
sudo sysctl -w net.ipv4.tcp_tw_reuse=1
|
||||
|
||||
allows reuse of sockets in TIME_WAIT
|
||||
|
||||
sudo sysctl -w net.ipv4.tcp_tw_recycle=1
|
||||
|
||||
works but seems to remove sockets from TIME_WAIT entirely?
|
||||
|
||||
sudo sysctl -w net.ipv4.tcp_fin_timeout=1
|
||||
|
||||
doen't control TIME_WAIT, it controls FIN_WAIT(2) contrary to some posts
|
||||
|
||||
|
||||
******************** CyaSSL Release 1.4.0 (2/18/2010)
|
||||
|
||||
Release 1.3.0 for CyaSSL adds bug fixes, better multi TLS/SSL version support
|
||||
through SSLv23_server_method(), and improved documentation in the doc/ folder.
|
||||
|
||||
For general build instructions doc/Building_CyaSSL.pdf.
|
||||
|
||||
******************** CyaSSL Release 1.3.0 (1/21/2010)
|
||||
|
||||
Release 1.3.0 for CyaSSL adds bug fixes, a potential security problem fix,
|
||||
better porting support, removal of assert()s, and a complete THREADX port.
|
||||
|
||||
For general build instructions see rc1 below.
|
||||
|
||||
******************** CyaSSL Release 1.2.0 (11/2/2009)
|
||||
|
||||
Release 1.2.0 for CyaSSL adds bug fixes and session negotiation if first use is
|
||||
read or write.
|
||||
|
||||
For general build instructions see rc1 below.
|
||||
|
||||
******************** CyaSSL Release 1.1.0 (9/2/2009)
|
||||
|
||||
Release 1.1.0 for CyaSSL adds bug fixes, a check against malicious session
|
||||
cache use, support for lighttpd, and TLS 1.2.
|
||||
|
||||
To get TLS 1.2 support please use the client and server functions:
|
||||
|
||||
SSL_METHOD *TLSv1_2_server_method(void);
|
||||
SSL_METHOD *TLSv1_2_client_method(void);
|
||||
|
||||
CyaSSL was tested against lighttpd 1.4.23. To build CyaSSL for use with
|
||||
lighttpd use the following commands from the CyaSSL install dir <CyaSSLDir>:
|
||||
|
||||
./configure --disable-shared --enable-opensslExtra --enable-fastmath --without-zlib
|
||||
|
||||
make
|
||||
make openssl-links
|
||||
|
||||
Then to build lighttpd with CyaSSL use the following commands from the
|
||||
lighttpd install dir:
|
||||
|
||||
./configure --with-openssl --with-openssl-includes=<CyaSSLDir>/include --with-openssl-libs=<CyaSSLDir>/lib LDFLAGS=-lm
|
||||
|
||||
make
|
||||
|
||||
On some systems you may get a linker error about a duplicate symbol for
|
||||
MD5_Init or other MD5 calls. This seems to be caused by the lighttpd src file
|
||||
md5.c, which defines MD5_Init(), and is included in liblightcomp_la-md5.o.
|
||||
When liblightcomp is linked with the SSL_LIBs the linker may complain about
|
||||
the duplicate symbol. This can be fixed by editing the lighttpd src file md5.c
|
||||
and adding this line to the beginning of the file:
|
||||
|
||||
#if 0
|
||||
|
||||
and this line to the end of the file
|
||||
|
||||
#endif
|
||||
|
||||
Then from the lighttpd src dir do a:
|
||||
|
||||
make clean
|
||||
make
|
||||
|
||||
|
||||
If you get link errors about undefined symbols more than likely the actual
|
||||
OpenSSL libraries are found by the linker before the CyaSSL openssl-links that
|
||||
point to the CyaSSL library, causing the linker confusion. This can be fixed
|
||||
by editing the Makefile in the lighttpd src directory and changing the line:
|
||||
|
||||
SSL_LIB = -lssl -lcrypto
|
||||
|
||||
to
|
||||
|
||||
SSL_LIB = -lcyassl
|
||||
|
||||
Then from the lighttpd src dir do a:
|
||||
|
||||
make clean
|
||||
make
|
||||
|
||||
This should remove any confusion the linker may be having with missing symbols.
|
||||
|
||||
For any questions or concerns please contact support@yassl.com .
|
||||
|
||||
For general build instructions see rc1 below.
|
||||
|
||||
******************CyaSSL Release 1.0.6 (8/03/2009)
|
||||
|
||||
Release 1.0.6 for CyaSSL adds bug fixes, an improved session cache, and faster
|
||||
math with a huge code option.
|
||||
|
||||
The session cache now defaults to a client mode, also good for embedded servers.
|
||||
For servers not under heavy load (less than 200 new sessions per minute), define
|
||||
BIG_SESSION_CACHE. If the server will be under heavy load, define
|
||||
HUGE_SESSION_CACHE.
|
||||
|
||||
There is now a fasthugemath option for configure. This enables fastmath plus
|
||||
even faster math by greatly increasing the code size of the math library. Use
|
||||
the benchmark utility to compare public key operations.
|
||||
|
||||
|
||||
For general build instructions see rc1 below.
|
||||
|
||||
******************CyaSSL Release 1.0.3 (5/10/2009)
|
||||
|
||||
Release 1.0.3 for CyaSSL adds bug fixes and add increased support for OpenSSL
|
||||
compatibility when building other applications.
|
||||
|
||||
Release 1.0.3 includes an alpha release of DTLS for both client and servers.
|
||||
This is only for testing purposes at this time. Rebroadcast and reordering
|
||||
aren't fully implemented at this time but will be for the next release.
|
||||
|
||||
For general build instructions see rc1 below.
|
||||
|
||||
******************CyaSSL Release 1.0.2 (4/3/2009)
|
||||
|
||||
Release 1.0.2 for CyaSSL adds bug fixes for a couple I/O issues. Some systems
|
||||
will send a SIGPIPE on socket recv() at any time and this should be handled by
|
||||
the application by turning off SIGPIPE through setsockopt() or returning from
|
||||
the handler.
|
||||
|
||||
Release 1.0.2 includes an alpha release of DTLS for both client and servers.
|
||||
This is only for testing purposes at this time. Rebroadcast and reordering
|
||||
aren't fully implemented at this time but will be for the next release.
|
||||
|
||||
For general build instructions see rc1 below.
|
||||
|
||||
*****************CyaSSL Release Candidiate 3 rc3-1.0.0 (2/25/2009)
|
||||
|
||||
|
||||
Release Candidate 3 for CyaSSL 1.0.0 adds bug fixes and adds a project file for
|
||||
iPhone development with Xcode. cyassl-iphone.xcodeproj is located in the root
|
||||
directory. This release also includes a fix for supporting other
|
||||
implementations that bundle multiple messages at the record layer, this was
|
||||
lost when cyassl i/o was re-implemented but is now fixed.
|
||||
|
||||
For general build instructions see rc1 below.
|
||||
|
||||
*****************CyaSSL Release Candidiate 2 rc2-1.0.0 (1/21/2009)
|
||||
|
||||
|
||||
Release Candidate 2 for CyaSSL 1.0.0 adds bug fixes and adds two new stream
|
||||
ciphers along with their respective cipher suites. CyaSSL adds support for
|
||||
HC-128 and RABBIT stream ciphers. The new suites are:
|
||||
|
||||
TLS_RSA_WITH_HC_128_CBC_SHA
|
||||
TLS_RSA_WITH_RABBIT_CBC_SHA
|
||||
|
||||
And the corresponding cipher names are
|
||||
|
||||
HC128-SHA
|
||||
RABBIT-SHA
|
||||
|
||||
CyaSSL also adds support for building with devkitPro for PPC by changing the
|
||||
library proper to use libogc. The examples haven't been changed yet but if
|
||||
there's interest they can be. Here's an example ./configure to build CyaSSL
|
||||
for devkitPro:
|
||||
|
||||
./configure --disable-shared CC=/pathTo/devkitpro/devkitPPC/bin/powerpc-gekko-gcc --host=ppc --without-zlib --enable-singleThreaded RANLIB=/pathTo/devkitpro/devkitPPC/bin/powerpc-gekko-ranlib CFLAGS="-DDEVKITPRO -DGEKKO"
|
||||
|
||||
For linking purposes you'll need
|
||||
|
||||
LDFLAGS="-g -mrvl -mcpu=750 -meabi -mhard-float -Wl,-Map,$(notdir $@).map"
|
||||
|
||||
For general build instructions see rc1 below.
|
||||
|
||||
|
||||
********************CyaSSL Release Candidiate 1 rc1-1.0.0 (12/17/2008)
|
||||
|
||||
|
||||
Release Candidate 1 for CyaSSL 1.0.0 contains major internal changes. Several
|
||||
areas have optimization improvements, less dynamic memory use, and the I/O
|
||||
strategy has been refactored to allow alternate I/O handling or Library use.
|
||||
Many thanks to Thierry Fournier for providing these ideas and most of the work.
|
||||
|
||||
Because of these changes, this release is only a candidate since some problems
|
||||
are probably inevitable on some platform with some I/O use. Please report any
|
||||
problems and we'll try to resolve them as soon as possible. You can contact us
|
||||
at support@yassl.com or todd@yassl.com.
|
||||
|
||||
Using TomsFastMath by passing --enable-fastmath to ./configure now uses assembly
|
||||
on some platforms. This is new so please report any problems as every compiler,
|
||||
mode, OS combination hasn't been tested. On ia32 all of the registers need to
|
||||
be available so be sure to pass these options to CFLAGS:
|
||||
|
||||
CFLAGS="-O3 -fomit-frame-pointer"
|
||||
|
||||
OS X will also need -mdynamic-no-pic added to CFLAGS
|
||||
|
||||
Also if you're building in shared mode for ia32 you'll need to pass options to
|
||||
LDFLAGS as well on OS X:
|
||||
|
||||
LDFLAGS=-Wl,-read_only_relocs,warning
|
||||
|
||||
This gives warnings for some symbols but seems to work.
|
||||
|
||||
|
||||
--To build on Linux, Solaris, *BSD, Mac OS X, or Cygwin:
|
||||
|
||||
./configure
|
||||
make
|
||||
|
||||
from the ./testsuite/ directory run ./testsuite
|
||||
|
||||
to make a debug build:
|
||||
|
||||
./configure --enable-debug --disable-shared
|
||||
make
|
||||
|
||||
|
||||
|
||||
--To build on Win32
|
||||
|
||||
Choose (Re)Build All from the project workspace
|
||||
|
||||
Run the testsuite program
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
*************************CyaSSL version 0.9.9 (7/25/2008)
|
||||
|
||||
This release of CyaSSL adds bug fixes, Pre-Shared Keys, over-rideable memory
|
||||
handling, and optionally TomsFastMath. Thanks to Moisés Guimarães for the
|
||||
work on TomsFastMath.
|
||||
|
||||
To optionally use TomsFastMath pass --enable-fastmath to ./configure
|
||||
Or define USE_FAST_MATH in each project from CyaSSL for MSVC.
|
||||
|
||||
Please use the benchmark routine before and after to see the performance
|
||||
difference, on some platforms the gains will be little but RSA encryption
|
||||
always seems to be faster. On x86-64 machines with GCC the normal math library
|
||||
may outperform the fast one when using CFLAGS=-m64 because TomsFastMath can't
|
||||
yet use -m64 because of GCCs inability to do 128bit division.
|
||||
|
||||
**** UPDATE GCC 4.2.1 can now do 128bit division ***
|
||||
|
||||
See notes below (0.2.0) for complete build instructions.
|
||||
|
||||
|
||||
****************CyaSSL version 0.9.8 (5/7/2008)
|
||||
|
||||
This release of CyaSSL adds bug fixes, client side Diffie-Hellman, and better
|
||||
socket handling.
|
||||
|
||||
See notes below (0.2.0) for complete build instructions.
|
||||
|
||||
|
||||
****************CyaSSL version 0.9.6 (1/31/2008)
|
||||
|
||||
This release of CyaSSL adds bug fixes, increased session management, and a fix
|
||||
for gnutls.
|
||||
|
||||
See notes below (0.2.0) for complete build instructions.
|
||||
|
||||
|
||||
****************CyaSSL version 0.9.0 (10/15/2007)
|
||||
|
||||
This release of CyaSSL adds bug fixes, MSVC 2005 support, GCC 4.2 support,
|
||||
IPV6 support and test, and new test certificates.
|
||||
|
||||
See notes below (0.2.0) for complete build instructions.
|
||||
|
||||
|
||||
****************CyaSSL version 0.8.0 (1/10/2007)
|
||||
|
||||
This release of CyaSSL adds increased socket support, for non-blocking writes,
|
||||
connects, and interrupted system calls.
|
||||
|
||||
See notes below (0.2.0) for complete build instructions.
|
||||
|
||||
|
||||
****************CyaSSL version 0.6.3 (10/30/2006)
|
||||
|
||||
This release of CyaSSL adds debug logging to stderr to aid in the debugging of
|
||||
CyaSSL on systems that may not provide the best support.
|
||||
|
||||
If CyaSSL is built with debugging support then you need to call
|
||||
CyaSSL_Debugging_ON() to turn logging on.
|
||||
|
||||
On Unix use ./configure --enable-debug
|
||||
|
||||
On Windows define DEBUG_CYASSL when building CyaSSL
|
||||
|
||||
|
||||
To turn logging back off call CyaSSL_Debugging_OFF()
|
||||
|
||||
See notes below (0.2.0) for complete build instructions.
|
||||
|
||||
|
||||
*****************CyaSSL version 0.6.2 (10/29/2006)
|
||||
|
||||
This release of CyaSSL adds TLS 1.1.
|
||||
|
||||
Note that CyaSSL has certificate verification on by default, unlike OpenSSL.
|
||||
To emulate OpenSSL behavior, you must call SSL_CTX_set_verify() with
|
||||
SSL_VERIFY_NONE. In order to have full security you should never do this,
|
||||
provide CyaSSL with the proper certificates to eliminate impostors and call
|
||||
CyaSSL_check_domain_name() to prevent man in the middle attacks.
|
||||
|
||||
See notes below (0.2.0) for build instructions.
|
||||
|
||||
*****************CyaSSL version 0.6.0 (10/25/2006)
|
||||
|
||||
This release of CyaSSL adds more SSL functions, better autoconf, nonblocking
|
||||
I/O for accept, connect, and read. There is now an --enable-small configure
|
||||
option that turns off TLS, AES, DES3, HMAC, and ERROR_STRINGS, see configure.in
|
||||
for the defines. Note that TLS requires HMAC and AES requires TLS.
|
||||
|
||||
See notes below (0.2.0) for build instructions.
|
||||
|
||||
|
||||
*****************CyaSSL version 0.5.5 (09/27/2006)
|
||||
|
||||
This mini release of CyaSSL adds better input processing through buffered input
|
||||
and big message support. Added SSL_pending() and some sanity checks on user
|
||||
settings.
|
||||
|
||||
See notes below (0.2.0) for build instructions.
|
||||
|
||||
|
||||
*****************CyaSSL version 0.5.0 (03/27/2006)
|
||||
|
||||
This release of CyaSSL adds AES support and minor bug fixes.
|
||||
|
||||
See notes below (0.2.0) for build instructions.
|
||||
|
||||
|
||||
*****************CyaSSL version 0.4.0 (03/15/2006)
|
||||
|
||||
This release of CyaSSL adds TLSv1 client/server support and libtool.
|
||||
|
||||
See notes below for build instructions.
|
||||
|
||||
|
||||
*****************CyaSSL version 0.3.0 (02/26/2006)
|
||||
|
||||
This release of CyaSSL adds SSLv3 server support and session resumption.
|
||||
|
||||
See notes below for build instructions.
|
||||
|
||||
|
||||
*****************CyaSSL version 0.2.0 (02/19/2006)
|
||||
|
||||
|
||||
This is the first release of CyaSSL and its crypt brother, CTaoCrypt. CyaSSL
|
||||
is written in ANSI C with the idea of a small code size, footprint, and memory
|
||||
usage in mind. CTaoCrypt can be as small as 32K, and the current client
|
||||
version of CyaSSL can be as small as 12K.
|
||||
|
||||
|
||||
The first release of CTaoCrypt supports MD5, SHA-1, 3DES, ARC4, Big Integer
|
||||
Support, RSA, ASN parsing, and basic x509 (en/de)coding.
|
||||
|
||||
The first release of CyaSSL supports normal client RSA mode SSLv3 connections
|
||||
with support for SHA-1 and MD5 digests. Ciphers include 3DES and RC4.
|
||||
|
||||
|
||||
--To build on Linux, Solaris, *BSD, Mac OS X, or Cygwin:
|
||||
|
||||
./configure
|
||||
make
|
||||
|
||||
from the ./testsuite/ directory run ./testsuite
|
||||
|
||||
to make a debug build:
|
||||
|
||||
./configure --enable-debug --disable-shared
|
||||
make
|
||||
|
||||
|
||||
|
||||
--To build on Win32
|
||||
|
||||
Choose (Re)Build All from the project workspace
|
||||
|
||||
Run the testsuite program
|
||||
|
||||
|
||||
|
||||
*** The next release of CyaSSL will support a server and more OpenSSL
|
||||
compatibility functions.
|
||||
|
||||
|
||||
Please send questions or comments to todd@yassl.com
|
||||
|
||||
944
FreeRTOS-Plus/CyaSSL/aclocal.m4
vendored
944
FreeRTOS-Plus/CyaSSL/aclocal.m4
vendored
@@ -1,944 +0,0 @@
|
||||
# generated automatically by aclocal 1.10 -*- Autoconf -*-
|
||||
|
||||
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
|
||||
# 2005, 2006 Free Software Foundation, Inc.
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
|
||||
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
# PARTICULAR PURPOSE.
|
||||
|
||||
m4_if(m4_PACKAGE_VERSION, [2.61],,
|
||||
[m4_fatal([this file was generated for autoconf 2.61.
|
||||
You have another version of autoconf. If you want to use that,
|
||||
you should regenerate the build system entirely.], [63])])
|
||||
|
||||
# Copyright (C) 2002, 2003, 2005, 2006 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# AM_AUTOMAKE_VERSION(VERSION)
|
||||
# ----------------------------
|
||||
# Automake X.Y traces this macro to ensure aclocal.m4 has been
|
||||
# generated from the m4 files accompanying Automake X.Y.
|
||||
# (This private macro should not be called outside this file.)
|
||||
AC_DEFUN([AM_AUTOMAKE_VERSION],
|
||||
[am__api_version='1.10'
|
||||
dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
|
||||
dnl require some minimum version. Point them to the right macro.
|
||||
m4_if([$1], [1.10], [],
|
||||
[AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
|
||||
])
|
||||
|
||||
# _AM_AUTOCONF_VERSION(VERSION)
|
||||
# -----------------------------
|
||||
# aclocal traces this macro to find the Autoconf version.
|
||||
# This is a private macro too. Using m4_define simplifies
|
||||
# the logic in aclocal, which can simply ignore this definition.
|
||||
m4_define([_AM_AUTOCONF_VERSION], [])
|
||||
|
||||
# AM_SET_CURRENT_AUTOMAKE_VERSION
|
||||
# -------------------------------
|
||||
# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
|
||||
# This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
|
||||
AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
|
||||
[AM_AUTOMAKE_VERSION([1.10])dnl
|
||||
_AM_AUTOCONF_VERSION(m4_PACKAGE_VERSION)])
|
||||
|
||||
# Figure out how to run the assembler. -*- Autoconf -*-
|
||||
|
||||
# Copyright (C) 2001, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# serial 5
|
||||
|
||||
# AM_PROG_AS
|
||||
# ----------
|
||||
AC_DEFUN([AM_PROG_AS],
|
||||
[# By default we simply use the C compiler to build assembly code.
|
||||
AC_REQUIRE([AC_PROG_CC])
|
||||
test "${CCAS+set}" = set || CCAS=$CC
|
||||
test "${CCASFLAGS+set}" = set || CCASFLAGS=$CFLAGS
|
||||
AC_ARG_VAR([CCAS], [assembler compiler command (defaults to CC)])
|
||||
AC_ARG_VAR([CCASFLAGS], [assembler compiler flags (defaults to CFLAGS)])
|
||||
_AM_IF_OPTION([no-dependencies],, [_AM_DEPENDENCIES([CCAS])])dnl
|
||||
])
|
||||
|
||||
# AM_AUX_DIR_EXPAND -*- Autoconf -*-
|
||||
|
||||
# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
|
||||
# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to
|
||||
# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
|
||||
#
|
||||
# Of course, Automake must honor this variable whenever it calls a
|
||||
# tool from the auxiliary directory. The problem is that $srcdir (and
|
||||
# therefore $ac_aux_dir as well) can be either absolute or relative,
|
||||
# depending on how configure is run. This is pretty annoying, since
|
||||
# it makes $ac_aux_dir quite unusable in subdirectories: in the top
|
||||
# source directory, any form will work fine, but in subdirectories a
|
||||
# relative path needs to be adjusted first.
|
||||
#
|
||||
# $ac_aux_dir/missing
|
||||
# fails when called from a subdirectory if $ac_aux_dir is relative
|
||||
# $top_srcdir/$ac_aux_dir/missing
|
||||
# fails if $ac_aux_dir is absolute,
|
||||
# fails when called from a subdirectory in a VPATH build with
|
||||
# a relative $ac_aux_dir
|
||||
#
|
||||
# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
|
||||
# are both prefixed by $srcdir. In an in-source build this is usually
|
||||
# harmless because $srcdir is `.', but things will broke when you
|
||||
# start a VPATH build or use an absolute $srcdir.
|
||||
#
|
||||
# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
|
||||
# iff we strip the leading $srcdir from $ac_aux_dir. That would be:
|
||||
# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
|
||||
# and then we would define $MISSING as
|
||||
# MISSING="\${SHELL} $am_aux_dir/missing"
|
||||
# This will work as long as MISSING is not called from configure, because
|
||||
# unfortunately $(top_srcdir) has no meaning in configure.
|
||||
# However there are other variables, like CC, which are often used in
|
||||
# configure, and could therefore not use this "fixed" $ac_aux_dir.
|
||||
#
|
||||
# Another solution, used here, is to always expand $ac_aux_dir to an
|
||||
# absolute PATH. The drawback is that using absolute paths prevent a
|
||||
# configured tree to be moved without reconfiguration.
|
||||
|
||||
AC_DEFUN([AM_AUX_DIR_EXPAND],
|
||||
[dnl Rely on autoconf to set up CDPATH properly.
|
||||
AC_PREREQ([2.50])dnl
|
||||
# expand $ac_aux_dir to an absolute path
|
||||
am_aux_dir=`cd $ac_aux_dir && pwd`
|
||||
])
|
||||
|
||||
# AM_CONDITIONAL -*- Autoconf -*-
|
||||
|
||||
# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006
|
||||
# Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# serial 8
|
||||
|
||||
# AM_CONDITIONAL(NAME, SHELL-CONDITION)
|
||||
# -------------------------------------
|
||||
# Define a conditional.
|
||||
AC_DEFUN([AM_CONDITIONAL],
|
||||
[AC_PREREQ(2.52)dnl
|
||||
ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])],
|
||||
[$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
|
||||
AC_SUBST([$1_TRUE])dnl
|
||||
AC_SUBST([$1_FALSE])dnl
|
||||
_AM_SUBST_NOTMAKE([$1_TRUE])dnl
|
||||
_AM_SUBST_NOTMAKE([$1_FALSE])dnl
|
||||
if $2; then
|
||||
$1_TRUE=
|
||||
$1_FALSE='#'
|
||||
else
|
||||
$1_TRUE='#'
|
||||
$1_FALSE=
|
||||
fi
|
||||
AC_CONFIG_COMMANDS_PRE(
|
||||
[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
|
||||
AC_MSG_ERROR([[conditional "$1" was never defined.
|
||||
Usually this means the macro was only invoked conditionally.]])
|
||||
fi])])
|
||||
|
||||
# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
|
||||
# Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# serial 9
|
||||
|
||||
# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
|
||||
# written in clear, in which case automake, when reading aclocal.m4,
|
||||
# will think it sees a *use*, and therefore will trigger all it's
|
||||
# C support machinery. Also note that it means that autoscan, seeing
|
||||
# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
|
||||
|
||||
|
||||
# _AM_DEPENDENCIES(NAME)
|
||||
# ----------------------
|
||||
# See how the compiler implements dependency checking.
|
||||
# NAME is "CC", "CXX", "GCJ", or "OBJC".
|
||||
# We try a few techniques and use that to set a single cache variable.
|
||||
#
|
||||
# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
|
||||
# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
|
||||
# dependency, and given that the user is not expected to run this macro,
|
||||
# just rely on AC_PROG_CC.
|
||||
AC_DEFUN([_AM_DEPENDENCIES],
|
||||
[AC_REQUIRE([AM_SET_DEPDIR])dnl
|
||||
AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
|
||||
AC_REQUIRE([AM_MAKE_INCLUDE])dnl
|
||||
AC_REQUIRE([AM_DEP_TRACK])dnl
|
||||
|
||||
ifelse([$1], CC, [depcc="$CC" am_compiler_list=],
|
||||
[$1], CXX, [depcc="$CXX" am_compiler_list=],
|
||||
[$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
|
||||
[$1], UPC, [depcc="$UPC" am_compiler_list=],
|
||||
[$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'],
|
||||
[depcc="$$1" am_compiler_list=])
|
||||
|
||||
AC_CACHE_CHECK([dependency style of $depcc],
|
||||
[am_cv_$1_dependencies_compiler_type],
|
||||
[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
|
||||
# We make a subdir and do the tests there. Otherwise we can end up
|
||||
# making bogus files that we don't know about and never remove. For
|
||||
# instance it was reported that on HP-UX the gcc test will end up
|
||||
# making a dummy file named `D' -- because `-MD' means `put the output
|
||||
# in D'.
|
||||
mkdir conftest.dir
|
||||
# Copy depcomp to subdir because otherwise we won't find it if we're
|
||||
# using a relative directory.
|
||||
cp "$am_depcomp" conftest.dir
|
||||
cd conftest.dir
|
||||
# We will build objects and dependencies in a subdirectory because
|
||||
# it helps to detect inapplicable dependency modes. For instance
|
||||
# both Tru64's cc and ICC support -MD to output dependencies as a
|
||||
# side effect of compilation, but ICC will put the dependencies in
|
||||
# the current directory while Tru64 will put them in the object
|
||||
# directory.
|
||||
mkdir sub
|
||||
|
||||
am_cv_$1_dependencies_compiler_type=none
|
||||
if test "$am_compiler_list" = ""; then
|
||||
am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
|
||||
fi
|
||||
for depmode in $am_compiler_list; do
|
||||
# Setup a source with many dependencies, because some compilers
|
||||
# like to wrap large dependency lists on column 80 (with \), and
|
||||
# we should not choose a depcomp mode which is confused by this.
|
||||
#
|
||||
# We need to recreate these files for each test, as the compiler may
|
||||
# overwrite some of them when testing with obscure command lines.
|
||||
# This happens at least with the AIX C compiler.
|
||||
: > sub/conftest.c
|
||||
for i in 1 2 3 4 5 6; do
|
||||
echo '#include "conftst'$i'.h"' >> sub/conftest.c
|
||||
# Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
|
||||
# Solaris 8's {/usr,}/bin/sh.
|
||||
touch sub/conftst$i.h
|
||||
done
|
||||
echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
|
||||
|
||||
case $depmode in
|
||||
nosideeffect)
|
||||
# after this tag, mechanisms are not by side-effect, so they'll
|
||||
# only be used when explicitly requested
|
||||
if test "x$enable_dependency_tracking" = xyes; then
|
||||
continue
|
||||
else
|
||||
break
|
||||
fi
|
||||
;;
|
||||
none) break ;;
|
||||
esac
|
||||
# We check with `-c' and `-o' for the sake of the "dashmstdout"
|
||||
# mode. It turns out that the SunPro C++ compiler does not properly
|
||||
# handle `-M -o', and we need to detect this.
|
||||
if depmode=$depmode \
|
||||
source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
|
||||
depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
|
||||
$SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
|
||||
>/dev/null 2>conftest.err &&
|
||||
grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
|
||||
grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
|
||||
grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
|
||||
${MAKE-make} -s -f confmf > /dev/null 2>&1; then
|
||||
# icc doesn't choke on unknown options, it will just issue warnings
|
||||
# or remarks (even with -Werror). So we grep stderr for any message
|
||||
# that says an option was ignored or not supported.
|
||||
# When given -MP, icc 7.0 and 7.1 complain thusly:
|
||||
# icc: Command line warning: ignoring option '-M'; no argument required
|
||||
# The diagnosis changed in icc 8.0:
|
||||
# icc: Command line remark: option '-MP' not supported
|
||||
if (grep 'ignoring option' conftest.err ||
|
||||
grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
|
||||
am_cv_$1_dependencies_compiler_type=$depmode
|
||||
break
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
cd ..
|
||||
rm -rf conftest.dir
|
||||
else
|
||||
am_cv_$1_dependencies_compiler_type=none
|
||||
fi
|
||||
])
|
||||
AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
|
||||
AM_CONDITIONAL([am__fastdep$1], [
|
||||
test "x$enable_dependency_tracking" != xno \
|
||||
&& test "$am_cv_$1_dependencies_compiler_type" = gcc3])
|
||||
])
|
||||
|
||||
|
||||
# AM_SET_DEPDIR
|
||||
# -------------
|
||||
# Choose a directory name for dependency files.
|
||||
# This macro is AC_REQUIREd in _AM_DEPENDENCIES
|
||||
AC_DEFUN([AM_SET_DEPDIR],
|
||||
[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
|
||||
AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
|
||||
])
|
||||
|
||||
|
||||
# AM_DEP_TRACK
|
||||
# ------------
|
||||
AC_DEFUN([AM_DEP_TRACK],
|
||||
[AC_ARG_ENABLE(dependency-tracking,
|
||||
[ --disable-dependency-tracking speeds up one-time build
|
||||
--enable-dependency-tracking do not reject slow dependency extractors])
|
||||
if test "x$enable_dependency_tracking" != xno; then
|
||||
am_depcomp="$ac_aux_dir/depcomp"
|
||||
AMDEPBACKSLASH='\'
|
||||
fi
|
||||
AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
|
||||
AC_SUBST([AMDEPBACKSLASH])dnl
|
||||
_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
|
||||
])
|
||||
|
||||
# Generate code to set up dependency tracking. -*- Autoconf -*-
|
||||
|
||||
# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
|
||||
# Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
#serial 3
|
||||
|
||||
# _AM_OUTPUT_DEPENDENCY_COMMANDS
|
||||
# ------------------------------
|
||||
AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
|
||||
[for mf in $CONFIG_FILES; do
|
||||
# Strip MF so we end up with the name of the file.
|
||||
mf=`echo "$mf" | sed -e 's/:.*$//'`
|
||||
# Check whether this is an Automake generated Makefile or not.
|
||||
# We used to match only the files named `Makefile.in', but
|
||||
# some people rename them; so instead we look at the file content.
|
||||
# Grep'ing the first line is not enough: some people post-process
|
||||
# each Makefile.in and add a new line on top of each file to say so.
|
||||
# Grep'ing the whole file is not good either: AIX grep has a line
|
||||
# limit of 2048, but all sed's we know have understand at least 4000.
|
||||
if sed 10q "$mf" | grep '^#.*generated by automake' > /dev/null 2>&1; then
|
||||
dirpart=`AS_DIRNAME("$mf")`
|
||||
else
|
||||
continue
|
||||
fi
|
||||
# Extract the definition of DEPDIR, am__include, and am__quote
|
||||
# from the Makefile without running `make'.
|
||||
DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
|
||||
test -z "$DEPDIR" && continue
|
||||
am__include=`sed -n 's/^am__include = //p' < "$mf"`
|
||||
test -z "am__include" && continue
|
||||
am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
|
||||
# When using ansi2knr, U may be empty or an underscore; expand it
|
||||
U=`sed -n 's/^U = //p' < "$mf"`
|
||||
# Find all dependency output files, they are included files with
|
||||
# $(DEPDIR) in their names. We invoke sed twice because it is the
|
||||
# simplest approach to changing $(DEPDIR) to its actual value in the
|
||||
# expansion.
|
||||
for file in `sed -n "
|
||||
s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
|
||||
sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
|
||||
# Make sure the directory exists.
|
||||
test -f "$dirpart/$file" && continue
|
||||
fdir=`AS_DIRNAME(["$file"])`
|
||||
AS_MKDIR_P([$dirpart/$fdir])
|
||||
# echo "creating $dirpart/$file"
|
||||
echo '# dummy' > "$dirpart/$file"
|
||||
done
|
||||
done
|
||||
])# _AM_OUTPUT_DEPENDENCY_COMMANDS
|
||||
|
||||
|
||||
# AM_OUTPUT_DEPENDENCY_COMMANDS
|
||||
# -----------------------------
|
||||
# This macro should only be invoked once -- use via AC_REQUIRE.
|
||||
#
|
||||
# This code is only required when automatic dependency tracking
|
||||
# is enabled. FIXME. This creates each `.P' file that we will
|
||||
# need in order to bootstrap the dependency handling code.
|
||||
AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
|
||||
[AC_CONFIG_COMMANDS([depfiles],
|
||||
[test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
|
||||
[AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
|
||||
])
|
||||
|
||||
# Do all the work for Automake. -*- Autoconf -*-
|
||||
|
||||
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
|
||||
# 2005, 2006 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# serial 12
|
||||
|
||||
# This macro actually does too much. Some checks are only needed if
|
||||
# your package does certain things. But this isn't really a big deal.
|
||||
|
||||
# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
|
||||
# AM_INIT_AUTOMAKE([OPTIONS])
|
||||
# -----------------------------------------------
|
||||
# The call with PACKAGE and VERSION arguments is the old style
|
||||
# call (pre autoconf-2.50), which is being phased out. PACKAGE
|
||||
# and VERSION should now be passed to AC_INIT and removed from
|
||||
# the call to AM_INIT_AUTOMAKE.
|
||||
# We support both call styles for the transition. After
|
||||
# the next Automake release, Autoconf can make the AC_INIT
|
||||
# arguments mandatory, and then we can depend on a new Autoconf
|
||||
# release and drop the old call support.
|
||||
AC_DEFUN([AM_INIT_AUTOMAKE],
|
||||
[AC_PREREQ([2.60])dnl
|
||||
dnl Autoconf wants to disallow AM_ names. We explicitly allow
|
||||
dnl the ones we care about.
|
||||
m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
|
||||
AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
|
||||
AC_REQUIRE([AC_PROG_INSTALL])dnl
|
||||
if test "`cd $srcdir && pwd`" != "`pwd`"; then
|
||||
# Use -I$(srcdir) only when $(srcdir) != ., so that make's output
|
||||
# is not polluted with repeated "-I."
|
||||
AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
|
||||
# test to see if srcdir already configured
|
||||
if test -f $srcdir/config.status; then
|
||||
AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
|
||||
fi
|
||||
fi
|
||||
|
||||
# test whether we have cygpath
|
||||
if test -z "$CYGPATH_W"; then
|
||||
if (cygpath --version) >/dev/null 2>/dev/null; then
|
||||
CYGPATH_W='cygpath -w'
|
||||
else
|
||||
CYGPATH_W=echo
|
||||
fi
|
||||
fi
|
||||
AC_SUBST([CYGPATH_W])
|
||||
|
||||
# Define the identity of the package.
|
||||
dnl Distinguish between old-style and new-style calls.
|
||||
m4_ifval([$2],
|
||||
[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
|
||||
AC_SUBST([PACKAGE], [$1])dnl
|
||||
AC_SUBST([VERSION], [$2])],
|
||||
[_AM_SET_OPTIONS([$1])dnl
|
||||
dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
|
||||
m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
|
||||
[m4_fatal([AC_INIT should be called with package and version arguments])])dnl
|
||||
AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
|
||||
AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
|
||||
|
||||
_AM_IF_OPTION([no-define],,
|
||||
[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
|
||||
AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
|
||||
|
||||
# Some tools Automake needs.
|
||||
AC_REQUIRE([AM_SANITY_CHECK])dnl
|
||||
AC_REQUIRE([AC_ARG_PROGRAM])dnl
|
||||
AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
|
||||
AM_MISSING_PROG(AUTOCONF, autoconf)
|
||||
AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
|
||||
AM_MISSING_PROG(AUTOHEADER, autoheader)
|
||||
AM_MISSING_PROG(MAKEINFO, makeinfo)
|
||||
AM_PROG_INSTALL_SH
|
||||
AM_PROG_INSTALL_STRIP
|
||||
AC_REQUIRE([AM_PROG_MKDIR_P])dnl
|
||||
# We need awk for the "check" target. The system "awk" is bad on
|
||||
# some platforms.
|
||||
AC_REQUIRE([AC_PROG_AWK])dnl
|
||||
AC_REQUIRE([AC_PROG_MAKE_SET])dnl
|
||||
AC_REQUIRE([AM_SET_LEADING_DOT])dnl
|
||||
_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
|
||||
[_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
|
||||
[_AM_PROG_TAR([v7])])])
|
||||
_AM_IF_OPTION([no-dependencies],,
|
||||
[AC_PROVIDE_IFELSE([AC_PROG_CC],
|
||||
[_AM_DEPENDENCIES(CC)],
|
||||
[define([AC_PROG_CC],
|
||||
defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
|
||||
AC_PROVIDE_IFELSE([AC_PROG_CXX],
|
||||
[_AM_DEPENDENCIES(CXX)],
|
||||
[define([AC_PROG_CXX],
|
||||
defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
|
||||
AC_PROVIDE_IFELSE([AC_PROG_OBJC],
|
||||
[_AM_DEPENDENCIES(OBJC)],
|
||||
[define([AC_PROG_OBJC],
|
||||
defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
|
||||
])
|
||||
])
|
||||
|
||||
|
||||
# When config.status generates a header, we must update the stamp-h file.
|
||||
# This file resides in the same directory as the config header
|
||||
# that is generated. The stamp files are numbered to have different names.
|
||||
|
||||
# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
|
||||
# loop where config.status creates the headers, so we can generate
|
||||
# our stamp files there.
|
||||
AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
|
||||
[# Compute $1's index in $config_headers.
|
||||
_am_stamp_count=1
|
||||
for _am_header in $config_headers :; do
|
||||
case $_am_header in
|
||||
$1 | $1:* )
|
||||
break ;;
|
||||
* )
|
||||
_am_stamp_count=`expr $_am_stamp_count + 1` ;;
|
||||
esac
|
||||
done
|
||||
echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count])
|
||||
|
||||
# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# AM_PROG_INSTALL_SH
|
||||
# ------------------
|
||||
# Define $install_sh.
|
||||
AC_DEFUN([AM_PROG_INSTALL_SH],
|
||||
[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
|
||||
install_sh=${install_sh-"\$(SHELL) $am_aux_dir/install-sh"}
|
||||
AC_SUBST(install_sh)])
|
||||
|
||||
# Copyright (C) 2003, 2005 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# serial 2
|
||||
|
||||
# Check whether the underlying file-system supports filenames
|
||||
# with a leading dot. For instance MS-DOS doesn't.
|
||||
AC_DEFUN([AM_SET_LEADING_DOT],
|
||||
[rm -rf .tst 2>/dev/null
|
||||
mkdir .tst 2>/dev/null
|
||||
if test -d .tst; then
|
||||
am__leading_dot=.
|
||||
else
|
||||
am__leading_dot=_
|
||||
fi
|
||||
rmdir .tst 2>/dev/null
|
||||
AC_SUBST([am__leading_dot])])
|
||||
|
||||
# Check to see how 'make' treats includes. -*- Autoconf -*-
|
||||
|
||||
# Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# serial 3
|
||||
|
||||
# AM_MAKE_INCLUDE()
|
||||
# -----------------
|
||||
# Check to see how make treats includes.
|
||||
AC_DEFUN([AM_MAKE_INCLUDE],
|
||||
[am_make=${MAKE-make}
|
||||
cat > confinc << 'END'
|
||||
am__doit:
|
||||
@echo done
|
||||
.PHONY: am__doit
|
||||
END
|
||||
# If we don't find an include directive, just comment out the code.
|
||||
AC_MSG_CHECKING([for style of include used by $am_make])
|
||||
am__include="#"
|
||||
am__quote=
|
||||
_am_result=none
|
||||
# First try GNU make style include.
|
||||
echo "include confinc" > confmf
|
||||
# We grep out `Entering directory' and `Leaving directory'
|
||||
# messages which can occur if `w' ends up in MAKEFLAGS.
|
||||
# In particular we don't look at `^make:' because GNU make might
|
||||
# be invoked under some other name (usually "gmake"), in which
|
||||
# case it prints its new name instead of `make'.
|
||||
if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
|
||||
am__include=include
|
||||
am__quote=
|
||||
_am_result=GNU
|
||||
fi
|
||||
# Now try BSD make style include.
|
||||
if test "$am__include" = "#"; then
|
||||
echo '.include "confinc"' > confmf
|
||||
if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
|
||||
am__include=.include
|
||||
am__quote="\""
|
||||
_am_result=BSD
|
||||
fi
|
||||
fi
|
||||
AC_SUBST([am__include])
|
||||
AC_SUBST([am__quote])
|
||||
AC_MSG_RESULT([$_am_result])
|
||||
rm -f confinc confmf
|
||||
])
|
||||
|
||||
# Copyright (C) 1999, 2000, 2001, 2003, 2004, 2005
|
||||
# Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# serial 5
|
||||
|
||||
# AM_PROG_CC_C_O
|
||||
# --------------
|
||||
# Like AC_PROG_CC_C_O, but changed for automake.
|
||||
AC_DEFUN([AM_PROG_CC_C_O],
|
||||
[AC_REQUIRE([AC_PROG_CC_C_O])dnl
|
||||
AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
|
||||
AC_REQUIRE_AUX_FILE([compile])dnl
|
||||
# FIXME: we rely on the cache variable name because
|
||||
# there is no other way.
|
||||
set dummy $CC
|
||||
ac_cc=`echo $[2] | sed ['s/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/']`
|
||||
if eval "test \"`echo '$ac_cv_prog_cc_'${ac_cc}_c_o`\" != yes"; then
|
||||
# Losing compiler, so override with the script.
|
||||
# FIXME: It is wrong to rewrite CC.
|
||||
# But if we don't then we get into trouble of one sort or another.
|
||||
# A longer-term fix would be to have automake use am__CC in this case,
|
||||
# and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
|
||||
CC="$am_aux_dir/compile $CC"
|
||||
fi
|
||||
dnl Make sure AC_PROG_CC is never called again, or it will override our
|
||||
dnl setting of CC.
|
||||
m4_define([AC_PROG_CC],
|
||||
[m4_fatal([AC_PROG_CC cannot be called after AM_PROG_CC_C_O])])
|
||||
])
|
||||
|
||||
# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-
|
||||
|
||||
# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005
|
||||
# Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# serial 5
|
||||
|
||||
# AM_MISSING_PROG(NAME, PROGRAM)
|
||||
# ------------------------------
|
||||
AC_DEFUN([AM_MISSING_PROG],
|
||||
[AC_REQUIRE([AM_MISSING_HAS_RUN])
|
||||
$1=${$1-"${am_missing_run}$2"}
|
||||
AC_SUBST($1)])
|
||||
|
||||
|
||||
# AM_MISSING_HAS_RUN
|
||||
# ------------------
|
||||
# Define MISSING if not defined so far and test if it supports --run.
|
||||
# If it does, set am_missing_run to use it, otherwise, to nothing.
|
||||
AC_DEFUN([AM_MISSING_HAS_RUN],
|
||||
[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
|
||||
AC_REQUIRE_AUX_FILE([missing])dnl
|
||||
test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
|
||||
# Use eval to expand $SHELL
|
||||
if eval "$MISSING --run true"; then
|
||||
am_missing_run="$MISSING --run "
|
||||
else
|
||||
am_missing_run=
|
||||
AC_MSG_WARN([`missing' script is too old or missing])
|
||||
fi
|
||||
])
|
||||
|
||||
# Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# AM_PROG_MKDIR_P
|
||||
# ---------------
|
||||
# Check for `mkdir -p'.
|
||||
AC_DEFUN([AM_PROG_MKDIR_P],
|
||||
[AC_PREREQ([2.60])dnl
|
||||
AC_REQUIRE([AC_PROG_MKDIR_P])dnl
|
||||
dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P,
|
||||
dnl while keeping a definition of mkdir_p for backward compatibility.
|
||||
dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
|
||||
dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
|
||||
dnl Makefile.ins that do not define MKDIR_P, so we do our own
|
||||
dnl adjustment using top_builddir (which is defined more often than
|
||||
dnl MKDIR_P).
|
||||
AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
|
||||
case $mkdir_p in
|
||||
[[\\/$]]* | ?:[[\\/]]*) ;;
|
||||
*/*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
|
||||
esac
|
||||
])
|
||||
|
||||
# Helper functions for option handling. -*- Autoconf -*-
|
||||
|
||||
# Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# serial 3
|
||||
|
||||
# _AM_MANGLE_OPTION(NAME)
|
||||
# -----------------------
|
||||
AC_DEFUN([_AM_MANGLE_OPTION],
|
||||
[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
|
||||
|
||||
# _AM_SET_OPTION(NAME)
|
||||
# ------------------------------
|
||||
# Set option NAME. Presently that only means defining a flag for this option.
|
||||
AC_DEFUN([_AM_SET_OPTION],
|
||||
[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
|
||||
|
||||
# _AM_SET_OPTIONS(OPTIONS)
|
||||
# ----------------------------------
|
||||
# OPTIONS is a space-separated list of Automake options.
|
||||
AC_DEFUN([_AM_SET_OPTIONS],
|
||||
[AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
|
||||
|
||||
# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
|
||||
# -------------------------------------------
|
||||
# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
|
||||
AC_DEFUN([_AM_IF_OPTION],
|
||||
[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
|
||||
|
||||
# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# AM_RUN_LOG(COMMAND)
|
||||
# -------------------
|
||||
# Run COMMAND, save the exit status in ac_status, and log it.
|
||||
# (This has been adapted from Autoconf's _AC_RUN_LOG macro.)
|
||||
AC_DEFUN([AM_RUN_LOG],
|
||||
[{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD
|
||||
($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD
|
||||
ac_status=$?
|
||||
echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
|
||||
(exit $ac_status); }])
|
||||
|
||||
# Check to make sure that the build environment is sane. -*- Autoconf -*-
|
||||
|
||||
# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
|
||||
# Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# serial 4
|
||||
|
||||
# AM_SANITY_CHECK
|
||||
# ---------------
|
||||
AC_DEFUN([AM_SANITY_CHECK],
|
||||
[AC_MSG_CHECKING([whether build environment is sane])
|
||||
# Just in case
|
||||
sleep 1
|
||||
echo timestamp > conftest.file
|
||||
# Do `set' in a subshell so we don't clobber the current shell's
|
||||
# arguments. Must try -L first in case configure is actually a
|
||||
# symlink; some systems play weird games with the mod time of symlinks
|
||||
# (eg FreeBSD returns the mod time of the symlink's containing
|
||||
# directory).
|
||||
if (
|
||||
set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
|
||||
if test "$[*]" = "X"; then
|
||||
# -L didn't work.
|
||||
set X `ls -t $srcdir/configure conftest.file`
|
||||
fi
|
||||
rm -f conftest.file
|
||||
if test "$[*]" != "X $srcdir/configure conftest.file" \
|
||||
&& test "$[*]" != "X conftest.file $srcdir/configure"; then
|
||||
|
||||
# If neither matched, then we have a broken ls. This can happen
|
||||
# if, for instance, CONFIG_SHELL is bash and it inherits a
|
||||
# broken ls alias from the environment. This has actually
|
||||
# happened. Such a system could not be considered "sane".
|
||||
AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
|
||||
alias in your environment])
|
||||
fi
|
||||
|
||||
test "$[2]" = conftest.file
|
||||
)
|
||||
then
|
||||
# Ok.
|
||||
:
|
||||
else
|
||||
AC_MSG_ERROR([newly created file is older than distributed files!
|
||||
Check your system clock])
|
||||
fi
|
||||
AC_MSG_RESULT(yes)])
|
||||
|
||||
# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# AM_PROG_INSTALL_STRIP
|
||||
# ---------------------
|
||||
# One issue with vendor `install' (even GNU) is that you can't
|
||||
# specify the program used to strip binaries. This is especially
|
||||
# annoying in cross-compiling environments, where the build's strip
|
||||
# is unlikely to handle the host's binaries.
|
||||
# Fortunately install-sh will honor a STRIPPROG variable, so we
|
||||
# always use install-sh in `make install-strip', and initialize
|
||||
# STRIPPROG with the value of the STRIP variable (set by the user).
|
||||
AC_DEFUN([AM_PROG_INSTALL_STRIP],
|
||||
[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
|
||||
# Installed binaries are usually stripped using `strip' when the user
|
||||
# run `make install-strip'. However `strip' might not be the right
|
||||
# tool to use in cross-compilation environments, therefore Automake
|
||||
# will honor the `STRIP' environment variable to overrule this program.
|
||||
dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
|
||||
if test "$cross_compiling" != no; then
|
||||
AC_CHECK_TOOL([STRIP], [strip], :)
|
||||
fi
|
||||
INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
|
||||
AC_SUBST([INSTALL_STRIP_PROGRAM])])
|
||||
|
||||
# Copyright (C) 2006 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# _AM_SUBST_NOTMAKE(VARIABLE)
|
||||
# ---------------------------
|
||||
# Prevent Automake from outputing VARIABLE = @VARIABLE@ in Makefile.in.
|
||||
# This macro is traced by Automake.
|
||||
AC_DEFUN([_AM_SUBST_NOTMAKE])
|
||||
|
||||
# Check how to create a tarball. -*- Autoconf -*-
|
||||
|
||||
# Copyright (C) 2004, 2005 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# serial 2
|
||||
|
||||
# _AM_PROG_TAR(FORMAT)
|
||||
# --------------------
|
||||
# Check how to create a tarball in format FORMAT.
|
||||
# FORMAT should be one of `v7', `ustar', or `pax'.
|
||||
#
|
||||
# Substitute a variable $(am__tar) that is a command
|
||||
# writing to stdout a FORMAT-tarball containing the directory
|
||||
# $tardir.
|
||||
# tardir=directory && $(am__tar) > result.tar
|
||||
#
|
||||
# Substitute a variable $(am__untar) that extract such
|
||||
# a tarball read from stdin.
|
||||
# $(am__untar) < result.tar
|
||||
AC_DEFUN([_AM_PROG_TAR],
|
||||
[# Always define AMTAR for backward compatibility.
|
||||
AM_MISSING_PROG([AMTAR], [tar])
|
||||
m4_if([$1], [v7],
|
||||
[am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
|
||||
[m4_case([$1], [ustar],, [pax],,
|
||||
[m4_fatal([Unknown tar format])])
|
||||
AC_MSG_CHECKING([how to create a $1 tar archive])
|
||||
# Loop over all known methods to create a tar archive until one works.
|
||||
_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
|
||||
_am_tools=${am_cv_prog_tar_$1-$_am_tools}
|
||||
# Do not fold the above two line into one, because Tru64 sh and
|
||||
# Solaris sh will not grok spaces in the rhs of `-'.
|
||||
for _am_tool in $_am_tools
|
||||
do
|
||||
case $_am_tool in
|
||||
gnutar)
|
||||
for _am_tar in tar gnutar gtar;
|
||||
do
|
||||
AM_RUN_LOG([$_am_tar --version]) && break
|
||||
done
|
||||
am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
|
||||
am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
|
||||
am__untar="$_am_tar -xf -"
|
||||
;;
|
||||
plaintar)
|
||||
# Must skip GNU tar: if it does not support --format= it doesn't create
|
||||
# ustar tarball either.
|
||||
(tar --version) >/dev/null 2>&1 && continue
|
||||
am__tar='tar chf - "$$tardir"'
|
||||
am__tar_='tar chf - "$tardir"'
|
||||
am__untar='tar xf -'
|
||||
;;
|
||||
pax)
|
||||
am__tar='pax -L -x $1 -w "$$tardir"'
|
||||
am__tar_='pax -L -x $1 -w "$tardir"'
|
||||
am__untar='pax -r'
|
||||
;;
|
||||
cpio)
|
||||
am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
|
||||
am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
|
||||
am__untar='cpio -i -H $1 -d'
|
||||
;;
|
||||
none)
|
||||
am__tar=false
|
||||
am__tar_=false
|
||||
am__untar=false
|
||||
;;
|
||||
esac
|
||||
|
||||
# If the value was cached, stop now. We just wanted to have am__tar
|
||||
# and am__untar set.
|
||||
test -n "${am_cv_prog_tar_$1}" && break
|
||||
|
||||
# tar/untar a dummy directory, and stop if the command works
|
||||
rm -rf conftest.dir
|
||||
mkdir conftest.dir
|
||||
echo GrepMe > conftest.dir/file
|
||||
AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
|
||||
rm -rf conftest.dir
|
||||
if test -s conftest.tar; then
|
||||
AM_RUN_LOG([$am__untar <conftest.tar])
|
||||
grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
|
||||
fi
|
||||
done
|
||||
rm -rf conftest.dir
|
||||
|
||||
AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
|
||||
AC_MSG_RESULT([$am_cv_prog_tar_$1])])
|
||||
AC_SUBST([am__tar])
|
||||
AC_SUBST([am__untar])
|
||||
]) # _AM_PROG_TAR
|
||||
|
||||
m4_include([m4/ax_pthread.m4])
|
||||
m4_include([m4/hexversion.m4])
|
||||
m4_include([m4/lib_socket_nsl.m4])
|
||||
m4_include([m4/libtool.m4])
|
||||
m4_include([m4/ltoptions.m4])
|
||||
m4_include([m4/ltsugar.m4])
|
||||
m4_include([m4/ltversion.m4])
|
||||
m4_include([m4/lt~obsolete.m4])
|
||||
m4_include([m4/visibility.m4])
|
||||
@@ -1,87 +0,0 @@
|
||||
Certificate:
|
||||
Data:
|
||||
Version: 3 (0x2)
|
||||
Serial Number:
|
||||
e9:d0:a7:5f:79:25:f4:3c
|
||||
Signature Algorithm: sha1WithRSAEncryption
|
||||
Issuer: C=US, ST=Montana, L=Bozeman, O=Sawtooth, OU=Consulting, CN=www.yassl.com/emailAddress=info@yassl.com
|
||||
Validity
|
||||
Not Before: Oct 24 18:18:15 2011 GMT
|
||||
Not After : Jul 20 18:18:15 2014 GMT
|
||||
Subject: C=US, ST=Montana, L=Bozeman, O=Sawtooth, OU=Consulting, CN=www.yassl.com/emailAddress=info@yassl.com
|
||||
Subject Public Key Info:
|
||||
Public Key Algorithm: rsaEncryption
|
||||
RSA Public Key: (2048 bit)
|
||||
Modulus (2048 bit):
|
||||
00:bf:0c:ca:2d:14:b2:1e:84:42:5b:cd:38:1f:4a:
|
||||
f2:4d:75:10:f1:b6:35:9f:df:ca:7d:03:98:d3:ac:
|
||||
de:03:66:ee:2a:f1:d8:b0:7d:6e:07:54:0b:10:98:
|
||||
21:4d:80:cb:12:20:e7:cc:4f:de:45:7d:c9:72:77:
|
||||
32:ea:ca:90:bb:69:52:10:03:2f:a8:f3:95:c5:f1:
|
||||
8b:62:56:1b:ef:67:6f:a4:10:41:95:ad:0a:9b:e3:
|
||||
a5:c0:b0:d2:70:76:50:30:5b:a8:e8:08:2c:7c:ed:
|
||||
a7:a2:7a:8d:38:29:1c:ac:c7:ed:f2:7c:95:b0:95:
|
||||
82:7d:49:5c:38:cd:77:25:ef:bd:80:75:53:94:3c:
|
||||
3d:ca:63:5b:9f:15:b5:d3:1d:13:2f:19:d1:3c:db:
|
||||
76:3a:cc:b8:7d:c9:e5:c2:d7:da:40:6f:d8:21:dc:
|
||||
73:1b:42:2d:53:9c:fe:1a:fc:7d:ab:7a:36:3f:98:
|
||||
de:84:7c:05:67:ce:6a:14:38:87:a9:f1:8c:b5:68:
|
||||
cb:68:7f:71:20:2b:f5:a0:63:f5:56:2f:a3:26:d2:
|
||||
b7:6f:b1:5a:17:d7:38:99:08:fe:93:58:6f:fe:c3:
|
||||
13:49:08:16:0b:a7:4d:67:00:52:31:67:23:4e:98:
|
||||
ed:51:45:1d:b9:04:d9:0b:ec:d8:28:b3:4b:bd:ed:
|
||||
36:79
|
||||
Exponent: 65537 (0x10001)
|
||||
X509v3 extensions:
|
||||
X509v3 Subject Key Identifier:
|
||||
27:8E:67:11:74:C3:26:1D:3F:ED:33:63:B3:A4:D8:1D:30:E5:E8:D5
|
||||
X509v3 Authority Key Identifier:
|
||||
keyid:27:8E:67:11:74:C3:26:1D:3F:ED:33:63:B3:A4:D8:1D:30:E5:E8:D5
|
||||
DirName:/C=US/ST=Montana/L=Bozeman/O=Sawtooth/OU=Consulting/CN=www.yassl.com/emailAddress=info@yassl.com
|
||||
serial:E9:D0:A7:5F:79:25:F4:3C
|
||||
|
||||
X509v3 Basic Constraints:
|
||||
CA:TRUE
|
||||
Signature Algorithm: sha1WithRSAEncryption
|
||||
5f:86:14:f4:51:8b:bc:a5:4e:30:da:5e:ac:9a:f8:6c:d9:26:
|
||||
4b:93:f9:e3:1c:89:6f:9e:ee:b3:9d:77:3e:89:20:76:a3:e6:
|
||||
e8:86:15:21:db:e2:33:b2:34:d5:d0:9f:f3:c1:a4:87:92:5c:
|
||||
f9:d1:ff:30:2f:8e:03:bc:b3:3c:0c:32:a3:90:5f:1a:90:1e:
|
||||
af:9d:f3:9e:d7:07:02:a9:7d:27:66:63:2f:af:18:d7:ac:18:
|
||||
98:8c:83:8f:38:f3:0b:ac:36:10:75:fb:ca:76:13:50:5b:02:
|
||||
8f:73:bf:e3:a0:ee:83:52:25:54:ce:26:ce:9c:bd:2f:79:ab:
|
||||
1b:60:b8:92:f1:03:c0:fc:3b:08:d9:c0:ad:d5:72:08:25:80:
|
||||
61:2d:dc:9f:a7:83:62:07:47:e0:07:4c:4b:07:30:04:a9:87:
|
||||
1c:55:7f:07:12:d0:cb:42:5d:cb:cf:66:01:1a:17:ee:f9:0f:
|
||||
60:b7:db:6f:68:e5:4e:41:62:6e:d3:6f:60:4f:4b:27:de:cf:
|
||||
18:07:f1:13:5d:cb:3f:a9:25:44:da:52:5c:c8:04:e1:56:12:
|
||||
f5:2a:90:4e:d1:e2:af:01:b5:23:a1:ec:31:da:7b:63:69:c4:
|
||||
b8:f3:e7:ce:a1:3d:c0:db:6d:f3:b2:d9:46:c8:9f:c3:b8:70:
|
||||
5a:1f:7f:ca
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIIEnjCCA4agAwIBAgIJAOnQp195JfQ8MA0GCSqGSIb3DQEBBQUAMIGQMQswCQYD
|
||||
VQQGEwJVUzEQMA4GA1UECBMHTW9udGFuYTEQMA4GA1UEBxMHQm96ZW1hbjERMA8G
|
||||
A1UEChMIU2F3dG9vdGgxEzARBgNVBAsTCkNvbnN1bHRpbmcxFjAUBgNVBAMTDXd3
|
||||
dy55YXNzbC5jb20xHTAbBgkqhkiG9w0BCQEWDmluZm9AeWFzc2wuY29tMB4XDTEx
|
||||
MTAyNDE4MTgxNVoXDTE0MDcyMDE4MTgxNVowgZAxCzAJBgNVBAYTAlVTMRAwDgYD
|
||||
VQQIEwdNb250YW5hMRAwDgYDVQQHEwdCb3plbWFuMREwDwYDVQQKEwhTYXd0b290
|
||||
aDETMBEGA1UECxMKQ29uc3VsdGluZzEWMBQGA1UEAxMNd3d3Lnlhc3NsLmNvbTEd
|
||||
MBsGCSqGSIb3DQEJARYOaW5mb0B5YXNzbC5jb20wggEiMA0GCSqGSIb3DQEBAQUA
|
||||
A4IBDwAwggEKAoIBAQC/DMotFLIehEJbzTgfSvJNdRDxtjWf38p9A5jTrN4DZu4q
|
||||
8diwfW4HVAsQmCFNgMsSIOfMT95FfclydzLqypC7aVIQAy+o85XF8YtiVhvvZ2+k
|
||||
EEGVrQqb46XAsNJwdlAwW6joCCx87aeieo04KRysx+3yfJWwlYJ9SVw4zXcl772A
|
||||
dVOUPD3KY1ufFbXTHRMvGdE823Y6zLh9yeXC19pAb9gh3HMbQi1TnP4a/H2rejY/
|
||||
mN6EfAVnzmoUOIep8Yy1aMtof3EgK/WgY/VWL6Mm0rdvsVoX1ziZCP6TWG/+wxNJ
|
||||
CBYLp01nAFIxZyNOmO1RRR25BNkL7Ngos0u97TZ5AgMBAAGjgfgwgfUwHQYDVR0O
|
||||
BBYEFCeOZxF0wyYdP+0zY7Ok2B0w5ejVMIHFBgNVHSMEgb0wgbqAFCeOZxF0wyYd
|
||||
P+0zY7Ok2B0w5ejVoYGWpIGTMIGQMQswCQYDVQQGEwJVUzEQMA4GA1UECBMHTW9u
|
||||
dGFuYTEQMA4GA1UEBxMHQm96ZW1hbjERMA8GA1UEChMIU2F3dG9vdGgxEzARBgNV
|
||||
BAsTCkNvbnN1bHRpbmcxFjAUBgNVBAMTDXd3dy55YXNzbC5jb20xHTAbBgkqhkiG
|
||||
9w0BCQEWDmluZm9AeWFzc2wuY29tggkA6dCnX3kl9DwwDAYDVR0TBAUwAwEB/zAN
|
||||
BgkqhkiG9w0BAQUFAAOCAQEAX4YU9FGLvKVOMNperJr4bNkmS5P54xyJb57us513
|
||||
PokgdqPm6IYVIdviM7I01dCf88Gkh5Jc+dH/MC+OA7yzPAwyo5BfGpAer53zntcH
|
||||
Aql9J2ZjL68Y16wYmIyDjzjzC6w2EHX7ynYTUFsCj3O/46Dug1IlVM4mzpy9L3mr
|
||||
G2C4kvEDwPw7CNnArdVyCCWAYS3cn6eDYgdH4AdMSwcwBKmHHFV/BxLQy0Jdy89m
|
||||
ARoX7vkPYLfbb2jlTkFibtNvYE9LJ97PGAfxE13LP6klRNpSXMgE4VYS9SqQTtHi
|
||||
rwG1I6HsMdp7Y2nEuPPnzqE9wNtt87LZRsifw7hwWh9/yg==
|
||||
-----END CERTIFICATE-----
|
||||
Binary file not shown.
@@ -1,87 +0,0 @@
|
||||
Certificate:
|
||||
Data:
|
||||
Version: 3 (0x2)
|
||||
Serial Number:
|
||||
87:4a:75:be:91:66:d8:3d
|
||||
Signature Algorithm: sha1WithRSAEncryption
|
||||
Issuer: C=US, ST=Oregon, L=Portland, O=yaSSL, OU=Programming, CN=www.yassl.com/emailAddress=info@yassl.com
|
||||
Validity
|
||||
Not Before: Oct 24 18:21:55 2011 GMT
|
||||
Not After : Jul 20 18:21:55 2014 GMT
|
||||
Subject: C=US, ST=Oregon, L=Portland, O=yaSSL, OU=Programming, CN=www.yassl.com/emailAddress=info@yassl.com
|
||||
Subject Public Key Info:
|
||||
Public Key Algorithm: rsaEncryption
|
||||
RSA Public Key: (2048 bit)
|
||||
Modulus (2048 bit):
|
||||
00:c3:03:d1:2b:fe:39:a4:32:45:3b:53:c8:84:2b:
|
||||
2a:7c:74:9a:bd:aa:2a:52:07:47:d6:a6:36:b2:07:
|
||||
32:8e:d0:ba:69:7b:c6:c3:44:9e:d4:81:48:fd:2d:
|
||||
68:a2:8b:67:bb:a1:75:c8:36:2c:4a:d2:1b:f7:8b:
|
||||
ba:cf:0d:f9:ef:ec:f1:81:1e:7b:9b:03:47:9a:bf:
|
||||
65:cc:7f:65:24:69:a6:e8:14:89:5b:e4:34:f7:c5:
|
||||
b0:14:93:f5:67:7b:3a:7a:78:e1:01:56:56:91:a6:
|
||||
13:42:8d:d2:3c:40:9c:4c:ef:d1:86:df:37:51:1b:
|
||||
0c:a1:3b:f5:f1:a3:4a:35:e4:e1:ce:96:df:1b:7e:
|
||||
bf:4e:97:d0:10:e8:a8:08:30:81:af:20:0b:43:14:
|
||||
c5:74:67:b4:32:82:6f:8d:86:c2:88:40:99:36:83:
|
||||
ba:1e:40:72:22:17:d7:52:65:24:73:b0:ce:ef:19:
|
||||
cd:ae:ff:78:6c:7b:c0:12:03:d4:4e:72:0d:50:6d:
|
||||
3b:a3:3b:a3:99:5e:9d:c8:d9:0c:85:b3:d9:8a:d9:
|
||||
54:26:db:6d:fa:ac:bb:ff:25:4c:c4:d1:79:f4:71:
|
||||
d3:86:40:18:13:b0:63:b5:72:4e:30:c4:97:84:86:
|
||||
2d:56:2f:d7:15:f7:7f:c0:ae:f5:fc:5b:e5:fb:a1:
|
||||
ba:d3
|
||||
Exponent: 65537 (0x10001)
|
||||
X509v3 extensions:
|
||||
X509v3 Subject Key Identifier:
|
||||
33:D8:45:66:D7:68:87:18:7E:54:0D:70:27:91:C7:26:D7:85:65:C0
|
||||
X509v3 Authority Key Identifier:
|
||||
keyid:33:D8:45:66:D7:68:87:18:7E:54:0D:70:27:91:C7:26:D7:85:65:C0
|
||||
DirName:/C=US/ST=Oregon/L=Portland/O=yaSSL/OU=Programming/CN=www.yassl.com/emailAddress=info@yassl.com
|
||||
serial:87:4A:75:BE:91:66:D8:3D
|
||||
|
||||
X509v3 Basic Constraints:
|
||||
CA:TRUE
|
||||
Signature Algorithm: sha1WithRSAEncryption
|
||||
1c:7c:42:81:29:9e:21:cf:d0:d8:c1:54:6f:cc:ae:14:09:38:
|
||||
ff:68:98:9a:95:53:76:18:7b:e6:30:76:ec:28:0d:75:a7:de:
|
||||
e0:cd:8e:d5:55:23:6a:47:2b:4e:8d:fc:7d:06:a3:d8:0f:ad:
|
||||
5e:d6:04:c9:00:33:fb:77:27:d3:b5:03:b3:7b:21:74:31:0b:
|
||||
4a:af:2d:1a:b3:93:8e:cc:f3:5f:3d:90:3f:cc:e3:55:19:91:
|
||||
7b:78:24:2e:4a:09:bb:18:4e:61:2d:9c:c6:0a:a0:34:91:88:
|
||||
70:6b:3b:48:47:bc:79:94:a2:a0:4d:32:47:54:c2:a3:dc:2e:
|
||||
d2:51:4c:29:39:11:ff:e2:15:5e:58:97:36:f6:e9:06:06:86:
|
||||
0e:8d:9d:95:03:72:b2:8b:19:7c:e9:14:6e:a1:88:73:68:58:
|
||||
6d:71:5e:c2:d5:d3:13:d2:5f:de:ea:03:be:e2:00:40:e5:ce:
|
||||
fd:e6:92:31:57:c3:eb:bb:66:ac:cb:2f:1a:fa:e0:62:a2:47:
|
||||
f4:93:43:2a:4b:6c:5e:0a:2f:f9:e7:e6:4a:63:86:b0:ac:2a:
|
||||
a1:eb:b4:5b:67:cd:32:e4:b6:11:4b:9a:72:66:0d:a2:4a:76:
|
||||
8f:fe:22:bc:83:fd:db:b7:d5:a9:ee:05:c9:b1:71:7e:1b:2b:
|
||||
e1:e3:af:c0
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIIEmDCCA4CgAwIBAgIJAIdKdb6RZtg9MA0GCSqGSIb3DQEBBQUAMIGOMQswCQYD
|
||||
VQQGEwJVUzEPMA0GA1UECBMGT3JlZ29uMREwDwYDVQQHEwhQb3J0bGFuZDEOMAwG
|
||||
A1UEChMFeWFTU0wxFDASBgNVBAsTC1Byb2dyYW1taW5nMRYwFAYDVQQDEw13d3cu
|
||||
eWFzc2wuY29tMR0wGwYJKoZIhvcNAQkBFg5pbmZvQHlhc3NsLmNvbTAeFw0xMTEw
|
||||
MjQxODIxNTVaFw0xNDA3MjAxODIxNTVaMIGOMQswCQYDVQQGEwJVUzEPMA0GA1UE
|
||||
CBMGT3JlZ29uMREwDwYDVQQHEwhQb3J0bGFuZDEOMAwGA1UEChMFeWFTU0wxFDAS
|
||||
BgNVBAsTC1Byb2dyYW1taW5nMRYwFAYDVQQDEw13d3cueWFzc2wuY29tMR0wGwYJ
|
||||
KoZIhvcNAQkBFg5pbmZvQHlhc3NsLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEP
|
||||
ADCCAQoCggEBAMMD0Sv+OaQyRTtTyIQrKnx0mr2qKlIHR9amNrIHMo7Quml7xsNE
|
||||
ntSBSP0taKKLZ7uhdcg2LErSG/eLus8N+e/s8YEee5sDR5q/Zcx/ZSRppugUiVvk
|
||||
NPfFsBST9Wd7Onp44QFWVpGmE0KN0jxAnEzv0YbfN1EbDKE79fGjSjXk4c6W3xt+
|
||||
v06X0BDoqAgwga8gC0MUxXRntDKCb42GwohAmTaDuh5AciIX11JlJHOwzu8Zza7/
|
||||
eGx7wBID1E5yDVBtO6M7o5lencjZDIWz2YrZVCbbbfqsu/8lTMTRefRx04ZAGBOw
|
||||
Y7VyTjDEl4SGLVYv1xX3f8Cu9fxb5fuhutMCAwEAAaOB9jCB8zAdBgNVHQ4EFgQU
|
||||
M9hFZtdohxh+VA1wJ5HHJteFZcAwgcMGA1UdIwSBuzCBuIAUM9hFZtdohxh+VA1w
|
||||
J5HHJteFZcChgZSkgZEwgY4xCzAJBgNVBAYTAlVTMQ8wDQYDVQQIEwZPcmVnb24x
|
||||
ETAPBgNVBAcTCFBvcnRsYW5kMQ4wDAYDVQQKEwV5YVNTTDEUMBIGA1UECxMLUHJv
|
||||
Z3JhbW1pbmcxFjAUBgNVBAMTDXd3dy55YXNzbC5jb20xHTAbBgkqhkiG9w0BCQEW
|
||||
DmluZm9AeWFzc2wuY29tggkAh0p1vpFm2D0wDAYDVR0TBAUwAwEB/zANBgkqhkiG
|
||||
9w0BAQUFAAOCAQEAHHxCgSmeIc/Q2MFUb8yuFAk4/2iYmpVTdhh75jB27CgNdafe
|
||||
4M2O1VUjakcrTo38fQaj2A+tXtYEyQAz+3cn07UDs3shdDELSq8tGrOTjszzXz2Q
|
||||
P8zjVRmRe3gkLkoJuxhOYS2cxgqgNJGIcGs7SEe8eZSioE0yR1TCo9wu0lFMKTkR
|
||||
/+IVXliXNvbpBgaGDo2dlQNysosZfOkUbqGIc2hYbXFewtXTE9Jf3uoDvuIAQOXO
|
||||
/eaSMVfD67tmrMsvGvrgYqJH9JNDKktsXgov+efmSmOGsKwqoeu0W2fNMuS2EUua
|
||||
cmYNokp2j/4ivIP927fVqe4FybFxfhsr4eOvwA==
|
||||
-----END CERTIFICATE-----
|
||||
@@ -1,54 +0,0 @@
|
||||
Certificate:
|
||||
Data:
|
||||
Version: 3 (0x2)
|
||||
Serial Number:
|
||||
bf:cc:cb:7a:0a:07:42:82
|
||||
Signature Algorithm: ecdsa-with-SHA1
|
||||
Issuer: C=US, ST=Oregon, L=Salem, O=Client ECC, OU=Fast, CN=www.yassl.com/emailAddress=info@yassl.com
|
||||
Validity
|
||||
Not Before: May 1 23:51:33 2012 GMT
|
||||
Not After : Jan 26 23:51:33 2015 GMT
|
||||
Subject: C=US, ST=Oregon, L=Salem, O=Client ECC, OU=Fast, CN=www.yassl.com/emailAddress=info@yassl.com
|
||||
Subject Public Key Info:
|
||||
Public Key Algorithm: id-ecPublicKey
|
||||
EC Public Key:
|
||||
pub:
|
||||
04:55:bf:f4:0f:44:50:9a:3d:ce:9b:b7:f0:c5:4d:
|
||||
f5:70:7b:d4:ec:24:8e:19:80:ec:5a:4c:a2:24:03:
|
||||
62:2c:9b:da:ef:a2:35:12:43:84:76:16:c6:56:95:
|
||||
06:cc:01:a9:bd:f6:75:1a:42:f7:bd:a9:b2:36:22:
|
||||
5f:c7:5d:7f:b4
|
||||
ASN1 OID: prime256v1
|
||||
X509v3 extensions:
|
||||
X509v3 Subject Key Identifier:
|
||||
EB:D4:4B:59:6B:95:61:3F:51:57:B6:04:4D:89:41:88:44:5C:AB:F2
|
||||
X509v3 Authority Key Identifier:
|
||||
keyid:EB:D4:4B:59:6B:95:61:3F:51:57:B6:04:4D:89:41:88:44:5C:AB:F2
|
||||
DirName:/C=US/ST=Oregon/L=Salem/O=Client ECC/OU=Fast/CN=www.yassl.com/emailAddress=info@yassl.com
|
||||
serial:BF:CC:CB:7A:0A:07:42:82
|
||||
|
||||
X509v3 Basic Constraints:
|
||||
CA:TRUE
|
||||
Signature Algorithm: ecdsa-with-SHA1
|
||||
30:44:02:20:26:08:44:95:35:2e:fa:9d:20:01:a6:79:60:ed:
|
||||
35:a7:0a:dd:7a:0e:75:c5:80:d2:0b:9f:6a:90:d6:31:76:75:
|
||||
02:20:2d:87:a2:bb:d5:e2:42:61:35:19:59:40:1d:fd:71:4f:
|
||||
28:65:96:99:e6:85:1b:09:ad:d4:58:71:56:63:0b:c7
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIIC+jCCAqKgAwIBAgIJAL/My3oKB0KCMAkGByqGSM49BAEwgYkxCzAJBgNVBAYT
|
||||
AlVTMQ8wDQYDVQQIEwZPcmVnb24xDjAMBgNVBAcTBVNhbGVtMRMwEQYDVQQKEwpD
|
||||
bGllbnQgRUNDMQ0wCwYDVQQLEwRGYXN0MRYwFAYDVQQDEw13d3cueWFzc2wuY29t
|
||||
MR0wGwYJKoZIhvcNAQkBFg5pbmZvQHlhc3NsLmNvbTAeFw0xMjA1MDEyMzUxMzNa
|
||||
Fw0xNTAxMjYyMzUxMzNaMIGJMQswCQYDVQQGEwJVUzEPMA0GA1UECBMGT3JlZ29u
|
||||
MQ4wDAYDVQQHEwVTYWxlbTETMBEGA1UEChMKQ2xpZW50IEVDQzENMAsGA1UECxME
|
||||
RmFzdDEWMBQGA1UEAxMNd3d3Lnlhc3NsLmNvbTEdMBsGCSqGSIb3DQEJARYOaW5m
|
||||
b0B5YXNzbC5jb20wWTATBgcqhkjOPQIBBggqhkjOPQMBBwNCAARVv/QPRFCaPc6b
|
||||
t/DFTfVwe9TsJI4ZgOxaTKIkA2Ism9rvojUSQ4R2FsZWlQbMAam99nUaQve9qbI2
|
||||
Il/HXX+0o4HxMIHuMB0GA1UdDgQWBBTr1EtZa5VhP1FXtgRNiUGIRFyr8jCBvgYD
|
||||
VR0jBIG2MIGzgBTr1EtZa5VhP1FXtgRNiUGIRFyr8qGBj6SBjDCBiTELMAkGA1UE
|
||||
BhMCVVMxDzANBgNVBAgTBk9yZWdvbjEOMAwGA1UEBxMFU2FsZW0xEzARBgNVBAoT
|
||||
CkNsaWVudCBFQ0MxDTALBgNVBAsTBEZhc3QxFjAUBgNVBAMTDXd3dy55YXNzbC5j
|
||||
b20xHTAbBgkqhkiG9w0BCQEWDmluZm9AeWFzc2wuY29tggkAv8zLegoHQoIwDAYD
|
||||
VR0TBAUwAwEB/zAJBgcqhkjOPQQBA0cAMEQCICYIRJU1LvqdIAGmeWDtNacK3XoO
|
||||
dcWA0gufapDWMXZ1AiAth6K71eJCYTUZWUAd/XFPKGWWmeaFGwmt1FhxVmMLxw==
|
||||
-----END CERTIFICATE-----
|
||||
@@ -1,12 +0,0 @@
|
||||
-----BEGIN RSA PRIVATE KEY-----
|
||||
Proc-Type: 4,ENCRYPTED
|
||||
DEK-Info: DES-EDE3-CBC,BDE979D13CCC0ABD
|
||||
|
||||
N7yz2JV13EmQ7MZPL5wamid5+G1V1gp8FKqMemAC5JDxonS/W9oViMLUcxbfPTDx
|
||||
FznKdYSVTIQ7vv3ofmDG4MEyV/2C568N2kdtAw+jTfrZFN+IU9CI+W+In/nacirF
|
||||
02sAcvDMofustnooKNOO7/iyb5+3vRvEt5vSSRQn5WuSQ9sUKjuzoLs/lbf7fyAt
|
||||
4NeqfI3rYBZXxiUOLITOGXzGNRuFoY+o2uDCfelLAJ8uhiVG6ME3LeJEo1dT5lZ8
|
||||
CSJOLPasKg0iG4V7olM4j9FvAfZr48RRsSfUen756Jo2HpI4bad8LKhFYIdNs2Au
|
||||
WwKLmjpo6QB9hBmRshR04rEXPdrgTqLBExCE08PyaGYnWU8ggWritCeBzDQFj/n4
|
||||
sI+NO0Mymuvg98e5RpO52lg3Xnqv9RIK3guLFOmI6aEHC0PS4WwOEQ==
|
||||
-----END RSA PRIVATE KEY-----
|
||||
@@ -1,39 +0,0 @@
|
||||
Certificate Revocation List (CRL):
|
||||
Version 2 (0x1)
|
||||
Signature Algorithm: sha1WithRSAEncryption
|
||||
Issuer: /C=US/ST=Oregon/L=Portland/O=yaSSL/OU=Programming/CN=www.yassl.com/emailAddress=info@yassl.com
|
||||
Last Update: Aug 10 18:01:01 2012 GMT
|
||||
Next Update: Dec 8 18:01:01 2012 GMT
|
||||
CRL extensions:
|
||||
X509v3 CRL Number:
|
||||
62
|
||||
No Revoked Certificates.
|
||||
Signature Algorithm: sha1WithRSAEncryption
|
||||
1e:69:b2:c4:72:a7:b2:c9:e1:b9:ac:06:40:2c:c5:66:9a:07:
|
||||
6c:91:2e:17:09:c7:86:b4:62:2d:0f:1f:a3:a3:1c:93:ce:45:
|
||||
53:d5:57:94:a6:77:af:51:da:86:e4:1e:6f:57:c8:cc:5f:07:
|
||||
8d:a5:db:bd:b3:f7:cf:e2:11:3c:e2:51:79:7e:b3:a9:47:f7:
|
||||
c1:17:12:5b:7c:e5:c3:71:17:d2:ce:59:d4:0d:dc:45:ff:bc:
|
||||
fe:a7:76:7b:92:88:52:0c:a5:e0:79:75:86:50:27:15:2a:01:
|
||||
66:a6:ba:96:d4:9a:14:1d:92:7d:63:72:5f:25:9b:05:72:cb:
|
||||
ed:6d:7c:92:1f:4f:3e:64:cb:5d:80:9e:ad:c8:47:83:88:5b:
|
||||
3d:07:3f:d3:6a:2c:dd:c9:f7:09:bb:05:2f:9a:f4:73:15:f4:
|
||||
61:b1:47:87:9c:bf:c9:61:42:19:14:b8:67:9c:c5:c1:86:f1:
|
||||
e8:63:71:40:6c:2f:b1:c1:0c:1f:f4:c4:80:e2:d0:cb:88:6b:
|
||||
51:1e:e9:b0:06:19:7c:6d:85:cf:05:7f:fe:3d:35:79:9e:f0:
|
||||
5b:f4:06:63:d4:eb:d2:e2:70:29:a9:02:b4:c1:b4:bd:53:f4:
|
||||
8f:b3:df:37:91:44:d5:e8:c4:10:86:76:0e:49:2b:ba:9a:a4:
|
||||
dd:33:0e:7e
|
||||
-----BEGIN X509 CRL-----
|
||||
MIIB6DCB0QIBATANBgkqhkiG9w0BAQUFADCBjjELMAkGA1UEBhMCVVMxDzANBgNV
|
||||
BAgTBk9yZWdvbjERMA8GA1UEBxMIUG9ydGxhbmQxDjAMBgNVBAoTBXlhU1NMMRQw
|
||||
EgYDVQQLEwtQcm9ncmFtbWluZzEWMBQGA1UEAxMNd3d3Lnlhc3NsLmNvbTEdMBsG
|
||||
CSqGSIb3DQEJARYOaW5mb0B5YXNzbC5jb20XDTEyMDgxMDE4MDEwMVoXDTEyMTIw
|
||||
ODE4MDEwMVqgDjAMMAoGA1UdFAQDAgE+MA0GCSqGSIb3DQEBBQUAA4IBAQAeabLE
|
||||
cqeyyeG5rAZALMVmmgdskS4XCceGtGItDx+joxyTzkVT1VeUpnevUdqG5B5vV8jM
|
||||
XweNpdu9s/fP4hE84lF5frOpR/fBFxJbfOXDcRfSzlnUDdxF/7z+p3Z7kohSDKXg
|
||||
eXWGUCcVKgFmprqW1JoUHZJ9Y3JfJZsFcsvtbXySH08+ZMtdgJ6tyEeDiFs9Bz/T
|
||||
aizdyfcJuwUvmvRzFfRhsUeHnL/JYUIZFLhnnMXBhvHoY3FAbC+xwQwf9MSA4tDL
|
||||
iGtRHumwBhl8bYXPBX/+PTV5nvBb9AZj1OvS4nApqQK0wbS9U/SPs983kUTV6MQQ
|
||||
hnYOSSu6mqTdMw5+
|
||||
-----END X509 CRL-----
|
||||
@@ -1,39 +0,0 @@
|
||||
Certificate Revocation List (CRL):
|
||||
Version 2 (0x1)
|
||||
Signature Algorithm: sha1WithRSAEncryption
|
||||
Issuer: /C=US/ST=Montana/L=Bozeman/O=Sawtooth/OU=Consulting/CN=www.yassl.com/emailAddress=info@yassl.com
|
||||
Last Update: Aug 10 18:01:01 2012 GMT
|
||||
Next Update: Dec 8 18:01:01 2012 GMT
|
||||
CRL extensions:
|
||||
X509v3 CRL Number:
|
||||
60
|
||||
No Revoked Certificates.
|
||||
Signature Algorithm: sha1WithRSAEncryption
|
||||
26:1c:06:6a:42:ff:8b:18:71:4e:ef:7c:02:74:43:6f:7b:83:
|
||||
99:2f:e1:4e:74:0f:f9:99:62:a1:90:88:11:1b:d8:59:3b:1e:
|
||||
34:dd:f4:92:81:6f:49:2c:9a:5f:ba:21:6f:11:95:19:6e:da:
|
||||
38:a4:4e:a0:7e:4a:fb:7c:c6:9f:c8:26:2d:9b:cd:e8:30:14:
|
||||
10:38:56:63:89:bf:a7:eb:11:0f:7c:81:60:d7:c3:ab:07:ef:
|
||||
6c:af:81:4d:b9:cd:6e:91:c6:42:13:01:d8:1a:62:cb:52:fd:
|
||||
44:0b:fa:9f:34:de:75:ba:5a:3d:df:d4:b1:7e:a0:b9:3f:f5:
|
||||
ed:a3:e6:ef:ef:20:95:45:3c:75:8c:a8:5c:ae:8c:e9:3c:f1:
|
||||
e6:34:fd:65:bb:9a:f9:5f:8c:96:7c:32:12:50:43:2b:30:94:
|
||||
4e:8a:f0:c3:5e:c9:e2:49:08:83:64:7a:3b:f3:d5:30:f3:78:
|
||||
4b:20:3c:51:d0:da:37:14:f4:c8:f2:ab:41:d2:c3:b9:7a:7f:
|
||||
42:17:42:79:a4:10:67:4e:84:d4:e9:a9:e8:dd:46:5d:b2:f4:
|
||||
e8:3d:1c:24:3c:81:e7:56:bb:43:11:e2:d9:a2:9d:ce:b5:78:
|
||||
ad:19:14:7c:d7:37:e8:bf:f7:30:fc:4d:05:a9:33:6b:12:9f:
|
||||
24:19:39:35
|
||||
-----BEGIN X509 CRL-----
|
||||
MIIB6jCB0wIBATANBgkqhkiG9w0BAQUFADCBkDELMAkGA1UEBhMCVVMxEDAOBgNV
|
||||
BAgTB01vbnRhbmExEDAOBgNVBAcTB0JvemVtYW4xETAPBgNVBAoTCFNhd3Rvb3Ro
|
||||
MRMwEQYDVQQLEwpDb25zdWx0aW5nMRYwFAYDVQQDEw13d3cueWFzc2wuY29tMR0w
|
||||
GwYJKoZIhvcNAQkBFg5pbmZvQHlhc3NsLmNvbRcNMTIwODEwMTgwMTAxWhcNMTIx
|
||||
MjA4MTgwMTAxWqAOMAwwCgYDVR0UBAMCATwwDQYJKoZIhvcNAQEFBQADggEBACYc
|
||||
BmpC/4sYcU7vfAJ0Q297g5kv4U50D/mZYqGQiBEb2Fk7HjTd9JKBb0ksml+6IW8R
|
||||
lRlu2jikTqB+Svt8xp/IJi2bzegwFBA4VmOJv6frEQ98gWDXw6sH72yvgU25zW6R
|
||||
xkITAdgaYstS/UQL+p803nW6Wj3f1LF+oLk/9e2j5u/vIJVFPHWMqFyujOk88eY0
|
||||
/WW7mvlfjJZ8MhJQQyswlE6K8MNeyeJJCINkejvz1TDzeEsgPFHQ2jcU9Mjyq0HS
|
||||
w7l6f0IXQnmkEGdOhNTpqejdRl2y9Og9HCQ8gedWu0MR4tminc61eK0ZFHzXN+i/
|
||||
9zD8TQWpM2sSnyQZOTU=
|
||||
-----END X509 CRL-----
|
||||
@@ -1,41 +0,0 @@
|
||||
Certificate Revocation List (CRL):
|
||||
Version 2 (0x1)
|
||||
Signature Algorithm: sha1WithRSAEncryption
|
||||
Issuer: /C=US/ST=Montana/L=Bozeman/O=Sawtooth/OU=Consulting/CN=www.yassl.com/emailAddress=info@yassl.com
|
||||
Last Update: Aug 10 18:01:01 2012 GMT
|
||||
Next Update: Dec 8 18:01:01 2012 GMT
|
||||
CRL extensions:
|
||||
X509v3 CRL Number:
|
||||
61
|
||||
Revoked Certificates:
|
||||
Serial Number: 02
|
||||
Revocation Date: Aug 10 18:01:01 2012 GMT
|
||||
Signature Algorithm: sha1WithRSAEncryption
|
||||
5c:eb:53:33:02:74:bb:c1:37:37:81:1a:36:9c:eb:d0:28:87:
|
||||
12:56:1a:d8:ec:ae:8e:ef:42:d0:61:07:f0:f0:b5:e8:2a:16:
|
||||
5e:78:ab:e9:ad:62:f3:6c:c5:fe:7a:b5:c7:0e:8a:e3:0a:2d:
|
||||
63:b5:ec:c4:c1:1f:1e:c3:77:b7:24:10:4b:09:b1:d8:ea:40:
|
||||
4f:74:6a:9a:d7:57:bd:b9:d3:e2:42:81:81:b2:5c:42:d8:d3:
|
||||
21:3f:f2:05:e2:11:8f:ce:60:cc:3b:76:55:e6:5f:6d:71:13:
|
||||
b1:7e:2c:50:d2:29:fe:f2:ad:96:f9:ee:8f:5c:c3:0a:73:e7:
|
||||
78:c5:8f:6e:0d:35:66:64:4a:76:05:93:9f:eb:05:b2:c3:a1:
|
||||
f5:d5:4c:4b:6e:79:f2:8d:51:90:7c:9d:a9:f5:94:7f:93:fe:
|
||||
39:da:c1:fb:8c:94:66:1d:d4:40:a9:48:ee:3b:91:14:83:4e:
|
||||
b4:ea:93:07:f6:be:48:4a:ec:4c:26:61:2d:a2:66:01:c5:d8:
|
||||
d3:18:f6:d0:1b:d2:94:13:c9:94:84:54:e4:44:10:01:66:25:
|
||||
47:ee:b2:19:4a:65:e3:79:42:9e:12:af:a7:4a:a4:66:35:e3:
|
||||
1a:db:2c:80:ff:a4:9c:2e:6e:32:8e:50:5d:ec:7e:de:1a:01:
|
||||
a9:08:fc:a2
|
||||
-----BEGIN X509 CRL-----
|
||||
MIICADCB6QIBATANBgkqhkiG9w0BAQUFADCBkDELMAkGA1UEBhMCVVMxEDAOBgNV
|
||||
BAgTB01vbnRhbmExEDAOBgNVBAcTB0JvemVtYW4xETAPBgNVBAoTCFNhd3Rvb3Ro
|
||||
MRMwEQYDVQQLEwpDb25zdWx0aW5nMRYwFAYDVQQDEw13d3cueWFzc2wuY29tMR0w
|
||||
GwYJKoZIhvcNAQkBFg5pbmZvQHlhc3NsLmNvbRcNMTIwODEwMTgwMTAxWhcNMTIx
|
||||
MjA4MTgwMTAxWjAUMBICAQIXDTEyMDgxMDE4MDEwMVqgDjAMMAoGA1UdFAQDAgE9
|
||||
MA0GCSqGSIb3DQEBBQUAA4IBAQBc61MzAnS7wTc3gRo2nOvQKIcSVhrY7K6O70LQ
|
||||
YQfw8LXoKhZeeKvprWLzbMX+erXHDorjCi1jtezEwR8ew3e3JBBLCbHY6kBPdGqa
|
||||
11e9udPiQoGBslxC2NMhP/IF4hGPzmDMO3ZV5l9tcROxfixQ0in+8q2W+e6PXMMK
|
||||
c+d4xY9uDTVmZEp2BZOf6wWyw6H11UxLbnnyjVGQfJ2p9ZR/k/452sH7jJRmHdRA
|
||||
qUjuO5EUg0606pMH9r5ISuxMJmEtomYBxdjTGPbQG9KUE8mUhFTkRBABZiVH7rIZ
|
||||
SmXjeUKeEq+nSqRmNeMa2yyA/6ScLm4yjlBd7H7eGgGpCPyi
|
||||
-----END X509 CRL-----
|
||||
@@ -1,24 +0,0 @@
|
||||
Certificate Revocation List (CRL):
|
||||
Version 2 (0x1)
|
||||
Signature Algorithm: ecdsa-with-SHA1
|
||||
Issuer: /C=US/ST=Oregon/L=Salem/O=Client ECC/OU=Fast/CN=www.yassl.com/emailAddress=info@yassl.com
|
||||
Last Update: Aug 10 18:01:01 2012 GMT
|
||||
Next Update: Dec 8 18:01:01 2012 GMT
|
||||
CRL extensions:
|
||||
X509v3 CRL Number:
|
||||
63
|
||||
No Revoked Certificates.
|
||||
Signature Algorithm: ecdsa-with-SHA1
|
||||
30:44:02:20:7f:8d:d7:28:61:96:4c:b7:a8:17:0a:7f:9d:cf:
|
||||
fa:29:e1:1d:cb:30:61:1b:b3:6b:f0:61:68:15:25:76:62:32:
|
||||
02:20:55:ca:fc:37:b4:4c:f9:78:99:b3:c9:d4:1a:e1:fa:f7:
|
||||
8a:4a:94:ce:31:ed:b0:1f:dc:64:d7:2a:59:47:b9:2d
|
||||
-----BEGIN X509 CRL-----
|
||||
MIIBHzCByAIBATAJBgcqhkjOPQQBMIGJMQswCQYDVQQGEwJVUzEPMA0GA1UECBMG
|
||||
T3JlZ29uMQ4wDAYDVQQHEwVTYWxlbTETMBEGA1UEChMKQ2xpZW50IEVDQzENMAsG
|
||||
A1UECxMERmFzdDEWMBQGA1UEAxMNd3d3Lnlhc3NsLmNvbTEdMBsGCSqGSIb3DQEJ
|
||||
ARYOaW5mb0B5YXNzbC5jb20XDTEyMDgxMDE4MDEwMVoXDTEyMTIwODE4MDEwMVqg
|
||||
DjAMMAoGA1UdFAQDAgE/MAkGByqGSM49BAEDRwAwRAIgf43XKGGWTLeoFwp/nc/6
|
||||
KeEdyzBhG7Nr8GFoFSV2YjICIFXK/De0TPl4mbPJ1Brh+veKSpTOMe2wH9xk1ypZ
|
||||
R7kt
|
||||
-----END X509 CRL-----
|
||||
@@ -1,24 +0,0 @@
|
||||
Certificate Revocation List (CRL):
|
||||
Version 2 (0x1)
|
||||
Signature Algorithm: ecdsa-with-SHA1
|
||||
Issuer: /C=US/ST=Washington/L=Seattle/O=Eliptic/OU=ECC/CN=www.yassl.com/emailAddress=info@yassl.com
|
||||
Last Update: Aug 10 18:01:01 2012 GMT
|
||||
Next Update: Dec 8 18:01:01 2012 GMT
|
||||
CRL extensions:
|
||||
X509v3 CRL Number:
|
||||
64
|
||||
No Revoked Certificates.
|
||||
Signature Algorithm: ecdsa-with-SHA1
|
||||
30:44:02:20:59:42:06:a7:73:69:03:08:05:e8:4b:95:ca:cf:
|
||||
f1:30:9e:84:4b:3c:52:c8:10:b9:c8:36:c8:07:64:65:fd:bf:
|
||||
02:20:71:60:a7:35:d6:8c:52:c2:df:06:dc:40:52:c5:ef:4c:
|
||||
8b:ec:96:4b:72:b0:c4:36:3e:c8:9d:62:5e:49:f2:5f
|
||||
-----BEGIN X509 CRL-----
|
||||
MIIBITCBygIBATAJBgcqhkjOPQQBMIGLMQswCQYDVQQGEwJVUzETMBEGA1UECBMK
|
||||
V2FzaGluZ3RvbjEQMA4GA1UEBxMHU2VhdHRsZTEQMA4GA1UEChMHRWxpcHRpYzEM
|
||||
MAoGA1UECxMDRUNDMRYwFAYDVQQDEw13d3cueWFzc2wuY29tMR0wGwYJKoZIhvcN
|
||||
AQkBFg5pbmZvQHlhc3NsLmNvbRcNMTIwODEwMTgwMTAxWhcNMTIxMjA4MTgwMTAx
|
||||
WqAOMAwwCgYDVR0UBAMCAUAwCQYHKoZIzj0EAQNHADBEAiBZQganc2kDCAXoS5XK
|
||||
z/EwnoRLPFLIELnINsgHZGX9vwIgcWCnNdaMUsLfBtxAUsXvTIvslktysMQ2Psid
|
||||
Yl5J8l8=
|
||||
-----END X509 CRL-----
|
||||
@@ -1,40 +0,0 @@
|
||||
# vim:ft=automake
|
||||
# All paths should be given relative to the root
|
||||
#
|
||||
|
||||
EXTRA_DIST += \
|
||||
certs/ca-cert.pem \
|
||||
certs/ca-key.pem \
|
||||
certs/client-cert.pem \
|
||||
certs/client-keyEnc.pem \
|
||||
certs/client-key.pem \
|
||||
certs/ecc-key.pem \
|
||||
certs/ecc-keyPkcs8.pem \
|
||||
certs/ecc-client-key.pem \
|
||||
certs/client-ecc-cert.pem \
|
||||
certs/ntru-cert.pem \
|
||||
certs/dh2048.pem \
|
||||
certs/server-cert.pem \
|
||||
certs/server-ecc.pem \
|
||||
certs/server-ecc-rsa.pem \
|
||||
certs/server-keyEnc.pem \
|
||||
certs/server-key.pem \
|
||||
certs/server-keyPkcs8Enc12.pem \
|
||||
certs/server-keyPkcs8Enc2.pem \
|
||||
certs/server-keyPkcs8Enc.pem \
|
||||
certs/server-keyPkcs8.pem
|
||||
|
||||
EXTRA_DIST += \
|
||||
certs/ca-key.der \
|
||||
certs/client-cert.der \
|
||||
certs/client-key.der \
|
||||
certs/dh2048.der \
|
||||
certs/rsa2048.der \
|
||||
certs/dsa2048.der \
|
||||
certs/ecc-key.der
|
||||
|
||||
|
||||
doc_DATA+= certs/taoCert.txt
|
||||
|
||||
EXTRA_DIST+= certs/ntru-key.raw
|
||||
|
||||
@@ -1,28 +0,0 @@
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIIEyTCCA7GgAwIBAgIIASZ+ezr7rN0wDQYJKoZIhvcNAQEFBQAwgZAxCzAJBgNV
|
||||
BAYTAlVTMRAwDgYDVQQIEwdNb250YW5hMRAwDgYDVQQHEwdCb3plbWFuMREwDwYD
|
||||
VQQKEwhTYXd0b290aDETMBEGA1UECxMKQ29uc3VsdGluZzEWMBQGA1UEAxMNd3d3
|
||||
Lnlhc3NsLmNvbTEdMBsGCSqGSIb3DQEJARYOaW5mb0B5YXNzbC5jb20wIhgPMjAx
|
||||
MTEyMDUwMDE2MzdaGA8yMDEzMDQxOTAxMTYzN1owgYoxCzAJBgNVBAYTAlVTMQsw
|
||||
CQYDVQQIEwJPUjERMA8GA1UEBxMIUG9ydGxhbmQxDjAMBgNVBAoTBXlhU1NMMRQw
|
||||
EgYDVQQLEwtEZXZlbG9wbWVudDEWMBQGA1UEAxMNd3d3Lnlhc3NsLmNvbTEdMBsG
|
||||
CSqGSIb3DQEJARYOaW5mb0B5YXNzbC5jb20wggJLMBgGCisGAQQBwXABAQIGCisG
|
||||
AQQBwXABAi4DggItAASCAihFDRAy0fOBZth/IRQFJeuEUgrViJfGvKOUuNW6yYmn
|
||||
9/YXT2I3/aiBZ/udSehoEFVPNgLs/ZWwNrsIuETH5TPkS1e9Ig4I5G839deKT89M
|
||||
Qpq7GiKLwlLY3He/a6O+/UMEFH4ShdhDopsH2+IsWCX0H7Lvp8L8RqURrQNFXvlr
|
||||
xRAFiBixEQNry2HyEcVz/9TQSdifE4KGUtneErqsk1/Sms1m1/NqW30H77YerJfs
|
||||
QWsOEgasoJnYWS6knJC4XsUbJKqKcHRc6XeODOyf72J3ESvES2C+cqEsShxVP7zG
|
||||
hDiHurwfyvIAUL4bZSBtlAqt60iOEsXScXwdbNrj+4iuFAyjX8+JrxGMbDNi3X5l
|
||||
L2RLUiEIKUSGUozbDlR3jU2WoHUm76mZwjGe1+vOKpvqh5yrRoyqiDERj8wsGrDO
|
||||
MdoheW1xSjQ3p5fQ/UOtagWA5Lh/MqbCIHdMzMLpbOmfhFJA5BXaNg/qThhjpmvf
|
||||
csYfwWCWukKKbjfY7cxOVMuUN0VvoYBjOxt5UQhXuPjH/+5s4J7E/IxQrWz6fhcG
|
||||
wfvJjWJjedfhP23Jm4zodbwtU6MgPF641DcAwcnBqSi/Ugi7d0YeHMqTJkSnIJZV
|
||||
r3v1YLuqiFDzB6bx69DGpCxFMxIpdOPq4a9WpeQQ9H7cBK0HFl4tRPNnQ2XCrKMc
|
||||
86gQ35aaM2vPvgj0d/zgC0AG8WFQEG1wYBvLEgfiQsi7auXoScYZA8AwDQYJKoZI
|
||||
hvcNAQEFBQADggEBAJ7eyiJIGiyyrhAdaYOit3U3CUkGSatNXTkn8PRO8SwzPWCi
|
||||
FQ+4AePYV+/ovtNZiqLwm7mVa3s2CS8LCk2s9/ld22cDJNV+gDkzrelUyTLUi0jr
|
||||
zZJwEiaNXIEkYrLGifSzoNUgQBTzDmOSkm2UpIX70GTsXF73FKdqonf1VTnopVKa
|
||||
XZDpIG3/TKyh8jCwowMrkxnHS886FhXiHGCBzM1rnp3S+r3b+rTqoKoeuZQnDgJP
|
||||
IZwnZL6agtwbUfmZj6/868irlsLtC9M5nKBtj/U/tQIrW52XEhBqChmTXIq0JNL1
|
||||
++kWLLeu9t0T53Pth3VxMT/ePV0aURQvjINm60o=
|
||||
-----END CERTIFICATE-----
|
||||
Binary file not shown.
@@ -1,158 +0,0 @@
|
||||
Certificate:
|
||||
Data:
|
||||
Version: 1 (0x0)
|
||||
Serial Number: 2 (0x2)
|
||||
Signature Algorithm: sha1WithRSAEncryption
|
||||
Issuer: C=US, ST=Montana, L=Bozeman, O=Sawtooth, OU=Consulting, CN=www.yassl.com/emailAddress=info@yassl.com
|
||||
Validity
|
||||
Not Before: Oct 24 18:27:13 2011 GMT
|
||||
Not After : Jul 20 18:27:13 2014 GMT
|
||||
Subject: C=US, ST=Montana, L=Bozeman, O=yaSSL, OU=Support, CN=www.yassl.com/emailAddress=info@yassl.com
|
||||
Subject Public Key Info:
|
||||
Public Key Algorithm: rsaEncryption
|
||||
RSA Public Key: (2048 bit)
|
||||
Modulus (2048 bit):
|
||||
00:c0:95:08:e1:57:41:f2:71:6d:b7:d2:45:41:27:
|
||||
01:65:c6:45:ae:f2:bc:24:30:b8:95:ce:2f:4e:d6:
|
||||
f6:1c:88:bc:7c:9f:fb:a8:67:7f:fe:5c:9c:51:75:
|
||||
f7:8a:ca:07:e7:35:2f:8f:e1:bd:7b:c0:2f:7c:ab:
|
||||
64:a8:17:fc:ca:5d:7b:ba:e0:21:e5:72:2e:6f:2e:
|
||||
86:d8:95:73:da:ac:1b:53:b9:5f:3f:d7:19:0d:25:
|
||||
4f:e1:63:63:51:8b:0b:64:3f:ad:43:b8:a5:1c:5c:
|
||||
34:b3:ae:00:a0:63:c5:f6:7f:0b:59:68:78:73:a6:
|
||||
8c:18:a9:02:6d:af:c3:19:01:2e:b8:10:e3:c6:cc:
|
||||
40:b4:69:a3:46:33:69:87:6e:c4:bb:17:a6:f3:e8:
|
||||
dd:ad:73:bc:7b:2f:21:b5:fd:66:51:0c:bd:54:b3:
|
||||
e1:6d:5f:1c:bc:23:73:d1:09:03:89:14:d2:10:b9:
|
||||
64:c3:2a:d0:a1:96:4a:bc:e1:d4:1a:5b:c7:a0:c0:
|
||||
c1:63:78:0f:44:37:30:32:96:80:32:23:95:a1:77:
|
||||
ba:13:d2:97:73:e2:5d:25:c9:6a:0d:c3:39:60:a4:
|
||||
b4:b0:69:42:42:09:e9:d8:08:bc:33:20:b3:58:22:
|
||||
a7:aa:eb:c4:e1:e6:61:83:c5:d2:96:df:d9:d0:4f:
|
||||
ad:d7
|
||||
Exponent: 65537 (0x10001)
|
||||
Signature Algorithm: sha1WithRSAEncryption
|
||||
71:4e:d3:62:df:cc:4c:f7:cd:b7:6e:52:0b:6c:6e:e0:bd:c2:
|
||||
2d:07:d7:c0:b0:6e:43:1e:35:bc:30:01:50:f0:ff:99:23:6c:
|
||||
18:1a:41:b6:11:d6:d4:19:61:fd:e4:77:97:1c:39:e1:57:ab:
|
||||
c5:15:63:77:11:36:5e:74:e2:24:0b:1f:41:78:ad:b7:81:e7:
|
||||
b4:40:66:80:f0:4b:91:a0:6d:a8:6e:3d:53:d9:8b:ce:2a:e1:
|
||||
0b:45:65:87:a1:96:ae:ee:3e:88:d5:12:1f:78:17:ae:2c:c5:
|
||||
73:44:d8:dc:f4:af:d8:cc:ae:4c:e1:0c:be:55:a4:99:f7:6e:
|
||||
96:c0:c8:45:87:bf:dc:51:57:ff:9e:73:37:6a:18:9c:c3:f9:
|
||||
22:7a:f4:b0:52:bd:fc:21:30:f8:c5:ff:1e:87:7d:ad:a2:5a:
|
||||
35:f5:22:a8:b4:0a:76:38:e6:76:b0:98:af:1b:ec:8a:0a:43:
|
||||
74:d2:85:34:37:84:07:e1:f6:23:b2:29:de:a6:b6:b7:4c:57:
|
||||
7e:96:06:cb:a9:16:25:29:3a:03:2d:55:7d:a6:8c:a4:f7:9e:
|
||||
81:c9:95:b6:7c:c1:4a:ce:94:66:0c:ca:88:eb:d2:09:f5:5b:
|
||||
19:58:82:df:27:fd:67:95:78:b7:02:06:d5:a7:61:bd:ef:3a:
|
||||
fc:b2:61:cd
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIIDkDCCAngCAQIwDQYJKoZIhvcNAQEFBQAwgZAxCzAJBgNVBAYTAlVTMRAwDgYD
|
||||
VQQIEwdNb250YW5hMRAwDgYDVQQHEwdCb3plbWFuMREwDwYDVQQKEwhTYXd0b290
|
||||
aDETMBEGA1UECxMKQ29uc3VsdGluZzEWMBQGA1UEAxMNd3d3Lnlhc3NsLmNvbTEd
|
||||
MBsGCSqGSIb3DQEJARYOaW5mb0B5YXNzbC5jb20wHhcNMTExMDI0MTgyNzEzWhcN
|
||||
MTQwNzIwMTgyNzEzWjCBijELMAkGA1UEBhMCVVMxEDAOBgNVBAgTB01vbnRhbmEx
|
||||
EDAOBgNVBAcTB0JvemVtYW4xDjAMBgNVBAoTBXlhU1NMMRAwDgYDVQQLEwdTdXBw
|
||||
b3J0MRYwFAYDVQQDEw13d3cueWFzc2wuY29tMR0wGwYJKoZIhvcNAQkBFg5pbmZv
|
||||
QHlhc3NsLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMCVCOFX
|
||||
QfJxbbfSRUEnAWXGRa7yvCQwuJXOL07W9hyIvHyf+6hnf/5cnFF194rKB+c1L4/h
|
||||
vXvAL3yrZKgX/Mpde7rgIeVyLm8uhtiVc9qsG1O5Xz/XGQ0lT+FjY1GLC2Q/rUO4
|
||||
pRxcNLOuAKBjxfZ/C1loeHOmjBipAm2vwxkBLrgQ48bMQLRpo0YzaYduxLsXpvPo
|
||||
3a1zvHsvIbX9ZlEMvVSz4W1fHLwjc9EJA4kU0hC5ZMMq0KGWSrzh1Bpbx6DAwWN4
|
||||
D0Q3MDKWgDIjlaF3uhPSl3PiXSXJag3DOWCktLBpQkIJ6dgIvDMgs1gip6rrxOHm
|
||||
YYPF0pbf2dBPrdcCAwEAATANBgkqhkiG9w0BAQUFAAOCAQEAcU7TYt/MTPfNt25S
|
||||
C2xu4L3CLQfXwLBuQx41vDABUPD/mSNsGBpBthHW1Blh/eR3lxw54VerxRVjdxE2
|
||||
XnTiJAsfQXitt4HntEBmgPBLkaBtqG49U9mLzirhC0Vlh6GWru4+iNUSH3gXrizF
|
||||
c0TY3PSv2MyuTOEMvlWkmfdulsDIRYe/3FFX/55zN2oYnMP5Inr0sFK9/CEw+MX/
|
||||
Hod9raJaNfUiqLQKdjjmdrCYrxvsigpDdNKFNDeEB+H2I7Ip3qa2t0xXfpYGy6kW
|
||||
JSk6Ay1VfaaMpPeegcmVtnzBSs6UZgzKiOvSCfVbGViC3yf9Z5V4twIG1adhve86
|
||||
/LJhzQ==
|
||||
-----END CERTIFICATE-----
|
||||
Certificate:
|
||||
Data:
|
||||
Version: 3 (0x2)
|
||||
Serial Number:
|
||||
e9:d0:a7:5f:79:25:f4:3c
|
||||
Signature Algorithm: sha1WithRSAEncryption
|
||||
Issuer: C=US, ST=Montana, L=Bozeman, O=Sawtooth, OU=Consulting, CN=www.yassl.com/emailAddress=info@yassl.com
|
||||
Validity
|
||||
Not Before: Oct 24 18:18:15 2011 GMT
|
||||
Not After : Jul 20 18:18:15 2014 GMT
|
||||
Subject: C=US, ST=Montana, L=Bozeman, O=Sawtooth, OU=Consulting, CN=www.yassl.com/emailAddress=info@yassl.com
|
||||
Subject Public Key Info:
|
||||
Public Key Algorithm: rsaEncryption
|
||||
RSA Public Key: (2048 bit)
|
||||
Modulus (2048 bit):
|
||||
00:bf:0c:ca:2d:14:b2:1e:84:42:5b:cd:38:1f:4a:
|
||||
f2:4d:75:10:f1:b6:35:9f:df:ca:7d:03:98:d3:ac:
|
||||
de:03:66:ee:2a:f1:d8:b0:7d:6e:07:54:0b:10:98:
|
||||
21:4d:80:cb:12:20:e7:cc:4f:de:45:7d:c9:72:77:
|
||||
32:ea:ca:90:bb:69:52:10:03:2f:a8:f3:95:c5:f1:
|
||||
8b:62:56:1b:ef:67:6f:a4:10:41:95:ad:0a:9b:e3:
|
||||
a5:c0:b0:d2:70:76:50:30:5b:a8:e8:08:2c:7c:ed:
|
||||
a7:a2:7a:8d:38:29:1c:ac:c7:ed:f2:7c:95:b0:95:
|
||||
82:7d:49:5c:38:cd:77:25:ef:bd:80:75:53:94:3c:
|
||||
3d:ca:63:5b:9f:15:b5:d3:1d:13:2f:19:d1:3c:db:
|
||||
76:3a:cc:b8:7d:c9:e5:c2:d7:da:40:6f:d8:21:dc:
|
||||
73:1b:42:2d:53:9c:fe:1a:fc:7d:ab:7a:36:3f:98:
|
||||
de:84:7c:05:67:ce:6a:14:38:87:a9:f1:8c:b5:68:
|
||||
cb:68:7f:71:20:2b:f5:a0:63:f5:56:2f:a3:26:d2:
|
||||
b7:6f:b1:5a:17:d7:38:99:08:fe:93:58:6f:fe:c3:
|
||||
13:49:08:16:0b:a7:4d:67:00:52:31:67:23:4e:98:
|
||||
ed:51:45:1d:b9:04:d9:0b:ec:d8:28:b3:4b:bd:ed:
|
||||
36:79
|
||||
Exponent: 65537 (0x10001)
|
||||
X509v3 extensions:
|
||||
X509v3 Subject Key Identifier:
|
||||
27:8E:67:11:74:C3:26:1D:3F:ED:33:63:B3:A4:D8:1D:30:E5:E8:D5
|
||||
X509v3 Authority Key Identifier:
|
||||
keyid:27:8E:67:11:74:C3:26:1D:3F:ED:33:63:B3:A4:D8:1D:30:E5:E8:D5
|
||||
DirName:/C=US/ST=Montana/L=Bozeman/O=Sawtooth/OU=Consulting/CN=www.yassl.com/emailAddress=info@yassl.com
|
||||
serial:E9:D0:A7:5F:79:25:F4:3C
|
||||
|
||||
X509v3 Basic Constraints:
|
||||
CA:TRUE
|
||||
Signature Algorithm: sha1WithRSAEncryption
|
||||
5f:86:14:f4:51:8b:bc:a5:4e:30:da:5e:ac:9a:f8:6c:d9:26:
|
||||
4b:93:f9:e3:1c:89:6f:9e:ee:b3:9d:77:3e:89:20:76:a3:e6:
|
||||
e8:86:15:21:db:e2:33:b2:34:d5:d0:9f:f3:c1:a4:87:92:5c:
|
||||
f9:d1:ff:30:2f:8e:03:bc:b3:3c:0c:32:a3:90:5f:1a:90:1e:
|
||||
af:9d:f3:9e:d7:07:02:a9:7d:27:66:63:2f:af:18:d7:ac:18:
|
||||
98:8c:83:8f:38:f3:0b:ac:36:10:75:fb:ca:76:13:50:5b:02:
|
||||
8f:73:bf:e3:a0:ee:83:52:25:54:ce:26:ce:9c:bd:2f:79:ab:
|
||||
1b:60:b8:92:f1:03:c0:fc:3b:08:d9:c0:ad:d5:72:08:25:80:
|
||||
61:2d:dc:9f:a7:83:62:07:47:e0:07:4c:4b:07:30:04:a9:87:
|
||||
1c:55:7f:07:12:d0:cb:42:5d:cb:cf:66:01:1a:17:ee:f9:0f:
|
||||
60:b7:db:6f:68:e5:4e:41:62:6e:d3:6f:60:4f:4b:27:de:cf:
|
||||
18:07:f1:13:5d:cb:3f:a9:25:44:da:52:5c:c8:04:e1:56:12:
|
||||
f5:2a:90:4e:d1:e2:af:01:b5:23:a1:ec:31:da:7b:63:69:c4:
|
||||
b8:f3:e7:ce:a1:3d:c0:db:6d:f3:b2:d9:46:c8:9f:c3:b8:70:
|
||||
5a:1f:7f:ca
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIIEnjCCA4agAwIBAgIJAOnQp195JfQ8MA0GCSqGSIb3DQEBBQUAMIGQMQswCQYD
|
||||
VQQGEwJVUzEQMA4GA1UECBMHTW9udGFuYTEQMA4GA1UEBxMHQm96ZW1hbjERMA8G
|
||||
A1UEChMIU2F3dG9vdGgxEzARBgNVBAsTCkNvbnN1bHRpbmcxFjAUBgNVBAMTDXd3
|
||||
dy55YXNzbC5jb20xHTAbBgkqhkiG9w0BCQEWDmluZm9AeWFzc2wuY29tMB4XDTEx
|
||||
MTAyNDE4MTgxNVoXDTE0MDcyMDE4MTgxNVowgZAxCzAJBgNVBAYTAlVTMRAwDgYD
|
||||
VQQIEwdNb250YW5hMRAwDgYDVQQHEwdCb3plbWFuMREwDwYDVQQKEwhTYXd0b290
|
||||
aDETMBEGA1UECxMKQ29uc3VsdGluZzEWMBQGA1UEAxMNd3d3Lnlhc3NsLmNvbTEd
|
||||
MBsGCSqGSIb3DQEJARYOaW5mb0B5YXNzbC5jb20wggEiMA0GCSqGSIb3DQEBAQUA
|
||||
A4IBDwAwggEKAoIBAQC/DMotFLIehEJbzTgfSvJNdRDxtjWf38p9A5jTrN4DZu4q
|
||||
8diwfW4HVAsQmCFNgMsSIOfMT95FfclydzLqypC7aVIQAy+o85XF8YtiVhvvZ2+k
|
||||
EEGVrQqb46XAsNJwdlAwW6joCCx87aeieo04KRysx+3yfJWwlYJ9SVw4zXcl772A
|
||||
dVOUPD3KY1ufFbXTHRMvGdE823Y6zLh9yeXC19pAb9gh3HMbQi1TnP4a/H2rejY/
|
||||
mN6EfAVnzmoUOIep8Yy1aMtof3EgK/WgY/VWL6Mm0rdvsVoX1ziZCP6TWG/+wxNJ
|
||||
CBYLp01nAFIxZyNOmO1RRR25BNkL7Ngos0u97TZ5AgMBAAGjgfgwgfUwHQYDVR0O
|
||||
BBYEFCeOZxF0wyYdP+0zY7Ok2B0w5ejVMIHFBgNVHSMEgb0wgbqAFCeOZxF0wyYd
|
||||
P+0zY7Ok2B0w5ejVoYGWpIGTMIGQMQswCQYDVQQGEwJVUzEQMA4GA1UECBMHTW9u
|
||||
dGFuYTEQMA4GA1UEBxMHQm96ZW1hbjERMA8GA1UEChMIU2F3dG9vdGgxEzARBgNV
|
||||
BAsTCkNvbnN1bHRpbmcxFjAUBgNVBAMTDXd3dy55YXNzbC5jb20xHTAbBgkqhkiG
|
||||
9w0BCQEWDmluZm9AeWFzc2wuY29tggkA6dCnX3kl9DwwDAYDVR0TBAUwAwEB/zAN
|
||||
BgkqhkiG9w0BAQUFAAOCAQEAX4YU9FGLvKVOMNperJr4bNkmS5P54xyJb57us513
|
||||
PokgdqPm6IYVIdviM7I01dCf88Gkh5Jc+dH/MC+OA7yzPAwyo5BfGpAer53zntcH
|
||||
Aql9J2ZjL68Y16wYmIyDjzjzC6w2EHX7ynYTUFsCj3O/46Dug1IlVM4mzpy9L3mr
|
||||
G2C4kvEDwPw7CNnArdVyCCWAYS3cn6eDYgdH4AdMSwcwBKmHHFV/BxLQy0Jdy89m
|
||||
ARoX7vkPYLfbb2jlTkFibtNvYE9LJ97PGAfxE13LP6klRNpSXMgE4VYS9SqQTtHi
|
||||
rwG1I6HsMdp7Y2nEuPPnzqE9wNtt87LZRsifw7hwWh9/yg==
|
||||
-----END CERTIFICATE-----
|
||||
@@ -1,54 +0,0 @@
|
||||
Certificate:
|
||||
Data:
|
||||
Version: 1 (0x0)
|
||||
Serial Number: 9 (0x9)
|
||||
Signature Algorithm: sha1WithRSAEncryption
|
||||
Issuer: C=US, ST=Montana, L=Bozeman, O=Sawtooth, OU=Consulting, CN=www.yassl.com/emailAddress=info@yassl.com
|
||||
Validity
|
||||
Not Before: Aug 8 21:58:29 2012 GMT
|
||||
Not After : May 5 21:58:29 2015 GMT
|
||||
Subject: C=US, ST=Washington, L=Seattle, O=Elliptic - RSAsig, OU=ECC-RSAsig, CN=www.yassl.com/emailAddress=info@yassl.com
|
||||
Subject Public Key Info:
|
||||
Public Key Algorithm: id-ecPublicKey
|
||||
EC Public Key:
|
||||
pub:
|
||||
04:bb:33:ac:4c:27:50:4a:c6:4a:a5:04:c3:3c:de:
|
||||
9f:36:db:72:2d:ce:94:ea:2b:fa:cb:20:09:39:2c:
|
||||
16:e8:61:02:e9:af:4d:d3:02:93:9a:31:5b:97:92:
|
||||
21:7f:f0:cf:18:da:91:11:02:34:86:e8:20:58:33:
|
||||
0b:80:34:89:d8
|
||||
ASN1 OID: prime256v1
|
||||
Signature Algorithm: sha1WithRSAEncryption
|
||||
a0:1c:de:98:e8:61:c8:fb:0a:0e:af:ea:99:4b:c0:49:e6:66:
|
||||
68:5e:7a:18:b8:0c:e3:0f:16:86:bc:b5:86:79:02:69:1c:b7:
|
||||
e7:ff:53:d9:05:5d:27:39:24:54:67:14:de:ef:8e:c2:a0:11:
|
||||
ca:c8:27:99:b9:d6:e9:71:1f:86:c9:8f:b1:74:a2:9f:93:6a:
|
||||
0c:74:cf:17:77:8c:26:08:6e:a8:ac:69:d4:55:15:a2:95:87:
|
||||
43:7a:ab:72:93:73:40:58:c2:bb:9c:89:f2:73:20:69:df:f1:
|
||||
f3:65:08:9c:00:67:97:a6:71:00:2b:31:84:10:ac:bd:54:ac:
|
||||
fd:b3:eb:12:36:77:f6:0a:e3:9a:96:d2:a6:22:bc:1d:6b:ce:
|
||||
3c:0d:7b:d9:1c:1d:f1:ee:ec:ce:83:c8:98:c9:65:3e:06:31:
|
||||
c3:b2:87:da:09:b4:90:0b:e2:6b:29:0e:d6:ae:53:1d:10:98:
|
||||
e2:dc:f9:63:38:a1:a2:af:46:23:a4:4c:ab:0c:0b:08:be:cd:
|
||||
a4:a6:6d:46:f0:f8:e0:31:99:85:39:10:4a:a0:04:54:3b:21:
|
||||
e1:e9:b4:f3:a5:06:cd:37:ae:2c:ca:5d:ac:90:b5:ab:92:81:
|
||||
aa:bf:2d:3f:8e:ee:4d:12:81:0a:8e:a4:ca:87:93:af:b0:25:
|
||||
7e:e2:07:f7
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIIC1zCCAb8CAQkwDQYJKoZIhvcNAQEFBQAwgZAxCzAJBgNVBAYTAlVTMRAwDgYD
|
||||
VQQIEwdNb250YW5hMRAwDgYDVQQHEwdCb3plbWFuMREwDwYDVQQKEwhTYXd0b290
|
||||
aDETMBEGA1UECxMKQ29uc3VsdGluZzEWMBQGA1UEAxMNd3d3Lnlhc3NsLmNvbTEd
|
||||
MBsGCSqGSIb3DQEJARYOaW5mb0B5YXNzbC5jb20wHhcNMTIwODA4MjE1ODI5WhcN
|
||||
MTUwNTA1MjE1ODI5WjCBnDELMAkGA1UEBhMCVVMxEzARBgNVBAgTCldhc2hpbmd0
|
||||
b24xEDAOBgNVBAcTB1NlYXR0bGUxGjAYBgNVBAoTEUVsbGlwdGljIC0gUlNBc2ln
|
||||
MRMwEQYDVQQLEwpFQ0MtUlNBc2lnMRYwFAYDVQQDEw13d3cueWFzc2wuY29tMR0w
|
||||
GwYJKoZIhvcNAQkBFg5pbmZvQHlhc3NsLmNvbTBZMBMGByqGSM49AgEGCCqGSM49
|
||||
AwEHA0IABLszrEwnUErGSqUEwzzenzbbci3OlOor+ssgCTksFuhhAumvTdMCk5ox
|
||||
W5eSIX/wzxjakRECNIboIFgzC4A0idgwDQYJKoZIhvcNAQEFBQADggEBAKAc3pjo
|
||||
Ycj7Cg6v6plLwEnmZmheehi4DOMPFoa8tYZ5Amkct+f/U9kFXSc5JFRnFN7vjsKg
|
||||
EcrIJ5m51ulxH4bJj7F0op+Tagx0zxd3jCYIbqisadRVFaKVh0N6q3KTc0BYwruc
|
||||
ifJzIGnf8fNlCJwAZ5emcQArMYQQrL1UrP2z6xI2d/YK45qW0qYivB1rzjwNe9kc
|
||||
HfHu7M6DyJjJZT4GMcOyh9oJtJAL4mspDtauUx0QmOLc+WM4oaKvRiOkTKsMCwi+
|
||||
zaSmbUbw+OAxmYU5EEqgBFQ7IeHptPOlBs03rizKXayQtauSgaq/LT+O7k0SgQqO
|
||||
pMqHk6+wJX7iB/c=
|
||||
-----END CERTIFICATE-----
|
||||
@@ -1,55 +0,0 @@
|
||||
Certificate:
|
||||
Data:
|
||||
Version: 3 (0x2)
|
||||
Serial Number:
|
||||
f4:cc:72:08:11:35:69:b3
|
||||
Signature Algorithm: ecdsa-with-SHA1
|
||||
Issuer: C=US, ST=Washington, L=Seattle, O=Eliptic, OU=ECC, CN=www.yassl.com/emailAddress=info@yassl.com
|
||||
Validity
|
||||
Not Before: Jan 25 20:09:20 2011 GMT
|
||||
Not After : Oct 21 20:09:20 2013 GMT
|
||||
Subject: C=US, ST=Washington, L=Seattle, O=Eliptic, OU=ECC, CN=www.yassl.com/emailAddress=info@yassl.com
|
||||
Subject Public Key Info:
|
||||
Public Key Algorithm: id-ecPublicKey
|
||||
EC Public Key:
|
||||
pub:
|
||||
04:bb:33:ac:4c:27:50:4a:c6:4a:a5:04:c3:3c:de:
|
||||
9f:36:db:72:2d:ce:94:ea:2b:fa:cb:20:09:39:2c:
|
||||
16:e8:61:02:e9:af:4d:d3:02:93:9a:31:5b:97:92:
|
||||
21:7f:f0:cf:18:da:91:11:02:34:86:e8:20:58:33:
|
||||
0b:80:34:89:d8
|
||||
ASN1 OID: prime256v1
|
||||
X509v3 extensions:
|
||||
X509v3 Subject Key Identifier:
|
||||
5D:5D:26:EF:AC:7E:36:F9:9B:76:15:2B:4A:25:02:23:EF:B2:89:30
|
||||
X509v3 Authority Key Identifier:
|
||||
keyid:5D:5D:26:EF:AC:7E:36:F9:9B:76:15:2B:4A:25:02:23:EF:B2:89:30
|
||||
DirName:/C=US/ST=Washington/L=Seattle/O=Eliptic/OU=ECC/CN=www.yassl.com/emailAddress=info@yassl.com
|
||||
serial:F4:CC:72:08:11:35:69:B3
|
||||
|
||||
X509v3 Basic Constraints:
|
||||
CA:TRUE
|
||||
Signature Algorithm: ecdsa-with-SHA1
|
||||
30:44:02:20:08:9b:66:9f:39:ef:49:2b:99:92:31:65:a1:87:
|
||||
10:91:63:fe:69:e0:5f:b0:49:66:0a:71:41:fd:08:c0:8e:4c:
|
||||
02:20:02:2a:60:37:e4:94:6b:3e:39:a8:6c:4f:07:75:2b:28:
|
||||
b3:f5:9d:c2:26:c7:64:1b:a9:7f:6e:e9:2a:a3:5e:4e
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIIDADCCAqigAwIBAgIJAPTMcggRNWmzMAkGByqGSM49BAEwgYsxCzAJBgNVBAYT
|
||||
AlVTMRMwEQYDVQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdTZWF0dGxlMRAwDgYD
|
||||
VQQKEwdFbGlwdGljMQwwCgYDVQQLEwNFQ0MxFjAUBgNVBAMTDXd3dy55YXNzbC5j
|
||||
b20xHTAbBgkqhkiG9w0BCQEWDmluZm9AeWFzc2wuY29tMB4XDTExMDEyNTIwMDky
|
||||
MFoXDTEzMTAyMTIwMDkyMFowgYsxCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpXYXNo
|
||||
aW5ndG9uMRAwDgYDVQQHEwdTZWF0dGxlMRAwDgYDVQQKEwdFbGlwdGljMQwwCgYD
|
||||
VQQLEwNFQ0MxFjAUBgNVBAMTDXd3dy55YXNzbC5jb20xHTAbBgkqhkiG9w0BCQEW
|
||||
DmluZm9AeWFzc2wuY29tMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEuzOsTCdQ
|
||||
SsZKpQTDPN6fNttyLc6U6iv6yyAJOSwW6GEC6a9N0wKTmjFbl5Ihf/DPGNqREQI0
|
||||
huggWDMLgDSJ2KOB8zCB8DAdBgNVHQ4EFgQUXV0m76x+NvmbdhUrSiUCI++yiTAw
|
||||
gcAGA1UdIwSBuDCBtYAUXV0m76x+NvmbdhUrSiUCI++yiTChgZGkgY4wgYsxCzAJ
|
||||
BgNVBAYTAlVTMRMwEQYDVQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdTZWF0dGxl
|
||||
MRAwDgYDVQQKEwdFbGlwdGljMQwwCgYDVQQLEwNFQ0MxFjAUBgNVBAMTDXd3dy55
|
||||
YXNzbC5jb20xHTAbBgkqhkiG9w0BCQEWDmluZm9AeWFzc2wuY29tggkA9MxyCBE1
|
||||
abMwDAYDVR0TBAUwAwEB/zAJBgcqhkjOPQQBA0cAMEQCIAibZp8570krmZIxZaGH
|
||||
EJFj/mngX7BJZgpxQf0IwI5MAiACKmA35JRrPjmobE8HdSsos/WdwibHZBupf27p
|
||||
KqNeTg==
|
||||
-----END CERTIFICATE-----
|
||||
@@ -1,29 +0,0 @@
|
||||
-----BEGIN ENCRYPTED PRIVATE KEY-----
|
||||
MIIE5TAcBgoqhkiG9w0BDAEBMA4ECFytdly5R2o9AgIIAASCBMOa6fgAUIR5GokK
|
||||
Z81YZMxC3sNqAwjLEkOwmez2za2fq+2mw6T8tB5W75lFpWyXD1MDPa1PpLzyw27c
|
||||
d2C8nipCzp37yYLmXr+aS519CBJR80ily/WLcdv+ScsA6pjOEW2p+VDY55jFp2pr
|
||||
n94/K2nFQpMxAdjxnqQCF5ewMLqzy3o3s6U3V9zIxy/xlLYi//UWFI8fqtOikqs4
|
||||
apWLNqJONRZq95OITKO/Nhz7GyEfjrewJmv4zVToEnSagSwbR4IVFn5Lok8rSpI9
|
||||
qwey9wsB1CguVwR0O2NjDVKUGXinfhdr+zMQlCoz+xY/Q1TkH4gEY5wpln4cBvtm
|
||||
PL/BnD4wEWHh8vS61wfOQ7wPgY+cdCe75stTrKzc6amVJB+40Qi3Vt4TEPGwcP16
|
||||
/qGl0zpYuAgilPtuEBw3GX3LiigpHmSt43D3DiYNGzv+Aran2Ei9iGSGeI2zHz8r
|
||||
WFZEnptAwlqeyL7+MZjAOXlu6QG1yix8HvZLmtBHrE2MhuR4KbS3fAUCNQpn8OKu
|
||||
zxYzs1ti5F2V4c9yK63gSz3H1ObRNsM2OkpUbSVGqLUN6a8HsI6yYh4we6q0gxKD
|
||||
VGdzEz4S1BFEBfXWVSPnRNMR4YD8kiQEPutUZFLiWWZ7WliH5yNfHZUia8dovxFa
|
||||
MWmAbSjMKRGvV+LvAGQHYBVfJSQO6VvBfBDtu0H4rLr8urmcPY+hbw1XxGfKSQp1
|
||||
iIdvVwjefl8wM9LSRsvqY5l4mu+XDPanQlFbzKBOSyLQts97ys3AR+jkK8Bmv14l
|
||||
xmCF8bJzzz5a2wAqbPhWIbk4J4VfcJEXNMzd19w4SxGv9fUXNiZZElUdNE+wtRsQ
|
||||
YvACYn9sZ6JUwg9hNTLXuXZY47LuQrrdTDHupoVA9zLvUYMKgO+pjwS8uy1dLQao
|
||||
0aztHLZEXuVJvpiRoMtYZl37ZNoLHQJeZUNyNATshAoD1+uSc7aywl8yqdTzXRR2
|
||||
g0rkExXEVJ5OPyzbFdOQSC5HoOC7dInIBmkrSFEJMKDkMzwYI+uSoIbn+8i+Gjzy
|
||||
Vh3/lftts/BIvr4NAh1ZAq/215jZSdAGo+1VZeuBeybwh3RBdBl8PhDBviTvbxSk
|
||||
P+F1T+UcbAz9bgjQJgNvDb9XHNI8rfEhfDPX/Pr4VvxBZNndmRJVQDKi23YD/7yF
|
||||
WAwXy418M7DPqp7NYmUHFe7JRm9bHk41EeknLZaZGW5qHwQKA10RoJCgjoOIFTsd
|
||||
kD3Qq/0mEuOiuJn5UPE19xtUpvFWamDf3s3zSHM7VJ+gGNrS/WbQ+KmTimj0Wucd
|
||||
2vWiNCGbhWwmp3LLKQlB5xDwXJy099SZUUkgcxGmfcT7FOpd3QSLYnwtPz8uLW0N
|
||||
76zbiUTYCQ/ASLrwcKFGCKKBz62DlRreK23E/RjqkKKCVFzzg8AzQTa02ml+wQyG
|
||||
+5EOwEF2yIrhV0p4hY/GDAIe3cdchiy1EQf6xH/IxPF/QsKNp0CfHVPgdFwLzjM2
|
||||
oFD3analGblxp9CMiDbiKTOdFPL8XcguufqpWra2jtUbe07HQaeU2NcM2TeB2KsU
|
||||
PhgBwgdNxW69K55iHReaZtuLw0GhD+KBrm7gSteVniiYLzLKzxmMycGGtoNwpbGi
|
||||
MMJBE+BYZylG
|
||||
-----END ENCRYPTED PRIVATE KEY-----
|
||||
@@ -1,157 +0,0 @@
|
||||
|
||||
***** Create a self signed cert ************
|
||||
|
||||
1) openssl genrsa 512 > client-key.pem
|
||||
|
||||
2) openssl req -new -x509 -nodes -md5 -days 1000 -key client-key.pem > client-cert.pem
|
||||
|
||||
3) note sha1 would be -sha1
|
||||
|
||||
-- adding metadata to beginning
|
||||
|
||||
3) openssl x509 -in client-cert.pem -text > tmp.pem
|
||||
|
||||
4) mv tmp.pem client-cert.pem
|
||||
|
||||
|
||||
***** Create a CA, signing authority **********
|
||||
|
||||
same as self signed, use ca prefix instead of client
|
||||
|
||||
|
||||
***** Create a cert signed by CA **************
|
||||
|
||||
1) openssl req -newkey rsa:512 -md5 -days 1000 -nodes -keyout server-key.pem > server-req.pem
|
||||
|
||||
* note if using exisitng key do: -new -key keyName
|
||||
|
||||
2) copy ca-key.pem ca-cert.srl (why ????)
|
||||
|
||||
3) openssl x509 -req -in server-req.pem -days 1000 -md5 -CA ca-cert.pem -CAkey ca-key.pem -set_serial 01 > server-cert.pem
|
||||
|
||||
|
||||
|
||||
***** To create a dsa cert ********************
|
||||
|
||||
1) openssl dsaparam 512 > dsa512.param # creates group params
|
||||
|
||||
2) openssl gendsa dsa512.param > dsa512.pem # creates private key
|
||||
|
||||
3) openssl req -new -x509 -nodes -days 1000 -key dsa512.pem > dsa-cert.pem
|
||||
|
||||
|
||||
|
||||
|
||||
***** To convert from PEM to DER **************
|
||||
|
||||
a) openssl x509 -in cert.pem -inform PEM -out cert.der -outform DER
|
||||
|
||||
to convert rsa private PEM to DER :
|
||||
|
||||
b) openssl rsa -in key.pem -outform DER -out key.der
|
||||
|
||||
|
||||
**** To encrypt rsa key already in pem **********
|
||||
|
||||
a) openssl rsa <server-key.pem.bak -des >server-keyEnc.pem
|
||||
|
||||
note location of des, pass = yassl123
|
||||
|
||||
|
||||
*** To make a public key from a private key ******
|
||||
|
||||
|
||||
openssl rsa -in 1024rsa.priv -pubout -out 1024rsa.pub
|
||||
|
||||
|
||||
**** To convert to pkcs8 *******
|
||||
|
||||
openssl pkcs8 -nocrypt -topk8 -in server-key.pem -out server-keyPkcs8.pem
|
||||
|
||||
|
||||
**** To convert to pkcs8 encrypted *******
|
||||
|
||||
openssl pkcs8 -topk8 -in server-key.pem -out server-keyPkcs8Enc.pem
|
||||
|
||||
passwd: yassl123
|
||||
|
||||
to use PKCS#5 v2 instead of v1.5 which is default add
|
||||
|
||||
-v2 des3 # file Pkcs8Enc2
|
||||
|
||||
to use PKCS#12 instead use -v1 witch a 12 algo like
|
||||
|
||||
-v1 PBE-SHA1-RC4-128 # file Pkcs8Enc12 , see man pkcs8 for more info
|
||||
|
||||
|
||||
**** To convert from pkcs8 to traditional ****
|
||||
|
||||
openssl pkcs8 -nocrypt -in server-keyPkcs8.pem -out server-key.pem
|
||||
|
||||
|
||||
*** DH paramters ***
|
||||
|
||||
openssl dhparam 2048 > dh2048.param
|
||||
|
||||
to add metadata
|
||||
|
||||
openssl dhparam -in dh2048.param -text > dh2048.pem
|
||||
|
||||
**** ECC ******
|
||||
|
||||
1) make a key
|
||||
|
||||
to see types available do
|
||||
openssl ecparam -list_curves
|
||||
|
||||
make a new key
|
||||
openssl ecparam -genkey -text -name secp256r1 -out ecc-key.pem
|
||||
|
||||
|
||||
*** CRL ***
|
||||
|
||||
1) create a crl
|
||||
|
||||
a) openssl ca -gencrl -crldays 120 -out crl.pem -keyfile ./ca-key.pem -cert ./ca-cert.pem
|
||||
|
||||
Error No ./CA root/index.txt so:
|
||||
|
||||
b) touch ./CA root/index.txt
|
||||
|
||||
a) again
|
||||
|
||||
Error No ./CA root/crlnumber so:
|
||||
|
||||
c) touch ./CA root/crlnumber
|
||||
|
||||
a) again
|
||||
|
||||
Error unable to load CRL number
|
||||
|
||||
d) add '01' to crlnumber file
|
||||
|
||||
a) again
|
||||
|
||||
2) view crl file
|
||||
|
||||
openssl crl -in crl.pem -text
|
||||
|
||||
3) revoke
|
||||
|
||||
openssl ca -revoke server-cert.pem -keyfile ./ca-key.pem -cert ./ca-cert.pem
|
||||
|
||||
Then regenerate crl with a)
|
||||
|
||||
4) verify
|
||||
|
||||
openssl verify -CAfile ./ca-cert.pem ./server-cert.pem
|
||||
|
||||
OK
|
||||
|
||||
Make file with both ca and crl
|
||||
|
||||
cat ca-cert.pem crl.pem > ca-crl.pem
|
||||
|
||||
openssl verify -CAfile ./ca-crl.pem -crl_check ./ca-cert.pem
|
||||
|
||||
revoked
|
||||
@@ -1,142 +0,0 @@
|
||||
#! /bin/sh
|
||||
# Wrapper for compilers which do not understand `-c -o'.
|
||||
|
||||
scriptversion=2005-05-14.22
|
||||
|
||||
# Copyright (C) 1999, 2000, 2003, 2004, 2005 Free Software Foundation, Inc.
|
||||
# Written by Tom Tromey <tromey@cygnus.com>.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2, or (at your option)
|
||||
# any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
|
||||
# As a special exception to the GNU General Public License, if you
|
||||
# distribute this file as part of a program that contains a
|
||||
# configuration script generated by Autoconf, you may include it under
|
||||
# the same distribution terms that you use for the rest of that program.
|
||||
|
||||
# This file is maintained in Automake, please report
|
||||
# bugs to <bug-automake@gnu.org> or send patches to
|
||||
# <automake-patches@gnu.org>.
|
||||
|
||||
case $1 in
|
||||
'')
|
||||
echo "$0: No command. Try \`$0 --help' for more information." 1>&2
|
||||
exit 1;
|
||||
;;
|
||||
-h | --h*)
|
||||
cat <<\EOF
|
||||
Usage: compile [--help] [--version] PROGRAM [ARGS]
|
||||
|
||||
Wrapper for compilers which do not understand `-c -o'.
|
||||
Remove `-o dest.o' from ARGS, run PROGRAM with the remaining
|
||||
arguments, and rename the output as expected.
|
||||
|
||||
If you are trying to build a whole package this is not the
|
||||
right script to run: please start by reading the file `INSTALL'.
|
||||
|
||||
Report bugs to <bug-automake@gnu.org>.
|
||||
EOF
|
||||
exit $?
|
||||
;;
|
||||
-v | --v*)
|
||||
echo "compile $scriptversion"
|
||||
exit $?
|
||||
;;
|
||||
esac
|
||||
|
||||
ofile=
|
||||
cfile=
|
||||
eat=
|
||||
|
||||
for arg
|
||||
do
|
||||
if test -n "$eat"; then
|
||||
eat=
|
||||
else
|
||||
case $1 in
|
||||
-o)
|
||||
# configure might choose to run compile as `compile cc -o foo foo.c'.
|
||||
# So we strip `-o arg' only if arg is an object.
|
||||
eat=1
|
||||
case $2 in
|
||||
*.o | *.obj)
|
||||
ofile=$2
|
||||
;;
|
||||
*)
|
||||
set x "$@" -o "$2"
|
||||
shift
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
*.c)
|
||||
cfile=$1
|
||||
set x "$@" "$1"
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
set x "$@" "$1"
|
||||
shift
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
shift
|
||||
done
|
||||
|
||||
if test -z "$ofile" || test -z "$cfile"; then
|
||||
# If no `-o' option was seen then we might have been invoked from a
|
||||
# pattern rule where we don't need one. That is ok -- this is a
|
||||
# normal compilation that the losing compiler can handle. If no
|
||||
# `.c' file was seen then we are probably linking. That is also
|
||||
# ok.
|
||||
exec "$@"
|
||||
fi
|
||||
|
||||
# Name of file we expect compiler to create.
|
||||
cofile=`echo "$cfile" | sed -e 's|^.*/||' -e 's/\.c$/.o/'`
|
||||
|
||||
# Create the lock directory.
|
||||
# Note: use `[/.-]' here to ensure that we don't use the same name
|
||||
# that we are using for the .o file. Also, base the name on the expected
|
||||
# object file name, since that is what matters with a parallel build.
|
||||
lockdir=`echo "$cofile" | sed -e 's|[/.-]|_|g'`.d
|
||||
while true; do
|
||||
if mkdir "$lockdir" >/dev/null 2>&1; then
|
||||
break
|
||||
fi
|
||||
sleep 1
|
||||
done
|
||||
# FIXME: race condition here if user kills between mkdir and trap.
|
||||
trap "rmdir '$lockdir'; exit 1" 1 2 15
|
||||
|
||||
# Run the compile.
|
||||
"$@"
|
||||
ret=$?
|
||||
|
||||
if test -f "$cofile"; then
|
||||
mv "$cofile" "$ofile"
|
||||
elif test -f "${cofile}bj"; then
|
||||
mv "${cofile}bj" "$ofile"
|
||||
fi
|
||||
|
||||
rmdir "$lockdir"
|
||||
exit $ret
|
||||
|
||||
# Local Variables:
|
||||
# mode: shell-script
|
||||
# sh-indentation: 2
|
||||
# eval: (add-hook 'write-file-hooks 'time-stamp)
|
||||
# time-stamp-start: "scriptversion="
|
||||
# time-stamp-format: "%:y-%02m-%02d.%02H"
|
||||
# time-stamp-end: "$"
|
||||
# End:
|
||||
@@ -1,584 +0,0 @@
|
||||
#! /bin/sh
|
||||
# depcomp - compile a program generating dependencies as side-effects
|
||||
|
||||
scriptversion=2006-10-15.18
|
||||
|
||||
# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006 Free Software
|
||||
# Foundation, Inc.
|
||||
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2, or (at your option)
|
||||
# any later version.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
# 02110-1301, USA.
|
||||
|
||||
# As a special exception to the GNU General Public License, if you
|
||||
# distribute this file as part of a program that contains a
|
||||
# configuration script generated by Autoconf, you may include it under
|
||||
# the same distribution terms that you use for the rest of that program.
|
||||
|
||||
# Originally written by Alexandre Oliva <oliva@dcc.unicamp.br>.
|
||||
|
||||
case $1 in
|
||||
'')
|
||||
echo "$0: No command. Try \`$0 --help' for more information." 1>&2
|
||||
exit 1;
|
||||
;;
|
||||
-h | --h*)
|
||||
cat <<\EOF
|
||||
Usage: depcomp [--help] [--version] PROGRAM [ARGS]
|
||||
|
||||
Run PROGRAMS ARGS to compile a file, generating dependencies
|
||||
as side-effects.
|
||||
|
||||
Environment variables:
|
||||
depmode Dependency tracking mode.
|
||||
source Source file read by `PROGRAMS ARGS'.
|
||||
object Object file output by `PROGRAMS ARGS'.
|
||||
DEPDIR directory where to store dependencies.
|
||||
depfile Dependency file to output.
|
||||
tmpdepfile Temporary file to use when outputing dependencies.
|
||||
libtool Whether libtool is used (yes/no).
|
||||
|
||||
Report bugs to <bug-automake@gnu.org>.
|
||||
EOF
|
||||
exit $?
|
||||
;;
|
||||
-v | --v*)
|
||||
echo "depcomp $scriptversion"
|
||||
exit $?
|
||||
;;
|
||||
esac
|
||||
|
||||
if test -z "$depmode" || test -z "$source" || test -z "$object"; then
|
||||
echo "depcomp: Variables source, object and depmode must be set" 1>&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po.
|
||||
depfile=${depfile-`echo "$object" |
|
||||
sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`}
|
||||
tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
|
||||
|
||||
rm -f "$tmpdepfile"
|
||||
|
||||
# Some modes work just like other modes, but use different flags. We
|
||||
# parameterize here, but still list the modes in the big case below,
|
||||
# to make depend.m4 easier to write. Note that we *cannot* use a case
|
||||
# here, because this file can only contain one case statement.
|
||||
if test "$depmode" = hp; then
|
||||
# HP compiler uses -M and no extra arg.
|
||||
gccflag=-M
|
||||
depmode=gcc
|
||||
fi
|
||||
|
||||
if test "$depmode" = dashXmstdout; then
|
||||
# This is just like dashmstdout with a different argument.
|
||||
dashmflag=-xM
|
||||
depmode=dashmstdout
|
||||
fi
|
||||
|
||||
case "$depmode" in
|
||||
gcc3)
|
||||
## gcc 3 implements dependency tracking that does exactly what
|
||||
## we want. Yay! Note: for some reason libtool 1.4 doesn't like
|
||||
## it if -MD -MP comes after the -MF stuff. Hmm.
|
||||
## Unfortunately, FreeBSD c89 acceptance of flags depends upon
|
||||
## the command line argument order; so add the flags where they
|
||||
## appear in depend2.am. Note that the slowdown incurred here
|
||||
## affects only configure: in makefiles, %FASTDEP% shortcuts this.
|
||||
for arg
|
||||
do
|
||||
case $arg in
|
||||
-c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;;
|
||||
*) set fnord "$@" "$arg" ;;
|
||||
esac
|
||||
shift # fnord
|
||||
shift # $arg
|
||||
done
|
||||
"$@"
|
||||
stat=$?
|
||||
if test $stat -eq 0; then :
|
||||
else
|
||||
rm -f "$tmpdepfile"
|
||||
exit $stat
|
||||
fi
|
||||
mv "$tmpdepfile" "$depfile"
|
||||
;;
|
||||
|
||||
gcc)
|
||||
## There are various ways to get dependency output from gcc. Here's
|
||||
## why we pick this rather obscure method:
|
||||
## - Don't want to use -MD because we'd like the dependencies to end
|
||||
## up in a subdir. Having to rename by hand is ugly.
|
||||
## (We might end up doing this anyway to support other compilers.)
|
||||
## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like
|
||||
## -MM, not -M (despite what the docs say).
|
||||
## - Using -M directly means running the compiler twice (even worse
|
||||
## than renaming).
|
||||
if test -z "$gccflag"; then
|
||||
gccflag=-MD,
|
||||
fi
|
||||
"$@" -Wp,"$gccflag$tmpdepfile"
|
||||
stat=$?
|
||||
if test $stat -eq 0; then :
|
||||
else
|
||||
rm -f "$tmpdepfile"
|
||||
exit $stat
|
||||
fi
|
||||
rm -f "$depfile"
|
||||
echo "$object : \\" > "$depfile"
|
||||
alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
|
||||
## The second -e expression handles DOS-style file names with drive letters.
|
||||
sed -e 's/^[^:]*: / /' \
|
||||
-e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile"
|
||||
## This next piece of magic avoids the `deleted header file' problem.
|
||||
## The problem is that when a header file which appears in a .P file
|
||||
## is deleted, the dependency causes make to die (because there is
|
||||
## typically no way to rebuild the header). We avoid this by adding
|
||||
## dummy dependencies for each header file. Too bad gcc doesn't do
|
||||
## this for us directly.
|
||||
tr ' ' '
|
||||
' < "$tmpdepfile" |
|
||||
## Some versions of gcc put a space before the `:'. On the theory
|
||||
## that the space means something, we add a space to the output as
|
||||
## well.
|
||||
## Some versions of the HPUX 10.20 sed can't process this invocation
|
||||
## correctly. Breaking it into two sed invocations is a workaround.
|
||||
sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
||||
hp)
|
||||
# This case exists only to let depend.m4 do its work. It works by
|
||||
# looking at the text of this script. This case will never be run,
|
||||
# since it is checked for above.
|
||||
exit 1
|
||||
;;
|
||||
|
||||
sgi)
|
||||
if test "$libtool" = yes; then
|
||||
"$@" "-Wp,-MDupdate,$tmpdepfile"
|
||||
else
|
||||
"$@" -MDupdate "$tmpdepfile"
|
||||
fi
|
||||
stat=$?
|
||||
if test $stat -eq 0; then :
|
||||
else
|
||||
rm -f "$tmpdepfile"
|
||||
exit $stat
|
||||
fi
|
||||
rm -f "$depfile"
|
||||
|
||||
if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files
|
||||
echo "$object : \\" > "$depfile"
|
||||
|
||||
# Clip off the initial element (the dependent). Don't try to be
|
||||
# clever and replace this with sed code, as IRIX sed won't handle
|
||||
# lines with more than a fixed number of characters (4096 in
|
||||
# IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines;
|
||||
# the IRIX cc adds comments like `#:fec' to the end of the
|
||||
# dependency line.
|
||||
tr ' ' '
|
||||
' < "$tmpdepfile" \
|
||||
| sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \
|
||||
tr '
|
||||
' ' ' >> $depfile
|
||||
echo >> $depfile
|
||||
|
||||
# The second pass generates a dummy entry for each header file.
|
||||
tr ' ' '
|
||||
' < "$tmpdepfile" \
|
||||
| sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
|
||||
>> $depfile
|
||||
else
|
||||
# The sourcefile does not contain any dependencies, so just
|
||||
# store a dummy comment line, to avoid errors with the Makefile
|
||||
# "include basename.Plo" scheme.
|
||||
echo "#dummy" > "$depfile"
|
||||
fi
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
||||
aix)
|
||||
# The C for AIX Compiler uses -M and outputs the dependencies
|
||||
# in a .u file. In older versions, this file always lives in the
|
||||
# current directory. Also, the AIX compiler puts `$object:' at the
|
||||
# start of each line; $object doesn't have directory information.
|
||||
# Version 6 uses the directory in both cases.
|
||||
stripped=`echo "$object" | sed 's/\(.*\)\..*$/\1/'`
|
||||
tmpdepfile="$stripped.u"
|
||||
if test "$libtool" = yes; then
|
||||
"$@" -Wc,-M
|
||||
else
|
||||
"$@" -M
|
||||
fi
|
||||
stat=$?
|
||||
|
||||
if test -f "$tmpdepfile"; then :
|
||||
else
|
||||
stripped=`echo "$stripped" | sed 's,^.*/,,'`
|
||||
tmpdepfile="$stripped.u"
|
||||
fi
|
||||
|
||||
if test $stat -eq 0; then :
|
||||
else
|
||||
rm -f "$tmpdepfile"
|
||||
exit $stat
|
||||
fi
|
||||
|
||||
if test -f "$tmpdepfile"; then
|
||||
outname="$stripped.o"
|
||||
# Each line is of the form `foo.o: dependent.h'.
|
||||
# Do two passes, one to just change these to
|
||||
# `$object: dependent.h' and one to simply `dependent.h:'.
|
||||
sed -e "s,^$outname:,$object :," < "$tmpdepfile" > "$depfile"
|
||||
sed -e "s,^$outname: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile"
|
||||
else
|
||||
# The sourcefile does not contain any dependencies, so just
|
||||
# store a dummy comment line, to avoid errors with the Makefile
|
||||
# "include basename.Plo" scheme.
|
||||
echo "#dummy" > "$depfile"
|
||||
fi
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
||||
icc)
|
||||
# Intel's C compiler understands `-MD -MF file'. However on
|
||||
# icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c
|
||||
# ICC 7.0 will fill foo.d with something like
|
||||
# foo.o: sub/foo.c
|
||||
# foo.o: sub/foo.h
|
||||
# which is wrong. We want:
|
||||
# sub/foo.o: sub/foo.c
|
||||
# sub/foo.o: sub/foo.h
|
||||
# sub/foo.c:
|
||||
# sub/foo.h:
|
||||
# ICC 7.1 will output
|
||||
# foo.o: sub/foo.c sub/foo.h
|
||||
# and will wrap long lines using \ :
|
||||
# foo.o: sub/foo.c ... \
|
||||
# sub/foo.h ... \
|
||||
# ...
|
||||
|
||||
"$@" -MD -MF "$tmpdepfile"
|
||||
stat=$?
|
||||
if test $stat -eq 0; then :
|
||||
else
|
||||
rm -f "$tmpdepfile"
|
||||
exit $stat
|
||||
fi
|
||||
rm -f "$depfile"
|
||||
# Each line is of the form `foo.o: dependent.h',
|
||||
# or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'.
|
||||
# Do two passes, one to just change these to
|
||||
# `$object: dependent.h' and one to simply `dependent.h:'.
|
||||
sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile"
|
||||
# Some versions of the HPUX 10.20 sed can't process this invocation
|
||||
# correctly. Breaking it into two sed invocations is a workaround.
|
||||
sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" |
|
||||
sed -e 's/$/ :/' >> "$depfile"
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
||||
hp2)
|
||||
# The "hp" stanza above does not work with aCC (C++) and HP's ia64
|
||||
# compilers, which have integrated preprocessors. The correct option
|
||||
# to use with these is +Maked; it writes dependencies to a file named
|
||||
# 'foo.d', which lands next to the object file, wherever that
|
||||
# happens to be.
|
||||
# Much of this is similar to the tru64 case; see comments there.
|
||||
dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
|
||||
test "x$dir" = "x$object" && dir=
|
||||
base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
|
||||
if test "$libtool" = yes; then
|
||||
tmpdepfile1=$dir$base.d
|
||||
tmpdepfile2=$dir.libs/$base.d
|
||||
"$@" -Wc,+Maked
|
||||
else
|
||||
tmpdepfile1=$dir$base.d
|
||||
tmpdepfile2=$dir$base.d
|
||||
"$@" +Maked
|
||||
fi
|
||||
stat=$?
|
||||
if test $stat -eq 0; then :
|
||||
else
|
||||
rm -f "$tmpdepfile1" "$tmpdepfile2"
|
||||
exit $stat
|
||||
fi
|
||||
|
||||
for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2"
|
||||
do
|
||||
test -f "$tmpdepfile" && break
|
||||
done
|
||||
if test -f "$tmpdepfile"; then
|
||||
sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile"
|
||||
# Add `dependent.h:' lines.
|
||||
sed -ne '2,${; s/^ *//; s/ \\*$//; s/$/:/; p;}' "$tmpdepfile" >> "$depfile"
|
||||
else
|
||||
echo "#dummy" > "$depfile"
|
||||
fi
|
||||
rm -f "$tmpdepfile" "$tmpdepfile2"
|
||||
;;
|
||||
|
||||
tru64)
|
||||
# The Tru64 compiler uses -MD to generate dependencies as a side
|
||||
# effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'.
|
||||
# At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
|
||||
# dependencies in `foo.d' instead, so we check for that too.
|
||||
# Subdirectories are respected.
|
||||
dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
|
||||
test "x$dir" = "x$object" && dir=
|
||||
base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
|
||||
|
||||
if test "$libtool" = yes; then
|
||||
# With Tru64 cc, shared objects can also be used to make a
|
||||
# static library. This mechanism is used in libtool 1.4 series to
|
||||
# handle both shared and static libraries in a single compilation.
|
||||
# With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d.
|
||||
#
|
||||
# With libtool 1.5 this exception was removed, and libtool now
|
||||
# generates 2 separate objects for the 2 libraries. These two
|
||||
# compilations output dependencies in $dir.libs/$base.o.d and
|
||||
# in $dir$base.o.d. We have to check for both files, because
|
||||
# one of the two compilations can be disabled. We should prefer
|
||||
# $dir$base.o.d over $dir.libs/$base.o.d because the latter is
|
||||
# automatically cleaned when .libs/ is deleted, while ignoring
|
||||
# the former would cause a distcleancheck panic.
|
||||
tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4
|
||||
tmpdepfile2=$dir$base.o.d # libtool 1.5
|
||||
tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5
|
||||
tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504
|
||||
"$@" -Wc,-MD
|
||||
else
|
||||
tmpdepfile1=$dir$base.o.d
|
||||
tmpdepfile2=$dir$base.d
|
||||
tmpdepfile3=$dir$base.d
|
||||
tmpdepfile4=$dir$base.d
|
||||
"$@" -MD
|
||||
fi
|
||||
|
||||
stat=$?
|
||||
if test $stat -eq 0; then :
|
||||
else
|
||||
rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
|
||||
exit $stat
|
||||
fi
|
||||
|
||||
for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
|
||||
do
|
||||
test -f "$tmpdepfile" && break
|
||||
done
|
||||
if test -f "$tmpdepfile"; then
|
||||
sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
|
||||
# That's a tab and a space in the [].
|
||||
sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
|
||||
else
|
||||
echo "#dummy" > "$depfile"
|
||||
fi
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
||||
#nosideeffect)
|
||||
# This comment above is used by automake to tell side-effect
|
||||
# dependency tracking mechanisms from slower ones.
|
||||
|
||||
dashmstdout)
|
||||
# Important note: in order to support this mode, a compiler *must*
|
||||
# always write the preprocessed file to stdout, regardless of -o.
|
||||
"$@" || exit $?
|
||||
|
||||
# Remove the call to Libtool.
|
||||
if test "$libtool" = yes; then
|
||||
while test $1 != '--mode=compile'; do
|
||||
shift
|
||||
done
|
||||
shift
|
||||
fi
|
||||
|
||||
# Remove `-o $object'.
|
||||
IFS=" "
|
||||
for arg
|
||||
do
|
||||
case $arg in
|
||||
-o)
|
||||
shift
|
||||
;;
|
||||
$object)
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
set fnord "$@" "$arg"
|
||||
shift # fnord
|
||||
shift # $arg
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
test -z "$dashmflag" && dashmflag=-M
|
||||
# Require at least two characters before searching for `:'
|
||||
# in the target name. This is to cope with DOS-style filenames:
|
||||
# a dependency such as `c:/foo/bar' could be seen as target `c' otherwise.
|
||||
"$@" $dashmflag |
|
||||
sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile"
|
||||
rm -f "$depfile"
|
||||
cat < "$tmpdepfile" > "$depfile"
|
||||
tr ' ' '
|
||||
' < "$tmpdepfile" | \
|
||||
## Some versions of the HPUX 10.20 sed can't process this invocation
|
||||
## correctly. Breaking it into two sed invocations is a workaround.
|
||||
sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
||||
dashXmstdout)
|
||||
# This case only exists to satisfy depend.m4. It is never actually
|
||||
# run, as this mode is specially recognized in the preamble.
|
||||
exit 1
|
||||
;;
|
||||
|
||||
makedepend)
|
||||
"$@" || exit $?
|
||||
# Remove any Libtool call
|
||||
if test "$libtool" = yes; then
|
||||
while test $1 != '--mode=compile'; do
|
||||
shift
|
||||
done
|
||||
shift
|
||||
fi
|
||||
# X makedepend
|
||||
shift
|
||||
cleared=no
|
||||
for arg in "$@"; do
|
||||
case $cleared in
|
||||
no)
|
||||
set ""; shift
|
||||
cleared=yes ;;
|
||||
esac
|
||||
case "$arg" in
|
||||
-D*|-I*)
|
||||
set fnord "$@" "$arg"; shift ;;
|
||||
# Strip any option that makedepend may not understand. Remove
|
||||
# the object too, otherwise makedepend will parse it as a source file.
|
||||
-*|$object)
|
||||
;;
|
||||
*)
|
||||
set fnord "$@" "$arg"; shift ;;
|
||||
esac
|
||||
done
|
||||
obj_suffix="`echo $object | sed 's/^.*\././'`"
|
||||
touch "$tmpdepfile"
|
||||
${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@"
|
||||
rm -f "$depfile"
|
||||
cat < "$tmpdepfile" > "$depfile"
|
||||
sed '1,2d' "$tmpdepfile" | tr ' ' '
|
||||
' | \
|
||||
## Some versions of the HPUX 10.20 sed can't process this invocation
|
||||
## correctly. Breaking it into two sed invocations is a workaround.
|
||||
sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
|
||||
rm -f "$tmpdepfile" "$tmpdepfile".bak
|
||||
;;
|
||||
|
||||
cpp)
|
||||
# Important note: in order to support this mode, a compiler *must*
|
||||
# always write the preprocessed file to stdout.
|
||||
"$@" || exit $?
|
||||
|
||||
# Remove the call to Libtool.
|
||||
if test "$libtool" = yes; then
|
||||
while test $1 != '--mode=compile'; do
|
||||
shift
|
||||
done
|
||||
shift
|
||||
fi
|
||||
|
||||
# Remove `-o $object'.
|
||||
IFS=" "
|
||||
for arg
|
||||
do
|
||||
case $arg in
|
||||
-o)
|
||||
shift
|
||||
;;
|
||||
$object)
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
set fnord "$@" "$arg"
|
||||
shift # fnord
|
||||
shift # $arg
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
"$@" -E |
|
||||
sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
|
||||
-e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' |
|
||||
sed '$ s: \\$::' > "$tmpdepfile"
|
||||
rm -f "$depfile"
|
||||
echo "$object : \\" > "$depfile"
|
||||
cat < "$tmpdepfile" >> "$depfile"
|
||||
sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile"
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
||||
msvisualcpp)
|
||||
# Important note: in order to support this mode, a compiler *must*
|
||||
# always write the preprocessed file to stdout, regardless of -o,
|
||||
# because we must use -o when running libtool.
|
||||
"$@" || exit $?
|
||||
IFS=" "
|
||||
for arg
|
||||
do
|
||||
case "$arg" in
|
||||
"-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
|
||||
set fnord "$@"
|
||||
shift
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
set fnord "$@" "$arg"
|
||||
shift
|
||||
shift
|
||||
;;
|
||||
esac
|
||||
done
|
||||
"$@" -E |
|
||||
sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile"
|
||||
rm -f "$depfile"
|
||||
echo "$object : \\" > "$depfile"
|
||||
. "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile"
|
||||
echo " " >> "$depfile"
|
||||
. "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile"
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
||||
none)
|
||||
exec "$@"
|
||||
;;
|
||||
|
||||
*)
|
||||
echo "Unknown depmode $depmode" 1>&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
exit 0
|
||||
|
||||
# Local Variables:
|
||||
# mode: shell-script
|
||||
# sh-indentation: 2
|
||||
# eval: (add-hook 'write-file-hooks 'time-stamp)
|
||||
# time-stamp-start: "scriptversion="
|
||||
# time-stamp-format: "%:y-%02m-%02d.%02H"
|
||||
# time-stamp-end: "$"
|
||||
# End:
|
||||
@@ -1,507 +0,0 @@
|
||||
#!/bin/sh
|
||||
# install - install a program, script, or datafile
|
||||
|
||||
scriptversion=2006-10-14.15
|
||||
|
||||
# This originates from X11R5 (mit/util/scripts/install.sh), which was
|
||||
# later released in X11R6 (xc/config/util/install.sh) with the
|
||||
# following copyright and license.
|
||||
#
|
||||
# Copyright (C) 1994 X Consortium
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the "Software"), to
|
||||
# deal in the Software without restriction, including without limitation the
|
||||
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
||||
# sell copies of the Software, and to permit persons to whom the Software is
|
||||
# furnished to do so, subject to the following conditions:
|
||||
#
|
||||
# The above copyright notice and this permission notice shall be included in
|
||||
# all copies or substantial portions of the Software.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
|
||||
# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
|
||||
# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
#
|
||||
# Except as contained in this notice, the name of the X Consortium shall not
|
||||
# be used in advertising or otherwise to promote the sale, use or other deal-
|
||||
# ings in this Software without prior written authorization from the X Consor-
|
||||
# tium.
|
||||
#
|
||||
#
|
||||
# FSF changes to this file are in the public domain.
|
||||
#
|
||||
# Calling this script install-sh is preferred over install.sh, to prevent
|
||||
# `make' implicit rules from creating a file called install from it
|
||||
# when there is no Makefile.
|
||||
#
|
||||
# This script is compatible with the BSD install script, but was written
|
||||
# from scratch.
|
||||
|
||||
nl='
|
||||
'
|
||||
IFS=" "" $nl"
|
||||
|
||||
# set DOITPROG to echo to test this script
|
||||
|
||||
# Don't use :- since 4.3BSD and earlier shells don't like it.
|
||||
doit="${DOITPROG-}"
|
||||
if test -z "$doit"; then
|
||||
doit_exec=exec
|
||||
else
|
||||
doit_exec=$doit
|
||||
fi
|
||||
|
||||
# Put in absolute file names if you don't have them in your path;
|
||||
# or use environment vars.
|
||||
|
||||
mvprog="${MVPROG-mv}"
|
||||
cpprog="${CPPROG-cp}"
|
||||
chmodprog="${CHMODPROG-chmod}"
|
||||
chownprog="${CHOWNPROG-chown}"
|
||||
chgrpprog="${CHGRPPROG-chgrp}"
|
||||
stripprog="${STRIPPROG-strip}"
|
||||
rmprog="${RMPROG-rm}"
|
||||
mkdirprog="${MKDIRPROG-mkdir}"
|
||||
|
||||
posix_glob=
|
||||
posix_mkdir=
|
||||
|
||||
# Desired mode of installed file.
|
||||
mode=0755
|
||||
|
||||
chmodcmd=$chmodprog
|
||||
chowncmd=
|
||||
chgrpcmd=
|
||||
stripcmd=
|
||||
rmcmd="$rmprog -f"
|
||||
mvcmd="$mvprog"
|
||||
src=
|
||||
dst=
|
||||
dir_arg=
|
||||
dstarg=
|
||||
no_target_directory=
|
||||
|
||||
usage="Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
|
||||
or: $0 [OPTION]... SRCFILES... DIRECTORY
|
||||
or: $0 [OPTION]... -t DIRECTORY SRCFILES...
|
||||
or: $0 [OPTION]... -d DIRECTORIES...
|
||||
|
||||
In the 1st form, copy SRCFILE to DSTFILE.
|
||||
In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
|
||||
In the 4th, create DIRECTORIES.
|
||||
|
||||
Options:
|
||||
-c (ignored)
|
||||
-d create directories instead of installing files.
|
||||
-g GROUP $chgrpprog installed files to GROUP.
|
||||
-m MODE $chmodprog installed files to MODE.
|
||||
-o USER $chownprog installed files to USER.
|
||||
-s $stripprog installed files.
|
||||
-t DIRECTORY install into DIRECTORY.
|
||||
-T report an error if DSTFILE is a directory.
|
||||
--help display this help and exit.
|
||||
--version display version info and exit.
|
||||
|
||||
Environment variables override the default commands:
|
||||
CHGRPPROG CHMODPROG CHOWNPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG
|
||||
"
|
||||
|
||||
while test $# -ne 0; do
|
||||
case $1 in
|
||||
-c) shift
|
||||
continue;;
|
||||
|
||||
-d) dir_arg=true
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-g) chgrpcmd="$chgrpprog $2"
|
||||
shift
|
||||
shift
|
||||
continue;;
|
||||
|
||||
--help) echo "$usage"; exit $?;;
|
||||
|
||||
-m) mode=$2
|
||||
shift
|
||||
shift
|
||||
case $mode in
|
||||
*' '* | *' '* | *'
|
||||
'* | *'*'* | *'?'* | *'['*)
|
||||
echo "$0: invalid mode: $mode" >&2
|
||||
exit 1;;
|
||||
esac
|
||||
continue;;
|
||||
|
||||
-o) chowncmd="$chownprog $2"
|
||||
shift
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-s) stripcmd=$stripprog
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-t) dstarg=$2
|
||||
shift
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-T) no_target_directory=true
|
||||
shift
|
||||
continue;;
|
||||
|
||||
--version) echo "$0 $scriptversion"; exit $?;;
|
||||
|
||||
--) shift
|
||||
break;;
|
||||
|
||||
-*) echo "$0: invalid option: $1" >&2
|
||||
exit 1;;
|
||||
|
||||
*) break;;
|
||||
esac
|
||||
done
|
||||
|
||||
if test $# -ne 0 && test -z "$dir_arg$dstarg"; then
|
||||
# When -d is used, all remaining arguments are directories to create.
|
||||
# When -t is used, the destination is already specified.
|
||||
# Otherwise, the last argument is the destination. Remove it from $@.
|
||||
for arg
|
||||
do
|
||||
if test -n "$dstarg"; then
|
||||
# $@ is not empty: it contains at least $arg.
|
||||
set fnord "$@" "$dstarg"
|
||||
shift # fnord
|
||||
fi
|
||||
shift # arg
|
||||
dstarg=$arg
|
||||
done
|
||||
fi
|
||||
|
||||
if test $# -eq 0; then
|
||||
if test -z "$dir_arg"; then
|
||||
echo "$0: no input file specified." >&2
|
||||
exit 1
|
||||
fi
|
||||
# It's OK to call `install-sh -d' without argument.
|
||||
# This can happen when creating conditional directories.
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if test -z "$dir_arg"; then
|
||||
trap '(exit $?); exit' 1 2 13 15
|
||||
|
||||
# Set umask so as not to create temps with too-generous modes.
|
||||
# However, 'strip' requires both read and write access to temps.
|
||||
case $mode in
|
||||
# Optimize common cases.
|
||||
*644) cp_umask=133;;
|
||||
*755) cp_umask=22;;
|
||||
|
||||
*[0-7])
|
||||
if test -z "$stripcmd"; then
|
||||
u_plus_rw=
|
||||
else
|
||||
u_plus_rw='% 200'
|
||||
fi
|
||||
cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
|
||||
*)
|
||||
if test -z "$stripcmd"; then
|
||||
u_plus_rw=
|
||||
else
|
||||
u_plus_rw=,u+rw
|
||||
fi
|
||||
cp_umask=$mode$u_plus_rw;;
|
||||
esac
|
||||
fi
|
||||
|
||||
for src
|
||||
do
|
||||
# Protect names starting with `-'.
|
||||
case $src in
|
||||
-*) src=./$src ;;
|
||||
esac
|
||||
|
||||
if test -n "$dir_arg"; then
|
||||
dst=$src
|
||||
dstdir=$dst
|
||||
test -d "$dstdir"
|
||||
dstdir_status=$?
|
||||
else
|
||||
|
||||
# Waiting for this to be detected by the "$cpprog $src $dsttmp" command
|
||||
# might cause directories to be created, which would be especially bad
|
||||
# if $src (and thus $dsttmp) contains '*'.
|
||||
if test ! -f "$src" && test ! -d "$src"; then
|
||||
echo "$0: $src does not exist." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if test -z "$dstarg"; then
|
||||
echo "$0: no destination specified." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
dst=$dstarg
|
||||
# Protect names starting with `-'.
|
||||
case $dst in
|
||||
-*) dst=./$dst ;;
|
||||
esac
|
||||
|
||||
# If destination is a directory, append the input filename; won't work
|
||||
# if double slashes aren't ignored.
|
||||
if test -d "$dst"; then
|
||||
if test -n "$no_target_directory"; then
|
||||
echo "$0: $dstarg: Is a directory" >&2
|
||||
exit 1
|
||||
fi
|
||||
dstdir=$dst
|
||||
dst=$dstdir/`basename "$src"`
|
||||
dstdir_status=0
|
||||
else
|
||||
# Prefer dirname, but fall back on a substitute if dirname fails.
|
||||
dstdir=`
|
||||
(dirname "$dst") 2>/dev/null ||
|
||||
expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
|
||||
X"$dst" : 'X\(//\)[^/]' \| \
|
||||
X"$dst" : 'X\(//\)$' \| \
|
||||
X"$dst" : 'X\(/\)' \| . 2>/dev/null ||
|
||||
echo X"$dst" |
|
||||
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
|
||||
s//\1/
|
||||
q
|
||||
}
|
||||
/^X\(\/\/\)[^/].*/{
|
||||
s//\1/
|
||||
q
|
||||
}
|
||||
/^X\(\/\/\)$/{
|
||||
s//\1/
|
||||
q
|
||||
}
|
||||
/^X\(\/\).*/{
|
||||
s//\1/
|
||||
q
|
||||
}
|
||||
s/.*/./; q'
|
||||
`
|
||||
|
||||
test -d "$dstdir"
|
||||
dstdir_status=$?
|
||||
fi
|
||||
fi
|
||||
|
||||
obsolete_mkdir_used=false
|
||||
|
||||
if test $dstdir_status != 0; then
|
||||
case $posix_mkdir in
|
||||
'')
|
||||
# Create intermediate dirs using mode 755 as modified by the umask.
|
||||
# This is like FreeBSD 'install' as of 1997-10-28.
|
||||
umask=`umask`
|
||||
case $stripcmd.$umask in
|
||||
# Optimize common cases.
|
||||
*[2367][2367]) mkdir_umask=$umask;;
|
||||
.*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
|
||||
|
||||
*[0-7])
|
||||
mkdir_umask=`expr $umask + 22 \
|
||||
- $umask % 100 % 40 + $umask % 20 \
|
||||
- $umask % 10 % 4 + $umask % 2
|
||||
`;;
|
||||
*) mkdir_umask=$umask,go-w;;
|
||||
esac
|
||||
|
||||
# With -d, create the new directory with the user-specified mode.
|
||||
# Otherwise, rely on $mkdir_umask.
|
||||
if test -n "$dir_arg"; then
|
||||
mkdir_mode=-m$mode
|
||||
else
|
||||
mkdir_mode=
|
||||
fi
|
||||
|
||||
posix_mkdir=false
|
||||
case $umask in
|
||||
*[123567][0-7][0-7])
|
||||
# POSIX mkdir -p sets u+wx bits regardless of umask, which
|
||||
# is incompatible with FreeBSD 'install' when (umask & 300) != 0.
|
||||
;;
|
||||
*)
|
||||
tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
|
||||
trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
|
||||
|
||||
if (umask $mkdir_umask &&
|
||||
exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
|
||||
then
|
||||
if test -z "$dir_arg" || {
|
||||
# Check for POSIX incompatibilities with -m.
|
||||
# HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
|
||||
# other-writeable bit of parent directory when it shouldn't.
|
||||
# FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
|
||||
ls_ld_tmpdir=`ls -ld "$tmpdir"`
|
||||
case $ls_ld_tmpdir in
|
||||
d????-?r-*) different_mode=700;;
|
||||
d????-?--*) different_mode=755;;
|
||||
*) false;;
|
||||
esac &&
|
||||
$mkdirprog -m$different_mode -p -- "$tmpdir" && {
|
||||
ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
|
||||
test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
|
||||
}
|
||||
}
|
||||
then posix_mkdir=:
|
||||
fi
|
||||
rmdir "$tmpdir/d" "$tmpdir"
|
||||
else
|
||||
# Remove any dirs left behind by ancient mkdir implementations.
|
||||
rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
|
||||
fi
|
||||
trap '' 0;;
|
||||
esac;;
|
||||
esac
|
||||
|
||||
if
|
||||
$posix_mkdir && (
|
||||
umask $mkdir_umask &&
|
||||
$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
|
||||
)
|
||||
then :
|
||||
else
|
||||
|
||||
# The umask is ridiculous, or mkdir does not conform to POSIX,
|
||||
# or it failed possibly due to a race condition. Create the
|
||||
# directory the slow way, step by step, checking for races as we go.
|
||||
|
||||
case $dstdir in
|
||||
/*) prefix=/ ;;
|
||||
-*) prefix=./ ;;
|
||||
*) prefix= ;;
|
||||
esac
|
||||
|
||||
case $posix_glob in
|
||||
'')
|
||||
if (set -f) 2>/dev/null; then
|
||||
posix_glob=true
|
||||
else
|
||||
posix_glob=false
|
||||
fi ;;
|
||||
esac
|
||||
|
||||
oIFS=$IFS
|
||||
IFS=/
|
||||
$posix_glob && set -f
|
||||
set fnord $dstdir
|
||||
shift
|
||||
$posix_glob && set +f
|
||||
IFS=$oIFS
|
||||
|
||||
prefixes=
|
||||
|
||||
for d
|
||||
do
|
||||
test -z "$d" && continue
|
||||
|
||||
prefix=$prefix$d
|
||||
if test -d "$prefix"; then
|
||||
prefixes=
|
||||
else
|
||||
if $posix_mkdir; then
|
||||
(umask=$mkdir_umask &&
|
||||
$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
|
||||
# Don't fail if two instances are running concurrently.
|
||||
test -d "$prefix" || exit 1
|
||||
else
|
||||
case $prefix in
|
||||
*\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
|
||||
*) qprefix=$prefix;;
|
||||
esac
|
||||
prefixes="$prefixes '$qprefix'"
|
||||
fi
|
||||
fi
|
||||
prefix=$prefix/
|
||||
done
|
||||
|
||||
if test -n "$prefixes"; then
|
||||
# Don't fail if two instances are running concurrently.
|
||||
(umask $mkdir_umask &&
|
||||
eval "\$doit_exec \$mkdirprog $prefixes") ||
|
||||
test -d "$dstdir" || exit 1
|
||||
obsolete_mkdir_used=true
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
if test -n "$dir_arg"; then
|
||||
{ test -z "$chowncmd" || $doit $chowncmd "$dst"; } &&
|
||||
{ test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } &&
|
||||
{ test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false ||
|
||||
test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1
|
||||
else
|
||||
|
||||
# Make a couple of temp file names in the proper directory.
|
||||
dsttmp=$dstdir/_inst.$$_
|
||||
rmtmp=$dstdir/_rm.$$_
|
||||
|
||||
# Trap to clean up those temp files at exit.
|
||||
trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
|
||||
|
||||
# Copy the file name to the temp name.
|
||||
(umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") &&
|
||||
|
||||
# and set any options; do chmod last to preserve setuid bits.
|
||||
#
|
||||
# If any of these fail, we abort the whole thing. If we want to
|
||||
# ignore errors from any of these, just make sure not to ignore
|
||||
# errors from the above "$doit $cpprog $src $dsttmp" command.
|
||||
#
|
||||
{ test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } \
|
||||
&& { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } \
|
||||
&& { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } \
|
||||
&& { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } &&
|
||||
|
||||
# Now rename the file to the real destination.
|
||||
{ $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null \
|
||||
|| {
|
||||
# The rename failed, perhaps because mv can't rename something else
|
||||
# to itself, or perhaps because mv is so ancient that it does not
|
||||
# support -f.
|
||||
|
||||
# Now remove or move aside any old file at destination location.
|
||||
# We try this two ways since rm can't unlink itself on some
|
||||
# systems and the destination file might be busy for other
|
||||
# reasons. In this case, the final cleanup might fail but the new
|
||||
# file should still install successfully.
|
||||
{
|
||||
if test -f "$dst"; then
|
||||
$doit $rmcmd -f "$dst" 2>/dev/null \
|
||||
|| { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null \
|
||||
&& { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }; }\
|
||||
|| {
|
||||
echo "$0: cannot unlink or rename $dst" >&2
|
||||
(exit 1); exit 1
|
||||
}
|
||||
else
|
||||
:
|
||||
fi
|
||||
} &&
|
||||
|
||||
# Now rename the file to the real destination.
|
||||
$doit $mvcmd "$dsttmp" "$dst"
|
||||
}
|
||||
} || exit 1
|
||||
|
||||
trap '' 0
|
||||
fi
|
||||
done
|
||||
|
||||
# Local variables:
|
||||
# eval: (add-hook 'write-file-hooks 'time-stamp)
|
||||
# time-stamp-start: "scriptversion="
|
||||
# time-stamp-format: "%:y-%02m-%02d.%02H"
|
||||
# time-stamp-end: "$"
|
||||
# End:
|
||||
@@ -1,367 +0,0 @@
|
||||
#! /bin/sh
|
||||
# Common stub for a few missing GNU programs while installing.
|
||||
|
||||
scriptversion=2006-05-10.23
|
||||
|
||||
# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006
|
||||
# Free Software Foundation, Inc.
|
||||
# Originally by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
|
||||
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2, or (at your option)
|
||||
# any later version.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
# 02110-1301, USA.
|
||||
|
||||
# As a special exception to the GNU General Public License, if you
|
||||
# distribute this file as part of a program that contains a
|
||||
# configuration script generated by Autoconf, you may include it under
|
||||
# the same distribution terms that you use for the rest of that program.
|
||||
|
||||
if test $# -eq 0; then
|
||||
echo 1>&2 "Try \`$0 --help' for more information"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
run=:
|
||||
sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p'
|
||||
sed_minuso='s/.* -o \([^ ]*\).*/\1/p'
|
||||
|
||||
# In the cases where this matters, `missing' is being run in the
|
||||
# srcdir already.
|
||||
if test -f configure.ac; then
|
||||
configure_ac=configure.ac
|
||||
else
|
||||
configure_ac=configure.in
|
||||
fi
|
||||
|
||||
msg="missing on your system"
|
||||
|
||||
case $1 in
|
||||
--run)
|
||||
# Try to run requested program, and just exit if it succeeds.
|
||||
run=
|
||||
shift
|
||||
"$@" && exit 0
|
||||
# Exit code 63 means version mismatch. This often happens
|
||||
# when the user try to use an ancient version of a tool on
|
||||
# a file that requires a minimum version. In this case we
|
||||
# we should proceed has if the program had been absent, or
|
||||
# if --run hadn't been passed.
|
||||
if test $? = 63; then
|
||||
run=:
|
||||
msg="probably too old"
|
||||
fi
|
||||
;;
|
||||
|
||||
-h|--h|--he|--hel|--help)
|
||||
echo "\
|
||||
$0 [OPTION]... PROGRAM [ARGUMENT]...
|
||||
|
||||
Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an
|
||||
error status if there is no known handling for PROGRAM.
|
||||
|
||||
Options:
|
||||
-h, --help display this help and exit
|
||||
-v, --version output version information and exit
|
||||
--run try to run the given command, and emulate it if it fails
|
||||
|
||||
Supported PROGRAM values:
|
||||
aclocal touch file \`aclocal.m4'
|
||||
autoconf touch file \`configure'
|
||||
autoheader touch file \`config.h.in'
|
||||
autom4te touch the output file, or create a stub one
|
||||
automake touch all \`Makefile.in' files
|
||||
bison create \`y.tab.[ch]', if possible, from existing .[ch]
|
||||
flex create \`lex.yy.c', if possible, from existing .c
|
||||
help2man touch the output file
|
||||
lex create \`lex.yy.c', if possible, from existing .c
|
||||
makeinfo touch the output file
|
||||
tar try tar, gnutar, gtar, then tar without non-portable flags
|
||||
yacc create \`y.tab.[ch]', if possible, from existing .[ch]
|
||||
|
||||
Send bug reports to <bug-automake@gnu.org>."
|
||||
exit $?
|
||||
;;
|
||||
|
||||
-v|--v|--ve|--ver|--vers|--versi|--versio|--version)
|
||||
echo "missing $scriptversion (GNU Automake)"
|
||||
exit $?
|
||||
;;
|
||||
|
||||
-*)
|
||||
echo 1>&2 "$0: Unknown \`$1' option"
|
||||
echo 1>&2 "Try \`$0 --help' for more information"
|
||||
exit 1
|
||||
;;
|
||||
|
||||
esac
|
||||
|
||||
# Now exit if we have it, but it failed. Also exit now if we
|
||||
# don't have it and --version was passed (most likely to detect
|
||||
# the program).
|
||||
case $1 in
|
||||
lex|yacc)
|
||||
# Not GNU programs, they don't have --version.
|
||||
;;
|
||||
|
||||
tar)
|
||||
if test -n "$run"; then
|
||||
echo 1>&2 "ERROR: \`tar' requires --run"
|
||||
exit 1
|
||||
elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
|
||||
*)
|
||||
if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
|
||||
# We have it, but it failed.
|
||||
exit 1
|
||||
elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
|
||||
# Could not run --version or --help. This is probably someone
|
||||
# running `$TOOL --version' or `$TOOL --help' to check whether
|
||||
# $TOOL exists and not knowing $TOOL uses missing.
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
# If it does not exist, or fails to run (possibly an outdated version),
|
||||
# try to emulate it.
|
||||
case $1 in
|
||||
aclocal*)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is $msg. You should only need it if
|
||||
you modified \`acinclude.m4' or \`${configure_ac}'. You might want
|
||||
to install the \`Automake' and \`Perl' packages. Grab them from
|
||||
any GNU archive site."
|
||||
touch aclocal.m4
|
||||
;;
|
||||
|
||||
autoconf)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is $msg. You should only need it if
|
||||
you modified \`${configure_ac}'. You might want to install the
|
||||
\`Autoconf' and \`GNU m4' packages. Grab them from any GNU
|
||||
archive site."
|
||||
touch configure
|
||||
;;
|
||||
|
||||
autoheader)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is $msg. You should only need it if
|
||||
you modified \`acconfig.h' or \`${configure_ac}'. You might want
|
||||
to install the \`Autoconf' and \`GNU m4' packages. Grab them
|
||||
from any GNU archive site."
|
||||
files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}`
|
||||
test -z "$files" && files="config.h"
|
||||
touch_files=
|
||||
for f in $files; do
|
||||
case $f in
|
||||
*:*) touch_files="$touch_files "`echo "$f" |
|
||||
sed -e 's/^[^:]*://' -e 's/:.*//'`;;
|
||||
*) touch_files="$touch_files $f.in";;
|
||||
esac
|
||||
done
|
||||
touch $touch_files
|
||||
;;
|
||||
|
||||
automake*)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is $msg. You should only need it if
|
||||
you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'.
|
||||
You might want to install the \`Automake' and \`Perl' packages.
|
||||
Grab them from any GNU archive site."
|
||||
find . -type f -name Makefile.am -print |
|
||||
sed 's/\.am$/.in/' |
|
||||
while read f; do touch "$f"; done
|
||||
;;
|
||||
|
||||
autom4te)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is needed, but is $msg.
|
||||
You might have modified some files without having the
|
||||
proper tools for further handling them.
|
||||
You can get \`$1' as part of \`Autoconf' from any GNU
|
||||
archive site."
|
||||
|
||||
file=`echo "$*" | sed -n "$sed_output"`
|
||||
test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
|
||||
if test -f "$file"; then
|
||||
touch $file
|
||||
else
|
||||
test -z "$file" || exec >$file
|
||||
echo "#! /bin/sh"
|
||||
echo "# Created by GNU Automake missing as a replacement of"
|
||||
echo "# $ $@"
|
||||
echo "exit 0"
|
||||
chmod +x $file
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
|
||||
bison|yacc)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' $msg. You should only need it if
|
||||
you modified a \`.y' file. You may need the \`Bison' package
|
||||
in order for those modifications to take effect. You can get
|
||||
\`Bison' from any GNU archive site."
|
||||
rm -f y.tab.c y.tab.h
|
||||
if test $# -ne 1; then
|
||||
eval LASTARG="\${$#}"
|
||||
case $LASTARG in
|
||||
*.y)
|
||||
SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
|
||||
if test -f "$SRCFILE"; then
|
||||
cp "$SRCFILE" y.tab.c
|
||||
fi
|
||||
SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
|
||||
if test -f "$SRCFILE"; then
|
||||
cp "$SRCFILE" y.tab.h
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
if test ! -f y.tab.h; then
|
||||
echo >y.tab.h
|
||||
fi
|
||||
if test ! -f y.tab.c; then
|
||||
echo 'main() { return 0; }' >y.tab.c
|
||||
fi
|
||||
;;
|
||||
|
||||
lex|flex)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is $msg. You should only need it if
|
||||
you modified a \`.l' file. You may need the \`Flex' package
|
||||
in order for those modifications to take effect. You can get
|
||||
\`Flex' from any GNU archive site."
|
||||
rm -f lex.yy.c
|
||||
if test $# -ne 1; then
|
||||
eval LASTARG="\${$#}"
|
||||
case $LASTARG in
|
||||
*.l)
|
||||
SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
|
||||
if test -f "$SRCFILE"; then
|
||||
cp "$SRCFILE" lex.yy.c
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
if test ! -f lex.yy.c; then
|
||||
echo 'main() { return 0; }' >lex.yy.c
|
||||
fi
|
||||
;;
|
||||
|
||||
help2man)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is $msg. You should only need it if
|
||||
you modified a dependency of a manual page. You may need the
|
||||
\`Help2man' package in order for those modifications to take
|
||||
effect. You can get \`Help2man' from any GNU archive site."
|
||||
|
||||
file=`echo "$*" | sed -n "$sed_output"`
|
||||
test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
|
||||
if test -f "$file"; then
|
||||
touch $file
|
||||
else
|
||||
test -z "$file" || exec >$file
|
||||
echo ".ab help2man is required to generate this page"
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
|
||||
makeinfo)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is $msg. You should only need it if
|
||||
you modified a \`.texi' or \`.texinfo' file, or any other file
|
||||
indirectly affecting the aspect of the manual. The spurious
|
||||
call might also be the consequence of using a buggy \`make' (AIX,
|
||||
DU, IRIX). You might want to install the \`Texinfo' package or
|
||||
the \`GNU make' package. Grab either from any GNU archive site."
|
||||
# The file to touch is that specified with -o ...
|
||||
file=`echo "$*" | sed -n "$sed_output"`
|
||||
test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
|
||||
if test -z "$file"; then
|
||||
# ... or it is the one specified with @setfilename ...
|
||||
infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
|
||||
file=`sed -n '
|
||||
/^@setfilename/{
|
||||
s/.* \([^ ]*\) *$/\1/
|
||||
p
|
||||
q
|
||||
}' $infile`
|
||||
# ... or it is derived from the source name (dir/f.texi becomes f.info)
|
||||
test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info
|
||||
fi
|
||||
# If the file does not exist, the user really needs makeinfo;
|
||||
# let's fail without touching anything.
|
||||
test -f $file || exit 1
|
||||
touch $file
|
||||
;;
|
||||
|
||||
tar)
|
||||
shift
|
||||
|
||||
# We have already tried tar in the generic part.
|
||||
# Look for gnutar/gtar before invocation to avoid ugly error
|
||||
# messages.
|
||||
if (gnutar --version > /dev/null 2>&1); then
|
||||
gnutar "$@" && exit 0
|
||||
fi
|
||||
if (gtar --version > /dev/null 2>&1); then
|
||||
gtar "$@" && exit 0
|
||||
fi
|
||||
firstarg="$1"
|
||||
if shift; then
|
||||
case $firstarg in
|
||||
*o*)
|
||||
firstarg=`echo "$firstarg" | sed s/o//`
|
||||
tar "$firstarg" "$@" && exit 0
|
||||
;;
|
||||
esac
|
||||
case $firstarg in
|
||||
*h*)
|
||||
firstarg=`echo "$firstarg" | sed s/h//`
|
||||
tar "$firstarg" "$@" && exit 0
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
echo 1>&2 "\
|
||||
WARNING: I can't seem to be able to run \`tar' with the given arguments.
|
||||
You may want to install GNU tar or Free paxutils, or check the
|
||||
command line arguments."
|
||||
exit 1
|
||||
;;
|
||||
|
||||
*)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is needed, and is $msg.
|
||||
You might have modified some files without having the
|
||||
proper tools for further handling them. Check the \`README' file,
|
||||
it often tells you about the needed prerequisites for installing
|
||||
this package. You may also peek at any GNU archive site, in case
|
||||
some other package would contain this missing \`$1' program."
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
exit 0
|
||||
|
||||
# Local variables:
|
||||
# eval: (add-hook 'write-file-hooks 'time-stamp)
|
||||
# time-stamp-start: "scriptversion="
|
||||
# time-stamp-format: "%:y-%02m-%02d.%02H"
|
||||
# time-stamp-end: "$"
|
||||
# End:
|
||||
26020
FreeRTOS-Plus/CyaSSL/configure
vendored
26020
FreeRTOS-Plus/CyaSSL/configure
vendored
File diff suppressed because it is too large
Load Diff
@@ -1,736 +0,0 @@
|
||||
# configure.ac
|
||||
#
|
||||
# Copyright (C) 2006-2012 Sawtooth Consulting Ltd.
|
||||
#
|
||||
# This file is part of CyaSSL.
|
||||
#
|
||||
#
|
||||
|
||||
AC_INIT([cyassl],[2.3.0],[http://www.yassl.com])
|
||||
|
||||
AC_CONFIG_AUX_DIR(config)
|
||||
|
||||
AC_CANONICAL_TARGET
|
||||
|
||||
AM_INIT_AUTOMAKE(-Wall -Werror -Wno-portability foreign tar-ustar subdir-objects)
|
||||
|
||||
AC_CANONICAL_HOST
|
||||
AC_CANONICAL_BUILD
|
||||
|
||||
AC_PREREQ([2.61])
|
||||
|
||||
AC_CONFIG_MACRO_DIR(m4)
|
||||
|
||||
AC_CONFIG_HEADERS([config.h:config.in])dnl Keep filename to 8.3 for MS-DOS.
|
||||
|
||||
|
||||
#shared library versioning
|
||||
CYASSL_LIBRARY_VERSION=3:1:0
|
||||
# | | |
|
||||
# +------+ | +---+
|
||||
# | | |
|
||||
# current:revision:age
|
||||
# | | |
|
||||
# | | +- increment if interfaces have been added
|
||||
# | | set to zero if interfaces have been removed
|
||||
# | or changed
|
||||
# | +- increment if source code has changed
|
||||
# | set to zero if current is incremented
|
||||
# +- increment if interfaces have been added, removed or changed
|
||||
AC_SUBST(CYASSL_LIBRARY_VERSION)
|
||||
|
||||
# Make sure configure doesn't add to CFLAGS
|
||||
CFLAGS="$CFLAGS $C_EXTRA_FLAGS"
|
||||
|
||||
LT_INIT([win32-dll])
|
||||
LT_LANG([C++])
|
||||
LT_LANG([C])
|
||||
gl_VISIBILITY
|
||||
|
||||
m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
|
||||
|
||||
AC_CHECK_FUNCS([gethostbyname])
|
||||
AC_CHECK_FUNCS([gettimeofday])
|
||||
AC_CHECK_FUNCS([inet_ntoa])
|
||||
AC_CHECK_FUNCS([memset])
|
||||
AC_CHECK_FUNCS([socket])
|
||||
AC_CHECK_HEADERS([arpa/inet.h])
|
||||
AC_CHECK_HEADERS([fcntl.h])
|
||||
AC_CHECK_HEADERS([limits.h])
|
||||
AC_CHECK_HEADERS([netdb.h])
|
||||
AC_CHECK_HEADERS([netinet/in.h])
|
||||
AC_CHECK_HEADERS([stddef.h])
|
||||
AC_CHECK_HEADERS([sys/ioctl.h])
|
||||
AC_CHECK_HEADERS([sys/socket.h])
|
||||
AC_CHECK_HEADERS([sys/time.h])
|
||||
AC_CHECK_HEADERS(errno.h)
|
||||
AC_CHECK_LIB(network,socket)
|
||||
AC_CHECK_SIZEOF(long long, 8)
|
||||
AC_CHECK_SIZEOF(long, 4)
|
||||
AC_C_BIGENDIAN
|
||||
AC_DISABLE_STATIC
|
||||
AC_DISABLE_STATIC
|
||||
AC_FUNC_MALLOC
|
||||
AC_FUNC_MKTIME
|
||||
AC_FUNC_REALLOC
|
||||
|
||||
AC_PROG_CC
|
||||
AC_PROG_CC_C_O
|
||||
AC_PROG_CXX
|
||||
AC_PROG_INSTALL
|
||||
LT_INIT
|
||||
AC_TYPE_SIZE_T
|
||||
AC_TYPE_UINT8_T
|
||||
AM_PROG_AS
|
||||
AM_PROG_CC_C_O
|
||||
LT_LIB_M
|
||||
|
||||
OPTIMIZE_CFLAGS="-Os -fomit-frame-pointer"
|
||||
OPTIMIZE_FAST_CFLAGS="-O3 -fomit-frame-pointer"
|
||||
OPTIMIZE_HUGE_CFLAGS="-funroll-loops -DTFM_SMALL_SET"
|
||||
DEBUG_CFLAGS="-g -DDEBUG -DDEBUG_CYASSL"
|
||||
|
||||
|
||||
# DEBUG
|
||||
AC_ARG_ENABLE(debug,
|
||||
[ --enable-debug Enable CyaSSL debugging support (default: disabled)],
|
||||
[ ENABLED_DEBUG=$enableval ],
|
||||
[ ENABLED_DEBUG=no ]
|
||||
)
|
||||
if test "$ENABLED_DEBUG" = "yes"
|
||||
then
|
||||
# Full debug. Very slow in some cases
|
||||
AM_CFLAGS="$DEBUG_CFLAGS $AM_CFLAGS"
|
||||
else
|
||||
# Optimized version. No debug
|
||||
AM_CFLAGS="$AM_CFLAGS -DNDEBUG"
|
||||
fi
|
||||
|
||||
|
||||
# SMALL BUILD
|
||||
AC_ARG_ENABLE(small,
|
||||
[ --enable-small Enable smallest build (default: disabled)],
|
||||
[ ENABLED_SMALL=$enableval ],
|
||||
[ ENABLED_SMALL=no ]
|
||||
)
|
||||
if test "$ENABLED_SMALL" = "yes"
|
||||
then
|
||||
# make small no tls build with smallest cipher
|
||||
# if you only want server or client you can define NO_CYASSL_SERVER or
|
||||
# NO_CYASSL_CLIENT but then some of the examples and testsuite won't build
|
||||
# note that TLS needs HMAC
|
||||
AM_CFLAGS="-DNO_TLS -DNO_HMAC -DNO_AES -DNO_DES3 -DNO_SHA256 -DNO_ERROR_STRINGS -DNO_RABBIT -DNO_PSK -DNO_DSA -DNO_DH -DNO_PWDBASED $AM_CFLAGS"
|
||||
fi
|
||||
|
||||
|
||||
# SINGLE THREADED
|
||||
AC_ARG_ENABLE(singleThreaded,
|
||||
[ --enable-singleThreaded Enable CyaSSL single threaded (default: disabled)],
|
||||
[ ENABLED_SINGLETHREADED=$enableval ],
|
||||
[ ENABLED_SINGLETHREADED=no ]
|
||||
)
|
||||
if test "$ENABLED_SINGLETHREADED" = "yes"
|
||||
then
|
||||
AM_CFLAGS="-DSINGLE_THREADED $AM_CFLAGS"
|
||||
fi
|
||||
|
||||
|
||||
# DTLS
|
||||
AC_ARG_ENABLE(dtls,
|
||||
[ --enable-dtls Enable CyaSSL DTLS (default: disabled)],
|
||||
[ ENABLED_DTLS=$enableval ],
|
||||
[ ENABLED_DTLS=no ]
|
||||
)
|
||||
if test "$ENABLED_DTLS" = "yes"
|
||||
then
|
||||
AM_CFLAGS="-DCYASSL_DTLS $AM_CFLAGS"
|
||||
fi
|
||||
|
||||
|
||||
# OPENSSL Extra Compatibility
|
||||
AC_ARG_ENABLE(opensslExtra,
|
||||
[ --enable-opensslExtra Enable extra OpenSSL API, size+ (default: disabled)],
|
||||
[ ENABLED_OPENSSLEXTRA=$enableval ],
|
||||
[ ENABLED_OPENSSLEXTRA=no ]
|
||||
)
|
||||
if test "$ENABLED_OPENSSLEXTRA" = "yes"
|
||||
then
|
||||
AM_CFLAGS="-DOPENSSL_EXTRA $AM_CFLAGS"
|
||||
fi
|
||||
|
||||
if test "$ENABLED_OPENSSLEXTRA" = "yes" && test "$ENABLED_SMALL" = "yes"
|
||||
then
|
||||
AC_MSG_ERROR([cannot enable small and opensslExtra, only one or the other.])
|
||||
fi
|
||||
|
||||
|
||||
# IPv6 Test Apps
|
||||
AC_ARG_ENABLE(ipv6,
|
||||
[ --enable-ipv6 Enable testing of IPV6 (default: disabled)],
|
||||
[ ENABLED_IPV6=$enableval ],
|
||||
[ ENABLED_IPV6=no ]
|
||||
)
|
||||
|
||||
if test "$ENABLED_IPV6" = "yes"
|
||||
then
|
||||
AM_CFLAGS="$AM_CFLAGS -DTEST_IPV6"
|
||||
fi
|
||||
|
||||
|
||||
# Fortress build
|
||||
AC_ARG_ENABLE(fortress,
|
||||
[ --enable-fortress Enable SSL fortress build (default: disabled)],
|
||||
[ ENABLED_FORTRESS=$enableval ],
|
||||
[ ENABLED_FORTRESS=no ]
|
||||
)
|
||||
|
||||
if test "$ENABLED_FORTRESS" = "yes"
|
||||
then
|
||||
AM_CFLAGS="$AM_CFLAGS -DFORTRESS -DOPENSSL_EXTRA -DCYASSL_DES_ECB -DCYASSL_AES_COUNTER -DCYASSL_AES_DIRECT -DCYASSL_DER_LOAD -DCYASSL_SHA512 -DCYASSL_SHA384 -DCYASSL_KEY_GEN"
|
||||
fi
|
||||
|
||||
|
||||
# ssl bump build
|
||||
AC_ARG_ENABLE(bump,
|
||||
[ --enable-bump Enable SSL Bump build (default: disabled)],
|
||||
[ ENABLED_BUMP=$enableval ],
|
||||
[ ENABLED_BUMP=no ]
|
||||
)
|
||||
|
||||
if test "$ENABLED_BUMP" = "yes"
|
||||
then
|
||||
AM_CFLAGS="$AM_CFLAGS -DLARGE_STATIC_BUFFERS -DCYASSL_CERT_GEN -DCYASSL_KEY_GEN -DHUGE_SESSION_CACHE -DOPENSSL_EXTRA -DFP_MAX_BITS=8192 -DCYASSL_DER_LOAD -DCYASSL_ALT_NAMES -DCYASSL_TEST_CERT"
|
||||
fi
|
||||
|
||||
# fastmath
|
||||
AC_ARG_ENABLE(fastmath,
|
||||
[ --enable-fastmath Enable fast math for BigInts (default: disabled)],
|
||||
[ ENABLED_FASTMATH=$enableval ],
|
||||
[ ENABLED_FASTMATH=no ]
|
||||
)
|
||||
|
||||
if test "x$ENABLED_FASTMATH" = "xyes"
|
||||
then
|
||||
AM_CFLAGS="$AM_CFLAGS -DUSE_FAST_MATH"
|
||||
fi
|
||||
|
||||
|
||||
# fast HUGE math
|
||||
AC_ARG_ENABLE(fasthugemath,
|
||||
[ --enable-fasthugemath Enable fast math + huge code (default: disabled)],
|
||||
[ ENABLED_FASTHUGEMATH=$enableval ],
|
||||
[ ENABLED_FASTHUGEMATH=no ]
|
||||
)
|
||||
|
||||
if test "$ENABLED_BUMP" = "yes"
|
||||
then
|
||||
ENABLED_FASTHUGEMATH="yes"
|
||||
fi
|
||||
|
||||
if test "$ENABLED_FASTHUGEMATH" = "yes"
|
||||
then
|
||||
ENABLED_FASTMATH="yes"
|
||||
AM_CFLAGS="$AM_CFLAGS -DUSE_FAST_MATH"
|
||||
fi
|
||||
|
||||
AM_CONDITIONAL([BUILD_FASTMATH], [test "x$ENABLED_FASTMATH" = "xyes"])
|
||||
|
||||
|
||||
# big cache
|
||||
AC_ARG_ENABLE(bigcache,
|
||||
[ --enable-bigcache Enable big session cache (default: disabled)],
|
||||
[ ENABLED_BIGCACHE=$enableval ],
|
||||
[ ENABLED_BIGCACHE=no ]
|
||||
)
|
||||
|
||||
if test "$ENABLED_BIGCACHE" = "yes"
|
||||
then
|
||||
AM_CFLAGS="$AM_CFLAGS -DBIG_SESSION_CACHE"
|
||||
fi
|
||||
|
||||
|
||||
# HUGE cache
|
||||
AC_ARG_ENABLE(hugecache,
|
||||
[ --enable-hugecache Enable huge session cache (default: disabled)],
|
||||
[ ENABLED_HUGECACHE=$enableval ],
|
||||
[ ENABLED_HUGECACHE=no ]
|
||||
)
|
||||
|
||||
if test "$ENABLED_HUGECACHE" = "yes"
|
||||
then
|
||||
AM_CFLAGS="$AM_CFLAGS -DHUGE_SESSION_CACHE"
|
||||
fi
|
||||
|
||||
|
||||
# SMALL cache
|
||||
AC_ARG_ENABLE(smallcache,
|
||||
[ --enable-smallcache Enable small session cache (default: disabled)],
|
||||
[ ENABLED_SMALLCACHE=$enableval ],
|
||||
[ ENABLED_SMALLCACHE=no ]
|
||||
)
|
||||
|
||||
if test "$ENABLED_SMALLCACHE" = "yes"
|
||||
then
|
||||
AM_CFLAGS="$AM_CFLAGS -DSMALL_SESSION_CACHE"
|
||||
fi
|
||||
|
||||
|
||||
# SNIFFER
|
||||
AC_ARG_ENABLE(sniffer,
|
||||
[ --enable-sniffer Enable CyaSSL sniffer support (default: disabled)],
|
||||
[ ENABLED_SNIFFER=$enableval ],
|
||||
[ ENABLED_SNIFFER=no ]
|
||||
)
|
||||
|
||||
if test "$ENABLED_SNIFFER" = "yes"
|
||||
then
|
||||
AM_CFLAGS="$AM_CFLAGS -DCYASSL_SNIFFER -DOPENSSL_EXTRA"
|
||||
fi
|
||||
|
||||
AM_CONDITIONAL([BUILD_SNIFFER], [test "x$ENABLED_SNIFFER" = "xyes"])
|
||||
|
||||
# AES-GCM
|
||||
AC_ARG_ENABLE(aesgcm,
|
||||
[ --enable-aesgcm Enable CyaSSL AES-GCM support (default: disabled)],
|
||||
[ ENABLED_AESGCM=$enableval ],
|
||||
[ ENABLED_AESGCM=no ]
|
||||
)
|
||||
|
||||
if test "$ENABLED_AESGCM" = "word32"
|
||||
then
|
||||
AM_CFLAGS="$AM_CFLAGS -DGCM_WORD32"
|
||||
ENABLED_AESGCM=yes
|
||||
fi
|
||||
|
||||
if test "$ENABLED_AESGCM" = "small"
|
||||
then
|
||||
AM_CFLAGS="$AM_CFLAGS -DGCM_SMALL"
|
||||
ENABLED_AESGCM=yes
|
||||
fi
|
||||
|
||||
if test "$ENABLED_AESGCM" = "table"
|
||||
then
|
||||
AM_CFLAGS="$AM_CFLAGS -DGCM_TABLE"
|
||||
ENABLED_AESGCM=yes
|
||||
fi
|
||||
|
||||
if test "$ENABLED_AESGCM" = "yes"
|
||||
then
|
||||
AM_CFLAGS="$AM_CFLAGS -DHAVE_AESGCM -DCYASSL_SHA384 -DCYASSL_SHA512"
|
||||
fi
|
||||
|
||||
AM_CONDITIONAL([BUILD_AESGCM], [test "x$ENABLED_AESGCM" = "xyes"])
|
||||
|
||||
# AES-NI
|
||||
AC_ARG_ENABLE(aesni,
|
||||
[ --enable-aesni Enable CyaSSL AES-NI support (default: disabled)],
|
||||
[ ENABLED_AESNI=$enableval ],
|
||||
[ ENABLED_AESNI=no ]
|
||||
)
|
||||
|
||||
if test "$ENABLED_AESNI" = "yes"
|
||||
then
|
||||
AM_CFLAGS="$AM_CFLAGS -DCYASSL_AESNI"
|
||||
if test "$GCC" = "yes"
|
||||
then
|
||||
# GCC needs these flags, icc doesn't
|
||||
AM_CFLAGS="$AM_CFLAGS -maes -msse4"
|
||||
fi
|
||||
fi
|
||||
|
||||
AM_CONDITIONAL([BUILD_AESNI], [test "x$ENABLED_AESNI" = "xyes"])
|
||||
|
||||
|
||||
# MD2
|
||||
AC_ARG_ENABLE(md2,
|
||||
[ --enable-md2 Enable CyaSSL MD2 support (default: disabled)],
|
||||
[ ENABLED_MD2=$enableval ],
|
||||
[ ENABLED_MD2=no ]
|
||||
)
|
||||
|
||||
if test "$ENABLED_BUMP" = "yes"
|
||||
then
|
||||
ENABLED_MD2="yes"
|
||||
fi
|
||||
|
||||
if test "$ENABLED_MD2" = "yes"
|
||||
then
|
||||
AM_CFLAGS="$AM_CFLAGS -DCYASSL_MD2"
|
||||
fi
|
||||
|
||||
AM_CONDITIONAL([BUILD_MD2], [test "x$ENABLED_MD2" = "xyes"])
|
||||
|
||||
|
||||
# RIPEMD
|
||||
AC_ARG_ENABLE(ripemd,
|
||||
[ --enable-ripemd Enable CyaSSL RIPEMD-160 support (default: disabled)],
|
||||
[ ENABLED_RIPEMD=$enableval ],
|
||||
[ ENABLED_RIPEMD=no ]
|
||||
)
|
||||
|
||||
if test "$ENABLED_RIPEMD" = "yes"
|
||||
then
|
||||
AM_CFLAGS="$AM_CFLAGS -DCYASSL_RIPEMD"
|
||||
fi
|
||||
|
||||
AM_CONDITIONAL([BUILD_RIPEMD], [test "x$ENABLED_RIPEMD" = "xyes"])
|
||||
|
||||
|
||||
# SHA512
|
||||
AC_ARG_ENABLE(sha512,
|
||||
[ --enable-sha512 Enable CyaSSL SHA-512 support (default: disabled)],
|
||||
[ ENABLED_SHA512=$enableval ],
|
||||
[ ENABLED_SHA512=no ]
|
||||
)
|
||||
|
||||
if test "$ENABLED_SHA512" = "yes"
|
||||
then
|
||||
AM_CFLAGS="$AM_CFLAGS -DCYASSL_SHA512"
|
||||
fi
|
||||
|
||||
if test "$ENABLED_FORTRESS" = "yes"
|
||||
then
|
||||
ENABLED_SHA512="yes"
|
||||
fi
|
||||
|
||||
if test "$ENABLED_AESGCM" = "yes"
|
||||
then
|
||||
ENABLED_SHA512="yes"
|
||||
fi
|
||||
|
||||
|
||||
AM_CONDITIONAL([BUILD_SHA512], [test "x$ENABLED_SHA512" = "xyes"])
|
||||
|
||||
|
||||
# SESSION CERTS
|
||||
AC_ARG_ENABLE(sessioncerts,
|
||||
[ --enable-sessioncerts Enable session cert storing (default: disabled)],
|
||||
[ ENABLED_SESSIONCERTS=$enableval ],
|
||||
[ ENABLED_SESSIONCERTS=no ]
|
||||
)
|
||||
|
||||
if test "$ENABLED_SESSIONCERTS" = "yes"
|
||||
then
|
||||
AM_CFLAGS="$AM_CFLAGS -DSESSION_CERTS"
|
||||
fi
|
||||
|
||||
|
||||
# KEY GENERATION
|
||||
AC_ARG_ENABLE(keygen,
|
||||
[ --enable-keygen Enable key generation (default: disabled)],
|
||||
[ ENABLED_KEYGEN=$enableval ],
|
||||
[ ENABLED_KEYGEN=no ]
|
||||
)
|
||||
|
||||
if test "$ENABLED_KEYGEN" = "yes"
|
||||
then
|
||||
AM_CFLAGS="$AM_CFLAGS -DCYASSL_KEY_GEN"
|
||||
fi
|
||||
|
||||
|
||||
# CERT GENERATION
|
||||
AC_ARG_ENABLE(certgen,
|
||||
[ --enable-certgen Enable cert generation (default: disabled)],
|
||||
[ ENABLED_CERTGEN=$enableval ],
|
||||
[ ENABLED_CERTGEN=no ]
|
||||
)
|
||||
|
||||
if test "$ENABLED_CERTGEN" = "yes"
|
||||
then
|
||||
AM_CFLAGS="$AM_CFLAGS -DCYASSL_CERT_GEN"
|
||||
fi
|
||||
|
||||
|
||||
# HC128
|
||||
AC_ARG_ENABLE(hc128,
|
||||
[ --enable-hc128 Enable HC-128 (default: disabled)],
|
||||
[ ENABLED_HC128=$enableval ],
|
||||
[ ENABLED_HC128=no ]
|
||||
)
|
||||
|
||||
if test "$ENABLED_HC128" = "no"
|
||||
then
|
||||
AM_CFLAGS="$AM_CFLAGS -DNO_HC128"
|
||||
else
|
||||
AM_CFLAGS="$AM_CFLAGS -DHAVE_HC128"
|
||||
fi
|
||||
|
||||
AM_CONDITIONAL([BUILD_HC128], [test "x$ENABLED_HC128" = "xyes"])
|
||||
|
||||
|
||||
# PSK
|
||||
AC_ARG_ENABLE(psk,
|
||||
[ --enable-psk Enable PSK (default: disabled)],
|
||||
[ ENABLED_PSK=$enableval ],
|
||||
[ ENABLED_PSK=no ]
|
||||
)
|
||||
|
||||
if test "$ENABLED_PSK" = "no"
|
||||
then
|
||||
AM_CFLAGS="$AM_CFLAGS -DNO_PSK"
|
||||
fi
|
||||
|
||||
|
||||
# Web Server Build
|
||||
AC_ARG_ENABLE(webServer,
|
||||
[ --enable-webServer Enable Web Server (default: disabled)],
|
||||
[ ENABLED_WEBSERVER=$enableval ],
|
||||
[ ENABLED_WEBSERVER=no ]
|
||||
)
|
||||
|
||||
if test "$ENABLED_WEBSERVER" = "yes"
|
||||
then
|
||||
AM_CFLAGS="$AM_CFLAGS -DHAVE_WEBSERVER"
|
||||
fi
|
||||
|
||||
|
||||
# No Filesystem Build
|
||||
AC_ARG_ENABLE(noFilesystem,
|
||||
[ --enable-noFilesystem Enable No Filesystem (default: disabled)],
|
||||
[ ENABLED_NOFILESYSTEM=$enableval ],
|
||||
[ ENABLED_NOFILESYSTEM=no ]
|
||||
)
|
||||
|
||||
if test "$ENABLED_NOFILESYSTEM" = "yes"
|
||||
then
|
||||
AM_CFLAGS="$AM_CFLAGS -DNO_FILESYSTEM"
|
||||
fi
|
||||
|
||||
|
||||
# No inline Build
|
||||
AC_ARG_ENABLE(noInline,
|
||||
[ --enable-noInline Enable No inline (default: disabled)],
|
||||
[ ENABLED_NOINLINE=$enableval ],
|
||||
[ ENABLED_NOINLINE=no ]
|
||||
)
|
||||
|
||||
if test "$ENABLED_NOINLINE" = "yes"
|
||||
then
|
||||
AM_CFLAGS="$AM_CFLAGS -DNO_INLINE"
|
||||
fi
|
||||
|
||||
AM_CONDITIONAL([BUILD_NOINLINE], [test "x$ENABLED_NOINLINE" = "xyes"])
|
||||
|
||||
|
||||
# ECC
|
||||
AC_ARG_ENABLE(ecc,
|
||||
[ --enable-ecc Enable ECC (default: disabled)],
|
||||
[ ENABLED_ECC=$enableval ],
|
||||
[ ENABLED_ECC=no ]
|
||||
)
|
||||
|
||||
if test "$ENABLED_ECC" = "yes"
|
||||
then
|
||||
AM_CFLAGS="$AM_CFLAGS -DHAVE_ECC"
|
||||
fi
|
||||
|
||||
AM_CONDITIONAL([BUILD_ECC], [test "x$ENABLED_ECC" = "xyes"])
|
||||
|
||||
|
||||
if test "$ENABLED_ECC" = "yes" && test "$ENABLED_SMALL" = "yes"
|
||||
then
|
||||
AC_MSG_ERROR([cannot enable ecc and small, ecc requires TLS which small turns off.])
|
||||
fi
|
||||
|
||||
|
||||
# OCSP
|
||||
AC_ARG_ENABLE(ocsp,
|
||||
[ --enable-ocsp Enable OCSP (default: disabled)],
|
||||
[ ENABLED_OCSP=$enableval ],
|
||||
[ ENABLED_OCSP=no ],
|
||||
)
|
||||
|
||||
if test "$ENABLED_OCSP" = "yes"
|
||||
then
|
||||
AM_CFLAGS="$AM_CFLAGS -DHAVE_OCSP"
|
||||
fi
|
||||
|
||||
AM_CONDITIONAL([BUILD_OCSP], [test "x$ENABLED_OCSP" = "xyes"])
|
||||
|
||||
|
||||
# CRL
|
||||
AC_ARG_ENABLE(crl,
|
||||
[ --enable-crl Enable CRL (default: disabled)],
|
||||
[ ENABLED_CRL=$enableval ],
|
||||
[ ENABLED_CRL=no ],
|
||||
)
|
||||
|
||||
if test "$ENABLED_CRL" = "yes"
|
||||
then
|
||||
AM_CFLAGS="$AM_CFLAGS -DHAVE_CRL"
|
||||
fi
|
||||
|
||||
AM_CONDITIONAL([BUILD_CRL], [test "x$ENABLED_CRL" = "xyes"])
|
||||
|
||||
|
||||
# CRL Monitor
|
||||
AC_ARG_ENABLE(crl-monitor,
|
||||
[ --enable-crl-monitor Enable CRL Monitor (default: disabled)],
|
||||
[ ENABLED_CRL_MONITOR=$enableval ],
|
||||
[ ENABLED_CRL_MONITOR=no ],
|
||||
)
|
||||
|
||||
if test "$ENABLED_CRL_MONITOR" = "yes"
|
||||
then
|
||||
AM_CFLAGS="$AM_CFLAGS -DHAVE_CRL_MONITOR"
|
||||
fi
|
||||
|
||||
AM_CONDITIONAL([BUILD_CRL_MONITOR], [test "x$ENABLED_CRL_MONITOR" = "xyes"])
|
||||
|
||||
|
||||
# NTRU
|
||||
ntruHome=`pwd`/NTRU_algorithm
|
||||
ntruInclude=$ntruHome/cryptolib
|
||||
ntruLib=$ntruHome
|
||||
AC_ARG_ENABLE(ntru,
|
||||
[ --enable-ntru Enable NTRU (default: disabled)],
|
||||
[ ENABLED_NTRU=$enableval ],
|
||||
[ ENABLED_NTRU=no ]
|
||||
)
|
||||
|
||||
if test "$ENABLED_NTRU" = "yes"
|
||||
then
|
||||
AM_CFLAGS="$AM_CFLAGS -DHAVE_NTRU -I$ntruInclude"
|
||||
AM_LDFLAGS="$AM_LDFLAGS -L$ntruLib"
|
||||
LIBS="$LIBS -lntru_encrypt"
|
||||
fi
|
||||
|
||||
AM_CONDITIONAL([BUILD_NTRU], [test "x$ENABLED_NTRU" = "xyes"])
|
||||
|
||||
if test "$ENABLED_NTRU" = "yes" && test "$ENABLED_SMALL" = "yes"
|
||||
then
|
||||
AC_MSG_ERROR([cannot enable ntru and small, ntru requires TLS which small turns off.])
|
||||
fi
|
||||
|
||||
|
||||
# Test certs, use internal cert functions for extra testing
|
||||
AC_ARG_ENABLE(testcert,
|
||||
[ --enable-testcert Enable Test Cert (default: disabled)],
|
||||
[ ENABLED_TESTCERT=$enableval ],
|
||||
[ ENABLED_TESTCERT=no ]
|
||||
)
|
||||
|
||||
if test "$ENABLED_TESTCERT" = "yes"
|
||||
then
|
||||
AM_CFLAGS="$AM_CFLAGS -DCYASSL_TEST_CERT"
|
||||
fi
|
||||
|
||||
|
||||
# LIBZ
|
||||
trylibzdir=""
|
||||
AC_ARG_WITH(libz,
|
||||
[ --with-libz=PATH PATH to libz install (default /usr/) ],
|
||||
[
|
||||
AC_MSG_CHECKING([for libz])
|
||||
CPPFLAGS="$CPPFLAGS -DHAVE_LIBZ"
|
||||
LIBS="$LIBS -lz"
|
||||
|
||||
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <zlib.h>]], [[ deflateInit(0, 8); ]])],[ libz_linked=yes ],[ libz_linked=no ])
|
||||
|
||||
if test "x$libz_linked" == "xno" ; then
|
||||
if test "x$withval" != "xno" ; then
|
||||
trylibzdir=$withval
|
||||
fi
|
||||
if test "x$withval" == "xyes" ; then
|
||||
trylibzdir="/usr"
|
||||
fi
|
||||
|
||||
AM_LDFLAGS="$AM_LDFLAGS -L$trylibzdir/lib"
|
||||
CPPFLAGS="$CPPFLAGS -I$trylibzdir/include"
|
||||
|
||||
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <zlib.h>]], [[ deflateInit(0, 8); ]])],[ libz_linked=yes ],[ libz_linked=no ])
|
||||
|
||||
if test "x$libz_linked" == "xno" ; then
|
||||
AC_MSG_ERROR([libz isn't found.
|
||||
If it's already installed, specify its path using --with-libz=/dir/])
|
||||
fi
|
||||
AC_MSG_RESULT([yes])
|
||||
else
|
||||
AC_MSG_RESULT([yes])
|
||||
fi
|
||||
|
||||
]
|
||||
)
|
||||
|
||||
|
||||
# OPTIMIZE FLAGS
|
||||
if test "$GCC" = "yes"
|
||||
then
|
||||
AM_CFLAGS="$AM_CFLAGS -Wall -Wno-unused"
|
||||
if test "$ENABLED_DEBUG" = "no"
|
||||
then
|
||||
if test "$ENABLED_FASTMATH" = "yes"
|
||||
then
|
||||
AM_CFLAGS="$AM_CFLAGS $OPTIMIZE_FAST_CFLAGS"
|
||||
if test "$ENABLED_FASTHUGEMATH" = "yes"
|
||||
then
|
||||
AM_CFLAGS="$AM_CFLAGS $OPTIMIZE_HUGE_CFLAGS"
|
||||
fi
|
||||
else
|
||||
AM_CFLAGS="$AM_CFLAGS $OPTIMIZE_CFLAGS"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
AX_PTHREAD([
|
||||
AC_DEFINE([HAVE_PTHREAD], [1], [Define if you have POSIX threads libraries and header files.])
|
||||
],
|
||||
[
|
||||
AC_DEFINE([HAVE_PTHREAD], [0], [Define if you have POSIX threads libraries and header files.])
|
||||
])
|
||||
|
||||
LIB_SOCKET_NSL
|
||||
|
||||
dnl Various GCC warnings that should never fire for release quality code
|
||||
GCCWARNINGS="-Wall -fno-strict-aliasing -W -Wfloat-equal -Wundef \
|
||||
-Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes \
|
||||
-Wwrite-strings -Wredundant-decls -Wchar-subscripts -Wcomment \
|
||||
-Wformat=2 -Wwrite-strings -Wmissing-declarations -Wredundant-decls \
|
||||
-Wnested-externs -Wbad-function-cast -Wswitch-enum -Winit-self \
|
||||
-Wmissing-field-initializers -Wdeclaration-after-statement \
|
||||
-Wold-style-definition -Waddress -Wmissing-noreturn -Wnormalized=id \
|
||||
-Woverride-init -Wstrict-overflow=1 -Wextra -Wstack-protector -Wformat \
|
||||
-Wformat-security -Wpointer-sign -Wshadow -Wswitch-default"
|
||||
|
||||
case "$host_os" in
|
||||
*linux*)
|
||||
GCCWARNINGS="$GCCWARNINGS -Warray-bounds"
|
||||
;;
|
||||
esac
|
||||
|
||||
AC_ARG_ENABLE(gcc-lots-o-warnings,
|
||||
AS_HELP_STRING(--enable-gcc-lots-o-warnings, Enable lots of gcc warnings (default: disabled)),
|
||||
[if test x$enableval = xyes; then
|
||||
AM_CFLAGS="$AM_CFLAGS $GCCWARNINGS"
|
||||
fi])
|
||||
|
||||
AC_ARG_ENABLE(gcc-hardening,
|
||||
AS_HELP_STRING(--enable-gcc-hardening, Enable compiler security checks (default: disabled)),
|
||||
[if test x$enableval = xyes; then
|
||||
AM_CFLAGS="$AM_CFLAGS -D_FORTIFY_SOURCE=2 -fstack-protector-all"
|
||||
AM_CFLAGS="$AM_CFLAGS -fwrapv -fPIE -Wstack-protector"
|
||||
AM_CFLAGS="$AM_CFLAGS --param ssp-buffer-size=1"
|
||||
LDFLAGS="$LDFLAGS -pie"
|
||||
fi])
|
||||
|
||||
dnl Linker hardening options
|
||||
dnl Currently these options are ELF specific - you can't use this with MacOSX
|
||||
AC_ARG_ENABLE(linker-hardening,
|
||||
AS_HELP_STRING(--enable-linker-hardening, Enable linker security fixups (default: disabled)),
|
||||
[if test x$enableval = xyes; then
|
||||
LDFLAGS="$LDFLAGS -z relro -z now"
|
||||
fi])
|
||||
|
||||
CREATE_HEX_VERSION
|
||||
AM_CFLAGS="$AM_CFLAGS $CFLAG_VISIBILITY"
|
||||
AC_SUBST(AM_CFLAGS)
|
||||
AC_SUBST(AM_LDFLAGS)
|
||||
|
||||
# FINAL
|
||||
AC_CONFIG_FILES([stamp-h], [echo timestamp > stamp-h])
|
||||
AC_CONFIG_FILES([Makefile])
|
||||
AC_CONFIG_FILES([cyassl/version.h])
|
||||
AC_CONFIG_FILES([support/libcyassl.pc])
|
||||
|
||||
AC_OUTPUT
|
||||
|
||||
@@ -1,681 +0,0 @@
|
||||
/* benchmark.c
|
||||
*
|
||||
* Copyright (C) 2006-2012 Sawtooth Consulting Ltd.
|
||||
*
|
||||
* This file is part of CyaSSL.
|
||||
*
|
||||
* CyaSSL is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* CyaSSL is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
*/
|
||||
|
||||
/* CTaoCrypt benchmark */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include <cyassl/ctaocrypt/des3.h>
|
||||
#include <cyassl/ctaocrypt/arc4.h>
|
||||
#include <cyassl/ctaocrypt/hc128.h>
|
||||
#include <cyassl/ctaocrypt/rabbit.h>
|
||||
#include <cyassl/ctaocrypt/aes.h>
|
||||
#include <cyassl/ctaocrypt/md5.h>
|
||||
#include <cyassl/ctaocrypt/sha.h>
|
||||
#include <cyassl/ctaocrypt/sha256.h>
|
||||
#include <cyassl/ctaocrypt/sha512.h>
|
||||
#include <cyassl/ctaocrypt/rsa.h>
|
||||
#include <cyassl/ctaocrypt/asn.h>
|
||||
#include <cyassl/ctaocrypt/ripemd.h>
|
||||
#include <cyassl/ctaocrypt/ecc.h>
|
||||
|
||||
#include <cyassl/ctaocrypt/dh.h>
|
||||
|
||||
#ifdef _MSC_VER
|
||||
/* 4996 warning to use MS extensions e.g., strcpy_s instead of strncpy */
|
||||
#pragma warning(disable: 4996)
|
||||
#endif
|
||||
|
||||
void bench_des();
|
||||
void bench_arc4();
|
||||
void bench_hc128();
|
||||
void bench_rabbit();
|
||||
void bench_aes(int);
|
||||
void bench_aesgcm();
|
||||
|
||||
void bench_md5();
|
||||
void bench_sha();
|
||||
void bench_sha256();
|
||||
void bench_sha512();
|
||||
void bench_ripemd();
|
||||
|
||||
void bench_rsa();
|
||||
void bench_rsaKeyGen();
|
||||
void bench_dh();
|
||||
#ifdef HAVE_ECC
|
||||
void bench_eccKeyGen();
|
||||
void bench_eccKeyAgree();
|
||||
#endif
|
||||
|
||||
double current_time();
|
||||
|
||||
|
||||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
#ifndef NO_AES
|
||||
bench_aes(0);
|
||||
bench_aes(1);
|
||||
#endif
|
||||
#ifdef HAVE_AESGCM
|
||||
bench_aesgcm();
|
||||
#endif
|
||||
bench_arc4();
|
||||
#ifdef HAVE_HC128
|
||||
bench_hc128();
|
||||
#endif
|
||||
#ifndef NO_RABBIT
|
||||
bench_rabbit();
|
||||
#endif
|
||||
#ifndef NO_DES3
|
||||
bench_des();
|
||||
#endif
|
||||
|
||||
printf("\n");
|
||||
|
||||
bench_md5();
|
||||
bench_sha();
|
||||
#ifndef NO_SHA256
|
||||
bench_sha256();
|
||||
#endif
|
||||
#ifdef CYASSL_SHA512
|
||||
bench_sha512();
|
||||
#endif
|
||||
#ifdef CYASSL_RIPEMD
|
||||
bench_ripemd();
|
||||
#endif
|
||||
|
||||
printf("\n");
|
||||
|
||||
bench_rsa();
|
||||
|
||||
#ifndef NO_DH
|
||||
bench_dh();
|
||||
#endif
|
||||
|
||||
#ifdef CYASSL_KEY_GEN
|
||||
bench_rsaKeyGen();
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_ECC
|
||||
bench_eccKeyGen();
|
||||
bench_eccKeyAgree();
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
const int megs = 5; /* how many megs to test (en/de)cryption */
|
||||
const int times = 100; /* public key iterations */
|
||||
|
||||
const byte key[] =
|
||||
{
|
||||
0x01,0x23,0x45,0x67,0x89,0xab,0xcd,0xef,
|
||||
0xfe,0xde,0xba,0x98,0x76,0x54,0x32,0x10,
|
||||
0x89,0xab,0xcd,0xef,0x01,0x23,0x45,0x67
|
||||
};
|
||||
|
||||
const byte iv[] =
|
||||
{
|
||||
0x12,0x34,0x56,0x78,0x90,0xab,0xcd,0xef,
|
||||
0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,
|
||||
0x11,0x21,0x31,0x41,0x51,0x61,0x71,0x81
|
||||
|
||||
};
|
||||
|
||||
|
||||
byte plain [1024*1024];
|
||||
byte cipher[1024*1024];
|
||||
|
||||
|
||||
#ifndef NO_AES
|
||||
void bench_aes(int show)
|
||||
{
|
||||
Aes enc;
|
||||
double start, total, persec;
|
||||
int i;
|
||||
|
||||
AesSetKey(&enc, key, 16, iv, AES_ENCRYPTION);
|
||||
start = current_time();
|
||||
|
||||
for(i = 0; i < megs; i++)
|
||||
AesCbcEncrypt(&enc, plain, cipher, sizeof(plain));
|
||||
|
||||
total = current_time() - start;
|
||||
|
||||
persec = 1 / total * megs;
|
||||
|
||||
if (show)
|
||||
printf("AES %d megs took %5.3f seconds, %6.2f MB/s\n", megs, total,
|
||||
persec);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
byte additional[13];
|
||||
byte tag[16];
|
||||
|
||||
|
||||
#ifdef HAVE_AESGCM
|
||||
void bench_aesgcm()
|
||||
{
|
||||
Aes enc;
|
||||
double start, total, persec;
|
||||
int i;
|
||||
|
||||
AesGcmSetKey(&enc, key, 16, iv);
|
||||
AesGcmSetExpIV(&enc, iv+4);
|
||||
start = current_time();
|
||||
|
||||
for(i = 0; i < megs; i++)
|
||||
AesGcmEncrypt(&enc, cipher, plain, sizeof(plain),
|
||||
tag, 16, additional, 13);
|
||||
|
||||
total = current_time() - start;
|
||||
|
||||
persec = 1 / total * megs;
|
||||
printf("AES-GCM %d megs took %5.3f seconds, %6.2f MB/s\n", megs, total,
|
||||
persec);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef NO_DES3
|
||||
void bench_des()
|
||||
{
|
||||
Des3 enc;
|
||||
double start, total, persec;
|
||||
int i;
|
||||
|
||||
Des3_SetKey(&enc, key, iv, DES_ENCRYPTION);
|
||||
start = current_time();
|
||||
|
||||
for(i = 0; i < megs; i++)
|
||||
Des3_CbcEncrypt(&enc, plain, cipher, sizeof(plain));
|
||||
|
||||
total = current_time() - start;
|
||||
|
||||
persec = 1 / total * megs;
|
||||
|
||||
printf("3DES %d megs took %5.3f seconds, %6.2f MB/s\n", megs, total,
|
||||
persec);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
void bench_arc4()
|
||||
{
|
||||
Arc4 enc;
|
||||
double start, total, persec;
|
||||
int i;
|
||||
|
||||
Arc4SetKey(&enc, key, 16);
|
||||
start = current_time();
|
||||
|
||||
for(i = 0; i < megs; i++)
|
||||
Arc4Process(&enc, cipher, plain, sizeof(plain));
|
||||
|
||||
total = current_time() - start;
|
||||
persec = 1 / total * megs;
|
||||
|
||||
printf("ARC4 %d megs took %5.3f seconds, %6.2f MB/s\n", megs, total,
|
||||
persec);
|
||||
}
|
||||
|
||||
|
||||
#ifdef HAVE_HC128
|
||||
void bench_hc128()
|
||||
{
|
||||
HC128 enc;
|
||||
double start, total, persec;
|
||||
int i;
|
||||
|
||||
Hc128_SetKey(&enc, key, iv);
|
||||
start = current_time();
|
||||
|
||||
for(i = 0; i < megs; i++)
|
||||
Hc128_Process(&enc, cipher, plain, sizeof(plain));
|
||||
|
||||
total = current_time() - start;
|
||||
persec = 1 / total * megs;
|
||||
|
||||
printf("HC128 %d megs took %5.3f seconds, %6.2f MB/s\n", megs, total,
|
||||
persec);
|
||||
}
|
||||
#endif /* HAVE_HC128 */
|
||||
|
||||
|
||||
#ifndef NO_RABBIT
|
||||
void bench_rabbit()
|
||||
{
|
||||
Rabbit enc;
|
||||
double start, total, persec;
|
||||
int i;
|
||||
|
||||
RabbitSetKey(&enc, key, iv);
|
||||
start = current_time();
|
||||
|
||||
for(i = 0; i < megs; i++)
|
||||
RabbitProcess(&enc, cipher, plain, sizeof(plain));
|
||||
|
||||
total = current_time() - start;
|
||||
persec = 1 / total * megs;
|
||||
|
||||
printf("RABBIT %d megs took %5.3f seconds, %6.2f MB/s\n", megs, total,
|
||||
persec);
|
||||
}
|
||||
#endif /* NO_RABBIT */
|
||||
|
||||
|
||||
void bench_md5()
|
||||
{
|
||||
Md5 hash;
|
||||
byte digest[MD5_DIGEST_SIZE];
|
||||
double start, total, persec;
|
||||
int i;
|
||||
|
||||
InitMd5(&hash);
|
||||
start = current_time();
|
||||
|
||||
for(i = 0; i < megs; i++)
|
||||
Md5Update(&hash, plain, sizeof(plain));
|
||||
|
||||
Md5Final(&hash, digest);
|
||||
|
||||
total = current_time() - start;
|
||||
persec = 1 / total * megs;
|
||||
|
||||
printf("MD5 %d megs took %5.3f seconds, %6.2f MB/s\n", megs, total,
|
||||
persec);
|
||||
}
|
||||
|
||||
|
||||
void bench_sha()
|
||||
{
|
||||
Sha hash;
|
||||
byte digest[SHA_DIGEST_SIZE];
|
||||
double start, total, persec;
|
||||
int i;
|
||||
|
||||
InitSha(&hash);
|
||||
start = current_time();
|
||||
|
||||
for(i = 0; i < megs; i++)
|
||||
ShaUpdate(&hash, plain, sizeof(plain));
|
||||
|
||||
ShaFinal(&hash, digest);
|
||||
|
||||
total = current_time() - start;
|
||||
persec = 1 / total * megs;
|
||||
|
||||
printf("SHA %d megs took %5.3f seconds, %6.2f MB/s\n", megs, total,
|
||||
persec);
|
||||
}
|
||||
|
||||
|
||||
#ifndef NO_SHA256
|
||||
void bench_sha256()
|
||||
{
|
||||
Sha256 hash;
|
||||
byte digest[SHA256_DIGEST_SIZE];
|
||||
double start, total, persec;
|
||||
int i;
|
||||
|
||||
InitSha256(&hash);
|
||||
start = current_time();
|
||||
|
||||
for(i = 0; i < megs; i++)
|
||||
Sha256Update(&hash, plain, sizeof(plain));
|
||||
|
||||
Sha256Final(&hash, digest);
|
||||
|
||||
total = current_time() - start;
|
||||
persec = 1 / total * megs;
|
||||
|
||||
printf("SHA-256 %d megs took %5.3f seconds, %6.2f MB/s\n", megs, total,
|
||||
persec);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CYASSL_SHA512
|
||||
void bench_sha512()
|
||||
{
|
||||
Sha512 hash;
|
||||
byte digest[SHA512_DIGEST_SIZE];
|
||||
double start, total, persec;
|
||||
int i;
|
||||
|
||||
InitSha512(&hash);
|
||||
start = current_time();
|
||||
|
||||
for(i = 0; i < megs; i++)
|
||||
Sha512Update(&hash, plain, sizeof(plain));
|
||||
|
||||
Sha512Final(&hash, digest);
|
||||
|
||||
total = current_time() - start;
|
||||
persec = 1 / total * megs;
|
||||
|
||||
printf("SHA-512 %d megs took %5.3f seconds, %6.2f MB/s\n", megs, total,
|
||||
persec);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CYASSL_RIPEMD
|
||||
void bench_ripemd()
|
||||
{
|
||||
RipeMd hash;
|
||||
byte digest[RIPEMD_DIGEST_SIZE];
|
||||
double start, total, persec;
|
||||
int i;
|
||||
|
||||
InitRipeMd(&hash);
|
||||
start = current_time();
|
||||
|
||||
for(i = 0; i < megs; i++)
|
||||
RipeMdUpdate(&hash, plain, sizeof(plain));
|
||||
|
||||
RipeMdFinal(&hash, digest);
|
||||
|
||||
total = current_time() - start;
|
||||
persec = 1 / total * megs;
|
||||
|
||||
printf("RIPEMD %d megs took %5.3f seconds, %6.2f MB/s\n", megs, total,
|
||||
persec);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
RNG rng;
|
||||
|
||||
void bench_rsa()
|
||||
{
|
||||
int i;
|
||||
byte tmp[4096];
|
||||
size_t bytes;
|
||||
word32 idx = 0;
|
||||
|
||||
byte message[] = "Everyone gets Friday off.";
|
||||
byte cipher[512]; /* for up to 4096 bit */
|
||||
byte* output;
|
||||
const int len = (int)strlen((char*)message);
|
||||
double start, total, each, milliEach;
|
||||
|
||||
RsaKey key;
|
||||
FILE* file = fopen("./certs/rsa2048.der", "rb");
|
||||
|
||||
if (!file) {
|
||||
printf("can't find ./certs/rsa2048.der, "
|
||||
"Please run from CyaSSL home dir\n");
|
||||
return;
|
||||
}
|
||||
|
||||
InitRng(&rng);
|
||||
bytes = fread(tmp, 1, sizeof(tmp), file);
|
||||
InitRsaKey(&key, 0);
|
||||
bytes = RsaPrivateKeyDecode(tmp, &idx, &key, (word32)bytes);
|
||||
|
||||
start = current_time();
|
||||
|
||||
for (i = 0; i < times; i++)
|
||||
bytes = RsaPublicEncrypt(message,len,cipher,sizeof(cipher), &key, &rng);
|
||||
|
||||
total = current_time() - start;
|
||||
each = total / times; /* per second */
|
||||
milliEach = each * 1000; /* milliseconds */
|
||||
|
||||
printf("RSA 2048 encryption took %6.2f milliseconds, avg over %d"
|
||||
" iterations\n", milliEach, times);
|
||||
|
||||
start = current_time();
|
||||
|
||||
for (i = 0; i < times; i++)
|
||||
RsaPrivateDecryptInline(cipher, (word32)bytes, &output, &key);
|
||||
|
||||
total = current_time() - start;
|
||||
each = total / times; /* per second */
|
||||
milliEach = each * 1000; /* milliseconds */
|
||||
|
||||
printf("RSA 2048 decryption took %6.2f milliseconds, avg over %d"
|
||||
" iterations\n", milliEach, times);
|
||||
|
||||
fclose(file);
|
||||
FreeRsaKey(&key);
|
||||
}
|
||||
|
||||
|
||||
#ifndef NO_DH
|
||||
void bench_dh()
|
||||
{
|
||||
int i;
|
||||
byte tmp[1024];
|
||||
size_t bytes;
|
||||
word32 idx = 0, pubSz, privSz, pubSz2, privSz2, agreeSz;
|
||||
|
||||
byte pub[256]; /* for 2048 bit */
|
||||
byte priv[256]; /* for 2048 bit */
|
||||
byte pub2[256]; /* for 2048 bit */
|
||||
byte priv2[256]; /* for 2048 bit */
|
||||
byte agree[256]; /* for 2048 bit */
|
||||
|
||||
double start, total, each, milliEach;
|
||||
DhKey key;
|
||||
FILE* file = fopen("./certs/dh2048.der", "rb");
|
||||
|
||||
if (!file) {
|
||||
printf("can't find ./certs/dh2048.der, "
|
||||
"Please run from CyaSSL home dir\n");
|
||||
return;
|
||||
}
|
||||
|
||||
bytes = fread(tmp, 1, sizeof(tmp), file);
|
||||
InitDhKey(&key);
|
||||
bytes = DhKeyDecode(tmp, &idx, &key, (word32)bytes);
|
||||
|
||||
start = current_time();
|
||||
|
||||
for (i = 0; i < times; i++)
|
||||
DhGenerateKeyPair(&key, &rng, priv, &privSz, pub, &pubSz);
|
||||
|
||||
total = current_time() - start;
|
||||
each = total / times; /* per second */
|
||||
milliEach = each * 1000; /* milliseconds */
|
||||
|
||||
printf("DH 2048 key generation %6.2f milliseconds, avg over %d"
|
||||
" iterations\n", milliEach, times);
|
||||
|
||||
DhGenerateKeyPair(&key, &rng, priv2, &privSz2, pub2, &pubSz2);
|
||||
start = current_time();
|
||||
|
||||
for (i = 0; i < times; i++)
|
||||
DhAgree(&key, agree, &agreeSz, priv, privSz, pub2, pubSz2);
|
||||
|
||||
total = current_time() - start;
|
||||
each = total / times; /* per second */
|
||||
milliEach = each * 1000; /* milliseconds */
|
||||
|
||||
printf("DH 2048 key agreement %6.2f milliseconds, avg over %d"
|
||||
" iterations\n", milliEach, times);
|
||||
|
||||
fclose(file);
|
||||
FreeDhKey(&key);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CYASSL_KEY_GEN
|
||||
void bench_rsaKeyGen()
|
||||
{
|
||||
RsaKey genKey;
|
||||
double start, total, each, milliEach;
|
||||
int i;
|
||||
const int genTimes = 5;
|
||||
|
||||
/* 1024 bit */
|
||||
start = current_time();
|
||||
|
||||
for(i = 0; i < genTimes; i++) {
|
||||
InitRsaKey(&genKey, 0);
|
||||
MakeRsaKey(&genKey, 1024, 65537, &rng);
|
||||
FreeRsaKey(&genKey);
|
||||
}
|
||||
|
||||
total = current_time() - start;
|
||||
each = total / genTimes; /* per second */
|
||||
milliEach = each * 1000; /* millisconds */
|
||||
printf("\n");
|
||||
printf("RSA 1024 key generation %6.2f milliseconds, avg over %d"
|
||||
" iterations\n", milliEach, genTimes);
|
||||
|
||||
/* 2048 bit */
|
||||
start = current_time();
|
||||
|
||||
for(i = 0; i < genTimes; i++) {
|
||||
InitRsaKey(&genKey, 0);
|
||||
MakeRsaKey(&genKey, 2048, 65537, &rng);
|
||||
FreeRsaKey(&genKey);
|
||||
}
|
||||
|
||||
total = current_time() - start;
|
||||
each = total / genTimes; /* per second */
|
||||
milliEach = each * 1000; /* millisconds */
|
||||
printf("RSA 2048 key generation %6.2f milliseconds, avg over %d"
|
||||
" iterations\n", milliEach, genTimes);
|
||||
}
|
||||
#endif /* CYASSL_KEY_GEN */
|
||||
|
||||
#ifdef HAVE_ECC
|
||||
void bench_eccKeyGen()
|
||||
{
|
||||
ecc_key genKey;
|
||||
double start, total, each, milliEach;
|
||||
int i;
|
||||
const int genTimes = 5;
|
||||
|
||||
/* 256 bit */
|
||||
start = current_time();
|
||||
|
||||
for(i = 0; i < genTimes; i++) {
|
||||
int ret = ecc_make_key(&rng, 32, &genKey);
|
||||
ecc_free(&genKey);
|
||||
}
|
||||
|
||||
total = current_time() - start;
|
||||
each = total / genTimes; /* per second */
|
||||
milliEach = each * 1000; /* millisconds */
|
||||
printf("\n");
|
||||
printf("ECC 256 key generation %6.2f milliseconds, avg over %d"
|
||||
" iterations\n", milliEach, genTimes);
|
||||
}
|
||||
|
||||
|
||||
void bench_eccKeyAgree()
|
||||
{
|
||||
ecc_key genKey, genKey2;
|
||||
double start, total, each, milliEach;
|
||||
int i;
|
||||
const int agreeTimes = 5;
|
||||
byte shared[1024];
|
||||
byte sig[1024];
|
||||
byte digest[32];
|
||||
word32 x;
|
||||
|
||||
ecc_make_key(&rng, 32, &genKey);
|
||||
ecc_make_key(&rng, 32, &genKey2);
|
||||
|
||||
/* 256 bit */
|
||||
start = current_time();
|
||||
|
||||
for(i = 0; i < agreeTimes; i++) {
|
||||
x = sizeof(shared);
|
||||
ecc_shared_secret(&genKey, &genKey2, shared, &x);
|
||||
}
|
||||
|
||||
total = current_time() - start;
|
||||
each = total / agreeTimes; /* per second */
|
||||
milliEach = each * 1000; /* millisconds */
|
||||
printf("EC-DHE key agreement %6.2f milliseconds, avg over %d"
|
||||
" iterations\n", milliEach, agreeTimes);
|
||||
|
||||
/* make dummy digest */
|
||||
for (i = 0; i < sizeof(digest); i++)
|
||||
digest[i] = i;
|
||||
|
||||
|
||||
start = current_time();
|
||||
|
||||
for(i = 0; i < agreeTimes; i++) {
|
||||
x = sizeof(sig);
|
||||
ecc_sign_hash(digest, sizeof(digest), sig, &x, &rng, &genKey);
|
||||
}
|
||||
|
||||
total = current_time() - start;
|
||||
each = total / agreeTimes; /* per second */
|
||||
milliEach = each * 1000; /* millisconds */
|
||||
printf("EC-DSA sign time %6.2f milliseconds, avg over %d"
|
||||
" iterations\n", milliEach, agreeTimes);
|
||||
|
||||
ecc_free(&genKey2);
|
||||
ecc_free(&genKey);
|
||||
}
|
||||
#endif /* HAVE_ECC */
|
||||
|
||||
|
||||
#ifdef _WIN32
|
||||
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#include <windows.h>
|
||||
|
||||
double current_time()
|
||||
{
|
||||
static int init = 0;
|
||||
static LARGE_INTEGER freq;
|
||||
|
||||
LARGE_INTEGER count;
|
||||
|
||||
if (!init) {
|
||||
QueryPerformanceFrequency(&freq);
|
||||
init = 1;
|
||||
}
|
||||
|
||||
QueryPerformanceCounter(&count);
|
||||
|
||||
return (double)count.QuadPart / freq.QuadPart;
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
#include <sys/time.h>
|
||||
|
||||
double current_time()
|
||||
{
|
||||
struct timeval tv;
|
||||
gettimeofday(&tv, 0);
|
||||
|
||||
return (double)tv.tv_sec + (double)tv.tv_usec / 1000000;
|
||||
}
|
||||
|
||||
#endif /* _WIN32 */
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
# vim:ft=automake
|
||||
# All paths should be given relative to the root
|
||||
|
||||
noinst_PROGRAMS += ctaocrypt/benchmark/benchmark
|
||||
ctaocrypt_benchmark_benchmark_SOURCES = ctaocrypt/benchmark/benchmark.c
|
||||
ctaocrypt_benchmark_benchmark_LDADD = src/libcyassl.la
|
||||
ctaocrypt_benchmark_benchmark_DEPENDENCIES = src/libcyassl.la
|
||||
EXTRA_DIST += ctaocrypt/benchmark/benchmark.sln
|
||||
EXTRA_DIST += ctaocrypt/benchmark/benchmark.vcproj
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,484 +0,0 @@
|
||||
/* aes_asm.s
|
||||
*
|
||||
* Copyright (C) 2006-2011 Sawtooth Consulting Ltd.
|
||||
*
|
||||
* This file is part of CyaSSL.
|
||||
*
|
||||
* CyaSSL is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* CyaSSL is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
*/
|
||||
|
||||
|
||||
/* See Intel® Advanced Encryption Standard (AES) Instructions Set White Paper
|
||||
* by Intel Mobility Group, Israel Development Center, Israel Shay Gueron
|
||||
*/
|
||||
|
||||
|
||||
//AES_CBC_encrypt (const unsigned char *in,
|
||||
// unsigned char *out,
|
||||
// unsigned char ivec[16],
|
||||
// unsigned long length,
|
||||
// const unsigned char *KS,
|
||||
// int nr)
|
||||
.globl AES_CBC_encrypt
|
||||
AES_CBC_encrypt:
|
||||
# parameter 1: %rdi
|
||||
# parameter 2: %rsi
|
||||
# parameter 3: %rdx
|
||||
# parameter 4: %rcx
|
||||
# parameter 5: %r8
|
||||
# parameter 6: %r9d
|
||||
movq %rcx, %r10
|
||||
shrq $4, %rcx
|
||||
shlq $60, %r10
|
||||
je NO_PARTS
|
||||
addq $1, %rcx
|
||||
NO_PARTS:
|
||||
subq $16, %rsi
|
||||
movdqa (%rdx), %xmm1
|
||||
LOOP:
|
||||
pxor (%rdi), %xmm1
|
||||
pxor (%r8), %xmm1
|
||||
addq $16,%rsi
|
||||
addq $16,%rdi
|
||||
cmpl $12, %r9d
|
||||
aesenc 16(%r8),%xmm1
|
||||
aesenc 32(%r8),%xmm1
|
||||
aesenc 48(%r8),%xmm1
|
||||
aesenc 64(%r8),%xmm1
|
||||
aesenc 80(%r8),%xmm1
|
||||
aesenc 96(%r8),%xmm1
|
||||
aesenc 112(%r8),%xmm1
|
||||
aesenc 128(%r8),%xmm1
|
||||
aesenc 144(%r8),%xmm1
|
||||
movdqa 160(%r8),%xmm2
|
||||
jb LAST
|
||||
cmpl $14, %r9d
|
||||
|
||||
aesenc 160(%r8),%xmm1
|
||||
aesenc 176(%r8),%xmm1
|
||||
movdqa 192(%r8),%xmm2
|
||||
jb LAST
|
||||
aesenc 192(%r8),%xmm1
|
||||
aesenc 208(%r8),%xmm1
|
||||
movdqa 224(%r8),%xmm2
|
||||
LAST:
|
||||
decq %rcx
|
||||
aesenclast %xmm2,%xmm1
|
||||
movdqu %xmm1,(%rsi)
|
||||
jne LOOP
|
||||
ret
|
||||
|
||||
|
||||
|
||||
//AES_CBC_decrypt (const unsigned char *in,
|
||||
// unsigned char *out,
|
||||
// unsigned char ivec[16],
|
||||
// unsigned long length,
|
||||
// const unsigned char *KS,
|
||||
// int nr)
|
||||
.globl AES_CBC_decrypt
|
||||
AES_CBC_decrypt:
|
||||
# parameter 1: %rdi
|
||||
# parameter 2: %rsi
|
||||
# parameter 3: %rdx
|
||||
# parameter 4: %rcx
|
||||
# parameter 5: %r8
|
||||
# parameter 6: %r9d
|
||||
|
||||
movq %rcx, %r10
|
||||
shrq $4, %rcx
|
||||
shlq $60, %r10
|
||||
je DNO_PARTS_4
|
||||
addq $1, %rcx
|
||||
DNO_PARTS_4:
|
||||
movq %rcx, %r10
|
||||
shlq $62, %r10
|
||||
shrq $62, %r10
|
||||
shrq $2, %rcx
|
||||
movdqu (%rdx),%xmm5
|
||||
je DREMAINDER_4
|
||||
subq $64, %rsi
|
||||
DLOOP_4:
|
||||
movdqu (%rdi), %xmm1
|
||||
movdqu 16(%rdi), %xmm2
|
||||
movdqu 32(%rdi), %xmm3
|
||||
movdqu 48(%rdi), %xmm4
|
||||
movdqa %xmm1, %xmm6
|
||||
movdqa %xmm2, %xmm7
|
||||
movdqa %xmm3, %xmm8
|
||||
movdqa %xmm4, %xmm15
|
||||
movdqa (%r8), %xmm9
|
||||
movdqa 16(%r8), %xmm10
|
||||
movdqa 32(%r8), %xmm11
|
||||
movdqa 48(%r8), %xmm12
|
||||
pxor %xmm9, %xmm1
|
||||
pxor %xmm9, %xmm2
|
||||
pxor %xmm9, %xmm3
|
||||
|
||||
pxor %xmm9, %xmm4
|
||||
aesdec %xmm10, %xmm1
|
||||
aesdec %xmm10, %xmm2
|
||||
aesdec %xmm10, %xmm3
|
||||
aesdec %xmm10, %xmm4
|
||||
aesdec %xmm11, %xmm1
|
||||
aesdec %xmm11, %xmm2
|
||||
aesdec %xmm11, %xmm3
|
||||
aesdec %xmm11, %xmm4
|
||||
aesdec %xmm12, %xmm1
|
||||
aesdec %xmm12, %xmm2
|
||||
aesdec %xmm12, %xmm3
|
||||
aesdec %xmm12, %xmm4
|
||||
movdqa 64(%r8), %xmm9
|
||||
movdqa 80(%r8), %xmm10
|
||||
movdqa 96(%r8), %xmm11
|
||||
movdqa 112(%r8), %xmm12
|
||||
aesdec %xmm9, %xmm1
|
||||
aesdec %xmm9, %xmm2
|
||||
aesdec %xmm9, %xmm3
|
||||
aesdec %xmm9, %xmm4
|
||||
aesdec %xmm10, %xmm1
|
||||
aesdec %xmm10, %xmm2
|
||||
aesdec %xmm10, %xmm3
|
||||
aesdec %xmm10, %xmm4
|
||||
aesdec %xmm11, %xmm1
|
||||
aesdec %xmm11, %xmm2
|
||||
aesdec %xmm11, %xmm3
|
||||
aesdec %xmm11, %xmm4
|
||||
aesdec %xmm12, %xmm1
|
||||
aesdec %xmm12, %xmm2
|
||||
aesdec %xmm12, %xmm3
|
||||
aesdec %xmm12, %xmm4
|
||||
movdqa 128(%r8), %xmm9
|
||||
movdqa 144(%r8), %xmm10
|
||||
movdqa 160(%r8), %xmm11
|
||||
cmpl $12, %r9d
|
||||
aesdec %xmm9, %xmm1
|
||||
aesdec %xmm9, %xmm2
|
||||
aesdec %xmm9, %xmm3
|
||||
aesdec %xmm9, %xmm4
|
||||
aesdec %xmm10, %xmm1
|
||||
aesdec %xmm10, %xmm2
|
||||
aesdec %xmm10, %xmm3
|
||||
aesdec %xmm10, %xmm4
|
||||
jb DLAST_4
|
||||
movdqa 160(%r8), %xmm9
|
||||
movdqa 176(%r8), %xmm10
|
||||
movdqa 192(%r8), %xmm11
|
||||
cmpl $14, %r9d
|
||||
aesdec %xmm9, %xmm1
|
||||
aesdec %xmm9, %xmm2
|
||||
aesdec %xmm9, %xmm3
|
||||
aesdec %xmm9, %xmm4
|
||||
aesdec %xmm10, %xmm1
|
||||
aesdec %xmm10, %xmm2
|
||||
aesdec %xmm10, %xmm3
|
||||
aesdec %xmm10, %xmm4
|
||||
jb DLAST_4
|
||||
|
||||
movdqa 192(%r8), %xmm9
|
||||
movdqa 208(%r8), %xmm10
|
||||
movdqa 224(%r8), %xmm11
|
||||
aesdec %xmm9, %xmm1
|
||||
aesdec %xmm9, %xmm2
|
||||
aesdec %xmm9, %xmm3
|
||||
aesdec %xmm9, %xmm4
|
||||
aesdec %xmm10, %xmm1
|
||||
aesdec %xmm10, %xmm2
|
||||
aesdec %xmm10, %xmm3
|
||||
aesdec %xmm10, %xmm4
|
||||
DLAST_4:
|
||||
addq $64, %rdi
|
||||
addq $64, %rsi
|
||||
decq %rcx
|
||||
aesdeclast %xmm11, %xmm1
|
||||
aesdeclast %xmm11, %xmm2
|
||||
aesdeclast %xmm11, %xmm3
|
||||
aesdeclast %xmm11, %xmm4
|
||||
pxor %xmm5 ,%xmm1
|
||||
pxor %xmm6 ,%xmm2
|
||||
pxor %xmm7 ,%xmm3
|
||||
pxor %xmm8 ,%xmm4
|
||||
movdqu %xmm1, (%rsi)
|
||||
movdqu %xmm2, 16(%rsi)
|
||||
movdqu %xmm3, 32(%rsi)
|
||||
movdqu %xmm4, 48(%rsi)
|
||||
movdqa %xmm15,%xmm5
|
||||
jne DLOOP_4
|
||||
addq $64, %rsi
|
||||
DREMAINDER_4:
|
||||
cmpq $0, %r10
|
||||
je DEND_4
|
||||
DLOOP_4_2:
|
||||
movdqu (%rdi), %xmm1
|
||||
movdqa %xmm1 ,%xmm15
|
||||
addq $16, %rdi
|
||||
pxor (%r8), %xmm1
|
||||
movdqu 160(%r8), %xmm2
|
||||
cmpl $12, %r9d
|
||||
aesdec 16(%r8), %xmm1
|
||||
aesdec 32(%r8), %xmm1
|
||||
aesdec 48(%r8), %xmm1
|
||||
aesdec 64(%r8), %xmm1
|
||||
aesdec 80(%r8), %xmm1
|
||||
aesdec 96(%r8), %xmm1
|
||||
aesdec 112(%r8), %xmm1
|
||||
aesdec 128(%r8), %xmm1
|
||||
aesdec 144(%r8), %xmm1
|
||||
jb DLAST_4_2
|
||||
movdqu 192(%r8), %xmm2
|
||||
cmpl $14, %r9d
|
||||
aesdec 160(%r8), %xmm1
|
||||
aesdec 176(%r8), %xmm1
|
||||
jb DLAST_4_2
|
||||
movdqu 224(%r8), %xmm2
|
||||
aesdec 192(%r8), %xmm1
|
||||
aesdec 208(%r8), %xmm1
|
||||
DLAST_4_2:
|
||||
aesdeclast %xmm2, %xmm1
|
||||
pxor %xmm5, %xmm1
|
||||
movdqa %xmm15, %xmm5
|
||||
movdqu %xmm1, (%rsi)
|
||||
|
||||
addq $16, %rsi
|
||||
decq %r10
|
||||
jne DLOOP_4_2
|
||||
DEND_4:
|
||||
ret
|
||||
|
||||
|
||||
|
||||
|
||||
//void AES_128_Key_Expansion(const unsigned char* userkey,
|
||||
// unsigned char* key_schedule);
|
||||
.align 16,0x90
|
||||
.globl AES_128_Key_Expansion
|
||||
AES_128_Key_Expansion:
|
||||
# parameter 1: %rdi
|
||||
# parameter 2: %rsi
|
||||
movl $10, 240(%rsi)
|
||||
|
||||
movdqu (%rdi), %xmm1
|
||||
movdqa %xmm1, (%rsi)
|
||||
|
||||
|
||||
ASSISTS:
|
||||
aeskeygenassist $1, %xmm1, %xmm2
|
||||
call PREPARE_ROUNDKEY_128
|
||||
movdqa %xmm1, 16(%rsi)
|
||||
aeskeygenassist $2, %xmm1, %xmm2
|
||||
call PREPARE_ROUNDKEY_128
|
||||
movdqa %xmm1, 32(%rsi)
|
||||
aeskeygenassist $4, %xmm1, %xmm2
|
||||
call PREPARE_ROUNDKEY_128
|
||||
movdqa %xmm1, 48(%rsi)
|
||||
aeskeygenassist $8, %xmm1, %xmm2
|
||||
call PREPARE_ROUNDKEY_128
|
||||
movdqa %xmm1, 64(%rsi)
|
||||
aeskeygenassist $16, %xmm1, %xmm2
|
||||
call PREPARE_ROUNDKEY_128
|
||||
movdqa %xmm1, 80(%rsi)
|
||||
aeskeygenassist $32, %xmm1, %xmm2
|
||||
call PREPARE_ROUNDKEY_128
|
||||
movdqa %xmm1, 96(%rsi)
|
||||
aeskeygenassist $64, %xmm1, %xmm2
|
||||
call PREPARE_ROUNDKEY_128
|
||||
movdqa %xmm1, 112(%rsi)
|
||||
aeskeygenassist $0x80, %xmm1, %xmm2
|
||||
call PREPARE_ROUNDKEY_128
|
||||
movdqa %xmm1, 128(%rsi)
|
||||
aeskeygenassist $0x1b, %xmm1, %xmm2
|
||||
call PREPARE_ROUNDKEY_128
|
||||
movdqa %xmm1, 144(%rsi)
|
||||
aeskeygenassist $0x36, %xmm1, %xmm2
|
||||
call PREPARE_ROUNDKEY_128
|
||||
movdqa %xmm1, 160(%rsi)
|
||||
ret
|
||||
|
||||
PREPARE_ROUNDKEY_128:
|
||||
pshufd $255, %xmm2, %xmm2
|
||||
movdqa %xmm1, %xmm3
|
||||
pslldq $4, %xmm3
|
||||
pxor %xmm3, %xmm1
|
||||
pslldq $4, %xmm3
|
||||
pxor %xmm3, %xmm1
|
||||
pslldq $4, %xmm3
|
||||
pxor %xmm3, %xmm1
|
||||
pxor %xmm2, %xmm1
|
||||
ret
|
||||
|
||||
|
||||
//void AES_192_Key_Expansion (const unsigned char *userkey,
|
||||
// unsigned char *key)
|
||||
.globl AES_192_Key_Expansion
|
||||
AES_192_Key_Expansion:
|
||||
# parameter 1: %rdi
|
||||
# parameter 2: %rsi
|
||||
|
||||
movdqu (%rdi), %xmm1
|
||||
movdqu 16(%rdi), %xmm3
|
||||
movdqa %xmm1, (%rsi)
|
||||
movdqa %xmm3, %xmm5
|
||||
|
||||
aeskeygenassist $0x1, %xmm3, %xmm2
|
||||
call PREPARE_ROUNDKEY_192
|
||||
shufpd $0, %xmm1, %xmm5
|
||||
movdqa %xmm5, 16(%rsi)
|
||||
movdqa %xmm1, %xmm6
|
||||
shufpd $1, %xmm3, %xmm6
|
||||
movdqa %xmm6, 32(%rsi)
|
||||
|
||||
aeskeygenassist $0x2, %xmm3, %xmm2
|
||||
call PREPARE_ROUNDKEY_192
|
||||
movdqa %xmm1, 48(%rsi)
|
||||
movdqa %xmm3, %xmm5
|
||||
|
||||
aeskeygenassist $0x4, %xmm3, %xmm2
|
||||
call PREPARE_ROUNDKEY_192
|
||||
shufpd $0, %xmm1, %xmm5
|
||||
movdqa %xmm5, 64(%rsi)
|
||||
movdqa %xmm1, %xmm6
|
||||
shufpd $1, %xmm3, %xmm6
|
||||
movdqa %xmm6, 80(%rsi)
|
||||
|
||||
aeskeygenassist $0x8, %xmm3, %xmm2
|
||||
call PREPARE_ROUNDKEY_192
|
||||
movdqa %xmm1, 96(%rsi)
|
||||
movdqa %xmm3, %xmm5
|
||||
|
||||
aeskeygenassist $0x10, %xmm3, %xmm2
|
||||
call PREPARE_ROUNDKEY_192
|
||||
shufpd $0, %xmm1, %xmm5
|
||||
movdqa %xmm5, 112(%rsi)
|
||||
movdqa %xmm1, %xmm6
|
||||
shufpd $1, %xmm3, %xmm6
|
||||
movdqa %xmm6, 128(%rsi)
|
||||
|
||||
aeskeygenassist $0x20, %xmm3, %xmm2
|
||||
call PREPARE_ROUNDKEY_192
|
||||
movdqa %xmm1, 144(%rsi)
|
||||
movdqa %xmm3, %xmm5
|
||||
|
||||
aeskeygenassist $0x40, %xmm3, %xmm2
|
||||
call PREPARE_ROUNDKEY_192
|
||||
shufpd $0, %xmm1, %xmm5
|
||||
movdqa %xmm5, 160(%rsi)
|
||||
movdqa %xmm1, %xmm6
|
||||
shufpd $1, %xmm3, %xmm6
|
||||
movdqa %xmm6, 176(%rsi)
|
||||
|
||||
aeskeygenassist $0x80, %xmm3, %xmm2
|
||||
call PREPARE_ROUNDKEY_192
|
||||
movdqa %xmm1, 192(%rsi)
|
||||
movdqa %xmm3, 208(%rsi)
|
||||
ret
|
||||
|
||||
PREPARE_ROUNDKEY_192:
|
||||
pshufd $0x55, %xmm2, %xmm2
|
||||
movdqu %xmm1, %xmm4
|
||||
pslldq $4, %xmm4
|
||||
pxor %xmm4, %xmm1
|
||||
|
||||
pslldq $4, %xmm4
|
||||
pxor %xmm4, %xmm1
|
||||
pslldq $4, %xmm4
|
||||
pxor %xmm4, %xmm1
|
||||
pxor %xmm2, %xmm1
|
||||
pshufd $0xff, %xmm1, %xmm2
|
||||
movdqu %xmm3, %xmm4
|
||||
pslldq $4, %xmm4
|
||||
pxor %xmm4, %xmm3
|
||||
pxor %xmm2, %xmm3
|
||||
ret
|
||||
|
||||
|
||||
//void AES_256_Key_Expansion (const unsigned char *userkey,
|
||||
// unsigned char *key)
|
||||
.globl AES_256_Key_Expansion
|
||||
AES_256_Key_Expansion:
|
||||
# parameter 1: %rdi
|
||||
# parameter 2: %rsi
|
||||
|
||||
movdqu (%rdi), %xmm1
|
||||
movdqu 16(%rdi), %xmm3
|
||||
movdqa %xmm1, (%rsi)
|
||||
movdqa %xmm3, 16(%rsi)
|
||||
|
||||
aeskeygenassist $0x1, %xmm3, %xmm2
|
||||
call MAKE_RK256_a
|
||||
movdqa %xmm1, 32(%rsi)
|
||||
aeskeygenassist $0x0, %xmm1, %xmm2
|
||||
call MAKE_RK256_b
|
||||
movdqa %xmm3, 48(%rsi)
|
||||
aeskeygenassist $0x2, %xmm3, %xmm2
|
||||
call MAKE_RK256_a
|
||||
movdqa %xmm1, 64(%rsi)
|
||||
aeskeygenassist $0x0, %xmm1, %xmm2
|
||||
call MAKE_RK256_b
|
||||
movdqa %xmm3, 80(%rsi)
|
||||
aeskeygenassist $0x4, %xmm3, %xmm2
|
||||
call MAKE_RK256_a
|
||||
movdqa %xmm1, 96(%rsi)
|
||||
aeskeygenassist $0x0, %xmm1, %xmm2
|
||||
call MAKE_RK256_b
|
||||
movdqa %xmm3, 112(%rsi)
|
||||
aeskeygenassist $0x8, %xmm3, %xmm2
|
||||
call MAKE_RK256_a
|
||||
movdqa %xmm1, 128(%rsi)
|
||||
aeskeygenassist $0x0, %xmm1, %xmm2
|
||||
call MAKE_RK256_b
|
||||
movdqa %xmm3, 144(%rsi)
|
||||
aeskeygenassist $0x10, %xmm3, %xmm2
|
||||
call MAKE_RK256_a
|
||||
movdqa %xmm1, 160(%rsi)
|
||||
aeskeygenassist $0x0, %xmm1, %xmm2
|
||||
call MAKE_RK256_b
|
||||
movdqa %xmm3, 176(%rsi)
|
||||
aeskeygenassist $0x20, %xmm3, %xmm2
|
||||
call MAKE_RK256_a
|
||||
movdqa %xmm1, 192(%rsi)
|
||||
|
||||
aeskeygenassist $0x0, %xmm1, %xmm2
|
||||
call MAKE_RK256_b
|
||||
movdqa %xmm3, 208(%rsi)
|
||||
aeskeygenassist $0x40, %xmm3, %xmm2
|
||||
call MAKE_RK256_a
|
||||
movdqa %xmm1, 224(%rsi)
|
||||
|
||||
ret
|
||||
|
||||
MAKE_RK256_a:
|
||||
pshufd $0xff, %xmm2, %xmm2
|
||||
movdqa %xmm1, %xmm4
|
||||
pslldq $4, %xmm4
|
||||
pxor %xmm4, %xmm1
|
||||
pslldq $4, %xmm4
|
||||
pxor %xmm4, %xmm1
|
||||
pslldq $4, %xmm4
|
||||
pxor %xmm4, %xmm1
|
||||
pxor %xmm2, %xmm1
|
||||
ret
|
||||
|
||||
MAKE_RK256_b:
|
||||
pshufd $0xaa, %xmm2, %xmm2
|
||||
movdqa %xmm3, %xmm4
|
||||
pslldq $4, %xmm4
|
||||
pxor %xmm4, %xmm3
|
||||
pslldq $4, %xmm4
|
||||
pxor %xmm4, %xmm3
|
||||
pslldq $4, %xmm4
|
||||
pxor %xmm4, %xmm3
|
||||
pxor %xmm2, %xmm3
|
||||
ret
|
||||
|
||||
@@ -1,78 +0,0 @@
|
||||
/* arc4.c
|
||||
*
|
||||
* Copyright (C) 2006-2012 Sawtooth Consulting Ltd.
|
||||
*
|
||||
* This file is part of CyaSSL.
|
||||
*
|
||||
* CyaSSL is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* CyaSSL is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
#include <cyassl/ctaocrypt/arc4.h>
|
||||
|
||||
|
||||
void Arc4SetKey(Arc4* arc4, const byte* key, word32 length)
|
||||
{
|
||||
word32 i;
|
||||
word32 keyIndex = 0, stateIndex = 0;
|
||||
|
||||
arc4->x = 1;
|
||||
arc4->y = 0;
|
||||
|
||||
for (i = 0; i < ARC4_STATE_SIZE; i++)
|
||||
arc4->state[i] = (byte)i;
|
||||
|
||||
for (i = 0; i < ARC4_STATE_SIZE; i++) {
|
||||
word32 a = arc4->state[i];
|
||||
stateIndex += key[keyIndex] + a;
|
||||
stateIndex &= 0xFF;
|
||||
arc4->state[i] = arc4->state[stateIndex];
|
||||
arc4->state[stateIndex] = (byte)a;
|
||||
|
||||
if (++keyIndex >= length)
|
||||
keyIndex = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static INLINE byte MakeByte(word32* x, word32* y, byte* s)
|
||||
{
|
||||
word32 a = s[*x], b;
|
||||
*y = (*y+a) & 0xff;
|
||||
|
||||
b = s[*y];
|
||||
s[*x] = (byte)b;
|
||||
s[*y] = (byte)a;
|
||||
*x = (*x+1) & 0xff;
|
||||
|
||||
return s[(a+b) & 0xff];
|
||||
}
|
||||
|
||||
|
||||
void Arc4Process(Arc4* arc4, byte* out, const byte* in, word32 length)
|
||||
{
|
||||
word32 x = arc4->x;
|
||||
word32 y = arc4->y;
|
||||
|
||||
while(length--)
|
||||
*out++ = *in++ ^ MakeByte(&x, &y, arc4->state);
|
||||
|
||||
arc4->x = (byte)x;
|
||||
arc4->y = (byte)y;
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,265 +0,0 @@
|
||||
/* coding.c
|
||||
*
|
||||
* Copyright (C) 2006-2012 Sawtooth Consulting Ltd.
|
||||
*
|
||||
* This file is part of CyaSSL.
|
||||
*
|
||||
* CyaSSL is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* CyaSSL is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
#include <cyassl/ctaocrypt/coding.h>
|
||||
#include <cyassl/ctaocrypt/error.h>
|
||||
#include <cyassl/ctaocrypt/logging.h>
|
||||
|
||||
|
||||
enum {
|
||||
BAD = 0xFF, /* invalid encoding */
|
||||
PAD = '=',
|
||||
PEM_LINE_SZ = 64
|
||||
};
|
||||
|
||||
|
||||
static
|
||||
const byte base64Decode[] = { 62, BAD, BAD, BAD, 63, /* + starts at 0x2B */
|
||||
52, 53, 54, 55, 56, 57, 58, 59, 60, 61,
|
||||
BAD, BAD, BAD, BAD, BAD, BAD, BAD,
|
||||
0, 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,
|
||||
BAD, BAD, BAD, BAD, BAD, BAD,
|
||||
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
|
||||
};
|
||||
|
||||
|
||||
int Base64_Decode(const byte* in, word32 inLen, byte* out, word32* outLen)
|
||||
{
|
||||
word32 i = 0;
|
||||
word32 j = 0;
|
||||
word32 plainSz = inLen - ((inLen + (PEM_LINE_SZ - 1)) / PEM_LINE_SZ );
|
||||
const byte maxIdx = (byte)sizeof(base64Decode) + 0x2B - 1;
|
||||
|
||||
plainSz = (plainSz * 3 + 3) / 4;
|
||||
if (plainSz > *outLen) return BAD_FUNC_ARG;
|
||||
|
||||
while (inLen > 3) {
|
||||
byte b1, b2, b3;
|
||||
byte e1 = in[j++];
|
||||
byte e2 = in[j++];
|
||||
byte e3 = in[j++];
|
||||
byte e4 = in[j++];
|
||||
|
||||
int pad3 = 0;
|
||||
int pad4 = 0;
|
||||
|
||||
if (e1 == 0) /* end file 0's */
|
||||
break;
|
||||
if (e3 == PAD)
|
||||
pad3 = 1;
|
||||
if (e4 == PAD)
|
||||
pad4 = 1;
|
||||
|
||||
if (e1 < 0x2B || e2 < 0x2B || e3 < 0x2B || e4 < 0x2B) {
|
||||
CYASSL_MSG("Bad Base64 Decode data, too small");
|
||||
return ASN_INPUT_E;
|
||||
}
|
||||
|
||||
if (e1 > maxIdx || e2 > maxIdx || e3 > maxIdx || e4 > maxIdx) {
|
||||
CYASSL_MSG("Bad Base64 Decode data, too big");
|
||||
return ASN_INPUT_E;
|
||||
}
|
||||
|
||||
e1 = base64Decode[e1 - 0x2B];
|
||||
e2 = base64Decode[e2 - 0x2B];
|
||||
e3 = (e3 == PAD) ? 0 : base64Decode[e3 - 0x2B];
|
||||
e4 = (e4 == PAD) ? 0 : base64Decode[e4 - 0x2B];
|
||||
|
||||
b1 = (e1 << 2) | (e2 >> 4);
|
||||
b2 = ((e2 & 0xF) << 4) | (e3 >> 2);
|
||||
b3 = ((e3 & 0x3) << 6) | e4;
|
||||
|
||||
out[i++] = b1;
|
||||
if (!pad3)
|
||||
out[i++] = b2;
|
||||
if (!pad4)
|
||||
out[i++] = b3;
|
||||
else
|
||||
break;
|
||||
|
||||
inLen -= 4;
|
||||
if (in[j] == ' ' || in[j] == '\r' || in[j] == '\n') {
|
||||
byte endLine = in[j++];
|
||||
inLen--;
|
||||
while (endLine == ' ') { /* allow trailing whitespace */
|
||||
endLine = in[j++];
|
||||
inLen--;
|
||||
}
|
||||
if (endLine == '\r') {
|
||||
endLine = in[j++];
|
||||
inLen--;
|
||||
}
|
||||
if (endLine != '\n') {
|
||||
CYASSL_MSG("Bad end of line in Base64 Decode");
|
||||
return ASN_INPUT_E;
|
||||
}
|
||||
}
|
||||
}
|
||||
*outLen = i;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
#if defined(OPENSSL_EXTRA) || defined (SESSION_CERTS) || defined(CYASSL_KEY_GEN) || defined(CYASSL_CERT_GEN) || defined(HAVE_WEBSERVER)
|
||||
|
||||
static
|
||||
const byte base64Encode[] = { 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J',
|
||||
'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T',
|
||||
'U', 'V', 'W', 'X', 'Y', 'Z',
|
||||
'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j',
|
||||
'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't',
|
||||
'u', 'v', 'w', 'x', 'y', 'z',
|
||||
'0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
|
||||
'+', '/'
|
||||
};
|
||||
|
||||
|
||||
/* porting assistance from yaSSL by Raphael HUCK */
|
||||
int Base64_Encode(const byte* in, word32 inLen, byte* out, word32* outLen)
|
||||
{
|
||||
word32 i = 0,
|
||||
j = 0,
|
||||
n = 0; /* new line counter */
|
||||
|
||||
word32 outSz = (inLen + 3 - 1) / 3 * 4;
|
||||
outSz += (outSz + PEM_LINE_SZ - 1) / PEM_LINE_SZ; /* new lines */
|
||||
|
||||
if (outSz > *outLen) return BAD_FUNC_ARG;
|
||||
|
||||
while (inLen > 2) {
|
||||
byte b1 = in[j++];
|
||||
byte b2 = in[j++];
|
||||
byte b3 = in[j++];
|
||||
|
||||
/* encoded idx */
|
||||
byte e1 = b1 >> 2;
|
||||
byte e2 = ((b1 & 0x3) << 4) | (b2 >> 4);
|
||||
byte e3 = ((b2 & 0xF) << 2) | (b3 >> 6);
|
||||
byte e4 = b3 & 0x3F;
|
||||
|
||||
/* store */
|
||||
out[i++] = base64Encode[e1];
|
||||
out[i++] = base64Encode[e2];
|
||||
out[i++] = base64Encode[e3];
|
||||
out[i++] = base64Encode[e4];
|
||||
|
||||
inLen -= 3;
|
||||
|
||||
if ((++n % (PEM_LINE_SZ / 4)) == 0 && inLen)
|
||||
out[i++] = '\n';
|
||||
}
|
||||
|
||||
/* last integral */
|
||||
if (inLen) {
|
||||
int twoBytes = (inLen == 2);
|
||||
|
||||
byte b1 = in[j++];
|
||||
byte b2 = (twoBytes) ? in[j++] : 0;
|
||||
|
||||
byte e1 = b1 >> 2;
|
||||
byte e2 = ((b1 & 0x3) << 4) | (b2 >> 4);
|
||||
byte e3 = (b2 & 0xF) << 2;
|
||||
|
||||
out[i++] = base64Encode[e1];
|
||||
out[i++] = base64Encode[e2];
|
||||
out[i++] = (twoBytes) ? base64Encode[e3] : PAD;
|
||||
out[i++] = PAD;
|
||||
}
|
||||
|
||||
out[i++] = '\n';
|
||||
if (i != outSz)
|
||||
return ASN_INPUT_E;
|
||||
*outLen = outSz;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static
|
||||
const byte hexDecode[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,
|
||||
BAD, BAD, BAD, BAD, BAD, BAD, BAD,
|
||||
10, 11, 12, 13, 14, 15
|
||||
}; /* A starts at 0x41 not 0x3A */
|
||||
|
||||
int Base16_Decode(const byte* in, word32 inLen, byte* out, word32* outLen)
|
||||
{
|
||||
word32 inIdx = 0;
|
||||
word32 outIdx = 0;
|
||||
|
||||
if (inLen == 1 && *outLen && in) {
|
||||
byte b = in[inIdx++] - 0x30; /* 0 starts at 0x30 */
|
||||
|
||||
/* sanity check */
|
||||
if (b >= sizeof(hexDecode)/sizeof(hexDecode[0]))
|
||||
return ASN_INPUT_E;
|
||||
|
||||
b = hexDecode[b];
|
||||
|
||||
if (b == BAD)
|
||||
return ASN_INPUT_E;
|
||||
|
||||
out[outIdx++] = b;
|
||||
|
||||
*outLen = outIdx;
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (inLen % 2)
|
||||
return BAD_FUNC_ARG;
|
||||
|
||||
if (*outLen < (inLen / 2))
|
||||
return BAD_FUNC_ARG;
|
||||
|
||||
while (inLen) {
|
||||
byte b = in[inIdx++] - 0x30; /* 0 starts at 0x30 */
|
||||
byte b2 = in[inIdx++] - 0x30;
|
||||
|
||||
/* sanity checks */
|
||||
if (b >= sizeof(hexDecode)/sizeof(hexDecode[0]))
|
||||
return ASN_INPUT_E;
|
||||
if (b2 >= sizeof(hexDecode)/sizeof(hexDecode[0]))
|
||||
return ASN_INPUT_E;
|
||||
|
||||
b = hexDecode[b];
|
||||
b2 = hexDecode[b2];
|
||||
|
||||
if (b == BAD || b2 == BAD)
|
||||
return ASN_INPUT_E;
|
||||
|
||||
out[outIdx++] = (b << 4) | b2;
|
||||
inLen -= 2;
|
||||
}
|
||||
|
||||
*outLen = outIdx;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
#endif /* OPENSSL_EXTRA */
|
||||
@@ -1,528 +0,0 @@
|
||||
/* des3.c
|
||||
*
|
||||
* Copyright (C) 2006-2012 Sawtooth Consulting Ltd.
|
||||
*
|
||||
* This file is part of CyaSSL.
|
||||
*
|
||||
* CyaSSL is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* CyaSSL is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
#ifndef NO_DES3
|
||||
|
||||
#include <cyassl/ctaocrypt/des3.h>
|
||||
|
||||
#ifdef NO_INLINE
|
||||
#include <cyassl/ctaocrypt/misc.h>
|
||||
#else
|
||||
#include <ctaocrypt/src/misc.c>
|
||||
#endif
|
||||
|
||||
|
||||
/* permuted choice table (key) */
|
||||
static const byte pc1[] = {
|
||||
57, 49, 41, 33, 25, 17, 9,
|
||||
1, 58, 50, 42, 34, 26, 18,
|
||||
10, 2, 59, 51, 43, 35, 27,
|
||||
19, 11, 3, 60, 52, 44, 36,
|
||||
|
||||
63, 55, 47, 39, 31, 23, 15,
|
||||
7, 62, 54, 46, 38, 30, 22,
|
||||
14, 6, 61, 53, 45, 37, 29,
|
||||
21, 13, 5, 28, 20, 12, 4
|
||||
};
|
||||
|
||||
/* number left rotations of pc1 */
|
||||
static const byte totrot[] = {
|
||||
1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28
|
||||
};
|
||||
|
||||
/* permuted choice key (table) */
|
||||
static const byte pc2[] = {
|
||||
14, 17, 11, 24, 1, 5,
|
||||
3, 28, 15, 6, 21, 10,
|
||||
23, 19, 12, 4, 26, 8,
|
||||
16, 7, 27, 20, 13, 2,
|
||||
41, 52, 31, 37, 47, 55,
|
||||
30, 40, 51, 45, 33, 48,
|
||||
44, 49, 39, 56, 34, 53,
|
||||
46, 42, 50, 36, 29, 32
|
||||
};
|
||||
|
||||
/* End of DES-defined tables */
|
||||
|
||||
/* bit 0 is left-most in byte */
|
||||
static const int bytebit[] = {
|
||||
0200,0100,040,020,010,04,02,01
|
||||
};
|
||||
|
||||
const word32 Spbox[8][64] = {
|
||||
{
|
||||
0x01010400,0x00000000,0x00010000,0x01010404,
|
||||
0x01010004,0x00010404,0x00000004,0x00010000,
|
||||
0x00000400,0x01010400,0x01010404,0x00000400,
|
||||
0x01000404,0x01010004,0x01000000,0x00000004,
|
||||
0x00000404,0x01000400,0x01000400,0x00010400,
|
||||
0x00010400,0x01010000,0x01010000,0x01000404,
|
||||
0x00010004,0x01000004,0x01000004,0x00010004,
|
||||
0x00000000,0x00000404,0x00010404,0x01000000,
|
||||
0x00010000,0x01010404,0x00000004,0x01010000,
|
||||
0x01010400,0x01000000,0x01000000,0x00000400,
|
||||
0x01010004,0x00010000,0x00010400,0x01000004,
|
||||
0x00000400,0x00000004,0x01000404,0x00010404,
|
||||
0x01010404,0x00010004,0x01010000,0x01000404,
|
||||
0x01000004,0x00000404,0x00010404,0x01010400,
|
||||
0x00000404,0x01000400,0x01000400,0x00000000,
|
||||
0x00010004,0x00010400,0x00000000,0x01010004},
|
||||
{
|
||||
0x80108020,0x80008000,0x00008000,0x00108020,
|
||||
0x00100000,0x00000020,0x80100020,0x80008020,
|
||||
0x80000020,0x80108020,0x80108000,0x80000000,
|
||||
0x80008000,0x00100000,0x00000020,0x80100020,
|
||||
0x00108000,0x00100020,0x80008020,0x00000000,
|
||||
0x80000000,0x00008000,0x00108020,0x80100000,
|
||||
0x00100020,0x80000020,0x00000000,0x00108000,
|
||||
0x00008020,0x80108000,0x80100000,0x00008020,
|
||||
0x00000000,0x00108020,0x80100020,0x00100000,
|
||||
0x80008020,0x80100000,0x80108000,0x00008000,
|
||||
0x80100000,0x80008000,0x00000020,0x80108020,
|
||||
0x00108020,0x00000020,0x00008000,0x80000000,
|
||||
0x00008020,0x80108000,0x00100000,0x80000020,
|
||||
0x00100020,0x80008020,0x80000020,0x00100020,
|
||||
0x00108000,0x00000000,0x80008000,0x00008020,
|
||||
0x80000000,0x80100020,0x80108020,0x00108000},
|
||||
{
|
||||
0x00000208,0x08020200,0x00000000,0x08020008,
|
||||
0x08000200,0x00000000,0x00020208,0x08000200,
|
||||
0x00020008,0x08000008,0x08000008,0x00020000,
|
||||
0x08020208,0x00020008,0x08020000,0x00000208,
|
||||
0x08000000,0x00000008,0x08020200,0x00000200,
|
||||
0x00020200,0x08020000,0x08020008,0x00020208,
|
||||
0x08000208,0x00020200,0x00020000,0x08000208,
|
||||
0x00000008,0x08020208,0x00000200,0x08000000,
|
||||
0x08020200,0x08000000,0x00020008,0x00000208,
|
||||
0x00020000,0x08020200,0x08000200,0x00000000,
|
||||
0x00000200,0x00020008,0x08020208,0x08000200,
|
||||
0x08000008,0x00000200,0x00000000,0x08020008,
|
||||
0x08000208,0x00020000,0x08000000,0x08020208,
|
||||
0x00000008,0x00020208,0x00020200,0x08000008,
|
||||
0x08020000,0x08000208,0x00000208,0x08020000,
|
||||
0x00020208,0x00000008,0x08020008,0x00020200},
|
||||
{
|
||||
0x00802001,0x00002081,0x00002081,0x00000080,
|
||||
0x00802080,0x00800081,0x00800001,0x00002001,
|
||||
0x00000000,0x00802000,0x00802000,0x00802081,
|
||||
0x00000081,0x00000000,0x00800080,0x00800001,
|
||||
0x00000001,0x00002000,0x00800000,0x00802001,
|
||||
0x00000080,0x00800000,0x00002001,0x00002080,
|
||||
0x00800081,0x00000001,0x00002080,0x00800080,
|
||||
0x00002000,0x00802080,0x00802081,0x00000081,
|
||||
0x00800080,0x00800001,0x00802000,0x00802081,
|
||||
0x00000081,0x00000000,0x00000000,0x00802000,
|
||||
0x00002080,0x00800080,0x00800081,0x00000001,
|
||||
0x00802001,0x00002081,0x00002081,0x00000080,
|
||||
0x00802081,0x00000081,0x00000001,0x00002000,
|
||||
0x00800001,0x00002001,0x00802080,0x00800081,
|
||||
0x00002001,0x00002080,0x00800000,0x00802001,
|
||||
0x00000080,0x00800000,0x00002000,0x00802080},
|
||||
{
|
||||
0x00000100,0x02080100,0x02080000,0x42000100,
|
||||
0x00080000,0x00000100,0x40000000,0x02080000,
|
||||
0x40080100,0x00080000,0x02000100,0x40080100,
|
||||
0x42000100,0x42080000,0x00080100,0x40000000,
|
||||
0x02000000,0x40080000,0x40080000,0x00000000,
|
||||
0x40000100,0x42080100,0x42080100,0x02000100,
|
||||
0x42080000,0x40000100,0x00000000,0x42000000,
|
||||
0x02080100,0x02000000,0x42000000,0x00080100,
|
||||
0x00080000,0x42000100,0x00000100,0x02000000,
|
||||
0x40000000,0x02080000,0x42000100,0x40080100,
|
||||
0x02000100,0x40000000,0x42080000,0x02080100,
|
||||
0x40080100,0x00000100,0x02000000,0x42080000,
|
||||
0x42080100,0x00080100,0x42000000,0x42080100,
|
||||
0x02080000,0x00000000,0x40080000,0x42000000,
|
||||
0x00080100,0x02000100,0x40000100,0x00080000,
|
||||
0x00000000,0x40080000,0x02080100,0x40000100},
|
||||
{
|
||||
0x20000010,0x20400000,0x00004000,0x20404010,
|
||||
0x20400000,0x00000010,0x20404010,0x00400000,
|
||||
0x20004000,0x00404010,0x00400000,0x20000010,
|
||||
0x00400010,0x20004000,0x20000000,0x00004010,
|
||||
0x00000000,0x00400010,0x20004010,0x00004000,
|
||||
0x00404000,0x20004010,0x00000010,0x20400010,
|
||||
0x20400010,0x00000000,0x00404010,0x20404000,
|
||||
0x00004010,0x00404000,0x20404000,0x20000000,
|
||||
0x20004000,0x00000010,0x20400010,0x00404000,
|
||||
0x20404010,0x00400000,0x00004010,0x20000010,
|
||||
0x00400000,0x20004000,0x20000000,0x00004010,
|
||||
0x20000010,0x20404010,0x00404000,0x20400000,
|
||||
0x00404010,0x20404000,0x00000000,0x20400010,
|
||||
0x00000010,0x00004000,0x20400000,0x00404010,
|
||||
0x00004000,0x00400010,0x20004010,0x00000000,
|
||||
0x20404000,0x20000000,0x00400010,0x20004010},
|
||||
{
|
||||
0x00200000,0x04200002,0x04000802,0x00000000,
|
||||
0x00000800,0x04000802,0x00200802,0x04200800,
|
||||
0x04200802,0x00200000,0x00000000,0x04000002,
|
||||
0x00000002,0x04000000,0x04200002,0x00000802,
|
||||
0x04000800,0x00200802,0x00200002,0x04000800,
|
||||
0x04000002,0x04200000,0x04200800,0x00200002,
|
||||
0x04200000,0x00000800,0x00000802,0x04200802,
|
||||
0x00200800,0x00000002,0x04000000,0x00200800,
|
||||
0x04000000,0x00200800,0x00200000,0x04000802,
|
||||
0x04000802,0x04200002,0x04200002,0x00000002,
|
||||
0x00200002,0x04000000,0x04000800,0x00200000,
|
||||
0x04200800,0x00000802,0x00200802,0x04200800,
|
||||
0x00000802,0x04000002,0x04200802,0x04200000,
|
||||
0x00200800,0x00000000,0x00000002,0x04200802,
|
||||
0x00000000,0x00200802,0x04200000,0x00000800,
|
||||
0x04000002,0x04000800,0x00000800,0x00200002},
|
||||
{
|
||||
0x10001040,0x00001000,0x00040000,0x10041040,
|
||||
0x10000000,0x10001040,0x00000040,0x10000000,
|
||||
0x00040040,0x10040000,0x10041040,0x00041000,
|
||||
0x10041000,0x00041040,0x00001000,0x00000040,
|
||||
0x10040000,0x10000040,0x10001000,0x00001040,
|
||||
0x00041000,0x00040040,0x10040040,0x10041000,
|
||||
0x00001040,0x00000000,0x00000000,0x10040040,
|
||||
0x10000040,0x10001000,0x00041040,0x00040000,
|
||||
0x00041040,0x00040000,0x10041000,0x00001000,
|
||||
0x00000040,0x10040040,0x00001000,0x00041040,
|
||||
0x10001000,0x00000040,0x10000040,0x10040000,
|
||||
0x10040040,0x10000000,0x00040000,0x10001040,
|
||||
0x00000000,0x10041040,0x00040040,0x10000040,
|
||||
0x10040000,0x10001000,0x10001040,0x00000000,
|
||||
0x10041040,0x00041000,0x00041000,0x00001040,
|
||||
0x00001040,0x00040040,0x10000000,0x10041000}
|
||||
};
|
||||
|
||||
|
||||
static INLINE void IPERM(word32* left, word32* right)
|
||||
{
|
||||
word32 work;
|
||||
|
||||
*right = rotlFixed(*right, 4U);
|
||||
work = (*left ^ *right) & 0xf0f0f0f0;
|
||||
*left ^= work;
|
||||
|
||||
*right = rotrFixed(*right^work, 20U);
|
||||
work = (*left ^ *right) & 0xffff0000;
|
||||
*left ^= work;
|
||||
|
||||
*right = rotrFixed(*right^work, 18U);
|
||||
work = (*left ^ *right) & 0x33333333;
|
||||
*left ^= work;
|
||||
|
||||
*right = rotrFixed(*right^work, 6U);
|
||||
work = (*left ^ *right) & 0x00ff00ff;
|
||||
*left ^= work;
|
||||
|
||||
*right = rotlFixed(*right^work, 9U);
|
||||
work = (*left ^ *right) & 0xaaaaaaaa;
|
||||
*left = rotlFixed(*left^work, 1U);
|
||||
*right ^= work;
|
||||
}
|
||||
|
||||
|
||||
static INLINE void FPERM(word32* left, word32* right)
|
||||
{
|
||||
word32 work;
|
||||
|
||||
*right = rotrFixed(*right, 1U);
|
||||
work = (*left ^ *right) & 0xaaaaaaaa;
|
||||
*right ^= work;
|
||||
|
||||
*left = rotrFixed(*left^work, 9U);
|
||||
work = (*left ^ *right) & 0x00ff00ff;
|
||||
*right ^= work;
|
||||
|
||||
*left = rotlFixed(*left^work, 6U);
|
||||
work = (*left ^ *right) & 0x33333333;
|
||||
*right ^= work;
|
||||
|
||||
*left = rotlFixed(*left^work, 18U);
|
||||
work = (*left ^ *right) & 0xffff0000;
|
||||
*right ^= work;
|
||||
|
||||
*left = rotlFixed(*left^work, 20U);
|
||||
work = (*left ^ *right) & 0xf0f0f0f0;
|
||||
*right ^= work;
|
||||
|
||||
*left = rotrFixed(*left^work, 4U);
|
||||
}
|
||||
|
||||
|
||||
static void DesSetKey(const byte* key, int dir, word32* out)
|
||||
{
|
||||
byte buffer[56+56+8];
|
||||
byte *const pc1m = buffer; /* place to modify pc1 into */
|
||||
byte *const pcr = pc1m + 56; /* place to rotate pc1 into */
|
||||
byte *const ks = pcr + 56;
|
||||
register int i,j,l;
|
||||
int m;
|
||||
|
||||
for (j = 0; j < 56; j++) { /* convert pc1 to bits of key */
|
||||
l = pc1[j] - 1; /* integer bit location */
|
||||
m = l & 07; /* find bit */
|
||||
pc1m[j] = (key[l >> 3] & /* find which key byte l is in */
|
||||
bytebit[m]) /* and which bit of that byte */
|
||||
? 1 : 0; /* and store 1-bit result */
|
||||
}
|
||||
for (i = 0; i < 16; i++) { /* key chunk for each iteration */
|
||||
XMEMSET(ks, 0, 8); /* Clear key schedule */
|
||||
for (j = 0; j < 56; j++) /* rotate pc1 the right amount */
|
||||
pcr[j] = pc1m[(l = j + totrot[i]) < (j < 28 ? 28 : 56) ? l: l-28];
|
||||
/* rotate left and right halves independently */
|
||||
for (j = 0; j < 48; j++){ /* select bits individually */
|
||||
/* check bit that goes to ks[j] */
|
||||
if (pcr[pc2[j] - 1]){
|
||||
/* mask it in if it's there */
|
||||
l= j % 6;
|
||||
ks[j/6] |= bytebit[l] >> 2;
|
||||
}
|
||||
}
|
||||
/* Now convert to odd/even interleaved form for use in F */
|
||||
out[2*i] = ((word32)ks[0] << 24)
|
||||
| ((word32)ks[2] << 16)
|
||||
| ((word32)ks[4] << 8)
|
||||
| ((word32)ks[6]);
|
||||
out[2*i + 1] = ((word32)ks[1] << 24)
|
||||
| ((word32)ks[3] << 16)
|
||||
| ((word32)ks[5] << 8)
|
||||
| ((word32)ks[7]);
|
||||
}
|
||||
|
||||
/* reverse key schedule order */
|
||||
if (dir == DES_DECRYPTION)
|
||||
for (i = 0; i < 16; i += 2) {
|
||||
word32 swap = out[i];
|
||||
out[i] = out[DES_KS_SIZE - 2 - i];
|
||||
out[DES_KS_SIZE - 2 - i] = swap;
|
||||
|
||||
swap = out[i + 1];
|
||||
out[i + 1] = out[DES_KS_SIZE - 1 - i];
|
||||
out[DES_KS_SIZE - 1 - i] = swap;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
static INLINE int Reverse(int dir)
|
||||
{
|
||||
return !dir;
|
||||
}
|
||||
|
||||
|
||||
void Des_SetIV(Des* des, const byte* iv)
|
||||
{
|
||||
if (des && iv)
|
||||
XMEMCPY(des->reg, iv, DES_BLOCK_SIZE);
|
||||
}
|
||||
|
||||
|
||||
void Des3_SetIV(Des3* des, const byte* iv)
|
||||
{
|
||||
if (des && iv)
|
||||
XMEMCPY(des->reg, iv, DES_BLOCK_SIZE);
|
||||
}
|
||||
|
||||
|
||||
void Des_SetKey(Des* des, const byte* key, const byte* iv, int dir)
|
||||
{
|
||||
DesSetKey(key, dir, des->key);
|
||||
|
||||
Des_SetIV(des, iv);
|
||||
}
|
||||
|
||||
|
||||
void Des3_SetKey(Des3* des, const byte* key, const byte* iv, int dir)
|
||||
{
|
||||
DesSetKey(key + (dir == DES_ENCRYPTION ? 0 : 16), dir, des->key[0]);
|
||||
DesSetKey(key + 8, Reverse(dir), des->key[1]);
|
||||
DesSetKey(key + (dir == DES_DECRYPTION ? 0 : 16), dir, des->key[2]);
|
||||
|
||||
Des3_SetIV(des, iv);
|
||||
}
|
||||
|
||||
|
||||
static void DesRawProcessBlock(word32* lIn, word32* rIn, const word32* kptr)
|
||||
{
|
||||
word32 l = *lIn, r = *rIn, i;
|
||||
|
||||
for (i=0; i<8; i++)
|
||||
{
|
||||
word32 work = rotrFixed(r, 4U) ^ kptr[4*i+0];
|
||||
l ^= Spbox[6][(work) & 0x3f]
|
||||
^ Spbox[4][(work >> 8) & 0x3f]
|
||||
^ Spbox[2][(work >> 16) & 0x3f]
|
||||
^ Spbox[0][(work >> 24) & 0x3f];
|
||||
work = r ^ kptr[4*i+1];
|
||||
l ^= Spbox[7][(work) & 0x3f]
|
||||
^ Spbox[5][(work >> 8) & 0x3f]
|
||||
^ Spbox[3][(work >> 16) & 0x3f]
|
||||
^ Spbox[1][(work >> 24) & 0x3f];
|
||||
|
||||
work = rotrFixed(l, 4U) ^ kptr[4*i+2];
|
||||
r ^= Spbox[6][(work) & 0x3f]
|
||||
^ Spbox[4][(work >> 8) & 0x3f]
|
||||
^ Spbox[2][(work >> 16) & 0x3f]
|
||||
^ Spbox[0][(work >> 24) & 0x3f];
|
||||
work = l ^ kptr[4*i+3];
|
||||
r ^= Spbox[7][(work) & 0x3f]
|
||||
^ Spbox[5][(work >> 8) & 0x3f]
|
||||
^ Spbox[3][(work >> 16) & 0x3f]
|
||||
^ Spbox[1][(work >> 24) & 0x3f];
|
||||
}
|
||||
|
||||
*lIn = l; *rIn = r;
|
||||
}
|
||||
|
||||
|
||||
static void DesProcessBlock(Des* des, const byte* in, byte* out)
|
||||
{
|
||||
word32 l, r;
|
||||
|
||||
XMEMCPY(&l, in, sizeof(l));
|
||||
XMEMCPY(&r, in + sizeof(l), sizeof(r));
|
||||
#ifdef LITTLE_ENDIAN_ORDER
|
||||
l = ByteReverseWord32(l);
|
||||
r = ByteReverseWord32(r);
|
||||
#endif
|
||||
IPERM(&l,&r);
|
||||
|
||||
DesRawProcessBlock(&l, &r, des->key);
|
||||
|
||||
FPERM(&l,&r);
|
||||
#ifdef LITTLE_ENDIAN_ORDER
|
||||
l = ByteReverseWord32(l);
|
||||
r = ByteReverseWord32(r);
|
||||
#endif
|
||||
XMEMCPY(out, &r, sizeof(r));
|
||||
XMEMCPY(out + sizeof(r), &l, sizeof(l));
|
||||
}
|
||||
|
||||
|
||||
static void Des3ProcessBlock(Des3* des, const byte* in, byte* out)
|
||||
{
|
||||
word32 l, r;
|
||||
|
||||
XMEMCPY(&l, in, sizeof(l));
|
||||
XMEMCPY(&r, in + sizeof(l), sizeof(r));
|
||||
#ifdef LITTLE_ENDIAN_ORDER
|
||||
l = ByteReverseWord32(l);
|
||||
r = ByteReverseWord32(r);
|
||||
#endif
|
||||
IPERM(&l,&r);
|
||||
|
||||
DesRawProcessBlock(&l, &r, des->key[0]);
|
||||
DesRawProcessBlock(&r, &l, des->key[1]);
|
||||
DesRawProcessBlock(&l, &r, des->key[2]);
|
||||
|
||||
FPERM(&l,&r);
|
||||
#ifdef LITTLE_ENDIAN_ORDER
|
||||
l = ByteReverseWord32(l);
|
||||
r = ByteReverseWord32(r);
|
||||
#endif
|
||||
XMEMCPY(out, &r, sizeof(r));
|
||||
XMEMCPY(out + sizeof(r), &l, sizeof(l));
|
||||
}
|
||||
|
||||
|
||||
void Des_CbcEncrypt(Des* des, byte* out, const byte* in, word32 sz)
|
||||
{
|
||||
word32 blocks = sz / DES_BLOCK_SIZE;
|
||||
|
||||
while (blocks--) {
|
||||
xorbuf((byte*)des->reg, in, DES_BLOCK_SIZE);
|
||||
DesProcessBlock(des, (byte*)des->reg, (byte*)des->reg);
|
||||
XMEMCPY(out, des->reg, DES_BLOCK_SIZE);
|
||||
|
||||
out += DES_BLOCK_SIZE;
|
||||
in += DES_BLOCK_SIZE;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void Des_CbcDecrypt(Des* des, byte* out, const byte* in, word32 sz)
|
||||
{
|
||||
word32 blocks = sz / DES_BLOCK_SIZE;
|
||||
byte hold[16];
|
||||
|
||||
while (blocks--) {
|
||||
XMEMCPY(des->tmp, in, DES_BLOCK_SIZE);
|
||||
DesProcessBlock(des, (byte*)des->tmp, out);
|
||||
xorbuf(out, (byte*)des->reg, DES_BLOCK_SIZE);
|
||||
|
||||
XMEMCPY(hold, des->reg, DES_BLOCK_SIZE);
|
||||
XMEMCPY(des->reg, des->tmp, DES_BLOCK_SIZE);
|
||||
XMEMCPY(des->tmp, hold, DES_BLOCK_SIZE);
|
||||
|
||||
out += DES_BLOCK_SIZE;
|
||||
in += DES_BLOCK_SIZE;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void Des3_CbcEncrypt(Des3* des, byte* out, const byte* in, word32 sz)
|
||||
{
|
||||
word32 blocks = sz / DES_BLOCK_SIZE;
|
||||
|
||||
while (blocks--) {
|
||||
xorbuf((byte*)des->reg, in, DES_BLOCK_SIZE);
|
||||
Des3ProcessBlock(des, (byte*)des->reg, (byte*)des->reg);
|
||||
XMEMCPY(out, des->reg, DES_BLOCK_SIZE);
|
||||
|
||||
out += DES_BLOCK_SIZE;
|
||||
in += DES_BLOCK_SIZE;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void Des3_CbcDecrypt(Des3* des, byte* out, const byte* in, word32 sz)
|
||||
{
|
||||
word32 blocks = sz / DES_BLOCK_SIZE;
|
||||
|
||||
while (blocks--) {
|
||||
XMEMCPY(des->tmp, in, DES_BLOCK_SIZE);
|
||||
Des3ProcessBlock(des, (byte*)des->tmp, out);
|
||||
xorbuf(out, (byte*)des->reg, DES_BLOCK_SIZE);
|
||||
XMEMCPY(des->reg, des->tmp, DES_BLOCK_SIZE);
|
||||
|
||||
out += DES_BLOCK_SIZE;
|
||||
in += DES_BLOCK_SIZE;
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef CYASSL_DES_ECB
|
||||
|
||||
/* One block, compatibility only */
|
||||
void Des_EcbEncrypt(Des* des, byte* out, const byte* in, word32 sz)
|
||||
{
|
||||
word32 blocks = sz / DES_BLOCK_SIZE;
|
||||
|
||||
while (blocks--) {
|
||||
DesProcessBlock(des, in, out);
|
||||
|
||||
out += DES_BLOCK_SIZE;
|
||||
in += DES_BLOCK_SIZE;
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* CYASSL_DES_ECB */
|
||||
|
||||
|
||||
#endif /* NO_DES3 */
|
||||
@@ -1,169 +0,0 @@
|
||||
/* dh.c
|
||||
*
|
||||
* Copyright (C) 2006-2012 Sawtooth Consulting Ltd.
|
||||
*
|
||||
* This file is part of CyaSSL.
|
||||
*
|
||||
* CyaSSL is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* CyaSSL is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
#ifndef NO_DH
|
||||
|
||||
#include <cyassl/ctaocrypt/dh.h>
|
||||
#include <cyassl/ctaocrypt/error.h>
|
||||
|
||||
#ifndef USER_MATH_LIB
|
||||
#include <math.h>
|
||||
#define XPOW(x,y) pow((x),(y))
|
||||
#define XLOG(x) log((x))
|
||||
#else
|
||||
/* user's own math lib */
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef min
|
||||
|
||||
static INLINE word32 min(word32 a, word32 b)
|
||||
{
|
||||
return a > b ? b : a;
|
||||
}
|
||||
|
||||
#endif /* min */
|
||||
|
||||
|
||||
void InitDhKey(DhKey* key)
|
||||
{
|
||||
(void)key;
|
||||
/* TomsFastMath doesn't use memory allocation */
|
||||
#ifndef USE_FAST_MATH
|
||||
key->p.dp = 0;
|
||||
key->g.dp = 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
void FreeDhKey(DhKey* key)
|
||||
{
|
||||
(void)key;
|
||||
/* TomsFastMath doesn't use memory allocation */
|
||||
#ifndef USE_FAST_MATH
|
||||
mp_clear(&key->p);
|
||||
mp_clear(&key->g);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
static word32 DiscreteLogWorkFactor(word32 n)
|
||||
{
|
||||
/* assuming discrete log takes about the same time as factoring */
|
||||
if (n<5)
|
||||
return 0;
|
||||
else
|
||||
return (word32)(2.4 * XPOW((double)n, 1.0/3.0) *
|
||||
XPOW(XLOG((double)n), 2.0/3.0) - 5);
|
||||
}
|
||||
|
||||
|
||||
static void GeneratePrivate(DhKey* key, RNG* rng, byte* priv, word32* privSz)
|
||||
{
|
||||
word32 sz = mp_unsigned_bin_size(&key->p);
|
||||
sz = min(sz, 2 * DiscreteLogWorkFactor(sz * BIT_SIZE) / BIT_SIZE + 1);
|
||||
|
||||
RNG_GenerateBlock(rng, priv, sz);
|
||||
priv[0] |= 0x0C;
|
||||
|
||||
*privSz = sz;
|
||||
}
|
||||
|
||||
|
||||
static int GeneratePublic(DhKey* key, const byte* priv, word32 privSz,
|
||||
byte* pub, word32* pubSz)
|
||||
{
|
||||
int ret = 0;
|
||||
|
||||
mp_int x;
|
||||
mp_int y;
|
||||
|
||||
if (mp_init_multi(&x, &y, 0, 0, 0, 0) != MP_OKAY)
|
||||
return MP_INIT_E;
|
||||
|
||||
if (mp_read_unsigned_bin(&x, priv, privSz) != MP_OKAY)
|
||||
ret = MP_READ_E;
|
||||
|
||||
if (ret == 0 && mp_exptmod(&key->g, &x, &key->p, &y) != MP_OKAY)
|
||||
ret = MP_EXPTMOD_E;
|
||||
|
||||
if (ret == 0 && mp_to_unsigned_bin(&y, pub) != MP_OKAY)
|
||||
ret = MP_TO_E;
|
||||
|
||||
if (ret == 0)
|
||||
*pubSz = mp_unsigned_bin_size(&y);
|
||||
|
||||
mp_clear(&y);
|
||||
mp_clear(&x);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
int DhGenerateKeyPair(DhKey* key, RNG* rng, byte* priv, word32* privSz,
|
||||
byte* pub, word32* pubSz)
|
||||
{
|
||||
GeneratePrivate(key, rng, priv, privSz);
|
||||
return GeneratePublic(key, priv, *privSz, pub, pubSz);
|
||||
|
||||
}
|
||||
|
||||
int DhAgree(DhKey* key, byte* agree, word32* agreeSz, const byte* priv,
|
||||
word32 privSz, const byte* otherPub, word32 pubSz)
|
||||
{
|
||||
int ret = 0;
|
||||
|
||||
mp_int x;
|
||||
mp_int y;
|
||||
mp_int z;
|
||||
|
||||
if (mp_init_multi(&x, &y, &z, 0, 0, 0) != MP_OKAY)
|
||||
return MP_INIT_E;
|
||||
|
||||
if (mp_read_unsigned_bin(&x, priv, privSz) != MP_OKAY)
|
||||
ret = MP_READ_E;
|
||||
|
||||
if (ret == 0 && mp_read_unsigned_bin(&y, otherPub, pubSz) != MP_OKAY)
|
||||
ret = MP_READ_E;
|
||||
|
||||
if (ret == 0 && mp_exptmod(&y, &x, &key->p, &z) != MP_OKAY)
|
||||
ret = MP_EXPTMOD_E;
|
||||
|
||||
if (ret == 0 && mp_to_unsigned_bin(&z, agree) != MP_OKAY)
|
||||
ret = MP_TO_E;
|
||||
|
||||
if (ret == 0)
|
||||
*agreeSz = mp_unsigned_bin_size(&z);
|
||||
|
||||
mp_clear(&z);
|
||||
mp_clear(&y);
|
||||
mp_clear(&x);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
#endif /* NO_DH */
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
/* dummy ecc.c for dist */
|
||||
@@ -1,210 +0,0 @@
|
||||
/* hmac.c
|
||||
*
|
||||
* Copyright (C) 2006-2012 Sawtooth Consulting Ltd.
|
||||
*
|
||||
* This file is part of CyaSSL.
|
||||
*
|
||||
* CyaSSL is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* CyaSSL is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
#ifndef NO_HMAC
|
||||
|
||||
#include <cyassl/ctaocrypt/hmac.h>
|
||||
#include <cyassl/ctaocrypt/error.h>
|
||||
|
||||
|
||||
static int InitHmac(Hmac* hmac, int type)
|
||||
{
|
||||
hmac->innerHashKeyed = 0;
|
||||
hmac->macType = (byte)type;
|
||||
|
||||
if (!(type == MD5 || type == SHA || type == SHA256 || type == SHA384))
|
||||
return BAD_FUNC_ARG;
|
||||
|
||||
if (type == MD5)
|
||||
InitMd5(&hmac->hash.md5);
|
||||
else if (type == SHA)
|
||||
InitSha(&hmac->hash.sha);
|
||||
#ifndef NO_SHA256
|
||||
else if (type == SHA256)
|
||||
InitSha256(&hmac->hash.sha256);
|
||||
#endif
|
||||
#ifdef CYASSL_SHA384
|
||||
else if (type == SHA384)
|
||||
InitSha384(&hmac->hash.sha384);
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
void HmacSetKey(Hmac* hmac, int type, const byte* key, word32 length)
|
||||
{
|
||||
byte* ip = (byte*) hmac->ipad;
|
||||
byte* op = (byte*) hmac->opad;
|
||||
word32 i, hmac_block_size = MD5_BLOCK_SIZE;
|
||||
|
||||
InitHmac(hmac, type);
|
||||
|
||||
if (hmac->macType == MD5) {
|
||||
if (length <= MD5_BLOCK_SIZE) {
|
||||
XMEMCPY(ip, key, length);
|
||||
}
|
||||
else {
|
||||
Md5Update(&hmac->hash.md5, key, length);
|
||||
Md5Final(&hmac->hash.md5, ip);
|
||||
length = MD5_DIGEST_SIZE;
|
||||
}
|
||||
}
|
||||
else if (hmac->macType == SHA) {
|
||||
hmac_block_size = SHA_BLOCK_SIZE;
|
||||
if (length <= SHA_BLOCK_SIZE) {
|
||||
XMEMCPY(ip, key, length);
|
||||
}
|
||||
else {
|
||||
ShaUpdate(&hmac->hash.sha, key, length);
|
||||
ShaFinal(&hmac->hash.sha, ip);
|
||||
length = SHA_DIGEST_SIZE;
|
||||
}
|
||||
}
|
||||
#ifndef NO_SHA256
|
||||
else if (hmac->macType == SHA256) {
|
||||
hmac_block_size = SHA256_BLOCK_SIZE;
|
||||
if (length <= SHA256_BLOCK_SIZE) {
|
||||
XMEMCPY(ip, key, length);
|
||||
}
|
||||
else {
|
||||
Sha256Update(&hmac->hash.sha256, key, length);
|
||||
Sha256Final(&hmac->hash.sha256, ip);
|
||||
length = SHA256_DIGEST_SIZE;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#ifdef CYASSL_SHA384
|
||||
else if (hmac->macType == SHA384) {
|
||||
hmac_block_size = SHA384_BLOCK_SIZE;
|
||||
if (length <= SHA384_BLOCK_SIZE) {
|
||||
XMEMCPY(ip, key, length);
|
||||
}
|
||||
else {
|
||||
Sha384Update(&hmac->hash.sha384, key, length);
|
||||
Sha384Final(&hmac->hash.sha384, ip);
|
||||
length = SHA384_DIGEST_SIZE;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
XMEMSET(ip + length, 0, hmac_block_size - length);
|
||||
|
||||
for(i = 0; i < hmac_block_size; i++) {
|
||||
op[i] = ip[i] ^ OPAD;
|
||||
ip[i] ^= IPAD;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void HmacKeyInnerHash(Hmac* hmac)
|
||||
{
|
||||
if (hmac->macType == MD5)
|
||||
Md5Update(&hmac->hash.md5, (byte*) hmac->ipad, MD5_BLOCK_SIZE);
|
||||
else if (hmac->macType == SHA)
|
||||
ShaUpdate(&hmac->hash.sha, (byte*) hmac->ipad, SHA_BLOCK_SIZE);
|
||||
#ifndef NO_SHA256
|
||||
else if (hmac->macType == SHA256)
|
||||
Sha256Update(&hmac->hash.sha256, (byte*) hmac->ipad, SHA256_BLOCK_SIZE);
|
||||
#endif
|
||||
#ifdef CYASSL_SHA384
|
||||
else if (hmac->macType == SHA384)
|
||||
Sha384Update(&hmac->hash.sha384, (byte*) hmac->ipad, SHA384_BLOCK_SIZE);
|
||||
#endif
|
||||
|
||||
hmac->innerHashKeyed = 1;
|
||||
}
|
||||
|
||||
|
||||
void HmacUpdate(Hmac* hmac, const byte* msg, word32 length)
|
||||
{
|
||||
if (!hmac->innerHashKeyed)
|
||||
HmacKeyInnerHash(hmac);
|
||||
|
||||
if (hmac->macType == MD5)
|
||||
Md5Update(&hmac->hash.md5, msg, length);
|
||||
else if (hmac->macType == SHA)
|
||||
ShaUpdate(&hmac->hash.sha, msg, length);
|
||||
#ifndef NO_SHA256
|
||||
else if (hmac->macType == SHA256)
|
||||
Sha256Update(&hmac->hash.sha256, msg, length);
|
||||
#endif
|
||||
#ifdef CYASSL_SHA384
|
||||
else if (hmac->macType == SHA384)
|
||||
Sha384Update(&hmac->hash.sha384, msg, length);
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
|
||||
void HmacFinal(Hmac* hmac, byte* hash)
|
||||
{
|
||||
if (!hmac->innerHashKeyed)
|
||||
HmacKeyInnerHash(hmac);
|
||||
|
||||
if (hmac->macType == MD5) {
|
||||
Md5Final(&hmac->hash.md5, (byte*) hmac->innerHash);
|
||||
|
||||
Md5Update(&hmac->hash.md5, (byte*) hmac->opad, MD5_BLOCK_SIZE);
|
||||
Md5Update(&hmac->hash.md5, (byte*) hmac->innerHash, MD5_DIGEST_SIZE);
|
||||
|
||||
Md5Final(&hmac->hash.md5, hash);
|
||||
}
|
||||
else if (hmac->macType == SHA) {
|
||||
ShaFinal(&hmac->hash.sha, (byte*) hmac->innerHash);
|
||||
|
||||
ShaUpdate(&hmac->hash.sha, (byte*) hmac->opad, SHA_BLOCK_SIZE);
|
||||
ShaUpdate(&hmac->hash.sha, (byte*) hmac->innerHash, SHA_DIGEST_SIZE);
|
||||
|
||||
ShaFinal(&hmac->hash.sha, hash);
|
||||
}
|
||||
#ifndef NO_SHA256
|
||||
else if (hmac->macType == SHA256) {
|
||||
Sha256Final(&hmac->hash.sha256, (byte*) hmac->innerHash);
|
||||
|
||||
Sha256Update(&hmac->hash.sha256, (byte*) hmac->opad, SHA256_BLOCK_SIZE);
|
||||
Sha256Update(&hmac->hash.sha256, (byte*) hmac->innerHash,
|
||||
SHA256_DIGEST_SIZE);
|
||||
|
||||
Sha256Final(&hmac->hash.sha256, hash);
|
||||
}
|
||||
#endif
|
||||
#ifdef CYASSL_SHA384
|
||||
else if (hmac->macType == SHA384) {
|
||||
Sha384Final(&hmac->hash.sha384, (byte*) hmac->innerHash);
|
||||
|
||||
Sha384Update(&hmac->hash.sha384, (byte*) hmac->opad, SHA384_BLOCK_SIZE);
|
||||
Sha384Update(&hmac->hash.sha384, (byte*) hmac->innerHash,
|
||||
SHA384_DIGEST_SIZE);
|
||||
|
||||
Sha384Final(&hmac->hash.sha384, hash);
|
||||
}
|
||||
#endif
|
||||
|
||||
hmac->innerHashKeyed = 0;
|
||||
}
|
||||
|
||||
|
||||
#endif /* NO_HMAC */
|
||||
|
||||
@@ -1,39 +0,0 @@
|
||||
# vim:ft=automake
|
||||
# All paths should be given relative to the root
|
||||
|
||||
EXTRA_DIST += ctaocrypt/src/misc.c
|
||||
EXTRA_DIST += ctaocrypt/src/asm.c
|
||||
|
||||
EXTRA_DIST += \
|
||||
ctaocrypt/src/ecc_fp.c \
|
||||
ctaocrypt/src/fp_mont_small.i \
|
||||
ctaocrypt/src/fp_mul_comba_12.i \
|
||||
ctaocrypt/src/fp_mul_comba_17.i \
|
||||
ctaocrypt/src/fp_mul_comba_20.i \
|
||||
ctaocrypt/src/fp_mul_comba_24.i \
|
||||
ctaocrypt/src/fp_mul_comba_28.i \
|
||||
ctaocrypt/src/fp_mul_comba_32.i \
|
||||
ctaocrypt/src/fp_mul_comba_3.i \
|
||||
ctaocrypt/src/fp_mul_comba_48.i \
|
||||
ctaocrypt/src/fp_mul_comba_4.i \
|
||||
ctaocrypt/src/fp_mul_comba_64.i \
|
||||
ctaocrypt/src/fp_mul_comba_6.i \
|
||||
ctaocrypt/src/fp_mul_comba_7.i \
|
||||
ctaocrypt/src/fp_mul_comba_8.i \
|
||||
ctaocrypt/src/fp_mul_comba_9.i \
|
||||
ctaocrypt/src/fp_mul_comba_small_set.i \
|
||||
ctaocrypt/src/fp_sqr_comba_12.i \
|
||||
ctaocrypt/src/fp_sqr_comba_17.i \
|
||||
ctaocrypt/src/fp_sqr_comba_20.i \
|
||||
ctaocrypt/src/fp_sqr_comba_24.i \
|
||||
ctaocrypt/src/fp_sqr_comba_28.i \
|
||||
ctaocrypt/src/fp_sqr_comba_32.i \
|
||||
ctaocrypt/src/fp_sqr_comba_3.i \
|
||||
ctaocrypt/src/fp_sqr_comba_48.i \
|
||||
ctaocrypt/src/fp_sqr_comba_4.i \
|
||||
ctaocrypt/src/fp_sqr_comba_64.i \
|
||||
ctaocrypt/src/fp_sqr_comba_6.i \
|
||||
ctaocrypt/src/fp_sqr_comba_7.i \
|
||||
ctaocrypt/src/fp_sqr_comba_8.i \
|
||||
ctaocrypt/src/fp_sqr_comba_9.i \
|
||||
ctaocrypt/src/fp_sqr_comba_small_set.i
|
||||
@@ -1,153 +0,0 @@
|
||||
/* logging.c
|
||||
*
|
||||
* Copyright (C) 2006-2012 Sawtooth Consulting Ltd.
|
||||
*
|
||||
* This file is part of CyaSSL.
|
||||
*
|
||||
* CyaSSL is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* CyaSSL is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
/* submitted by eof */
|
||||
|
||||
#include <cyassl/ctaocrypt/settings.h>
|
||||
#include <cyassl/ctaocrypt/logging.h>
|
||||
#include <cyassl/ctaocrypt/error.h>
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
CYASSL_API int CyaSSL_Debugging_ON(void);
|
||||
CYASSL_API void CyaSSL_Debugging_OFF(void);
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef DEBUG_CYASSL
|
||||
|
||||
/* Set these to default values initially. */
|
||||
static CyaSSL_Logging_cb log_function = 0;
|
||||
static int loggingEnabled = 0;
|
||||
|
||||
#endif /* DEBUG_CYASSL */
|
||||
|
||||
|
||||
int CyaSSL_SetLoggingCb(CyaSSL_Logging_cb f)
|
||||
{
|
||||
#ifdef DEBUG_CYASSL
|
||||
int res = 0;
|
||||
|
||||
if (f)
|
||||
log_function = f;
|
||||
else
|
||||
res = BAD_FUNC_ARG;
|
||||
|
||||
return res;
|
||||
#else
|
||||
(void)f;
|
||||
return NOT_COMPILED_IN;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
int CyaSSL_Debugging_ON(void)
|
||||
{
|
||||
#ifdef DEBUG_CYASSL
|
||||
loggingEnabled = 1;
|
||||
return 0;
|
||||
#else
|
||||
return NOT_COMPILED_IN;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
void CyaSSL_Debugging_OFF(void)
|
||||
{
|
||||
#ifdef DEBUG_CYASSL
|
||||
loggingEnabled = 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
#ifdef DEBUG_CYASSL
|
||||
|
||||
#include <stdio.h> /* for default printf stuff */
|
||||
|
||||
#ifdef THREADX
|
||||
int dc_log_printf(char*, ...);
|
||||
#endif
|
||||
|
||||
static void cyassl_log(const int logLevel, const char *const logMessage)
|
||||
{
|
||||
if (log_function)
|
||||
log_function(logLevel, logMessage);
|
||||
else {
|
||||
if (loggingEnabled) {
|
||||
#ifdef THREADX
|
||||
dc_log_printf("%s\n", logMessage);
|
||||
#elif defined(MICRIUM)
|
||||
#if (NET_SECURE_MGR_CFG_EN == DEF_ENABLED)
|
||||
NetSecure_TraceOut((CPU_CHAR *)logMessage);
|
||||
#endif
|
||||
#else
|
||||
fprintf(stderr, "%s\n", logMessage);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void CYASSL_MSG(const char* msg)
|
||||
{
|
||||
if (loggingEnabled)
|
||||
cyassl_log(INFO_LOG , msg);
|
||||
}
|
||||
|
||||
|
||||
void CYASSL_ENTER(const char* msg)
|
||||
{
|
||||
if (loggingEnabled) {
|
||||
char buffer[80];
|
||||
sprintf(buffer, "CyaSSL Entering %s", msg);
|
||||
cyassl_log(ENTER_LOG , buffer);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void CYASSL_LEAVE(const char* msg, int ret)
|
||||
{
|
||||
if (loggingEnabled) {
|
||||
char buffer[80];
|
||||
sprintf(buffer, "CyaSSL Leaving %s, return %d", msg, ret);
|
||||
cyassl_log(LEAVE_LOG , buffer);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void CYASSL_ERROR(int error)
|
||||
{
|
||||
if (loggingEnabled) {
|
||||
char buffer[80];
|
||||
sprintf(buffer, "CyaSSL error occured, error = %d", error);
|
||||
cyassl_log(ERROR_LOG , buffer);
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* DEBUG_CYASSL */
|
||||
@@ -1,129 +0,0 @@
|
||||
/* md2.c
|
||||
*
|
||||
* Copyright (C) 2006-2012 Sawtooth Consulting Ltd.
|
||||
*
|
||||
* This file is part of CyaSSL.
|
||||
*
|
||||
* CyaSSL is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* CyaSSL is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
*/
|
||||
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
#ifdef CYASSL_MD2
|
||||
|
||||
#include <cyassl/ctaocrypt/md2.h>
|
||||
#ifdef NO_INLINE
|
||||
#include <cyassl/ctaocrypt/misc.h>
|
||||
#else
|
||||
#include <ctaocrypt/src/misc.c>
|
||||
#endif
|
||||
|
||||
|
||||
void InitMd2(Md2* md2)
|
||||
{
|
||||
XMEMSET(md2->X, 0, MD2_X_SIZE);
|
||||
XMEMSET(md2->C, 0, MD2_BLOCK_SIZE);
|
||||
XMEMSET(md2->buffer, 0, MD2_BLOCK_SIZE);
|
||||
md2->count = 0;
|
||||
}
|
||||
|
||||
|
||||
void Md2Update(Md2* md2, const byte* data, word32 len)
|
||||
{
|
||||
static const byte S[256] =
|
||||
{
|
||||
41, 46, 67, 201, 162, 216, 124, 1, 61, 54, 84, 161, 236, 240, 6,
|
||||
19, 98, 167, 5, 243, 192, 199, 115, 140, 152, 147, 43, 217, 188,
|
||||
76, 130, 202, 30, 155, 87, 60, 253, 212, 224, 22, 103, 66, 111, 24,
|
||||
138, 23, 229, 18, 190, 78, 196, 214, 218, 158, 222, 73, 160, 251,
|
||||
245, 142, 187, 47, 238, 122, 169, 104, 121, 145, 21, 178, 7, 63,
|
||||
148, 194, 16, 137, 11, 34, 95, 33, 128, 127, 93, 154, 90, 144, 50,
|
||||
39, 53, 62, 204, 231, 191, 247, 151, 3, 255, 25, 48, 179, 72, 165,
|
||||
181, 209, 215, 94, 146, 42, 172, 86, 170, 198, 79, 184, 56, 210,
|
||||
150, 164, 125, 182, 118, 252, 107, 226, 156, 116, 4, 241, 69, 157,
|
||||
112, 89, 100, 113, 135, 32, 134, 91, 207, 101, 230, 45, 168, 2, 27,
|
||||
96, 37, 173, 174, 176, 185, 246, 28, 70, 97, 105, 52, 64, 126, 15,
|
||||
85, 71, 163, 35, 221, 81, 175, 58, 195, 92, 249, 206, 186, 197,
|
||||
234, 38, 44, 83, 13, 110, 133, 40, 132, 9, 211, 223, 205, 244, 65,
|
||||
129, 77, 82, 106, 220, 55, 200, 108, 193, 171, 250, 36, 225, 123,
|
||||
8, 12, 189, 177, 74, 120, 136, 149, 139, 227, 99, 232, 109, 233,
|
||||
203, 213, 254, 59, 0, 29, 57, 242, 239, 183, 14, 102, 88, 208, 228,
|
||||
166, 119, 114, 248, 235, 117, 75, 10, 49, 68, 80, 180, 143, 237,
|
||||
31, 26, 219, 153, 141, 51, 159, 17, 131, 20
|
||||
};
|
||||
|
||||
while (len) {
|
||||
word32 L = (MD2_PAD_SIZE - md2->count) < len ?
|
||||
(MD2_PAD_SIZE - md2->count) : len;
|
||||
XMEMCPY(md2->buffer + md2->count, data, L);
|
||||
md2->count += L;
|
||||
data += L;
|
||||
len -= L;
|
||||
|
||||
if (md2->count == MD2_PAD_SIZE) {
|
||||
int i;
|
||||
byte t;
|
||||
|
||||
md2->count = 0;
|
||||
XMEMCPY(md2->X + MD2_PAD_SIZE, md2->buffer, MD2_PAD_SIZE);
|
||||
t = md2->C[15];
|
||||
|
||||
for(i = 0; i < MD2_PAD_SIZE; i++) {
|
||||
md2->X[32 + i] = md2->X[MD2_PAD_SIZE + i] ^ md2->X[i];
|
||||
t = md2->C[i] ^= S[md2->buffer[i] ^ t];
|
||||
}
|
||||
|
||||
t=0;
|
||||
for(i = 0; i < 18; i++) {
|
||||
int j;
|
||||
for(j = 0; j < MD2_X_SIZE; j += 8) {
|
||||
t = md2->X[j+0] ^= S[t];
|
||||
t = md2->X[j+1] ^= S[t];
|
||||
t = md2->X[j+2] ^= S[t];
|
||||
t = md2->X[j+3] ^= S[t];
|
||||
t = md2->X[j+4] ^= S[t];
|
||||
t = md2->X[j+5] ^= S[t];
|
||||
t = md2->X[j+6] ^= S[t];
|
||||
t = md2->X[j+7] ^= S[t];
|
||||
}
|
||||
t = (t + i) & 0xFF;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void Md2Final(Md2* md2, byte* hash)
|
||||
{
|
||||
byte padding[MD2_BLOCK_SIZE];
|
||||
word32 padLen = MD2_PAD_SIZE - md2->count;
|
||||
word32 i;
|
||||
|
||||
for (i = 0; i < padLen; i++)
|
||||
padding[i] = (byte)padLen;
|
||||
|
||||
Md2Update(md2, padding, padLen);
|
||||
Md2Update(md2, md2->C, MD2_BLOCK_SIZE);
|
||||
|
||||
XMEMCPY(hash, md2->X, MD2_DIGEST_SIZE);
|
||||
|
||||
InitMd2(md2);
|
||||
}
|
||||
|
||||
|
||||
#endif /* CYASSL_MD2 */
|
||||
@@ -1,226 +0,0 @@
|
||||
/* md5.c
|
||||
*
|
||||
* Copyright (C) 2006-2012 Sawtooth Consulting Ltd.
|
||||
*
|
||||
* This file is part of CyaSSL.
|
||||
*
|
||||
* CyaSSL is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* CyaSSL is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
*/
|
||||
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
#include <cyassl/ctaocrypt/md5.h>
|
||||
|
||||
#ifdef NO_INLINE
|
||||
#include <cyassl/ctaocrypt/misc.h>
|
||||
#else
|
||||
#include <ctaocrypt/src/misc.c>
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef min
|
||||
|
||||
static INLINE word32 min(word32 a, word32 b)
|
||||
{
|
||||
return a > b ? b : a;
|
||||
}
|
||||
|
||||
#endif /* min */
|
||||
|
||||
|
||||
void InitMd5(Md5* md5)
|
||||
{
|
||||
md5->digest[0] = 0x67452301L;
|
||||
md5->digest[1] = 0xefcdab89L;
|
||||
md5->digest[2] = 0x98badcfeL;
|
||||
md5->digest[3] = 0x10325476L;
|
||||
|
||||
md5->buffLen = 0;
|
||||
md5->loLen = 0;
|
||||
md5->hiLen = 0;
|
||||
}
|
||||
|
||||
|
||||
static void Transform(Md5* md5)
|
||||
{
|
||||
#define F1(x, y, z) (z ^ (x & (y ^ z)))
|
||||
#define F2(x, y, z) F1(z, x, y)
|
||||
#define F3(x, y, z) (x ^ y ^ z)
|
||||
#define F4(x, y, z) (y ^ (x | ~z))
|
||||
|
||||
#define MD5STEP(f, w, x, y, z, data, s) \
|
||||
w = rotlFixed(w + f(x, y, z) + data, s) + x
|
||||
|
||||
/* Copy context->state[] to working vars */
|
||||
word32 a = md5->digest[0];
|
||||
word32 b = md5->digest[1];
|
||||
word32 c = md5->digest[2];
|
||||
word32 d = md5->digest[3];
|
||||
|
||||
MD5STEP(F1, a, b, c, d, md5->buffer[0] + 0xd76aa478, 7);
|
||||
MD5STEP(F1, d, a, b, c, md5->buffer[1] + 0xe8c7b756, 12);
|
||||
MD5STEP(F1, c, d, a, b, md5->buffer[2] + 0x242070db, 17);
|
||||
MD5STEP(F1, b, c, d, a, md5->buffer[3] + 0xc1bdceee, 22);
|
||||
MD5STEP(F1, a, b, c, d, md5->buffer[4] + 0xf57c0faf, 7);
|
||||
MD5STEP(F1, d, a, b, c, md5->buffer[5] + 0x4787c62a, 12);
|
||||
MD5STEP(F1, c, d, a, b, md5->buffer[6] + 0xa8304613, 17);
|
||||
MD5STEP(F1, b, c, d, a, md5->buffer[7] + 0xfd469501, 22);
|
||||
MD5STEP(F1, a, b, c, d, md5->buffer[8] + 0x698098d8, 7);
|
||||
MD5STEP(F1, d, a, b, c, md5->buffer[9] + 0x8b44f7af, 12);
|
||||
MD5STEP(F1, c, d, a, b, md5->buffer[10] + 0xffff5bb1, 17);
|
||||
MD5STEP(F1, b, c, d, a, md5->buffer[11] + 0x895cd7be, 22);
|
||||
MD5STEP(F1, a, b, c, d, md5->buffer[12] + 0x6b901122, 7);
|
||||
MD5STEP(F1, d, a, b, c, md5->buffer[13] + 0xfd987193, 12);
|
||||
MD5STEP(F1, c, d, a, b, md5->buffer[14] + 0xa679438e, 17);
|
||||
MD5STEP(F1, b, c, d, a, md5->buffer[15] + 0x49b40821, 22);
|
||||
|
||||
MD5STEP(F2, a, b, c, d, md5->buffer[1] + 0xf61e2562, 5);
|
||||
MD5STEP(F2, d, a, b, c, md5->buffer[6] + 0xc040b340, 9);
|
||||
MD5STEP(F2, c, d, a, b, md5->buffer[11] + 0x265e5a51, 14);
|
||||
MD5STEP(F2, b, c, d, a, md5->buffer[0] + 0xe9b6c7aa, 20);
|
||||
MD5STEP(F2, a, b, c, d, md5->buffer[5] + 0xd62f105d, 5);
|
||||
MD5STEP(F2, d, a, b, c, md5->buffer[10] + 0x02441453, 9);
|
||||
MD5STEP(F2, c, d, a, b, md5->buffer[15] + 0xd8a1e681, 14);
|
||||
MD5STEP(F2, b, c, d, a, md5->buffer[4] + 0xe7d3fbc8, 20);
|
||||
MD5STEP(F2, a, b, c, d, md5->buffer[9] + 0x21e1cde6, 5);
|
||||
MD5STEP(F2, d, a, b, c, md5->buffer[14] + 0xc33707d6, 9);
|
||||
MD5STEP(F2, c, d, a, b, md5->buffer[3] + 0xf4d50d87, 14);
|
||||
MD5STEP(F2, b, c, d, a, md5->buffer[8] + 0x455a14ed, 20);
|
||||
MD5STEP(F2, a, b, c, d, md5->buffer[13] + 0xa9e3e905, 5);
|
||||
MD5STEP(F2, d, a, b, c, md5->buffer[2] + 0xfcefa3f8, 9);
|
||||
MD5STEP(F2, c, d, a, b, md5->buffer[7] + 0x676f02d9, 14);
|
||||
MD5STEP(F2, b, c, d, a, md5->buffer[12] + 0x8d2a4c8a, 20);
|
||||
|
||||
MD5STEP(F3, a, b, c, d, md5->buffer[5] + 0xfffa3942, 4);
|
||||
MD5STEP(F3, d, a, b, c, md5->buffer[8] + 0x8771f681, 11);
|
||||
MD5STEP(F3, c, d, a, b, md5->buffer[11] + 0x6d9d6122, 16);
|
||||
MD5STEP(F3, b, c, d, a, md5->buffer[14] + 0xfde5380c, 23);
|
||||
MD5STEP(F3, a, b, c, d, md5->buffer[1] + 0xa4beea44, 4);
|
||||
MD5STEP(F3, d, a, b, c, md5->buffer[4] + 0x4bdecfa9, 11);
|
||||
MD5STEP(F3, c, d, a, b, md5->buffer[7] + 0xf6bb4b60, 16);
|
||||
MD5STEP(F3, b, c, d, a, md5->buffer[10] + 0xbebfbc70, 23);
|
||||
MD5STEP(F3, a, b, c, d, md5->buffer[13] + 0x289b7ec6, 4);
|
||||
MD5STEP(F3, d, a, b, c, md5->buffer[0] + 0xeaa127fa, 11);
|
||||
MD5STEP(F3, c, d, a, b, md5->buffer[3] + 0xd4ef3085, 16);
|
||||
MD5STEP(F3, b, c, d, a, md5->buffer[6] + 0x04881d05, 23);
|
||||
MD5STEP(F3, a, b, c, d, md5->buffer[9] + 0xd9d4d039, 4);
|
||||
MD5STEP(F3, d, a, b, c, md5->buffer[12] + 0xe6db99e5, 11);
|
||||
MD5STEP(F3, c, d, a, b, md5->buffer[15] + 0x1fa27cf8, 16);
|
||||
MD5STEP(F3, b, c, d, a, md5->buffer[2] + 0xc4ac5665, 23);
|
||||
|
||||
MD5STEP(F4, a, b, c, d, md5->buffer[0] + 0xf4292244, 6);
|
||||
MD5STEP(F4, d, a, b, c, md5->buffer[7] + 0x432aff97, 10);
|
||||
MD5STEP(F4, c, d, a, b, md5->buffer[14] + 0xab9423a7, 15);
|
||||
MD5STEP(F4, b, c, d, a, md5->buffer[5] + 0xfc93a039, 21);
|
||||
MD5STEP(F4, a, b, c, d, md5->buffer[12] + 0x655b59c3, 6);
|
||||
MD5STEP(F4, d, a, b, c, md5->buffer[3] + 0x8f0ccc92, 10);
|
||||
MD5STEP(F4, c, d, a, b, md5->buffer[10] + 0xffeff47d, 15);
|
||||
MD5STEP(F4, b, c, d, a, md5->buffer[1] + 0x85845dd1, 21);
|
||||
MD5STEP(F4, a, b, c, d, md5->buffer[8] + 0x6fa87e4f, 6);
|
||||
MD5STEP(F4, d, a, b, c, md5->buffer[15] + 0xfe2ce6e0, 10);
|
||||
MD5STEP(F4, c, d, a, b, md5->buffer[6] + 0xa3014314, 15);
|
||||
MD5STEP(F4, b, c, d, a, md5->buffer[13] + 0x4e0811a1, 21);
|
||||
MD5STEP(F4, a, b, c, d, md5->buffer[4] + 0xf7537e82, 6);
|
||||
MD5STEP(F4, d, a, b, c, md5->buffer[11] + 0xbd3af235, 10);
|
||||
MD5STEP(F4, c, d, a, b, md5->buffer[2] + 0x2ad7d2bb, 15);
|
||||
MD5STEP(F4, b, c, d, a, md5->buffer[9] + 0xeb86d391, 21);
|
||||
|
||||
/* Add the working vars back into digest state[] */
|
||||
md5->digest[0] += a;
|
||||
md5->digest[1] += b;
|
||||
md5->digest[2] += c;
|
||||
md5->digest[3] += d;
|
||||
}
|
||||
|
||||
|
||||
static INLINE void AddLength(Md5* md5, word32 len)
|
||||
{
|
||||
word32 tmp = md5->loLen;
|
||||
if ( (md5->loLen += len) < tmp)
|
||||
md5->hiLen++; /* carry low to high */
|
||||
}
|
||||
|
||||
|
||||
void Md5Update(Md5* md5, const byte* data, word32 len)
|
||||
{
|
||||
/* do block size increments */
|
||||
byte* local = (byte*)md5->buffer;
|
||||
|
||||
while (len) {
|
||||
word32 add = min(len, MD5_BLOCK_SIZE - md5->buffLen);
|
||||
XMEMCPY(&local[md5->buffLen], data, add);
|
||||
|
||||
md5->buffLen += add;
|
||||
data += add;
|
||||
len -= add;
|
||||
|
||||
if (md5->buffLen == MD5_BLOCK_SIZE) {
|
||||
#ifdef BIG_ENDIAN_ORDER
|
||||
ByteReverseBytes(local, local, MD5_BLOCK_SIZE);
|
||||
#endif
|
||||
Transform(md5);
|
||||
AddLength(md5, MD5_BLOCK_SIZE);
|
||||
md5->buffLen = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void Md5Final(Md5* md5, byte* hash)
|
||||
{
|
||||
byte* local = (byte*)md5->buffer;
|
||||
|
||||
AddLength(md5, md5->buffLen); /* before adding pads */
|
||||
|
||||
local[md5->buffLen++] = 0x80; /* add 1 */
|
||||
|
||||
/* pad with zeros */
|
||||
if (md5->buffLen > MD5_PAD_SIZE) {
|
||||
XMEMSET(&local[md5->buffLen], 0, MD5_BLOCK_SIZE - md5->buffLen);
|
||||
md5->buffLen += MD5_BLOCK_SIZE - md5->buffLen;
|
||||
|
||||
#ifdef BIG_ENDIAN_ORDER
|
||||
ByteReverseBytes(local, local, MD5_BLOCK_SIZE);
|
||||
#endif
|
||||
Transform(md5);
|
||||
md5->buffLen = 0;
|
||||
}
|
||||
XMEMSET(&local[md5->buffLen], 0, MD5_PAD_SIZE - md5->buffLen);
|
||||
|
||||
/* put lengths in bits */
|
||||
md5->hiLen = (md5->loLen >> (8*sizeof(md5->loLen) - 3)) +
|
||||
(md5->hiLen << 3);
|
||||
md5->loLen = md5->loLen << 3;
|
||||
|
||||
/* store lengths */
|
||||
#ifdef BIG_ENDIAN_ORDER
|
||||
ByteReverseBytes(local, local, MD5_BLOCK_SIZE);
|
||||
#endif
|
||||
/* ! length ordering dependent on digest endian type ! */
|
||||
XMEMCPY(&local[MD5_PAD_SIZE], &md5->loLen, sizeof(word32));
|
||||
XMEMCPY(&local[MD5_PAD_SIZE + sizeof(word32)], &md5->hiLen, sizeof(word32));
|
||||
|
||||
Transform(md5);
|
||||
#ifdef BIG_ENDIAN_ORDER
|
||||
ByteReverseWords(md5->digest, md5->digest, MD5_DIGEST_SIZE);
|
||||
#endif
|
||||
XMEMCPY(hash, md5->digest, MD5_DIGEST_SIZE);
|
||||
|
||||
InitMd5(md5); /* reset state */
|
||||
}
|
||||
|
||||
@@ -1,99 +0,0 @@
|
||||
/* memory.c
|
||||
*
|
||||
* Copyright (C) 2006-2012 Sawtooth Consulting Ltd.
|
||||
*
|
||||
* This file is part of CyaSSL.
|
||||
*
|
||||
* CyaSSL is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* CyaSSL is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
/* submitted by eof */
|
||||
|
||||
|
||||
#include <cyassl/ctaocrypt/settings.h>
|
||||
|
||||
#ifdef USE_CYASSL_MEMORY
|
||||
|
||||
#include <cyassl/ctaocrypt/memory.h>
|
||||
#include <cyassl/ctaocrypt/error.h>
|
||||
|
||||
|
||||
/* Set these to default values initially. */
|
||||
static CyaSSL_Malloc_cb malloc_function = 0;
|
||||
static CyaSSL_Free_cb free_function = 0;
|
||||
static CyaSSL_Realloc_cb realloc_function = 0;
|
||||
|
||||
int CyaSSL_SetAllocators(CyaSSL_Malloc_cb mf,
|
||||
CyaSSL_Free_cb ff,
|
||||
CyaSSL_Realloc_cb rf)
|
||||
{
|
||||
int res = 0;
|
||||
|
||||
if (mf)
|
||||
malloc_function = mf;
|
||||
else
|
||||
res = BAD_FUNC_ARG;
|
||||
|
||||
if (ff)
|
||||
free_function = ff;
|
||||
else
|
||||
res = BAD_FUNC_ARG;
|
||||
|
||||
if (rf)
|
||||
realloc_function = rf;
|
||||
else
|
||||
res = BAD_FUNC_ARG;
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
void* CyaSSL_Malloc(size_t size)
|
||||
{
|
||||
void* res = 0;
|
||||
|
||||
if (malloc_function)
|
||||
res = malloc_function(size);
|
||||
else
|
||||
res = malloc(size);
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
void CyaSSL_Free(void *ptr)
|
||||
{
|
||||
if (free_function)
|
||||
free_function(ptr);
|
||||
else
|
||||
free(ptr);
|
||||
}
|
||||
|
||||
void* CyaSSL_Realloc(void *ptr, size_t size)
|
||||
{
|
||||
void* res = 0;
|
||||
|
||||
if (realloc_function)
|
||||
res = realloc_function(ptr, size);
|
||||
else
|
||||
res = realloc(ptr, size);
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
#endif /* USE_CYASSL_MEMORY */
|
||||
@@ -1,174 +0,0 @@
|
||||
/* misc.c
|
||||
*
|
||||
* Copyright (C) 2006-2012 Sawtooth Consulting Ltd.
|
||||
*
|
||||
* This file is part of CyaSSL.
|
||||
*
|
||||
* CyaSSL is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* CyaSSL is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
#include <cyassl/ctaocrypt/misc.h>
|
||||
|
||||
/* inlining these functions is a huge speed increase and a small size decrease,
|
||||
because the functions are smaller than function call setup/cleanup, e.g.,
|
||||
md5 benchmark is twice as fast with inline. If you don't want it, then
|
||||
define NO_INLINE and compile this file into cyassl, otherwise it's used as
|
||||
a source header
|
||||
*/
|
||||
|
||||
#ifdef NO_INLINE
|
||||
#define STATIC
|
||||
#else
|
||||
#define STATIC static
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef INTEL_INTRINSICS
|
||||
|
||||
#include <stdlib.h> /* get intrinsic definitions */
|
||||
|
||||
#pragma intrinsic(_lrotl, _lrotr)
|
||||
|
||||
STATIC INLINE word32 rotlFixed(word32 x, word32 y)
|
||||
{
|
||||
return y ? _lrotl(x, y) : x;
|
||||
}
|
||||
|
||||
STATIC INLINE word32 rotrFixed(word32 x, word32 y)
|
||||
{
|
||||
return y ? _lrotr(x, y) : x;
|
||||
}
|
||||
|
||||
#else /* generic */
|
||||
|
||||
STATIC INLINE word32 rotlFixed(word32 x, word32 y)
|
||||
{
|
||||
return (x << y) | (x >> (sizeof(y) * 8 - y));
|
||||
}
|
||||
|
||||
|
||||
STATIC INLINE word32 rotrFixed(word32 x, word32 y)
|
||||
{
|
||||
return (x >> y) | (x << (sizeof(y) * 8 - y));
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
STATIC INLINE word32 ByteReverseWord32(word32 value)
|
||||
{
|
||||
#ifdef PPC_INTRINSICS
|
||||
/* PPC: load reverse indexed instruction */
|
||||
return (word32)__lwbrx(&value,0);
|
||||
#elif defined(FAST_ROTATE)
|
||||
/* 5 instructions with rotate instruction, 9 without */
|
||||
return (rotrFixed(value, 8U) & 0xff00ff00) |
|
||||
(rotlFixed(value, 8U) & 0x00ff00ff);
|
||||
#else
|
||||
/* 6 instructions with rotate instruction, 8 without */
|
||||
value = ((value & 0xFF00FF00) >> 8) | ((value & 0x00FF00FF) << 8);
|
||||
return rotlFixed(value, 16U);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
STATIC INLINE void ByteReverseWords(word32* out, const word32* in,
|
||||
word32 byteCount)
|
||||
{
|
||||
word32 count = byteCount/sizeof(word32), i;
|
||||
|
||||
for (i = 0; i < count; i++)
|
||||
out[i] = ByteReverseWord32(in[i]);
|
||||
|
||||
}
|
||||
|
||||
|
||||
#ifdef WORD64_AVAILABLE
|
||||
|
||||
|
||||
STATIC INLINE word64 rotlFixed64(word64 x, word64 y)
|
||||
{
|
||||
return (x << y) | (x >> (sizeof(y) * 8 - y));
|
||||
}
|
||||
|
||||
|
||||
STATIC INLINE word64 rotrFixed64(word64 x, word64 y)
|
||||
{
|
||||
return (x >> y) | (x << (sizeof(y) * 8 - y));
|
||||
}
|
||||
|
||||
|
||||
STATIC INLINE word64 ByteReverseWord64(word64 value)
|
||||
{
|
||||
#ifdef CTAOCRYPT_SLOW_WORD64
|
||||
return (word64)(ByteReverseWord32((word32)value)) << 32 |
|
||||
ByteReverseWord32((word32)(value>>32));
|
||||
#else
|
||||
value = ((value & W64LIT(0xFF00FF00FF00FF00)) >> 8) |
|
||||
((value & W64LIT(0x00FF00FF00FF00FF)) << 8);
|
||||
value = ((value & W64LIT(0xFFFF0000FFFF0000)) >> 16) |
|
||||
((value & W64LIT(0x0000FFFF0000FFFF)) << 16);
|
||||
return rotlFixed64(value, 32U);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
STATIC INLINE void ByteReverseWords64(word64* out, const word64* in,
|
||||
word32 byteCount)
|
||||
{
|
||||
word32 count = byteCount/sizeof(word64), i;
|
||||
|
||||
for (i = 0; i < count; i++)
|
||||
out[i] = ByteReverseWord64(in[i]);
|
||||
|
||||
}
|
||||
|
||||
#endif /* WORD64_AVAILABLE */
|
||||
|
||||
|
||||
STATIC INLINE void ByteReverseBytes(byte* out, const byte* in, word32 byteCount)
|
||||
{
|
||||
word32* op = (word32*)out;
|
||||
const word32* ip = (const word32*)in;
|
||||
|
||||
ByteReverseWords(op, ip, byteCount);
|
||||
}
|
||||
|
||||
|
||||
STATIC INLINE void XorWords(word* r, const word* a, word32 n)
|
||||
{
|
||||
word32 i;
|
||||
|
||||
for (i = 0; i < n; i++) r[i] ^= a[i];
|
||||
}
|
||||
|
||||
|
||||
STATIC INLINE void xorbuf(byte* buf, const byte* mask, word32 count)
|
||||
{
|
||||
if (((word)buf | (word)mask | count) % WORD_SIZE == 0)
|
||||
XorWords( (word*)buf, (const word*)mask, count / WORD_SIZE);
|
||||
else {
|
||||
word32 i;
|
||||
for (i = 0; i < count; i++) buf[i] ^= mask[i];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#undef STATIC
|
||||
|
||||
@@ -1,319 +0,0 @@
|
||||
/* pwdbased.c
|
||||
*
|
||||
* Copyright (C) 2006-2012 Sawtooth Consulting Ltd.
|
||||
*
|
||||
* This file is part of CyaSSL.
|
||||
*
|
||||
* CyaSSL is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* CyaSSL is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
#ifndef NO_PWDBASED
|
||||
|
||||
#include <cyassl/ctaocrypt/pwdbased.h>
|
||||
#include <cyassl/ctaocrypt/hmac.h>
|
||||
#include <cyassl/ctaocrypt/integer.h>
|
||||
#include <cyassl/ctaocrypt/error.h>
|
||||
#ifdef CYASSL_SHA512
|
||||
#include <cyassl/ctaocrypt/sha512.h>
|
||||
#endif
|
||||
#ifdef NO_INLINE
|
||||
#include <cyassl/ctaocrypt/misc.h>
|
||||
#else
|
||||
#include <ctaocrypt/src/misc.c>
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef min
|
||||
|
||||
static INLINE word32 min(word32 a, word32 b)
|
||||
{
|
||||
return a > b ? b : a;
|
||||
}
|
||||
|
||||
#endif /* min */
|
||||
|
||||
|
||||
int PBKDF1(byte* output, const byte* passwd, int pLen, const byte* salt,
|
||||
int sLen, int iterations, int kLen, int hashType)
|
||||
{
|
||||
Md5 md5;
|
||||
Sha sha;
|
||||
int hLen = (hashType == MD5) ? MD5_DIGEST_SIZE : SHA_DIGEST_SIZE;
|
||||
int i;
|
||||
byte buffer[SHA_DIGEST_SIZE]; /* max size */
|
||||
|
||||
if (hashType != MD5 && hashType != SHA)
|
||||
return BAD_FUNC_ARG;
|
||||
|
||||
if (kLen > hLen)
|
||||
return BAD_FUNC_ARG;
|
||||
|
||||
if (iterations < 1)
|
||||
return BAD_FUNC_ARG;
|
||||
|
||||
if (hashType == MD5) {
|
||||
InitMd5(&md5);
|
||||
Md5Update(&md5, passwd, pLen);
|
||||
Md5Update(&md5, salt, sLen);
|
||||
Md5Final(&md5, buffer);
|
||||
}
|
||||
else {
|
||||
InitSha(&sha);
|
||||
ShaUpdate(&sha, passwd, pLen);
|
||||
ShaUpdate(&sha, salt, sLen);
|
||||
ShaFinal(&sha, buffer);
|
||||
}
|
||||
|
||||
for (i = 1; i < iterations; i++) {
|
||||
if (hashType == MD5) {
|
||||
Md5Update(&md5, buffer, hLen);
|
||||
Md5Final(&md5, buffer);
|
||||
}
|
||||
else {
|
||||
ShaUpdate(&sha, buffer, hLen);
|
||||
ShaFinal(&sha, buffer);
|
||||
}
|
||||
}
|
||||
XMEMCPY(output, buffer, kLen);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
int PBKDF2(byte* output, const byte* passwd, int pLen, const byte* salt,
|
||||
int sLen, int iterations, int kLen, int hashType)
|
||||
{
|
||||
word32 i = 1;
|
||||
int hLen;
|
||||
int j;
|
||||
Hmac hmac;
|
||||
byte buffer[INNER_HASH_SIZE]; /* max size */
|
||||
|
||||
if (hashType == MD5) {
|
||||
hLen = MD5_DIGEST_SIZE;
|
||||
}
|
||||
else if (hashType == SHA) {
|
||||
hLen = SHA_DIGEST_SIZE;
|
||||
}
|
||||
#ifndef NO_SHA256
|
||||
else if (hashType == SHA256) {
|
||||
hLen = SHA256_DIGEST_SIZE;
|
||||
}
|
||||
#endif
|
||||
#ifdef CYASSL_SHA512
|
||||
else if (hashType == SHA512) {
|
||||
hLen = SHA512_DIGEST_SIZE;
|
||||
}
|
||||
#endif
|
||||
else
|
||||
return BAD_FUNC_ARG;
|
||||
|
||||
HmacSetKey(&hmac, hashType, passwd, pLen);
|
||||
|
||||
while (kLen) {
|
||||
int currentLen;
|
||||
HmacUpdate(&hmac, salt, sLen);
|
||||
|
||||
/* encode i */
|
||||
for (j = 0; j < 4; j++) {
|
||||
byte b = (byte)(i >> ((3-j) * 8));
|
||||
HmacUpdate(&hmac, &b, 1);
|
||||
}
|
||||
HmacFinal(&hmac, buffer);
|
||||
|
||||
currentLen = min(kLen, hLen);
|
||||
XMEMCPY(output, buffer, currentLen);
|
||||
|
||||
for (j = 1; j < iterations; j++) {
|
||||
HmacUpdate(&hmac, buffer, hLen);
|
||||
HmacFinal(&hmac, buffer);
|
||||
xorbuf(output, buffer, currentLen);
|
||||
}
|
||||
|
||||
output += currentLen;
|
||||
kLen -= currentLen;
|
||||
i++;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
int PKCS12_PBKDF(byte* output, const byte* passwd, int passLen,const byte* salt,
|
||||
int saltLen, int iterations, int kLen, int hashType, int id)
|
||||
{
|
||||
/* all in bytes instead of bits */
|
||||
word32 u, v, dLen, pLen, iLen, sLen, totalLen;
|
||||
int dynamic = 0;
|
||||
int ret = 0;
|
||||
int i;
|
||||
byte *D, *S, *P, *I;
|
||||
byte staticBuffer[1024];
|
||||
byte* buffer = staticBuffer;
|
||||
#ifdef CYASSL_SHA512
|
||||
byte Ai[SHA512_DIGEST_SIZE];
|
||||
byte B[SHA512_BLOCK_SIZE];
|
||||
#elif !defined(NO_SHA256)
|
||||
byte Ai[SHA256_DIGEST_SIZE];
|
||||
byte B[SHA256_BLOCK_SIZE];
|
||||
#else
|
||||
byte Ai[SHA_DIGEST_SIZE];
|
||||
byte B[SHA_BLOCK_SIZE];
|
||||
#endif
|
||||
|
||||
if (!iterations)
|
||||
iterations = 1;
|
||||
|
||||
if (hashType == MD5) {
|
||||
v = MD5_BLOCK_SIZE;
|
||||
u = MD5_DIGEST_SIZE;
|
||||
}
|
||||
else if (hashType == SHA) {
|
||||
v = SHA_BLOCK_SIZE;
|
||||
u = SHA_DIGEST_SIZE;
|
||||
}
|
||||
#ifndef NO_SHA256
|
||||
else if (hashType == SHA256) {
|
||||
v = SHA256_BLOCK_SIZE;
|
||||
u = SHA256_DIGEST_SIZE;
|
||||
}
|
||||
#endif
|
||||
#ifdef CYASSL_SHA512
|
||||
else if (hashType == SHA512) {
|
||||
v = SHA512_BLOCK_SIZE;
|
||||
u = SHA512_DIGEST_SIZE;
|
||||
}
|
||||
#endif
|
||||
else
|
||||
return BAD_FUNC_ARG;
|
||||
|
||||
dLen = v;
|
||||
sLen = v * ((saltLen + v - 1) / v);
|
||||
if (passLen)
|
||||
pLen = v * ((passLen + v - 1) / v);
|
||||
else
|
||||
pLen = 0;
|
||||
iLen = sLen + pLen;
|
||||
|
||||
totalLen = dLen + sLen + pLen;
|
||||
|
||||
if (totalLen > sizeof(staticBuffer)) {
|
||||
buffer = (byte*)XMALLOC(totalLen, 0, DYNAMIC_TYPE_KEY);
|
||||
if (buffer == NULL) return MEMORY_E;
|
||||
dynamic = 1;
|
||||
}
|
||||
|
||||
D = buffer;
|
||||
S = D + dLen;
|
||||
P = S + sLen;
|
||||
I = S;
|
||||
|
||||
XMEMSET(D, id, dLen);
|
||||
|
||||
for (i = 0; i < (int)sLen; i++)
|
||||
S[i] = salt[i % saltLen];
|
||||
for (i = 0; i < (int)pLen; i++)
|
||||
P[i] = passwd[i % passLen];
|
||||
|
||||
while (kLen > 0) {
|
||||
word32 currentLen;
|
||||
mp_int B1;
|
||||
|
||||
if (hashType == MD5) {
|
||||
}
|
||||
else if (hashType == SHA) {
|
||||
Sha sha;
|
||||
|
||||
InitSha(&sha);
|
||||
ShaUpdate(&sha, buffer, totalLen);
|
||||
ShaFinal(&sha, Ai);
|
||||
|
||||
for (i = 1; i < iterations; i++) {
|
||||
ShaUpdate(&sha, Ai, u);
|
||||
ShaFinal(&sha, Ai);
|
||||
}
|
||||
}
|
||||
#ifndef NO_SHA256
|
||||
else if (hashType == SHA256) {
|
||||
}
|
||||
#endif
|
||||
#ifdef CYASSL_SHA512
|
||||
else if (hashType == SHA512) {
|
||||
}
|
||||
#endif
|
||||
|
||||
for (i = 0; i < (int)v; i++)
|
||||
B[i] = Ai[i % u];
|
||||
|
||||
mp_init(&B1);
|
||||
if (mp_read_unsigned_bin(&B1, B, v) != MP_OKAY)
|
||||
ret = MP_READ_E;
|
||||
else if (mp_add_d(&B1, (mp_digit)1, &B1) != MP_OKAY) {
|
||||
ret = MP_ADD_E;
|
||||
mp_clear(&B1);
|
||||
break;
|
||||
}
|
||||
|
||||
for (i = 0; i < (int)iLen; i += v) {
|
||||
int outSz;
|
||||
mp_int i1;
|
||||
mp_int res;
|
||||
|
||||
mp_init(&i1);
|
||||
mp_init(&res);
|
||||
|
||||
if (mp_read_unsigned_bin(&i1, I + i, v) != MP_OKAY)
|
||||
ret = MP_READ_E;
|
||||
else if (mp_add(&i1, &B1, &res) != MP_OKAY)
|
||||
ret = MP_ADD_E;
|
||||
else if ( (outSz = mp_unsigned_bin_size(&res)) < 0)
|
||||
ret = MP_TO_E;
|
||||
else {
|
||||
if (outSz > (int)v) {
|
||||
/* take off MSB */
|
||||
byte tmp[129];
|
||||
mp_to_unsigned_bin(&res, tmp);
|
||||
XMEMCPY(I + i, tmp + 1, v);
|
||||
}
|
||||
else if (outSz < (int)v) {
|
||||
XMEMSET(I + i, 0, v - outSz);
|
||||
mp_to_unsigned_bin(&res, I + i + v - outSz);
|
||||
}
|
||||
else
|
||||
mp_to_unsigned_bin(&res, I + i);
|
||||
}
|
||||
|
||||
mp_clear(&i1);
|
||||
mp_clear(&res);
|
||||
if (ret < 0) break;
|
||||
}
|
||||
|
||||
currentLen = min(kLen, (int)u);
|
||||
XMEMCPY(output, Ai, currentLen);
|
||||
output += currentLen;
|
||||
kLen -= currentLen;
|
||||
mp_clear(&B1);
|
||||
}
|
||||
|
||||
if (dynamic) XFREE(buffer, 0, DYNAMIC_TYPE_KEY);
|
||||
return ret;
|
||||
}
|
||||
|
||||
#endif /* NO_PWDBASED */
|
||||
|
||||
@@ -1,193 +0,0 @@
|
||||
/* random.c
|
||||
*
|
||||
* Copyright (C) 2006-2012 Sawtooth Consulting Ltd.
|
||||
*
|
||||
* This file is part of CyaSSL.
|
||||
*
|
||||
* CyaSSL is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* CyaSSL is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
/* on HPUX 11 you may need to install /dev/random see
|
||||
http://h20293.www2.hp.com/portal/swdepot/displayProductInfo.do?productNumber=KRNG11I
|
||||
|
||||
*/
|
||||
|
||||
#include <cyassl/ctaocrypt/random.h>
|
||||
#include <cyassl/ctaocrypt/error.h>
|
||||
|
||||
|
||||
#if defined(USE_WINDOWS_API)
|
||||
#ifndef _WIN32_WINNT
|
||||
#define _WIN32_WINNT 0x0400
|
||||
#endif
|
||||
#include <windows.h>
|
||||
#include <wincrypt.h>
|
||||
#else
|
||||
#ifndef NO_DEV_RANDOM
|
||||
#include <fcntl.h>
|
||||
#include <unistd.h>
|
||||
#else
|
||||
/* include headers that may be needed to get good seed */
|
||||
#endif
|
||||
#endif /* USE_WINDOWS_API */
|
||||
|
||||
|
||||
|
||||
/* Get seed and key cipher */
|
||||
int InitRng(RNG* rng)
|
||||
{
|
||||
byte key[32];
|
||||
byte junk[256];
|
||||
|
||||
int ret = GenerateSeed(&rng->seed, key, sizeof(key));
|
||||
|
||||
if (ret == 0) {
|
||||
Arc4SetKey(&rng->cipher, key, sizeof(key));
|
||||
RNG_GenerateBlock(rng, junk, sizeof(junk)); /* rid initial state */
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
/* place a generated block in output */
|
||||
void RNG_GenerateBlock(RNG* rng, byte* output, word32 sz)
|
||||
{
|
||||
XMEMSET(output, 0, sz);
|
||||
Arc4Process(&rng->cipher, output, output, sz);
|
||||
}
|
||||
|
||||
|
||||
byte RNG_GenerateByte(RNG* rng)
|
||||
{
|
||||
byte b;
|
||||
RNG_GenerateBlock(rng, &b, 1);
|
||||
|
||||
return b;
|
||||
}
|
||||
|
||||
|
||||
#if defined(USE_WINDOWS_API)
|
||||
|
||||
|
||||
int GenerateSeed(OS_Seed* os, byte* output, word32 sz)
|
||||
{
|
||||
if(!CryptAcquireContext(&os->handle, 0, 0, PROV_RSA_FULL,
|
||||
CRYPT_VERIFYCONTEXT))
|
||||
return WINCRYPT_E;
|
||||
|
||||
if (!CryptGenRandom(os->handle, sz, output))
|
||||
return CRYPTGEN_E;
|
||||
|
||||
CryptReleaseContext(os->handle, 0);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
#elif defined(THREADX)
|
||||
|
||||
#include "rtprand.h" /* rtp_rand () */
|
||||
#include "rtptime.h" /* rtp_get_system_msec() */
|
||||
|
||||
|
||||
int GenerateSeed(OS_Seed* os, byte* output, word32 sz)
|
||||
{
|
||||
int i;
|
||||
rtp_srand(rtp_get_system_msec());
|
||||
|
||||
for (i = 0; i < sz; i++ ) {
|
||||
output[i] = rtp_rand() % 256;
|
||||
if ( (i % 8) == 7)
|
||||
rtp_srand(rtp_get_system_msec());
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
#elif defined(MICRIUM)
|
||||
|
||||
int GenerateSeed(OS_Seed* os, byte* output, word32 sz)
|
||||
{
|
||||
#if (NET_SECURE_MGR_CFG_EN == DEF_ENABLED)
|
||||
NetSecure_InitSeed(output, sz);
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
#elif defined(MBED)
|
||||
|
||||
/* write a real one !!!, just for testing board */
|
||||
int GenerateSeed(OS_Seed* os, byte* output, word32 sz)
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < sz; i++ )
|
||||
output[i] = i;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
#elif defined(NO_DEV_RANDOM)
|
||||
|
||||
#error "you need to write an os specific GenerateSeed() here"
|
||||
|
||||
|
||||
#else /* !USE_WINDOWS_API && !THREADX && !MICRIUM && !NO_DEV_RANDOM */
|
||||
|
||||
|
||||
/* may block */
|
||||
int GenerateSeed(OS_Seed* os, byte* output, word32 sz)
|
||||
{
|
||||
int ret = 0;
|
||||
|
||||
os->fd = open("/dev/urandom",O_RDONLY);
|
||||
if (os->fd == -1) {
|
||||
/* may still have /dev/random */
|
||||
os->fd = open("/dev/random",O_RDONLY);
|
||||
if (os->fd == -1)
|
||||
return OPEN_RAN_E;
|
||||
}
|
||||
|
||||
while (sz) {
|
||||
int len = read(os->fd, output, sz);
|
||||
if (len == -1) {
|
||||
ret = READ_RAN_E;
|
||||
break;
|
||||
}
|
||||
|
||||
sz -= len;
|
||||
output += len;
|
||||
|
||||
if (sz) {
|
||||
#ifdef BLOCKING
|
||||
sleep(0); /* context switch */
|
||||
#else
|
||||
ret = RAN_BLOCK_E;
|
||||
break;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
close(os->fd);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
#endif /* USE_WINDOWS_API */
|
||||
|
||||
@@ -1,557 +0,0 @@
|
||||
/* rsa.c
|
||||
*
|
||||
* Copyright (C) 2006-2012 Sawtooth Consulting Ltd.
|
||||
*
|
||||
* This file is part of CyaSSL.
|
||||
*
|
||||
* CyaSSL is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* CyaSSL is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
*/
|
||||
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
#include <cyassl/ctaocrypt/rsa.h>
|
||||
#include <cyassl/ctaocrypt/random.h>
|
||||
#include <cyassl/ctaocrypt/error.h>
|
||||
#include <cyassl/ctaocrypt/logging.h>
|
||||
|
||||
#ifdef SHOW_GEN
|
||||
#include <stdio.h>
|
||||
#endif
|
||||
|
||||
|
||||
enum {
|
||||
RSA_PUBLIC_ENCRYPT = 0,
|
||||
RSA_PUBLIC_DECRYPT = 1,
|
||||
RSA_PRIVATE_ENCRYPT = 2,
|
||||
RSA_PRIVATE_DECRYPT = 3,
|
||||
|
||||
RSA_BLOCK_TYPE_1 = 1,
|
||||
RSA_BLOCK_TYPE_2 = 2,
|
||||
|
||||
RSA_MIN_SIZE = 512,
|
||||
RSA_MAX_SIZE = 4096,
|
||||
|
||||
RSA_MIN_PAD_SZ = 11 /* seperator + 0 + pad value + 8 pads */
|
||||
};
|
||||
|
||||
|
||||
void InitRsaKey(RsaKey* key, void* heap)
|
||||
{
|
||||
key->type = -1; /* haven't decided yet */
|
||||
key->heap = heap;
|
||||
|
||||
/* TomsFastMath doesn't use memory allocation */
|
||||
#ifndef USE_FAST_MATH
|
||||
key->n.dp = key->e.dp = 0; /* public alloc parts */
|
||||
|
||||
key->d.dp = key->p.dp = 0; /* private alloc parts */
|
||||
key->q.dp = key->dP.dp = 0;
|
||||
key->u.dp = key->dQ.dp = 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
void FreeRsaKey(RsaKey* key)
|
||||
{
|
||||
(void)key;
|
||||
/* TomsFastMath doesn't use memory allocation */
|
||||
#ifndef USE_FAST_MATH
|
||||
if (key->type == RSA_PRIVATE) {
|
||||
mp_clear(&key->u);
|
||||
mp_clear(&key->dQ);
|
||||
mp_clear(&key->dP);
|
||||
mp_clear(&key->q);
|
||||
mp_clear(&key->p);
|
||||
mp_clear(&key->d);
|
||||
}
|
||||
mp_clear(&key->e);
|
||||
mp_clear(&key->n);
|
||||
#endif
|
||||
}
|
||||
|
||||
static void RsaPad(const byte* input, word32 inputLen, byte* pkcsBlock,
|
||||
word32 pkcsBlockLen, byte padValue, RNG* rng)
|
||||
{
|
||||
if (inputLen == 0) return;
|
||||
|
||||
pkcsBlock[0] = 0x0; /* set first byte to zero and advance */
|
||||
pkcsBlock++; pkcsBlockLen--;
|
||||
pkcsBlock[0] = padValue; /* insert padValue */
|
||||
|
||||
if (padValue == RSA_BLOCK_TYPE_1)
|
||||
/* pad with 0xff bytes */
|
||||
XMEMSET(&pkcsBlock[1], 0xFF, pkcsBlockLen - inputLen - 2);
|
||||
else {
|
||||
/* pad with non-zero random bytes */
|
||||
word32 padLen = pkcsBlockLen - inputLen - 1, i;
|
||||
RNG_GenerateBlock(rng, &pkcsBlock[1], padLen);
|
||||
|
||||
/* remove zeros */
|
||||
for (i = 1; i < padLen; i++)
|
||||
if (pkcsBlock[i] == 0) pkcsBlock[i] = 0x01;
|
||||
}
|
||||
|
||||
pkcsBlock[pkcsBlockLen-inputLen-1] = 0; /* separator */
|
||||
XMEMCPY(pkcsBlock+pkcsBlockLen-inputLen, input, inputLen);
|
||||
}
|
||||
|
||||
|
||||
static word32 RsaUnPad(const byte *pkcsBlock, unsigned int pkcsBlockLen,
|
||||
byte **output, byte padValue)
|
||||
{
|
||||
word32 maxOutputLen = (pkcsBlockLen > 10) ? (pkcsBlockLen - 10) : 0,
|
||||
invalid = 0,
|
||||
i = 1,
|
||||
outputLen;
|
||||
|
||||
if (pkcsBlock[0] != 0x0) /* skip past zero */
|
||||
invalid = 1;
|
||||
pkcsBlock++; pkcsBlockLen--;
|
||||
|
||||
/* Require block type padValue */
|
||||
invalid = (pkcsBlock[0] != padValue) || invalid;
|
||||
|
||||
/* skip past the padding until we find the separator */
|
||||
while (i<pkcsBlockLen && pkcsBlock[i++]) { /* null body */
|
||||
}
|
||||
if(!(i==pkcsBlockLen || pkcsBlock[i-1]==0)) {
|
||||
CYASSL_MSG("RsaUnPad error, bad formatting");
|
||||
return 0;
|
||||
}
|
||||
|
||||
outputLen = pkcsBlockLen - i;
|
||||
invalid = (outputLen > maxOutputLen) || invalid;
|
||||
|
||||
if (invalid) {
|
||||
CYASSL_MSG("RsaUnPad error, bad formatting");
|
||||
return 0;
|
||||
}
|
||||
|
||||
*output = (byte *)(pkcsBlock + i);
|
||||
return outputLen;
|
||||
}
|
||||
|
||||
|
||||
static int RsaFunction(const byte* in, word32 inLen, byte* out, word32* outLen,
|
||||
int type, RsaKey* key)
|
||||
{
|
||||
#define ERROR_OUT(x) { ret = x; goto done;}
|
||||
|
||||
mp_int tmp;
|
||||
int ret = 0;
|
||||
word32 keyLen, len;
|
||||
|
||||
if (mp_init(&tmp) != MP_OKAY)
|
||||
return MP_INIT_E;
|
||||
|
||||
if (mp_read_unsigned_bin(&tmp, (byte*)in, inLen) != MP_OKAY)
|
||||
ERROR_OUT(MP_READ_E);
|
||||
|
||||
if (type == RSA_PRIVATE_DECRYPT || type == RSA_PRIVATE_ENCRYPT) {
|
||||
#ifdef RSA_LOW_MEM /* half as much memory but twice as slow */
|
||||
if (mp_exptmod(&tmp, &key->d, &key->n, &tmp) != MP_OKAY)
|
||||
ERROR_OUT(MP_EXPTMOD_E);
|
||||
#else
|
||||
#define INNER_ERROR_OUT(x) { ret = x; goto inner_done; }
|
||||
|
||||
mp_int tmpa, tmpb;
|
||||
|
||||
if (mp_init(&tmpa) != MP_OKAY)
|
||||
ERROR_OUT(MP_INIT_E);
|
||||
|
||||
if (mp_init(&tmpb) != MP_OKAY) {
|
||||
mp_clear(&tmpa);
|
||||
ERROR_OUT(MP_INIT_E);
|
||||
}
|
||||
|
||||
/* tmpa = tmp^dP mod p */
|
||||
if (mp_exptmod(&tmp, &key->dP, &key->p, &tmpa) != MP_OKAY)
|
||||
INNER_ERROR_OUT(MP_EXPTMOD_E);
|
||||
|
||||
/* tmpb = tmp^dQ mod q */
|
||||
if (mp_exptmod(&tmp, &key->dQ, &key->q, &tmpb) != MP_OKAY)
|
||||
INNER_ERROR_OUT(MP_EXPTMOD_E);
|
||||
|
||||
/* tmp = (tmpa - tmpb) * qInv (mod p) */
|
||||
if (mp_sub(&tmpa, &tmpb, &tmp) != MP_OKAY)
|
||||
INNER_ERROR_OUT(MP_SUB_E);
|
||||
|
||||
if (mp_mulmod(&tmp, &key->u, &key->p, &tmp) != MP_OKAY)
|
||||
INNER_ERROR_OUT(MP_MULMOD_E);
|
||||
|
||||
/* tmp = tmpb + q * tmp */
|
||||
if (mp_mul(&tmp, &key->q, &tmp) != MP_OKAY)
|
||||
INNER_ERROR_OUT(MP_MUL_E);
|
||||
|
||||
if (mp_add(&tmp, &tmpb, &tmp) != MP_OKAY)
|
||||
INNER_ERROR_OUT(MP_ADD_E);
|
||||
|
||||
inner_done:
|
||||
mp_clear(&tmpa);
|
||||
mp_clear(&tmpb);
|
||||
|
||||
if (ret != 0) return ret;
|
||||
|
||||
#endif /* RSA_LOW_MEM */
|
||||
}
|
||||
else if (type == RSA_PUBLIC_ENCRYPT || type == RSA_PUBLIC_DECRYPT) {
|
||||
if (mp_exptmod(&tmp, &key->e, &key->n, &tmp) != MP_OKAY)
|
||||
ERROR_OUT(MP_EXPTMOD_E);
|
||||
}
|
||||
else
|
||||
ERROR_OUT(RSA_WRONG_TYPE_E);
|
||||
|
||||
keyLen = mp_unsigned_bin_size(&key->n);
|
||||
if (keyLen > *outLen)
|
||||
ERROR_OUT(RSA_BUFFER_E);
|
||||
|
||||
len = mp_unsigned_bin_size(&tmp);
|
||||
|
||||
/* pad front w/ zeros to match key length */
|
||||
while (len < keyLen) {
|
||||
*out++ = 0x00;
|
||||
len++;
|
||||
}
|
||||
|
||||
*outLen = keyLen;
|
||||
|
||||
/* convert */
|
||||
if (mp_to_unsigned_bin(&tmp, out) != MP_OKAY)
|
||||
ERROR_OUT(MP_TO_E);
|
||||
|
||||
done:
|
||||
mp_clear(&tmp);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
int RsaPublicEncrypt(const byte* in, word32 inLen, byte* out, word32 outLen,
|
||||
RsaKey* key, RNG* rng)
|
||||
{
|
||||
int sz = mp_unsigned_bin_size(&key->n), ret;
|
||||
|
||||
if (sz > (int)outLen)
|
||||
return RSA_BUFFER_E;
|
||||
|
||||
if (inLen > (word32)(sz - RSA_MIN_PAD_SZ))
|
||||
return RSA_BUFFER_E;
|
||||
|
||||
RsaPad(in, inLen, out, sz, RSA_BLOCK_TYPE_2, rng);
|
||||
|
||||
if ((ret = RsaFunction(out, sz, out, &outLen, RSA_PUBLIC_ENCRYPT, key)) < 0)
|
||||
sz = ret;
|
||||
|
||||
return sz;
|
||||
}
|
||||
|
||||
|
||||
int RsaPrivateDecryptInline(byte* in, word32 inLen, byte** out, RsaKey* key)
|
||||
{
|
||||
int plainLen, ret;
|
||||
|
||||
if ((ret = RsaFunction(in, inLen, in, &inLen, RSA_PRIVATE_DECRYPT, key))
|
||||
< 0) {
|
||||
return ret;
|
||||
}
|
||||
|
||||
plainLen = RsaUnPad(in, inLen, out, RSA_BLOCK_TYPE_2);
|
||||
|
||||
return plainLen;
|
||||
}
|
||||
|
||||
|
||||
int RsaPrivateDecrypt(const byte* in, word32 inLen, byte* out, word32 outLen,
|
||||
RsaKey* key)
|
||||
{
|
||||
int plainLen, ret;
|
||||
byte* tmp;
|
||||
byte* pad = 0;
|
||||
|
||||
tmp = (byte*)XMALLOC(inLen, key->heap, DYNAMIC_TYPE_RSA);
|
||||
if (tmp == NULL) {
|
||||
return MEMORY_E;
|
||||
}
|
||||
|
||||
XMEMCPY(tmp, in, inLen);
|
||||
|
||||
if ((ret = plainLen = RsaPrivateDecryptInline(tmp, inLen, &pad, key))
|
||||
< 0) {
|
||||
XFREE(tmp, key->heap, DYNAMIC_TYPE_RSA);
|
||||
return ret;
|
||||
}
|
||||
if (plainLen > (int)outLen)
|
||||
plainLen = BAD_FUNC_ARG;
|
||||
else
|
||||
XMEMCPY(out, pad, plainLen);
|
||||
XMEMSET(tmp, 0x00, inLen);
|
||||
|
||||
XFREE(tmp, key->heap, DYNAMIC_TYPE_RSA);
|
||||
return plainLen;
|
||||
}
|
||||
|
||||
|
||||
/* for Rsa Verify */
|
||||
int RsaSSL_VerifyInline(byte* in, word32 inLen, byte** out, RsaKey* key)
|
||||
{
|
||||
int plainLen, ret;
|
||||
|
||||
if ((ret = RsaFunction(in, inLen, in, &inLen, RSA_PUBLIC_DECRYPT, key))
|
||||
< 0) {
|
||||
return ret;
|
||||
}
|
||||
|
||||
plainLen = RsaUnPad(in, inLen, out, RSA_BLOCK_TYPE_1);
|
||||
|
||||
return plainLen;
|
||||
}
|
||||
|
||||
|
||||
int RsaSSL_Verify(const byte* in, word32 inLen, byte* out, word32 outLen,
|
||||
RsaKey* key)
|
||||
{
|
||||
int plainLen, ret;
|
||||
byte* tmp;
|
||||
byte* pad = 0;
|
||||
|
||||
tmp = (byte*)XMALLOC(inLen, key->heap, DYNAMIC_TYPE_RSA);
|
||||
if (tmp == NULL) {
|
||||
return MEMORY_E;
|
||||
}
|
||||
|
||||
XMEMCPY(tmp, in, inLen);
|
||||
|
||||
if ((ret = plainLen = RsaSSL_VerifyInline(tmp, inLen, &pad, key))
|
||||
< 0) {
|
||||
XFREE(tmp, key->heap, DYNAMIC_TYPE_RSA);
|
||||
return ret;
|
||||
}
|
||||
|
||||
if (plainLen > (int)outLen)
|
||||
plainLen = BAD_FUNC_ARG;
|
||||
else
|
||||
XMEMCPY(out, pad, plainLen);
|
||||
XMEMSET(tmp, 0x00, inLen);
|
||||
|
||||
XFREE(tmp, key->heap, DYNAMIC_TYPE_RSA);
|
||||
return plainLen;
|
||||
}
|
||||
|
||||
|
||||
/* for Rsa Sign */
|
||||
int RsaSSL_Sign(const byte* in, word32 inLen, byte* out, word32 outLen,
|
||||
RsaKey* key, RNG* rng)
|
||||
{
|
||||
int sz = mp_unsigned_bin_size(&key->n), ret;
|
||||
|
||||
if (sz > (int)outLen)
|
||||
return RSA_BUFFER_E;
|
||||
|
||||
if (inLen > (word32)(sz - RSA_MIN_PAD_SZ))
|
||||
return RSA_BUFFER_E;
|
||||
|
||||
RsaPad(in, inLen, out, sz, RSA_BLOCK_TYPE_1, rng);
|
||||
|
||||
if ((ret = RsaFunction(out, sz, out, &outLen, RSA_PRIVATE_ENCRYPT,key)) < 0)
|
||||
sz = ret;
|
||||
|
||||
return sz;
|
||||
}
|
||||
|
||||
|
||||
int RsaEncryptSize(RsaKey* key)
|
||||
{
|
||||
return mp_unsigned_bin_size(&key->n);
|
||||
}
|
||||
|
||||
|
||||
#ifdef CYASSL_KEY_GEN
|
||||
|
||||
static const int USE_BBS = 1;
|
||||
|
||||
static int rand_prime(mp_int* N, int len, RNG* rng, void* heap)
|
||||
{
|
||||
int err, res, type;
|
||||
byte* buf;
|
||||
|
||||
(void)heap;
|
||||
if (N == NULL || rng == NULL)
|
||||
return BAD_FUNC_ARG;
|
||||
|
||||
/* get type */
|
||||
if (len < 0) {
|
||||
type = USE_BBS;
|
||||
len = -len;
|
||||
} else {
|
||||
type = 0;
|
||||
}
|
||||
|
||||
/* allow sizes between 2 and 512 bytes for a prime size */
|
||||
if (len < 2 || len > 512) {
|
||||
return BAD_FUNC_ARG;
|
||||
}
|
||||
|
||||
/* allocate buffer to work with */
|
||||
buf = (byte*)XMALLOC(len, heap, DYNAMIC_TYPE_RSA);
|
||||
if (buf == NULL) {
|
||||
return MEMORY_E;
|
||||
}
|
||||
XMEMSET(buf, 0, len);
|
||||
|
||||
do {
|
||||
#ifdef SHOW_GEN
|
||||
printf(".");
|
||||
fflush(stdout);
|
||||
#endif
|
||||
/* generate value */
|
||||
RNG_GenerateBlock(rng, buf, len);
|
||||
|
||||
/* munge bits */
|
||||
buf[0] |= 0x80 | 0x40;
|
||||
buf[len-1] |= 0x01 | ((type & USE_BBS) ? 0x02 : 0x00);
|
||||
|
||||
/* load value */
|
||||
if ((err = mp_read_unsigned_bin(N, buf, len)) != MP_OKAY) {
|
||||
XFREE(buf, heap, DYNAMIC_TYPE_RSA);
|
||||
return err;
|
||||
}
|
||||
|
||||
/* test */
|
||||
if ((err = mp_prime_is_prime(N, 8, &res)) != MP_OKAY) {
|
||||
XFREE(buf, heap, DYNAMIC_TYPE_RSA);
|
||||
return err;
|
||||
}
|
||||
} while (res == MP_NO);
|
||||
|
||||
#ifdef LTC_CLEAN_STACK
|
||||
XMEMSET(buf, 0, len);
|
||||
#endif
|
||||
|
||||
XFREE(buf, heap, DYNAMIC_TYPE_RSA);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/* Make an RSA key for size bits, with e specified, 65537 is a good e */
|
||||
int MakeRsaKey(RsaKey* key, int size, long e, RNG* rng)
|
||||
{
|
||||
mp_int p, q, tmp1, tmp2, tmp3;
|
||||
int err;
|
||||
|
||||
if (key == NULL || rng == NULL)
|
||||
return BAD_FUNC_ARG;
|
||||
|
||||
if (size < RSA_MIN_SIZE || size > RSA_MAX_SIZE)
|
||||
return BAD_FUNC_ARG;
|
||||
|
||||
if (e < 3 || (e & 1) == 0)
|
||||
return BAD_FUNC_ARG;
|
||||
|
||||
if ((err = mp_init_multi(&p, &q, &tmp1, &tmp2, &tmp3, NULL)) != MP_OKAY)
|
||||
return err;
|
||||
|
||||
err = mp_set_int(&tmp3, e);
|
||||
|
||||
/* make p */
|
||||
if (err == MP_OKAY) {
|
||||
do {
|
||||
err = rand_prime(&p, size/16, rng, key->heap); /* size in bytes/2 */
|
||||
|
||||
if (err == MP_OKAY)
|
||||
err = mp_sub_d(&p, 1, &tmp1); /* tmp1 = p-1 */
|
||||
|
||||
if (err == MP_OKAY)
|
||||
err = mp_gcd(&tmp1, &tmp3, &tmp2); /* tmp2 = gcd(p-1, e) */
|
||||
} while (err == MP_OKAY && mp_cmp_d(&tmp2, 1) != 0); /* e divdes p-1 */
|
||||
}
|
||||
|
||||
/* make q */
|
||||
if (err == MP_OKAY) {
|
||||
do {
|
||||
err = rand_prime(&q, size/16, rng, key->heap); /* size in bytes/2 */
|
||||
|
||||
if (err == MP_OKAY)
|
||||
err = mp_sub_d(&q, 1, &tmp1); /* tmp1 = q-1 */
|
||||
|
||||
if (err == MP_OKAY)
|
||||
err = mp_gcd(&tmp1, &tmp3, &tmp2); /* tmp2 = gcd(q-1, e) */
|
||||
} while (err == MP_OKAY && mp_cmp_d(&tmp2, 1) != 0); /* e divdes q-1 */
|
||||
}
|
||||
|
||||
if (err == MP_OKAY)
|
||||
err = mp_init_multi(&key->n, &key->e, &key->d, &key->p, &key->q, NULL);
|
||||
|
||||
if (err == MP_OKAY)
|
||||
err = mp_init_multi(&key->dP, &key->dP, &key->u, NULL, NULL, NULL);
|
||||
|
||||
if (err == MP_OKAY)
|
||||
err = mp_sub_d(&p, 1, &tmp2); /* tmp2 = p-1 */
|
||||
|
||||
if (err == MP_OKAY)
|
||||
err = mp_lcm(&tmp1, &tmp2, &tmp1); /* tmp1 = lcm(p-1, q-1),last loop */
|
||||
|
||||
/* make key */
|
||||
if (err == MP_OKAY)
|
||||
err = mp_set_int(&key->e, e); /* key->e = e */
|
||||
|
||||
if (err == MP_OKAY) /* key->d = 1/e mod lcm(p-1, q-1) */
|
||||
err = mp_invmod(&key->e, &tmp1, &key->d);
|
||||
|
||||
if (err == MP_OKAY)
|
||||
err = mp_mul(&p, &q, &key->n); /* key->n = pq */
|
||||
|
||||
if (err == MP_OKAY)
|
||||
err = mp_sub_d(&p, 1, &tmp1);
|
||||
|
||||
if (err == MP_OKAY)
|
||||
err = mp_sub_d(&q, 1, &tmp2);
|
||||
|
||||
if (err == MP_OKAY)
|
||||
err = mp_mod(&key->d, &tmp1, &key->dP);
|
||||
|
||||
if (err == MP_OKAY)
|
||||
err = mp_mod(&key->d, &tmp2, &key->dQ);
|
||||
|
||||
if (err == MP_OKAY)
|
||||
err = mp_invmod(&q, &p, &key->u);
|
||||
|
||||
if (err == MP_OKAY)
|
||||
err = mp_copy(&p, &key->p);
|
||||
|
||||
if (err == MP_OKAY)
|
||||
err = mp_copy(&q, &key->q);
|
||||
|
||||
if (err == MP_OKAY)
|
||||
key->type = RSA_PRIVATE;
|
||||
|
||||
mp_clear(&tmp3);
|
||||
mp_clear(&tmp2);
|
||||
mp_clear(&tmp1);
|
||||
mp_clear(&q);
|
||||
mp_clear(&p);
|
||||
|
||||
if (err != MP_OKAY) {
|
||||
FreeRsaKey(key);
|
||||
return err;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
#endif /* CYASLS_KEY_GEN */
|
||||
|
||||
@@ -1,201 +0,0 @@
|
||||
/* sha.c
|
||||
*
|
||||
* Copyright (C) 2006-2012 Sawtooth Consulting Ltd.
|
||||
*
|
||||
* This file is part of CyaSSL.
|
||||
*
|
||||
* CyaSSL is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* CyaSSL is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
#include <cyassl/ctaocrypt/sha.h>
|
||||
#ifdef NO_INLINE
|
||||
#include <cyassl/ctaocrypt/misc.h>
|
||||
#else
|
||||
#include <ctaocrypt/src/misc.c>
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef min
|
||||
|
||||
static INLINE word32 min(word32 a, word32 b)
|
||||
{
|
||||
return a > b ? b : a;
|
||||
}
|
||||
|
||||
#endif /* min */
|
||||
|
||||
|
||||
void InitSha(Sha* sha)
|
||||
{
|
||||
sha->digest[0] = 0x67452301L;
|
||||
sha->digest[1] = 0xEFCDAB89L;
|
||||
sha->digest[2] = 0x98BADCFEL;
|
||||
sha->digest[3] = 0x10325476L;
|
||||
sha->digest[4] = 0xC3D2E1F0L;
|
||||
|
||||
sha->buffLen = 0;
|
||||
sha->loLen = 0;
|
||||
sha->hiLen = 0;
|
||||
}
|
||||
|
||||
#define blk0(i) (W[i] = sha->buffer[i])
|
||||
#define blk1(i) (W[i&15] = \
|
||||
rotlFixed(W[(i+13)&15]^W[(i+8)&15]^W[(i+2)&15]^W[i&15],1))
|
||||
|
||||
#define f1(x,y,z) (z^(x &(y^z)))
|
||||
#define f2(x,y,z) (x^y^z)
|
||||
#define f3(x,y,z) ((x&y)|(z&(x|y)))
|
||||
#define f4(x,y,z) (x^y^z)
|
||||
|
||||
/* (R0+R1), R2, R3, R4 are the different operations used in SHA1 */
|
||||
#define R0(v,w,x,y,z,i) z+= f1(w,x,y) + blk0(i) + 0x5A827999+ \
|
||||
rotlFixed(v,5); w = rotlFixed(w,30);
|
||||
#define R1(v,w,x,y,z,i) z+= f1(w,x,y) + blk1(i) + 0x5A827999+ \
|
||||
rotlFixed(v,5); w = rotlFixed(w,30);
|
||||
#define R2(v,w,x,y,z,i) z+= f2(w,x,y) + blk1(i) + 0x6ED9EBA1+ \
|
||||
rotlFixed(v,5); w = rotlFixed(w,30);
|
||||
#define R3(v,w,x,y,z,i) z+= f3(w,x,y) + blk1(i) + 0x8F1BBCDC+ \
|
||||
rotlFixed(v,5); w = rotlFixed(w,30);
|
||||
#define R4(v,w,x,y,z,i) z+= f4(w,x,y) + blk1(i) + 0xCA62C1D6+ \
|
||||
rotlFixed(v,5); w = rotlFixed(w,30);
|
||||
|
||||
|
||||
static void Transform(Sha* sha)
|
||||
{
|
||||
word32 W[SHA_BLOCK_SIZE / sizeof(word32)];
|
||||
|
||||
/* Copy context->state[] to working vars */
|
||||
word32 a = sha->digest[0];
|
||||
word32 b = sha->digest[1];
|
||||
word32 c = sha->digest[2];
|
||||
word32 d = sha->digest[3];
|
||||
word32 e = sha->digest[4];
|
||||
|
||||
/* nearly 1 K bigger in code size but 25% faster */
|
||||
/* 4 rounds of 20 operations each. Loop unrolled. */
|
||||
R0(a,b,c,d,e, 0); R0(e,a,b,c,d, 1); R0(d,e,a,b,c, 2); R0(c,d,e,a,b, 3);
|
||||
R0(b,c,d,e,a, 4); R0(a,b,c,d,e, 5); R0(e,a,b,c,d, 6); R0(d,e,a,b,c, 7);
|
||||
R0(c,d,e,a,b, 8); R0(b,c,d,e,a, 9); R0(a,b,c,d,e,10); R0(e,a,b,c,d,11);
|
||||
R0(d,e,a,b,c,12); R0(c,d,e,a,b,13); R0(b,c,d,e,a,14); R0(a,b,c,d,e,15);
|
||||
|
||||
R1(e,a,b,c,d,16); R1(d,e,a,b,c,17); R1(c,d,e,a,b,18); R1(b,c,d,e,a,19);
|
||||
|
||||
R2(a,b,c,d,e,20); R2(e,a,b,c,d,21); R2(d,e,a,b,c,22); R2(c,d,e,a,b,23);
|
||||
R2(b,c,d,e,a,24); R2(a,b,c,d,e,25); R2(e,a,b,c,d,26); R2(d,e,a,b,c,27);
|
||||
R2(c,d,e,a,b,28); R2(b,c,d,e,a,29); R2(a,b,c,d,e,30); R2(e,a,b,c,d,31);
|
||||
R2(d,e,a,b,c,32); R2(c,d,e,a,b,33); R2(b,c,d,e,a,34); R2(a,b,c,d,e,35);
|
||||
R2(e,a,b,c,d,36); R2(d,e,a,b,c,37); R2(c,d,e,a,b,38); R2(b,c,d,e,a,39);
|
||||
|
||||
R3(a,b,c,d,e,40); R3(e,a,b,c,d,41); R3(d,e,a,b,c,42); R3(c,d,e,a,b,43);
|
||||
R3(b,c,d,e,a,44); R3(a,b,c,d,e,45); R3(e,a,b,c,d,46); R3(d,e,a,b,c,47);
|
||||
R3(c,d,e,a,b,48); R3(b,c,d,e,a,49); R3(a,b,c,d,e,50); R3(e,a,b,c,d,51);
|
||||
R3(d,e,a,b,c,52); R3(c,d,e,a,b,53); R3(b,c,d,e,a,54); R3(a,b,c,d,e,55);
|
||||
R3(e,a,b,c,d,56); R3(d,e,a,b,c,57); R3(c,d,e,a,b,58); R3(b,c,d,e,a,59);
|
||||
|
||||
R4(a,b,c,d,e,60); R4(e,a,b,c,d,61); R4(d,e,a,b,c,62); R4(c,d,e,a,b,63);
|
||||
R4(b,c,d,e,a,64); R4(a,b,c,d,e,65); R4(e,a,b,c,d,66); R4(d,e,a,b,c,67);
|
||||
R4(c,d,e,a,b,68); R4(b,c,d,e,a,69); R4(a,b,c,d,e,70); R4(e,a,b,c,d,71);
|
||||
R4(d,e,a,b,c,72); R4(c,d,e,a,b,73); R4(b,c,d,e,a,74); R4(a,b,c,d,e,75);
|
||||
R4(e,a,b,c,d,76); R4(d,e,a,b,c,77); R4(c,d,e,a,b,78); R4(b,c,d,e,a,79);
|
||||
|
||||
/* Add the working vars back into digest state[] */
|
||||
sha->digest[0] += a;
|
||||
sha->digest[1] += b;
|
||||
sha->digest[2] += c;
|
||||
sha->digest[3] += d;
|
||||
sha->digest[4] += e;
|
||||
}
|
||||
|
||||
|
||||
static INLINE void AddLength(Sha* sha, word32 len)
|
||||
{
|
||||
word32 tmp = sha->loLen;
|
||||
if ( (sha->loLen += len) < tmp)
|
||||
sha->hiLen++; /* carry low to high */
|
||||
}
|
||||
|
||||
|
||||
void ShaUpdate(Sha* sha, const byte* data, word32 len)
|
||||
{
|
||||
/* do block size increments */
|
||||
byte* local = (byte*)sha->buffer;
|
||||
|
||||
while (len) {
|
||||
word32 add = min(len, SHA_BLOCK_SIZE - sha->buffLen);
|
||||
XMEMCPY(&local[sha->buffLen], data, add);
|
||||
|
||||
sha->buffLen += add;
|
||||
data += add;
|
||||
len -= add;
|
||||
|
||||
if (sha->buffLen == SHA_BLOCK_SIZE) {
|
||||
#ifdef LITTLE_ENDIAN_ORDER
|
||||
ByteReverseBytes(local, local, SHA_BLOCK_SIZE);
|
||||
#endif
|
||||
Transform(sha);
|
||||
AddLength(sha, SHA_BLOCK_SIZE);
|
||||
sha->buffLen = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void ShaFinal(Sha* sha, byte* hash)
|
||||
{
|
||||
byte* local = (byte*)sha->buffer;
|
||||
|
||||
AddLength(sha, sha->buffLen); /* before adding pads */
|
||||
|
||||
local[sha->buffLen++] = 0x80; /* add 1 */
|
||||
|
||||
/* pad with zeros */
|
||||
if (sha->buffLen > SHA_PAD_SIZE) {
|
||||
XMEMSET(&local[sha->buffLen], 0, SHA_BLOCK_SIZE - sha->buffLen);
|
||||
sha->buffLen += SHA_BLOCK_SIZE - sha->buffLen;
|
||||
|
||||
#ifdef LITTLE_ENDIAN_ORDER
|
||||
ByteReverseBytes(local, local, SHA_BLOCK_SIZE);
|
||||
#endif
|
||||
Transform(sha);
|
||||
sha->buffLen = 0;
|
||||
}
|
||||
XMEMSET(&local[sha->buffLen], 0, SHA_PAD_SIZE - sha->buffLen);
|
||||
|
||||
/* put lengths in bits */
|
||||
sha->hiLen = (sha->loLen >> (8*sizeof(sha->loLen) - 3)) +
|
||||
(sha->hiLen << 3);
|
||||
sha->loLen = sha->loLen << 3;
|
||||
|
||||
/* store lengths */
|
||||
#ifdef LITTLE_ENDIAN_ORDER
|
||||
ByteReverseBytes(local, local, SHA_BLOCK_SIZE);
|
||||
#endif
|
||||
/* ! length ordering dependent on digest endian type ! */
|
||||
XMEMCPY(&local[SHA_PAD_SIZE], &sha->hiLen, sizeof(word32));
|
||||
XMEMCPY(&local[SHA_PAD_SIZE + sizeof(word32)], &sha->loLen, sizeof(word32));
|
||||
|
||||
Transform(sha);
|
||||
#ifdef LITTLE_ENDIAN_ORDER
|
||||
ByteReverseWords(sha->digest, sha->digest, SHA_DIGEST_SIZE);
|
||||
#endif
|
||||
XMEMCPY(hash, sha->digest, SHA_DIGEST_SIZE);
|
||||
|
||||
InitSha(sha); /* reset state */
|
||||
}
|
||||
|
||||
@@ -1,209 +0,0 @@
|
||||
/* sha256.c
|
||||
*
|
||||
* Copyright (C) 2006-2012 Sawtooth Consulting Ltd.
|
||||
*
|
||||
* This file is part of CyaSSL.
|
||||
*
|
||||
* CyaSSL is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* CyaSSL is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
*/
|
||||
|
||||
|
||||
/* code submitted by raphael.huck@efixo.com */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
#ifndef NO_SHA256
|
||||
|
||||
#include <cyassl/ctaocrypt/sha256.h>
|
||||
#ifdef NO_INLINE
|
||||
#include <cyassl/ctaocrypt/misc.h>
|
||||
#else
|
||||
#include <ctaocrypt/src/misc.c>
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef min
|
||||
|
||||
static INLINE word32 min(word32 a, word32 b)
|
||||
{
|
||||
return a > b ? b : a;
|
||||
}
|
||||
|
||||
#endif /* min */
|
||||
|
||||
|
||||
void InitSha256(Sha256* sha256)
|
||||
{
|
||||
sha256->digest[0] = 0x6A09E667L;
|
||||
sha256->digest[1] = 0xBB67AE85L;
|
||||
sha256->digest[2] = 0x3C6EF372L;
|
||||
sha256->digest[3] = 0xA54FF53AL;
|
||||
sha256->digest[4] = 0x510E527FL;
|
||||
sha256->digest[5] = 0x9B05688CL;
|
||||
sha256->digest[6] = 0x1F83D9ABL;
|
||||
sha256->digest[7] = 0x5BE0CD19L;
|
||||
|
||||
sha256->buffLen = 0;
|
||||
sha256->loLen = 0;
|
||||
sha256->hiLen = 0;
|
||||
}
|
||||
|
||||
static const word32 K[64] = {
|
||||
0x428A2F98L, 0x71374491L, 0xB5C0FBCFL, 0xE9B5DBA5L, 0x3956C25BL,
|
||||
0x59F111F1L, 0x923F82A4L, 0xAB1C5ED5L, 0xD807AA98L, 0x12835B01L,
|
||||
0x243185BEL, 0x550C7DC3L, 0x72BE5D74L, 0x80DEB1FEL, 0x9BDC06A7L,
|
||||
0xC19BF174L, 0xE49B69C1L, 0xEFBE4786L, 0x0FC19DC6L, 0x240CA1CCL,
|
||||
0x2DE92C6FL, 0x4A7484AAL, 0x5CB0A9DCL, 0x76F988DAL, 0x983E5152L,
|
||||
0xA831C66DL, 0xB00327C8L, 0xBF597FC7L, 0xC6E00BF3L, 0xD5A79147L,
|
||||
0x06CA6351L, 0x14292967L, 0x27B70A85L, 0x2E1B2138L, 0x4D2C6DFCL,
|
||||
0x53380D13L, 0x650A7354L, 0x766A0ABBL, 0x81C2C92EL, 0x92722C85L,
|
||||
0xA2BFE8A1L, 0xA81A664BL, 0xC24B8B70L, 0xC76C51A3L, 0xD192E819L,
|
||||
0xD6990624L, 0xF40E3585L, 0x106AA070L, 0x19A4C116L, 0x1E376C08L,
|
||||
0x2748774CL, 0x34B0BCB5L, 0x391C0CB3L, 0x4ED8AA4AL, 0x5B9CCA4FL,
|
||||
0x682E6FF3L, 0x748F82EEL, 0x78A5636FL, 0x84C87814L, 0x8CC70208L,
|
||||
0x90BEFFFAL, 0xA4506CEBL, 0xBEF9A3F7L, 0xC67178F2L
|
||||
};
|
||||
|
||||
#define Ch(x,y,z) (z ^ (x & (y ^ z)))
|
||||
#define Maj(x,y,z) (((x | y) & z) | (x & y))
|
||||
#define S(x, n) rotrFixed(x, n)
|
||||
#define R(x, n) (((x)&0xFFFFFFFFL)>>(n))
|
||||
#define Sigma0(x) (S(x, 2) ^ S(x, 13) ^ S(x, 22))
|
||||
#define Sigma1(x) (S(x, 6) ^ S(x, 11) ^ S(x, 25))
|
||||
#define Gamma0(x) (S(x, 7) ^ S(x, 18) ^ R(x, 3))
|
||||
#define Gamma1(x) (S(x, 17) ^ S(x, 19) ^ R(x, 10))
|
||||
|
||||
#define RND(a,b,c,d,e,f,g,h,i) \
|
||||
t0 = h + Sigma1(e) + Ch(e, f, g) + K[i] + W[i]; \
|
||||
t1 = Sigma0(a) + Maj(a, b, c); \
|
||||
d += t0; \
|
||||
h = t0 + t1;
|
||||
|
||||
|
||||
static void Transform(Sha256* sha256)
|
||||
{
|
||||
word32 S[8], W[64], t0, t1;
|
||||
int i;
|
||||
|
||||
/* Copy context->state[] to working vars */
|
||||
for (i = 0; i < 8; i++)
|
||||
S[i] = sha256->digest[i];
|
||||
|
||||
for (i = 0; i < 16; i++)
|
||||
W[i] = sha256->buffer[i];
|
||||
|
||||
for (i = 16; i < 64; i++)
|
||||
W[i] = Gamma1(W[i-2]) + W[i-7] + Gamma0(W[i-15]) + W[i-16];
|
||||
|
||||
for (i = 0; i < 64; i += 8) {
|
||||
RND(S[0],S[1],S[2],S[3],S[4],S[5],S[6],S[7],i+0);
|
||||
RND(S[7],S[0],S[1],S[2],S[3],S[4],S[5],S[6],i+1);
|
||||
RND(S[6],S[7],S[0],S[1],S[2],S[3],S[4],S[5],i+2);
|
||||
RND(S[5],S[6],S[7],S[0],S[1],S[2],S[3],S[4],i+3);
|
||||
RND(S[4],S[5],S[6],S[7],S[0],S[1],S[2],S[3],i+4);
|
||||
RND(S[3],S[4],S[5],S[6],S[7],S[0],S[1],S[2],i+5);
|
||||
RND(S[2],S[3],S[4],S[5],S[6],S[7],S[0],S[1],i+6);
|
||||
RND(S[1],S[2],S[3],S[4],S[5],S[6],S[7],S[0],i+7);
|
||||
}
|
||||
|
||||
/* Add the working vars back into digest state[] */
|
||||
for (i = 0; i < 8; i++) {
|
||||
sha256->digest[i] += S[i];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static INLINE void AddLength(Sha256* sha256, word32 len)
|
||||
{
|
||||
word32 tmp = sha256->loLen;
|
||||
if ( (sha256->loLen += len) < tmp)
|
||||
sha256->hiLen++; /* carry low to high */
|
||||
}
|
||||
|
||||
|
||||
void Sha256Update(Sha256* sha256, const byte* data, word32 len)
|
||||
{
|
||||
/* do block size increments */
|
||||
byte* local = (byte*)sha256->buffer;
|
||||
|
||||
while (len) {
|
||||
word32 add = min(len, SHA256_BLOCK_SIZE - sha256->buffLen);
|
||||
XMEMCPY(&local[sha256->buffLen], data, add);
|
||||
|
||||
sha256->buffLen += add;
|
||||
data += add;
|
||||
len -= add;
|
||||
|
||||
if (sha256->buffLen == SHA256_BLOCK_SIZE) {
|
||||
#ifdef LITTLE_ENDIAN_ORDER
|
||||
ByteReverseBytes(local, local, SHA256_BLOCK_SIZE);
|
||||
#endif
|
||||
Transform(sha256);
|
||||
AddLength(sha256, SHA256_BLOCK_SIZE);
|
||||
sha256->buffLen = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void Sha256Final(Sha256* sha256, byte* hash)
|
||||
{
|
||||
byte* local = (byte*)sha256->buffer;
|
||||
|
||||
AddLength(sha256, sha256->buffLen); /* before adding pads */
|
||||
|
||||
local[sha256->buffLen++] = 0x80; /* add 1 */
|
||||
|
||||
/* pad with zeros */
|
||||
if (sha256->buffLen > SHA256_PAD_SIZE) {
|
||||
XMEMSET(&local[sha256->buffLen], 0, SHA256_BLOCK_SIZE - sha256->buffLen);
|
||||
sha256->buffLen += SHA256_BLOCK_SIZE - sha256->buffLen;
|
||||
|
||||
#ifdef LITTLE_ENDIAN_ORDER
|
||||
ByteReverseBytes(local, local, SHA256_BLOCK_SIZE);
|
||||
#endif
|
||||
Transform(sha256);
|
||||
sha256->buffLen = 0;
|
||||
}
|
||||
XMEMSET(&local[sha256->buffLen], 0, SHA256_PAD_SIZE - sha256->buffLen);
|
||||
|
||||
/* put lengths in bits */
|
||||
sha256->hiLen = (sha256->loLen >> (8*sizeof(sha256->loLen) - 3)) +
|
||||
(sha256->hiLen << 3);
|
||||
sha256->loLen = sha256->loLen << 3;
|
||||
|
||||
/* store lengths */
|
||||
#ifdef LITTLE_ENDIAN_ORDER
|
||||
ByteReverseBytes(local, local, SHA256_BLOCK_SIZE);
|
||||
#endif
|
||||
/* ! length ordering dependent on digest endian type ! */
|
||||
XMEMCPY(&local[SHA256_PAD_SIZE], &sha256->hiLen, sizeof(word32));
|
||||
XMEMCPY(&local[SHA256_PAD_SIZE + sizeof(word32)], &sha256->loLen,
|
||||
sizeof(word32));
|
||||
|
||||
Transform(sha256);
|
||||
#ifdef LITTLE_ENDIAN_ORDER
|
||||
ByteReverseWords(sha256->digest, sha256->digest, SHA256_DIGEST_SIZE);
|
||||
#endif
|
||||
XMEMCPY(hash, sha256->digest, SHA256_DIGEST_SIZE);
|
||||
|
||||
InitSha256(sha256); /* reset state */
|
||||
}
|
||||
|
||||
|
||||
#endif /* NO_SHA256 */
|
||||
|
||||
@@ -1,386 +0,0 @@
|
||||
/* sha512.c
|
||||
*
|
||||
* Copyright (C) 2006-2012 Sawtooth Consulting Ltd.
|
||||
*
|
||||
* This file is part of CyaSSL.
|
||||
*
|
||||
* CyaSSL is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* CyaSSL is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef CYASSL_SHA512
|
||||
|
||||
#include <cyassl/ctaocrypt/sha512.h>
|
||||
#ifdef NO_INLINE
|
||||
#include <cyassl/ctaocrypt/misc.h>
|
||||
#else
|
||||
#include <ctaocrypt/src/misc.c>
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef min
|
||||
|
||||
static INLINE word32 min(word32 a, word32 b)
|
||||
{
|
||||
return a > b ? b : a;
|
||||
}
|
||||
|
||||
#endif /* min */
|
||||
|
||||
|
||||
void InitSha512(Sha512* sha512)
|
||||
{
|
||||
sha512->digest[0] = W64LIT(0x6a09e667f3bcc908);
|
||||
sha512->digest[1] = W64LIT(0xbb67ae8584caa73b);
|
||||
sha512->digest[2] = W64LIT(0x3c6ef372fe94f82b);
|
||||
sha512->digest[3] = W64LIT(0xa54ff53a5f1d36f1);
|
||||
sha512->digest[4] = W64LIT(0x510e527fade682d1);
|
||||
sha512->digest[5] = W64LIT(0x9b05688c2b3e6c1f);
|
||||
sha512->digest[6] = W64LIT(0x1f83d9abfb41bd6b);
|
||||
sha512->digest[7] = W64LIT(0x5be0cd19137e2179);
|
||||
|
||||
sha512->buffLen = 0;
|
||||
sha512->loLen = 0;
|
||||
sha512->hiLen = 0;
|
||||
}
|
||||
|
||||
|
||||
static const word64 K512[80] = {
|
||||
W64LIT(0x428a2f98d728ae22), W64LIT(0x7137449123ef65cd),
|
||||
W64LIT(0xb5c0fbcfec4d3b2f), W64LIT(0xe9b5dba58189dbbc),
|
||||
W64LIT(0x3956c25bf348b538), W64LIT(0x59f111f1b605d019),
|
||||
W64LIT(0x923f82a4af194f9b), W64LIT(0xab1c5ed5da6d8118),
|
||||
W64LIT(0xd807aa98a3030242), W64LIT(0x12835b0145706fbe),
|
||||
W64LIT(0x243185be4ee4b28c), W64LIT(0x550c7dc3d5ffb4e2),
|
||||
W64LIT(0x72be5d74f27b896f), W64LIT(0x80deb1fe3b1696b1),
|
||||
W64LIT(0x9bdc06a725c71235), W64LIT(0xc19bf174cf692694),
|
||||
W64LIT(0xe49b69c19ef14ad2), W64LIT(0xefbe4786384f25e3),
|
||||
W64LIT(0x0fc19dc68b8cd5b5), W64LIT(0x240ca1cc77ac9c65),
|
||||
W64LIT(0x2de92c6f592b0275), W64LIT(0x4a7484aa6ea6e483),
|
||||
W64LIT(0x5cb0a9dcbd41fbd4), W64LIT(0x76f988da831153b5),
|
||||
W64LIT(0x983e5152ee66dfab), W64LIT(0xa831c66d2db43210),
|
||||
W64LIT(0xb00327c898fb213f), W64LIT(0xbf597fc7beef0ee4),
|
||||
W64LIT(0xc6e00bf33da88fc2), W64LIT(0xd5a79147930aa725),
|
||||
W64LIT(0x06ca6351e003826f), W64LIT(0x142929670a0e6e70),
|
||||
W64LIT(0x27b70a8546d22ffc), W64LIT(0x2e1b21385c26c926),
|
||||
W64LIT(0x4d2c6dfc5ac42aed), W64LIT(0x53380d139d95b3df),
|
||||
W64LIT(0x650a73548baf63de), W64LIT(0x766a0abb3c77b2a8),
|
||||
W64LIT(0x81c2c92e47edaee6), W64LIT(0x92722c851482353b),
|
||||
W64LIT(0xa2bfe8a14cf10364), W64LIT(0xa81a664bbc423001),
|
||||
W64LIT(0xc24b8b70d0f89791), W64LIT(0xc76c51a30654be30),
|
||||
W64LIT(0xd192e819d6ef5218), W64LIT(0xd69906245565a910),
|
||||
W64LIT(0xf40e35855771202a), W64LIT(0x106aa07032bbd1b8),
|
||||
W64LIT(0x19a4c116b8d2d0c8), W64LIT(0x1e376c085141ab53),
|
||||
W64LIT(0x2748774cdf8eeb99), W64LIT(0x34b0bcb5e19b48a8),
|
||||
W64LIT(0x391c0cb3c5c95a63), W64LIT(0x4ed8aa4ae3418acb),
|
||||
W64LIT(0x5b9cca4f7763e373), W64LIT(0x682e6ff3d6b2b8a3),
|
||||
W64LIT(0x748f82ee5defb2fc), W64LIT(0x78a5636f43172f60),
|
||||
W64LIT(0x84c87814a1f0ab72), W64LIT(0x8cc702081a6439ec),
|
||||
W64LIT(0x90befffa23631e28), W64LIT(0xa4506cebde82bde9),
|
||||
W64LIT(0xbef9a3f7b2c67915), W64LIT(0xc67178f2e372532b),
|
||||
W64LIT(0xca273eceea26619c), W64LIT(0xd186b8c721c0c207),
|
||||
W64LIT(0xeada7dd6cde0eb1e), W64LIT(0xf57d4f7fee6ed178),
|
||||
W64LIT(0x06f067aa72176fba), W64LIT(0x0a637dc5a2c898a6),
|
||||
W64LIT(0x113f9804bef90dae), W64LIT(0x1b710b35131c471b),
|
||||
W64LIT(0x28db77f523047d84), W64LIT(0x32caab7b40c72493),
|
||||
W64LIT(0x3c9ebe0a15c9bebc), W64LIT(0x431d67c49c100d4c),
|
||||
W64LIT(0x4cc5d4becb3e42b6), W64LIT(0x597f299cfc657e2a),
|
||||
W64LIT(0x5fcb6fab3ad6faec), W64LIT(0x6c44198c4a475817)
|
||||
};
|
||||
|
||||
|
||||
#define blk0(i) (W[i] = sha512->buffer[i])
|
||||
#define blk2(i) (W[i&15]+=s1(W[(i-2)&15])+W[(i-7)&15]+s0(W[(i-15)&15]))
|
||||
|
||||
#define Ch(x,y,z) (z^(x&(y^z)))
|
||||
#define Maj(x,y,z) ((x&y)|(z&(x|y)))
|
||||
|
||||
#define a(i) T[(0-i)&7]
|
||||
#define b(i) T[(1-i)&7]
|
||||
#define c(i) T[(2-i)&7]
|
||||
#define d(i) T[(3-i)&7]
|
||||
#define e(i) T[(4-i)&7]
|
||||
#define f(i) T[(5-i)&7]
|
||||
#define g(i) T[(6-i)&7]
|
||||
#define h(i) T[(7-i)&7]
|
||||
|
||||
#define S0(x) (rotrFixed64(x,28)^rotrFixed64(x,34)^rotrFixed64(x,39))
|
||||
#define S1(x) (rotrFixed64(x,14)^rotrFixed64(x,18)^rotrFixed64(x,41))
|
||||
#define s0(x) (rotrFixed64(x,1)^rotrFixed64(x,8)^(x>>7))
|
||||
#define s1(x) (rotrFixed64(x,19)^rotrFixed64(x,61)^(x>>6))
|
||||
|
||||
#define R(i) h(i)+=S1(e(i))+Ch(e(i),f(i),g(i))+K[i+j]+(j?blk2(i):blk0(i));\
|
||||
d(i)+=h(i);h(i)+=S0(a(i))+Maj(a(i),b(i),c(i))
|
||||
|
||||
#define blk384(i) (W[i] = sha384->buffer[i])
|
||||
|
||||
#define R2(i) h(i)+=S1(e(i))+Ch(e(i),f(i),g(i))+K[i+j]+(j?blk2(i):blk384(i));\
|
||||
d(i)+=h(i);h(i)+=S0(a(i))+Maj(a(i),b(i),c(i))
|
||||
|
||||
|
||||
static void Transform(Sha512* sha512)
|
||||
{
|
||||
const word64* K = K512;
|
||||
|
||||
word32 j;
|
||||
word64 W[16];
|
||||
word64 T[8];
|
||||
|
||||
/* Copy digest to working vars */
|
||||
XMEMCPY(T, sha512->digest, sizeof(T));
|
||||
|
||||
/* 64 operations, partially loop unrolled */
|
||||
for (j = 0; j < 80; j += 16) {
|
||||
R( 0); R( 1); R( 2); R( 3);
|
||||
R( 4); R( 5); R( 6); R( 7);
|
||||
R( 8); R( 9); R(10); R(11);
|
||||
R(12); R(13); R(14); R(15);
|
||||
}
|
||||
|
||||
/* Add the working vars back into digest */
|
||||
|
||||
sha512->digest[0] += a(0);
|
||||
sha512->digest[1] += b(0);
|
||||
sha512->digest[2] += c(0);
|
||||
sha512->digest[3] += d(0);
|
||||
sha512->digest[4] += e(0);
|
||||
sha512->digest[5] += f(0);
|
||||
sha512->digest[6] += g(0);
|
||||
sha512->digest[7] += h(0);
|
||||
|
||||
/* Wipe variables */
|
||||
XMEMSET(W, 0, sizeof(W));
|
||||
XMEMSET(T, 0, sizeof(T));
|
||||
}
|
||||
|
||||
|
||||
static INLINE void AddLength(Sha512* sha512, word32 len)
|
||||
{
|
||||
word32 tmp = sha512->loLen;
|
||||
if ( (sha512->loLen += len) < tmp)
|
||||
sha512->hiLen++; /* carry low to high */
|
||||
}
|
||||
|
||||
|
||||
void Sha512Update(Sha512* sha512, const byte* data, word32 len)
|
||||
{
|
||||
/* do block size increments */
|
||||
byte* local = (byte*)sha512->buffer;
|
||||
|
||||
while (len) {
|
||||
word32 add = min(len, SHA512_BLOCK_SIZE - sha512->buffLen);
|
||||
XMEMCPY(&local[sha512->buffLen], data, add);
|
||||
|
||||
sha512->buffLen += add;
|
||||
data += add;
|
||||
len -= add;
|
||||
|
||||
if (sha512->buffLen == SHA512_BLOCK_SIZE) {
|
||||
#ifdef LITTLE_ENDIAN_ORDER
|
||||
ByteReverseWords64(sha512->buffer, sha512->buffer,
|
||||
SHA512_BLOCK_SIZE);
|
||||
#endif
|
||||
Transform(sha512);
|
||||
AddLength(sha512, SHA512_BLOCK_SIZE);
|
||||
sha512->buffLen = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void Sha512Final(Sha512* sha512, byte* hash)
|
||||
{
|
||||
byte* local = (byte*)sha512->buffer;
|
||||
|
||||
AddLength(sha512, sha512->buffLen); /* before adding pads */
|
||||
|
||||
local[sha512->buffLen++] = 0x80; /* add 1 */
|
||||
|
||||
/* pad with zeros */
|
||||
if (sha512->buffLen > SHA512_PAD_SIZE) {
|
||||
XMEMSET(&local[sha512->buffLen], 0, SHA512_BLOCK_SIZE -sha512->buffLen);
|
||||
sha512->buffLen += SHA512_BLOCK_SIZE - sha512->buffLen;
|
||||
|
||||
#ifdef LITTLE_ENDIAN_ORDER
|
||||
ByteReverseWords64(sha512->buffer,sha512->buffer,SHA512_BLOCK_SIZE);
|
||||
#endif
|
||||
Transform(sha512);
|
||||
sha512->buffLen = 0;
|
||||
}
|
||||
XMEMSET(&local[sha512->buffLen], 0, SHA512_PAD_SIZE - sha512->buffLen);
|
||||
|
||||
/* put lengths in bits */
|
||||
sha512->hiLen = (sha512->loLen >> (8*sizeof(sha512->loLen) - 3)) +
|
||||
(sha512->hiLen << 3);
|
||||
sha512->loLen = sha512->loLen << 3;
|
||||
|
||||
/* store lengths */
|
||||
#ifdef LITTLE_ENDIAN_ORDER
|
||||
ByteReverseWords64(sha512->buffer, sha512->buffer, SHA512_PAD_SIZE);
|
||||
#endif
|
||||
/* ! length ordering dependent on digest endian type ! */
|
||||
sha512->buffer[SHA512_BLOCK_SIZE / sizeof(word64) - 2] = sha512->hiLen;
|
||||
sha512->buffer[SHA512_BLOCK_SIZE / sizeof(word64) - 1] = sha512->loLen;
|
||||
|
||||
Transform(sha512);
|
||||
#ifdef LITTLE_ENDIAN_ORDER
|
||||
ByteReverseWords64(sha512->digest, sha512->digest, SHA512_DIGEST_SIZE);
|
||||
#endif
|
||||
XMEMCPY(hash, sha512->digest, SHA512_DIGEST_SIZE);
|
||||
|
||||
InitSha512(sha512); /* reset state */
|
||||
}
|
||||
|
||||
|
||||
|
||||
#ifdef CYASSL_SHA384
|
||||
|
||||
void InitSha384(Sha384* sha384)
|
||||
{
|
||||
sha384->digest[0] = W64LIT(0xcbbb9d5dc1059ed8);
|
||||
sha384->digest[1] = W64LIT(0x629a292a367cd507);
|
||||
sha384->digest[2] = W64LIT(0x9159015a3070dd17);
|
||||
sha384->digest[3] = W64LIT(0x152fecd8f70e5939);
|
||||
sha384->digest[4] = W64LIT(0x67332667ffc00b31);
|
||||
sha384->digest[5] = W64LIT(0x8eb44a8768581511);
|
||||
sha384->digest[6] = W64LIT(0xdb0c2e0d64f98fa7);
|
||||
sha384->digest[7] = W64LIT(0x47b5481dbefa4fa4);
|
||||
|
||||
sha384->buffLen = 0;
|
||||
sha384->loLen = 0;
|
||||
sha384->hiLen = 0;
|
||||
}
|
||||
|
||||
|
||||
static void Transform384(Sha384* sha384)
|
||||
{
|
||||
const word64* K = K512;
|
||||
|
||||
word32 j;
|
||||
word64 W[16];
|
||||
word64 T[8];
|
||||
|
||||
/* Copy digest to working vars */
|
||||
XMEMCPY(T, sha384->digest, sizeof(T));
|
||||
|
||||
/* 64 operations, partially loop unrolled */
|
||||
for (j = 0; j < 80; j += 16) {
|
||||
R2( 0); R2( 1); R2( 2); R2( 3);
|
||||
R2( 4); R2( 5); R2( 6); R2( 7);
|
||||
R2( 8); R2( 9); R2(10); R2(11);
|
||||
R2(12); R2(13); R2(14); R2(15);
|
||||
}
|
||||
|
||||
/* Add the working vars back into digest */
|
||||
|
||||
sha384->digest[0] += a(0);
|
||||
sha384->digest[1] += b(0);
|
||||
sha384->digest[2] += c(0);
|
||||
sha384->digest[3] += d(0);
|
||||
sha384->digest[4] += e(0);
|
||||
sha384->digest[5] += f(0);
|
||||
sha384->digest[6] += g(0);
|
||||
sha384->digest[7] += h(0);
|
||||
|
||||
/* Wipe variables */
|
||||
XMEMSET(W, 0, sizeof(W));
|
||||
XMEMSET(T, 0, sizeof(T));
|
||||
}
|
||||
|
||||
|
||||
static INLINE void AddLength384(Sha384* sha384, word32 len)
|
||||
{
|
||||
word32 tmp = sha384->loLen;
|
||||
if ( (sha384->loLen += len) < tmp)
|
||||
sha384->hiLen++; /* carry low to high */
|
||||
}
|
||||
|
||||
|
||||
void Sha384Update(Sha384* sha384, const byte* data, word32 len)
|
||||
{
|
||||
/* do block size increments */
|
||||
byte* local = (byte*)sha384->buffer;
|
||||
|
||||
while (len) {
|
||||
word32 add = min(len, SHA384_BLOCK_SIZE - sha384->buffLen);
|
||||
XMEMCPY(&local[sha384->buffLen], data, add);
|
||||
|
||||
sha384->buffLen += add;
|
||||
data += add;
|
||||
len -= add;
|
||||
|
||||
if (sha384->buffLen == SHA384_BLOCK_SIZE) {
|
||||
#ifdef LITTLE_ENDIAN_ORDER
|
||||
ByteReverseWords64(sha384->buffer, sha384->buffer,
|
||||
SHA384_BLOCK_SIZE);
|
||||
#endif
|
||||
Transform384(sha384);
|
||||
AddLength384(sha384, SHA384_BLOCK_SIZE);
|
||||
sha384->buffLen = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void Sha384Final(Sha384* sha384, byte* hash)
|
||||
{
|
||||
byte* local = (byte*)sha384->buffer;
|
||||
|
||||
AddLength384(sha384, sha384->buffLen); /* before adding pads */
|
||||
|
||||
local[sha384->buffLen++] = 0x80; /* add 1 */
|
||||
|
||||
/* pad with zeros */
|
||||
if (sha384->buffLen > SHA384_PAD_SIZE) {
|
||||
XMEMSET(&local[sha384->buffLen], 0, SHA384_BLOCK_SIZE -sha384->buffLen);
|
||||
sha384->buffLen += SHA384_BLOCK_SIZE - sha384->buffLen;
|
||||
|
||||
#ifdef LITTLE_ENDIAN_ORDER
|
||||
ByteReverseWords64(sha384->buffer,sha384->buffer,SHA384_BLOCK_SIZE);
|
||||
#endif
|
||||
Transform384(sha384);
|
||||
sha384->buffLen = 0;
|
||||
}
|
||||
XMEMSET(&local[sha384->buffLen], 0, SHA384_PAD_SIZE - sha384->buffLen);
|
||||
|
||||
/* put lengths in bits */
|
||||
sha384->hiLen = (sha384->loLen >> (8*sizeof(sha384->loLen) - 3)) +
|
||||
(sha384->hiLen << 3);
|
||||
sha384->loLen = sha384->loLen << 3;
|
||||
|
||||
/* store lengths */
|
||||
#ifdef LITTLE_ENDIAN_ORDER
|
||||
ByteReverseWords64(sha384->buffer, sha384->buffer, SHA384_PAD_SIZE);
|
||||
#endif
|
||||
/* ! length ordering dependent on digest endian type ! */
|
||||
sha384->buffer[SHA384_BLOCK_SIZE / sizeof(word64) - 2] = sha384->hiLen;
|
||||
sha384->buffer[SHA384_BLOCK_SIZE / sizeof(word64) - 1] = sha384->loLen;
|
||||
|
||||
Transform384(sha384);
|
||||
#ifdef LITTLE_ENDIAN_ORDER
|
||||
ByteReverseWords64(sha384->digest, sha384->digest, SHA384_DIGEST_SIZE);
|
||||
#endif
|
||||
XMEMCPY(hash, sha384->digest, SHA384_DIGEST_SIZE);
|
||||
|
||||
InitSha384(sha384); /* reset state */
|
||||
}
|
||||
|
||||
#endif /* CYASSL_SHA384 */
|
||||
|
||||
#endif /* CYASSL_SHA512 */
|
||||
@@ -1,9 +0,0 @@
|
||||
# vim:ft=automake
|
||||
# All paths should be given relative to the root
|
||||
|
||||
noinst_PROGRAMS+= ctaocrypt/test/testctaocrypt
|
||||
ctaocrypt_test_testctaocrypt_SOURCES = ctaocrypt/test/test.c
|
||||
ctaocrypt_test_testctaocrypt_LDADD = src/libcyassl.la
|
||||
ctaocrypt_test_testctaocrypt_DEPENDENCIES = src/libcyassl.la
|
||||
EXTRA_DIST += ctaocrypt/test/test.sln
|
||||
EXTRA_DIST += ctaocrypt/test/test.vcproj
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,379 +0,0 @@
|
||||
// !$*UTF8*$!
|
||||
{
|
||||
archiveVersion = 1;
|
||||
classes = {
|
||||
};
|
||||
objectVersion = 45;
|
||||
objects = {
|
||||
|
||||
/* Begin PBXBuildFile section */
|
||||
43809E9B0FB7AD1C0050922E /* md4.c in Sources */ = {isa = PBXBuildFile; fileRef = 43809E9A0FB7AD1C0050922E /* md4.c */; };
|
||||
43962ADF0DE7ED48003C5E5B /* ssl.c in Sources */ = {isa = PBXBuildFile; fileRef = 43C6C2790DDF984100F2D488 /* ssl.c */; };
|
||||
439B3820136B391E004C965E /* logging.c in Sources */ = {isa = PBXBuildFile; fileRef = 439B381F136B391E004C965E /* logging.c */; };
|
||||
43B89CBD142FEB5E00284CC6 /* internal.c in Sources */ = {isa = PBXBuildFile; fileRef = 43B89CBC142FEB5E00284CC6 /* internal.c */; };
|
||||
43B89CBF142FEB6C00284CC6 /* io.c in Sources */ = {isa = PBXBuildFile; fileRef = 43B89CBE142FEB6C00284CC6 /* io.c */; };
|
||||
43B89CC5142FEBBD00284CC6 /* memory.c in Sources */ = {isa = PBXBuildFile; fileRef = 43B89CC0142FEBBD00284CC6 /* memory.c */; };
|
||||
43B89CC6142FEBBD00284CC6 /* tfm.c in Sources */ = {isa = PBXBuildFile; fileRef = 43B89CC1142FEBBD00284CC6 /* tfm.c */; };
|
||||
43B89CC7142FEBBD00284CC6 /* ripemd.c in Sources */ = {isa = PBXBuildFile; fileRef = 43B89CC2142FEBBD00284CC6 /* ripemd.c */; };
|
||||
43B89CC8142FEBBD00284CC6 /* sha512.c in Sources */ = {isa = PBXBuildFile; fileRef = 43B89CC3142FEBBD00284CC6 /* sha512.c */; };
|
||||
43B89CC9142FEBBD00284CC6 /* pwdbased.c in Sources */ = {isa = PBXBuildFile; fileRef = 43B89CC4142FEBBD00284CC6 /* pwdbased.c */; };
|
||||
43C6C27C0DDF984100F2D488 /* keys.c in Sources */ = {isa = PBXBuildFile; fileRef = 43C6C2780DDF984100F2D488 /* keys.c */; };
|
||||
43C6C27E0DDF984100F2D488 /* tls.c in Sources */ = {isa = PBXBuildFile; fileRef = 43C6C27A0DDF984100F2D488 /* tls.c */; };
|
||||
43C6C2920DDF98D400F2D488 /* aes.c in Sources */ = {isa = PBXBuildFile; fileRef = 43C6C2830DDF98D400F2D488 /* aes.c */; };
|
||||
43C6C2930DDF98D400F2D488 /* arc4.c in Sources */ = {isa = PBXBuildFile; fileRef = 43C6C2840DDF98D400F2D488 /* arc4.c */; };
|
||||
43C6C2940DDF98D400F2D488 /* asn.c in Sources */ = {isa = PBXBuildFile; fileRef = 43C6C2850DDF98D400F2D488 /* asn.c */; };
|
||||
43C6C2950DDF98D400F2D488 /* coding.c in Sources */ = {isa = PBXBuildFile; fileRef = 43C6C2860DDF98D400F2D488 /* coding.c */; };
|
||||
43C6C2960DDF98D400F2D488 /* des3.c in Sources */ = {isa = PBXBuildFile; fileRef = 43C6C2870DDF98D400F2D488 /* des3.c */; };
|
||||
43C6C2970DDF98D400F2D488 /* dh.c in Sources */ = {isa = PBXBuildFile; fileRef = 43C6C2880DDF98D400F2D488 /* dh.c */; };
|
||||
43C6C2980DDF98D400F2D488 /* dsa.c in Sources */ = {isa = PBXBuildFile; fileRef = 43C6C2890DDF98D400F2D488 /* dsa.c */; };
|
||||
43C6C2990DDF98D400F2D488 /* hmac.c in Sources */ = {isa = PBXBuildFile; fileRef = 43C6C28A0DDF98D400F2D488 /* hmac.c */; };
|
||||
43C6C29A0DDF98D400F2D488 /* integer.c in Sources */ = {isa = PBXBuildFile; fileRef = 43C6C28B0DDF98D400F2D488 /* integer.c */; };
|
||||
43C6C29B0DDF98D400F2D488 /* md5.c in Sources */ = {isa = PBXBuildFile; fileRef = 43C6C28C0DDF98D400F2D488 /* md5.c */; };
|
||||
43C6C29D0DDF98D400F2D488 /* random.c in Sources */ = {isa = PBXBuildFile; fileRef = 43C6C28E0DDF98D400F2D488 /* random.c */; };
|
||||
43C6C29E0DDF98D400F2D488 /* rsa.c in Sources */ = {isa = PBXBuildFile; fileRef = 43C6C28F0DDF98D400F2D488 /* rsa.c */; };
|
||||
43C6C29F0DDF98D400F2D488 /* sha.c in Sources */ = {isa = PBXBuildFile; fileRef = 43C6C2900DDF98D400F2D488 /* sha.c */; };
|
||||
43C6C2A00DDF98D400F2D488 /* sha256.c in Sources */ = {isa = PBXBuildFile; fileRef = 43C6C2910DDF98D400F2D488 /* sha256.c */; };
|
||||
43D565650F1EC9A600550C88 /* hc128.c in Sources */ = {isa = PBXBuildFile; fileRef = 43D565640F1EC9A600550C88 /* hc128.c */; };
|
||||
43D565670F1EC9CC00550C88 /* rabbit.c in Sources */ = {isa = PBXBuildFile; fileRef = 43D565660F1EC9CC00550C88 /* rabbit.c */; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXCopyFilesBuildPhase section */
|
||||
43C6C3160DDFAC6A00F2D488 /* CopyFiles */ = {
|
||||
isa = PBXCopyFilesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
dstPath = "";
|
||||
dstSubfolderSpec = 7;
|
||||
files = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
43C6C3170DDFAC6A00F2D488 /* CopyFiles */ = {
|
||||
isa = PBXCopyFilesBuildPhase;
|
||||
buildActionMask = 8;
|
||||
dstPath = "";
|
||||
dstSubfolderSpec = 7;
|
||||
files = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 1;
|
||||
};
|
||||
43C6C3180DDFAC6A00F2D488 /* CopyFiles */ = {
|
||||
isa = PBXCopyFilesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
dstPath = "";
|
||||
dstSubfolderSpec = 7;
|
||||
files = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXCopyFilesBuildPhase section */
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
4368F6E40E9EA1140002A123 /* test.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; lineEnding = 2; name = test.c; path = ctaocrypt/test/test.c; sourceTree = "<group>"; };
|
||||
43809E9A0FB7AD1C0050922E /* md4.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = md4.c; path = ctaocrypt/src/md4.c; sourceTree = "<group>"; };
|
||||
439B381F136B391E004C965E /* logging.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = logging.c; path = ctaocrypt/src/logging.c; sourceTree = "<group>"; };
|
||||
43B89CBC142FEB5E00284CC6 /* internal.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = internal.c; path = src/internal.c; sourceTree = "<group>"; };
|
||||
43B89CBE142FEB6C00284CC6 /* io.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = io.c; path = src/io.c; sourceTree = "<group>"; };
|
||||
43B89CC0142FEBBD00284CC6 /* memory.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = memory.c; path = ctaocrypt/src/memory.c; sourceTree = "<group>"; };
|
||||
43B89CC1142FEBBD00284CC6 /* tfm.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = tfm.c; path = ctaocrypt/src/tfm.c; sourceTree = "<group>"; };
|
||||
43B89CC2142FEBBD00284CC6 /* ripemd.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = ripemd.c; path = ctaocrypt/src/ripemd.c; sourceTree = "<group>"; };
|
||||
43B89CC3142FEBBD00284CC6 /* sha512.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = sha512.c; path = ctaocrypt/src/sha512.c; sourceTree = "<group>"; };
|
||||
43B89CC4142FEBBD00284CC6 /* pwdbased.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = pwdbased.c; path = ctaocrypt/src/pwdbased.c; sourceTree = "<group>"; };
|
||||
43C6C2780DDF984100F2D488 /* keys.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; lineEnding = 2; name = keys.c; path = src/keys.c; sourceTree = "<group>"; };
|
||||
43C6C2790DDF984100F2D488 /* ssl.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; lineEnding = 0; name = ssl.c; path = src/ssl.c; sourceTree = "<group>"; };
|
||||
43C6C27A0DDF984100F2D488 /* tls.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; lineEnding = 2; name = tls.c; path = src/tls.c; sourceTree = "<group>"; };
|
||||
43C6C2830DDF98D400F2D488 /* aes.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; lineEnding = 2; name = aes.c; path = ctaocrypt/src/aes.c; sourceTree = "<group>"; };
|
||||
43C6C2840DDF98D400F2D488 /* arc4.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; lineEnding = 2; name = arc4.c; path = ctaocrypt/src/arc4.c; sourceTree = "<group>"; };
|
||||
43C6C2850DDF98D400F2D488 /* asn.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; lineEnding = 2; name = asn.c; path = ctaocrypt/src/asn.c; sourceTree = "<group>"; };
|
||||
43C6C2860DDF98D400F2D488 /* coding.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; lineEnding = 2; name = coding.c; path = ctaocrypt/src/coding.c; sourceTree = "<group>"; };
|
||||
43C6C2870DDF98D400F2D488 /* des3.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; lineEnding = 2; name = des3.c; path = ctaocrypt/src/des3.c; sourceTree = "<group>"; };
|
||||
43C6C2880DDF98D400F2D488 /* dh.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; lineEnding = 2; name = dh.c; path = ctaocrypt/src/dh.c; sourceTree = "<group>"; };
|
||||
43C6C2890DDF98D400F2D488 /* dsa.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; lineEnding = 2; name = dsa.c; path = ctaocrypt/src/dsa.c; sourceTree = "<group>"; };
|
||||
43C6C28A0DDF98D400F2D488 /* hmac.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; lineEnding = 0; name = hmac.c; path = ctaocrypt/src/hmac.c; sourceTree = "<group>"; };
|
||||
43C6C28B0DDF98D400F2D488 /* integer.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; lineEnding = 2; name = integer.c; path = ctaocrypt/src/integer.c; sourceTree = "<group>"; };
|
||||
43C6C28C0DDF98D400F2D488 /* md5.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; lineEnding = 2; name = md5.c; path = ctaocrypt/src/md5.c; sourceTree = "<group>"; };
|
||||
43C6C28E0DDF98D400F2D488 /* random.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; lineEnding = 2; name = random.c; path = ctaocrypt/src/random.c; sourceTree = "<group>"; };
|
||||
43C6C28F0DDF98D400F2D488 /* rsa.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; lineEnding = 2; name = rsa.c; path = ctaocrypt/src/rsa.c; sourceTree = "<group>"; };
|
||||
43C6C2900DDF98D400F2D488 /* sha.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; lineEnding = 2; name = sha.c; path = ctaocrypt/src/sha.c; sourceTree = "<group>"; };
|
||||
43C6C2910DDF98D400F2D488 /* sha256.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; lineEnding = 0; name = sha256.c; path = ctaocrypt/src/sha256.c; sourceTree = "<group>"; };
|
||||
43CB530D116E9FD5000A264B /* iphone-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "iphone-Info.plist"; sourceTree = "<group>"; };
|
||||
43D565640F1EC9A600550C88 /* hc128.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; lineEnding = 2; name = hc128.c; path = ctaocrypt/src/hc128.c; sourceTree = "<group>"; };
|
||||
43D565660F1EC9CC00550C88 /* rabbit.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; lineEnding = 2; name = rabbit.c; path = ctaocrypt/src/rabbit.c; sourceTree = "<group>"; };
|
||||
D2AAC046055464E500DB518D /* libcyassl.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libcyassl.a; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXFrameworksBuildPhase section */
|
||||
D289987405E68DCB004EDB86 /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXFrameworksBuildPhase section */
|
||||
|
||||
/* Begin PBXGroup section */
|
||||
08FB7794FE84155DC02AAC07 /* cyassl */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
08FB7795FE84155DC02AAC07 /* Source */,
|
||||
C6A0FF2B0290797F04C91782 /* Documentation */,
|
||||
1AB674ADFE9D54B511CA2CBB /* Products */,
|
||||
43CB530D116E9FD5000A264B /* iphone-Info.plist */,
|
||||
);
|
||||
name = cyassl;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
08FB7795FE84155DC02AAC07 /* Source */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
43CA25B90EA400A60011ECA2 /* headers */,
|
||||
43CA25720EA3F9B20011ECA2 /* src */,
|
||||
);
|
||||
name = Source;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
1AB674ADFE9D54B511CA2CBB /* Products */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
D2AAC046055464E500DB518D /* libcyassl.a */,
|
||||
);
|
||||
name = Products;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
43CA25720EA3F9B20011ECA2 /* src */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
43B89CC0142FEBBD00284CC6 /* memory.c */,
|
||||
43B89CC1142FEBBD00284CC6 /* tfm.c */,
|
||||
43B89CC2142FEBBD00284CC6 /* ripemd.c */,
|
||||
43B89CC3142FEBBD00284CC6 /* sha512.c */,
|
||||
43B89CC4142FEBBD00284CC6 /* pwdbased.c */,
|
||||
43B89CBE142FEB6C00284CC6 /* io.c */,
|
||||
43B89CBC142FEB5E00284CC6 /* internal.c */,
|
||||
439B381F136B391E004C965E /* logging.c */,
|
||||
43809E9A0FB7AD1C0050922E /* md4.c */,
|
||||
43D565660F1EC9CC00550C88 /* rabbit.c */,
|
||||
43D565640F1EC9A600550C88 /* hc128.c */,
|
||||
43C6C2830DDF98D400F2D488 /* aes.c */,
|
||||
43C6C2840DDF98D400F2D488 /* arc4.c */,
|
||||
43C6C2850DDF98D400F2D488 /* asn.c */,
|
||||
43C6C2860DDF98D400F2D488 /* coding.c */,
|
||||
43C6C2870DDF98D400F2D488 /* des3.c */,
|
||||
4368F6E40E9EA1140002A123 /* test.c */,
|
||||
43C6C2880DDF98D400F2D488 /* dh.c */,
|
||||
43C6C2890DDF98D400F2D488 /* dsa.c */,
|
||||
43C6C28A0DDF98D400F2D488 /* hmac.c */,
|
||||
43C6C28B0DDF98D400F2D488 /* integer.c */,
|
||||
43C6C28C0DDF98D400F2D488 /* md5.c */,
|
||||
43C6C28E0DDF98D400F2D488 /* random.c */,
|
||||
43C6C28F0DDF98D400F2D488 /* rsa.c */,
|
||||
43C6C2900DDF98D400F2D488 /* sha.c */,
|
||||
43C6C2910DDF98D400F2D488 /* sha256.c */,
|
||||
43C6C2780DDF984100F2D488 /* keys.c */,
|
||||
43C6C2790DDF984100F2D488 /* ssl.c */,
|
||||
43C6C27A0DDF984100F2D488 /* tls.c */,
|
||||
);
|
||||
name = src;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
43CA25B90EA400A60011ECA2 /* headers */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
);
|
||||
name = headers;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
C6A0FF2B0290797F04C91782 /* Documentation */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
);
|
||||
name = Documentation;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
/* End PBXGroup section */
|
||||
|
||||
/* Begin PBXHeadersBuildPhase section */
|
||||
D2AAC043055464E500DB518D /* Headers */ = {
|
||||
isa = PBXHeadersBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXHeadersBuildPhase section */
|
||||
|
||||
/* Begin PBXNativeTarget section */
|
||||
D2AAC045055464E500DB518D /* cyassl */ = {
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = 1DEB91EB08733DB70010E9CD /* Build configuration list for PBXNativeTarget "cyassl" */;
|
||||
buildPhases = (
|
||||
D2AAC043055464E500DB518D /* Headers */,
|
||||
D2AAC044055464E500DB518D /* Sources */,
|
||||
D289987405E68DCB004EDB86 /* Frameworks */,
|
||||
43C6C3160DDFAC6A00F2D488 /* CopyFiles */,
|
||||
43C6C3170DDFAC6A00F2D488 /* CopyFiles */,
|
||||
43C6C3180DDFAC6A00F2D488 /* CopyFiles */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
dependencies = (
|
||||
);
|
||||
name = cyassl;
|
||||
productName = cyassl;
|
||||
productReference = D2AAC046055464E500DB518D /* libcyassl.a */;
|
||||
productType = "com.apple.product-type.library.static";
|
||||
};
|
||||
/* End PBXNativeTarget section */
|
||||
|
||||
/* Begin PBXProject section */
|
||||
08FB7793FE84155DC02AAC07 /* Project object */ = {
|
||||
isa = PBXProject;
|
||||
attributes = {
|
||||
BuildIndependentTargetsInParallel = YES;
|
||||
};
|
||||
buildConfigurationList = 1DEB91EF08733DB70010E9CD /* Build configuration list for PBXProject "cyassl-iphone" */;
|
||||
compatibilityVersion = "Xcode 3.1";
|
||||
developmentRegion = English;
|
||||
hasScannedForEncodings = 1;
|
||||
knownRegions = (
|
||||
English,
|
||||
Japanese,
|
||||
French,
|
||||
German,
|
||||
);
|
||||
mainGroup = 08FB7794FE84155DC02AAC07 /* cyassl */;
|
||||
projectDirPath = "";
|
||||
projectRoot = "";
|
||||
targets = (
|
||||
D2AAC045055464E500DB518D /* cyassl */,
|
||||
);
|
||||
};
|
||||
/* End PBXProject section */
|
||||
|
||||
/* Begin PBXSourcesBuildPhase section */
|
||||
D2AAC044055464E500DB518D /* Sources */ = {
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
43C6C27C0DDF984100F2D488 /* keys.c in Sources */,
|
||||
43C6C27E0DDF984100F2D488 /* tls.c in Sources */,
|
||||
43C6C2920DDF98D400F2D488 /* aes.c in Sources */,
|
||||
43C6C2930DDF98D400F2D488 /* arc4.c in Sources */,
|
||||
43C6C2940DDF98D400F2D488 /* asn.c in Sources */,
|
||||
43C6C2950DDF98D400F2D488 /* coding.c in Sources */,
|
||||
43C6C2960DDF98D400F2D488 /* des3.c in Sources */,
|
||||
43C6C2970DDF98D400F2D488 /* dh.c in Sources */,
|
||||
43C6C2980DDF98D400F2D488 /* dsa.c in Sources */,
|
||||
43C6C2990DDF98D400F2D488 /* hmac.c in Sources */,
|
||||
43C6C29A0DDF98D400F2D488 /* integer.c in Sources */,
|
||||
43C6C29B0DDF98D400F2D488 /* md5.c in Sources */,
|
||||
43C6C29D0DDF98D400F2D488 /* random.c in Sources */,
|
||||
43C6C29E0DDF98D400F2D488 /* rsa.c in Sources */,
|
||||
43C6C29F0DDF98D400F2D488 /* sha.c in Sources */,
|
||||
43C6C2A00DDF98D400F2D488 /* sha256.c in Sources */,
|
||||
43962ADF0DE7ED48003C5E5B /* ssl.c in Sources */,
|
||||
43D565650F1EC9A600550C88 /* hc128.c in Sources */,
|
||||
43D565670F1EC9CC00550C88 /* rabbit.c in Sources */,
|
||||
43809E9B0FB7AD1C0050922E /* md4.c in Sources */,
|
||||
439B3820136B391E004C965E /* logging.c in Sources */,
|
||||
43B89CBD142FEB5E00284CC6 /* internal.c in Sources */,
|
||||
43B89CBF142FEB6C00284CC6 /* io.c in Sources */,
|
||||
43B89CC5142FEBBD00284CC6 /* memory.c in Sources */,
|
||||
43B89CC6142FEBBD00284CC6 /* tfm.c in Sources */,
|
||||
43B89CC7142FEBBD00284CC6 /* ripemd.c in Sources */,
|
||||
43B89CC8142FEBBD00284CC6 /* sha512.c in Sources */,
|
||||
43B89CC9142FEBBD00284CC6 /* pwdbased.c in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXSourcesBuildPhase section */
|
||||
|
||||
/* Begin XCBuildConfiguration section */
|
||||
1DEB91EC08733DB70010E9CD /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ARCHS = "$(ARCHS_STANDARD_32_BIT)";
|
||||
COPY_PHASE_STRIP = NO;
|
||||
GCC_DYNAMIC_NO_PIC = NO;
|
||||
GCC_ENABLE_FIX_AND_CONTINUE = YES;
|
||||
GCC_MODEL_TUNING = G5;
|
||||
GCC_OPTIMIZATION_LEVEL = 0;
|
||||
GCC_PREPROCESSOR_DEFINITIONS = IPHONE;
|
||||
HEADER_SEARCH_PATHS = $SRCROOT;
|
||||
INSTALL_PATH = /usr/local/lib;
|
||||
PRODUCT_NAME = cyassl;
|
||||
SDKROOT = iphoneos;
|
||||
USER_HEADER_SEARCH_PATHS = "";
|
||||
WARNING_CFLAGS = "-Wall";
|
||||
ZERO_LINK = YES;
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
1DEB91ED08733DB70010E9CD /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ARCHS = "$(ARCHS_STANDARD_32_BIT)";
|
||||
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
||||
GCC_MODEL_TUNING = G5;
|
||||
GCC_PREPROCESSOR_DEFINITIONS = IPHONE;
|
||||
HEADER_SEARCH_PATHS = $SRCROOT;
|
||||
INSTALL_PATH = /usr/local/lib;
|
||||
PRODUCT_NAME = cyassl;
|
||||
USER_HEADER_SEARCH_PATHS = "";
|
||||
WARNING_CFLAGS = "-Wall";
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
1DEB91F008733DB70010E9CD /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ARCHS = "$(ARCHS_STANDARD_32_BIT)";
|
||||
GCC_PREPROCESSOR_DEFINITIONS = IPHONE;
|
||||
GCC_VERSION = 4.2;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
PREBINDING = NO;
|
||||
SDKROOT = iphoneos;
|
||||
USER_HEADER_SEARCH_PATHS = "include ctaocrypt/include";
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
1DEB91F108733DB70010E9CD /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ARCHS = "$(ARCHS_STANDARD_32_BIT)";
|
||||
GCC_PREPROCESSOR_DEFINITIONS = IPHONE;
|
||||
GCC_VERSION = 4.2;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
PREBINDING = NO;
|
||||
SDKROOT = iphonesimulator2.2;
|
||||
USER_HEADER_SEARCH_PATHS = "include ctaocrypt/include";
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
/* End XCBuildConfiguration section */
|
||||
|
||||
/* Begin XCConfigurationList section */
|
||||
1DEB91EB08733DB70010E9CD /* Build configuration list for PBXNativeTarget "cyassl" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
1DEB91EC08733DB70010E9CD /* Debug */,
|
||||
1DEB91ED08733DB70010E9CD /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
1DEB91EF08733DB70010E9CD /* Build configuration list for PBXProject "cyassl-iphone" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
1DEB91F008733DB70010E9CD /* Debug */,
|
||||
1DEB91F108733DB70010E9CD /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
/* End XCConfigurationList section */
|
||||
};
|
||||
rootObject = 08FB7793FE84155DC02AAC07 /* Project object */;
|
||||
}
|
||||
@@ -1,65 +0,0 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 10.00
|
||||
# Visual C++ Express 2008
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cyassl", "cyassl-ntru.vcproj", "{73973223-5EE8-41CA-8E88-1D60E89A237B}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testsuite", "testsuite\testsuite-ntru.vcproj", "{611E8971-46E0-4D0A-B5A1-632C3B00CB80}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{73973223-5EE8-41CA-8E88-1D60E89A237B} = {73973223-5EE8-41CA-8E88-1D60E89A237B}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "echoserver", "examples\echoserver\echoserver-ntru.vcproj", "{07D97C48-E08F-4E34-9F67-3064039FF2CB}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{73973223-5EE8-41CA-8E88-1D60E89A237B} = {73973223-5EE8-41CA-8E88-1D60E89A237B}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "echoclient", "examples\echoclient\echoclient-ntru.vcproj", "{8362A816-C5DC-4E22-B5C5-9E6806387073}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{73973223-5EE8-41CA-8E88-1D60E89A237B} = {73973223-5EE8-41CA-8E88-1D60E89A237B}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "client", "examples\client\client-ntru.vcproj", "{3ADE9549-582D-4D8E-9826-B172197A7959}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{73973223-5EE8-41CA-8E88-1D60E89A237B} = {73973223-5EE8-41CA-8E88-1D60E89A237B}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "server", "examples\server\server-ntru.vcproj", "{E9FB0BA5-BA46-4A59-A953-39C18CD1DCB1}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{73973223-5EE8-41CA-8E88-1D60E89A237B} = {73973223-5EE8-41CA-8E88-1D60E89A237B}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Win32 = Debug|Win32
|
||||
Release|Win32 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{73973223-5EE8-41CA-8E88-1D60E89A237B}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{73973223-5EE8-41CA-8E88-1D60E89A237B}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{73973223-5EE8-41CA-8E88-1D60E89A237B}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{73973223-5EE8-41CA-8E88-1D60E89A237B}.Release|Win32.Build.0 = Release|Win32
|
||||
{611E8971-46E0-4D0A-B5A1-632C3B00CB80}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{611E8971-46E0-4D0A-B5A1-632C3B00CB80}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{611E8971-46E0-4D0A-B5A1-632C3B00CB80}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{611E8971-46E0-4D0A-B5A1-632C3B00CB80}.Release|Win32.Build.0 = Release|Win32
|
||||
{07D97C48-E08F-4E34-9F67-3064039FF2CB}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{07D97C48-E08F-4E34-9F67-3064039FF2CB}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{07D97C48-E08F-4E34-9F67-3064039FF2CB}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{07D97C48-E08F-4E34-9F67-3064039FF2CB}.Release|Win32.Build.0 = Release|Win32
|
||||
{8362A816-C5DC-4E22-B5C5-9E6806387073}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{8362A816-C5DC-4E22-B5C5-9E6806387073}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{8362A816-C5DC-4E22-B5C5-9E6806387073}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{8362A816-C5DC-4E22-B5C5-9E6806387073}.Release|Win32.Build.0 = Release|Win32
|
||||
{3ADE9549-582D-4D8E-9826-B172197A7959}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{3ADE9549-582D-4D8E-9826-B172197A7959}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{3ADE9549-582D-4D8E-9826-B172197A7959}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{3ADE9549-582D-4D8E-9826-B172197A7959}.Release|Win32.Build.0 = Release|Win32
|
||||
{E9FB0BA5-BA46-4A59-A953-39C18CD1DCB1}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{E9FB0BA5-BA46-4A59-A953-39C18CD1DCB1}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{E9FB0BA5-BA46-4A59-A953-39C18CD1DCB1}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{E9FB0BA5-BA46-4A59-A953-39C18CD1DCB1}.Release|Win32.Build.0 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
@@ -1,285 +0,0 @@
|
||||
<?xml version="1.0" encoding="Windows-1252"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="9.00"
|
||||
Name="cyassl"
|
||||
ProjectGUID="{73973223-5EE8-41CA-8E88-1D60E89A237B}"
|
||||
RootNamespace="cyassl"
|
||||
Keyword="Win32Proj"
|
||||
TargetFrameworkVersion="196613"
|
||||
>
|
||||
<Platforms>
|
||||
<Platform
|
||||
Name="Win32"
|
||||
/>
|
||||
</Platforms>
|
||||
<ToolFiles>
|
||||
</ToolFiles>
|
||||
<Configurations>
|
||||
<Configuration
|
||||
Name="Debug|Win32"
|
||||
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
|
||||
IntermediateDirectory="$(ConfigurationName)"
|
||||
ConfigurationType="4"
|
||||
CharacterSet="1"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="./;NTRU/include"
|
||||
PreprocessorDefinitions="OPENSSL_EXTRA;CYASSL_RIPEMD;CYASSL_SHA512;HAVE_NTRU;NO_PSK;WIN32"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="3"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="3"
|
||||
DebugInformationFormat="4"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLibrarianTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release|Win32"
|
||||
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
|
||||
IntermediateDirectory="$(ConfigurationName)"
|
||||
ConfigurationType="4"
|
||||
CharacterSet="1"
|
||||
WholeProgramOptimization="1"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
EnableIntrinsicFunctions="true"
|
||||
AdditionalIncludeDirectories="./;NTRU/include"
|
||||
PreprocessorDefinitions="OPENSSL_EXTRA;CYASSL_RIPEMD;CYASSL_SHA512;HAVE_NTRU;NO_PSK;WIN32"
|
||||
RuntimeLibrary="2"
|
||||
EnableFunctionLevelLinking="true"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="3"
|
||||
DebugInformationFormat="3"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLibrarianTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
</Configurations>
|
||||
<References>
|
||||
</References>
|
||||
<Files>
|
||||
<Filter
|
||||
Name="Source Files"
|
||||
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
|
||||
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
|
||||
>
|
||||
<File
|
||||
RelativePath=".\ctaocrypt\src\aes.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\ctaocrypt\src\arc4.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\ctaocrypt\src\asm.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\ctaocrypt\src\asn.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\ctaocrypt\src\coding.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\ctaocrypt\src\des3.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\ctaocrypt\src\dh.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\ctaocrypt\src\dsa.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\ctaocrypt\src\hc128.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\ctaocrypt\src\hmac.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\ctaocrypt\src\integer.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\internal.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\io.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\keys.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\ctaocrypt\src\logging.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\ctaocrypt\src\md4.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\ctaocrypt\src\md5.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\ctaocrypt\src\memory.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\ctaocrypt\src\misc.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\ctaocrypt\src\pwdbased.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\ctaocrypt\src\rabbit.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\ctaocrypt\src\random.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\ctaocrypt\src\ripemd.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\ctaocrypt\src\rsa.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\ctaocrypt\src\sha.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\ctaocrypt\src\sha256.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\ctaocrypt\src\sha512.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\ssl.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\tls.c"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Header Files"
|
||||
Filter="h;hpp;hxx;hm;inl;inc;xsd"
|
||||
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
|
||||
>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Resource Files"
|
||||
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
|
||||
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
|
||||
>
|
||||
</Filter>
|
||||
</Files>
|
||||
<Globals>
|
||||
</Globals>
|
||||
</VisualStudioProject>
|
||||
@@ -1,74 +0,0 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 10.00
|
||||
# Visual C++ Express 2008
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cyassl", "cyassl.vcproj", "{73973223-5EE8-41CA-8E88-1D60E89A237B}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testsuite", "testsuite\testsuite.vcproj", "{611E8971-46E0-4D0A-B5A1-632C3B00CB80}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{73973223-5EE8-41CA-8E88-1D60E89A237B} = {73973223-5EE8-41CA-8E88-1D60E89A237B}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sslSniffer", "sslSniffer\sslSniffer.vcproj", "{34FAE5A6-2B0F-4B55-86FE-0C43E4810F4D}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{73973223-5EE8-41CA-8E88-1D60E89A237B} = {73973223-5EE8-41CA-8E88-1D60E89A237B}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "echoserver", "examples\echoserver\echoserver.vcproj", "{07D97C48-E08F-4E34-9F67-3064039FF2CB}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{73973223-5EE8-41CA-8E88-1D60E89A237B} = {73973223-5EE8-41CA-8E88-1D60E89A237B}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "echoclient", "examples\echoclient\echoclient.vcproj", "{8362A816-C5DC-4E22-B5C5-9E6806387073}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{73973223-5EE8-41CA-8E88-1D60E89A237B} = {73973223-5EE8-41CA-8E88-1D60E89A237B}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "client", "examples\client\client.vcproj", "{3ADE9549-582D-4D8E-9826-B172197A7959}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{73973223-5EE8-41CA-8E88-1D60E89A237B} = {73973223-5EE8-41CA-8E88-1D60E89A237B}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "server", "examples\server\server.vcproj", "{E9FB0BA5-BA46-4A59-A953-39C18CD1DCB1}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{73973223-5EE8-41CA-8E88-1D60E89A237B} = {73973223-5EE8-41CA-8E88-1D60E89A237B}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Win32 = Debug|Win32
|
||||
Release|Win32 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{73973223-5EE8-41CA-8E88-1D60E89A237B}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{73973223-5EE8-41CA-8E88-1D60E89A237B}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{73973223-5EE8-41CA-8E88-1D60E89A237B}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{73973223-5EE8-41CA-8E88-1D60E89A237B}.Release|Win32.Build.0 = Release|Win32
|
||||
{611E8971-46E0-4D0A-B5A1-632C3B00CB80}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{611E8971-46E0-4D0A-B5A1-632C3B00CB80}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{611E8971-46E0-4D0A-B5A1-632C3B00CB80}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{611E8971-46E0-4D0A-B5A1-632C3B00CB80}.Release|Win32.Build.0 = Release|Win32
|
||||
{34FAE5A6-2B0F-4B55-86FE-0C43E4810F4D}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{34FAE5A6-2B0F-4B55-86FE-0C43E4810F4D}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{34FAE5A6-2B0F-4B55-86FE-0C43E4810F4D}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{34FAE5A6-2B0F-4B55-86FE-0C43E4810F4D}.Release|Win32.Build.0 = Release|Win32
|
||||
{07D97C48-E08F-4E34-9F67-3064039FF2CB}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{07D97C48-E08F-4E34-9F67-3064039FF2CB}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{07D97C48-E08F-4E34-9F67-3064039FF2CB}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{07D97C48-E08F-4E34-9F67-3064039FF2CB}.Release|Win32.Build.0 = Release|Win32
|
||||
{8362A816-C5DC-4E22-B5C5-9E6806387073}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{8362A816-C5DC-4E22-B5C5-9E6806387073}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{8362A816-C5DC-4E22-B5C5-9E6806387073}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{8362A816-C5DC-4E22-B5C5-9E6806387073}.Release|Win32.Build.0 = Release|Win32
|
||||
{3ADE9549-582D-4D8E-9826-B172197A7959}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{3ADE9549-582D-4D8E-9826-B172197A7959}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{3ADE9549-582D-4D8E-9826-B172197A7959}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{3ADE9549-582D-4D8E-9826-B172197A7959}.Release|Win32.Build.0 = Release|Win32
|
||||
{E9FB0BA5-BA46-4A59-A953-39C18CD1DCB1}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{E9FB0BA5-BA46-4A59-A953-39C18CD1DCB1}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{E9FB0BA5-BA46-4A59-A953-39C18CD1DCB1}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{E9FB0BA5-BA46-4A59-A953-39C18CD1DCB1}.Release|Win32.Build.0 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
@@ -1,277 +0,0 @@
|
||||
<?xml version="1.0" encoding="Windows-1252"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="9.00"
|
||||
Name="cyassl"
|
||||
ProjectGUID="{73973223-5EE8-41CA-8E88-1D60E89A237B}"
|
||||
RootNamespace="cyassl"
|
||||
Keyword="Win32Proj"
|
||||
TargetFrameworkVersion="196613"
|
||||
>
|
||||
<Platforms>
|
||||
<Platform
|
||||
Name="Win32"
|
||||
/>
|
||||
</Platforms>
|
||||
<ToolFiles>
|
||||
</ToolFiles>
|
||||
<Configurations>
|
||||
<Configuration
|
||||
Name="Debug|Win32"
|
||||
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
|
||||
IntermediateDirectory="$(ConfigurationName)"
|
||||
ConfigurationType="4"
|
||||
CharacterSet="1"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="./"
|
||||
PreprocessorDefinitions="OPENSSL_EXTRA;CYASSL_RIPEMD;CYASSL_SHA512;NO_PSK"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="3"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="4"
|
||||
DebugInformationFormat="4"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLibrarianTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release|Win32"
|
||||
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
|
||||
IntermediateDirectory="$(ConfigurationName)"
|
||||
ConfigurationType="4"
|
||||
CharacterSet="1"
|
||||
WholeProgramOptimization="1"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
EnableIntrinsicFunctions="true"
|
||||
AdditionalIncludeDirectories="./"
|
||||
PreprocessorDefinitions="OPENSSL_EXTRA;CYASSL_RIPEMD;CYASSL_SHA512;NO_PSK"
|
||||
RuntimeLibrary="2"
|
||||
EnableFunctionLevelLinking="true"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="3"
|
||||
DebugInformationFormat="3"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLibrarianTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
</Configurations>
|
||||
<References>
|
||||
</References>
|
||||
<Files>
|
||||
<Filter
|
||||
Name="Source Files"
|
||||
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
|
||||
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
|
||||
>
|
||||
<File
|
||||
RelativePath=".\ctaocrypt\src\aes.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\ctaocrypt\src\arc4.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\ctaocrypt\src\asn.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\ctaocrypt\src\coding.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\ctaocrypt\src\des3.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\ctaocrypt\src\dh.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\ctaocrypt\src\dsa.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\ctaocrypt\src\hc128.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\ctaocrypt\src\hmac.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\ctaocrypt\src\integer.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\internal.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\io.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\keys.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\ctaocrypt\src\logging.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\ctaocrypt\src\md4.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\ctaocrypt\src\md5.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\ctaocrypt\src\memory.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\ctaocrypt\src\pwdbased.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\ctaocrypt\src\rabbit.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\ctaocrypt\src\random.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\ctaocrypt\src\ripemd.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\ctaocrypt\src\rsa.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\ctaocrypt\src\sha.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\ctaocrypt\src\sha256.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\ctaocrypt\src\sha512.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\ssl.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\tls.c"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Header Files"
|
||||
Filter="h;hpp;hxx;hm;inl;inc;xsd"
|
||||
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
|
||||
>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Resource Files"
|
||||
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
|
||||
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
|
||||
>
|
||||
</Filter>
|
||||
</Files>
|
||||
<Globals>
|
||||
</Globals>
|
||||
</VisualStudioProject>
|
||||
@@ -1,80 +0,0 @@
|
||||
/* cyassl_callbacks.h
|
||||
*
|
||||
* Copyright (C) 2012 Sawtooth Consulting Ltd.
|
||||
*
|
||||
* This file is part of CyaSSL.
|
||||
*
|
||||
* CyaSSL is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* CyaSSL is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
*/
|
||||
|
||||
|
||||
#ifndef CYASSL_CALLBACKS_H
|
||||
#define CYASSL_CALLBACKS_H
|
||||
|
||||
#include <sys/time.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
enum { /* CALLBACK CONTSTANTS */
|
||||
MAX_PACKETNAME_SZ = 24,
|
||||
MAX_CIPHERNAME_SZ = 24,
|
||||
MAX_TIMEOUT_NAME_SZ = 24,
|
||||
MAX_PACKETS_HANDSHAKE = 14, /* 12 for client auth plus 2 alerts */
|
||||
MAX_VALUE_SZ = 128, /* all handshake packets but Cert should
|
||||
fit here */
|
||||
};
|
||||
|
||||
|
||||
typedef struct handShakeInfo_st {
|
||||
char cipherName[MAX_CIPHERNAME_SZ + 1]; /* negotiated cipher */
|
||||
char packetNames[MAX_PACKETS_HANDSHAKE][MAX_PACKETNAME_SZ + 1];
|
||||
/* SSL packet names */
|
||||
int numberPackets; /* actual # of packets */
|
||||
int negotiationError; /* cipher/parameter err */
|
||||
} HandShakeInfo;
|
||||
|
||||
|
||||
typedef struct timeval Timeval;
|
||||
|
||||
|
||||
typedef struct packetInfo_st {
|
||||
char packetName[MAX_PACKETNAME_SZ + 1]; /* SSL packet name */
|
||||
Timeval timestamp; /* when it occured */
|
||||
unsigned char value[MAX_VALUE_SZ]; /* if fits, it's here */
|
||||
unsigned char* bufferValue; /* otherwise here (non 0) */
|
||||
int valueSz; /* sz of value or buffer */
|
||||
} PacketInfo;
|
||||
|
||||
|
||||
typedef struct timeoutInfo_st {
|
||||
char timeoutName[MAX_TIMEOUT_NAME_SZ + 1]; /* timeout Name */
|
||||
int flags; /* for future use */
|
||||
int numberPackets; /* actual # of packets */
|
||||
PacketInfo packets[MAX_PACKETS_HANDSHAKE]; /* list of all packets */
|
||||
Timeval timeoutValue; /* timer that caused it */
|
||||
} TimeoutInfo;
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* CyaSSL_CALLBACKS_H */
|
||||
|
||||
@@ -1,47 +0,0 @@
|
||||
/* crl.h
|
||||
*
|
||||
* Copyright (C) 2006-2012 Sawtooth Consulting Ltd.
|
||||
*
|
||||
* This file is part of CyaSSL.
|
||||
*
|
||||
* CyaSSL is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* CyaSSL is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
*/
|
||||
|
||||
|
||||
#ifndef CYASSL_CRL_H
|
||||
#define CYASSL_CRL_H
|
||||
|
||||
#include <cyassl/ssl.h>
|
||||
#include <cyassl/ctaocrypt/asn.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct CYASSL_CRL CYASSL_CRL;
|
||||
|
||||
CYASSL_LOCAL int InitCRL(CYASSL_CRL*, CYASSL_CERT_MANAGER*);
|
||||
CYASSL_LOCAL void FreeCRL(CYASSL_CRL*);
|
||||
|
||||
CYASSL_LOCAL int LoadCRL(CYASSL_CRL* crl, const char* path, int type, int mon);
|
||||
CYASSL_LOCAL int BufferLoadCRL(CYASSL_CRL*, const byte*, long, int);
|
||||
CYASSL_LOCAL int CheckCertCRL(CYASSL_CRL*, DecodedCert*);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
#endif /* CYASSL_CRL_H */
|
||||
@@ -1,113 +0,0 @@
|
||||
/* aes.h
|
||||
*
|
||||
* Copyright (C) 2006-2012 Sawtooth Consulting Ltd.
|
||||
*
|
||||
* This file is part of CyaSSL.
|
||||
*
|
||||
* CyaSSL is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* CyaSSL is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
*/
|
||||
|
||||
|
||||
#ifndef NO_AES
|
||||
|
||||
#ifndef CTAO_CRYPT_AES_H
|
||||
#define CTAO_CRYPT_AES_H
|
||||
|
||||
|
||||
#include <cyassl/ctaocrypt/types.h>
|
||||
|
||||
#ifdef CYASSL_AESNI
|
||||
|
||||
#include <wmmintrin.h>
|
||||
|
||||
#if !defined (ALIGN16)
|
||||
#if defined (__GNUC__)
|
||||
#define ALIGN16 __attribute__ ( (aligned (16)))
|
||||
#elif defined(_MSC_VER)
|
||||
#define ALIGN16 __declspec (align (16))
|
||||
#else
|
||||
#define ALIGN16
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#endif /* CYASSL_AESNI */
|
||||
|
||||
#if !defined (ALIGN16)
|
||||
#define ALIGN16
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
enum {
|
||||
AES_ENC_TYPE = 1, /* cipher unique type */
|
||||
AES_ENCRYPTION = 0,
|
||||
AES_DECRYPTION = 1,
|
||||
AES_BLOCK_SIZE = 16
|
||||
};
|
||||
|
||||
|
||||
typedef struct Aes {
|
||||
/* AESNI needs key first, rounds 2nd, not sure why yet */
|
||||
ALIGN16 word32 key[60];
|
||||
word32 rounds;
|
||||
|
||||
ALIGN16 word32 reg[AES_BLOCK_SIZE / sizeof(word32)]; /* for CBC mode */
|
||||
ALIGN16 word32 tmp[AES_BLOCK_SIZE / sizeof(word32)]; /* same */
|
||||
|
||||
#ifdef HAVE_AESGCM
|
||||
ALIGN16 byte H[AES_BLOCK_SIZE];
|
||||
#ifdef GCM_TABLE
|
||||
/* key-based fast multiplication table. */
|
||||
ALIGN16 byte M0[256][AES_BLOCK_SIZE];
|
||||
#endif /* GCM_TABLE */
|
||||
#endif /* HAVE_AESGCM */
|
||||
} Aes;
|
||||
|
||||
|
||||
CYASSL_API int AesSetKey(Aes* aes, const byte* key, word32 len, const byte* iv,
|
||||
int dir);
|
||||
CYASSL_API int AesSetIV(Aes* aes, const byte* iv);
|
||||
CYASSL_API void AesCbcEncrypt(Aes* aes, byte* out, const byte* in, word32 sz);
|
||||
CYASSL_API void AesCbcDecrypt(Aes* aes, byte* out, const byte* in, word32 sz);
|
||||
CYASSL_API void AesCtrEncrypt(Aes* aes, byte* out, const byte* in, word32 sz);
|
||||
CYASSL_API void AesEncryptDirect(Aes* aes, byte* out, const byte* in);
|
||||
CYASSL_API void AesDecryptDirect(Aes* aes, byte* out, const byte* in);
|
||||
|
||||
#ifdef HAVE_AESGCM
|
||||
CYASSL_API void AesGcmSetKey(Aes* aes, const byte* key, word32 len,
|
||||
const byte* implicitIV);
|
||||
CYASSL_API void AesGcmSetExpIV(Aes* aes, const byte* iv);
|
||||
CYASSL_API void AesGcmGetExpIV(Aes* aes, byte* iv);
|
||||
CYASSL_API void AesGcmIncExpIV(Aes* aes);
|
||||
CYASSL_API void AesGcmEncrypt(Aes* aes, byte* out, const byte* in, word32 sz,
|
||||
byte* authTag, word32 authTagSz,
|
||||
const byte* authIn, word32 authInSz);
|
||||
CYASSL_API int AesGcmDecrypt(Aes* aes, byte* out, const byte* in, word32 sz,
|
||||
const byte* authTag, word32 authTagSz,
|
||||
const byte* authIn, word32 authInSz);
|
||||
#endif /* HAVE_AESGCM */
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* CTAO_CRYPT_AES_H */
|
||||
#endif /* NO_AES */
|
||||
|
||||
@@ -1,57 +0,0 @@
|
||||
/* arc4.h
|
||||
*
|
||||
* Copyright (C) 2006-2012 Sawtooth Consulting Ltd.
|
||||
*
|
||||
* This file is part of CyaSSL.
|
||||
*
|
||||
* CyaSSL is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* CyaSSL is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
*/
|
||||
|
||||
|
||||
#ifndef CTAO_CRYPT_ARC4_H
|
||||
#define CTAO_CRYPT_ARC4_H
|
||||
|
||||
|
||||
#include <cyassl/ctaocrypt/types.h>
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
enum {
|
||||
ARC4_ENC_TYPE = 4, /* cipher unique type */
|
||||
ARC4_STATE_SIZE = 256
|
||||
};
|
||||
|
||||
/* ARC4 encryption and decryption */
|
||||
typedef struct Arc4 {
|
||||
byte x;
|
||||
byte y;
|
||||
byte state[ARC4_STATE_SIZE];
|
||||
} Arc4;
|
||||
|
||||
CYASSL_API void Arc4Process(Arc4*, byte*, const byte*, word32);
|
||||
CYASSL_API void Arc4SetKey(Arc4*, const byte*, word32);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* CTAO_CRYPT_ARC4_H */
|
||||
|
||||
@@ -1,485 +0,0 @@
|
||||
/* asn.h
|
||||
*
|
||||
* Copyright (C) 2006-2012 Sawtooth Consulting Ltd.
|
||||
*
|
||||
* This file is part of CyaSSL.
|
||||
*
|
||||
* CyaSSL is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* CyaSSL is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
*/
|
||||
|
||||
|
||||
#ifndef CTAO_CRYPT_ASN_H
|
||||
#define CTAO_CRYPT_ASN_H
|
||||
|
||||
#include <cyassl/ctaocrypt/types.h>
|
||||
#include <cyassl/ctaocrypt/rsa.h>
|
||||
#include <cyassl/ctaocrypt/dh.h>
|
||||
#include <cyassl/ctaocrypt/dsa.h>
|
||||
#include <cyassl/ctaocrypt/sha.h>
|
||||
#include <cyassl/ctaocrypt/md5.h>
|
||||
#include <cyassl/ctaocrypt/asn_public.h> /* public interface */
|
||||
#ifdef HAVE_ECC
|
||||
#include <cyassl/ctaocrypt/ecc.h>
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
enum {
|
||||
ISSUER = 0,
|
||||
SUBJECT = 1,
|
||||
|
||||
EXTERNAL_SERIAL_SIZE = 32,
|
||||
|
||||
BEFORE = 0,
|
||||
AFTER = 1
|
||||
};
|
||||
|
||||
/* ASN Tags */
|
||||
enum ASN_Tags {
|
||||
ASN_BOOLEAN = 0x01,
|
||||
ASN_INTEGER = 0x02,
|
||||
ASN_BIT_STRING = 0x03,
|
||||
ASN_OCTET_STRING = 0x04,
|
||||
ASN_TAG_NULL = 0x05,
|
||||
ASN_OBJECT_ID = 0x06,
|
||||
ASN_ENUMERATED = 0x0a,
|
||||
ASN_SEQUENCE = 0x10,
|
||||
ASN_SET = 0x11,
|
||||
ASN_UTC_TIME = 0x17,
|
||||
ASN_DNS_TYPE = 0x02,
|
||||
ASN_GENERALIZED_TIME = 0x18,
|
||||
CRL_EXTENSIONS = 0xa0,
|
||||
ASN_EXTENSIONS = 0xa3,
|
||||
ASN_LONG_LENGTH = 0x80
|
||||
};
|
||||
|
||||
enum ASN_Flags{
|
||||
ASN_CONSTRUCTED = 0x20,
|
||||
ASN_CONTEXT_SPECIFIC = 0x80
|
||||
};
|
||||
|
||||
enum DN_Tags {
|
||||
ASN_COMMON_NAME = 0x03, /* CN */
|
||||
ASN_SUR_NAME = 0x04, /* SN */
|
||||
ASN_COUNTRY_NAME = 0x06, /* C */
|
||||
ASN_LOCALITY_NAME = 0x07, /* L */
|
||||
ASN_STATE_NAME = 0x08, /* ST */
|
||||
ASN_ORG_NAME = 0x0a, /* O */
|
||||
ASN_ORGUNIT_NAME = 0x0b /* OU */
|
||||
};
|
||||
|
||||
enum PBES {
|
||||
PBE_MD5_DES = 0,
|
||||
PBE_SHA1_DES = 1,
|
||||
PBE_SHA1_DES3 = 2,
|
||||
PBE_SHA1_RC4_128 = 3,
|
||||
PBES2 = 13 /* algo ID */
|
||||
};
|
||||
|
||||
enum ENCRYPTION_TYPES {
|
||||
DES_TYPE = 0,
|
||||
DES3_TYPE = 1,
|
||||
RC4_TYPE = 2
|
||||
};
|
||||
|
||||
enum ECC_TYPES {
|
||||
ECC_PREFIX_0 = 160,
|
||||
ECC_PREFIX_1 = 161
|
||||
};
|
||||
|
||||
enum Misc_ASN {
|
||||
ASN_NAME_MAX = 256,
|
||||
MAX_SALT_SIZE = 64, /* MAX PKCS Salt length */
|
||||
MAX_IV_SIZE = 64, /* MAX PKCS Iv length */
|
||||
MAX_KEY_SIZE = 64, /* MAX PKCS Key length */
|
||||
PKCS5 = 5, /* PKCS oid tag */
|
||||
PKCS5v2 = 6, /* PKCS #5 v2.0 */
|
||||
PKCS12 = 12, /* PKCS #12 */
|
||||
MAX_UNICODE_SZ = 256,
|
||||
ASN_BOOL_SIZE = 2, /* including type */
|
||||
SHA_SIZE = 20,
|
||||
RSA_INTS = 8, /* RSA ints in private key */
|
||||
MIN_DATE_SIZE = 13,
|
||||
MAX_DATE_SIZE = 32,
|
||||
ASN_GEN_TIME_SZ = 15, /* 7 numbers * 2 + Zulu tag */
|
||||
MAX_ENCODED_SIG_SZ = 512,
|
||||
MAX_SIG_SZ = 256,
|
||||
MAX_ALGO_SZ = 20,
|
||||
MAX_SEQ_SZ = 5, /* enum(seq | con) + length(4) */
|
||||
MAX_SET_SZ = 5, /* enum(set | con) + length(4) */
|
||||
MAX_VERSION_SZ = 5, /* enum + id + version(byte) + (header(2))*/
|
||||
MAX_ENCODED_DIG_SZ = 73, /* sha512 + enum(bit or octet) + legnth(4) */
|
||||
MAX_RSA_INT_SZ = 517, /* RSA raw sz 4096 for bits + tag + len(4) */
|
||||
MAX_NTRU_KEY_SZ = 610, /* NTRU 112 bit public key */
|
||||
MAX_NTRU_ENC_SZ = 628, /* NTRU 112 bit DER public encoding */
|
||||
MAX_LENGTH_SZ = 4, /* Max length size for DER encoding */
|
||||
MAX_RSA_E_SZ = 16, /* Max RSA public e size */
|
||||
MAX_CA_SZ = 32, /* Max encoded CA basic constraint length */
|
||||
MAX_SN_SZ = 35, /* Max encoded serial number (INT) length */
|
||||
#ifdef CYASSL_CERT_GEN
|
||||
#ifdef CYASSL_ALT_NAMES
|
||||
MAX_EXTENSIONS_SZ = 1 + MAX_LENGTH_SZ + CTC_MAX_ALT_SIZE,
|
||||
#else
|
||||
MAX_EXTENSIONS_SZ = 1 + MAX_LENGTH_SZ + MAX_CA_SZ,
|
||||
#endif
|
||||
/* Max total extensions, id + len + others */
|
||||
#endif
|
||||
MAX_OCSP_EXT_SZ = 58, /* Max OCSP Extension length */
|
||||
MAX_OCSP_NONCE_SZ = 18, /* OCSP Nonce size */
|
||||
MAX_PUBLIC_KEY_SZ = MAX_NTRU_ENC_SZ + MAX_ALGO_SZ + MAX_SEQ_SZ * 2
|
||||
/* use bigger NTRU size */
|
||||
};
|
||||
|
||||
|
||||
enum Oid_Types {
|
||||
hashType = 0,
|
||||
sigType = 1,
|
||||
keyType = 2
|
||||
};
|
||||
|
||||
|
||||
enum Hash_Sum {
|
||||
MD2h = 646,
|
||||
MD5h = 649,
|
||||
SHAh = 88,
|
||||
SHA256h = 414,
|
||||
SHA384h = 415,
|
||||
SHA512h = 416
|
||||
};
|
||||
|
||||
|
||||
enum Key_Sum {
|
||||
DSAk = 515,
|
||||
RSAk = 645,
|
||||
NTRUk = 364,
|
||||
ECDSAk = 518
|
||||
};
|
||||
|
||||
|
||||
enum Ecc_Sum {
|
||||
ECC_256R1 = 526,
|
||||
ECC_384R1 = 210,
|
||||
ECC_521R1 = 211,
|
||||
ECC_160R1 = 184,
|
||||
ECC_192R1 = 520,
|
||||
ECC_224R1 = 209
|
||||
};
|
||||
|
||||
|
||||
enum KDF_Sum {
|
||||
PBKDF2_OID = 660
|
||||
};
|
||||
|
||||
|
||||
enum Extensions_Sum {
|
||||
BASIC_CA_OID = 133,
|
||||
ALT_NAMES_OID = 131,
|
||||
CRL_DIST_OID = 145,
|
||||
AUTH_INFO_OID = 69,
|
||||
CA_ISSUER_OID = 117
|
||||
};
|
||||
|
||||
|
||||
enum VerifyType {
|
||||
NO_VERIFY = 0,
|
||||
VERIFY = 1
|
||||
};
|
||||
|
||||
|
||||
typedef struct DNS_entry DNS_entry;
|
||||
|
||||
struct DNS_entry {
|
||||
DNS_entry* next; /* next on DNS list */
|
||||
char* name; /* actual DNS name */
|
||||
};
|
||||
|
||||
typedef struct DecodedCert DecodedCert;
|
||||
typedef struct Signer Signer;
|
||||
|
||||
|
||||
struct DecodedCert {
|
||||
byte* publicKey;
|
||||
word32 pubKeySize;
|
||||
int pubKeyStored;
|
||||
word32 certBegin; /* offset to start of cert */
|
||||
word32 sigIndex; /* offset to start of signature */
|
||||
word32 sigLength; /* length of signature */
|
||||
word32 signatureOID; /* sum of algorithm object id */
|
||||
word32 keyOID; /* sum of key algo object id */
|
||||
DNS_entry* altNames; /* alt names list of dns entries */
|
||||
byte subjectHash[SHA_SIZE]; /* hash of all Names */
|
||||
byte issuerHash[SHA_SIZE]; /* hash of all Names */
|
||||
#ifdef HAVE_OCSP
|
||||
byte issuerKeyHash[SHA_SIZE]; /* hash of the public Key */
|
||||
#endif /* HAVE_OCSP */
|
||||
byte* signature; /* not owned, points into raw cert */
|
||||
char* subjectCN; /* CommonName */
|
||||
int subjectCNLen;
|
||||
int subjectCNStored; /* have we saved a copy we own */
|
||||
char issuer[ASN_NAME_MAX]; /* full name including common name */
|
||||
char subject[ASN_NAME_MAX]; /* full name including common name */
|
||||
int verify; /* Default to yes, but could be off */
|
||||
byte* source; /* byte buffer holder cert, NOT owner */
|
||||
word32 srcIdx; /* current offset into buffer */
|
||||
word32 maxIdx; /* max offset based on init size */
|
||||
void* heap; /* for user memory overrides */
|
||||
byte serial[EXTERNAL_SERIAL_SIZE]; /* raw serial number */
|
||||
int serialSz; /* raw serial bytes stored */
|
||||
byte* extensions; /* not owned, points into raw cert */
|
||||
int extensionsSz; /* length of cert extensions */
|
||||
word32 extensionsIdx; /* if want to go back and parse later */
|
||||
byte* extAuthInfo; /* Authority Information Access URI */
|
||||
int extAuthInfoSz; /* length of the URI */
|
||||
byte* extCrlInfo; /* CRL Distribution Points */
|
||||
int extCrlInfoSz; /* length of the URI */
|
||||
byte isCA; /* CA basic constraint true */
|
||||
#ifdef CYASSL_CERT_GEN
|
||||
/* easy access to subject info for other sign */
|
||||
char* subjectSN;
|
||||
int subjectSNLen;
|
||||
char* subjectC;
|
||||
int subjectCLen;
|
||||
char* subjectL;
|
||||
int subjectLLen;
|
||||
char* subjectST;
|
||||
int subjectSTLen;
|
||||
char* subjectO;
|
||||
int subjectOLen;
|
||||
char* subjectOU;
|
||||
int subjectOULen;
|
||||
char* subjectEmail;
|
||||
int subjectEmailLen;
|
||||
byte* beforeDate;
|
||||
int beforeDateLen;
|
||||
byte* afterDate;
|
||||
int afterDateLen;
|
||||
#endif /* CYASSL_CERT_GEN */
|
||||
};
|
||||
|
||||
|
||||
/* CA Signers */
|
||||
struct Signer {
|
||||
byte* publicKey;
|
||||
word32 pubKeySize;
|
||||
word32 keyOID; /* key type */
|
||||
char* name; /* common name */
|
||||
byte hash[SHA_DIGEST_SIZE]; /* sha hash of names in certificate */
|
||||
Signer* next;
|
||||
};
|
||||
|
||||
|
||||
/* not for public consumption but may use for testing sometimes */
|
||||
#ifdef CYASSL_TEST_CERT
|
||||
#define CYASSL_TEST_API CYASSL_API
|
||||
#else
|
||||
#define CYASSL_TEST_API CYASSL_LOCAL
|
||||
#endif
|
||||
|
||||
CYASSL_TEST_API void FreeAltNames(DNS_entry*, void*);
|
||||
CYASSL_TEST_API void InitDecodedCert(DecodedCert*, byte*, word32, void*);
|
||||
CYASSL_TEST_API void FreeDecodedCert(DecodedCert*);
|
||||
CYASSL_TEST_API int ParseCert(DecodedCert*, int type, int verify, void* cm);
|
||||
|
||||
CYASSL_LOCAL int ParseCertRelative(DecodedCert*, int type, int verify,void* cm);
|
||||
CYASSL_LOCAL int DecodeToKey(DecodedCert*, int verify);
|
||||
|
||||
CYASSL_LOCAL word32 EncodeSignature(byte* out, const byte* digest, word32 digSz,
|
||||
int hashOID);
|
||||
|
||||
CYASSL_LOCAL Signer* MakeSigner(void*);
|
||||
CYASSL_LOCAL void FreeSigners(Signer*, void*);
|
||||
|
||||
|
||||
CYASSL_LOCAL int ToTraditional(byte* buffer, word32 length);
|
||||
CYASSL_LOCAL int ToTraditionalEnc(byte* buffer, word32 length,const char*, int);
|
||||
|
||||
CYASSL_LOCAL int ValidateDate(const byte* date, byte format, int dateType);
|
||||
|
||||
#ifdef HAVE_ECC
|
||||
/* ASN sig helpers */
|
||||
CYASSL_LOCAL int StoreECC_DSA_Sig(byte* out, word32* outLen, mp_int* r,
|
||||
mp_int* s);
|
||||
CYASSL_LOCAL int DecodeECC_DSA_Sig(const byte* sig, word32 sigLen,
|
||||
mp_int* r, mp_int* s);
|
||||
/* private key helpers */
|
||||
CYASSL_LOCAL int EccPrivateKeyDecode(const byte* input,word32* inOutIdx,
|
||||
ecc_key*,word32);
|
||||
#endif
|
||||
|
||||
#ifdef CYASSL_CERT_GEN
|
||||
|
||||
enum cert_enums {
|
||||
NAME_ENTRIES = 8,
|
||||
JOINT_LEN = 2,
|
||||
EMAIL_JOINT_LEN = 9,
|
||||
RSA_KEY = 10,
|
||||
NTRU_KEY = 11
|
||||
};
|
||||
|
||||
|
||||
#endif /* CYASSL_CERT_GEN */
|
||||
|
||||
|
||||
|
||||
/* for pointer use */
|
||||
typedef struct CertStatus CertStatus;
|
||||
|
||||
#ifdef HAVE_OCSP
|
||||
|
||||
enum Ocsp_Response_Status {
|
||||
OCSP_SUCCESSFUL = 0, /* Response has valid confirmations */
|
||||
OCSP_MALFORMED_REQUEST = 1, /* Illegal confirmation request */
|
||||
OCSP_INTERNAL_ERROR = 2, /* Internal error in issuer */
|
||||
OCSP_TRY_LATER = 3, /* Try again later */
|
||||
OCSP_SIG_REQUIRED = 5, /* Must sign the request (4 is skipped) */
|
||||
OCSP_UNAUTHROIZED = 6 /* Request unauthorized */
|
||||
};
|
||||
|
||||
|
||||
enum Ocsp_Cert_Status {
|
||||
CERT_GOOD = 0,
|
||||
CERT_REVOKED = 1,
|
||||
CERT_UNKNOWN = 2
|
||||
};
|
||||
|
||||
|
||||
enum Ocsp_Sums {
|
||||
OCSP_BASIC_OID = 117,
|
||||
OCSP_NONCE_OID = 118
|
||||
};
|
||||
|
||||
|
||||
typedef struct OcspRequest OcspRequest;
|
||||
typedef struct OcspResponse OcspResponse;
|
||||
|
||||
|
||||
struct CertStatus {
|
||||
CertStatus* next;
|
||||
|
||||
byte serial[EXTERNAL_SERIAL_SIZE];
|
||||
int serialSz;
|
||||
|
||||
int status;
|
||||
|
||||
byte thisDate[MAX_DATE_SIZE];
|
||||
byte nextDate[MAX_DATE_SIZE];
|
||||
byte thisDateFormat;
|
||||
byte nextDateFormat;
|
||||
};
|
||||
|
||||
|
||||
struct OcspResponse {
|
||||
int responseStatus; /* return code from Responder */
|
||||
|
||||
byte* response; /* Pointer to beginning of OCSP Response */
|
||||
word32 responseSz; /* length of the OCSP Response */
|
||||
|
||||
byte producedDate[MAX_DATE_SIZE];
|
||||
/* Date at which this response was signed */
|
||||
byte producedDateFormat; /* format of the producedDate */
|
||||
byte* issuerHash;
|
||||
byte* issuerKeyHash;
|
||||
|
||||
byte* cert;
|
||||
word32 certSz;
|
||||
|
||||
byte* sig; /* Pointer to sig in source */
|
||||
word32 sigSz; /* Length in octets for the sig */
|
||||
word32 sigOID; /* OID for hash used for sig */
|
||||
|
||||
CertStatus* status; /* certificate status to fill out */
|
||||
|
||||
byte* nonce; /* pointer to nonce inside ASN.1 response */
|
||||
int nonceSz; /* length of the nonce string */
|
||||
|
||||
byte* source; /* pointer to source buffer, not owned */
|
||||
word32 maxIdx; /* max offset based on init size */
|
||||
};
|
||||
|
||||
|
||||
struct OcspRequest {
|
||||
DecodedCert* cert;
|
||||
|
||||
byte nonce[MAX_OCSP_NONCE_SZ];
|
||||
int nonceSz;
|
||||
|
||||
byte* issuerHash; /* pointer to issuerHash in source cert */
|
||||
byte* issuerKeyHash; /* pointer to issuerKeyHash in source cert */
|
||||
byte* serial; /* pointer to serial number in source cert */
|
||||
int serialSz; /* length of the serial number */
|
||||
|
||||
byte* dest; /* pointer to the destination ASN.1 buffer */
|
||||
word32 destSz; /* length of the destination buffer */
|
||||
};
|
||||
|
||||
|
||||
CYASSL_LOCAL void InitOcspResponse(OcspResponse*, CertStatus*, byte*, word32);
|
||||
CYASSL_LOCAL int OcspResponseDecode(OcspResponse*);
|
||||
|
||||
CYASSL_LOCAL void InitOcspRequest(OcspRequest*, DecodedCert*, byte*, word32);
|
||||
CYASSL_LOCAL int EncodeOcspRequest(OcspRequest*);
|
||||
|
||||
CYASSL_LOCAL int CompareOcspReqResp(OcspRequest*, OcspResponse*);
|
||||
|
||||
|
||||
#endif /* HAVE_OCSP */
|
||||
|
||||
|
||||
/* for pointer use */
|
||||
typedef struct RevokedCert RevokedCert;
|
||||
|
||||
#ifdef HAVE_CRL
|
||||
|
||||
struct RevokedCert {
|
||||
byte serialNumber[EXTERNAL_SERIAL_SIZE];
|
||||
int serialSz;
|
||||
RevokedCert* next;
|
||||
};
|
||||
|
||||
typedef struct DecodedCRL DecodedCRL;
|
||||
|
||||
struct DecodedCRL {
|
||||
word32 certBegin; /* offset to start of cert */
|
||||
word32 sigIndex; /* offset to start of signature */
|
||||
word32 sigLength; /* length of signature */
|
||||
word32 signatureOID; /* sum of algorithm object id */
|
||||
byte* signature; /* pointer into raw source, not owned */
|
||||
byte issuerHash[SHA_DIGEST_SIZE]; /* issuer hash */
|
||||
byte crlHash[MD5_DIGEST_SIZE]; /* raw crl data hash */
|
||||
byte lastDate[MAX_DATE_SIZE]; /* last date updated */
|
||||
byte nextDate[MAX_DATE_SIZE]; /* next update date */
|
||||
byte lastDateFormat; /* format of last date */
|
||||
byte nextDateFormat; /* format of next date */
|
||||
RevokedCert* certs; /* revoked cert list */
|
||||
int totalCerts; /* number on list */
|
||||
};
|
||||
|
||||
CYASSL_LOCAL void InitDecodedCRL(DecodedCRL*);
|
||||
CYASSL_LOCAL int ParseCRL(DecodedCRL*, const byte* buff, long sz, void* cm);
|
||||
CYASSL_LOCAL void FreeDecodedCRL(DecodedCRL*);
|
||||
|
||||
|
||||
#endif /* HAVE_CRL */
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
#endif /* CTAO_CRYPT_ASN_H */
|
||||
|
||||
@@ -1,155 +0,0 @@
|
||||
/* asn_public.h
|
||||
*
|
||||
* Copyright (C) 2006-2012 Sawtooth Consulting Ltd.
|
||||
*
|
||||
* This file is part of CyaSSL.
|
||||
*
|
||||
* CyaSSL is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* CyaSSL is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
*/
|
||||
|
||||
|
||||
#ifndef CTAO_CRYPT_ASN_PUBLIC_H
|
||||
#define CTAO_CRYPT_ASN_PUBLIC_H
|
||||
|
||||
#include <cyassl/ctaocrypt/types.h>
|
||||
#ifdef CYASSL_CERT_GEN
|
||||
#include <cyassl/ctaocrypt/rsa.h>
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
/* Certificate file Type */
|
||||
enum CertType {
|
||||
CERT_TYPE = 0,
|
||||
PRIVATEKEY_TYPE,
|
||||
DH_PARAM_TYPE,
|
||||
CRL_TYPE,
|
||||
CA_TYPE
|
||||
};
|
||||
|
||||
|
||||
/* Signature type, by OID sum */
|
||||
enum Ctc_SigType {
|
||||
CTC_SHAwDSA = 517,
|
||||
CTC_MD2wRSA = 646,
|
||||
CTC_MD5wRSA = 648,
|
||||
CTC_SHAwRSA = 649,
|
||||
CTC_SHAwECDSA = 520,
|
||||
CTC_SHA256wRSA = 655,
|
||||
CTC_SHA256wECDSA = 524,
|
||||
CTC_SHA384wRSA = 656,
|
||||
CTC_SHA384wECDSA = 525,
|
||||
CTC_SHA512wRSA = 657,
|
||||
CTC_SHA512wECDSA = 526
|
||||
};
|
||||
|
||||
|
||||
#ifdef CYASSL_CERT_GEN
|
||||
|
||||
enum Ctc_Misc {
|
||||
CTC_NAME_SIZE = 64,
|
||||
CTC_DATE_SIZE = 32,
|
||||
CTC_MAX_ALT_SIZE = 8192, /* may be huge */
|
||||
CTC_SERIAL_SIZE = 8
|
||||
};
|
||||
|
||||
typedef struct CertName {
|
||||
char country[CTC_NAME_SIZE];
|
||||
char state[CTC_NAME_SIZE];
|
||||
char locality[CTC_NAME_SIZE];
|
||||
char sur[CTC_NAME_SIZE];
|
||||
char org[CTC_NAME_SIZE];
|
||||
char unit[CTC_NAME_SIZE];
|
||||
char commonName[CTC_NAME_SIZE];
|
||||
char email[CTC_NAME_SIZE]; /* !!!! email has to be last !!!! */
|
||||
} CertName;
|
||||
|
||||
|
||||
/* for user to fill for certificate generation */
|
||||
typedef struct Cert {
|
||||
int version; /* x509 version */
|
||||
byte serial[CTC_SERIAL_SIZE]; /* serial number */
|
||||
int sigType; /* signature algo type */
|
||||
CertName issuer; /* issuer info */
|
||||
int daysValid; /* validity days */
|
||||
int selfSigned; /* self signed flag */
|
||||
CertName subject; /* subject info */
|
||||
int isCA; /* is this going to be a CA */
|
||||
/* internal use only */
|
||||
int bodySz; /* pre sign total size */
|
||||
int keyType; /* public key type of subject */
|
||||
#ifdef CYASSL_ALT_NAMES
|
||||
byte altNames[CTC_MAX_ALT_SIZE]; /* altNames copy */
|
||||
int altNamesSz; /* altNames size in bytes */
|
||||
byte beforeDate[CTC_DATE_SIZE]; /* before date copy */
|
||||
int beforeDateSz; /* size of copy */
|
||||
byte afterDate[CTC_DATE_SIZE]; /* after date copy */
|
||||
int afterDateSz; /* size of copy */
|
||||
#endif
|
||||
} Cert;
|
||||
|
||||
|
||||
|
||||
|
||||
/* Initialize and Set Certficate defaults:
|
||||
version = 3 (0x2)
|
||||
serial = 0 (Will be randomly generated)
|
||||
sigType = SHA_WITH_RSA
|
||||
issuer = blank
|
||||
daysValid = 500
|
||||
selfSigned = 1 (true) use subject as issuer
|
||||
subject = blank
|
||||
isCA = 0 (false)
|
||||
keyType = RSA_KEY (default)
|
||||
*/
|
||||
CYASSL_API void InitCert(Cert*);
|
||||
CYASSL_API int MakeCert(Cert*, byte* derBuffer, word32 derSz, RsaKey*, RNG*);
|
||||
CYASSL_API int SignCert(Cert*, byte* derBuffer, word32 derSz, RsaKey*, RNG*);
|
||||
CYASSL_API int MakeSelfCert(Cert*, byte* derBuffer, word32 derSz, RsaKey*,
|
||||
RNG*);
|
||||
CYASSL_API int SetIssuer(Cert*, const char*);
|
||||
CYASSL_API int SetSubject(Cert*, const char*);
|
||||
#ifdef CYASSL_ALT_NAMES
|
||||
CYASSL_API int SetAltNames(Cert*, const char*);
|
||||
#endif
|
||||
CYASSL_API int SetIssuerBuffer(Cert*, const byte*, int);
|
||||
CYASSL_API int SetSubjectBuffer(Cert*, const byte*, int);
|
||||
CYASSL_API int SetAltNamesBuffer(Cert*, const byte*, int);
|
||||
CYASSL_API int SetDatesBuffer(Cert*, const byte*, int);
|
||||
|
||||
#ifdef HAVE_NTRU
|
||||
CYASSL_API int MakeNtruCert(Cert*, byte* derBuffer, word32 derSz,
|
||||
const byte* ntruKey, word16 keySz, RNG*);
|
||||
#endif
|
||||
|
||||
#endif /* CYASSL_CERT_GEN */
|
||||
|
||||
|
||||
#if defined(CYASSL_KEY_GEN) || defined(CYASSL_CERT_GEN)
|
||||
CYASSL_API int DerToPem(const byte* der, word32 derSz, byte* output,
|
||||
word32 outputSz, int type);
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
#endif /* CTAO_CRYPT_ASN_PUBLIC_H */
|
||||
|
||||
@@ -1,51 +0,0 @@
|
||||
/* coding.h
|
||||
*
|
||||
* Copyright (C) 2006-2012 Sawtooth Consulting Ltd.
|
||||
*
|
||||
* This file is part of CyaSSL.
|
||||
*
|
||||
* CyaSSL is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* CyaSSL is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
*/
|
||||
|
||||
|
||||
#ifndef CTAO_CRYPT_CODING_H
|
||||
#define CTAO_CRYPT_CODING_H
|
||||
|
||||
#include <cyassl/ctaocrypt/types.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
/* decode needed by CyaSSL */
|
||||
CYASSL_LOCAL int Base64_Decode(const byte* in, word32 inLen, byte* out,
|
||||
word32* outLen);
|
||||
|
||||
#if defined(OPENSSL_EXTRA) || defined(SESSION_CERTS) || defined(CYASSL_KEY_GEN) || defined(CYASSL_CERT_GEN) || defined(HAVE_WEBSERVER)
|
||||
/* encode isn't */
|
||||
CYASSL_API
|
||||
int Base64_Encode(const byte* in, word32 inLen, byte* out,
|
||||
word32* outLen);
|
||||
CYASSL_LOCAL
|
||||
int Base16_Decode(const byte* in, word32 inLen, byte* out, word32* outLen);
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
#endif /* CTAO_CRYPT_CODING_H */
|
||||
|
||||
@@ -1,81 +0,0 @@
|
||||
/* des3.h
|
||||
*
|
||||
* Copyright (C) 2006-2012 Sawtooth Consulting Ltd.
|
||||
*
|
||||
* This file is part of CyaSSL.
|
||||
*
|
||||
* CyaSSL is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* CyaSSL is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
*/
|
||||
|
||||
|
||||
#ifndef NO_DES3
|
||||
|
||||
#ifndef CTAO_CRYPT_DES3_H
|
||||
#define CTAO_CRYPT_DES3_H
|
||||
|
||||
|
||||
#include <cyassl/ctaocrypt/types.h>
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
enum {
|
||||
DES_ENC_TYPE = 2, /* cipher unique type */
|
||||
DES3_ENC_TYPE = 3, /* cipher unique type */
|
||||
DES_BLOCK_SIZE = 8,
|
||||
DES_KS_SIZE = 32,
|
||||
|
||||
DES_ENCRYPTION = 0,
|
||||
DES_DECRYPTION = 1,
|
||||
};
|
||||
|
||||
|
||||
/* DES encryption and decryption */
|
||||
typedef struct Des {
|
||||
word32 key[DES_KS_SIZE];
|
||||
word32 reg[DES_BLOCK_SIZE / sizeof(word32)]; /* for CBC mode */
|
||||
word32 tmp[DES_BLOCK_SIZE / sizeof(word32)]; /* same */
|
||||
} Des;
|
||||
|
||||
|
||||
/* DES3 encryption and decryption */
|
||||
typedef struct Des3 {
|
||||
word32 key[3][DES_KS_SIZE];
|
||||
word32 reg[DES_BLOCK_SIZE / sizeof(word32)]; /* for CBC mode */
|
||||
word32 tmp[DES_BLOCK_SIZE / sizeof(word32)]; /* same */
|
||||
} Des3;
|
||||
|
||||
|
||||
CYASSL_API void Des_SetKey(Des* des, const byte* key, const byte* iv, int dir);
|
||||
CYASSL_API void Des_SetIV(Des* des, const byte* iv);
|
||||
CYASSL_API void Des_CbcEncrypt(Des* des, byte* out, const byte* in, word32 sz);
|
||||
CYASSL_API void Des_CbcDecrypt(Des* des, byte* out, const byte* in, word32 sz);
|
||||
CYASSL_API void Des_EcbEncrypt(Des* des, byte* out, const byte* in, word32 sz);
|
||||
|
||||
CYASSL_API void Des3_SetKey(Des3* des, const byte* key, const byte* iv,int dir);
|
||||
CYASSL_API void Des3_SetIV(Des3* des, const byte* iv);
|
||||
CYASSL_API void Des3_CbcEncrypt(Des3* des, byte* out, const byte* in,word32 sz);
|
||||
CYASSL_API void Des3_CbcDecrypt(Des3* des, byte* out, const byte* in,word32 sz);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
#endif /* NO_DES3 */
|
||||
#endif /* CTAO_CRYPT_DES3_H */
|
||||
|
||||
@@ -1,67 +0,0 @@
|
||||
/* dh.h
|
||||
*
|
||||
* Copyright (C) 2006-2012 Sawtooth Consulting Ltd.
|
||||
*
|
||||
* This file is part of CyaSSL.
|
||||
*
|
||||
* CyaSSL is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* CyaSSL is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
*/
|
||||
|
||||
|
||||
#ifndef NO_DH
|
||||
|
||||
#ifndef CTAO_CRYPT_DH_H
|
||||
#define CTAO_CRYPT_DH_H
|
||||
|
||||
#include <cyassl/ctaocrypt/types.h>
|
||||
#include <cyassl/ctaocrypt/integer.h>
|
||||
#include <cyassl/ctaocrypt/random.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
/* Diffie-Hellman Key */
|
||||
typedef struct DhKey {
|
||||
mp_int p, g; /* group parameters */
|
||||
} DhKey;
|
||||
|
||||
|
||||
CYASSL_API void InitDhKey(DhKey* key);
|
||||
CYASSL_API void FreeDhKey(DhKey* key);
|
||||
|
||||
CYASSL_API int DhGenerateKeyPair(DhKey* key, RNG* rng, byte* priv,
|
||||
word32* privSz, byte* pub, word32* pubSz);
|
||||
CYASSL_API int DhAgree(DhKey* key, byte* agree, word32* agreeSz,
|
||||
const byte* priv, word32 privSz, const byte* otherPub,
|
||||
word32 pubSz);
|
||||
|
||||
CYASSL_API int DhKeyDecode(const byte* input, word32* inOutIdx, DhKey* key,
|
||||
word32);
|
||||
CYASSL_API int DhSetKey(DhKey* key, const byte* p, word32 pSz, const byte* g,
|
||||
word32 gSz);
|
||||
CYASSL_API int DhParamsLoad(const byte* input, word32 inSz, byte* p,
|
||||
word32* pInOutSz, byte* g, word32* gInOutSz);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
#endif /* CTAO_CRYPT_DH_H */
|
||||
|
||||
#endif /* NO_DH */
|
||||
|
||||
@@ -1,67 +0,0 @@
|
||||
/* dsa.h
|
||||
*
|
||||
* Copyright (C) 2006-2012 Sawtooth Consulting Ltd.
|
||||
*
|
||||
* This file is part of CyaSSL.
|
||||
*
|
||||
* CyaSSL is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* CyaSSL is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
*/
|
||||
|
||||
|
||||
#ifndef NO_DSA
|
||||
|
||||
#ifndef CTAO_CRYPT_DSA_H
|
||||
#define CTAO_CRYPT_DSA_H
|
||||
|
||||
#include <cyassl/ctaocrypt/types.h>
|
||||
#include <cyassl/ctaocrypt/integer.h>
|
||||
#include <cyassl/ctaocrypt/random.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
enum {
|
||||
DSA_PUBLIC = 0,
|
||||
DSA_PRIVATE = 1
|
||||
};
|
||||
|
||||
/* DSA */
|
||||
typedef struct DsaKey {
|
||||
mp_int p, q, g, y, x;
|
||||
int type; /* public or private */
|
||||
} DsaKey;
|
||||
|
||||
|
||||
CYASSL_API void InitDsaKey(DsaKey* key);
|
||||
CYASSL_API void FreeDsaKey(DsaKey* key);
|
||||
|
||||
CYASSL_API int DsaSign(const byte* digest, byte* out, DsaKey* key, RNG* rng);
|
||||
CYASSL_API int DsaVerify(const byte* digest, const byte* sig, DsaKey* key,
|
||||
int* answer);
|
||||
|
||||
CYASSL_API int DsaPublicKeyDecode(const byte* input, word32* inOutIdx, DsaKey*,
|
||||
word32);
|
||||
CYASSL_API int DsaPrivateKeyDecode(const byte* input, word32* inOutIdx, DsaKey*,
|
||||
word32);
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
#endif /* CTAO_CRYPT_DSA_H */
|
||||
#endif /* NO_DSA */
|
||||
|
||||
@@ -1,129 +0,0 @@
|
||||
/* ecc.h
|
||||
*
|
||||
* Copyright (C) 2006-2012 Sawtooth Consulting Ltd.
|
||||
*
|
||||
* This file is part of CyaSSL.
|
||||
*
|
||||
* CyaSSL is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* CyaSSL is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
*/
|
||||
|
||||
#ifdef HAVE_ECC
|
||||
|
||||
#ifndef CTAO_CRYPT_ECC_H
|
||||
#define CTAO_CRYPT_ECC_H
|
||||
|
||||
#include <cyassl/ctaocrypt/types.h>
|
||||
#include <cyassl/ctaocrypt/integer.h>
|
||||
#include <cyassl/ctaocrypt/random.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
enum {
|
||||
ECC_PUBLICKEY = 1,
|
||||
ECC_PRIVATEKEY = 2,
|
||||
ECC_MAXNAME = 16, /* MAX CURVE NAME LENGTH */
|
||||
SIG_HEADER_SZ = 6, /* ECC signature header size */
|
||||
ECC_BUFSIZE = 256, /* for exported keys temp buffer */
|
||||
ECC_MINSIZE = 20, /* MIN Private Key size */
|
||||
ECC_MAXSIZE = 66 /* MAX Private Key size */
|
||||
};
|
||||
|
||||
|
||||
/* ECC set type defined a NIST GF(p) curve */
|
||||
typedef struct {
|
||||
int size; /* The size of the curve in octets */
|
||||
const char* name; /* name of this curve */
|
||||
const char* prime; /* prime that defines the field, curve is in (hex) */
|
||||
const char* B; /* fields B param (hex) */
|
||||
const char* order; /* order of the curve (hex) */
|
||||
const char* Gx; /* x coordinate of the base point on curve (hex) */
|
||||
const char* Gy; /* y coordinate of the base point on curve (hex) */
|
||||
} ecc_set_type;
|
||||
|
||||
|
||||
/* A point on an ECC curve, stored in Jacbobian format such that (x,y,z) =>
|
||||
(x/z^2, y/z^3, 1) when interpreted as affine */
|
||||
typedef struct {
|
||||
mp_int x; /* The x coordinate */
|
||||
mp_int y; /* The y coordinate */
|
||||
mp_int z; /* The z coordinate */
|
||||
} ecc_point;
|
||||
|
||||
|
||||
/* An ECC Key */
|
||||
typedef struct {
|
||||
int type; /* Public or Private */
|
||||
int idx; /* Index into the ecc_sets[] for the parameters of
|
||||
this curve if -1, this key is using user supplied
|
||||
curve in dp */
|
||||
const ecc_set_type* dp; /* domain parameters, either points to NIST
|
||||
curves (idx >= 0) or user supplied */
|
||||
ecc_point pubkey; /* public key */
|
||||
mp_int k; /* private key */
|
||||
} ecc_key;
|
||||
|
||||
|
||||
/* ECC predefined curve sets */
|
||||
extern const ecc_set_type ecc_sets[];
|
||||
|
||||
|
||||
CYASSL_API
|
||||
int ecc_make_key(RNG* rng, int keysize, ecc_key* key);
|
||||
CYASSL_API
|
||||
int ecc_shared_secret(ecc_key* private_key, ecc_key* public_key, byte* out,
|
||||
word32* outlen);
|
||||
CYASSL_API
|
||||
int ecc_sign_hash(const byte* in, word32 inlen, byte* out, word32 *outlen,
|
||||
RNG* rng, ecc_key* key);
|
||||
CYASSL_API
|
||||
int ecc_verify_hash(const byte* sig, word32 siglen, byte* hash, word32 hashlen,
|
||||
int* stat, ecc_key* key);
|
||||
CYASSL_API
|
||||
void ecc_init(ecc_key* key);
|
||||
CYASSL_API
|
||||
void ecc_free(ecc_key* key);
|
||||
|
||||
|
||||
/* ASN key helpers */
|
||||
CYASSL_API
|
||||
int ecc_export_x963(ecc_key*, byte* out, word32* outLen);
|
||||
CYASSL_API
|
||||
int ecc_import_x963(const byte* in, word32 inLen, ecc_key* key);
|
||||
CYASSL_API
|
||||
int ecc_import_private_key(const byte* priv, word32 privSz, const byte* pub,
|
||||
word32 pubSz, ecc_key* key);
|
||||
|
||||
/* size helper */
|
||||
CYASSL_API
|
||||
int ecc_size(ecc_key* key);
|
||||
CYASSL_API
|
||||
int ecc_sig_size(ecc_key* key);
|
||||
|
||||
/* TODO: fix mutex types */
|
||||
#define MUTEX_GLOBAL(x) int (x);
|
||||
#define MUTEX_LOCK(x)
|
||||
#define MUTEX_UNLOCK(x)
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
#endif /* CTAO_CRYPT_ECC_H */
|
||||
#endif /* HAVE_ECC */
|
||||
@@ -1,115 +0,0 @@
|
||||
/* error.h
|
||||
*
|
||||
* Copyright (C) 2006-2012 Sawtooth Consulting Ltd.
|
||||
*
|
||||
* This file is part of CyaSSL.
|
||||
*
|
||||
* CyaSSL is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* CyaSSL is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
*/
|
||||
|
||||
|
||||
#ifndef CTAO_CRYPT_ERROR_H
|
||||
#define CTAO_CRYPT_ERROR_H
|
||||
|
||||
#include <cyassl/ctaocrypt/types.h>
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
/* error codes */
|
||||
enum {
|
||||
MAX_ERROR_SZ = 80, /* max size of error string */
|
||||
MAX_CODE_E = -100, /* errors -101 - -199 */
|
||||
OPEN_RAN_E = -101, /* opening random device error */
|
||||
READ_RAN_E = -102, /* reading random device error */
|
||||
WINCRYPT_E = -103, /* windows crypt init error */
|
||||
CRYPTGEN_E = -104, /* windows crypt generation error */
|
||||
RAN_BLOCK_E = -105, /* reading random device would block */
|
||||
|
||||
MP_INIT_E = -110, /* mp_init error state */
|
||||
MP_READ_E = -111, /* mp_read error state */
|
||||
MP_EXPTMOD_E = -112, /* mp_exptmod error state */
|
||||
MP_TO_E = -113, /* mp_to_xxx error state, can't convert */
|
||||
MP_SUB_E = -114, /* mp_sub error state, can't subtract */
|
||||
MP_ADD_E = -115, /* mp_add error state, can't add */
|
||||
MP_MUL_E = -116, /* mp_mul error state, can't multiply */
|
||||
MP_MULMOD_E = -117, /* mp_mulmod error state, can't multiply mod */
|
||||
MP_MOD_E = -118, /* mp_mod error state, can't mod */
|
||||
MP_INVMOD_E = -119, /* mp_invmod error state, can't inv mod */
|
||||
MP_CMP_E = -120, /* mp_cmp error state */
|
||||
MP_ZERO_E = -121, /* got a mp zero result, not expected */
|
||||
|
||||
MEMORY_E = -125, /* out of memory error */
|
||||
|
||||
RSA_WRONG_TYPE_E = -130, /* RSA wrong block type for RSA function */
|
||||
RSA_BUFFER_E = -131, /* RSA buffer error, output too small or
|
||||
input too large */
|
||||
BUFFER_E = -132, /* output buffer too small or input too large */
|
||||
ALGO_ID_E = -133, /* setting algo id error */
|
||||
PUBLIC_KEY_E = -134, /* setting public key error */
|
||||
DATE_E = -135, /* setting date validity error */
|
||||
SUBJECT_E = -136, /* setting subject name error */
|
||||
ISSUER_E = -137, /* setting issuer name error */
|
||||
CA_TRUE_E = -138, /* setting CA basic constraint true error */
|
||||
EXTENSIONS_E = -139, /* setting extensions error */
|
||||
|
||||
ASN_PARSE_E = -140, /* ASN parsing error, invalid input */
|
||||
ASN_VERSION_E = -141, /* ASN version error, invalid number */
|
||||
ASN_GETINT_E = -142, /* ASN get big int error, invalid data */
|
||||
ASN_RSA_KEY_E = -143, /* ASN key init error, invalid input */
|
||||
ASN_OBJECT_ID_E = -144, /* ASN object id error, invalid id */
|
||||
ASN_TAG_NULL_E = -145, /* ASN tag error, not null */
|
||||
ASN_EXPECT_0_E = -146, /* ASN expect error, not zero */
|
||||
ASN_BITSTR_E = -147, /* ASN bit string error, wrong id */
|
||||
ASN_UNKNOWN_OID_E = -148, /* ASN oid error, unknown sum id */
|
||||
ASN_DATE_SZ_E = -149, /* ASN date error, bad size */
|
||||
ASN_BEFORE_DATE_E = -150, /* ASN date error, current date before */
|
||||
ASN_AFTER_DATE_E = -151, /* ASN date error, current date after */
|
||||
ASN_SIG_OID_E = -152, /* ASN signature error, mismatched oid */
|
||||
ASN_TIME_E = -153, /* ASN time error, unknown time type */
|
||||
ASN_INPUT_E = -154, /* ASN input error, not enough data */
|
||||
ASN_SIG_CONFIRM_E = -155, /* ASN sig error, confirm failure */
|
||||
ASN_SIG_HASH_E = -156, /* ASN sig error, unsupported hash type */
|
||||
ASN_SIG_KEY_E = -157, /* ASN sig error, unsupported key type */
|
||||
ASN_DH_KEY_E = -158, /* ASN key init error, invalid input */
|
||||
ASN_NTRU_KEY_E = -159, /* ASN ntru key decode error, invalid input */
|
||||
|
||||
ECC_BAD_ARG_E = -170, /* ECC input argument of wrong type */
|
||||
ASN_ECC_KEY_E = -171, /* ASN ECC bad input */
|
||||
ECC_CURVE_OID_E = -172, /* Unsupported ECC OID curve type */
|
||||
BAD_FUNC_ARG = -173, /* Bad function argument provided */
|
||||
NOT_COMPILED_IN = -174, /* Feature not compiled in */
|
||||
UNICODE_SIZE_E = -175, /* Unicode password too big */
|
||||
NO_PASSWORD = -176, /* no password provided by user */
|
||||
ALT_NAME_E = -177, /* alt name size problem, too big */
|
||||
|
||||
AES_GCM_AUTH_E = -180, /* AES-GCM Authentication check failure */
|
||||
|
||||
MIN_CODE_E = -200 /* errors -101 - -199 */
|
||||
};
|
||||
|
||||
|
||||
CYASSL_API void CTaoCryptErrorString(int error, char* buffer);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
#endif /* CTAO_CRYPT_ERROR_H */
|
||||
|
||||
@@ -1,60 +0,0 @@
|
||||
/* hc128.h
|
||||
*
|
||||
* Copyright (C) 2006-2012 Sawtooth Consulting Ltd.
|
||||
*
|
||||
* This file is part of CyaSSL.
|
||||
*
|
||||
* CyaSSL is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* CyaSSL is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
*/
|
||||
|
||||
|
||||
#ifndef NO_HC128
|
||||
|
||||
#ifndef CTAO_CRYPT_HC128_H
|
||||
#define CTAO_CRYPT_HC128_H
|
||||
|
||||
#include <cyassl/ctaocrypt/types.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
enum {
|
||||
HC128_ENC_TYPE = 6 /* cipher unique type */
|
||||
};
|
||||
|
||||
/* HC-128 stream cipher */
|
||||
typedef struct HC128 {
|
||||
word32 T[1024]; /* P[i] = T[i]; Q[i] = T[1024 + i ]; */
|
||||
word32 X[16];
|
||||
word32 Y[16];
|
||||
word32 counter1024; /* counter1024 = i mod 1024 at the ith step */
|
||||
word32 key[8];
|
||||
word32 iv[8];
|
||||
} HC128;
|
||||
|
||||
|
||||
CYASSL_API void Hc128_Process(HC128*, byte*, const byte*, word32);
|
||||
CYASSL_API void Hc128_SetKey(HC128*, const byte* key, const byte* iv);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
#endif /* CTAO_CRYPT_HC128_H */
|
||||
|
||||
#endif /* HAVE_HC128 */
|
||||
@@ -1,99 +0,0 @@
|
||||
/* hmac.h
|
||||
*
|
||||
* Copyright (C) 2006-2012 Sawtooth Consulting Ltd.
|
||||
*
|
||||
* This file is part of CyaSSL.
|
||||
*
|
||||
* CyaSSL is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* CyaSSL is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
*/
|
||||
|
||||
|
||||
#ifndef NO_HMAC
|
||||
|
||||
#ifndef CTAO_CRYPT_HMAC_H
|
||||
#define CTAO_CRYPT_HMAC_H
|
||||
|
||||
#include <cyassl/ctaocrypt/md5.h>
|
||||
#include <cyassl/ctaocrypt/sha.h>
|
||||
|
||||
#ifndef NO_SHA256
|
||||
#include <cyassl/ctaocrypt/sha256.h>
|
||||
#endif
|
||||
|
||||
#ifdef CYASSL_SHA384
|
||||
#include <cyassl/ctaocrypt/sha512.h>
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
enum {
|
||||
IPAD = 0x36,
|
||||
OPAD = 0x5C,
|
||||
#if defined(CYASSL_SHA384)
|
||||
INNER_HASH_SIZE = SHA384_DIGEST_SIZE,
|
||||
HMAC_BLOCK_SIZE = SHA384_BLOCK_SIZE
|
||||
#elif !defined(NO_SHA256)
|
||||
INNER_HASH_SIZE = SHA256_DIGEST_SIZE,
|
||||
HMAC_BLOCK_SIZE = SHA256_BLOCK_SIZE,
|
||||
SHA384 = 5
|
||||
#else
|
||||
INNER_HASH_SIZE = SHA_DIGEST_SIZE,
|
||||
HMAC_BLOCK_SIZE = SHA_BLOCK_SIZE,
|
||||
SHA256 = 2, /* hash type unique */
|
||||
SHA384 = 5
|
||||
#endif
|
||||
};
|
||||
|
||||
|
||||
/* hash union */
|
||||
typedef union {
|
||||
Md5 md5;
|
||||
Sha sha;
|
||||
#ifndef NO_SHA256
|
||||
Sha256 sha256;
|
||||
#endif
|
||||
#ifdef CYASSL_SHA384
|
||||
Sha384 sha384;
|
||||
#endif
|
||||
} Hash;
|
||||
|
||||
/* Hmac digest */
|
||||
typedef struct Hmac {
|
||||
Hash hash;
|
||||
word32 ipad[HMAC_BLOCK_SIZE / sizeof(word32)]; /* same block size all*/
|
||||
word32 opad[HMAC_BLOCK_SIZE / sizeof(word32)];
|
||||
word32 innerHash[INNER_HASH_SIZE / sizeof(word32)]; /* max size */
|
||||
byte macType; /* md5 sha or sha256 */
|
||||
byte innerHashKeyed; /* keyed flag */
|
||||
} Hmac;
|
||||
|
||||
|
||||
/* does init */
|
||||
CYASSL_API void HmacSetKey(Hmac*, int type, const byte* key, word32 keySz);
|
||||
CYASSL_API void HmacUpdate(Hmac*, const byte*, word32);
|
||||
CYASSL_API void HmacFinal(Hmac*, byte*);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
#endif /* CTAO_CRYPT_HMAC_H */
|
||||
|
||||
#endif /* NO_HMAC */
|
||||
|
||||
@@ -1,37 +0,0 @@
|
||||
# vim:ft=automake
|
||||
# All paths should be given relative to the root
|
||||
|
||||
nobase_include_HEADERS+= \
|
||||
cyassl/ctaocrypt/aes.h \
|
||||
cyassl/ctaocrypt/arc4.h \
|
||||
cyassl/ctaocrypt/asn.h \
|
||||
cyassl/ctaocrypt/asn_public.h \
|
||||
cyassl/ctaocrypt/coding.h \
|
||||
cyassl/ctaocrypt/des3.h \
|
||||
cyassl/ctaocrypt/dh.h \
|
||||
cyassl/ctaocrypt/dsa.h \
|
||||
cyassl/ctaocrypt/ecc.h \
|
||||
cyassl/ctaocrypt/error.h \
|
||||
cyassl/ctaocrypt/hc128.h \
|
||||
cyassl/ctaocrypt/hmac.h \
|
||||
cyassl/ctaocrypt/integer.h \
|
||||
cyassl/ctaocrypt/md2.h \
|
||||
cyassl/ctaocrypt/md4.h \
|
||||
cyassl/ctaocrypt/md5.h \
|
||||
cyassl/ctaocrypt/misc.h \
|
||||
cyassl/ctaocrypt/pwdbased.h \
|
||||
cyassl/ctaocrypt/rabbit.h \
|
||||
cyassl/ctaocrypt/random.h \
|
||||
cyassl/ctaocrypt/ripemd.h \
|
||||
cyassl/ctaocrypt/rsa.h \
|
||||
cyassl/ctaocrypt/settings.h \
|
||||
cyassl/ctaocrypt/sha256.h \
|
||||
cyassl/ctaocrypt/sha512.h \
|
||||
cyassl/ctaocrypt/sha.h \
|
||||
cyassl/ctaocrypt/tfm.h \
|
||||
cyassl/ctaocrypt/types.h \
|
||||
cyassl/ctaocrypt/visibility.h \
|
||||
cyassl/ctaocrypt/logging.h \
|
||||
cyassl/ctaocrypt/memory.h \
|
||||
cyassl/ctaocrypt/mpi_class.h \
|
||||
cyassl/ctaocrypt/mpi_superclass.h
|
||||
@@ -1,329 +0,0 @@
|
||||
/* integer.h
|
||||
*
|
||||
* Copyright (C) 2006-2012 Sawtooth Consulting Ltd.
|
||||
*
|
||||
* This file is part of CyaSSL.
|
||||
*
|
||||
* CyaSSL is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* CyaSSL is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
*/
|
||||
|
||||
/*
|
||||
* Based on public domain LibTomMath 0.38 by Tom St Denis, tomstdenis@iahu.ca,
|
||||
* http://math.libtomcrypt.com
|
||||
*/
|
||||
|
||||
|
||||
#ifndef CTAO_CRYPT_INTEGER_H
|
||||
#define CTAO_CRYPT_INTEGER_H
|
||||
|
||||
/* may optionally use fast math instead, not yet supported on all platforms and
|
||||
may not be faster on all
|
||||
*/
|
||||
#include <cyassl/ctaocrypt/types.h> /* will set MP_xxBIT if not default */
|
||||
#ifdef USE_FAST_MATH
|
||||
#include <cyassl/ctaocrypt/tfm.h>
|
||||
#else
|
||||
|
||||
#ifndef CHAR_BIT
|
||||
#include <limits.h>
|
||||
#endif
|
||||
|
||||
#include <cyassl/ctaocrypt/mpi_class.h>
|
||||
|
||||
#ifndef MIN
|
||||
#define MIN(x,y) ((x)<(y)?(x):(y))
|
||||
#endif
|
||||
|
||||
#ifndef MAX
|
||||
#define MAX(x,y) ((x)>(y)?(x):(y))
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
||||
/* C++ compilers don't like assigning void * to mp_digit * */
|
||||
#define OPT_CAST(x) (x *)
|
||||
|
||||
#else
|
||||
|
||||
/* C on the other hand doesn't care */
|
||||
#define OPT_CAST(x)
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
/* detect 64-bit mode if possible */
|
||||
#if defined(__x86_64__)
|
||||
#if !(defined(MP_64BIT) && defined(MP_16BIT) && defined(MP_8BIT))
|
||||
#define MP_64BIT
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* some default configurations.
|
||||
*
|
||||
* A "mp_digit" must be able to hold DIGIT_BIT + 1 bits
|
||||
* A "mp_word" must be able to hold 2*DIGIT_BIT + 1 bits
|
||||
*
|
||||
* At the very least a mp_digit must be able to hold 7 bits
|
||||
* [any size beyond that is ok provided it doesn't overflow the data type]
|
||||
*/
|
||||
#ifdef MP_8BIT
|
||||
typedef unsigned char mp_digit;
|
||||
typedef unsigned short mp_word;
|
||||
#elif defined(MP_16BIT)
|
||||
typedef unsigned short mp_digit;
|
||||
typedef unsigned long mp_word;
|
||||
#elif defined(MP_64BIT)
|
||||
/* for GCC only on supported platforms */
|
||||
#ifndef CRYPT
|
||||
typedef unsigned long long ulong64;
|
||||
typedef signed long long long64;
|
||||
#endif
|
||||
|
||||
typedef unsigned long mp_digit;
|
||||
typedef unsigned long mp_word __attribute__ ((mode(TI)));
|
||||
|
||||
#define DIGIT_BIT 60
|
||||
#else
|
||||
/* this is the default case, 28-bit digits */
|
||||
|
||||
/* this is to make porting into LibTomCrypt easier :-) */
|
||||
#ifndef CRYPT
|
||||
#if defined(_MSC_VER) || defined(__BORLANDC__)
|
||||
typedef unsigned __int64 ulong64;
|
||||
typedef signed __int64 long64;
|
||||
#else
|
||||
typedef unsigned long long ulong64;
|
||||
typedef signed long long long64;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
typedef unsigned int mp_digit; /* long could be 64 now, changed TAO */
|
||||
typedef ulong64 mp_word;
|
||||
|
||||
#ifdef MP_31BIT
|
||||
/* this is an extension that uses 31-bit digits */
|
||||
#define DIGIT_BIT 31
|
||||
#else
|
||||
/* default case is 28-bit digits, defines MP_28BIT as a handy test macro */
|
||||
#define DIGIT_BIT 28
|
||||
#define MP_28BIT
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
/* otherwise the bits per digit is calculated automatically from the size of
|
||||
a mp_digit */
|
||||
#ifndef DIGIT_BIT
|
||||
#define DIGIT_BIT ((int)((CHAR_BIT * sizeof(mp_digit) - 1)))
|
||||
/* bits per digit */
|
||||
#endif
|
||||
|
||||
#define MP_DIGIT_BIT DIGIT_BIT
|
||||
#define MP_MASK ((((mp_digit)1)<<((mp_digit)DIGIT_BIT))-((mp_digit)1))
|
||||
#define MP_DIGIT_MAX MP_MASK
|
||||
|
||||
/* equalities */
|
||||
#define MP_LT -1 /* less than */
|
||||
#define MP_EQ 0 /* equal to */
|
||||
#define MP_GT 1 /* greater than */
|
||||
|
||||
#define MP_ZPOS 0 /* positive integer */
|
||||
#define MP_NEG 1 /* negative */
|
||||
|
||||
#define MP_OKAY 0 /* ok result */
|
||||
#define MP_MEM -2 /* out of mem */
|
||||
#define MP_VAL -3 /* invalid input */
|
||||
#define MP_RANGE MP_VAL
|
||||
|
||||
#define MP_YES 1 /* yes response */
|
||||
#define MP_NO 0 /* no response */
|
||||
|
||||
/* Primality generation flags */
|
||||
#define LTM_PRIME_BBS 0x0001 /* BBS style prime */
|
||||
#define LTM_PRIME_SAFE 0x0002 /* Safe prime (p-1)/2 == prime */
|
||||
#define LTM_PRIME_2MSB_ON 0x0008 /* force 2nd MSB to 1 */
|
||||
|
||||
typedef int mp_err;
|
||||
|
||||
/* define this to use lower memory usage routines (exptmods mostly) */
|
||||
#define MP_LOW_MEM
|
||||
|
||||
/* default precision */
|
||||
#ifndef MP_PREC
|
||||
#ifndef MP_LOW_MEM
|
||||
#define MP_PREC 32 /* default digits of precision */
|
||||
#else
|
||||
#define MP_PREC 1 /* default digits of precision */
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* size of comba arrays, should be at least 2 * 2**(BITS_PER_WORD -
|
||||
BITS_PER_DIGIT*2) */
|
||||
#define MP_WARRAY (1 << (sizeof(mp_word) * CHAR_BIT - 2 * DIGIT_BIT + 1))
|
||||
|
||||
/* the infamous mp_int structure */
|
||||
typedef struct {
|
||||
int used, alloc, sign;
|
||||
mp_digit *dp;
|
||||
} mp_int;
|
||||
|
||||
/* callback for mp_prime_random, should fill dst with random bytes and return
|
||||
how many read [upto len] */
|
||||
typedef int ltm_prime_callback(unsigned char *dst, int len, void *dat);
|
||||
|
||||
|
||||
#define USED(m) ((m)->used)
|
||||
#define DIGIT(m,k) ((m)->dp[(k)])
|
||||
#define SIGN(m) ((m)->sign)
|
||||
|
||||
|
||||
/* ---> Basic Manipulations <--- */
|
||||
#define mp_iszero(a) (((a)->used == 0) ? MP_YES : MP_NO)
|
||||
#define mp_iseven(a) \
|
||||
(((a)->used > 0 && (((a)->dp[0] & 1) == 0)) ? MP_YES : MP_NO)
|
||||
#define mp_isodd(a) \
|
||||
(((a)->used > 0 && (((a)->dp[0] & 1) == 1)) ? MP_YES : MP_NO)
|
||||
|
||||
|
||||
/* number of primes */
|
||||
#ifdef MP_8BIT
|
||||
#define PRIME_SIZE 31
|
||||
#else
|
||||
#define PRIME_SIZE 256
|
||||
#endif
|
||||
|
||||
#define mp_prime_random(a, t, size, bbs, cb, dat) \
|
||||
mp_prime_random_ex(a, t, ((size) * 8) + 1, (bbs==1)?LTM_PRIME_BBS:0, cb, dat)
|
||||
|
||||
#define mp_read_raw(mp, str, len) mp_read_signed_bin((mp), (str), (len))
|
||||
#define mp_raw_size(mp) mp_signed_bin_size(mp)
|
||||
#define mp_toraw(mp, str) mp_to_signed_bin((mp), (str))
|
||||
#define mp_read_mag(mp, str, len) mp_read_unsigned_bin((mp), (str), (len))
|
||||
#define mp_mag_size(mp) mp_unsigned_bin_size(mp)
|
||||
#define mp_tomag(mp, str) mp_to_unsigned_bin((mp), (str))
|
||||
|
||||
#define mp_tobinary(M, S) mp_toradix((M), (S), 2)
|
||||
#define mp_tooctal(M, S) mp_toradix((M), (S), 8)
|
||||
#define mp_todecimal(M, S) mp_toradix((M), (S), 10)
|
||||
#define mp_tohex(M, S) mp_toradix((M), (S), 16)
|
||||
|
||||
#define s_mp_mul(a, b, c) s_mp_mul_digs(a, b, c, (a)->used + (b)->used + 1)
|
||||
|
||||
extern const char *mp_s_rmap;
|
||||
|
||||
/* 6 functions needed by Rsa */
|
||||
int mp_init (mp_int * a);
|
||||
void mp_clear (mp_int * a);
|
||||
int mp_unsigned_bin_size(mp_int * a);
|
||||
int mp_read_unsigned_bin (mp_int * a, const unsigned char *b, int c);
|
||||
int mp_to_unsigned_bin (mp_int * a, unsigned char *b);
|
||||
int mp_exptmod (mp_int * G, mp_int * X, mp_int * P, mp_int * Y);
|
||||
/* end functions needed by Rsa */
|
||||
|
||||
/* functions added to support above needed, removed TOOM and KARATSUBA */
|
||||
int mp_count_bits (mp_int * a);
|
||||
int mp_init_copy (mp_int * a, mp_int * b);
|
||||
int mp_copy (mp_int * a, mp_int * b);
|
||||
int mp_grow (mp_int * a, int size);
|
||||
void bn_reverse (unsigned char *s, int len);
|
||||
int mp_div_2d (mp_int * a, int b, mp_int * c, mp_int * d);
|
||||
void mp_zero (mp_int * a);
|
||||
void mp_clamp (mp_int * a);
|
||||
void mp_exch (mp_int * a, mp_int * b);
|
||||
void mp_rshd (mp_int * a, int b);
|
||||
int mp_mod_2d (mp_int * a, int b, mp_int * c);
|
||||
int mp_mul_2d (mp_int * a, int b, mp_int * c);
|
||||
int mp_lshd (mp_int * a, int b);
|
||||
int mp_abs (mp_int * a, mp_int * b);
|
||||
int mp_invmod (mp_int * a, mp_int * b, mp_int * c);
|
||||
int fast_mp_invmod (mp_int * a, mp_int * b, mp_int * c);
|
||||
int mp_invmod_slow (mp_int * a, mp_int * b, mp_int * c);
|
||||
int mp_cmp_mag (mp_int * a, mp_int * b);
|
||||
int mp_cmp (mp_int * a, mp_int * b);
|
||||
int mp_cmp_d(mp_int * a, mp_digit b);
|
||||
void mp_set (mp_int * a, mp_digit b);
|
||||
int mp_mod (mp_int * a, mp_int * b, mp_int * c);
|
||||
int mp_div(mp_int * a, mp_int * b, mp_int * c, mp_int * d);
|
||||
int mp_div_2(mp_int * a, mp_int * b);
|
||||
int mp_add (mp_int * a, mp_int * b, mp_int * c);
|
||||
int s_mp_add (mp_int * a, mp_int * b, mp_int * c);
|
||||
int s_mp_sub (mp_int * a, mp_int * b, mp_int * c);
|
||||
int mp_sub (mp_int * a, mp_int * b, mp_int * c);
|
||||
int mp_reduce_is_2k_l(mp_int *a);
|
||||
int mp_reduce_is_2k(mp_int *a);
|
||||
int mp_dr_is_modulus(mp_int *a);
|
||||
int mp_exptmod_fast (mp_int * G, mp_int * X, mp_int * P, mp_int * Y, int);
|
||||
int mp_montgomery_setup (mp_int * n, mp_digit * rho);
|
||||
int fast_mp_montgomery_reduce (mp_int * x, mp_int * n, mp_digit rho);
|
||||
int mp_montgomery_reduce (mp_int * x, mp_int * n, mp_digit rho);
|
||||
void mp_dr_setup(mp_int *a, mp_digit *d);
|
||||
int mp_dr_reduce (mp_int * x, mp_int * n, mp_digit k);
|
||||
int mp_reduce_2k(mp_int *a, mp_int *n, mp_digit d);
|
||||
int fast_s_mp_mul_high_digs (mp_int * a, mp_int * b, mp_int * c, int digs);
|
||||
int s_mp_mul_high_digs (mp_int * a, mp_int * b, mp_int * c, int digs);
|
||||
int mp_reduce_2k_setup_l(mp_int *a, mp_int *d);
|
||||
int mp_reduce_2k_l(mp_int *a, mp_int *n, mp_int *d);
|
||||
int mp_reduce (mp_int * x, mp_int * m, mp_int * mu);
|
||||
int mp_reduce_setup (mp_int * a, mp_int * b);
|
||||
int s_mp_exptmod (mp_int * G, mp_int * X, mp_int * P, mp_int * Y, int redmode);
|
||||
int mp_montgomery_calc_normalization (mp_int * a, mp_int * b);
|
||||
int s_mp_mul_digs (mp_int * a, mp_int * b, mp_int * c, int digs);
|
||||
int s_mp_sqr (mp_int * a, mp_int * b);
|
||||
int fast_s_mp_mul_digs (mp_int * a, mp_int * b, mp_int * c, int digs);
|
||||
int fast_s_mp_sqr (mp_int * a, mp_int * b);
|
||||
int mp_init_size (mp_int * a, int size);
|
||||
int mp_div_3 (mp_int * a, mp_int *c, mp_digit * d);
|
||||
int mp_mul_2(mp_int * a, mp_int * b);
|
||||
int mp_mul (mp_int * a, mp_int * b, mp_int * c);
|
||||
int mp_sqr (mp_int * a, mp_int * b);
|
||||
int mp_mulmod (mp_int * a, mp_int * b, mp_int * c, mp_int * d);
|
||||
int mp_mul_d (mp_int * a, mp_digit b, mp_int * c);
|
||||
int mp_2expt (mp_int * a, int b);
|
||||
int mp_reduce_2k_setup(mp_int *a, mp_digit *d);
|
||||
int mp_add_d (mp_int* a, mp_digit b, mp_int* c);
|
||||
int mp_set_int (mp_int * a, unsigned long b);
|
||||
/* end support added functions */
|
||||
|
||||
/* added */
|
||||
int mp_init_multi(mp_int* a, mp_int* b, mp_int* c, mp_int* d, mp_int* e,
|
||||
mp_int* f);
|
||||
|
||||
#if defined(HAVE_ECC) || defined(CYASSL_KEY_GEN)
|
||||
int mp_sqrmod(mp_int* a, mp_int* b, mp_int* c);
|
||||
#endif
|
||||
#ifdef HAVE_ECC
|
||||
int mp_read_radix(mp_int* a, const char* str, int radix);
|
||||
#endif
|
||||
|
||||
#ifdef CYASSL_KEY_GEN
|
||||
int mp_prime_is_prime (mp_int * a, int t, int *result);
|
||||
int mp_gcd (mp_int * a, mp_int * b, mp_int * c);
|
||||
int mp_lcm (mp_int * a, mp_int * b, mp_int * c);
|
||||
#endif
|
||||
|
||||
#if defined(CYASSL_KEY_GEN) || defined(HAVE_ECC) || !defined(NO_PWDBASED)
|
||||
int mp_sub_d (mp_int * a, mp_digit b, mp_int * c);
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* USE_FAST_MATH */
|
||||
|
||||
#endif /* CTAO_CRYPT_INTEGER_H */
|
||||
|
||||
@@ -1,70 +0,0 @@
|
||||
/* logging.h
|
||||
*
|
||||
* Copyright (C) 2006-2012 Sawtooth Consulting Ltd.
|
||||
*
|
||||
* This file is part of CyaSSL.
|
||||
*
|
||||
* CyaSSL is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* CyaSSL is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
*/
|
||||
|
||||
/* submitted by eof */
|
||||
|
||||
|
||||
#ifndef CYASSL_LOGGING_H
|
||||
#define CYASSL_LOGGING_H
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
enum CYA_Log_Levels {
|
||||
ERROR_LOG = 0,
|
||||
INFO_LOG,
|
||||
ENTER_LOG,
|
||||
LEAVE_LOG,
|
||||
OTHER_LOG
|
||||
};
|
||||
|
||||
typedef void (*CyaSSL_Logging_cb)(const int logLevel,
|
||||
const char *const logMessage);
|
||||
|
||||
CYASSL_API int CyaSSL_SetLoggingCb(CyaSSL_Logging_cb log_function);
|
||||
|
||||
|
||||
#ifdef DEBUG_CYASSL
|
||||
|
||||
void CYASSL_ENTER(const char* msg);
|
||||
void CYASSL_LEAVE(const char* msg, int ret);
|
||||
|
||||
void CYASSL_ERROR(int);
|
||||
void CYASSL_MSG(const char* msg);
|
||||
|
||||
#else /* DEBUG_CYASSL */
|
||||
|
||||
#define CYASSL_ENTER(m)
|
||||
#define CYASSL_LEAVE(m, r)
|
||||
|
||||
#define CYASSL_ERROR(e)
|
||||
#define CYASSL_MSG(m)
|
||||
|
||||
#endif /* DEBUG_CYASSL */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* CYASSL_MEMORY_H */
|
||||
@@ -1,64 +0,0 @@
|
||||
/* md2.h
|
||||
*
|
||||
* Copyright (C) 2006-2012 Sawtooth Consulting Ltd.
|
||||
*
|
||||
* This file is part of CyaSSL.
|
||||
*
|
||||
* CyaSSL is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* CyaSSL is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
*/
|
||||
|
||||
|
||||
#ifdef CYASSL_MD2
|
||||
|
||||
#ifndef CTAO_CRYPT_MD2_H
|
||||
#define CTAO_CRYPT_MD2_H
|
||||
|
||||
#include <cyassl/ctaocrypt/types.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
/* in bytes */
|
||||
enum {
|
||||
MD2 = 6, /* hash type unique */
|
||||
MD2_BLOCK_SIZE = 16,
|
||||
MD2_DIGEST_SIZE = 16,
|
||||
MD2_PAD_SIZE = 16,
|
||||
MD2_X_SIZE = 48
|
||||
};
|
||||
|
||||
|
||||
/* Md2 digest */
|
||||
typedef struct Md2 {
|
||||
word32 count; /* bytes % PAD_SIZE */
|
||||
byte X[MD2_X_SIZE];
|
||||
byte C[MD2_BLOCK_SIZE];
|
||||
byte buffer[MD2_BLOCK_SIZE];
|
||||
} Md2;
|
||||
|
||||
|
||||
CYASSL_API void InitMd2(Md2*);
|
||||
CYASSL_API void Md2Update(Md2*, const byte*, word32);
|
||||
CYASSL_API void Md2Final(Md2*, byte*);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
#endif /* CTAO_CRYPT_MD2_H */
|
||||
#endif /* CYASSL_MD2 */
|
||||
@@ -1,65 +0,0 @@
|
||||
/* md4.h
|
||||
*
|
||||
* Copyright (C) 2006-2012 Sawtooth Consulting Ltd.
|
||||
*
|
||||
* This file is part of CyaSSL.
|
||||
*
|
||||
* CyaSSL is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* CyaSSL is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
*/
|
||||
|
||||
|
||||
#ifndef NO_MD4
|
||||
|
||||
#ifndef CTAO_CRYPT_MD4_H
|
||||
#define CTAO_CRYPT_MD4_H
|
||||
|
||||
#include <cyassl/ctaocrypt/types.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
/* in bytes */
|
||||
enum {
|
||||
MD4_BLOCK_SIZE = 64,
|
||||
MD4_DIGEST_SIZE = 16,
|
||||
MD4_PAD_SIZE = 56
|
||||
};
|
||||
|
||||
|
||||
/* MD4 digest */
|
||||
typedef struct Md4 {
|
||||
word32 buffLen; /* in bytes */
|
||||
word32 loLen; /* length in bytes */
|
||||
word32 hiLen; /* length in bytes */
|
||||
word32 digest[MD4_DIGEST_SIZE / sizeof(word32)];
|
||||
word32 buffer[MD4_BLOCK_SIZE / sizeof(word32)];
|
||||
} Md4;
|
||||
|
||||
|
||||
CYASSL_API void InitMd4(Md4*);
|
||||
CYASSL_API void Md4Update(Md4*, const byte*, word32);
|
||||
CYASSL_API void Md4Final(Md4*, byte*);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
#endif /* CTAO_CRYPT_MD4_H */
|
||||
|
||||
#endif /* NO_MD4 */
|
||||
|
||||
@@ -1,62 +0,0 @@
|
||||
/* md5.h
|
||||
*
|
||||
* Copyright (C) 2006-2012 Sawtooth Consulting Ltd.
|
||||
*
|
||||
* This file is part of CyaSSL.
|
||||
*
|
||||
* CyaSSL is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* CyaSSL is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
*/
|
||||
|
||||
|
||||
#ifndef CTAO_CRYPT_MD5_H
|
||||
#define CTAO_CRYPT_MD5_H
|
||||
|
||||
#include <cyassl/ctaocrypt/types.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
/* in bytes */
|
||||
enum {
|
||||
MD5 = 0, /* hash type unique */
|
||||
MD5_BLOCK_SIZE = 64,
|
||||
MD5_DIGEST_SIZE = 16,
|
||||
MD5_PAD_SIZE = 56
|
||||
};
|
||||
|
||||
|
||||
/* MD5 digest */
|
||||
typedef struct Md5 {
|
||||
word32 buffLen; /* in bytes */
|
||||
word32 loLen; /* length in bytes */
|
||||
word32 hiLen; /* length in bytes */
|
||||
word32 digest[MD5_DIGEST_SIZE / sizeof(word32)];
|
||||
word32 buffer[MD5_BLOCK_SIZE / sizeof(word32)];
|
||||
} Md5;
|
||||
|
||||
|
||||
CYASSL_API void InitMd5(Md5*);
|
||||
CYASSL_API void Md5Update(Md5*, const byte*, word32);
|
||||
CYASSL_API void Md5Final(Md5*, byte*);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
#endif /* CTAO_CRYPT_MD5_H */
|
||||
|
||||
@@ -1,55 +0,0 @@
|
||||
/* memory.h
|
||||
*
|
||||
* Copyright (C) 2006-2012 Sawtooth Consulting Ltd.
|
||||
*
|
||||
* This file is part of CyaSSL.
|
||||
*
|
||||
* CyaSSL is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* CyaSSL is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
*/
|
||||
|
||||
/* submitted by eof */
|
||||
|
||||
|
||||
#ifndef CYASSL_MEMORY_H
|
||||
#define CYASSL_MEMORY_H
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
typedef void *(*CyaSSL_Malloc_cb)(size_t size);
|
||||
typedef void (*CyaSSL_Free_cb)(void *ptr);
|
||||
typedef void *(*CyaSSL_Realloc_cb)(void *ptr, size_t size);
|
||||
|
||||
|
||||
/* Public set function */
|
||||
CYASSL_API int CyaSSL_SetAllocators(CyaSSL_Malloc_cb malloc_function,
|
||||
CyaSSL_Free_cb free_function,
|
||||
CyaSSL_Realloc_cb realloc_function);
|
||||
|
||||
/* Public in case user app wants to use XMALLOC/XFREE */
|
||||
CYASSL_API void* CyaSSL_Malloc(size_t size);
|
||||
CYASSL_API void CyaSSL_Free(void *ptr);
|
||||
CYASSL_API void* CyaSSL_Realloc(void *ptr, size_t size);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* CYASSL_MEMORY_H */
|
||||
@@ -1,74 +0,0 @@
|
||||
/* misc.h
|
||||
*
|
||||
* Copyright (C) 2006-2012 Sawtooth Consulting Ltd.
|
||||
*
|
||||
* This file is part of CyaSSL.
|
||||
*
|
||||
* CyaSSL is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* CyaSSL is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
*/
|
||||
|
||||
|
||||
#ifndef CTAO_CRYPT_MISC_H
|
||||
#define CTAO_CRYPT_MISC_H
|
||||
|
||||
|
||||
#include <cyassl/ctaocrypt/types.h>
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef NO_INLINE
|
||||
CYASSL_LOCAL
|
||||
word32 rotlFixed(word32, word32);
|
||||
CYASSL_LOCAL
|
||||
word32 rotrFixed(word32, word32);
|
||||
|
||||
CYASSL_LOCAL
|
||||
word32 ByteReverseWord32(word32);
|
||||
CYASSL_LOCAL
|
||||
void ByteReverseWords(word32*, const word32*, word32);
|
||||
CYASSL_LOCAL
|
||||
void ByteReverseBytes(byte*, const byte*, word32);
|
||||
|
||||
CYASSL_LOCAL
|
||||
void XorWords(word*, const word*, word32);
|
||||
CYASSL_LOCAL
|
||||
void xorbuf(byte*, const byte*, word32);
|
||||
|
||||
#ifdef WORD64_AVAILABLE
|
||||
CYASSL_LOCAL
|
||||
word64 rotlFixed64(word64, word64);
|
||||
CYASSL_LOCAL
|
||||
word64 rotrFixed64(word64, word64);
|
||||
|
||||
CYASSL_LOCAL
|
||||
word64 ByteReverseWord64(word64);
|
||||
CYASSL_LOCAL
|
||||
void ByteReverseWords64(word64*, const word64*, word32);
|
||||
#endif /* WORD64_AVAILABLE */
|
||||
|
||||
#endif /* NO_INLINE */
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* CTAO_CRYPT_MISC_H */
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,95 +0,0 @@
|
||||
/* mpi_superclass.h
|
||||
*
|
||||
* Copyright (C) 2006-2012 Sawtooth Consulting Ltd.
|
||||
*
|
||||
* This file is part of CyaSSL.
|
||||
*
|
||||
* CyaSSL is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* CyaSSL is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
*/
|
||||
|
||||
|
||||
/* super class file for PK algos */
|
||||
|
||||
/* default ... include all MPI */
|
||||
#define LTM_ALL
|
||||
|
||||
/* RSA only (does not support DH/DSA/ECC) */
|
||||
/* #define SC_RSA_1 */
|
||||
|
||||
/* For reference.... On an Athlon64 optimizing for speed...
|
||||
|
||||
LTM's mpi.o with all functions [striped] is 142KiB in size.
|
||||
|
||||
*/
|
||||
|
||||
/* Works for RSA only, mpi.o is 68KiB */
|
||||
#ifdef SC_RSA_1
|
||||
#define BN_MP_SHRINK_C
|
||||
#define BN_MP_LCM_C
|
||||
#define BN_MP_PRIME_RANDOM_EX_C
|
||||
#define BN_MP_INVMOD_C
|
||||
#define BN_MP_GCD_C
|
||||
#define BN_MP_MOD_C
|
||||
#define BN_MP_MULMOD_C
|
||||
#define BN_MP_ADDMOD_C
|
||||
#define BN_MP_EXPTMOD_C
|
||||
#define BN_MP_SET_INT_C
|
||||
#define BN_MP_INIT_MULTI_C
|
||||
#define BN_MP_CLEAR_MULTI_C
|
||||
#define BN_MP_UNSIGNED_BIN_SIZE_C
|
||||
#define BN_MP_TO_UNSIGNED_BIN_C
|
||||
#define BN_MP_MOD_D_C
|
||||
#define BN_MP_PRIME_RABIN_MILLER_TRIALS_C
|
||||
#define BN_REVERSE_C
|
||||
#define BN_PRIME_TAB_C
|
||||
|
||||
/* other modifiers */
|
||||
#define BN_MP_DIV_SMALL /* Slower division, not critical */
|
||||
|
||||
/* here we are on the last pass so we turn things off. The functions classes are still there
|
||||
* but we remove them specifically from the build. This also invokes tweaks in functions
|
||||
* like removing support for even moduli, etc...
|
||||
*/
|
||||
#ifdef LTM_LAST
|
||||
#undef BN_MP_TOOM_MUL_C
|
||||
#undef BN_MP_TOOM_SQR_C
|
||||
#undef BN_MP_KARATSUBA_MUL_C
|
||||
#undef BN_MP_KARATSUBA_SQR_C
|
||||
#undef BN_MP_REDUCE_C
|
||||
#undef BN_MP_REDUCE_SETUP_C
|
||||
#undef BN_MP_DR_IS_MODULUS_C
|
||||
#undef BN_MP_DR_SETUP_C
|
||||
#undef BN_MP_DR_REDUCE_C
|
||||
#undef BN_MP_REDUCE_IS_2K_C
|
||||
#undef BN_MP_REDUCE_2K_SETUP_C
|
||||
#undef BN_MP_REDUCE_2K_C
|
||||
#undef BN_S_MP_EXPTMOD_C
|
||||
#undef BN_MP_DIV_3_C
|
||||
#undef BN_S_MP_MUL_HIGH_DIGS_C
|
||||
#undef BN_FAST_S_MP_MUL_HIGH_DIGS_C
|
||||
#undef BN_FAST_MP_INVMOD_C
|
||||
|
||||
/* To safely undefine these you have to make sure your RSA key won't exceed the Comba threshold
|
||||
* which is roughly 255 digits [7140 bits for 32-bit machines, 15300 bits for 64-bit machines]
|
||||
* which means roughly speaking you can handle upto 2536-bit RSA keys with these defined without
|
||||
* trouble.
|
||||
*/
|
||||
#undef BN_S_MP_MUL_DIGS_C
|
||||
#undef BN_S_MP_SQR_C
|
||||
#undef BN_MP_MONTGOMERY_REDUCE_C
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,53 +0,0 @@
|
||||
/* pwdbased.h
|
||||
*
|
||||
* Copyright (C) 2006-2012 Sawtooth Consulting Ltd.
|
||||
*
|
||||
* This file is part of CyaSSL.
|
||||
*
|
||||
* CyaSSL is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* CyaSSL is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
*/
|
||||
|
||||
|
||||
#ifndef NO_PWDBASED
|
||||
|
||||
#ifndef CTAO_CRYPT_PWDBASED_H
|
||||
#define CTAO_CRYPT_PWDBASED_H
|
||||
|
||||
#include <cyassl/ctaocrypt/types.h>
|
||||
#include <cyassl/ctaocrypt/md5.h> /* for hash type */
|
||||
#include <cyassl/ctaocrypt/sha.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
CYASSL_API int PBKDF1(byte* output, const byte* passwd, int pLen,
|
||||
const byte* salt, int sLen, int iterations, int kLen,
|
||||
int hashType);
|
||||
CYASSL_API int PBKDF2(byte* output, const byte* passwd, int pLen,
|
||||
const byte* salt, int sLen, int iterations, int kLen,
|
||||
int hashType);
|
||||
CYASSL_API int PKCS12_PBKDF(byte* output, const byte* passwd, int pLen,
|
||||
const byte* salt, int sLen, int iterations,
|
||||
int kLen, int hashType, int purpose);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
#endif /* CTAO_CRYPT_PWDBASED_H */
|
||||
#endif /* NO_PWDBASED */
|
||||
@@ -1,65 +0,0 @@
|
||||
/* rabbit.h
|
||||
*
|
||||
* Copyright (C) 2006-2012 Sawtooth Consulting Ltd.
|
||||
*
|
||||
* This file is part of CyaSSL.
|
||||
*
|
||||
* CyaSSL is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* CyaSSL is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
*/
|
||||
|
||||
|
||||
#ifndef NO_RABBIT
|
||||
|
||||
#ifndef CTAO_CRYPT_RABBIT_H
|
||||
#define CTAO_CRYPT_RABBIT_H
|
||||
|
||||
#include <cyassl/ctaocrypt/types.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
enum {
|
||||
RABBIT_ENC_TYPE = 5 /* cipher unique type */
|
||||
};
|
||||
|
||||
|
||||
/* Rabbit Context */
|
||||
typedef struct RabbitCtx {
|
||||
word32 x[8];
|
||||
word32 c[8];
|
||||
word32 carry;
|
||||
} RabbitCtx;
|
||||
|
||||
|
||||
/* Rabbit stream cipher */
|
||||
typedef struct Rabbit {
|
||||
RabbitCtx masterCtx;
|
||||
RabbitCtx workCtx;
|
||||
} Rabbit;
|
||||
|
||||
|
||||
CYASSL_API void RabbitProcess(Rabbit*, byte*, const byte*, word32);
|
||||
CYASSL_API void RabbitSetKey(Rabbit*, const byte* key, const byte* iv);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
#endif /* CTAO_CRYPT_RABBIT_H */
|
||||
|
||||
#endif /* NO_RABBIT */
|
||||
@@ -1,73 +0,0 @@
|
||||
/* random.h
|
||||
*
|
||||
* Copyright (C) 2006-2012 Sawtooth Consulting Ltd.
|
||||
*
|
||||
* This file is part of CyaSSL.
|
||||
*
|
||||
* CyaSSL is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* CyaSSL is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
*/
|
||||
|
||||
|
||||
#ifndef CTAO_CRYPT_RANDOM_H
|
||||
#define CTAO_CRYPT_RANDOM_H
|
||||
|
||||
#include <cyassl/ctaocrypt/arc4.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(USE_WINDOWS_API)
|
||||
#if defined(_WIN64)
|
||||
typedef unsigned __int64 ProviderHandle;
|
||||
/* type HCRYPTPROV, avoid #include <windows.h> */
|
||||
#else
|
||||
typedef unsigned long ProviderHandle;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
/* OS specific seeder */
|
||||
typedef struct OS_Seed {
|
||||
#if defined(USE_WINDOWS_API)
|
||||
ProviderHandle handle;
|
||||
#else
|
||||
int fd;
|
||||
#endif
|
||||
} OS_Seed;
|
||||
|
||||
CYASSL_LOCAL
|
||||
int GenerateSeed(OS_Seed* os, byte* seed, word32 sz);
|
||||
|
||||
|
||||
/* secure Random Nnumber Generator */
|
||||
typedef struct RNG {
|
||||
OS_Seed seed;
|
||||
Arc4 cipher;
|
||||
} RNG;
|
||||
|
||||
|
||||
CYASSL_API int InitRng(RNG*);
|
||||
CYASSL_API void RNG_GenerateBlock(RNG*, byte*, word32 sz);
|
||||
CYASSL_API byte RNG_GenerateByte(RNG*);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
#endif /* CTAO_CRYPT_RANDOM_H */
|
||||
|
||||
@@ -1,64 +0,0 @@
|
||||
/* ripemd.h
|
||||
*
|
||||
* Copyright (C) 2006-2012 Sawtooth Consulting Ltd.
|
||||
*
|
||||
* This file is part of CyaSSL.
|
||||
*
|
||||
* CyaSSL is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* CyaSSL is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
*/
|
||||
|
||||
|
||||
#ifdef CYASSL_RIPEMD
|
||||
|
||||
#ifndef CTAO_CRYPT_RIPEMD_H
|
||||
#define CTAO_CRYPT_RIPEME_H
|
||||
|
||||
#include <cyassl/ctaocrypt/types.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
/* in bytes */
|
||||
enum {
|
||||
RIPEMD = 3, /* hash type unique */
|
||||
RIPEMD_BLOCK_SIZE = 64,
|
||||
RIPEMD_DIGEST_SIZE = 20,
|
||||
RIPEMD_PAD_SIZE = 56
|
||||
};
|
||||
|
||||
|
||||
/* RipeMd 160 digest */
|
||||
typedef struct RipeMd {
|
||||
word32 buffLen; /* in bytes */
|
||||
word32 loLen; /* length in bytes */
|
||||
word32 hiLen; /* length in bytes */
|
||||
word32 digest[RIPEMD_DIGEST_SIZE / sizeof(word32)];
|
||||
word32 buffer[RIPEMD_BLOCK_SIZE / sizeof(word32)];
|
||||
} RipeMd;
|
||||
|
||||
|
||||
CYASSL_API void InitRipeMd(RipeMd*);
|
||||
CYASSL_API void RipeMdUpdate(RipeMd*, const byte*, word32);
|
||||
CYASSL_API void RipeMdFinal(RipeMd*, byte*);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
#endif /* CTAO_CRYPT_RIPEMD_H */
|
||||
#endif /* CYASSL_RIPEMD */
|
||||
@@ -1,81 +0,0 @@
|
||||
/* rsa.h
|
||||
*
|
||||
* Copyright (C) 2006-2012 Sawtooth Consulting Ltd.
|
||||
*
|
||||
* This file is part of CyaSSL.
|
||||
*
|
||||
* CyaSSL is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* CyaSSL is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
*/
|
||||
|
||||
|
||||
#ifndef CTAO_CRYPT_RSA_H
|
||||
#define CTAO_CRYPT_RSA_H
|
||||
|
||||
#include <cyassl/ctaocrypt/types.h>
|
||||
#include <cyassl/ctaocrypt/integer.h>
|
||||
#include <cyassl/ctaocrypt/random.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
enum {
|
||||
RSA_PUBLIC = 0,
|
||||
RSA_PRIVATE = 1
|
||||
};
|
||||
|
||||
/* RSA */
|
||||
typedef struct RsaKey {
|
||||
mp_int n, e, d, p, q, dP, dQ, u;
|
||||
int type; /* public or private */
|
||||
void* heap; /* for user memory overrides */
|
||||
} RsaKey;
|
||||
|
||||
|
||||
CYASSL_API void InitRsaKey(RsaKey* key, void*);
|
||||
CYASSL_API void FreeRsaKey(RsaKey* key);
|
||||
|
||||
CYASSL_API int RsaPublicEncrypt(const byte* in, word32 inLen, byte* out,
|
||||
word32 outLen, RsaKey* key, RNG* rng);
|
||||
CYASSL_API int RsaPrivateDecryptInline(byte* in, word32 inLen, byte** out,
|
||||
RsaKey* key);
|
||||
CYASSL_API int RsaPrivateDecrypt(const byte* in, word32 inLen, byte* out,
|
||||
word32 outLen, RsaKey* key);
|
||||
CYASSL_API int RsaSSL_Sign(const byte* in, word32 inLen, byte* out,
|
||||
word32 outLen, RsaKey* key, RNG* rng);
|
||||
CYASSL_API int RsaSSL_VerifyInline(byte* in, word32 inLen, byte** out,
|
||||
RsaKey* key);
|
||||
CYASSL_API int RsaSSL_Verify(const byte* in, word32 inLen, byte* out,
|
||||
word32 outLen, RsaKey* key);
|
||||
CYASSL_API int RsaEncryptSize(RsaKey* key);
|
||||
|
||||
CYASSL_API int RsaPrivateKeyDecode(const byte* input, word32* inOutIdx, RsaKey*,
|
||||
word32);
|
||||
CYASSL_API int RsaPublicKeyDecode(const byte* input, word32* inOutIdx, RsaKey*,
|
||||
word32);
|
||||
#ifdef CYASSL_KEY_GEN
|
||||
CYASSL_API int MakeRsaKey(RsaKey* key, int size, long e, RNG* rng);
|
||||
CYASSL_API int RsaKeyToDer(RsaKey*, byte* output, word32 inLen);
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
#endif /* CTAO_CRYPT_RSA_H */
|
||||
|
||||
@@ -1,322 +0,0 @@
|
||||
/* settings.h
|
||||
*
|
||||
* Copyright (C) 2006-2012 Sawtooth Consulting Ltd.
|
||||
*
|
||||
* This file is part of CyaSSL.
|
||||
*
|
||||
* CyaSSL is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* CyaSSL is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
*/
|
||||
|
||||
/* Place OS specific preprocessor flags, defines, includes here, will be
|
||||
included into every file because types.h includes it */
|
||||
|
||||
|
||||
#ifndef CTAO_CRYPT_SETTINGS_H
|
||||
#define CTAO_CRYPT_SETTINGS_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Uncomment next line if using IPHONE */
|
||||
/* #define IPHONE */
|
||||
|
||||
/* Uncomment next line if using ThreadX */
|
||||
/* #define THREADX */
|
||||
|
||||
/* Uncomment next line if using Micrium ucOS */
|
||||
/* #define MICRIUM */
|
||||
|
||||
/* Uncomment next line if using Mbed */
|
||||
/* #define MBED */
|
||||
|
||||
/* Uncomment next line if using Microchip PIC32 ethernet starter kit */
|
||||
/* #define MICROCHIP_PIC32 */
|
||||
|
||||
/* Uncomment next line if using FreeRTOS */
|
||||
/* #define FREERTOS */
|
||||
|
||||
/* Uncomment next line if using FreeRTOS Windows Simulator */
|
||||
/* #define FREERTOS_WINSIM */
|
||||
|
||||
/* Uncomment next line if using lwip */
|
||||
/* #define CYASSL_LWIP */
|
||||
|
||||
/* Uncomment next line if building CyaSSL for a game console */
|
||||
/* #define CYASSL_GAME_BUILD */
|
||||
|
||||
|
||||
#include <cyassl/ctaocrypt/visibility.h>
|
||||
|
||||
#ifdef IPHONE
|
||||
#define SIZEOF_LONG_LONG 8
|
||||
#endif
|
||||
|
||||
#ifdef THREADX
|
||||
#define SIZEOF_LONG_LONG 8
|
||||
#endif
|
||||
|
||||
#ifdef MICROCHIP_PIC32
|
||||
/* use MBED plus no filesystem */
|
||||
#define MBED
|
||||
#define NO_FILESYSTEM
|
||||
#endif
|
||||
|
||||
#ifdef MBED
|
||||
#define SINGLE_THREADED
|
||||
#define CYASSL_USER_IO
|
||||
#define NO_WRITEV
|
||||
#define NO_DEV_RANDOM
|
||||
#define NO_SHA512
|
||||
#define NO_DH
|
||||
#define NO_DSA
|
||||
#define NO_HC128
|
||||
#endif /* MBED */
|
||||
|
||||
#ifdef FREERTOS_WINSIM
|
||||
#define FREERTOS
|
||||
#define USE_WINDOWS_API
|
||||
#endif
|
||||
|
||||
#ifdef FREERTOS
|
||||
#define NO_WRITEV
|
||||
#define NO_SHA512
|
||||
#define NO_DH
|
||||
#define NO_DSA
|
||||
#define NO_HC128
|
||||
|
||||
#ifndef SINGLE_THREADED
|
||||
#include "FreeRTOS.h"
|
||||
#include "semphr.h"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef CYASSL_GAME_BUILD
|
||||
#define SIZEOF_LONG_LONG 8
|
||||
#if defined(__PPU) || defined(__XENON)
|
||||
#define BIG_ENDIAN_ORDER
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef MICRIUM
|
||||
|
||||
#include "stdlib.h"
|
||||
#include "net_cfg.h"
|
||||
#include "ssl_cfg.h"
|
||||
#include "net_secure_os.h"
|
||||
|
||||
#define CYASSL_TYPES
|
||||
|
||||
typedef CPU_INT08U byte;
|
||||
typedef CPU_INT16U word16;
|
||||
typedef CPU_INT32U word32;
|
||||
|
||||
#if (NET_SECURE_MGR_CFG_WORD_SIZE == CPU_WORD_SIZE_32)
|
||||
#define SIZEOF_LONG 4
|
||||
#undef SIZEOF_LONG_LONG
|
||||
#else
|
||||
#undef SIZEOF_LONG
|
||||
#define SIZEOF_LONG_LONG 8
|
||||
#endif
|
||||
|
||||
#define STRING_USER
|
||||
|
||||
#define XSTRLEN(pstr) ((CPU_SIZE_T)Str_Len((CPU_CHAR *)(pstr)))
|
||||
#define XSTRNCPY(pstr_dest, pstr_src, len_max) \
|
||||
((CPU_CHAR *)Str_Copy_N((CPU_CHAR *)(pstr_dest), \
|
||||
(CPU_CHAR *)(pstr_src), (CPU_SIZE_T)(len_max)))
|
||||
#define XSTRNCMP(pstr_1, pstr_2, len_max) \
|
||||
((CPU_INT16S)Str_Cmp_N((CPU_CHAR *)(pstr_1), \
|
||||
(CPU_CHAR *)(pstr_2), (CPU_SIZE_T)(len_max)))
|
||||
#define XSTRSTR(pstr, pstr_srch) \
|
||||
((CPU_CHAR *)Str_Str((CPU_CHAR *)(pstr), \
|
||||
(CPU_CHAR *)(pstr_srch)))
|
||||
#define XMEMSET(pmem, data_val, size) \
|
||||
((void)Mem_Set((void *)(pmem), (CPU_INT08U) (data_val), \
|
||||
(CPU_SIZE_T)(size)))
|
||||
#define XMEMCPY(pdest, psrc, size) ((void)Mem_Copy((void *)(pdest), \
|
||||
(void *)(psrc), (CPU_SIZE_T)(size)))
|
||||
#define XMEMCMP(pmem_1, pmem_2, size) \
|
||||
(((CPU_BOOLEAN)Mem_Cmp((void *)(pmem_1), (void *)(pmem_2), \
|
||||
(CPU_SIZE_T)(size))) ? DEF_NO : DEF_YES)
|
||||
#define XMEMMOVE XMEMCPY
|
||||
|
||||
#if (NET_SECURE_MGR_CFG_EN == DEF_ENABLED)
|
||||
#define MICRIUM_MALLOC
|
||||
#define XMALLOC(s, h, type) ((void *)NetSecure_BlkGet((CPU_INT08U)(type), \
|
||||
(CPU_SIZE_T)(s), (void *)0))
|
||||
#define XFREE(p, h, type) (NetSecure_BlkFree((CPU_INT08U)(type), \
|
||||
(p), (void *)0))
|
||||
#define XREALLOC(p, n, h, t) realloc((p), (n))
|
||||
#endif
|
||||
|
||||
#if (NET_SECURE_MGR_CFG_FS_EN == DEF_ENABLED)
|
||||
#undef NO_FILESYSTEM
|
||||
#else
|
||||
#define NO_FILESYSTEM
|
||||
#endif
|
||||
|
||||
#if (SSL_CFG_TRACE_LEVEL == CYASSL_TRACE_LEVEL_DBG)
|
||||
#define DEBUG_CYASSL
|
||||
#else
|
||||
#undef DEBUG_CYASSL
|
||||
#endif
|
||||
|
||||
#if (SSL_CFG_OPENSSL_EN == DEF_ENABLED)
|
||||
#define OPENSSL_EXTRA
|
||||
#else
|
||||
#undef OPENSSL_EXTRA
|
||||
#endif
|
||||
|
||||
#if (SSL_CFG_MULTI_THREAD_EN == DEF_ENABLED)
|
||||
#undef SINGLE_THREADED
|
||||
#else
|
||||
#define SINGLE_THREADED
|
||||
#endif
|
||||
|
||||
#if (SSL_CFG_DH_EN == DEF_ENABLED)
|
||||
#undef NO_DH
|
||||
#else
|
||||
#define NO_DH
|
||||
#endif
|
||||
|
||||
#if (SSL_CFG_DSA_EN == DEF_ENABLED)
|
||||
#undef NO_DSA
|
||||
#else
|
||||
#define NO_DSA
|
||||
#endif
|
||||
|
||||
#if (SSL_CFG_PSK_EN == DEF_ENABLED)
|
||||
#undef NO_PSK
|
||||
#else
|
||||
#define NO_PSK
|
||||
#endif
|
||||
|
||||
#if (SSL_CFG_3DES_EN == DEF_ENABLED)
|
||||
#undef NO_DES
|
||||
#else
|
||||
#define NO_DES
|
||||
#endif
|
||||
|
||||
#if (SSL_CFG_AES_EN == DEF_ENABLED)
|
||||
#undef NO_AES
|
||||
#else
|
||||
#define NO_AES
|
||||
#endif
|
||||
|
||||
#if (SSL_CFG_RC4_EN == DEF_ENABLED)
|
||||
#undef NO_RC4
|
||||
#else
|
||||
#define NO_RC4
|
||||
#endif
|
||||
|
||||
#if (SSL_CFG_RABBIT_EN == DEF_ENABLED)
|
||||
#undef NO_RABBIT
|
||||
#else
|
||||
#define NO_RABBIT
|
||||
#endif
|
||||
|
||||
#if (SSL_CFG_HC128_EN == DEF_ENABLED)
|
||||
#undef NO_HC128
|
||||
#else
|
||||
#define NO_HC128
|
||||
#endif
|
||||
|
||||
#if (CPU_CFG_ENDIAN_TYPE == CPU_ENDIAN_TYPE_BIG)
|
||||
#define BIG_ENDIAN_ORDER
|
||||
#else
|
||||
#undef BIG_ENDIAN_ORDER
|
||||
#define LITTLE_ENDIAN_ORDER
|
||||
#endif
|
||||
|
||||
#if (SSL_CFG_MD4_EN == DEF_ENABLED)
|
||||
#undef NO_MD4
|
||||
#else
|
||||
#define NO_MD4
|
||||
#endif
|
||||
|
||||
#if (SSL_CFG_WRITEV_EN == DEF_ENABLED)
|
||||
#undef NO_WRITEV
|
||||
#else
|
||||
#define NO_WRITEV
|
||||
#endif
|
||||
|
||||
#if (SSL_CFG_USER_RNG_SEED_EN == DEF_ENABLED)
|
||||
#define NO_DEV_RANDOM
|
||||
#else
|
||||
#undef NO_DEV_RANDOM
|
||||
#endif
|
||||
|
||||
#if (SSL_CFG_USER_IO_EN == DEF_ENABLED)
|
||||
#define CYASSL_USER_IO
|
||||
#else
|
||||
#undef CYASSL_USER_IO
|
||||
#endif
|
||||
|
||||
#if (SSL_CFG_DYNAMIC_BUFFERS_EN == DEF_ENABLED)
|
||||
#undef LARGE_STATIC_BUFFERS
|
||||
#undef STATIC_CHUNKS_ONLY
|
||||
#else
|
||||
#define LARGE_STATIC_BUFFERS
|
||||
#define STATIC_CHUNKS_ONLY
|
||||
#endif
|
||||
|
||||
#if (SSL_CFG_DER_LOAD_EN == DEF_ENABLED)
|
||||
#define CYASSL_DER_LOAD
|
||||
#else
|
||||
#undef CYASSL_DER_LOAD
|
||||
#endif
|
||||
|
||||
#if (SSL_CFG_DTLS_EN == DEF_ENABLED)
|
||||
#define CYASSL_DTLS
|
||||
#else
|
||||
#undef CYASSL_DTLS
|
||||
#endif
|
||||
|
||||
#if (SSL_CFG_CALLBACKS_EN == DEF_ENABLED)
|
||||
#define CYASSL_CALLBACKS
|
||||
#else
|
||||
#undef CYASSL_CALLBACKS
|
||||
#endif
|
||||
|
||||
#if (SSL_CFG_FAST_MATH_EN == DEF_ENABLED)
|
||||
#define USE_FAST_MATH
|
||||
#else
|
||||
#undef USE_FAST_MATH
|
||||
#endif
|
||||
|
||||
#if (SSL_CFG_TFM_TIMING_RESISTANT_EN == DEF_ENABLED)
|
||||
#define TFM_TIMING_RESISTANT
|
||||
#else
|
||||
#undef TFM_TIMING_RESISTANT
|
||||
#endif
|
||||
|
||||
#endif /* MICRIUM */
|
||||
|
||||
|
||||
#if !defined(XMALLOC_USER) && !defined(MICRIUM_MALLOC)
|
||||
#define USE_CYASSL_MEMORY
|
||||
#endif
|
||||
|
||||
/* Place any other flags or defines here */
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* CTAO_CRYPT_SETTINGS_H */
|
||||
|
||||
@@ -1,62 +0,0 @@
|
||||
/* sha.h
|
||||
*
|
||||
* Copyright (C) 2006-2012 Sawtooth Consulting Ltd.
|
||||
*
|
||||
* This file is part of CyaSSL.
|
||||
*
|
||||
* CyaSSL is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* CyaSSL is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
*/
|
||||
|
||||
|
||||
#ifndef CTAO_CRYPT_SHA_H
|
||||
#define CTAO_CRYPT_SHA_H
|
||||
|
||||
#include <cyassl/ctaocrypt/types.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
/* in bytes */
|
||||
enum {
|
||||
SHA = 1, /* hash type unique */
|
||||
SHA_BLOCK_SIZE = 64,
|
||||
SHA_DIGEST_SIZE = 20,
|
||||
SHA_PAD_SIZE = 56
|
||||
};
|
||||
|
||||
|
||||
/* Sha digest */
|
||||
typedef struct Sha {
|
||||
word32 buffLen; /* in bytes */
|
||||
word32 loLen; /* length in bytes */
|
||||
word32 hiLen; /* length in bytes */
|
||||
word32 digest[SHA_DIGEST_SIZE / sizeof(word32)];
|
||||
word32 buffer[SHA_BLOCK_SIZE / sizeof(word32)];
|
||||
} Sha;
|
||||
|
||||
|
||||
CYASSL_API void InitSha(Sha*);
|
||||
CYASSL_API void ShaUpdate(Sha*, const byte*, word32);
|
||||
CYASSL_API void ShaFinal(Sha*, byte*);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
#endif /* CTAO_CRYPT_SHA_H */
|
||||
|
||||
@@ -1,68 +0,0 @@
|
||||
/* sha256.h
|
||||
*
|
||||
* Copyright (C) 2006-2012 Sawtooth Consulting Ltd.
|
||||
*
|
||||
* This file is part of CyaSSL.
|
||||
*
|
||||
* CyaSSL is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* CyaSSL is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
*/
|
||||
|
||||
|
||||
/* code submitted by raphael.huck@efixo.com */
|
||||
|
||||
|
||||
#ifndef NO_SHA256
|
||||
|
||||
#ifndef CTAO_CRYPT_SHA256_H
|
||||
#define CTAO_CRYPT_SHA256_H
|
||||
|
||||
#include <cyassl/ctaocrypt/types.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
/* in bytes */
|
||||
enum {
|
||||
SHA256 = 2, /* hash type unique */
|
||||
SHA256_BLOCK_SIZE = 64,
|
||||
SHA256_DIGEST_SIZE = 32,
|
||||
SHA256_PAD_SIZE = 56
|
||||
};
|
||||
|
||||
|
||||
/* Sha256 digest */
|
||||
typedef struct Sha256 {
|
||||
word32 buffLen; /* in bytes */
|
||||
word32 loLen; /* length in bytes */
|
||||
word32 hiLen; /* length in bytes */
|
||||
word32 digest[SHA256_DIGEST_SIZE / sizeof(word32)];
|
||||
word32 buffer[SHA256_BLOCK_SIZE / sizeof(word32)];
|
||||
} Sha256;
|
||||
|
||||
|
||||
CYASSL_API void InitSha256(Sha256*);
|
||||
CYASSL_API void Sha256Update(Sha256*, const byte*, word32);
|
||||
CYASSL_API void Sha256Final(Sha256*, byte*);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
#endif /* CTAO_CRYPT_SHA256_H */
|
||||
#endif /* NO_SHA256 */
|
||||
|
||||
@@ -1,91 +0,0 @@
|
||||
/* sha512.h
|
||||
*
|
||||
* Copyright (C) 2006-2012 Sawtooth Consulting Ltd.
|
||||
*
|
||||
* This file is part of CyaSSL.
|
||||
*
|
||||
* CyaSSL is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* CyaSSL is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
*/
|
||||
|
||||
|
||||
#ifdef CYASSL_SHA512
|
||||
|
||||
#ifndef CTAO_CRYPT_SHA512_H
|
||||
#define CTAO_CRYPT_SHA512_H
|
||||
|
||||
#include <cyassl/ctaocrypt/types.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
/* in bytes */
|
||||
enum {
|
||||
SHA512 = 4, /* hash type unique */
|
||||
SHA512_BLOCK_SIZE = 128,
|
||||
SHA512_DIGEST_SIZE = 64,
|
||||
SHA512_PAD_SIZE = 112
|
||||
};
|
||||
|
||||
|
||||
/* Sha512 digest */
|
||||
typedef struct Sha512 {
|
||||
word32 buffLen; /* in bytes */
|
||||
word32 loLen; /* length in bytes */
|
||||
word32 hiLen; /* length in bytes */
|
||||
word64 digest[SHA512_DIGEST_SIZE / sizeof(word64)];
|
||||
word64 buffer[SHA512_BLOCK_SIZE / sizeof(word64)];
|
||||
} Sha512;
|
||||
|
||||
|
||||
CYASSL_API void InitSha512(Sha512*);
|
||||
CYASSL_API void Sha512Update(Sha512*, const byte*, word32);
|
||||
CYASSL_API void Sha512Final(Sha512*, byte*);
|
||||
|
||||
|
||||
#ifdef CYASSL_SHA384
|
||||
|
||||
/* in bytes */
|
||||
enum {
|
||||
SHA384 = 5, /* hash type unique */
|
||||
SHA384_BLOCK_SIZE = 128,
|
||||
SHA384_DIGEST_SIZE = 48,
|
||||
SHA384_PAD_SIZE = 112
|
||||
};
|
||||
|
||||
|
||||
/* Sha384 digest */
|
||||
typedef struct Sha384 {
|
||||
word32 buffLen; /* in bytes */
|
||||
word32 loLen; /* length in bytes */
|
||||
word32 hiLen; /* length in bytes */
|
||||
word64 digest[SHA512_DIGEST_SIZE / sizeof(word64)]; /* for transform 512 */
|
||||
word64 buffer[SHA384_BLOCK_SIZE / sizeof(word64)];
|
||||
} Sha384;
|
||||
|
||||
|
||||
CYASSL_API void InitSha384(Sha384*);
|
||||
CYASSL_API void Sha384Update(Sha384*, const byte*, word32);
|
||||
CYASSL_API void Sha384Final(Sha384*, byte*);
|
||||
|
||||
#endif /* CYASSL_SHA384 */
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
#endif /* CTAO_CRYPT_SHA512_H */
|
||||
#endif /* CYASSL_SHA512 */
|
||||
@@ -1,686 +0,0 @@
|
||||
/* tfm.h
|
||||
*
|
||||
* Copyright (C) 2006-2012 Sawtooth Consulting Ltd.
|
||||
*
|
||||
* This file is part of CyaSSL.
|
||||
*
|
||||
* CyaSSL is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* CyaSSL is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
* Based on public domain TomsFastMath 0.10 by Tom St Denis, tomstdenis@iahu.ca,
|
||||
* http://math.libtomcrypt.com
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* Edited by Mois<69>s Guimar<61>es (moises.guimaraes@phoebus.com.br)
|
||||
* to fit CyaSSL's needs.
|
||||
*/
|
||||
|
||||
|
||||
#ifndef CTAO_CRYPT_TFM_H
|
||||
#define CTAO_CRYPT_TFM_H
|
||||
|
||||
#include <cyassl/ctaocrypt/types.h>
|
||||
#ifndef CHAR_BIT
|
||||
#include <limits.h>
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#ifndef MIN
|
||||
#define MIN(x,y) ((x)<(y)?(x):(y))
|
||||
#endif
|
||||
|
||||
#ifndef MAX
|
||||
#define MAX(x,y) ((x)>(y)?(x):(y))
|
||||
#endif
|
||||
|
||||
|
||||
/* autodetect x86-64 and make sure we are using 64-bit digits with x86-64 asm */
|
||||
#if defined(__x86_64__)
|
||||
#if defined(TFM_X86) || defined(TFM_SSE2) || defined(TFM_ARM)
|
||||
#error x86-64 detected, x86-32/SSE2/ARM optimizations are not valid!
|
||||
#endif
|
||||
#if !defined(TFM_X86_64) && !defined(TFM_NO_ASM)
|
||||
#define TFM_X86_64
|
||||
#endif
|
||||
#endif
|
||||
#if defined(TFM_X86_64)
|
||||
#if !defined(FP_64BIT)
|
||||
#define FP_64BIT
|
||||
#endif
|
||||
#endif
|
||||
/* use 64-bit digit even if not using asm on x86_64 */
|
||||
#if defined(__x86_64__) && !defined(FP_64BIT)
|
||||
#define FP_64BIT
|
||||
#endif
|
||||
|
||||
/* try to detect x86-32 */
|
||||
#if defined(__i386__) && !defined(TFM_SSE2)
|
||||
#if defined(TFM_X86_64) || defined(TFM_ARM)
|
||||
#error x86-32 detected, x86-64/ARM optimizations are not valid!
|
||||
#endif
|
||||
#if !defined(TFM_X86) && !defined(TFM_NO_ASM)
|
||||
#define TFM_X86
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* make sure we're 32-bit for x86-32/sse/arm/ppc32 */
|
||||
#if (defined(TFM_X86) || defined(TFM_SSE2) || defined(TFM_ARM) || defined(TFM_PPC32)) && defined(FP_64BIT)
|
||||
#warning x86-32, SSE2 and ARM, PPC32 optimizations require 32-bit digits (undefining)
|
||||
#undef FP_64BIT
|
||||
#endif
|
||||
|
||||
/* multi asms? */
|
||||
#ifdef TFM_X86
|
||||
#define TFM_ASM
|
||||
#endif
|
||||
#ifdef TFM_X86_64
|
||||
#ifdef TFM_ASM
|
||||
#error TFM_ASM already defined!
|
||||
#endif
|
||||
#define TFM_ASM
|
||||
#endif
|
||||
#ifdef TFM_SSE2
|
||||
#ifdef TFM_ASM
|
||||
#error TFM_ASM already defined!
|
||||
#endif
|
||||
#define TFM_ASM
|
||||
#endif
|
||||
#ifdef TFM_ARM
|
||||
#ifdef TFM_ASM
|
||||
#error TFM_ASM already defined!
|
||||
#endif
|
||||
#define TFM_ASM
|
||||
#endif
|
||||
#ifdef TFM_PPC32
|
||||
#ifdef TFM_ASM
|
||||
#error TFM_ASM already defined!
|
||||
#endif
|
||||
#define TFM_ASM
|
||||
#endif
|
||||
#ifdef TFM_PPC64
|
||||
#ifdef TFM_ASM
|
||||
#error TFM_ASM already defined!
|
||||
#endif
|
||||
#define TFM_ASM
|
||||
#endif
|
||||
#ifdef TFM_AVR32
|
||||
#ifdef TFM_ASM
|
||||
#error TFM_ASM already defined!
|
||||
#endif
|
||||
#define TFM_ASM
|
||||
#endif
|
||||
|
||||
/* we want no asm? */
|
||||
#ifdef TFM_NO_ASM
|
||||
#undef TFM_X86
|
||||
#undef TFM_X86_64
|
||||
#undef TFM_SSE2
|
||||
#undef TFM_ARM
|
||||
#undef TFM_PPC32
|
||||
#undef TFM_PPC64
|
||||
#undef TFM_AVR32
|
||||
#undef TFM_ASM
|
||||
#endif
|
||||
|
||||
/* ECC helpers */
|
||||
#ifdef TFM_ECC192
|
||||
#ifdef FP_64BIT
|
||||
#define TFM_MUL3
|
||||
#define TFM_SQR3
|
||||
#else
|
||||
#define TFM_MUL6
|
||||
#define TFM_SQR6
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef TFM_ECC224
|
||||
#ifdef FP_64BIT
|
||||
#define TFM_MUL4
|
||||
#define TFM_SQR4
|
||||
#else
|
||||
#define TFM_MUL7
|
||||
#define TFM_SQR7
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef TFM_ECC256
|
||||
#ifdef FP_64BIT
|
||||
#define TFM_MUL4
|
||||
#define TFM_SQR4
|
||||
#else
|
||||
#define TFM_MUL8
|
||||
#define TFM_SQR8
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef TFM_ECC384
|
||||
#ifdef FP_64BIT
|
||||
#define TFM_MUL6
|
||||
#define TFM_SQR6
|
||||
#else
|
||||
#define TFM_MUL12
|
||||
#define TFM_SQR12
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef TFM_ECC521
|
||||
#ifdef FP_64BIT
|
||||
#define TFM_MUL9
|
||||
#define TFM_SQR9
|
||||
#else
|
||||
#define TFM_MUL17
|
||||
#define TFM_SQR17
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
/* some default configurations.
|
||||
*/
|
||||
#if defined(FP_64BIT)
|
||||
/* for GCC only on supported platforms */
|
||||
#ifndef CRYPT
|
||||
typedef unsigned long ulong64;
|
||||
#endif
|
||||
typedef ulong64 fp_digit;
|
||||
typedef unsigned long fp_word __attribute__ ((mode(TI)));
|
||||
#else
|
||||
/* this is to make porting into LibTomCrypt easier :-) */
|
||||
#ifndef CRYPT
|
||||
#if defined(_MSC_VER) || defined(__BORLANDC__)
|
||||
typedef unsigned __int64 ulong64;
|
||||
typedef signed __int64 long64;
|
||||
#else
|
||||
typedef unsigned long long ulong64;
|
||||
typedef signed long long long64;
|
||||
#endif
|
||||
#endif
|
||||
typedef unsigned int fp_digit;
|
||||
typedef ulong64 fp_word;
|
||||
#endif
|
||||
|
||||
/* # of digits this is */
|
||||
#define DIGIT_BIT (int)((CHAR_BIT) * sizeof(fp_digit))
|
||||
|
||||
/* Max size of any number in bits. Basically the largest size you will be
|
||||
* multiplying should be half [or smaller] of FP_MAX_SIZE-four_digit
|
||||
*
|
||||
* It defaults to 4096-bits [allowing multiplications upto 2048x2048 bits ]
|
||||
*/
|
||||
#ifndef FP_MAX_BITS
|
||||
#define FP_MAX_BITS 4096
|
||||
#endif
|
||||
#define FP_MAX_SIZE (FP_MAX_BITS+(8*DIGIT_BIT))
|
||||
|
||||
/* will this lib work? */
|
||||
#if (CHAR_BIT & 7)
|
||||
#error CHAR_BIT must be a multiple of eight.
|
||||
#endif
|
||||
#if FP_MAX_BITS % CHAR_BIT
|
||||
#error FP_MAX_BITS must be a multiple of CHAR_BIT
|
||||
#endif
|
||||
|
||||
#define FP_MASK (fp_digit)(-1)
|
||||
#define FP_SIZE (FP_MAX_SIZE/DIGIT_BIT)
|
||||
|
||||
/* signs */
|
||||
#define FP_ZPOS 0
|
||||
#define FP_NEG 1
|
||||
|
||||
/* return codes */
|
||||
#define FP_OKAY 0
|
||||
#define FP_VAL 1
|
||||
#define FP_MEM 2
|
||||
|
||||
/* equalities */
|
||||
#define FP_LT -1 /* less than */
|
||||
#define FP_EQ 0 /* equal to */
|
||||
#define FP_GT 1 /* greater than */
|
||||
|
||||
/* replies */
|
||||
#define FP_YES 1 /* yes response */
|
||||
#define FP_NO 0 /* no response */
|
||||
|
||||
/* a FP type */
|
||||
typedef struct {
|
||||
fp_digit dp[FP_SIZE];
|
||||
int used,
|
||||
sign;
|
||||
} fp_int;
|
||||
|
||||
/* externally define this symbol to ignore the default settings, useful for changing the build from the make process */
|
||||
#ifndef TFM_ALREADY_SET
|
||||
|
||||
/* do we want the large set of small multiplications ?
|
||||
Enable these if you are going to be doing a lot of small (<= 16 digit) multiplications say in ECC
|
||||
Or if you're on a 64-bit machine doing RSA as a 1024-bit integer == 16 digits ;-)
|
||||
*/
|
||||
/* need to refactor the function */
|
||||
/*#define TFM_SMALL_SET */
|
||||
|
||||
/* do we want huge code
|
||||
Enable these if you are doing 20, 24, 28, 32, 48, 64 digit multiplications (useful for RSA)
|
||||
Less important on 64-bit machines as 32 digits == 2048 bits
|
||||
*/
|
||||
#if 0
|
||||
#define TFM_MUL3
|
||||
#define TFM_MUL4
|
||||
#define TFM_MUL6
|
||||
#define TFM_MUL7
|
||||
#define TFM_MUL8
|
||||
#define TFM_MUL9
|
||||
#define TFM_MUL12
|
||||
#define TFM_MUL17
|
||||
#endif
|
||||
#ifdef TFM_SMALL_SET
|
||||
#define TFM_MUL20
|
||||
#define TFM_MUL24
|
||||
#define TFM_MUL28
|
||||
#define TFM_MUL32
|
||||
#if (FP_MAX_BITS >= 6144) && defined(FP_64BIT)
|
||||
#define TFM_MUL48
|
||||
#endif
|
||||
#if (FP_MAX_BITS >= 8192) && defined(FP_64BIT)
|
||||
#define TFM_MUL64
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if 0
|
||||
#define TFM_SQR3
|
||||
#define TFM_SQR4
|
||||
#define TFM_SQR6
|
||||
#define TFM_SQR7
|
||||
#define TFM_SQR8
|
||||
#define TFM_SQR9
|
||||
#define TFM_SQR12
|
||||
#define TFM_SQR17
|
||||
#endif
|
||||
#ifdef TFM_SMALL_SET
|
||||
#define TFM_SQR20
|
||||
#define TFM_SQR24
|
||||
#define TFM_SQR28
|
||||
#define TFM_SQR32
|
||||
#define TFM_SQR48
|
||||
#define TFM_SQR64
|
||||
#endif
|
||||
|
||||
/* do we want some overflow checks
|
||||
Not required if you make sure your numbers are within range (e.g. by default a modulus for fp_exptmod() can only be upto 2048 bits long)
|
||||
*/
|
||||
/* #define TFM_CHECK */
|
||||
|
||||
/* Is the target a P4 Prescott
|
||||
*/
|
||||
/* #define TFM_PRESCOTT */
|
||||
|
||||
/* Do we want timing resistant fp_exptmod() ?
|
||||
* This makes it slower but also timing invariant with respect to the exponent
|
||||
*/
|
||||
/* #define TFM_TIMING_RESISTANT */
|
||||
|
||||
#endif /* TFM_ALREADY_SET */
|
||||
|
||||
/* functions */
|
||||
|
||||
/* returns a TFM ident string useful for debugging... */
|
||||
/*const char *fp_ident(void);*/
|
||||
|
||||
/* initialize [or zero] an fp int */
|
||||
#define fp_init(a) (void)XMEMSET((a), 0, sizeof(fp_int))
|
||||
#define fp_zero(a) fp_init(a)
|
||||
|
||||
/* zero/even/odd ? */
|
||||
#define fp_iszero(a) (((a)->used == 0) ? FP_YES : FP_NO)
|
||||
#define fp_iseven(a) (((a)->used >= 0 && (((a)->dp[0] & 1) == 0)) ? FP_YES : FP_NO)
|
||||
#define fp_isodd(a) (((a)->used > 0 && (((a)->dp[0] & 1) == 1)) ? FP_YES : FP_NO)
|
||||
|
||||
/* set to a small digit */
|
||||
void fp_set(fp_int *a, fp_digit b);
|
||||
|
||||
/* copy from a to b */
|
||||
#define fp_copy(a, b) (void)(((a) != (b)) ? (XMEMCPY((b), (a), sizeof(fp_int))) : (void)0)
|
||||
#define fp_init_copy(a, b) fp_copy(b, a)
|
||||
|
||||
/* clamp digits */
|
||||
#define fp_clamp(a) { while ((a)->used && (a)->dp[(a)->used-1] == 0) --((a)->used); (a)->sign = (a)->used ? (a)->sign : FP_ZPOS; }
|
||||
|
||||
/* negate and absolute */
|
||||
#define fp_neg(a, b) { fp_copy(a, b); (b)->sign ^= 1; fp_clamp(b); }
|
||||
#define fp_abs(a, b) { fp_copy(a, b); (b)->sign = 0; }
|
||||
|
||||
/* right shift x digits */
|
||||
void fp_rshd(fp_int *a, int x);
|
||||
|
||||
/* left shift x digits */
|
||||
void fp_lshd(fp_int *a, int x);
|
||||
|
||||
/* signed comparison */
|
||||
int fp_cmp(fp_int *a, fp_int *b);
|
||||
|
||||
/* unsigned comparison */
|
||||
int fp_cmp_mag(fp_int *a, fp_int *b);
|
||||
|
||||
/* power of 2 operations */
|
||||
void fp_div_2d(fp_int *a, int b, fp_int *c, fp_int *d);
|
||||
void fp_mod_2d(fp_int *a, int b, fp_int *c);
|
||||
void fp_mul_2d(fp_int *a, int b, fp_int *c);
|
||||
void fp_2expt (fp_int *a, int b);
|
||||
void fp_mul_2(fp_int *a, fp_int *c);
|
||||
void fp_div_2(fp_int *a, fp_int *c);
|
||||
|
||||
/* Counts the number of lsbs which are zero before the first zero bit */
|
||||
/*int fp_cnt_lsb(fp_int *a);*/
|
||||
|
||||
/* c = a + b */
|
||||
void fp_add(fp_int *a, fp_int *b, fp_int *c);
|
||||
|
||||
/* c = a - b */
|
||||
void fp_sub(fp_int *a, fp_int *b, fp_int *c);
|
||||
|
||||
/* c = a * b */
|
||||
void fp_mul(fp_int *a, fp_int *b, fp_int *c);
|
||||
|
||||
/* b = a*a */
|
||||
void fp_sqr(fp_int *a, fp_int *b);
|
||||
|
||||
/* a/b => cb + d == a */
|
||||
int fp_div(fp_int *a, fp_int *b, fp_int *c, fp_int *d);
|
||||
|
||||
/* c = a mod b, 0 <= c < b */
|
||||
int fp_mod(fp_int *a, fp_int *b, fp_int *c);
|
||||
|
||||
/* compare against a single digit */
|
||||
int fp_cmp_d(fp_int *a, fp_digit b);
|
||||
|
||||
/* c = a + b */
|
||||
void fp_add_d(fp_int *a, fp_digit b, fp_int *c);
|
||||
|
||||
/* c = a - b */
|
||||
void fp_sub_d(fp_int *a, fp_digit b, fp_int *c);
|
||||
|
||||
/* c = a * b */
|
||||
void fp_mul_d(fp_int *a, fp_digit b, fp_int *c);
|
||||
|
||||
/* a/b => cb + d == a */
|
||||
/*int fp_div_d(fp_int *a, fp_digit b, fp_int *c, fp_digit *d);*/
|
||||
|
||||
/* c = a mod b, 0 <= c < b */
|
||||
/*int fp_mod_d(fp_int *a, fp_digit b, fp_digit *c);*/
|
||||
|
||||
/* ---> number theory <--- */
|
||||
/* d = a + b (mod c) */
|
||||
/*int fp_addmod(fp_int *a, fp_int *b, fp_int *c, fp_int *d);*/
|
||||
|
||||
/* d = a - b (mod c) */
|
||||
/*int fp_submod(fp_int *a, fp_int *b, fp_int *c, fp_int *d);*/
|
||||
|
||||
/* d = a * b (mod c) */
|
||||
int fp_mulmod(fp_int *a, fp_int *b, fp_int *c, fp_int *d);
|
||||
|
||||
/* c = a * a (mod b) */
|
||||
int fp_sqrmod(fp_int *a, fp_int *b, fp_int *c);
|
||||
|
||||
/* c = 1/a (mod b) */
|
||||
int fp_invmod(fp_int *a, fp_int *b, fp_int *c);
|
||||
|
||||
/* c = (a, b) */
|
||||
/*void fp_gcd(fp_int *a, fp_int *b, fp_int *c);*/
|
||||
|
||||
/* c = [a, b] */
|
||||
/*void fp_lcm(fp_int *a, fp_int *b, fp_int *c);*/
|
||||
|
||||
/* setups the montgomery reduction */
|
||||
int fp_montgomery_setup(fp_int *a, fp_digit *mp);
|
||||
|
||||
/* computes a = B**n mod b without division or multiplication useful for
|
||||
* normalizing numbers in a Montgomery system.
|
||||
*/
|
||||
void fp_montgomery_calc_normalization(fp_int *a, fp_int *b);
|
||||
|
||||
/* computes x/R == x (mod N) via Montgomery Reduction */
|
||||
void fp_montgomery_reduce(fp_int *a, fp_int *m, fp_digit mp);
|
||||
|
||||
/* d = a**b (mod c) */
|
||||
int fp_exptmod(fp_int *a, fp_int *b, fp_int *c, fp_int *d);
|
||||
|
||||
/* primality stuff */
|
||||
|
||||
/* perform a Miller-Rabin test of a to the base b and store result in "result" */
|
||||
/*void fp_prime_miller_rabin (fp_int * a, fp_int * b, int *result);*/
|
||||
|
||||
/* 256 trial divisions + 8 Miller-Rabins, returns FP_YES if probable prime */
|
||||
/*int fp_isprime(fp_int *a);*/
|
||||
|
||||
/* Primality generation flags */
|
||||
/*#define TFM_PRIME_BBS 0x0001 */ /* BBS style prime */
|
||||
/*#define TFM_PRIME_SAFE 0x0002 */ /* Safe prime (p-1)/2 == prime */
|
||||
/*#define TFM_PRIME_2MSB_OFF 0x0004 */ /* force 2nd MSB to 0 */
|
||||
/*#define TFM_PRIME_2MSB_ON 0x0008 */ /* force 2nd MSB to 1 */
|
||||
|
||||
/* callback for fp_prime_random, should fill dst with random bytes and return how many read [upto len] */
|
||||
/*typedef int tfm_prime_callback(unsigned char *dst, int len, void *dat);*/
|
||||
|
||||
/*#define fp_prime_random(a, t, size, bbs, cb, dat) fp_prime_random_ex(a, t, ((size) * 8) + 1, (bbs==1)?TFM_PRIME_BBS:0, cb, dat)*/
|
||||
|
||||
/*int fp_prime_random_ex(fp_int *a, int t, int size, int flags, tfm_prime_callback cb, void *dat);*/
|
||||
|
||||
/* radix conersions */
|
||||
int fp_count_bits(fp_int *a);
|
||||
|
||||
int fp_unsigned_bin_size(fp_int *a);
|
||||
void fp_read_unsigned_bin(fp_int *a, unsigned char *b, int c);
|
||||
void fp_to_unsigned_bin(fp_int *a, unsigned char *b);
|
||||
|
||||
/*int fp_signed_bin_size(fp_int *a);*/
|
||||
/*void fp_read_signed_bin(fp_int *a, unsigned char *b, int c);*/
|
||||
/*void fp_to_signed_bin(fp_int *a, unsigned char *b);*/
|
||||
|
||||
/*int fp_read_radix(fp_int *a, char *str, int radix);*/
|
||||
/*int fp_toradix(fp_int *a, char *str, int radix);*/
|
||||
/*int fp_toradix_n(fp_int * a, char *str, int radix, int maxlen);*/
|
||||
|
||||
|
||||
/* VARIOUS LOW LEVEL STUFFS */
|
||||
void s_fp_add(fp_int *a, fp_int *b, fp_int *c);
|
||||
void s_fp_sub(fp_int *a, fp_int *b, fp_int *c);
|
||||
void fp_reverse(unsigned char *s, int len);
|
||||
|
||||
void fp_mul_comba(fp_int *A, fp_int *B, fp_int *C);
|
||||
|
||||
#ifdef TFM_SMALL_SET
|
||||
void fp_mul_comba_small(fp_int *A, fp_int *B, fp_int *C);
|
||||
#endif
|
||||
|
||||
#ifdef TFM_MUL3
|
||||
void fp_mul_comba3(fp_int *A, fp_int *B, fp_int *C);
|
||||
#endif
|
||||
#ifdef TFM_MUL4
|
||||
void fp_mul_comba4(fp_int *A, fp_int *B, fp_int *C);
|
||||
#endif
|
||||
#ifdef TFM_MUL6
|
||||
void fp_mul_comba6(fp_int *A, fp_int *B, fp_int *C);
|
||||
#endif
|
||||
#ifdef TFM_MUL7
|
||||
void fp_mul_comba7(fp_int *A, fp_int *B, fp_int *C);
|
||||
#endif
|
||||
#ifdef TFM_MUL8
|
||||
void fp_mul_comba8(fp_int *A, fp_int *B, fp_int *C);
|
||||
#endif
|
||||
#ifdef TFM_MUL9
|
||||
void fp_mul_comba9(fp_int *A, fp_int *B, fp_int *C);
|
||||
#endif
|
||||
#ifdef TFM_MUL12
|
||||
void fp_mul_comba12(fp_int *A, fp_int *B, fp_int *C);
|
||||
#endif
|
||||
#ifdef TFM_MUL17
|
||||
void fp_mul_comba17(fp_int *A, fp_int *B, fp_int *C);
|
||||
#endif
|
||||
|
||||
#ifdef TFM_MUL20
|
||||
void fp_mul_comba20(fp_int *A, fp_int *B, fp_int *C);
|
||||
#endif
|
||||
#ifdef TFM_MUL24
|
||||
void fp_mul_comba24(fp_int *A, fp_int *B, fp_int *C);
|
||||
#endif
|
||||
#ifdef TFM_MUL28
|
||||
void fp_mul_comba28(fp_int *A, fp_int *B, fp_int *C);
|
||||
#endif
|
||||
#ifdef TFM_MUL32
|
||||
void fp_mul_comba32(fp_int *A, fp_int *B, fp_int *C);
|
||||
#endif
|
||||
#ifdef TFM_MUL48
|
||||
void fp_mul_comba48(fp_int *A, fp_int *B, fp_int *C);
|
||||
#endif
|
||||
#ifdef TFM_MUL64
|
||||
void fp_mul_comba64(fp_int *A, fp_int *B, fp_int *C);
|
||||
#endif
|
||||
|
||||
void fp_sqr_comba(fp_int *A, fp_int *B);
|
||||
|
||||
#ifdef TFM_SMALL_SET
|
||||
void fp_sqr_comba_small(fp_int *A, fp_int *B);
|
||||
#endif
|
||||
|
||||
#ifdef TFM_SQR3
|
||||
void fp_sqr_comba3(fp_int *A, fp_int *B);
|
||||
#endif
|
||||
#ifdef TFM_SQR4
|
||||
void fp_sqr_comba4(fp_int *A, fp_int *B);
|
||||
#endif
|
||||
#ifdef TFM_SQR6
|
||||
void fp_sqr_comba6(fp_int *A, fp_int *B);
|
||||
#endif
|
||||
#ifdef TFM_SQR7
|
||||
void fp_sqr_comba7(fp_int *A, fp_int *B);
|
||||
#endif
|
||||
#ifdef TFM_SQR8
|
||||
void fp_sqr_comba8(fp_int *A, fp_int *B);
|
||||
#endif
|
||||
#ifdef TFM_SQR9
|
||||
void fp_sqr_comba9(fp_int *A, fp_int *B);
|
||||
#endif
|
||||
#ifdef TFM_SQR12
|
||||
void fp_sqr_comba12(fp_int *A, fp_int *B);
|
||||
#endif
|
||||
#ifdef TFM_SQR17
|
||||
void fp_sqr_comba17(fp_int *A, fp_int *B);
|
||||
#endif
|
||||
|
||||
#ifdef TFM_SQR20
|
||||
void fp_sqr_comba20(fp_int *A, fp_int *B);
|
||||
#endif
|
||||
#ifdef TFM_SQR24
|
||||
void fp_sqr_comba24(fp_int *A, fp_int *B);
|
||||
#endif
|
||||
#ifdef TFM_SQR28
|
||||
void fp_sqr_comba28(fp_int *A, fp_int *B);
|
||||
#endif
|
||||
#ifdef TFM_SQR32
|
||||
void fp_sqr_comba32(fp_int *A, fp_int *B);
|
||||
#endif
|
||||
#ifdef TFM_SQR48
|
||||
void fp_sqr_comba48(fp_int *A, fp_int *B);
|
||||
#endif
|
||||
#ifdef TFM_SQR64
|
||||
void fp_sqr_comba64(fp_int *A, fp_int *B);
|
||||
#endif
|
||||
/*extern const char *fp_s_rmap;*/
|
||||
|
||||
|
||||
/**
|
||||
* Used by CyaSSL
|
||||
*/
|
||||
|
||||
/* Types */
|
||||
typedef fp_digit mp_digit;
|
||||
typedef fp_word mp_word;
|
||||
typedef fp_int mp_int;
|
||||
|
||||
/* Constants */
|
||||
#define MP_LT FP_LT /* less than */
|
||||
#define MP_EQ FP_EQ /* equal to */
|
||||
#define MP_GT FP_GT /* greater than */
|
||||
#define MP_OKAY FP_OKAY /* ok result */
|
||||
#define MP_NO FP_NO /* yes/no result */
|
||||
#define MP_YES FP_YES /* yes/no result */
|
||||
|
||||
/* Prototypes */
|
||||
int mp_init (mp_int * a);
|
||||
void mp_clear (mp_int * a);
|
||||
int mp_init_multi(mp_int* a, mp_int* b, mp_int* c, mp_int* d, mp_int* e, mp_int* f);
|
||||
|
||||
int mp_add (mp_int * a, mp_int * b, mp_int * c);
|
||||
int mp_sub (mp_int * a, mp_int * b, mp_int * c);
|
||||
int mp_add_d (mp_int * a, mp_digit b, mp_int * c);
|
||||
|
||||
int mp_mul (mp_int * a, mp_int * b, mp_int * c);
|
||||
int mp_mulmod (mp_int * a, mp_int * b, mp_int * c, mp_int * d);
|
||||
int mp_mod(mp_int *a, mp_int *b, mp_int *c);
|
||||
int mp_invmod(mp_int *a, mp_int *b, mp_int *c);
|
||||
int mp_exptmod (mp_int * G, mp_int * X, mp_int * P, mp_int * Y);
|
||||
|
||||
int mp_cmp(mp_int *a, mp_int *b);
|
||||
int mp_cmp_d(mp_int *a, mp_digit b);
|
||||
|
||||
int mp_unsigned_bin_size(mp_int * a);
|
||||
int mp_read_unsigned_bin (mp_int * a, const unsigned char *b, int c);
|
||||
int mp_to_unsigned_bin (mp_int * a, unsigned char *b);
|
||||
|
||||
int mp_sub_d(fp_int *a, fp_digit b, fp_int *c);
|
||||
int mp_copy(fp_int* a, fp_int* b);
|
||||
int mp_isodd(mp_int* a);
|
||||
int mp_iszero(mp_int* a);
|
||||
int mp_count_bits(mp_int *a);
|
||||
int mp_set_int(fp_int *a, fp_digit b);
|
||||
|
||||
#ifdef HAVE_ECC
|
||||
int mp_read_radix(mp_int* a, const char* str, int radix);
|
||||
int mp_set(fp_int *a, fp_digit b);
|
||||
int mp_sqr(fp_int *A, fp_int *B);
|
||||
int mp_montgomery_reduce(fp_int *a, fp_int *m, fp_digit mp);
|
||||
int mp_montgomery_setup(fp_int *a, fp_digit *rho);
|
||||
int mp_div_2(fp_int * a, fp_int * b);
|
||||
int mp_init_copy(fp_int * a, fp_int * b);
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_ECC) || defined(CYASSL_KEY_GEN)
|
||||
int mp_sqrmod(mp_int* a, mp_int* b, mp_int* c);
|
||||
int mp_montgomery_calc_normalization(mp_int *a, mp_int *b);
|
||||
#endif
|
||||
|
||||
#ifdef CYASSL_KEY_GEN
|
||||
int mp_gcd(fp_int *a, fp_int *b, fp_int *c);
|
||||
int mp_lcm(fp_int *a, fp_int *b, fp_int *c);
|
||||
int mp_prime_is_prime(mp_int* a, int t, int* result);
|
||||
#endif /* CYASSL_KEY_GEN */
|
||||
|
||||
CYASSL_API word32 CheckRunTimeFastMath(void);
|
||||
|
||||
/* If user uses RSA, DH, DSA, or ECC math lib directly then fast math FP_SIZE
|
||||
must match, return 1 if a match otherwise 0 */
|
||||
#define CheckFastMathSettings() (FP_SIZE == CheckRunTimeFastMath())
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* CTAO_CRYPT_TFM_H */
|
||||
@@ -1,263 +0,0 @@
|
||||
/* types.h
|
||||
*
|
||||
* Copyright (C) 2006-2012 Sawtooth Consulting Ltd.
|
||||
*
|
||||
* This file is part of CyaSSL.
|
||||
*
|
||||
* CyaSSL is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* CyaSSL is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
*/
|
||||
|
||||
|
||||
#ifndef CTAO_CRYPT_TYPES_H
|
||||
#define CTAO_CRYPT_TYPES_H
|
||||
|
||||
#include <cyassl/ctaocrypt/settings.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(WORDS_BIGENDIAN) || (defined(__MWERKS__) && !defined(__INTEL__))
|
||||
#define BIG_ENDIAN_ORDER
|
||||
#endif
|
||||
|
||||
#ifndef BIG_ENDIAN_ORDER
|
||||
#define LITTLE_ENDIAN_ORDER
|
||||
#endif
|
||||
|
||||
#ifndef CYASSL_TYPES
|
||||
#ifndef byte
|
||||
typedef unsigned char byte;
|
||||
#endif
|
||||
typedef unsigned short word16;
|
||||
typedef unsigned int word32;
|
||||
#endif
|
||||
|
||||
|
||||
/* try to set SIZEOF_LONG or LONG_LONG if user didn't */
|
||||
#if !defined(_MSC_VER) && !defined(__BCPLUSPLUS__)
|
||||
#if !defined(SIZEOF_LONG_LONG) && !defined(SIZEOF_LONG)
|
||||
#if (defined(__alpha__) || defined(__ia64__) || defined(_ARCH_PPC64) \
|
||||
|| defined(__mips64) || defined(__x86_64__))
|
||||
/* long should be 64bit */
|
||||
#define SIZEOF_LONG 8
|
||||
#elif (defined__i386__)
|
||||
/* long long should be 64bit */
|
||||
#define SIZEOF_LONG_LONG 8
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(_MSC_VER) || defined(__BCPLUSPLUS__)
|
||||
#define WORD64_AVAILABLE
|
||||
#define W64LIT(x) x##ui64
|
||||
typedef unsigned __int64 word64;
|
||||
#elif SIZEOF_LONG == 8
|
||||
#define WORD64_AVAILABLE
|
||||
#define W64LIT(x) x##LL
|
||||
typedef unsigned long word64;
|
||||
#elif SIZEOF_LONG_LONG == 8
|
||||
#define WORD64_AVAILABLE
|
||||
#define W64LIT(x) x##LL
|
||||
typedef unsigned long long word64;
|
||||
#else
|
||||
#define MP_16BIT /* for mp_int, mp_word needs to be twice as big as
|
||||
mp_digit, no 64 bit type so make mp_digit 16 bit */
|
||||
#endif
|
||||
|
||||
|
||||
/* These platforms have 64-bit CPU registers. */
|
||||
#if (defined(__alpha__) || defined(__ia64__) || defined(_ARCH_PPC64) || \
|
||||
defined(__mips64) || defined(__x86_64__))
|
||||
typedef word64 word;
|
||||
#else
|
||||
typedef word32 word;
|
||||
#ifdef WORD64_AVAILABLE
|
||||
#define CTAOCRYPT_SLOW_WORD64
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
enum {
|
||||
WORD_SIZE = sizeof(word),
|
||||
BIT_SIZE = 8,
|
||||
WORD_BITS = WORD_SIZE * BIT_SIZE
|
||||
};
|
||||
|
||||
|
||||
/* use inlining if compiler allows */
|
||||
#ifndef INLINE
|
||||
#ifndef NO_INLINE
|
||||
#ifdef _MSC_VER
|
||||
#define INLINE __inline
|
||||
#elif defined(__GNUC__)
|
||||
#define INLINE inline
|
||||
#elif defined(THREADX)
|
||||
#define INLINE _Inline
|
||||
#else
|
||||
#define INLINE
|
||||
#endif
|
||||
#else
|
||||
#define INLINE
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
/* set up rotate style */
|
||||
#if defined(_MSC_VER) || defined(__BCPLUSPLUS__)
|
||||
#define INTEL_INTRINSICS
|
||||
#define FAST_ROTATE
|
||||
#elif defined(__MWERKS__) && TARGET_CPU_PPC
|
||||
#define PPC_INTRINSICS
|
||||
#define FAST_ROTATE
|
||||
#elif defined(__GNUC__) && defined(__i386__)
|
||||
/* GCC does peephole optimizations which should result in using rotate
|
||||
instructions */
|
||||
#define FAST_ROTATE
|
||||
#endif
|
||||
|
||||
|
||||
/* Micrium will use Visual Studio for compilation but not the Win32 API */
|
||||
#if defined(_WIN32) && !defined(MICRIUM) && !defined(FREERTOS)
|
||||
#define USE_WINDOWS_API
|
||||
#endif
|
||||
|
||||
|
||||
/* idea to add global alloc override by Moisés Guimarães */
|
||||
/* default to libc stuff */
|
||||
/* XREALLOC is used once in normal math lib, not in fast math lib */
|
||||
/* XFREE on some embeded systems doesn't like free(0) so test */
|
||||
#ifdef XMALLOC_USER
|
||||
/* prototypes for user heap override functions */
|
||||
#include <stddef.h> /* for size_t */
|
||||
extern void *XMALLOC(size_t n, void* heap, int type);
|
||||
extern void *XREALLOC(void *p, size_t n, void* heap, int type);
|
||||
extern void XFREE(void *p, void* heap, int type);
|
||||
#elif !defined(MICRIUM_MALLOC)
|
||||
/* default C runtime, can install different routines at runtime */
|
||||
#include <cyassl/ctaocrypt/memory.h>
|
||||
#define XMALLOC(s, h, t) CyaSSL_Malloc((s))
|
||||
#define XFREE(p, h, t) {void* xp = (p); if((xp)) CyaSSL_Free((xp));}
|
||||
#define XREALLOC(p, n, h, t) CyaSSL_Realloc((p), (n))
|
||||
#endif
|
||||
|
||||
#ifndef STRING_USER
|
||||
#include <string.h>
|
||||
char* mystrnstr(const char* s1, const char* s2, unsigned int n);
|
||||
|
||||
#define XMEMCPY(d,s,l) memcpy((d),(s),(l))
|
||||
#define XMEMSET(b,c,l) memset((b),(c),(l))
|
||||
#define XMEMCMP(s1,s2,n) memcmp((s1),(s2),(n))
|
||||
#define XMEMMOVE(d,s,l) memmove((d),(s),(l))
|
||||
|
||||
#define XSTRLEN(s1) strlen((s1))
|
||||
#define XSTRNCPY(s1,s2,n) strncpy((s1),(s2),(n))
|
||||
/* strstr, strncmp, and strncat only used by CyaSSL proper, not required for
|
||||
CTaoCrypt only */
|
||||
#define XSTRSTR(s1,s2) strstr((s1),(s2))
|
||||
#define XSTRNSTR(s1,s2,n) mystrnstr((s1),(s2),(n))
|
||||
#define XSTRNCMP(s1,s2,n) strncmp((s1),(s2),(n))
|
||||
#define XSTRNCAT(s1,s2,n) strncat((s1),(s2),(n))
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_ECC
|
||||
#ifndef CTYPE_USER
|
||||
#include <ctype.h>
|
||||
#define XTOUPPER(c) toupper((c))
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
/* memory allocation types for user hints */
|
||||
enum {
|
||||
DYNAMIC_TYPE_CA = 1,
|
||||
DYNAMIC_TYPE_CERT = 2,
|
||||
DYNAMIC_TYPE_KEY = 3,
|
||||
DYNAMIC_TYPE_FILE = 4,
|
||||
DYNAMIC_TYPE_SUBJECT_CN = 5,
|
||||
DYNAMIC_TYPE_PUBLIC_KEY = 6,
|
||||
DYNAMIC_TYPE_SIGNER = 7,
|
||||
DYNAMIC_TYPE_NONE = 8,
|
||||
DYNAMIC_TYPE_BIGINT = 9,
|
||||
DYNAMIC_TYPE_RSA = 10,
|
||||
DYNAMIC_TYPE_METHOD = 11,
|
||||
DYNAMIC_TYPE_OUT_BUFFER = 12,
|
||||
DYNAMIC_TYPE_IN_BUFFER = 13,
|
||||
DYNAMIC_TYPE_INFO = 14,
|
||||
DYNAMIC_TYPE_DH = 15,
|
||||
DYNAMIC_TYPE_DOMAIN = 16,
|
||||
DYNAMIC_TYPE_SSL = 17,
|
||||
DYNAMIC_TYPE_CTX = 18,
|
||||
DYNAMIC_TYPE_WRITEV = 19,
|
||||
DYNAMIC_TYPE_OPENSSL = 20,
|
||||
DYNAMIC_TYPE_DSA = 21,
|
||||
DYNAMIC_TYPE_CRL = 22,
|
||||
DYNAMIC_TYPE_REVOKED = 23,
|
||||
DYNAMIC_TYPE_CRL_ENTRY = 24,
|
||||
DYNAMIC_TYPE_CERT_MANAGER = 25,
|
||||
DYNAMIC_TYPE_CRL_MONITOR = 26,
|
||||
DYNAMIC_TYPE_OCSP_STATUS = 27,
|
||||
DYNAMIC_TYPE_OCSP_ENTRY = 28,
|
||||
DYNAMIC_TYPE_ALTNAME = 29
|
||||
};
|
||||
|
||||
/* stack protection */
|
||||
enum {
|
||||
MIN_STACK_BUFFER = 8
|
||||
};
|
||||
|
||||
|
||||
|
||||
/* settings detection for compile vs runtime math incombatibilities */
|
||||
enum {
|
||||
#if !defined(USE_FAST_MATH) && !defined(SIZEOF_LONG) && !defined(SIZEOF_LONG_LONG)
|
||||
CTC_SETTINGS = 0x0
|
||||
#elif !defined(USE_FAST_MATH) && defined(SIZEOF_LONG) && (SIZEOF_LONG == 8)
|
||||
CTC_SETTINGS = 0x1
|
||||
#elif !defined(USE_FAST_MATH) && defined(SIZEOF_LONG_LONG) && (SIZEOF_LONG_LONG == 8)
|
||||
CTC_SETTINGS = 0x2
|
||||
#elif !defined(USE_FAST_MATH) && defined(SIZEOF_LONG_LONG) && (SIZEOF_LONG_LONG == 4)
|
||||
CTC_SETTINGS = 0x4
|
||||
#elif defined(USE_FAST_MATH) && !defined(SIZEOF_LONG) && !defined(SIZEOF_LONG_LONG)
|
||||
CTC_SETTINGS = 0x8
|
||||
#elif defined(USE_FAST_MATH) && defined(SIZEOF_LONG) && (SIZEOF_LONG == 8)
|
||||
CTC_SETTINGS = 0x10
|
||||
#elif defined(USE_FAST_MATH) && defined(SIZEOF_LONG_LONG) && (SIZEOF_LONG_LONG == 8)
|
||||
CTC_SETTINGS = 0x20
|
||||
#elif defined(USE_FAST_MATH) && defined(SIZEOF_LONG_LONG) && (SIZEOF_LONG_LONG == 4)
|
||||
CTC_SETTINGS = 0x40
|
||||
#else
|
||||
#error "bad math long / long long settings"
|
||||
#endif
|
||||
};
|
||||
|
||||
|
||||
CYASSL_API word32 CheckRunTimeSettings(void);
|
||||
|
||||
/* If user uses RSA, DH, DSA, or ECC math lib directly then fast math and long
|
||||
types need to match at compile time and run time, CheckCtcSettings will
|
||||
return 1 if a match otherwise 0 */
|
||||
#define CheckCtcSettings() (CTC_SETTINGS == CheckRunTimeSettings())
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* CTAO_CRYPT_TYPES_H */
|
||||
|
||||
@@ -1,69 +0,0 @@
|
||||
/* visibility.h
|
||||
*
|
||||
* Copyright (C) 2006-2012 Sawtooth Consulting Ltd.
|
||||
*
|
||||
* This file is part of CyaSSL.
|
||||
*
|
||||
* CyaSSL is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* CyaSSL is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
*/
|
||||
|
||||
/* Visibility control macros */
|
||||
|
||||
|
||||
#ifndef CTAO_CRYPT_VISIBILITY_H
|
||||
#define CTAO_CRYPT_VISIBILITY_H
|
||||
|
||||
|
||||
/* CYASSL_API is used for the public API symbols.
|
||||
It either imports or exports (or does nothing for static builds)
|
||||
|
||||
CYASSL_LOCAL is used for non-API symbols (private).
|
||||
*/
|
||||
|
||||
#if defined(BUILDING_CYASSL)
|
||||
#if defined(HAVE_VISIBILITY) && HAVE_VISIBILITY
|
||||
#define CYASSL_API __attribute__ ((visibility("default")))
|
||||
#define CYASSL_LOCAL __attribute__ ((visibility("hidden")))
|
||||
#elif defined(__SUNPRO_C) && (__SUNPRO_C >= 0x550)
|
||||
#define CYASSL_API __global
|
||||
#define CYASSL_LOCAL __hidden
|
||||
#elif defined(_MSC_VER)
|
||||
#ifdef CYASSL_DLL
|
||||
#define CYASSL_API extern __declspec(dllexport)
|
||||
#else
|
||||
#define CYASSL_API
|
||||
#endif
|
||||
#define CYASSL_LOCAL
|
||||
#else
|
||||
#define CYASSL_API
|
||||
#define CYASSL_LOCAL
|
||||
#endif /* HAVE_VISIBILITY */
|
||||
#else /* BUILDING_CYASSL */
|
||||
#if defined(_MSC_VER)
|
||||
#ifdef CYASSL_DLL
|
||||
#define CYASSL_API extern __declspec(dllimport)
|
||||
#else
|
||||
#define CYASSL_API
|
||||
#endif
|
||||
#define CYASSL_LOCAL
|
||||
#else
|
||||
#define CYASSL_API
|
||||
#define CYASSL_LOCAL
|
||||
#endif
|
||||
#endif /* BUILDING_CYASSL */
|
||||
|
||||
|
||||
#endif /* CTAO_CRYPT_VISIBILITY_H */
|
||||
|
||||
@@ -1,133 +0,0 @@
|
||||
/* error.h
|
||||
*
|
||||
* Copyright (C) 2006-2012 Sawtooth Consulting Ltd.
|
||||
*
|
||||
* This file is part of CyaSSL.
|
||||
*
|
||||
* CyaSSL is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* CyaSSL is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
*/
|
||||
|
||||
|
||||
#ifndef CYASSL_ERROR_H
|
||||
#define CYASSL_ERROR_H
|
||||
|
||||
#include <cyassl/ctaocrypt/error.h> /* pull in CTaoCrypt errors */
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
enum CyaSSL_ErrorCodes {
|
||||
INPUT_CASE_ERROR = -201, /* process input state error */
|
||||
PREFIX_ERROR = -202, /* bad index to key rounds */
|
||||
MEMORY_ERROR = -203, /* out of memory */
|
||||
VERIFY_FINISHED_ERROR = -204, /* verify problem on finished */
|
||||
VERIFY_MAC_ERROR = -205, /* verify mac problem */
|
||||
PARSE_ERROR = -206, /* parse error on header */
|
||||
UNKNOWN_HANDSHAKE_TYPE = -207, /* weird handshake type */
|
||||
SOCKET_ERROR_E = -208, /* error state on socket */
|
||||
SOCKET_NODATA = -209, /* expected data, not there */
|
||||
INCOMPLETE_DATA = -210, /* don't have enough data to
|
||||
complete task */
|
||||
UNKNOWN_RECORD_TYPE = -211, /* unknown type in record hdr */
|
||||
DECRYPT_ERROR = -212, /* error during decryption */
|
||||
FATAL_ERROR = -213, /* recvd alert fatal error */
|
||||
ENCRYPT_ERROR = -214, /* error during encryption */
|
||||
FREAD_ERROR = -215, /* fread problem */
|
||||
NO_PEER_KEY = -216, /* need peer's key */
|
||||
NO_PRIVATE_KEY = -217, /* need the private key */
|
||||
RSA_PRIVATE_ERROR = -218, /* error during rsa priv op */
|
||||
NO_DH_PARAMS = -219, /* server missing DH params */
|
||||
BUILD_MSG_ERROR = -220, /* build message failure */
|
||||
|
||||
BAD_HELLO = -221, /* client hello malformed */
|
||||
DOMAIN_NAME_MISMATCH = -222, /* peer subject name mismatch */
|
||||
WANT_READ = -223, /* want read, call again */
|
||||
NOT_READY_ERROR = -224, /* handshake layer not ready */
|
||||
PMS_VERSION_ERROR = -225, /* pre m secret version error */
|
||||
VERSION_ERROR = -226, /* record layer version error */
|
||||
WANT_WRITE = -227, /* want write, call again */
|
||||
BUFFER_ERROR = -228, /* malformed buffer input */
|
||||
VERIFY_CERT_ERROR = -229, /* verify cert error */
|
||||
VERIFY_SIGN_ERROR = -230, /* verify sign error */
|
||||
CLIENT_ID_ERROR = -231, /* psk client identity error */
|
||||
SERVER_HINT_ERROR = -232, /* psk server hint error */
|
||||
PSK_KEY_ERROR = -233, /* psk key error */
|
||||
ZLIB_INIT_ERROR = -234, /* zlib init error */
|
||||
ZLIB_COMPRESS_ERROR = -235, /* zlib compression error */
|
||||
ZLIB_DECOMPRESS_ERROR = -236, /* zlib decompression error */
|
||||
|
||||
GETTIME_ERROR = -237, /* gettimeofday failed ??? */
|
||||
GETITIMER_ERROR = -238, /* getitimer failed ??? */
|
||||
SIGACT_ERROR = -239, /* sigaction failed ??? */
|
||||
SETITIMER_ERROR = -240, /* setitimer failed ??? */
|
||||
LENGTH_ERROR = -241, /* record layer length error */
|
||||
PEER_KEY_ERROR = -242, /* can't decode peer key */
|
||||
ZERO_RETURN = -243, /* peer sent close notify */
|
||||
SIDE_ERROR = -244, /* wrong client/server type */
|
||||
NO_PEER_CERT = -245, /* peer didn't send key */
|
||||
NTRU_KEY_ERROR = -246, /* NTRU key error */
|
||||
NTRU_DRBG_ERROR = -247, /* NTRU drbg error */
|
||||
NTRU_ENCRYPT_ERROR = -248, /* NTRU encrypt error */
|
||||
NTRU_DECRYPT_ERROR = -249, /* NTRU decrypt error */
|
||||
ECC_CURVETYPE_ERROR = -250, /* Bad ECC Curve Type */
|
||||
ECC_CURVE_ERROR = -251, /* Bad ECC Curve */
|
||||
ECC_PEERKEY_ERROR = -252, /* Bad Peer ECC Key */
|
||||
ECC_MAKEKEY_ERROR = -253, /* Bad Make ECC Key */
|
||||
ECC_EXPORT_ERROR = -254, /* Bad ECC Export Key */
|
||||
ECC_SHARED_ERROR = -255, /* Bad ECC Shared Secret */
|
||||
BAD_MUTEX_ERROR = -256, /* Bad mutex */
|
||||
NOT_CA_ERROR = -257, /* Not a CA cert error */
|
||||
BAD_PATH_ERROR = -258, /* Bad path for opendir */
|
||||
BAD_CERT_MANAGER_ERROR = -259, /* Bad Cert Manager */
|
||||
OCSP_CERT_REVOKED = -260, /* OCSP Certificate revoked */
|
||||
CRL_CERT_REVOKED = -261, /* CRL Certificate revoked */
|
||||
CRL_MISSING = -262, /* CRL Not loaded */
|
||||
MONITOR_RUNNING_E = -263, /* CRL Monitor already running */
|
||||
THREAD_CREATE_E = -264, /* Thread Create Error */
|
||||
OCSP_NEED_URL = -265, /* OCSP need an URL for lookup */
|
||||
OCSP_CERT_UNKNOWN = -266, /* OCSP responder doesn't know */
|
||||
OCSP_LOOKUP_FAIL = -267, /* OCSP lookup not successful */
|
||||
MAX_CHAIN_ERROR = -268, /* max chain depth exceeded */
|
||||
COOKIE_ERROR = -269, /* dtls cookie error */
|
||||
/* add strings to SetErrorString !!!!! */
|
||||
|
||||
/* begin negotiation parameter errors */
|
||||
UNSUPPORTED_SUITE = -290, /* unsupported cipher suite */
|
||||
MATCH_SUITE_ERROR = -291 /* can't match cipher suite */
|
||||
/* end negotiation parameter errors only 10 for now */
|
||||
/* add strings to SetErrorString !!!!! */
|
||||
};
|
||||
|
||||
|
||||
#ifdef CYASSL_CALLBACKS
|
||||
enum {
|
||||
MIN_PARAM_ERR = UNSUPPORTED_SUITE,
|
||||
MAX_PARAM_ERR = MIN_PARAM_ERR - 10
|
||||
};
|
||||
#endif
|
||||
|
||||
|
||||
CYASSL_LOCAL
|
||||
void SetErrorString(int error, char* buffer);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* CyaSSL_ERROR_H */
|
||||
|
||||
@@ -1,20 +0,0 @@
|
||||
# vim:ft=automake
|
||||
# All paths should be given relative to the root
|
||||
#
|
||||
|
||||
include cyassl/ctaocrypt/include.am
|
||||
include cyassl/openssl/include.am
|
||||
|
||||
EXTRA_DIST+= cyassl/sniffer_error.rc
|
||||
|
||||
nobase_include_HEADERS+= \
|
||||
cyassl/error.h \
|
||||
cyassl/internal.h \
|
||||
cyassl/ssl.h \
|
||||
cyassl/sniffer_error.h \
|
||||
cyassl/sniffer.h \
|
||||
cyassl/callbacks.h \
|
||||
cyassl/test.h \
|
||||
cyassl/version.h \
|
||||
cyassl/ocsp.h \
|
||||
cyassl/crl.h
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,52 +0,0 @@
|
||||
/* ssl.h
|
||||
*
|
||||
* Copyright (C) 2006-2012 Sawtooth Consulting Ltd.
|
||||
*
|
||||
* This file is part of CyaSSL.
|
||||
*
|
||||
* CyaSSL is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* CyaSSL is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
*/
|
||||
|
||||
|
||||
/* CyaSSL OCSP API */
|
||||
|
||||
#ifndef CYASSL_OCSP_H
|
||||
#define CYASSL_OCSP_H
|
||||
|
||||
|
||||
#include <cyassl/ssl.h>
|
||||
#include <cyassl/ctaocrypt/asn.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct CYASSL_OCSP CYASSL_OCSP;
|
||||
|
||||
CYASSL_LOCAL int CyaSSL_OCSP_Init(CYASSL_OCSP*);
|
||||
CYASSL_LOCAL void CyaSSL_OCSP_Cleanup(CYASSL_OCSP*);
|
||||
|
||||
CYASSL_LOCAL int CyaSSL_OCSP_set_override_url(CYASSL_OCSP*, const char*);
|
||||
CYASSL_LOCAL int CyaSSL_OCSP_Lookup_Cert(CYASSL_OCSP*, DecodedCert*);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* CYASSL_OCSP_H */
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user