mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-07-29 18:27:29 +02:00
Compare commits
983 Commits
Author | SHA1 | Date | |
---|---|---|---|
16db0c234e | |||
3378f8f25e | |||
5c5cee0789 | |||
427a421ec5 | |||
831d9cf640 | |||
3b4ff94931 | |||
1357cdb0e4 | |||
505b1a8a67 | |||
55401c13dd | |||
14b100fee6 | |||
37a9a7a457 | |||
1b5bc04e4a | |||
d04c915227 | |||
e6c80f0725 | |||
5e633ea6fd | |||
37c5ba26bf | |||
7db3116ae4 | |||
f3a707724b | |||
43f320d5e2 | |||
99b6c1d3c3 | |||
f9bf003718 | |||
b66cb11cb8 | |||
705aa0f453 | |||
226f018829 | |||
b3d99f2d32 | |||
593e466a44 | |||
98e6ad3ee9 | |||
307c71d9cb | |||
773d0da1bc | |||
fdb2416e49 | |||
d0c2e9b7a2 | |||
29b32e582a | |||
0d0fc27e42 | |||
ed82f06382 | |||
60c2388ae7 | |||
f3af0124e4 | |||
7fd3b8a993 | |||
87eb94b7c4 | |||
b51d6f3b8f | |||
c3cb9b3b43 | |||
0c34ecb451 | |||
e0a84521c5 | |||
17ab84eb07 | |||
42a0f3500f | |||
affbb3ef27 | |||
4502716fc4 | |||
b5ba31501c | |||
25e910a0a9 | |||
5f3ee80407 | |||
85d25798a5 | |||
d02af46256 | |||
a1f25a9299 | |||
8c70b11528 | |||
7f7c595d10 | |||
9559f09028 | |||
b40c2c0b1f | |||
33a7d7481d | |||
ae84982777 | |||
f1d1898ddf | |||
cb2082edee | |||
4ad91673ca | |||
ebd03368c7 | |||
79fad81c32 | |||
5c665fe614 | |||
baa012b1d9 | |||
b2ef938cbe | |||
af48800c58 | |||
2b59554245 | |||
cf25dfb16e | |||
1680b47ac6 | |||
e4a95342f1 | |||
9382f74f2e | |||
4b9c3d3512 | |||
9753e46721 | |||
616e4a66dd | |||
8b90414f2a | |||
2030bab8d8 | |||
4ed2cf4b6e | |||
8df0e43384 | |||
acaa2c02bf | |||
80225e58aa | |||
c325436712 | |||
abed4cf669 | |||
d2003bb8b7 | |||
b347df8d9a | |||
a243281ca9 | |||
4b3c3c92b3 | |||
ff68942ce4 | |||
082f5643ed | |||
7252b7ecd4 | |||
fd5937b599 | |||
da342ea079 | |||
7693b4282a | |||
10e6e7fbb5 | |||
c2a82bce3d | |||
926a62b458 | |||
04c6a447ab | |||
d3ceb89fb0 | |||
b430a14032 | |||
55763ef318 | |||
8f5e98486f | |||
a4c6ed0dda | |||
dcf88daae7 | |||
2051ee49b7 | |||
4dbb2d6d3b | |||
cfdfa7b2b3 | |||
05f11c4bca | |||
091c7a7ef3 | |||
ac716c96d3 | |||
9905787f4a | |||
2a741ba469 | |||
f5c3458795 | |||
61bf080290 | |||
871c116395 | |||
32705fb380 | |||
d7e74d0383 | |||
07407bbdaa | |||
712b3dd17c | |||
8f0b695249 | |||
83b96d748e | |||
ca4b2b3f90 | |||
f4c379cb96 | |||
47b468d14f | |||
8cb5f6d5d4 | |||
9c9c59cec3 | |||
9505f92bd1 | |||
018d1684c9 | |||
fa35353e75 | |||
a7228d0463 | |||
a0c630b4ee | |||
a56544c8b8 | |||
a0dc1b6f47 | |||
864f0468aa | |||
bc1a6282eb | |||
5104f4ea7a | |||
57512c46e8 | |||
1e6119bb0d | |||
42b937b8f3 | |||
d2d25b9b83 | |||
8c1310e376 | |||
aebd926472 | |||
8e64f9903d | |||
5a1886656a | |||
5c4fdb30ad | |||
87048698e5 | |||
791767e026 | |||
411a096b2b | |||
05dd84598b | |||
9dbf6a5e10 | |||
98b7ed9d47 | |||
942480e6ba | |||
477129b53e | |||
158029752c | |||
f12ba533e2 | |||
956ac08cab | |||
8e5532eb42 | |||
c27ebe546d | |||
65913b0d6c | |||
bad1c32df2 | |||
4491de3b77 | |||
8c0ee8a6f7 | |||
11d81b86de | |||
b5ac92bcd1 | |||
24ec09ef7a | |||
702c1b044d | |||
d665e16bd8 | |||
729fc1e603 | |||
71a1abebf5 | |||
f8ba117cef | |||
e38b4d5868 | |||
38dec0b932 | |||
1f09e35ccd | |||
dafcd8782a | |||
62a071262c | |||
d50b388a33 | |||
b806ca3c2f | |||
fe13b4b6c6 | |||
d279695314 | |||
8eee0b1d4c | |||
79432d9017 | |||
f29da112c6 | |||
4da114354b | |||
7c003c5755 | |||
fe0cd26b1e | |||
991a9094e6 | |||
b90d0d305d | |||
3cfb270a4d | |||
0b7e18040c | |||
f6edc37549 | |||
ba3e089596 | |||
8a6bd081c4 | |||
997d6dccf3 | |||
6d49631170 | |||
a74ac2b22c | |||
12f00a7acc | |||
b5c43d8ad4 | |||
576cb10732 | |||
a2bd6e786d | |||
f535e5428e | |||
97e0ec073f | |||
185331f007 | |||
1ff98154e5 | |||
27d6c727e0 | |||
0edc19feb2 | |||
e98193000a | |||
bea9084071 | |||
b0dca8ea69 | |||
9b0ffa0249 | |||
eeb8cdccde | |||
2dd22938d6 | |||
bf69de7054 | |||
786e4d9462 | |||
217254b533 | |||
f73585eec8 | |||
0480b2b60e | |||
1224d3d907 | |||
0005b4cbe4 | |||
13fb56d88e | |||
e9bc868dbb | |||
7004b2eafc | |||
30553a43ed | |||
9975d1d675 | |||
44352b5673 | |||
4b90474581 | |||
367429410f | |||
f8848aaa1b | |||
a572967017 | |||
332fd68347 | |||
c5385f902c | |||
ee0595f543 | |||
b6d49c5725 | |||
6aaf484b90 | |||
f396de1191 | |||
3db8935093 | |||
8a2936ebd4 | |||
82e3c00075 | |||
4a5a251e80 | |||
6d8246e98c | |||
8732fcddd9 | |||
2f6636559d | |||
547872683f | |||
7d287a6ba9 | |||
7d82bec7fc | |||
14b4bb3b0f | |||
f601b7bfda | |||
6bc7ba1592 | |||
8e53c7a62e | |||
72926b1eed | |||
7279d3bf85 | |||
9d77ca744f | |||
cb311e5708 | |||
8a924244c5 | |||
80e3c85737 | |||
75bb1a8fa7 | |||
2c452b305f | |||
d33f180760 | |||
436a51a0d7 | |||
d7c01be8bb | |||
d8b85da693 | |||
f65f86bb88 | |||
d6deb690e6 | |||
7522550cbf | |||
ace69d1c77 | |||
359803fc7d | |||
4d5712ca93 | |||
e63fa491aa | |||
4210716c22 | |||
965b70c32f | |||
3ecab06841 | |||
ea9784b32b | |||
c4714f71db | |||
46442075f4 | |||
a6d29aa628 | |||
dc55de007d | |||
ae9265fa44 | |||
7d7a72f2a6 | |||
3af1275f5d | |||
2d72bfe0eb | |||
2360c038be | |||
02581a3da2 | |||
e19c65da8b | |||
8564014983 | |||
692dc09d10 | |||
615f652bd0 | |||
72c5a92bde | |||
f878dbcef2 | |||
0f8111fc77 | |||
e8b9651075 | |||
fc928e7725 | |||
4f9e915bc1 | |||
a5d9005ac7 | |||
88938390ba | |||
b5d3613946 | |||
fa520f753d | |||
6ba3ae51f9 | |||
e3f72effb2 | |||
8e3f83e152 | |||
6ba7743fb3 | |||
31b03c8a2d | |||
ae63878700 | |||
0bcaf12bf4 | |||
543108bdcc | |||
e12f947c4f | |||
dd4be2496a | |||
2d9ed696c6 | |||
4e99c7ac99 | |||
bb103561ae | |||
2e980423ec | |||
2dfec3c6f1 | |||
e515638503 | |||
b9a7407d31 | |||
30b9033216 | |||
129de03da0 | |||
975ffe693b | |||
7cabbb4b54 | |||
99ef1a8d7e | |||
0a63898f5b | |||
f0c48fba45 | |||
e482c00cb1 | |||
25b4fed7b3 | |||
d0e16d25b4 | |||
11ffca451a | |||
dbe83c7405 | |||
a868451d72 | |||
a4c8d0e76c | |||
ec0a4d45cb | |||
4774f1b285 | |||
e8ce0b7f51 | |||
9a1b32d830 | |||
86f7d48c7e | |||
6773287895 | |||
1628b6f83f | |||
7914938e60 | |||
894a35a0f2 | |||
5a0d108cd9 | |||
f232ff84b4 | |||
7719cd9faa | |||
2ab409df96 | |||
49e62f0858 | |||
285ca36ca2 | |||
895944c04a | |||
87ad65d33f | |||
9210395c57 | |||
6b67d5e931 | |||
ebf25c5c4b | |||
d1277b1343 | |||
71f9ee4f2e | |||
b24f7f502c | |||
3f4c570aa1 | |||
7ce9315173 | |||
47e7e27bb2 | |||
ec3d060691 | |||
20e4889092 | |||
73f0395ca9 | |||
e1a73c1769 | |||
01a5368ffc | |||
43ed4a7424 | |||
f65dcd1378 | |||
6b3a80366f | |||
85b3346bbf | |||
23d6c70d3e | |||
591e1fc772 | |||
49e67487e7 | |||
01e9a246cd | |||
b9ab09a5a6 | |||
d52fe96063 | |||
43b8300896 | |||
12371d1c3b | |||
2667b8b542 | |||
98e766e770 | |||
3319ed9921 | |||
b4584e0a93 | |||
cc9ac1846d | |||
b397f89b27 | |||
f3a16e56c7 | |||
4fe2a1ec42 | |||
e947c86e67 | |||
48303918c2 | |||
88ba790930 | |||
6ff39cffe4 | |||
f4082f83e5 | |||
b2b45d3f4a | |||
ffc67892a4 | |||
598043dd6f | |||
2c1ed7c11c | |||
04d0c581b1 | |||
bdadeab342 | |||
07baa27b20 | |||
116f2403d0 | |||
7e29b8d2a6 | |||
59af8944cb | |||
abe921d703 | |||
87cad7a966 | |||
a8f6baf37c | |||
d9a9982bc8 | |||
df011b2e40 | |||
0acd8f0670 | |||
dfa1553548 | |||
9ea3371079 | |||
cdc651a75a | |||
62ef5de25c | |||
657b10c8b2 | |||
d65e5ef3e4 | |||
afb0cb3e20 | |||
5f7359be7e | |||
8ace08499b | |||
982b72796e | |||
30004498c5 | |||
44e0d7543c | |||
834ebe5bd8 | |||
f4f13371f9 | |||
36f62a5707 | |||
543d81ba97 | |||
24e22d4b6e | |||
44b6593fe5 | |||
defe5b4e31 | |||
01703281cc | |||
ba26b4b4e2 | |||
d799898a36 | |||
a3caa03381 | |||
7f4b0d1d3a | |||
5d29bf1e49 | |||
b3ffcbd5b4 | |||
2fc54ad751 | |||
95e7226447 | |||
b91f3c7c6d | |||
3ff842168e | |||
6edfb2a601 | |||
91b800ea46 | |||
a361f5c4bf | |||
532f0aaee7 | |||
ef644d4de0 | |||
b17b81ef43 | |||
6616975f81 | |||
0e3a093cc5 | |||
9f77aea1f8 | |||
a453ccba57 | |||
2e2de4cf4d | |||
b8b968d77f | |||
f65b0fc092 | |||
d5bf944630 | |||
425d418dee | |||
fe0772bcbf | |||
dfca5f82dd | |||
86c20f0e38 | |||
3f77a2c8c9 | |||
b327925a1b | |||
c7b5fbe552 | |||
ccff37f4b1 | |||
1139ad76aa | |||
6993bc58b1 | |||
9053a8c0ec | |||
4567e05851 | |||
eb221238c2 | |||
209e64ea79 | |||
d9a8bfbb80 | |||
5889b5d96d | |||
59e381d9db | |||
c75d738531 | |||
fa9126c2be | |||
d1515f8ee6 | |||
05165bc09e | |||
e85caee845 | |||
51c56051fb | |||
7f701ca194 | |||
eeb11a6e51 | |||
f3a0d311a0 | |||
f756573401 | |||
ac885c40f0 | |||
3b6ba7935d | |||
a695599667 | |||
ac227910f1 | |||
53e4c2ed72 | |||
0c363a17f1 | |||
acb3e446ab | |||
27a7cf609b | |||
3d88d8851a | |||
640a0cb0e3 | |||
44bf986827 | |||
4c453d4d69 | |||
f073f49ead | |||
6d3728fe61 | |||
4c9595c419 | |||
23ff36075b | |||
09ea7169d7 | |||
7ac6a21af5 | |||
561906cffd | |||
f0bc61a5d3 | |||
724297a127 | |||
e70838e984 | |||
581f91b984 | |||
03f9cafa4b | |||
0cfa423566 | |||
60f4919ee6 | |||
254d53bb18 | |||
d993ee1969 | |||
baf9bef8a3 | |||
cf114b92df | |||
ea3dc3d834 | |||
a7e0f4e483 | |||
acf1d07eea | |||
6913a46331 | |||
59419bef89 | |||
5bc976ee0f | |||
dc88a7e8eb | |||
9c58f70e29 | |||
6b15443a3b | |||
76bbcbb7b2 | |||
66a66c8905 | |||
831c760edc | |||
afbc34f0e0 | |||
5164c15216 | |||
541deaa0c0 | |||
902069783e | |||
51787db76b | |||
26cf98c878 | |||
4e657debfc | |||
96cc05b7b1 | |||
b36bc55197 | |||
359e86adf6 | |||
b25061844c | |||
c314dc3940 | |||
f82324a081 | |||
0e67cd17d6 | |||
726d686b07 | |||
a108c5565e | |||
c49e7a85f7 | |||
3a98eb7578 | |||
831e643a24 | |||
977ff51ad5 | |||
ed39a1652c | |||
ac1890922b | |||
7e8438b7b4 | |||
e925fbdbd6 | |||
87fbf7df80 | |||
da8eba2603 | |||
5ecca5a89d | |||
ca7e5d2463 | |||
067f10ae8e | |||
9005d2b54b | |||
f71376a42b | |||
8c97675979 | |||
f23013b8a7 | |||
c50f73b4cb | |||
ea3dc2361d | |||
92c5167327 | |||
584520fbc1 | |||
8c1d342715 | |||
5e4c0c426c | |||
0c9fe151de | |||
6e4d33eb00 | |||
6280aa9c91 | |||
77bf77dfd7 | |||
66a3ce2ec1 | |||
4af555b502 | |||
faa7283ff3 | |||
f5590f0abd | |||
7d4a5a6ec8 | |||
f8f7f69f48 | |||
b828ac047a | |||
f046e1d0be | |||
8b8c6bfa0f | |||
e5266f6640 | |||
7459b5b892 | |||
699b794a4a | |||
b96f0c6386 | |||
78c1d592cc | |||
a89398fdbc | |||
da386691a1 | |||
d4035e5f62 | |||
dd259b12c7 | |||
5d912d4c2b | |||
9ac2eaa3d6 | |||
4a7e56442a | |||
3130f0da28 | |||
5767db4cb5 | |||
54a7740cfe | |||
53c14bdf1f | |||
d6c4b37112 | |||
d4c99ae663 | |||
557c2ae469 | |||
21768d9626 | |||
4a007a2fa0 | |||
b8c9247769 | |||
11c8e5afb8 | |||
917bc83c60 | |||
e2ac17deb6 | |||
a8c0351fe4 | |||
b21bf90e1b | |||
5e48dcbeeb | |||
9aa8b71525 | |||
90e6a4dd8c | |||
134c6b8b1b | |||
ae905d70c4 | |||
85e8f1988a | |||
0e2c236e77 | |||
dc83cc6a0e | |||
f6304ae37a | |||
a4220120ba | |||
d732a2ef07 | |||
6348f3f2c7 | |||
905cf9c018 | |||
01138a5c53 | |||
f175bd302d | |||
a6b201c051 | |||
9871b13480 | |||
174618ebfb | |||
cf1f1f3ae7 | |||
335de43333 | |||
ce297f67af | |||
35b4f08049 | |||
91f075a5cf | |||
a1e8cd532d | |||
994fc1f8e3 | |||
767b452d61 | |||
60f28f322e | |||
d4d5243f4d | |||
01ae0696af | |||
0bbbea20be | |||
3e7619c785 | |||
f969bc3645 | |||
bb5280d0e4 | |||
0b4ed2c633 | |||
6737f5beb9 | |||
ba2a7f2627 | |||
936d0ff7a9 | |||
2885d66b17 | |||
1cb2f28308 | |||
57c6d46ea7 | |||
4d719897a5 | |||
aef97af361 | |||
5a421c04e7 | |||
d78770c1e5 | |||
3461c12083 | |||
cb08eb672e | |||
10306013bb | |||
b09d902ef4 | |||
ac998a0f7c | |||
db8bd91488 | |||
1be873533e | |||
a92b639155 | |||
f3b14343a5 | |||
b883cc55a4 | |||
1bc0dc53f9 | |||
a5d7a3ea8f | |||
c974d77213 | |||
ba4d058ba7 | |||
218ae522c6 | |||
114436e587 | |||
346a52a58c | |||
a89ec1ac91 | |||
afe043ee6c | |||
32dd1ab006 | |||
e3f54f332e | |||
cc0c89b02d | |||
454bfa4abd | |||
fe632a3f77 | |||
ef47f1a25e | |||
c11620f9b4 | |||
dc708f4f5b | |||
d99c5d8e06 | |||
8760e6ac3e | |||
a503f13321 | |||
6c0d473027 | |||
e673b1852a | |||
6abadd2f2a | |||
b76c42da7b | |||
400b1f1ae6 | |||
4a739f6bc7 | |||
57e7e28d6d | |||
9ca07d1f4d | |||
0d80343073 | |||
257d10a69f | |||
66c95b0c15 | |||
397fbb743f | |||
95a30e3f0a | |||
e970cdfbc0 | |||
f7c740df8f | |||
5f598e2649 | |||
9bbca6acfb | |||
829126f04d | |||
6d1e485ef4 | |||
36eeab927b | |||
e0413df92a | |||
e5c04e70a7 | |||
2c25481e7d | |||
dd421ebb7d | |||
30bec6c193 | |||
bd849ea9d7 | |||
c9617e86d6 | |||
0fc6c8a07d | |||
07c37ed50c | |||
d5d24df32a | |||
f044fbc1fe | |||
51a8901f6a | |||
dfb84dff37 | |||
d0affb0d0e | |||
2c0e7fd8e9 | |||
d3b01f9c56 | |||
cd0226924a | |||
9643e58dad | |||
4e19c234f4 | |||
ce2c76fd42 | |||
c3aedc940f | |||
4433fde099 | |||
7716da0881 | |||
bd0f508a0f | |||
19e50cd46a | |||
3ef8f65229 | |||
5fce4edb68 | |||
1cfd4e01cb | |||
afb559fddb | |||
08a3423f43 | |||
059db7f69c | |||
d1068d25d1 | |||
68cb6044cb | |||
989d7f4aad | |||
206f565820 | |||
f6c5bf032d | |||
d1baa9f541 | |||
53ccbddd01 | |||
88bba146ae | |||
40eb5b3cc5 | |||
e9c7cbf803 | |||
40972868ce | |||
7899252104 | |||
b160f8c486 | |||
cfd5a20e48 | |||
66bbb44f44 | |||
56ee2eaba8 | |||
97ca8439a4 | |||
407397e8be | |||
8c32a5a2ed | |||
9ddf43268d | |||
c47afaf84f | |||
56960ef1cc | |||
43a0a21fb6 | |||
982526ed13 | |||
0ee22d8f94 | |||
6943229f87 | |||
b1e603ae6b | |||
1ba8aff525 | |||
2bee126062 | |||
f8b106601b | |||
3361f7b7fe | |||
69afab58a5 | |||
6ce42706fe | |||
bdac618c3a | |||
820d934ae8 | |||
c9625789cd | |||
30a264eb65 | |||
0534d44c9e | |||
98bc1f8c46 | |||
457e214777 | |||
561a7fc35d | |||
2db5d29893 | |||
f8ffb086ec | |||
f6cca6049f | |||
79c14dc825 | |||
31d036178e | |||
87762e9012 | |||
501c6a67e7 | |||
7a12fb3e6b | |||
e2ae36f149 | |||
f1ed3cefc4 | |||
c20eb88d3d | |||
690938ffd4 | |||
03356be00b | |||
4b8fdb4371 | |||
925ddb6626 | |||
05692e1d6a | |||
c42792e0f1 | |||
198e48fa94 | |||
9d912970c8 | |||
7ec04c16b6 | |||
c08debf236 | |||
bfd510b919 | |||
4c66c4c3b5 | |||
a39f540c5a | |||
220bd66a63 | |||
1c2a3eddc1 | |||
d5fdb74d9a | |||
8b968d234a | |||
15fe7f4d94 | |||
3d90c359cd | |||
70552ef8e1 | |||
8343317e1b | |||
ecd007b287 | |||
8d2dc095dd | |||
aafe14ebc4 | |||
11df1d25d4 | |||
93c89ccc35 | |||
6722022201 | |||
80326fa1fa | |||
73349ec0d3 | |||
18c3679444 | |||
16ac91e6de | |||
17a92e76d3 | |||
6defed64cd | |||
08ff33894f | |||
bbde70c6fc | |||
dac47627b8 | |||
e601b37a32 | |||
d494254864 | |||
eedc2f3e47 | |||
3747246133 | |||
169331cf81 | |||
c4674c0cc3 | |||
a7aaf4fcaf | |||
8bfd6c0e7e | |||
d66722af15 | |||
435c1ae76c | |||
efb6932d8e | |||
820edc0299 | |||
706bd8a910 | |||
cf4ea232e3 | |||
ba0d887369 | |||
b83e1765da | |||
644726a3fc | |||
802d62513f | |||
901730e86e | |||
bdf11587c2 | |||
90446c3c5f | |||
afa27f0021 | |||
90385bb4b3 | |||
aecdb33e4e | |||
68e5124644 | |||
b8b5e7b873 | |||
a5af2e3d51 | |||
ab570a2130 | |||
368afbb815 | |||
e716380bad | |||
9b8c5fb40e | |||
45dde2da89 | |||
3401bba8a2 | |||
f904c598ed | |||
e0328ef78a | |||
85889f7fb9 | |||
e2eb1b78cc | |||
6e84ab1271 | |||
3cd231bdfc | |||
cf7e8baa19 | |||
aa164e5266 | |||
6d3c7d8c59 | |||
489fbf17fe | |||
07ca2bce56 | |||
cb178856a8 | |||
6f2b1b90a9 | |||
d408f01863 | |||
d607ffaf02 | |||
ac79d3b145 | |||
c9a4e9d56b | |||
4ffb3bbaae | |||
87a8cfadd3 | |||
aaad893804 | |||
1f0a32a7e3 | |||
bdacd5e8c4 | |||
1ac6db9d1d | |||
56d2180cf3 | |||
fe64523480 | |||
1f6c24f15a | |||
eb302b91b0 | |||
be4ce974d0 | |||
b1e39f66a3 | |||
638c095737 | |||
5dc0303dee | |||
2ce28d0328 | |||
22cb11f304 | |||
9295917ef2 | |||
6cdd8f46fa | |||
00cda6ab72 | |||
c2cf1fb708 | |||
4e3d7f494b | |||
3a9a195683 | |||
737cd127e8 | |||
918ea3a074 | |||
4e73ad8547 | |||
eecdfe1648 | |||
e39e27bb5b | |||
bac34015cc | |||
76bb3b2558 | |||
31bf833239 | |||
59e4c346f0 | |||
c08486e5e2 | |||
8f30850840 | |||
cb3d998301 | |||
3d91a55b88 | |||
ba2d7f590e | |||
217053a780 | |||
32fc5daf43 | |||
8a52cd3780 | |||
7edd1bd843 | |||
87b3df8621 | |||
6120f03173 | |||
6dd7eff1a8 | |||
ca7bf0d01e | |||
6d76b2f247 | |||
fbc5c8d6dc | |||
a1157da304 | |||
458302f9fe | |||
f528f5a7d3 | |||
4b8bb6cdfe | |||
9818fe4f55 | |||
c2292c31b0 | |||
28fb9fb0f7 | |||
02079a2f79 | |||
82a56daaaf | |||
a1bb4e3f93 | |||
6a62623c64 | |||
7332b4843c | |||
3f35c86520 | |||
0a31dc3a37 | |||
e8e575fd58 | |||
baddc07300 | |||
f2110487b6 | |||
73ddd32539 | |||
db7773aa54 | |||
0aea2607b5 | |||
2b48f248c4 | |||
97042d8661 | |||
708f38ac8d | |||
09e24d5469 | |||
e48f5a31d6 | |||
4c79ac1f88 | |||
2ed143bee0 | |||
2b6044c6ee | |||
ba6d956d02 | |||
387d9400b9 | |||
5b5b7e231d | |||
86408406fd | |||
3d67caa353 | |||
ecef0e38d5 | |||
ddb5c3a2aa | |||
8bf2d13f89 | |||
88b46d58d7 | |||
c3627df018 | |||
314630d0e3 | |||
7e322558ef | |||
6f90cdd465 | |||
2806c995a8 | |||
fd70122378 | |||
26153ffad6 | |||
a3e94f335b | |||
4b3a362705 | |||
a697a60bfd | |||
5bc728b882 | |||
7c91372621 | |||
839b5a4478 | |||
4b8ab62bd1 | |||
e5953ce6f6 | |||
146e7ff1f4 | |||
b9773673f7 | |||
ac92d30955 | |||
08d9e57bf6 | |||
c4ea674fc8 | |||
3ec2b9dbbc | |||
43592def99 | |||
32095795f2 | |||
6210ff78aa | |||
7b2d62f4f7 | |||
89b0c932a5 | |||
b26f577454 | |||
07990acaa6 | |||
59e0181c8d | |||
ea2585963f | |||
4feeeeda55 | |||
81a6ed4577 | |||
4d9fe4dafe | |||
833552ebac | |||
306a2013a9 | |||
b8411f1217 | |||
344b60eb92 | |||
d7d898697a | |||
5aad32eb28 | |||
7d1d277535 | |||
f9985f5399 | |||
7ee09ea23c | |||
669fbf2a14 | |||
9c5bcca1ab | |||
ec5b3fe313 | |||
f987da38d8 | |||
27f9cf01af | |||
cbde04a06b |
21
.gitignore
vendored
21
.gitignore
vendored
@ -1,3 +1,4 @@
|
||||
*.swp
|
||||
*.lo
|
||||
*.la
|
||||
*.o
|
||||
@ -11,9 +12,13 @@ config*
|
||||
*Release/
|
||||
*.ncb
|
||||
*.suo
|
||||
build-aux/
|
||||
rpm/spec
|
||||
stamp-h
|
||||
cyassl/options.h
|
||||
libtool.m4
|
||||
aclocal.m4
|
||||
aminclude.am
|
||||
lt*.m4
|
||||
INSTALL
|
||||
Makefile.in
|
||||
@ -23,6 +28,7 @@ missing
|
||||
libtool
|
||||
tags
|
||||
.tags*
|
||||
cyassl-config
|
||||
cyassl.sublime*
|
||||
ctaocrypt/benchmark/benchmark
|
||||
ctaocrypt/test/testctaocrypt
|
||||
@ -32,6 +38,7 @@ examples/echoserver/echoserver
|
||||
examples/server/server
|
||||
snifftest
|
||||
output
|
||||
mcapi/test
|
||||
testsuite/testsuite
|
||||
tests/unit
|
||||
testsuite/*.der
|
||||
@ -61,11 +68,21 @@ cyassl*rc*
|
||||
autoscan.log
|
||||
TAGS
|
||||
.DS_Store
|
||||
support/libcyassl.pc
|
||||
cyassl/version.h
|
||||
support/cyassl.pc
|
||||
cyassl/ctaocrypt/stamp-h1
|
||||
swig/_cyassl.so
|
||||
swig/cyassl.py
|
||||
swig/cyassl.pyc
|
||||
swig/cyassl_wrap.c
|
||||
stamp-h1
|
||||
clang_output_*
|
||||
internal.plist
|
||||
cov-int
|
||||
cyassl.tgz
|
||||
*.log
|
||||
*.trs
|
||||
IDE\MDK-ARM\Projects/
|
||||
IDE\MDK-ARM\STM32F2xx_StdPeriph_Lib/inc
|
||||
IDE\MDK-ARM\STM32F2xx_StdPeriph_Lib/src
|
||||
IDE\MDK-ARM\LPC43xx\Drivers/
|
||||
IDE\MDK-ARM\LPC43xx\LPC43xx/
|
||||
|
338
IDE/MDK-ARM/LPC43xx/startup_LPC43xx.s
Normal file
338
IDE/MDK-ARM/LPC43xx/startup_LPC43xx.s
Normal file
@ -0,0 +1,338 @@
|
||||
;/***********************************************************************
|
||||
; * $Id: startup_LPC43xx.s 6473 2011-02-16 17:40:54Z nxp27266 $
|
||||
; *
|
||||
; * Project: LPC43xx CMSIS Package
|
||||
; *
|
||||
; * Description: Cortex-M3 Core Device Startup File for the NXP LPC43xx
|
||||
; * Device Series.
|
||||
; *
|
||||
; * Copyright(C) 2011, NXP Semiconductor
|
||||
; * All rights reserved.
|
||||
; *
|
||||
; * modified by KEIL
|
||||
; ***********************************************************************
|
||||
; * Software that is described herein is for illustrative purposes only
|
||||
; * which provides customers with programming information regarding the
|
||||
; * products. This software is supplied "AS IS" without any warranties.
|
||||
; * NXP Semiconductors assumes no responsibility or liability for the
|
||||
; * use of the software, conveys no license or title under any patent,
|
||||
; * copyright, or mask work right to the product. NXP Semiconductors
|
||||
; * reserves the right to make changes in the software without
|
||||
; * notification. NXP Semiconductors also make no representation or
|
||||
; * warranty that such application will be suitable for the specified
|
||||
; * use without further testing or modification.
|
||||
; **********************************************************************/
|
||||
|
||||
; <h> Stack Configuration
|
||||
; <o> Stack Size (in Bytes) <0x0-0xFFFFFFFF:8>
|
||||
; </h>
|
||||
|
||||
Stack_Size EQU 0x00003000
|
||||
|
||||
AREA STACK, NOINIT, READWRITE, ALIGN=3
|
||||
Stack_Mem SPACE Stack_Size
|
||||
__initial_sp
|
||||
|
||||
|
||||
; <h> Heap Configuration
|
||||
; <o> Heap Size (in Bytes) <0x0-0xFFFFFFFF:8>
|
||||
; </h>
|
||||
|
||||
Heap_Size EQU 0x0000a000
|
||||
|
||||
AREA HEAP, NOINIT, READWRITE, ALIGN=3
|
||||
__heap_base
|
||||
Heap_Mem SPACE Heap_Size
|
||||
__heap_limit
|
||||
|
||||
PRESERVE8
|
||||
THUMB
|
||||
|
||||
; Vector Table Mapped to Address 0 at Reset
|
||||
|
||||
AREA RESET, DATA, READONLY
|
||||
EXPORT __Vectors
|
||||
|
||||
Sign_Value EQU 0x5A5A5A5A
|
||||
|
||||
__Vectors DCD __initial_sp ; 0 Top of Stack
|
||||
DCD Reset_Handler ; 1 Reset Handler
|
||||
DCD NMI_Handler ; 2 NMI Handler
|
||||
DCD HardFault_Handler ; 3 Hard Fault Handler
|
||||
DCD MemManage_Handler ; 4 MPU Fault Handler
|
||||
DCD BusFault_Handler ; 5 Bus Fault Handler
|
||||
DCD UsageFault_Handler ; 6 Usage Fault Handler
|
||||
DCD Sign_Value ; 7 Reserved
|
||||
DCD 0 ; 8 Reserved
|
||||
DCD 0 ; 9 Reserved
|
||||
DCD 0 ; 10 Reserved
|
||||
DCD SVC_Handler ; 11 SVCall Handler
|
||||
DCD DebugMon_Handler ; 12 Debug Monitor Handler
|
||||
DCD 0 ; 13 Reserved
|
||||
DCD PendSV_Handler ; 14 PendSV Handler
|
||||
DCD SysTick_Handler ; 15 SysTick Handler
|
||||
|
||||
; External Interrupts
|
||||
DCD DAC_IRQHandler ; 16 D/A Converter
|
||||
DCD M0CORE_IRQHandler ; 17 M0 Core
|
||||
DCD DMA_IRQHandler ; 18 General Purpose DMA
|
||||
DCD EZH_IRQHandler ; 19 EZH/EDM
|
||||
DCD FLASH_EEPROM_IRQHandler ; 20 Reserved for Typhoon
|
||||
DCD ETH_IRQHandler ; 21 Ethernet
|
||||
DCD SDIO_IRQHandler ; 22 SD/MMC
|
||||
DCD LCD_IRQHandler ; 23 LCD
|
||||
DCD USB0_IRQHandler ; 24 USB0
|
||||
DCD USB1_IRQHandler ; 25 USB1
|
||||
DCD SCT_IRQHandler ; 26 State Configurable Timer
|
||||
DCD RIT_IRQHandler ; 27 Repetitive Interrupt Timer
|
||||
DCD TIMER0_IRQHandler ; 28 Timer0
|
||||
DCD TIMER1_IRQHandler ; 29 Timer1
|
||||
DCD TIMER2_IRQHandler ; 30 Timer2
|
||||
DCD TIMER3_IRQHandler ; 31 Timer3
|
||||
DCD MCPWM_IRQHandler ; 32 Motor Control PWM
|
||||
DCD ADC0_IRQHandler ; 33 A/D Converter 0
|
||||
DCD I2C0_IRQHandler ; 34 I2C0
|
||||
DCD I2C1_IRQHandler ; 35 I2C1
|
||||
DCD SPI_IRQHandler ; 36 SPI
|
||||
DCD ADC1_IRQHandler ; 37 A/D Converter 1
|
||||
DCD SSP0_IRQHandler ; 38 SSP0
|
||||
DCD SSP1_IRQHandler ; 39 SSP1
|
||||
DCD UART0_IRQHandler ; 40 UART0
|
||||
DCD UART1_IRQHandler ; 41 UART1
|
||||
DCD UART2_IRQHandler ; 42 UART2
|
||||
DCD UART3_IRQHandler ; 43 UART3
|
||||
DCD I2S0_IRQHandler ; 44 I2S0
|
||||
DCD I2S1_IRQHandler ; 45 I2S1
|
||||
DCD SPIFI_IRQHandler ; 46 SPI Flash Interface
|
||||
DCD SGPIO_IRQHandler ; 47 SGPIO
|
||||
DCD GPIO0_IRQHandler ; 48 GPIO0
|
||||
DCD GPIO1_IRQHandler ; 49 GPIO1
|
||||
DCD GPIO2_IRQHandler ; 50 GPIO2
|
||||
DCD GPIO3_IRQHandler ; 51 GPIO3
|
||||
DCD GPIO4_IRQHandler ; 52 GPIO4
|
||||
DCD GPIO5_IRQHandler ; 53 GPIO5
|
||||
DCD GPIO6_IRQHandler ; 54 GPIO6
|
||||
DCD GPIO7_IRQHandler ; 55 GPIO7
|
||||
DCD GINT0_IRQHandler ; 56 GINT0
|
||||
DCD GINT1_IRQHandler ; 57 GINT1
|
||||
DCD EVRT_IRQHandler ; 58 Event Router
|
||||
DCD CAN1_IRQHandler ; 59 C_CAN1
|
||||
DCD 0 ; 60 Reserved
|
||||
DCD VADC_IRQHandler ; 61 VADC
|
||||
DCD ATIMER_IRQHandler ; 62 ATIMER
|
||||
DCD RTC_IRQHandler ; 63 RTC
|
||||
DCD 0 ; 64 Reserved
|
||||
DCD WDT_IRQHandler ; 65 WDT
|
||||
DCD M0s_IRQHandler ; 66 M0s
|
||||
DCD CAN0_IRQHandler ; 67 C_CAN0
|
||||
DCD QEI_IRQHandler ; 68 QEI
|
||||
|
||||
|
||||
;CRP address at offset 0x2FC relative to the BOOT Bank address
|
||||
IF :LNOT::DEF:NO_CRP
|
||||
SPACE (0x2FC - (. - __Vectors))
|
||||
; EXPORT CRP_Key
|
||||
CRP_Key DCD 0xFFFFFFFF
|
||||
; 0xFFFFFFFF => CRP Disabled
|
||||
; 0x12345678 => CRP Level 1
|
||||
; 0x87654321 => CRP Level 2
|
||||
; 0x43218765 => CRP Level 3 (ARE YOU SURE?)
|
||||
; 0x4E697370 => NO ISP (ARE YOU SURE?)
|
||||
ENDIF
|
||||
|
||||
AREA |.text|, CODE, READONLY
|
||||
|
||||
; Reset Handler
|
||||
|
||||
Reset_Handler PROC
|
||||
EXPORT Reset_Handler [WEAK]
|
||||
IMPORT SystemInit
|
||||
IMPORT __main
|
||||
LDR R0, =SystemInit
|
||||
BLX R0
|
||||
LDR R0, =__main
|
||||
BX R0
|
||||
ENDP
|
||||
|
||||
; Dummy Exception Handlers (infinite loops which can be modified)
|
||||
|
||||
NMI_Handler PROC
|
||||
EXPORT NMI_Handler [WEAK]
|
||||
B .
|
||||
ENDP
|
||||
HardFault_Handler\
|
||||
PROC
|
||||
EXPORT HardFault_Handler [WEAK]
|
||||
B .
|
||||
ENDP
|
||||
MemManage_Handler\
|
||||
PROC
|
||||
EXPORT MemManage_Handler [WEAK]
|
||||
B .
|
||||
ENDP
|
||||
BusFault_Handler\
|
||||
PROC
|
||||
EXPORT BusFault_Handler [WEAK]
|
||||
B .
|
||||
ENDP
|
||||
UsageFault_Handler\
|
||||
PROC
|
||||
EXPORT UsageFault_Handler [WEAK]
|
||||
B .
|
||||
ENDP
|
||||
SVC_Handler PROC
|
||||
EXPORT SVC_Handler [WEAK]
|
||||
B .
|
||||
ENDP
|
||||
DebugMon_Handler\
|
||||
PROC
|
||||
EXPORT DebugMon_Handler [WEAK]
|
||||
B .
|
||||
ENDP
|
||||
PendSV_Handler PROC
|
||||
EXPORT PendSV_Handler [WEAK]
|
||||
B .
|
||||
ENDP
|
||||
SysTick_Handler PROC
|
||||
EXPORT SysTick_Handler [WEAK]
|
||||
B .
|
||||
ENDP
|
||||
|
||||
Default_Handler PROC
|
||||
|
||||
EXPORT DAC_IRQHandler [WEAK]
|
||||
EXPORT M0CORE_IRQHandler [WEAK]
|
||||
EXPORT DMA_IRQHandler [WEAK]
|
||||
EXPORT EZH_IRQHandler [WEAK]
|
||||
EXPORT FLASH_EEPROM_IRQHandler [WEAK]
|
||||
EXPORT ETH_IRQHandler [WEAK]
|
||||
EXPORT SDIO_IRQHandler [WEAK]
|
||||
EXPORT LCD_IRQHandler [WEAK]
|
||||
EXPORT USB0_IRQHandler [WEAK]
|
||||
EXPORT USB1_IRQHandler [WEAK]
|
||||
EXPORT SCT_IRQHandler [WEAK]
|
||||
EXPORT RIT_IRQHandler [WEAK]
|
||||
EXPORT TIMER0_IRQHandler [WEAK]
|
||||
EXPORT TIMER1_IRQHandler [WEAK]
|
||||
EXPORT TIMER2_IRQHandler [WEAK]
|
||||
EXPORT TIMER3_IRQHandler [WEAK]
|
||||
EXPORT MCPWM_IRQHandler [WEAK]
|
||||
EXPORT ADC0_IRQHandler [WEAK]
|
||||
EXPORT I2C0_IRQHandler [WEAK]
|
||||
EXPORT I2C1_IRQHandler [WEAK]
|
||||
EXPORT SPI_IRQHandler [WEAK]
|
||||
EXPORT ADC1_IRQHandler [WEAK]
|
||||
EXPORT SSP0_IRQHandler [WEAK]
|
||||
EXPORT SSP1_IRQHandler [WEAK]
|
||||
EXPORT UART0_IRQHandler [WEAK]
|
||||
EXPORT UART1_IRQHandler [WEAK]
|
||||
EXPORT UART2_IRQHandler [WEAK]
|
||||
EXPORT UART3_IRQHandler [WEAK]
|
||||
EXPORT I2S0_IRQHandler [WEAK]
|
||||
EXPORT I2S1_IRQHandler [WEAK]
|
||||
EXPORT SPIFI_IRQHandler [WEAK]
|
||||
EXPORT SGPIO_IRQHandler [WEAK]
|
||||
EXPORT GPIO0_IRQHandler [WEAK]
|
||||
EXPORT GPIO1_IRQHandler [WEAK]
|
||||
EXPORT GPIO2_IRQHandler [WEAK]
|
||||
EXPORT GPIO3_IRQHandler [WEAK]
|
||||
EXPORT GPIO4_IRQHandler [WEAK]
|
||||
EXPORT GPIO5_IRQHandler [WEAK]
|
||||
EXPORT GPIO6_IRQHandler [WEAK]
|
||||
EXPORT GPIO7_IRQHandler [WEAK]
|
||||
EXPORT GINT0_IRQHandler [WEAK]
|
||||
EXPORT GINT1_IRQHandler [WEAK]
|
||||
EXPORT EVRT_IRQHandler [WEAK]
|
||||
EXPORT CAN1_IRQHandler [WEAK]
|
||||
EXPORT VADC_IRQHandler [WEAK]
|
||||
EXPORT ATIMER_IRQHandler [WEAK]
|
||||
EXPORT RTC_IRQHandler [WEAK]
|
||||
EXPORT WDT_IRQHandler [WEAK]
|
||||
EXPORT M0s_IRQHandler [WEAK]
|
||||
EXPORT CAN0_IRQHandler [WEAK]
|
||||
EXPORT QEI_IRQHandler [WEAK]
|
||||
|
||||
DAC_IRQHandler
|
||||
M0CORE_IRQHandler
|
||||
DMA_IRQHandler
|
||||
EZH_IRQHandler
|
||||
FLASH_EEPROM_IRQHandler
|
||||
ETH_IRQHandler
|
||||
SDIO_IRQHandler
|
||||
LCD_IRQHandler
|
||||
USB0_IRQHandler
|
||||
USB1_IRQHandler
|
||||
SCT_IRQHandler
|
||||
RIT_IRQHandler
|
||||
TIMER0_IRQHandler
|
||||
TIMER1_IRQHandler
|
||||
TIMER2_IRQHandler
|
||||
TIMER3_IRQHandler
|
||||
MCPWM_IRQHandler
|
||||
ADC0_IRQHandler
|
||||
I2C0_IRQHandler
|
||||
I2C1_IRQHandler
|
||||
SPI_IRQHandler
|
||||
ADC1_IRQHandler
|
||||
SSP0_IRQHandler
|
||||
SSP1_IRQHandler
|
||||
UART0_IRQHandler
|
||||
UART1_IRQHandler
|
||||
UART2_IRQHandler
|
||||
UART3_IRQHandler
|
||||
I2S0_IRQHandler
|
||||
I2S1_IRQHandler
|
||||
SPIFI_IRQHandler
|
||||
SGPIO_IRQHandler
|
||||
GPIO0_IRQHandler
|
||||
GPIO1_IRQHandler
|
||||
GPIO2_IRQHandler
|
||||
GPIO3_IRQHandler
|
||||
GPIO4_IRQHandler
|
||||
GPIO5_IRQHandler
|
||||
GPIO6_IRQHandler
|
||||
GPIO7_IRQHandler
|
||||
GINT0_IRQHandler
|
||||
GINT1_IRQHandler
|
||||
EVRT_IRQHandler
|
||||
CAN1_IRQHandler
|
||||
VADC_IRQHandler
|
||||
ATIMER_IRQHandler
|
||||
RTC_IRQHandler
|
||||
WDT_IRQHandler
|
||||
M0s_IRQHandler
|
||||
CAN0_IRQHandler
|
||||
QEI_IRQHandler
|
||||
|
||||
B .
|
||||
|
||||
ENDP
|
||||
|
||||
ALIGN
|
||||
|
||||
; User Initial Stack & Heap
|
||||
|
||||
IF :DEF:__MICROLIB
|
||||
|
||||
EXPORT __initial_sp
|
||||
EXPORT __heap_base
|
||||
EXPORT __heap_limit
|
||||
|
||||
ELSE
|
||||
|
||||
IMPORT __use_two_region_memory
|
||||
EXPORT __user_initial_stackheap
|
||||
__user_initial_stackheap
|
||||
|
||||
LDR R0, = Heap_Mem
|
||||
LDR R1, =(Stack_Mem + Stack_Size)
|
||||
LDR R2, = (Heap_Mem + Heap_Size)
|
||||
LDR R3, = Stack_Mem
|
||||
BX LR
|
||||
|
||||
ALIGN
|
||||
|
||||
ENDIF
|
||||
|
||||
|
||||
END
|
170
IDE/MDK-ARM/LPC43xx/time-LCP43xx.c
Normal file
170
IDE/MDK-ARM/LPC43xx/time-LCP43xx.c
Normal file
@ -0,0 +1,170 @@
|
||||
/* time.c
|
||||
*
|
||||
* Copyright (C) 2006-2013 wolfSSL Inc.
|
||||
*
|
||||
* 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
|
||||
|
||||
|
||||
/*-----------------------------------------------------------------------------
|
||||
* initialize RTC
|
||||
*----------------------------------------------------------------------------*/
|
||||
#include <stdio.h>
|
||||
#include "lpc43xx_rtc.h"
|
||||
#include "lpc43xx_cgu.h"
|
||||
|
||||
static void init_RTC()
|
||||
{
|
||||
/* Enable GPIO register interface clock */
|
||||
LPC_CCU1->CLK_M4_GPIO_CFG |= 1;
|
||||
while (!(LPC_CCU1->CLK_M4_GPIO_STAT & 1)) ;
|
||||
|
||||
/* RTC Block section ------------------------------------------------------ */
|
||||
/* Init RTC module */
|
||||
RTC_Init(LPC_RTC);
|
||||
|
||||
/* Set ALARM time for second */
|
||||
RTC_SetAlarmTime (LPC_RTC, RTC_TIMETYPE_SECOND, 30);
|
||||
|
||||
/* Set the AMR for 30s match alarm interrupt */
|
||||
RTC_AlarmIntConfig (LPC_RTC, RTC_TIMETYPE_SECOND, ENABLE);
|
||||
|
||||
/* Set the CIIR for minute counter interrupt*/
|
||||
RTC_CntIncrIntConfig (LPC_RTC, RTC_TIMETYPE_MINUTE, ENABLE);
|
||||
|
||||
/* Enable rtc (starts increase the tick counter and second counter register) */
|
||||
RTC_Cmd(LPC_RTC, ENABLE);
|
||||
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------------------------------
|
||||
* initialize TIM
|
||||
*----------------------------------------------------------------------------*/
|
||||
|
||||
#include "lpc43xx_timer.h"
|
||||
//#include "lpc43xx_cgu.h"
|
||||
//#include "lpc43xx_scu.h"
|
||||
//#include "lpc43xx_libcfg.h"
|
||||
//#include "debug_frmwrk.h"
|
||||
|
||||
static void init_TIM()
|
||||
{
|
||||
TIM_TIMERCFG_Type TIM_ConfigStruct;
|
||||
/* Initialize timer 0, prescale count time of 1uS */
|
||||
TIM_ConfigStruct.PrescaleOption = TIM_PRESCALE_TICKVAL;
|
||||
TIM_ConfigStruct.PrescaleValue = 204; /* 204MHz */
|
||||
/* Set configuration for Tim_config and Tim_MatchConfig */
|
||||
TIM_Init(LPC_TIMER2, TIM_TIMER_MODE,&TIM_ConfigStruct);
|
||||
TIM_ResetCounter(LPC_TIMER2);
|
||||
/* To start timer 2 */
|
||||
TIM_Cmd(LPC_TIMER2,ENABLE);
|
||||
}
|
||||
|
||||
double current_time()
|
||||
{
|
||||
return (double)LPC_TIMER2->TC/1000000.0;
|
||||
}
|
||||
|
||||
|
||||
void init_time(void) {
|
||||
init_RTC() ;
|
||||
init_TIM() ;
|
||||
}
|
||||
|
||||
#include <time.h>
|
||||
|
||||
struct tm *Cyassl_MDK_gmtime(const time_t *c)
|
||||
{
|
||||
static struct tm date ;
|
||||
|
||||
RTC_TIME_Type RTCFullTime;
|
||||
RTC_GetFullTime (LPC_RTC, &RTCFullTime);
|
||||
|
||||
date.tm_year = RTCFullTime.YEAR + 100 ;
|
||||
date.tm_mon = RTCFullTime.MONTH - 1 ;
|
||||
date.tm_mday = RTCFullTime.DOM ;
|
||||
date.tm_hour = RTCFullTime.HOUR ;
|
||||
date.tm_min = RTCFullTime.MIN ;
|
||||
date.tm_sec = RTCFullTime.SEC ;
|
||||
|
||||
#if defined(DEBUG_CYASSL)
|
||||
{
|
||||
extern void CYASSL_MSG(char *msg) ;
|
||||
char msg[100] ;
|
||||
sprintf(msg, "Debug::Cyassl_KEIL_gmtime(DATE=/%4d/%02d/%02d TIME=%02d:%02d:%02d)\n",
|
||||
RTCFullTime.YEAR+2000, RTCFullTime.MONTH, RTCFullTime.DOM,
|
||||
RTCFullTime.HOUR, RTCFullTime.MIN, RTCFullTime.SEC) ;
|
||||
CYASSL_MSG(msg) ;
|
||||
}
|
||||
#endif
|
||||
|
||||
return(&date) ;
|
||||
}
|
||||
|
||||
typedef struct func_args {
|
||||
int argc;
|
||||
char** argv;
|
||||
int return_code;
|
||||
} func_args;
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
void time_main(void *args)
|
||||
{
|
||||
char * datetime ;
|
||||
int year ;
|
||||
RTC_TIME_Type RTCFullTime;
|
||||
|
||||
if( args == NULL || ((func_args *)args)->argc == 1) {
|
||||
RTC_GetFullTime (LPC_RTC, &RTCFullTime);
|
||||
printf("Date: %d/%d/%d, Time: %02d:%02d:%02d\n",
|
||||
RTCFullTime.MONTH, RTCFullTime.DOM, RTCFullTime.YEAR+2000,
|
||||
RTCFullTime.HOUR, RTCFullTime.MIN, RTCFullTime.SEC) ;
|
||||
} else if(((func_args *)args)->argc == 3 &&
|
||||
((func_args *)args)->argv[1][0] == '-' &&
|
||||
((func_args *)args)->argv[1][1] == 'd' ) {
|
||||
|
||||
datetime = ((func_args *)args)->argv[2];
|
||||
sscanf(datetime, "%d/%d/%d",
|
||||
(int *)&RTCFullTime.MONTH, (int *)&RTCFullTime.DOM, &year) ;
|
||||
RTCFullTime.YEAR = year - 2000 ;
|
||||
RTC_SetTime (LPC_RTC, RTC_TIMETYPE_MONTH, RTCFullTime.MONTH);
|
||||
RTC_SetTime (LPC_RTC, RTC_TIMETYPE_YEAR, RTCFullTime.YEAR);
|
||||
RTC_SetTime (LPC_RTC, RTC_TIMETYPE_DAYOFMONTH, RTCFullTime.DOM);
|
||||
} else if(((func_args *)args)->argc == 3 &&
|
||||
((func_args *)args)->argv[1][0] == '-' &&
|
||||
((func_args *)args)->argv[1][1] == 't' ) {
|
||||
RTC_GetFullTime (LPC_RTC, &RTCFullTime);
|
||||
datetime = ((func_args *)args)->argv[2];
|
||||
sscanf(datetime, "%d:%d:%d",
|
||||
(int *)&RTCFullTime.HOUR,
|
||||
(int *)&RTCFullTime.MIN,
|
||||
(int *)&RTCFullTime.SEC
|
||||
) ;
|
||||
RTC_SetTime (LPC_RTC, RTC_TIMETYPE_SECOND, RTCFullTime.SEC);
|
||||
RTC_SetTime (LPC_RTC, RTC_TIMETYPE_MINUTE, RTCFullTime.MIN);
|
||||
RTC_SetTime (LPC_RTC, RTC_TIMETYPE_HOUR, RTCFullTime.HOUR);
|
||||
} else printf("Invalid argument\n") ;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
269
IDE/MDK-ARM/MDK-ARM/CyaSSL/Retarget.c
Normal file
269
IDE/MDK-ARM/MDK-ARM/CyaSSL/Retarget.c
Normal file
@ -0,0 +1,269 @@
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <rt_sys.h>
|
||||
|
||||
|
||||
#include <File_Config.h>
|
||||
|
||||
#pragma import(__use_no_semihosting_swi)
|
||||
|
||||
/* The following macro definitions may be used to translate this file:
|
||||
|
||||
STDIO - use standard Input/Output device
|
||||
(default is NOT used)
|
||||
*/
|
||||
|
||||
/* Standard IO device handles. */
|
||||
#define STDIN 0x8001
|
||||
#define STDOUT 0x8002
|
||||
#define STDERR 0x8003
|
||||
|
||||
/* Standard IO device name defines. */
|
||||
const char __stdin_name[] = "STDIN";
|
||||
const char __stdout_name[] = "STDOUT";
|
||||
const char __stderr_name[] = "STDERR";
|
||||
|
||||
struct __FILE { int handle; /* Add whatever you need here */ };
|
||||
|
||||
#ifdef STDIO
|
||||
extern int SER_GetChar (void);
|
||||
extern int SER_PutChar (int ch);
|
||||
|
||||
/*-----------------------------------------------------------------------------
|
||||
Write character to the Serial Port
|
||||
*----------------------------------------------------------------------------*/
|
||||
int sendchar (int c)
|
||||
{
|
||||
if (c == '\n') {
|
||||
SER_PutChar ('\r');
|
||||
}
|
||||
SER_PutChar (c);
|
||||
return (c);
|
||||
}
|
||||
|
||||
|
||||
/*-----------------------------------------------------------------------------
|
||||
Read character from the Serial Port
|
||||
*----------------------------------------------------------------------------*/
|
||||
int getkey (void)
|
||||
{
|
||||
int ch = SER_GetChar();
|
||||
|
||||
if (ch < 0) {
|
||||
return 0;
|
||||
}
|
||||
return ch;
|
||||
}
|
||||
#endif
|
||||
|
||||
/*--------------------------- _ttywrch ---------------------------------------*/
|
||||
|
||||
void _ttywrch (int ch)
|
||||
{
|
||||
#ifdef STDIO
|
||||
sendchar (ch);
|
||||
#endif
|
||||
}
|
||||
|
||||
/*--------------------------- _sys_open --------------------------------------*/
|
||||
#ifndef NO_FILESYSTEM
|
||||
static int KEIL_FS_open(const char *name, int openmode)
|
||||
{
|
||||
int i ; int ret ;
|
||||
#define PATHSIZE 100
|
||||
char path[PATHSIZE] ; char *p ;
|
||||
|
||||
if(strlen(name) > PATHSIZE)return(-1) ;
|
||||
|
||||
for(i = 0; i<= strlen(name); i++) {
|
||||
if(name[i] == '/')path[i] = '\\' ;
|
||||
else path[i] = name[i] ;
|
||||
}
|
||||
if(path[0] == '.' && path[1] == '\\') p = path + 2 ;
|
||||
else p = path ;
|
||||
|
||||
ret = __sys_open (p, openmode) ;
|
||||
|
||||
return(ret) ;
|
||||
}
|
||||
#endif
|
||||
|
||||
FILEHANDLE _sys_open (const char *name, int openmode)
|
||||
{
|
||||
/* Register standard Input Output devices. */
|
||||
if (strcmp(name, "STDIN") == 0) {
|
||||
return (STDIN);
|
||||
}
|
||||
if (strcmp(name, "STDOUT") == 0) {
|
||||
return (STDOUT);
|
||||
}
|
||||
if (strcmp(name, "STDERR") == 0) {
|
||||
return (STDERR);
|
||||
}
|
||||
#ifndef NO_FILESYSTEM
|
||||
return (KEIL_FS_open(name, openmode));
|
||||
#else
|
||||
return(0) ;
|
||||
#endif
|
||||
}
|
||||
|
||||
/*--------------------------- _sys_close -------------------------------------*/
|
||||
|
||||
int _sys_close (FILEHANDLE fh)
|
||||
{
|
||||
if (fh > 0x8000) {
|
||||
return (0);
|
||||
}
|
||||
#ifndef NO_FILESYSTEM
|
||||
return (__sys_close (fh));
|
||||
#else
|
||||
return(0) ;
|
||||
#endif
|
||||
}
|
||||
|
||||
/*--------------------------- _sys_write -------------------------------------*/
|
||||
|
||||
int _sys_write (FILEHANDLE fh, const U8 *buf, U32 len, int mode)
|
||||
{
|
||||
#ifdef STDIO
|
||||
if (fh == STDOUT) {
|
||||
/* Standard Output device. */
|
||||
for ( ; len; len--) {
|
||||
sendchar (*buf++);
|
||||
}
|
||||
return (0);
|
||||
}
|
||||
#endif
|
||||
if (fh > 0x8000) {
|
||||
return (-1);
|
||||
}
|
||||
#ifndef NO_FILESYSTEM
|
||||
return (__sys_write (fh, buf, len));
|
||||
#else
|
||||
return(0) ;
|
||||
#endif
|
||||
}
|
||||
|
||||
/*--------------------------- _sys_read --------------------------------------*/
|
||||
|
||||
int _sys_read (FILEHANDLE fh, U8 *buf, U32 len, int mode)
|
||||
{
|
||||
#ifdef STDIO
|
||||
if (fh == STDIN) {
|
||||
/* Standard Input device. */
|
||||
int sz ;
|
||||
while((buf[0] = getkey()) == 0) ;
|
||||
;
|
||||
for (sz = 0 ; sz <= len ; sz ++ ) {
|
||||
if(buf[sz] == 0) break ;
|
||||
else sz++ ;
|
||||
buf[sz] = getkey ();
|
||||
}
|
||||
return (sz);
|
||||
}
|
||||
#endif
|
||||
if (fh > 0x8000) {
|
||||
return (-1);
|
||||
}
|
||||
#ifndef NO_FILESYSTEM
|
||||
return (__sys_read (fh, buf, len));
|
||||
#else
|
||||
return(0) ;
|
||||
#endif
|
||||
}
|
||||
|
||||
/*--------------------------- _sys_istty -------------------------------------*/
|
||||
|
||||
int _sys_istty (FILEHANDLE fh)
|
||||
{
|
||||
if (fh > 0x8000) {
|
||||
return (1);
|
||||
}
|
||||
return (0);
|
||||
}
|
||||
|
||||
/*--------------------------- _sys_seek --------------------------------------*/
|
||||
|
||||
int _sys_seek (FILEHANDLE fh, long pos)
|
||||
{
|
||||
if (fh > 0x8000) {
|
||||
return (-1);
|
||||
}
|
||||
#ifndef NO_FILESYSTEM
|
||||
return (__sys_seek (fh, pos));
|
||||
#else
|
||||
return(0) ;
|
||||
#endif
|
||||
}
|
||||
|
||||
/*--------------------------- _sys_ensure ------------------------------------*/
|
||||
|
||||
int _sys_ensure (FILEHANDLE fh)
|
||||
{
|
||||
if (fh > 0x8000) {
|
||||
return (-1);
|
||||
}
|
||||
#ifndef NO_FILESYSTEM
|
||||
return (__sys_ensure (fh));
|
||||
#else
|
||||
return(0) ;
|
||||
#endif
|
||||
}
|
||||
|
||||
/*--------------------------- _sys_flen --------------------------------------*/
|
||||
|
||||
long _sys_flen (FILEHANDLE fh)
|
||||
{
|
||||
if (fh > 0x8000) {
|
||||
return (0);
|
||||
}
|
||||
#ifndef NO_FILESYSTEM
|
||||
return (__sys_flen (fh));
|
||||
#else
|
||||
return(0) ;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
/*--------------------------- _sys_tmpnam ------------------------------------*/
|
||||
|
||||
int _sys_tmpnam (char *name, int sig, unsigned maxlen)
|
||||
{
|
||||
return (1);
|
||||
}
|
||||
|
||||
/*--------------------------- _sys_command_string ----------------------------*/
|
||||
|
||||
char *_sys_command_string (char *cmd, int len)
|
||||
{
|
||||
return (cmd);
|
||||
}
|
||||
|
||||
/*--------------------------- _sys_exit --------------------------------------*/
|
||||
|
||||
void _sys_exit (int return_code)
|
||||
{
|
||||
#ifdef CYASSL_MDK_SHELL
|
||||
return ;
|
||||
#else
|
||||
/* Endless loop. */
|
||||
while (1);
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
/*--------------------------- time -----------------------------------------*/
|
||||
long time(long *t)
|
||||
{
|
||||
return ((long) 0) ; /** DUMMY TIME() **/
|
||||
}
|
||||
/*-----------------------------------------------------------------------------
|
||||
* end of file
|
||||
*----------------------------------------------------------------------------*/
|
28
IDE/MDK-ARM/MDK-ARM/CyaSSL/cert_data.c
Normal file
28
IDE/MDK-ARM/MDK-ARM/CyaSSL/cert_data.c
Normal file
@ -0,0 +1,28 @@
|
||||
/* certs_test.c
|
||||
*
|
||||
* Copyright (C) 2006-2013 wolfSSL Inc.
|
||||
*
|
||||
* 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
|
||||
|
||||
/* Define initial data for cert buffers */
|
||||
#include <cyassl/certs_test.h>
|
||||
|
39
IDE/MDK-ARM/MDK-ARM/CyaSSL/cert_data.h
Normal file
39
IDE/MDK-ARM/MDK-ARM/CyaSSL/cert_data.h
Normal file
@ -0,0 +1,39 @@
|
||||
#ifndef CYASSL_CERT_DATA_H
|
||||
#define CYASSL_CERT_DATA_H
|
||||
|
||||
#ifdef USE_CERT_BUFFERS_1024
|
||||
extern const unsigned char client_key_der_1024[] ;
|
||||
extern int sizeof_client_key_der_1024 ;
|
||||
/* ./certs/1024/client-cert.der, 1024-bit */
|
||||
extern const unsigned char client_cert_der_1024[] ;
|
||||
extern int sizeof_client_cert_der_1024 ;
|
||||
/* ./certs/1024/dh1024.der, 1024-bit */
|
||||
extern const unsigned char dh_key_der_1024[] ;
|
||||
extern int sizeof_dh_key_der_1024 ;
|
||||
/* ./certs/1024/dsa1024.der, 1024-bit */
|
||||
extern const unsigned char dsa_key_der_1024[] ;
|
||||
extern int sizeof_dsa_key_der_1024 ;
|
||||
/* ./certs/1024/rsa1024.der, 1024-bit */
|
||||
extern const unsigned char rsa_key_der_1024[] ;
|
||||
extern int sizeof_rsa_key_der_1024 ;
|
||||
|
||||
#elif defined(USE_CERT_BUFFERS_2048)
|
||||
/* ./certs/client-key.der, 2048-bit */
|
||||
extern const unsigned char client_key_der_2048[] ;
|
||||
extern int sizeof_client_key_der_2048 ;
|
||||
/* ./certs/client-cert.der, 2048-bit */
|
||||
extern const unsigned char client_cert_der_2048[] ;
|
||||
extern int sizeof_client_cert_der_2048 ;
|
||||
/* ./certs/dh2048.der, 2048-bit */
|
||||
extern const unsigned char dh_key_der_2048[] ;
|
||||
extern int sizeof_dh_key_der_2048 ;
|
||||
/* ./certs/dsa2048.der, 2048-bit */
|
||||
extern const unsigned char dsa_key_der_2048[] ;
|
||||
extern int sizeof_dsa_key_der_2048;
|
||||
/* ./certs/rsa2048.der, 2048-bit */
|
||||
extern const unsigned char rsa_key_der_2048[] ;
|
||||
extern int sizeof_rsa_key_der_2048 ;
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
291
IDE/MDK-ARM/MDK-ARM/CyaSSL/config-BARE-METAL.h
Normal file
291
IDE/MDK-ARM/MDK-ARM/CyaSSL/config-BARE-METAL.h
Normal file
@ -0,0 +1,291 @@
|
||||
/* config-BEREFOOT.h
|
||||
*
|
||||
* Copyright (C) 2006-2013 wolfSSL Inc.
|
||||
*
|
||||
* 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 for KEIL-RL Configuration ****/
|
||||
|
||||
#define __CORTEX_M3__
|
||||
#define CYASSL_MDK_ARM
|
||||
#define NO_WRITEV
|
||||
#define NO_CYASSL_DIR
|
||||
#define NO_MAIN_DRIVER
|
||||
|
||||
#define CYASSL_DER_LOAD
|
||||
#define HAVE_NULL_CIPHER
|
||||
|
||||
#define SINGLE_THREADED
|
||||
#define NO_FILESYSTEM
|
||||
#define NO_TLS
|
||||
|
||||
#define NO_ECHOSERVER
|
||||
#define NO_ECHOCLIENT
|
||||
#define NO_SIMPLE_SERVER
|
||||
#define NO_SIMPLE_CLIENT
|
||||
|
||||
// <<< Use Configuration Wizard in Context Menu >>>
|
||||
|
||||
// <h> Build Target: KEIL-BAREFOOT
|
||||
// <h> Single Threaded, No File System, No TCP-net
|
||||
// </h>
|
||||
// <e>Command Shell
|
||||
#define MDK_CONF_SHELL 1
|
||||
#if MDK_CONF_SHELL == 1
|
||||
#define CYASSL_MDK_SHELL
|
||||
#endif
|
||||
// </e>
|
||||
// <h>CyaSSL Apps
|
||||
// <h>Crypt/Cipher
|
||||
// <o>Cert Storage <1=> Mem Buff (1024bytes) <2=> Mem Buff (2048bytes)
|
||||
#define MDK_CONF_CERT_BUFF 1
|
||||
#if MDK_CONF_CERT_BUFF == 1
|
||||
#define USE_CERT_BUFFERS_1024
|
||||
#elif MDK_CONF_CERT_BUFF == 2
|
||||
#define USE_CERT_BUFFERS_2048
|
||||
#endif
|
||||
|
||||
// <e>Crypt/Cipher Test Suite
|
||||
#define MDK_CONF_CTaoCryptTest 1
|
||||
#if MDK_CONF_CTaoCryptTest == 0
|
||||
#define NO_CRYPT_TEST
|
||||
#endif
|
||||
// </e>
|
||||
// <e>Crypt/Cipher Benchmark
|
||||
#define MDK_CONF_CTaoCryptBenchmark 1
|
||||
#if MDK_CONF_CTaoCryptBenchmark == 0
|
||||
#define NO_CRYPT_BENCHMARK
|
||||
#define BENCH_EMBEDDED
|
||||
#endif
|
||||
// </e>
|
||||
// </h>
|
||||
|
||||
// <h>STM32 Hardware Crypt
|
||||
// <e>STM32F2 Hardware RNG
|
||||
#define MDK_CONF_STM32F2_RNG 0
|
||||
#if MDK_CONF_STM32F2_RNG == 1
|
||||
#define STM32F2_RNG
|
||||
#else
|
||||
#define NO_DEV_RANDOM
|
||||
#endif
|
||||
// </e>
|
||||
// <e>STM32F2 Hardware Crypt
|
||||
#define MDK_CONF_STM32F2_CRYPTO 0
|
||||
#if MDK_CONF_STM32F2_CRYPTO == 1
|
||||
#define STM32F2_CRYPTO
|
||||
#endif
|
||||
// </e>
|
||||
|
||||
// </h>
|
||||
|
||||
|
||||
// <h>CTaoCrypt Library
|
||||
|
||||
// <h>MD5, SHA, SHA-256, AES, RC4, ASN, RSA
|
||||
// </h>
|
||||
// <e>MD2
|
||||
#define MDK_CONF_MD2 0
|
||||
#if MDK_CONF_MD2 == 1
|
||||
#define CYASSL_MD2
|
||||
#endif
|
||||
// </e>
|
||||
// <e>MD4
|
||||
#define MDK_CONF_MD4 1
|
||||
#if MDK_CONF_MD4 == 0
|
||||
#define NO_MD4
|
||||
#endif
|
||||
// </e>
|
||||
// <e>SHA-384
|
||||
// <i>This has to be with SHA512
|
||||
#define MDK_CONF_SHA384 0
|
||||
#if MDK_CONF_SHA384 == 1
|
||||
#define CYASSL_SHA384
|
||||
#endif
|
||||
// </e>
|
||||
// <e>SHA-512
|
||||
#define MDK_CONF_SHA512 0
|
||||
#if MDK_CONF_SHA512 == 1
|
||||
#define CYASSL_SHA512
|
||||
#endif
|
||||
// </e>
|
||||
// <e>RIPEMD
|
||||
#define MDK_CONF_RIPEMD 0
|
||||
#if MDK_CONF_RIPEMD == 1
|
||||
#define CYASSL_RIPEMD
|
||||
#endif
|
||||
// </e>
|
||||
// <e>HMAC
|
||||
#define MDK_CONF_HMAC 1
|
||||
#if MDK_CONF_HMAC == 0
|
||||
#define NO_HMAC
|
||||
#endif
|
||||
// </e>
|
||||
// <e>HC128
|
||||
#define MDK_CONF_HC128 0
|
||||
#if MDK_CONF_HC128 == 1
|
||||
#define HAVE_HC128
|
||||
#endif
|
||||
// </e>
|
||||
// <e>RABBIT
|
||||
#define MDK_CONF_RABBIT 1
|
||||
#if MDK_CONF_RABBI == 0
|
||||
#define NO_RABBIT
|
||||
#endif
|
||||
// </e>
|
||||
|
||||
// <e>AEAD
|
||||
#define MDK_CONF_AEAD 0
|
||||
#if MDK_CONF_AEAD == 1
|
||||
#define HAVE_AEAD
|
||||
#endif
|
||||
// </e>
|
||||
// <e>DES3
|
||||
#define MDK_CONF_DES3 1
|
||||
#if MDK_CONF_DES3 == 0
|
||||
#define NO_DES3
|
||||
#endif
|
||||
// </e>
|
||||
// <e>CAMELLIA
|
||||
#define MDK_CONF_CAMELLIA 0
|
||||
#if MDK_CONF_CAMELLIA == 1
|
||||
#define HAVE_CAMELLIA
|
||||
#endif
|
||||
// </e>
|
||||
|
||||
// <e>DH
|
||||
// <i>need this for CYASSL_SERVER, OPENSSL_EXTRA
|
||||
#define MDK_CONF_DH 1
|
||||
#if MDK_CONF_DH == 0
|
||||
#define NO_DH
|
||||
#endif
|
||||
// </e>
|
||||
// <e>DSA
|
||||
#define MDK_CONF_DSA 1
|
||||
#if MDK_CONF_DSA == 0
|
||||
#define NO_DSA
|
||||
#endif
|
||||
// </e>
|
||||
// <e>PWDBASED
|
||||
#define MDK_CONF_PWDBASED 1
|
||||
#if MDK_CONF_PWDBASED == 0
|
||||
#define NO_PWDBASED
|
||||
#endif
|
||||
// </e>
|
||||
|
||||
// <e>ECC
|
||||
#define MDK_CONF_ECC 0
|
||||
#if MDK_CONF_ECC == 1
|
||||
#define HAVE_ECC
|
||||
#endif
|
||||
// </e>
|
||||
// <e>PSK
|
||||
#define MDK_CONF_PSK 1
|
||||
#if MDK_CONF_PSK == 0
|
||||
#define NO_PSK
|
||||
#endif
|
||||
// </e>
|
||||
// <e>AESCCM (Turn off Hardware Crypt)
|
||||
#define MDK_CONF_AESCCM 0
|
||||
#if MDK_CONF_AESCCM == 1
|
||||
#define HAVE_AESCCM
|
||||
#endif
|
||||
// </e>
|
||||
// <e>AESGCM (Turn off Hardware Crypt)
|
||||
#define MDK_CONF_AESGCM 0
|
||||
#if MDK_CONF_AESGCM == 1
|
||||
#define HAVE_AESGCM
|
||||
#define BUILD_AESGCM
|
||||
#endif
|
||||
// </e>
|
||||
// <e>NTRU (need License, "crypto_ntru.h")
|
||||
#define MDK_CONF_NTRU 0
|
||||
#if MDK_CONF_NTRU == 1
|
||||
#define HAVE_NTRU
|
||||
#endif
|
||||
// </e>
|
||||
// </h>
|
||||
|
||||
// <h>Others
|
||||
|
||||
// <e>Inline
|
||||
#define MDK_CONF_INLINE 0
|
||||
#if MDK_CONF_INLINE == 0
|
||||
#define NO_INLINE
|
||||
#endif
|
||||
// </e>
|
||||
// <h>Debug
|
||||
// <e>Debug Message
|
||||
#define MDK_CONF_DebugMessage 0
|
||||
#if MDK_CONF_DebugMessage == 1
|
||||
#define DEBUG_CYASSL
|
||||
#endif
|
||||
// </e>
|
||||
// <e>Check malloc
|
||||
#define MDK_CONF_CheckMalloc 1
|
||||
#if MDK_CONF_CheckMalloc == 1
|
||||
#define CYASSL_MALLOC_CHECK
|
||||
#endif
|
||||
// </e>
|
||||
|
||||
|
||||
// </h>
|
||||
// <e>ErrNo.h
|
||||
#define MDK_CONF_ErrNo 0
|
||||
#if MDK_CONF_ErrNo == 1
|
||||
#define HAVE_ERRNO
|
||||
#endif
|
||||
// </e>
|
||||
// <e>zlib (need "zlib.h")
|
||||
#define MDK_CONF_LIBZ 0
|
||||
#if MDK_CONF_LIBZ == 1
|
||||
#define HAVE_LIBZ
|
||||
#endif
|
||||
// </e>
|
||||
// <e>CAVIUM (need CAVIUM headers)
|
||||
#define MDK_CONF_CAVIUM 0
|
||||
#if MDK_CONF_CAVIUM == 1
|
||||
#define HAVE_CAVIUM
|
||||
#endif
|
||||
// </e>
|
||||
|
||||
// <e>Error Strings
|
||||
#define MDK_CONF_ErrorStrings 1
|
||||
#if MDK_CONF_ErrorStrings == 0
|
||||
#define NO_ERROR_STRINGS
|
||||
#endif
|
||||
// </e>
|
||||
|
||||
// <e>Small Stack
|
||||
#define MDK_CONF_SmallStack 1
|
||||
#if MDK_CONF_SmallStack == 0
|
||||
#define NO_CYASSL_SMALL_STACK
|
||||
#endif
|
||||
// </e>
|
||||
// <e>Use Fast Math
|
||||
#define MDK_CONF_FASTMATH 0
|
||||
#if MDK_CONF_FASTMATH == 1
|
||||
#define USE_FAST_MATH
|
||||
#endif
|
||||
// </e>
|
||||
|
||||
|
||||
// </h>
|
||||
|
||||
//</h>
|
||||
// <<< end of configuration section >>>
|
329
IDE/MDK-ARM/MDK-ARM/CyaSSL/config-FS.h
Normal file
329
IDE/MDK-ARM/MDK-ARM/CyaSSL/config-FS.h
Normal file
@ -0,0 +1,329 @@
|
||||
/* config-FS.h
|
||||
*
|
||||
* Copyright (C) 2006-2013 wolfSSL Inc.
|
||||
*
|
||||
* 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 for KEIL-RL Configuration ****/
|
||||
|
||||
#define __CORTEX_M3__
|
||||
#define CYASSL_KEIL_RL
|
||||
#define NO_WRITEV
|
||||
#define NO_CYASSL_DIR
|
||||
#define NO_MAIN_DRIVER
|
||||
|
||||
|
||||
#define CYASSL_DER_LOAD
|
||||
#define HAVE_NULL_CIPHER
|
||||
|
||||
#define SINGLE_THREADED
|
||||
|
||||
#define NO_ECHOSERVER
|
||||
#define NO_ECHOCLIENT
|
||||
#define NO_SIMPLE_SERVER
|
||||
#define NO_SIMPLE_CLIENT
|
||||
|
||||
// <<< Use Configuration Wizard in Context Menu >>>
|
||||
|
||||
// <h> Build Target: KEIL-FS
|
||||
// <h> Single Threaded, With File System, No TCP-net
|
||||
// </h>
|
||||
// <e>Command Shell
|
||||
#define MDK_CONF_SHELL 1
|
||||
#if MDK_CONF_SHELL == 1
|
||||
#define CYASSL_MDK_SHELL
|
||||
#endif
|
||||
// </e>
|
||||
// <h>CyaSSL Apps
|
||||
// <h>Crypt/Cipher
|
||||
// <o>Cert Storage <0=> SD Card <1=> Mem Buff (1024bytes) <2=> Mem Buff (2048bytes)
|
||||
#define MDK_CONF_CERT_BUFF 0
|
||||
#if MDK_CONF_CERT_BUFF== 1
|
||||
#define USE_CERT_BUFFERS_1024
|
||||
#elif MDK_CONF_CERT_BUFF == 2
|
||||
#define USE_CERT_BUFFERS_2048
|
||||
#endif
|
||||
|
||||
// <e>Crypt/Cipher Test Suite
|
||||
#define MDK_CONF_CTaoCryptTest 1
|
||||
#if MDK_CONF_CTaoCryptTest == 0
|
||||
#define NO_CRYPT_TEST
|
||||
#endif
|
||||
// </e>
|
||||
// <e>Crypt/Cipher Benchmark
|
||||
#define MDK_CONF_CTaoCryptBenchmark 1
|
||||
#if MDK_CONF_CTaoCryptBenchmark == 0
|
||||
#define NO_CRYPT_BENCHMARK
|
||||
#endif
|
||||
// </e>
|
||||
// </h>
|
||||
|
||||
// <h>STM32 Hardware Crypt
|
||||
// <e>STM32F2 Hardware RNG
|
||||
#define MDK_CONF_STM32F2_RNG 0
|
||||
#if MDK_CONF_STM32F2_RNG == 1
|
||||
#define STM32F2_RNG
|
||||
#else
|
||||
#define NO_DEV_RANDOM
|
||||
#endif
|
||||
// </e>
|
||||
// <e>STM32F2 Hardware Crypt
|
||||
#define MDK_CONF_STM32F2_CRYPTO 0
|
||||
#if MDK_CONF_STM32F2_CRYPTO == 1
|
||||
#define STM32F2_CRYPTO
|
||||
#endif
|
||||
// </e>
|
||||
|
||||
// </h>
|
||||
|
||||
// <h>CyaSSL Library
|
||||
// <h>SSL (Included by default)
|
||||
// </h>
|
||||
|
||||
// <e>TLS
|
||||
#define MDK_CONF_TLS 1
|
||||
#if MDK_CONF_TLS == 0
|
||||
#define NO_TLS
|
||||
#endif
|
||||
// </e>
|
||||
|
||||
// <e>CertGen
|
||||
#define MDK_CONF_CERT_GEN 0
|
||||
#if MDK_CONF_CERT_GEN == 1
|
||||
#define CYASSL_CERT_GEN
|
||||
#endif
|
||||
// </e>
|
||||
// <e>KeyGen
|
||||
#define MDK_CONF_KEY_GEN 0
|
||||
#if MDK_CONF_KEY_GEN == 1
|
||||
#define CYASSL_KEY_GEN
|
||||
#endif
|
||||
// </e>
|
||||
// <e>CRL
|
||||
#define MDK_CONF_DER_LOAD 0
|
||||
#if MDK_CONF_DER_LOAD == 1
|
||||
#define CYASSL_DER_LOAD
|
||||
#endif
|
||||
// </e>
|
||||
// <e>OpenSSL Extra
|
||||
#define MDK_CONF_OPENSSL_EXTRA 0
|
||||
#if MDK_CONF_OPENSSL_EXTRA == 1
|
||||
#define OPENSSL_EXTRA
|
||||
#endif
|
||||
// </e>
|
||||
// <h>CRL Monitor, OCSP (not supported with KEIL)
|
||||
// </h>
|
||||
|
||||
// </h>
|
||||
|
||||
// <h>CTaoCrypt Library
|
||||
|
||||
// <h>MD5, SHA, SHA-256, AES, RC4, ASN, RSA
|
||||
// </h>
|
||||
|
||||
// <e>MD2
|
||||
#define MDK_CONF_MD2 0
|
||||
#if MDK_CONF_MD2 == 1
|
||||
#define CYASSL_MD2
|
||||
#endif
|
||||
// </e>
|
||||
// <e>MD4
|
||||
#define MDK_CONF_MD4 1
|
||||
#if MDK_CONF_MD4 == 0
|
||||
#define NO_MD4
|
||||
#endif
|
||||
// </e>
|
||||
// <e>SHA-384
|
||||
// <i>This has to be with SHA512
|
||||
#define MDK_CONF_SHA384 0
|
||||
#if MDK_CONF_SHA384 == 1
|
||||
#define CYASSL_SHA384
|
||||
#endif
|
||||
// </e>
|
||||
// <e>SHA-512
|
||||
#define MDK_CONF_SHA512 0
|
||||
#if MDK_CONF_SHA512 == 1
|
||||
#define CYASSL_SHA512
|
||||
#endif
|
||||
// </e>
|
||||
// <e>RIPEMD
|
||||
#define MDK_CONF_RIPEMD 0
|
||||
#if MDK_CONF_RIPEMD == 1
|
||||
#define CYASSL_RIPEMD
|
||||
#endif
|
||||
// </e>
|
||||
// <e>HMAC
|
||||
#define MDK_CONF_HMAC 1
|
||||
#if MDK_CONF_HMAC == 0
|
||||
#define NO_HMAC
|
||||
#endif
|
||||
// </e>
|
||||
// <e>HC128
|
||||
#define MDK_CONF_HC128 0
|
||||
#if MDK_CONF_HC128 == 1
|
||||
#define HAVE_HC128
|
||||
#endif
|
||||
// </e>
|
||||
// <e>RABBIT
|
||||
#define MDK_CONF_RABBIT 1
|
||||
#if MDK_CONF_RABBI == 0
|
||||
#define NO_RABBIT
|
||||
#endif
|
||||
// </e>
|
||||
|
||||
// <e>AEAD
|
||||
#define MDK_CONF_AEAD 0
|
||||
#if MDK_CONF_AEAD == 1
|
||||
#define HAVE_AEAD
|
||||
#endif
|
||||
// </e>
|
||||
// <e>DES3
|
||||
#define MDK_CONF_DES3 1
|
||||
#if MDK_CONF_DES3 == 0
|
||||
#define NO_DES3
|
||||
#endif
|
||||
// </e>
|
||||
// <e>CAMELLIA
|
||||
#define MDK_CONF_CAMELLIA 0
|
||||
#if MDK_CONF_CAMELLIA == 1
|
||||
#define HAVE_CAMELLIA
|
||||
#endif
|
||||
// </e>
|
||||
|
||||
// <e>DH
|
||||
// <i>need this for CYASSL_SERVER, OPENSSL_EXTRA
|
||||
#define MDK_CONF_DH 1
|
||||
#if MDK_CONF_DH == 0
|
||||
#define NO_DH
|
||||
#endif
|
||||
// </e>
|
||||
// <e>DSA
|
||||
#define MDK_CONF_DSA 1
|
||||
#if MDK_CONF_DSA == 0
|
||||
#define NO_DSA
|
||||
#endif
|
||||
// </e>
|
||||
// <e>PWDBASED
|
||||
#define MDK_CONF_PWDBASED 1
|
||||
#if MDK_CONF_PWDBASED == 0
|
||||
#define NO_PWDBASED
|
||||
#endif
|
||||
// </e>
|
||||
|
||||
// <e>ECC
|
||||
#define MDK_CONF_ECC 0
|
||||
#if MDK_CONF_ECC == 1
|
||||
#define HAVE_ECC
|
||||
#endif
|
||||
// </e>
|
||||
// <e>PSK
|
||||
#define MDK_CONF_PSK 1
|
||||
#if MDK_CONF_PSK == 0
|
||||
#define NO_PSK
|
||||
#endif
|
||||
// </e>
|
||||
// <e>AESCCM (Turn off Hardware Crypt)
|
||||
#define MDK_CONF_AESCCM 0
|
||||
#if MDK_CONF_AESCCM == 1
|
||||
#define HAVE_AESCCM
|
||||
#endif
|
||||
// </e>
|
||||
// <e>AESGCM (Turn off Hardware Crypt)
|
||||
#define MDK_CONF_AESGCM 0
|
||||
#if MDK_CONF_AESGCM == 1
|
||||
#define HAVE_AESGCM
|
||||
#define BUILD_AESGCM
|
||||
#endif
|
||||
// </e>
|
||||
// <e>NTRU (need License, "crypto_ntru.h")
|
||||
#define MDK_CONF_NTRU 0
|
||||
#if MDK_CONF_NTRU == 1
|
||||
#define HAVE_NTRU
|
||||
#endif
|
||||
// </e>
|
||||
// </h>
|
||||
|
||||
// <h>Others
|
||||
|
||||
// <e>Inline
|
||||
#define MDK_CONF_INLINE 0
|
||||
#if MDK_CONF_INLINE == 0
|
||||
#define NO_INLINE
|
||||
#endif
|
||||
// </e>
|
||||
// <h>Debug
|
||||
// <e>Debug Message
|
||||
#define MDK_CONF_DebugMessage 0
|
||||
#if MDK_CONF_DebugMessage == 1
|
||||
#define DEBUG_CYASSL
|
||||
#endif
|
||||
// </e>
|
||||
// <e>Check malloc
|
||||
#define MDK_CONF_CheckMalloc 1
|
||||
#if MDK_CONF_CheckMalloc == 1
|
||||
#define CYASSL_MALLOC_CHECK
|
||||
#endif
|
||||
// </e>
|
||||
|
||||
|
||||
// </h>
|
||||
// <e>ErrNo.h
|
||||
#define MDK_CONF_ErrNo 0
|
||||
#if MDK_CONF_ErrNo == 1
|
||||
#define HAVE_ERRNO
|
||||
#endif
|
||||
// </e>
|
||||
// <e>zlib (need "zlib.h")
|
||||
#define MDK_CONF_LIBZ 0
|
||||
#if MDK_CONF_LIBZ == 1
|
||||
#define HAVE_LIBZ
|
||||
#endif
|
||||
// </e>
|
||||
// <e>CAVIUM (need CAVIUM headers)
|
||||
#define MDK_CONF_CAVIUM 0
|
||||
#if MDK_CONF_CAVIUM == 1
|
||||
#define HAVE_CAVIUM
|
||||
#endif
|
||||
// </e>
|
||||
|
||||
// <e>Error Strings
|
||||
#define MDK_CONF_ErrorStrings 1
|
||||
#if MDK_CONF_ErrorStrings == 0
|
||||
#define NO_ERROR_STRINGS
|
||||
#endif
|
||||
// </e>
|
||||
|
||||
// <e>Small Stack
|
||||
#define MDK_CONF_SmallStack 1
|
||||
#if MDK_CONF_SmallStack == 0
|
||||
#define NO_CYASSL_SMALL_STACK
|
||||
#endif
|
||||
// </e>
|
||||
// <e>Use Fast Math
|
||||
#define MDK_CONF_FASTMATH 0
|
||||
#if MDK_CONF_FASTMATH == 1
|
||||
#define USE_FAST_MATH
|
||||
#endif
|
||||
// </e>
|
||||
|
||||
|
||||
// </h>
|
||||
|
||||
//</h>
|
||||
// <<< end of configuration section >>>
|
351
IDE/MDK-ARM/MDK-ARM/CyaSSL/config-RTX-TCP-FS.h
Normal file
351
IDE/MDK-ARM/MDK-ARM/CyaSSL/config-RTX-TCP-FS.h
Normal file
@ -0,0 +1,351 @@
|
||||
/* config-RTX-TCP-FS.h
|
||||
*
|
||||
* Copyright (C) 2006-2013 wolfSSL Inc.
|
||||
*
|
||||
* 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 for KEIL-RL Configuration ****/
|
||||
|
||||
#define __CORTEX_M3__
|
||||
#define CYASSL_MDK_ARM
|
||||
#define NO_WRITEV
|
||||
#define NO_CYASSL_DIR
|
||||
#define NO_MAIN_DRIVER
|
||||
|
||||
|
||||
#define CYASSL_DER_LOAD
|
||||
#define HAVE_NULL_CIPHER
|
||||
|
||||
#define HAVE_KEIL_RTX
|
||||
#define CYASSL_KEIL_TCP_NET
|
||||
|
||||
|
||||
// <<< Use Configuration Wizard in Context Menu >>>
|
||||
// <h> Build Target: KEIL-RTX-TCP-FS
|
||||
// <h> RTOS, File System and TCP-net
|
||||
// </h>
|
||||
// <e>Command Shell
|
||||
#define MDK_CONF_SHELL 1
|
||||
#if MDK_CONF_SHELL == 1
|
||||
#define CYASSL_MDK_SHELL
|
||||
#endif
|
||||
// </e>
|
||||
// <h>CyaSSL Apps
|
||||
// <h>Crypt/Cipher
|
||||
// <o>Cert Storage <0=> SD Card <1=> Mem Buff (1024bytes) <2=> Mem Buff (2048bytes)
|
||||
#define MDK_CONF_CERT_BUFF 0
|
||||
#if MDK_CONF_CERT_BUFF== 1
|
||||
#define USE_CERT_BUFFERS_1024
|
||||
#elif MDK_CONF_CERT_BUFF == 2
|
||||
#define USE_CERT_BUFFERS_2048
|
||||
#endif
|
||||
|
||||
// <e>Crypt/Cipher Test Suite
|
||||
#define MDK_CONF_CTaoCryptTest 1
|
||||
#if MDK_CONF_CTaoCryptTest == 0
|
||||
#define NO_CRYPT_TEST
|
||||
#endif
|
||||
// </e>
|
||||
// <e>Crypt/Cipher Benchmark
|
||||
#define MDK_CONF_CTaoCryptBenchmark 1
|
||||
#if MDK_CONF_CTaoCryptBenchmark == 0
|
||||
#define NO_CRYPT_BENCHMARK
|
||||
#define BENCH_EMBEDDED
|
||||
#endif
|
||||
// </e>
|
||||
// </h>
|
||||
// <h>SSL/TLS Server/Client
|
||||
// <e>echoServer
|
||||
#define MDK_CONF_echoServer 1
|
||||
#if MDK_CONF_echoServer == 0
|
||||
#define NO_ECHOSERVER
|
||||
#endif
|
||||
// </e>
|
||||
// <e>echoClient
|
||||
#define MDK_CONF_echoClient 1
|
||||
#if MDK_CONF_echoClient == 0
|
||||
#define NO_ECHOCLIENT
|
||||
#endif
|
||||
// </e>
|
||||
// <e>SimpleServer
|
||||
#define MDK_CONF_simpleServer 1
|
||||
#if MDK_CONF_simpleServer == 0
|
||||
#define NO_SIMPLE_SERVER
|
||||
#endif
|
||||
// </e>
|
||||
// <e>SimpleCliet
|
||||
#define MDK_CONF_simpleClient 1
|
||||
#if MDK_CONF_simpleClient == 0
|
||||
#define NO_SIMPLE_CLIENT
|
||||
#endif
|
||||
// </e>
|
||||
// </h>
|
||||
// </h>
|
||||
// <h>STM32 Hardware Crypt
|
||||
// <e>STM32F2 Hardware RNG
|
||||
#define MDK_CONF_STM32F2_RNG 0
|
||||
#if MDK_CONF_STM32F2_RNG == 1
|
||||
#define STM32F2_RNG
|
||||
#else
|
||||
#define NO_DEV_RANDOM
|
||||
#endif
|
||||
// </e>
|
||||
// <e>STM32F2 Hardware Crypt
|
||||
#define MDK_CONF_STM32F2_CRYPTO 0
|
||||
#if MDK_CONF_STM32F2_CRYPTO == 1
|
||||
#define STM32F2_CRYPTO
|
||||
#endif
|
||||
// </e>
|
||||
|
||||
// </h>
|
||||
|
||||
// <h>CyaSSL Library
|
||||
// <h>SSL (Included by default)
|
||||
// </h>
|
||||
|
||||
// <e>TLS
|
||||
#define MDK_CONF_TLS 1
|
||||
#if MDK_CONF_TLS == 0
|
||||
#define NO_TLS
|
||||
#endif
|
||||
// </e>
|
||||
|
||||
// <e>CertGen
|
||||
#define MDK_CONF_CERT_GEN 0
|
||||
#if MDK_CONF_CERT_GEN == 1
|
||||
#define CYASSL_CERT_GEN
|
||||
#endif
|
||||
// </e>
|
||||
// <e>KeyGen
|
||||
#define MDK_CONF_KEY_GEN 0
|
||||
#if MDK_CONF_KEY_GEN == 1
|
||||
#define CYASSL_KEY_GEN
|
||||
#endif
|
||||
// </e>
|
||||
// <e>CRL
|
||||
#define MDK_CONF_DER_LOAD 0
|
||||
#if MDK_CONF_DER_LOAD == 1
|
||||
#define CYASSL_DER_LOAD
|
||||
#endif
|
||||
// </e>
|
||||
// <e>OpenSSL Extra
|
||||
#define MDK_CONF_OPENSSL_EXTRA 1
|
||||
#if MDK_CONF_OPENSSL_EXTRA == 1
|
||||
#define OPENSSL_EXTRA
|
||||
#endif
|
||||
// </e>
|
||||
// <h>CRL Monitor, OCSP (not supported with KEIL)
|
||||
// </h>
|
||||
|
||||
// </h>
|
||||
|
||||
// <h>CTaoCrypt Library
|
||||
|
||||
// <h>MD5, SHA, SHA-256, AES, RC4, ASN, RSA
|
||||
// </h>
|
||||
// <e>MD2
|
||||
#define MDK_CONF_MD2 0
|
||||
#if MDK_CONF_MD2 == 1
|
||||
#define CYASSL_MD2
|
||||
#endif
|
||||
// </e>
|
||||
// <e>MD4
|
||||
#define MDK_CONF_MD4 1
|
||||
#if MDK_CONF_MD4 == 0
|
||||
#define NO_MD4
|
||||
#endif
|
||||
// </e>
|
||||
// <e>SHA-384
|
||||
// <i>This has to be with SHA512
|
||||
#define MDK_CONF_SHA384 0
|
||||
#if MDK_CONF_SHA384 == 1
|
||||
#define CYASSL_SHA384
|
||||
#endif
|
||||
// </e>
|
||||
// <e>SHA-512
|
||||
#define MDK_CONF_SHA512 0
|
||||
#if MDK_CONF_SHA512 == 1
|
||||
#define CYASSL_SHA512
|
||||
#endif
|
||||
// </e>
|
||||
// <e>RIPEMD
|
||||
#define MDK_CONF_RIPEMD 1
|
||||
#if MDK_CONF_RIPEMD == 1
|
||||
#define CYASSL_RIPEMD
|
||||
#endif
|
||||
// </e>
|
||||
// <e>HMAC
|
||||
#define MDK_CONF_HMAC 1
|
||||
#if MDK_CONF_HMAC == 0
|
||||
#define NO_HMAC
|
||||
#endif
|
||||
// </e>
|
||||
// <e>HC128
|
||||
#define MDK_CONF_HC128 0
|
||||
#if MDK_CONF_HC128 == 1
|
||||
#define HAVE_HC128
|
||||
#endif
|
||||
// </e>
|
||||
// <e>RABBIT
|
||||
#define MDK_CONF_RABBIT 1
|
||||
#if MDK_CONF_RABBI == 0
|
||||
#define NO_RABBIT
|
||||
#endif
|
||||
// </e>
|
||||
|
||||
// <e>AEAD
|
||||
#define MDK_CONF_AEAD 0
|
||||
#if MDK_CONF_AEAD == 1
|
||||
#define HAVE_AEAD
|
||||
#endif
|
||||
// </e>
|
||||
// <e>DES3
|
||||
#define MDK_CONF_DES3 1
|
||||
#if MDK_CONF_DES3 == 0
|
||||
#define NO_DES3
|
||||
#endif
|
||||
// </e>
|
||||
// <e>CAMELLIA
|
||||
#define MDK_CONF_CAMELLIA 0
|
||||
#if MDK_CONF_CAMELLIA == 1
|
||||
#define HAVE_CAMELLIA
|
||||
#endif
|
||||
// </e>
|
||||
|
||||
// <e>DH
|
||||
// <i>need this for CYASSL_SERVER, OPENSSL_EXTRA
|
||||
#define MDK_CONF_DH 1
|
||||
#if MDK_CONF_DH == 0
|
||||
#define NO_DH
|
||||
#endif
|
||||
// </e>
|
||||
// <e>DSA
|
||||
#define MDK_CONF_DSA 1
|
||||
#if MDK_CONF_DSA == 0
|
||||
#define NO_DSA
|
||||
#endif
|
||||
// </e>
|
||||
// <e>PWDBASED
|
||||
#define MDK_CONF_PWDBASED 1
|
||||
#if MDK_CONF_PWDBASED == 0
|
||||
#define NO_PWDBASED
|
||||
#endif
|
||||
// </e>
|
||||
|
||||
// <e>ECC
|
||||
#define MDK_CONF_ECC 1
|
||||
#if MDK_CONF_ECC == 1
|
||||
#define HAVE_ECC
|
||||
#endif
|
||||
// </e>
|
||||
// <e>PSK
|
||||
#define MDK_CONF_PSK 1
|
||||
#if MDK_CONF_PSK == 0
|
||||
#define NO_PSK
|
||||
#endif
|
||||
// </e>
|
||||
// <e>AESCCM (Turn off Hardware Crypt)
|
||||
#define MDK_CONF_AESCCM 0
|
||||
#if MDK_CONF_AESCCM == 1
|
||||
#define HAVE_AESCCM
|
||||
#endif
|
||||
// </e>
|
||||
// <e>AESGCM (Turn off Hardware Crypt)
|
||||
#define MDK_CONF_AESGCM 0
|
||||
#if MDK_CONF_AESGCM == 1
|
||||
#define HAVE_AESGCM
|
||||
#define BUILD_AESGCM
|
||||
#endif
|
||||
// </e>
|
||||
// <e>NTRU (need License, "crypto_ntru.h")
|
||||
#define MDK_CONF_NTRU 0
|
||||
#if MDK_CONF_NTRU == 1
|
||||
#define HAVE_NTRU
|
||||
#endif
|
||||
// </e>
|
||||
// </h>
|
||||
|
||||
// <h>Others
|
||||
|
||||
// <e>Inline
|
||||
#define MDK_CONF_INLINE 0
|
||||
#if MDK_CONF_INLINE == 0
|
||||
#define NO_INLINE
|
||||
#endif
|
||||
// </e>
|
||||
// <h>Debug
|
||||
// <e>Debug Message
|
||||
#define MDK_CONF_DEBUG_MSG 0
|
||||
#if MDK_CONF_DEBUG_MSG == 1
|
||||
#define DEBUG_CYASSL
|
||||
#endif
|
||||
// </e>
|
||||
// <e>Check malloc
|
||||
#define MDK_CONF_CHECK_MALLOC 1
|
||||
#if MDK_CONF_CHECK_MALLOC == 1
|
||||
#define CYASSL_MALLOC_CHECK
|
||||
#endif
|
||||
// </e>
|
||||
|
||||
|
||||
// </h>
|
||||
// <e>ErrNo.h
|
||||
#define MDK_CONF_ERR_NO 0
|
||||
#if MDK_CONF_ERR_NO == 1
|
||||
#define HAVE_ERRNO
|
||||
#endif
|
||||
// </e>
|
||||
// <e>zlib (need "zlib.h")
|
||||
#define MDK_CONF_LIBZ 0
|
||||
#if MDK_CONF_LIBZ == 1
|
||||
#define HAVE_LIBZ
|
||||
#endif
|
||||
// </e>
|
||||
// <e>CAVIUM (need CAVIUM headers)
|
||||
#define MDK_CONF_CAVIUM 0
|
||||
#if MDK_CONF_CAVIUM == 1
|
||||
#define HAVE_CAVIUM
|
||||
#endif
|
||||
// </e>
|
||||
|
||||
// <e>Error Strings
|
||||
#define MDK_CONF_ErrorStrings 1
|
||||
#if MDK_CONF_ErrorStrings == 0
|
||||
#define NO_ERROR_STRINGS
|
||||
#endif
|
||||
// </e>
|
||||
|
||||
// <e>Small Stack
|
||||
#define MDK_CONF_SMALL_STACK 1
|
||||
#if MDK_CONF_SMALL_STACK == 0
|
||||
#define NO_CYASSL_SMALL_STACK
|
||||
#endif
|
||||
// </e>
|
||||
// <e>Use Fast Math
|
||||
#define MDK_CONF_FASTMATH 0
|
||||
#if MDK_CONF_FASTMATH == 1
|
||||
#define USE_FAST_MATH
|
||||
#endif
|
||||
// </e>
|
||||
|
||||
|
||||
// </h>
|
||||
|
||||
//</h>
|
||||
// <<< end of configuration section >>>
|
46
IDE/MDK-ARM/MDK-ARM/CyaSSL/config.h
Normal file
46
IDE/MDK-ARM/MDK-ARM/CyaSSL/config.h
Normal file
@ -0,0 +1,46 @@
|
||||
/* config.h
|
||||
*
|
||||
* Copyright (C) 2006-2013 wolfSSL Inc.
|
||||
*
|
||||
* 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 for KEIL-RL Configuration ****/
|
||||
|
||||
#define __CORTEX_M3__
|
||||
#define CYASSL_MDK_ARM
|
||||
#define NO_WRITEV
|
||||
#define NO_CYASSL_DIR
|
||||
|
||||
/* for Retarget.c */
|
||||
#define STDIO
|
||||
#define BENCH_EMBEDDED
|
||||
|
||||
#define CYASSL_DER_LOAD
|
||||
#define HAVE_NULL_CIPHER
|
||||
|
||||
#if defined(MDK_CONF_RTX_TCP_FS)
|
||||
#include "config-RTX-TCP-FS.h"
|
||||
#elif defined(MDK_CONF_TCP_FS)
|
||||
#include "config-TCP-FS.h"
|
||||
#elif defined(MDK_CONF_FS)
|
||||
#include "config-FS.h"
|
||||
#elif defined(MDK_CONF_BARE_METAL)
|
||||
#include "config-BARE-METAL.h"
|
||||
#endif
|
||||
|
201
IDE/MDK-ARM/MDK-ARM/CyaSSL/cyassl_MDK_ARM.c
Normal file
201
IDE/MDK-ARM/MDK-ARM/CyaSSL/cyassl_MDK_ARM.c
Normal file
@ -0,0 +1,201 @@
|
||||
/* cyassl_KEIL_RL.c
|
||||
*
|
||||
* Copyright (C) 2006-2013 wolfSSL Inc.
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
|
||||
|
||||
/***************************************************************************************/
|
||||
/** This file is for defining functions for specific to KEIL-RL. **/
|
||||
/***************************************************************************************/
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#include <rtl.h>
|
||||
#include "cyassl_MDK_ARM.h"
|
||||
|
||||
#include <cyassl/ctaocrypt/visibility.h>
|
||||
#include <cyassl/ctaocrypt/logging.h>
|
||||
|
||||
|
||||
/** KEIL-RL TCPnet ****/
|
||||
/** TCPnet BSD socket does not have following functions. **/
|
||||
|
||||
char *inet_ntoa(struct in_addr in)
|
||||
{
|
||||
#define NAMESIZE 16
|
||||
static char name[NAMESIZE] ;
|
||||
sprintf(name, "%d.%d.%d.%d", (in.s_addr>>24)&0xff, (in.s_addr>>16)&0xff, (in.s_addr>>8)&0xff, in.s_addr&0xff) ;
|
||||
return name ;
|
||||
}
|
||||
|
||||
unsigned long inet_addr(const char *cp)
|
||||
{
|
||||
unsigned int a[4] ; unsigned long ret ;
|
||||
sscanf(cp, "%d.%d.%d.%d", &a[0], &a[1], &a[2], &a[3]) ;
|
||||
ret = ((a[3]<<24) + (a[2]<<16) + (a[1]<<8) + a[0]) ;
|
||||
return(ret) ;
|
||||
}
|
||||
|
||||
|
||||
/*** tcp_connect is actually associated with following syassl_tcp_connect. ***/
|
||||
int Cyassl_connect(int sd, const struct sockaddr* sa, int sz)
|
||||
{
|
||||
int ret = 0 ;
|
||||
#if defined(CYASSL_KEIL_TCP_NET)
|
||||
|
||||
SOCKADDR_IN addr ;
|
||||
|
||||
addr = *(SOCKADDR_IN *)sa ;
|
||||
|
||||
do {
|
||||
#undef connect /* Go to KEIL TCPnet connect */
|
||||
ret = connect(sd, (SOCKADDR *)&addr, sizeof(addr)) ;
|
||||
os_dly_wait(50);
|
||||
} while(ret == SCK_EWOULDBLOCK) ;
|
||||
#ifdef DEBUG_CYASSL
|
||||
{
|
||||
char msg[50] ;
|
||||
sprintf(msg, "BSD Connect return code: %d\n", ret) ;
|
||||
CYASSL_MSG(msg) ;
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* CYASSL_KEIL_TCP_NET */
|
||||
return(ret ) ;
|
||||
}
|
||||
|
||||
|
||||
int Cyassl_accept(int sd, struct sockaddr *addr, int *addrlen)
|
||||
{
|
||||
int ret = 0 ;
|
||||
|
||||
#if defined(CYASSL_KEIL_TCP_NET)
|
||||
while(1) {
|
||||
#undef accept /* Go to KEIL TCPnet accept */
|
||||
ret = accept(sd, addr, addrlen) ;
|
||||
if(ret != SCK_EWOULDBLOCK) break ;
|
||||
os_dly_wait(1);
|
||||
}
|
||||
#ifdef DEBUG_CYASSL
|
||||
{
|
||||
char msg[50] ;
|
||||
sprintf(msg, "BSD Accept return code: %d\n", ret) ;
|
||||
CYASSL_MSG(msg) ;
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* CYASSL_KEIL_TCP_NET */
|
||||
return(ret ) ;
|
||||
|
||||
}
|
||||
|
||||
int Cyassl_recv(int sd, void *buf, size_t len, int flags)
|
||||
{
|
||||
int ret = 0;
|
||||
#if defined(CYASSL_KEIL_TCP_NET)
|
||||
while(1) {
|
||||
#undef recv /* Go to KEIL TCPnet recv */
|
||||
ret = recv(sd, buf, len, flags) ;
|
||||
if(ret != SCK_EWOULDBLOCK) break ;
|
||||
os_dly_wait(1);
|
||||
}
|
||||
#ifdef DEBUG_CYASSL
|
||||
{
|
||||
char msg[50] ;
|
||||
sprintf(msg, "BSD Recv return code: %d\n", ret) ;
|
||||
CYASSL_MSG(msg) ;
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* CYASSL_KEIL_TCP_NET */
|
||||
return(ret ) ;
|
||||
}
|
||||
|
||||
int Cyassl_send(int sd, const void *buf, size_t len, int flags)
|
||||
{
|
||||
int ret = 0 ;
|
||||
|
||||
#if defined(CYASSL_KEIL_TCP_NET)
|
||||
while(1) {
|
||||
#undef send /* Go to KEIL TCPnet send */
|
||||
ret = send(sd, buf, len, flags) ;
|
||||
if(ret != SCK_EWOULDBLOCK) break ;
|
||||
os_dly_wait(1);
|
||||
}
|
||||
#ifdef DEBUG_CYASSL
|
||||
{
|
||||
char msg[50] ;
|
||||
sprintf(msg, "BSD Send return code: %d\n", ret) ;
|
||||
CYASSL_MSG(msg) ;
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* CYASSL_KEIL_TCP_NET */
|
||||
return(ret) ;
|
||||
|
||||
}
|
||||
|
||||
#if defined(CYASSL_KEIL_TCP_NET)
|
||||
void Cyassl_sleep(int t)
|
||||
{
|
||||
#if defined(HAVE_KEIL_RTX)
|
||||
os_dly_wait(t/1000+1) ;
|
||||
#endif
|
||||
}
|
||||
|
||||
int Cyassl_tcp_select(int sd, int timeout)
|
||||
{
|
||||
|
||||
return 0 ;
|
||||
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
extern int getkey(void) ;
|
||||
extern int sendchar(int c) ;
|
||||
|
||||
char * Cyassl_fgets ( char * str, int num, FILE * f )
|
||||
{
|
||||
int i ;
|
||||
|
||||
for(i = 0 ; i< num ; i++) {
|
||||
while((str[i] = getkey()) == 0) ;
|
||||
if(str[i] == '\n' || str[i] == '\012' || str[i] == '\015') {
|
||||
sendchar('\n') ;
|
||||
str[i++] = '\n' ;
|
||||
str[i] = '\0' ;
|
||||
break ;
|
||||
} else if(str[i] == '\010') { /* BS */
|
||||
if(i) { /* erace one char */
|
||||
sendchar('\010') ; sendchar(' ') ; sendchar('\010') ;
|
||||
i = (i>0 ? (i-2) : -1 ) ;
|
||||
continue ;
|
||||
}
|
||||
} else if(str[i] == '\033' || str[i] == '\004' ) { /* ESC or ^D */
|
||||
str[i] = '\0' ;
|
||||
return(0) ;
|
||||
}
|
||||
sendchar(str[i]) ;
|
||||
}
|
||||
return(str) ;
|
||||
}
|
103
IDE/MDK-ARM/MDK-ARM/CyaSSL/cyassl_MDK_ARM.h
Normal file
103
IDE/MDK-ARM/MDK-ARM/CyaSSL/cyassl_MDK_ARM.h
Normal file
@ -0,0 +1,103 @@
|
||||
/* cyassl_KEIL_RL.h
|
||||
*
|
||||
* Copyright (C) 2006-2013 wolfSSL Inc.
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
|
||||
/******************************************************************************/
|
||||
/** This file is for defining types, values for specific to KEIL-MDK-ARM. **/
|
||||
/******************************************************************************/
|
||||
#ifndef CYASSL_KEIL_RL_H
|
||||
#define CYASSL_KEIL_RL_H
|
||||
|
||||
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
/* Go to STDIN */
|
||||
#define fgets(buff, sz, fd) Cyassl_fgets(buff, sz, fd)
|
||||
extern char * Cyassl_fgets ( char * str, int num, FILE * f ) ;
|
||||
|
||||
#define SOCKET_T int
|
||||
|
||||
/*** #include <socket.h> ***/
|
||||
#define NUMBITSPERBYTE 8
|
||||
#define FD_SETSIZE 10
|
||||
|
||||
typedef long fd_mask;
|
||||
#define NFDBITS (sizeof(fd_mask) * NUMBITSPERBYTE) /* bits per mask */
|
||||
|
||||
typedef struct fd_set {
|
||||
fd_mask fds_bits[(FD_SETSIZE + NFDBITS - 1) / NFDBITS];
|
||||
} fd_set;
|
||||
|
||||
/*** #include <sys/types.h> ***/
|
||||
struct timeval {
|
||||
long tv_sec; /* seconds */
|
||||
long tv_usec; /* microseconds */
|
||||
};
|
||||
|
||||
|
||||
/*** #include <unistd.h> **/
|
||||
/*
|
||||
int select(int nfds, fd_set *readfds, fd_set *writefds,
|
||||
fd_set *exceptfds, const struct timeval *timeout);
|
||||
void FD_CLR(int fd, fd_set *set);
|
||||
int FD_ISSET(int fd, fd_set *set);
|
||||
void FD_SET(int fd, fd_set *set);
|
||||
void FD_ZERO(fd_set *set);
|
||||
*/
|
||||
typedef int socklen_t ;
|
||||
|
||||
/* for avoiding conflict with KEIL-TCPnet BSD socket */
|
||||
/* Bodies are in cyassl_KEIL_RL.c */
|
||||
#define connect Cyassl_connect
|
||||
#define accept Cyassl_accept
|
||||
#define recv Cyassl_recv
|
||||
#define send Cyassl_send
|
||||
#define sleep Cyassl_sleep
|
||||
|
||||
/* for avoiding conflicting with KEIL-TCPnet TCP socket */
|
||||
/* Bodies are in test.h */
|
||||
#define tcp_connect Cyassl_tcp_connect
|
||||
#define tcp_socket Cyassl_tcp_soket
|
||||
#define tcp_listen Cyassl_tcp_listen
|
||||
#define tcp_select Cyassl_tcp_select
|
||||
|
||||
extern int Cyassl_connect(int sd, const struct sockaddr * sa, int sz) ;
|
||||
extern int Cyassl_accept(int sd, struct sockaddr *addr, socklen_t *addrlen);
|
||||
extern int Cyassl_recv(int sd, void *buf, size_t len, int flags);
|
||||
extern int Cyassl_send(int sd, const void *buf, size_t len, int flags);
|
||||
extern void Cyassl_sleep(int sec) ;
|
||||
extern int Cyassl_tcp_select(int sd, int timeout) ;
|
||||
|
||||
/** KEIL-RL TCPnet ****/
|
||||
/* TCPnet BSD socket does not have following functions. */
|
||||
extern char *inet_ntoa(struct in_addr in);
|
||||
extern unsigned long inet_addr(const char *cp);
|
||||
extern int setsockopt(int sockfd, int level, int optname,
|
||||
const void *optval, socklen_t optlen);
|
||||
extern int select(int nfds, fd_set *readfds, fd_set *writefds,
|
||||
fd_set *exceptfds, const struct timeval *timeout);
|
||||
|
||||
/* CyaSSL MDK-ARM time functions */
|
||||
#include <time.h>
|
||||
struct tm *Cyassl_MDK_gmtime(const time_t *c) ;
|
||||
extern double current_time(void) ;
|
||||
|
||||
#endif /* CYASSL_KEIL_RL_H */
|
173
IDE/MDK-ARM/MDK-ARM/CyaSSL/main.c
Normal file
173
IDE/MDK-ARM/MDK-ARM/CyaSSL/main.c
Normal file
@ -0,0 +1,173 @@
|
||||
/* main.c
|
||||
*
|
||||
* Copyright (C) 2006-2013 wolfSSL Inc.
|
||||
*
|
||||
* 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/visibility.h>
|
||||
#include <cyassl/ctaocrypt/logging.h>
|
||||
|
||||
#include <RTL.h>
|
||||
#include <stdio.h>
|
||||
#include "cyassl_MDK_ARM.h"
|
||||
|
||||
/*-----------------------------------------------------------------------------
|
||||
* Initialize a Flash Memory Card
|
||||
*----------------------------------------------------------------------------*/
|
||||
#if !defined(NO_FILESYSTEM)
|
||||
static void init_card (void)
|
||||
{
|
||||
U32 retv;
|
||||
|
||||
while ((retv = finit (NULL)) != 0) { /* Wait until the Card is ready */
|
||||
if (retv == 1) {
|
||||
printf ("\nSD/MMC Init Failed");
|
||||
printf ("\nInsert Memory card and press key...\n");
|
||||
} else {
|
||||
printf ("\nSD/MMC Card is Unformatted");
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
/*-----------------------------------------------------------------------------
|
||||
* TCP/IP tasks
|
||||
*----------------------------------------------------------------------------*/
|
||||
#ifdef CYASSL_KEIL_TCP_NET
|
||||
__task void tcp_tick (void)
|
||||
{
|
||||
|
||||
CYASSL_MSG("Time tick started.") ;
|
||||
#if defined (HAVE_KEIL_RTX)
|
||||
os_itv_set (10);
|
||||
#endif
|
||||
|
||||
while (1) {
|
||||
#if defined (HAVE_KEIL_RTX)
|
||||
os_itv_wait ();
|
||||
#endif
|
||||
/* Timer tick every 100 ms */
|
||||
timer_tick ();
|
||||
}
|
||||
}
|
||||
|
||||
__task void tcp_poll (void)
|
||||
{
|
||||
CYASSL_MSG("TCP polling started.\n") ;
|
||||
while (1) {
|
||||
main_TcpNet ();
|
||||
#if defined (HAVE_KEIL_RTX)
|
||||
os_tsk_pass ();
|
||||
#endif
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_KEIL_RTX) && defined(CYASSL_MDK_SHELL)
|
||||
#define SHELL_STACKSIZE 1000
|
||||
static unsigned char Shell_stack[SHELL_STACKSIZE] ;
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(CYASSL_MDK_SHELL)
|
||||
extern void shell_main(void) ;
|
||||
#endif
|
||||
|
||||
extern void time_main(int) ;
|
||||
extern void benchmark_test(void) ;
|
||||
extern void SER_Init(void) ;
|
||||
|
||||
/*-----------------------------------------------------------------------------
|
||||
* mian entry
|
||||
*----------------------------------------------------------------------------*/
|
||||
|
||||
/*** This is the parent task entry ***/
|
||||
void main_task (void)
|
||||
{
|
||||
#ifdef CYASSL_KEIL_TCP_NET
|
||||
init_TcpNet ();
|
||||
|
||||
os_tsk_create (tcp_tick, 2);
|
||||
os_tsk_create (tcp_poll, 1);
|
||||
#endif
|
||||
|
||||
#ifdef CYASSL_MDK_SHELL
|
||||
#ifdef HAVE_KEIL_RTX
|
||||
os_tsk_create_user(shell_main, 1, Shell_stack, SHELL_STACKSIZE) ;
|
||||
#else
|
||||
shell_main() ;
|
||||
#endif
|
||||
#else
|
||||
|
||||
/************************************/
|
||||
/*** USER APPLICATION HERE ***/
|
||||
/************************************/
|
||||
printf("USER LOGIC STARTED\n") ;
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_KEIL_RTX
|
||||
CYASSL_MSG("Terminating tcp_main\n") ;
|
||||
os_tsk_delete_self ();
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
|
||||
int myoptind = 0;
|
||||
char* myoptarg = NULL;
|
||||
|
||||
#if defined(DEBUG_CYASSL)
|
||||
extern void CyaSSL_Debugging_ON(void) ;
|
||||
#endif
|
||||
|
||||
|
||||
/*** main entry ***/
|
||||
extern void init_time(void) ;
|
||||
extern void SystemInit(void);
|
||||
|
||||
int main() {
|
||||
|
||||
SystemInit();
|
||||
SER_Init() ;
|
||||
#if !defined(NO_FILESYSTEM)
|
||||
init_card () ; /* initializing SD card */
|
||||
#endif
|
||||
|
||||
init_time() ;
|
||||
|
||||
|
||||
#if defined(DEBUG_CYASSL)
|
||||
printf("Turning ON Debug message\n") ;
|
||||
CyaSSL_Debugging_ON() ;
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_KEIL_RTX
|
||||
os_sys_init (main_task) ;
|
||||
#else
|
||||
main_task() ;
|
||||
#endif
|
||||
|
||||
return 0 ; /* There should be no return here */
|
||||
|
||||
}
|
595
IDE/MDK-ARM/MDK-ARM/CyaSSL/shell.c
Normal file
595
IDE/MDK-ARM/MDK-ARM/CyaSSL/shell.c
Normal file
@ -0,0 +1,595 @@
|
||||
/*shell.c
|
||||
*
|
||||
* Copyright (C) 2006-2013 wolfSSL Inc.
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
|
||||
/*** tiny Shell for CyaSSL apps ***/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
#include "cyassl/internal.h"
|
||||
#undef RNG
|
||||
#include <cyassl/ctaocrypt/logging.h>
|
||||
|
||||
#if defined(CYASSL_MDK_ARM)
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <rtl.h>
|
||||
#include "cyassl_MDK_ARM.h"
|
||||
#endif
|
||||
|
||||
#ifdef CYASSL_KEIL_NET
|
||||
#include "cyassl/test.h"
|
||||
#else
|
||||
typedef struct func_args {
|
||||
int argc;
|
||||
char** argv;
|
||||
int return_code;
|
||||
} func_args;
|
||||
#endif
|
||||
|
||||
#ifdef NO_ECHOCLIENT
|
||||
#define echoclient_test command_not_found
|
||||
#endif
|
||||
#ifdef NO_ECHOSERVER
|
||||
#define echoserver_test command_not_found
|
||||
#endif
|
||||
#ifdef NO_SIMPLE_CLIENT
|
||||
#define client_test command_not_found
|
||||
#endif
|
||||
#ifdef NO_SIMPLE_SERVER
|
||||
#define server_test command_not_found
|
||||
#endif
|
||||
#ifdef NO_CRYPT_BENCHMARK
|
||||
#define benchmark_test command_not_found
|
||||
#endif
|
||||
#ifdef NO_CRYPT_TEST
|
||||
#define ctaocrypt_test command_not_found
|
||||
#endif
|
||||
|
||||
#ifndef CYASSL_KEIL_NET
|
||||
#define ipaddr_comm command_not_found
|
||||
#endif
|
||||
|
||||
#if !defined(HAVE_KEIL_RTX)
|
||||
#define stack_comm command_not_found
|
||||
#endif
|
||||
|
||||
|
||||
#if !defined(DEBUG_CYASSL)
|
||||
#define dbg_comm command_not_found
|
||||
#endif
|
||||
|
||||
|
||||
void command_not_found(void *argv) {
|
||||
printf("Command not found\n") ;
|
||||
}
|
||||
|
||||
extern void echoclient_test(void *args) ;
|
||||
extern void echoserver_test(void *args) ;
|
||||
extern void benchmark_test(void *args) ;
|
||||
extern void ctaocrypt_test(void *args) ;
|
||||
extern void client_test(void *args) ;
|
||||
extern void server_test(void *args) ;
|
||||
extern void kill_task(void *args) ;
|
||||
extern void time_main(void *args) ;
|
||||
extern void ipaddr_comm(void *args) ;
|
||||
extern void stack_comm(void *args) ;
|
||||
extern void for_command(void *args) ;
|
||||
extern void dbg_comm(void *arg) ;
|
||||
extern void help_comm(void *arg) ;
|
||||
|
||||
#if !defined(NO_CRYPT_TEST)
|
||||
|
||||
#ifndef NO_MD5
|
||||
extern void md5_test(void *arg) ;
|
||||
#endif
|
||||
#ifdef CYASSL_MD2
|
||||
extern void md2_test(void *arg) ;
|
||||
#endif
|
||||
#ifndef NO_MD4
|
||||
extern void md4_test(void *arg) ;
|
||||
#endif
|
||||
|
||||
extern void sha_test(void *arg) ;
|
||||
|
||||
#ifndef NO_SHA256
|
||||
extern void sha256_test(void *arg) ;
|
||||
#endif
|
||||
#ifdef CYASSL_SHA384
|
||||
extern void sha384_test(void *arg) ;
|
||||
#endif
|
||||
|
||||
#ifdef CYASSL_SHA512
|
||||
extern void sha512_test(void *arg) ;
|
||||
#endif
|
||||
|
||||
#ifdef CYASSL_RIPEMD
|
||||
extern void ripemd_test(void *arg) ;
|
||||
#endif
|
||||
#ifndef NO_HMAC
|
||||
#ifndef NO_MD5
|
||||
extern void hmac_md5_test(void *arg) ;
|
||||
#endif
|
||||
extern void hmac_sha_test(void *arg) ;
|
||||
|
||||
#ifndef NO_SHA256
|
||||
extern void hmac_sha256_test(void *arg) ;
|
||||
#endif
|
||||
|
||||
#ifdef CYASSL_SHA384
|
||||
extern void hmac_sha384_test(void *arg) ;
|
||||
#endif
|
||||
#endif
|
||||
#ifndef NO_RC4
|
||||
extern void arc4_test(void *arg) ;
|
||||
#endif
|
||||
|
||||
#ifndef NO_HC128
|
||||
extern void hc128_test(void *arg) ;
|
||||
#endif
|
||||
|
||||
#ifndef NO_RABBIT
|
||||
extern void rabbit_test(void *arg) ;
|
||||
#endif
|
||||
|
||||
#ifndef NO_DES3
|
||||
extern void des_test(void *arg) ;
|
||||
extern void des3_test(void *arg) ;
|
||||
#endif
|
||||
|
||||
#ifndef NO_AES
|
||||
extern void aes_test(void *arg) ;
|
||||
#ifdef HAVE_AESGCM
|
||||
extern void aesgcm_test(void *arg) ;
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_AESCCM
|
||||
extern void aesccm_test(void *arg) ;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_CAMELLIA
|
||||
extern void camellia_test(void *arg) ;
|
||||
#endif
|
||||
extern void random_test(void *arg) ;
|
||||
|
||||
#ifndef NO_RSA
|
||||
extern void rsa_test(void *arg) ;
|
||||
#endif
|
||||
|
||||
#ifndef NO_DH
|
||||
extern void dh_test(void *arg) ;
|
||||
#endif
|
||||
|
||||
#ifndef NO_DSA
|
||||
extern void dsa_test(void *arg) ;
|
||||
#endif
|
||||
|
||||
#ifndef NO_PWDBASED
|
||||
extern void pwdbased_test(void *arg) ;
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_ECC
|
||||
extern void openssl_test(void *arg) ;
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_ECC
|
||||
extern void ecc_test(void *arg) ;
|
||||
#endif
|
||||
|
||||
#endif /* NO_CRYPT_TEST */
|
||||
|
||||
static struct {
|
||||
const char *command ;
|
||||
void (*func)(void *args) ;
|
||||
} commandTable[] = {
|
||||
"echoclient", echoclient_test,
|
||||
"echoserver", echoserver_test,
|
||||
"benchmark", benchmark_test,
|
||||
"test", ctaocrypt_test,
|
||||
"client", client_test,
|
||||
"server", server_test,
|
||||
"time", time_main, /* get/set RTC: [-d yy/mm/dd] [-t hh:mm:ss]*/
|
||||
"ipaddr", ipaddr_comm, /* TBD */
|
||||
"stack", stack_comm, /* On/Off check stack size */
|
||||
"for", for_command, /* iterate next command X times */
|
||||
"debug", dbg_comm, /* On/Off debug message */
|
||||
"help", help_comm, /* Breif description about the commands */
|
||||
|
||||
/** short name **/
|
||||
"ec", echoclient_test,
|
||||
"es", echoserver_test,
|
||||
"bm", benchmark_test,
|
||||
"te", ctaocrypt_test,
|
||||
"cl", client_test,
|
||||
"sv", server_test,
|
||||
"ip", ipaddr_comm,
|
||||
"st", stack_comm,
|
||||
"dbg", dbg_comm,
|
||||
"?", help_comm,
|
||||
|
||||
/*** test suites ****/
|
||||
#if !defined(NO_CRYPT_TEST)
|
||||
#ifndef NO_MD5
|
||||
"md5", md5_test,
|
||||
#endif
|
||||
#ifdef CYASSL_MD2
|
||||
"md2", md2_test,
|
||||
#endif
|
||||
#ifndef NO_MD4
|
||||
"md4", md4_test,
|
||||
#endif
|
||||
"sha", sha_test,
|
||||
#ifndef NO_SHA256
|
||||
"sha256", sha256_test,
|
||||
#endif
|
||||
#ifdef CYASSL_SHA384
|
||||
"sha384", sha384_test,
|
||||
#endif
|
||||
#ifdef CYASSL_SHA512
|
||||
"sha512", sha512_test,
|
||||
#endif
|
||||
#ifdef CYASSL_RIPEMD
|
||||
"ripemd", ripemd_test,
|
||||
#endif
|
||||
#ifndef NO_HMAC
|
||||
#ifndef NO_MD5
|
||||
"hmac_md5", hmac_md5_test,
|
||||
#endif
|
||||
"hmac_sha", hmac_sha_test,
|
||||
#ifndef NO_SHA256
|
||||
"hmac_sha256", hmac_sha256_test,
|
||||
#endif
|
||||
#ifdef CYASSL_SHA384
|
||||
"hmac_sha384", hmac_sha384_test,
|
||||
#endif
|
||||
#endif
|
||||
#ifndef NO_RC4
|
||||
"arc4", arc4_test,
|
||||
#endif
|
||||
#ifndef NO_HC128
|
||||
"hc128", hc128_test,
|
||||
#endif
|
||||
#ifndef NO_RABBIT
|
||||
"rabbit", rabbit_test,
|
||||
#endif
|
||||
#ifndef NO_DES3
|
||||
"des", des_test,
|
||||
"des3", des3_test,
|
||||
#endif
|
||||
#ifndef NO_AES
|
||||
"aes", aes_test,
|
||||
#ifdef HAVE_AESGCM
|
||||
"aesgcm", aesgcm_test,
|
||||
#endif
|
||||
#ifdef HAVE_AESCCM
|
||||
"aesccm", aesccm_test,
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_CAMELLIA
|
||||
"camellia", camellia_test,
|
||||
#endif
|
||||
"random", random_test,
|
||||
#ifndef NO_RSA
|
||||
"rsa", rsa_test,
|
||||
#endif
|
||||
#ifndef NO_DH
|
||||
"dh", dh_test,
|
||||
#endif
|
||||
#ifndef NO_DSA
|
||||
"dsa", dsa_test,
|
||||
#endif
|
||||
#ifndef NO_PWDBASED
|
||||
"pwdbased", pwdbased_test,
|
||||
#endif
|
||||
#ifdef OPENSSL_EXTRA
|
||||
"openssl", openssl_test,
|
||||
#endif
|
||||
#ifdef HAVE_ECC
|
||||
"ecc", ecc_test,
|
||||
#endif
|
||||
|
||||
#endif /* NO_CRYPT_TEST */
|
||||
|
||||
"", NULL
|
||||
} ;
|
||||
|
||||
enum jobtype { FORGROUND, BACKGROUND } ;
|
||||
|
||||
#define IF_DELIMITER(ch) ((ch) == ' ' || (ch) == '\n')
|
||||
|
||||
/******* Get Command Line *****************************/
|
||||
static int getline(char * line, int sz, func_args *args, int*bf_flg)
|
||||
{
|
||||
char * ret ;
|
||||
int i ;
|
||||
|
||||
#define MAXARGS 10
|
||||
#define MAXARGLEN 30
|
||||
static char *argv[MAXARGS] ;
|
||||
args->argv = argv ;
|
||||
|
||||
putchar('>') ;
|
||||
fflush(stdout) ;
|
||||
ret = fgets(line, sz, stdin) ;
|
||||
#define SHELL_ERROR_FGETS -102
|
||||
if(ret != line) return(SHELL_ERROR_FGETS) ;
|
||||
|
||||
if(line[strlen(line)-2] == '&') {
|
||||
(*bf_flg) = BACKGROUND ;
|
||||
line[strlen(line)-2] = '\n' ;
|
||||
} else {
|
||||
(*bf_flg) = FORGROUND ;
|
||||
}
|
||||
args->argc = 0 ;
|
||||
for(i=0; i<sz; i++) {
|
||||
args->argv[args->argc] = &(line[i]) ;
|
||||
while(!IF_DELIMITER(line[i])) i++ ;
|
||||
args->argc++ ;
|
||||
if(line[i] == '\n') {
|
||||
line[i] = '\0' ;
|
||||
break ;
|
||||
} else {
|
||||
line[i] = '\0' ;
|
||||
}
|
||||
}
|
||||
return i ;
|
||||
}
|
||||
|
||||
static int BackGround = 0 ; /* 1: background job is running */
|
||||
|
||||
/************* Embedded Shell Commands **********************************/
|
||||
#define IP_SIZE 16
|
||||
|
||||
#ifdef CYASSL_KEIL_NET
|
||||
static void ipaddr_comm(void *args)
|
||||
{
|
||||
if(((func_args *)args)->argc == 1) {
|
||||
printf("IP addr: %s, port %d\n", yasslIP, yasslPort) ;
|
||||
} else {
|
||||
if(BackGround != 0) {
|
||||
printf("Cannot change IP addr while background server is running\n") ;
|
||||
} else if(((func_args *)args)->argc == 3 &&
|
||||
((func_args *)args)->argv[1][0] == '-'&&
|
||||
((func_args *)args)->argv[1][1] == 'a' ) {
|
||||
/* strcpy(yasslIP, ((func_args *)args)->argv[2]) ; */
|
||||
} else if(((func_args *)args)->argc == 3 &&
|
||||
((func_args *)args)->argv[1][0] == '-' &&
|
||||
((func_args *)args)->argv[1][1] == 'p' ) {
|
||||
/* yasslPort = atoi(((func_args *)args)->argv[2]) ; */
|
||||
} else printf("Invalid argument\n") ;
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#if defined(HAVE_KEIL_RTX)
|
||||
static int stack_ck = 0 ;
|
||||
|
||||
static void stack_comm(void *args)
|
||||
{
|
||||
if(stack_ck) {
|
||||
printf("Stack Check: Off\n") ;
|
||||
stack_ck = 0 ;
|
||||
} else {
|
||||
printf("Stack Check: On\n") ;
|
||||
stack_ck = 1 ;
|
||||
}
|
||||
}
|
||||
|
||||
#define FILL_PATTERN 0xa596695a
|
||||
void stack_fill(char * stack, int size)
|
||||
{
|
||||
int i ;
|
||||
|
||||
if(stack_ck == 0)return ;
|
||||
for(i=1; i<size/4-10; i++)
|
||||
((int *)stack)[i] = FILL_PATTERN ;
|
||||
}
|
||||
|
||||
void stack_check(char * stack, int size)
|
||||
{
|
||||
int i ;
|
||||
|
||||
if(stack_ck == 0)return ;
|
||||
if(stack_ck == 1) {
|
||||
stack_ck ++ ; return ;
|
||||
}
|
||||
for(i=1; i<size/4 ; i++) {
|
||||
if(((int *)stack)[i] != FILL_PATTERN) break ;
|
||||
}
|
||||
if(i < size/4) {
|
||||
printf("Stack is used %d bytes out of %d\n", size - i*4, size) ;
|
||||
} else {
|
||||
printf("Stack overflow. Stack size: %d\n", size) ;
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* HAVE_KEIL_RTX */
|
||||
|
||||
static int for_iteration = 1 ;
|
||||
|
||||
static void for_command(void *args)
|
||||
{
|
||||
if( args == NULL || ((func_args *)args)->argc == 1) {
|
||||
printf("For %d times\n", for_iteration) ;
|
||||
} else if( args == NULL || ((func_args *)args)->argc == 2) {
|
||||
for_iteration = atoi(((func_args *)args)->argv[1]) ;
|
||||
} else printf("Invalid argument\n") ;
|
||||
}
|
||||
|
||||
|
||||
#if defined(DEBUG_CYASSL)
|
||||
|
||||
static int CyasslDebug = 1 ;
|
||||
|
||||
static void dbg_comm(void *args)
|
||||
{
|
||||
if(CyasslDebug == 1) {
|
||||
CyasslDebug = 0 ;
|
||||
printf("Turning OFF Debug message\n") ;
|
||||
CyaSSL_Debugging_OFF() ;
|
||||
} else {
|
||||
CyasslDebug = 1 ;
|
||||
printf("Turning ON Debug message\n") ;
|
||||
CyaSSL_Debugging_ON() ;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
static void help_comm(void *args)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
#define BG_JOB_STACK_SIZE 12000
|
||||
#if (!defined(NO_SIMPLE_SERVER) && !defined(NO_ECHOSERVER)) && \
|
||||
defined(HAVE_KEIL_RTX)
|
||||
static char bg_job_stack[BG_JOB_STACK_SIZE] ;
|
||||
#endif
|
||||
|
||||
#define COMMAND_STACK_SIZE 12000
|
||||
#if defined(HAVE_KEIL_RTX)
|
||||
static char command_stack[COMMAND_STACK_SIZE] ;
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef HAVE_KEIL_RTX
|
||||
static CyaSSL_Mutex command_mutex ;
|
||||
#endif
|
||||
|
||||
/*********** Invoke Forground Command *********************/
|
||||
static void command_invoke(void *args)
|
||||
{
|
||||
void (*func)(void * ) ;
|
||||
int i,iteration ;
|
||||
|
||||
func = (void(*)(void *))((func_args *)args)->argv[0] ;
|
||||
#ifdef HAVE_KEIL_RTX
|
||||
LockMutex((CyaSSL_Mutex *)&command_mutex) ;
|
||||
#endif
|
||||
iteration = for_iteration ;
|
||||
for(i=0; i< iteration; i++) {
|
||||
if(iteration > 1) printf("--- Start for %d ---->\n", i) ;
|
||||
#if defined(HAVE_KEIL_RTX)
|
||||
stack_fill(command_stack, COMMAND_STACK_SIZE) ;
|
||||
#endif
|
||||
|
||||
func(args) ; /* invoke command */
|
||||
|
||||
#if defined(HAVE_KEIL_RTX)
|
||||
stack_check(command_stack, COMMAND_STACK_SIZE) ;
|
||||
#endif
|
||||
}
|
||||
if(iteration > 1)
|
||||
for_iteration = 1 ;
|
||||
#ifdef HAVE_KEIL_RTX
|
||||
UnLockMutex((CyaSSL_Mutex *)&command_mutex) ;
|
||||
os_tsk_delete_self() ;
|
||||
#endif
|
||||
}
|
||||
|
||||
#if (!defined(NO_SIMPLE_SERVER) && !defined(NO_ECHOSERVER)) && \
|
||||
defined(HAVE_KEIL_RTX)
|
||||
/******* Invoke Background Job *******************************/
|
||||
static void bg_job_invoke(void *args)
|
||||
{
|
||||
void (*func)(void * ) ;
|
||||
BackGround = 1 ;
|
||||
stack_fill(bg_job_stack, BG_JOB_STACK_SIZE) ;
|
||||
func = (void(*)(void *))((func_args *)args)->argv[0] ;
|
||||
func(args) ; /* invoke command */
|
||||
stack_check(bg_job_stack, BG_JOB_STACK_SIZE) ;
|
||||
#ifdef CYASSL_KEIL_NET
|
||||
init_TcpNet ();
|
||||
#endif
|
||||
BackGround = 0 ;
|
||||
os_tsk_delete_self() ; ;
|
||||
}
|
||||
#endif
|
||||
|
||||
#define LINESIZE 100
|
||||
static char line[LINESIZE] ;
|
||||
|
||||
|
||||
/********* SHEULL MAIN LOOP ***********************************/
|
||||
void shell_main(void) {
|
||||
int i ;
|
||||
func_args args ;
|
||||
int bf_flg ;
|
||||
|
||||
i = BackGround ;
|
||||
/* Dummy for avoiding warning: BackGround is defined but not used. */
|
||||
|
||||
|
||||
#if defined(HAVE_KEIL_RTX)
|
||||
InitMutex(&command_mutex) ;
|
||||
#endif
|
||||
time_main(NULL) ;
|
||||
printf("Starting Shell\n") ;
|
||||
while(1) {
|
||||
if(getline(line, LINESIZE, &args, &bf_flg) > 0) {
|
||||
for(i=0; commandTable[i].func != NULL; i++) {
|
||||
if(strcmp(commandTable[i].command, args.argv[0]) == 0) {
|
||||
args.argv[0] = (char *) commandTable[i].func ;
|
||||
if(bf_flg == FORGROUND) {
|
||||
#ifdef HAVE_KEIL_RTX
|
||||
UnLockMutex((CyaSSL_Mutex *)&command_mutex) ;
|
||||
os_tsk_create_user_ex( (void(*)(void *))&command_invoke, 7,
|
||||
command_stack, COMMAND_STACK_SIZE, &args) ;
|
||||
#else
|
||||
command_invoke(&args) ;
|
||||
#endif
|
||||
#ifdef HAVE_KEIL_RTX
|
||||
LockMutex((CyaSSL_Mutex *)&command_mutex) ;
|
||||
#endif
|
||||
} else {
|
||||
#if (!defined(NO_SIMPLE_SERVER) && \
|
||||
!defined(NO_ECHOSERVER)) && \
|
||||
defined(HAVE_KEIL_RTX)
|
||||
if(BackGround != 0) {
|
||||
printf("Multiple background servers not supported.\n") ;
|
||||
} else {
|
||||
printf("\"%s\" is running with the background mode.\n",
|
||||
commandTable[i].command) ;
|
||||
os_tsk_create_user_ex( (void(*)(void *))&bg_job_invoke,
|
||||
6, bg_job_stack, BG_JOB_STACK_SIZE, &args) ;
|
||||
}
|
||||
#else
|
||||
printf("Invalid Command: no background job\n") ;
|
||||
#endif
|
||||
}
|
||||
break ;
|
||||
}
|
||||
}
|
||||
if(commandTable[i].func == NULL)
|
||||
printf("Command not found\n") ;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
53
IDE/MDK-ARM/MDK-ARM/CyaSSL/ssl-dummy.c
Normal file
53
IDE/MDK-ARM/MDK-ARM/CyaSSL/ssl-dummy.c
Normal file
@ -0,0 +1,53 @@
|
||||
/* ssl-dummy.c
|
||||
*
|
||||
* Copyright (C) 2006-2013 wolfSSL Inc.
|
||||
*
|
||||
* 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/ssl.h>
|
||||
#include <cyassl/internal.h>
|
||||
#include <cyassl/error.h>
|
||||
#include <cyassl/ctaocrypt/coding.h>
|
||||
|
||||
Signer* GetCA(void* vp, byte* hash)
|
||||
{
|
||||
Signer*s ;
|
||||
return s ;
|
||||
}
|
||||
|
||||
int CyaSSL_dtls(CYASSL* ssl)
|
||||
{
|
||||
return ssl->options.dtls;
|
||||
}
|
||||
|
||||
int CyaSSL_get_using_nonblock(CYASSL* ssl)
|
||||
{
|
||||
CYASSL_ENTER("CyaSSL_get_using_nonblock");
|
||||
CYASSL_LEAVE("CyaSSL_get_using_nonblock", ssl->options.usingNonblock);
|
||||
return ssl->options.usingNonblock;
|
||||
}
|
||||
|
||||
Signer* GetCAByName(void* vp, byte* hash)
|
||||
{
|
||||
Signer * ca ;
|
||||
return(ca) ;
|
||||
}
|
22
IDE/MDK-ARM/MDK-ARM/config/Dbg_Flash.ini
Normal file
22
IDE/MDK-ARM/MDK-ARM/config/Dbg_Flash.ini
Normal file
@ -0,0 +1,22 @@
|
||||
/******************************************************************************/
|
||||
/* Dbg_Flash.ini Initialization File for Debugging from Internal */
|
||||
/* Flash for NXP LPC18xx/LPC43xx */
|
||||
/******************************************************************************/
|
||||
/* This file is part of the uVision/ARM development tools. */
|
||||
/* Copyright (c) 2005-2012 Keil Software. All rights reserved. */
|
||||
/* This software may only be used under the terms of a valid, current, */
|
||||
/* end user licence from KEIL for a compatible version of KEIL software */
|
||||
/* development tools. Nothing else gives you the right to use this software. */
|
||||
/******************************************************************************/
|
||||
|
||||
FUNC void Per_Reset (void) {
|
||||
// Reset peripherals: LCD, USB0, USB1, DMA, SDIO, ETHERNET
|
||||
_WDWORD(0x40053100, 0x005F0000); // Issue reset
|
||||
_sleep_(1);
|
||||
}
|
||||
|
||||
Per_Reset(); // Reset some peripherals
|
||||
|
||||
KILL BUTTON * // Kill all buttons
|
||||
DEFINE BUTTON "Reset Peripherals", "Per_Reset()" // Create peripheral reset button
|
||||
|
401
IDE/MDK-ARM/MDK-ARM/config/File_Config.c
Normal file
401
IDE/MDK-ARM/MDK-ARM/config/File_Config.c
Normal file
@ -0,0 +1,401 @@
|
||||
/*----------------------------------------------------------------------------
|
||||
* RL-ARM - FlashFS
|
||||
*----------------------------------------------------------------------------
|
||||
* Name: FILE_CONFIG.C
|
||||
* Purpose: Configuration of RL FlashFS by user
|
||||
* Rev.: V4.70
|
||||
*----------------------------------------------------------------------------
|
||||
* This code is part of the RealView Run-Time Library.
|
||||
* Copyright (c) 2004-2013 KEIL - An ARM Company. All rights reserved.
|
||||
*---------------------------------------------------------------------------*/
|
||||
|
||||
#include <File_Config.h>
|
||||
|
||||
//-------- <<< Use Configuration Wizard in Context Menu >>> -----------------
|
||||
//
|
||||
// <h>File System
|
||||
// ==============
|
||||
// <i> Define File System global parameters
|
||||
|
||||
// <o>Number of open files <4-16>
|
||||
// <i>Define number of files that can be
|
||||
// <i>opened at the same time.
|
||||
// <i>Default: 8
|
||||
#define N_FILES 6
|
||||
|
||||
// <o>FAT Name Cache Size <0-1000000>
|
||||
// <i>Define number of cached FAT file or directory names.
|
||||
// <i>48 bytes of RAM is required for each cached name.
|
||||
#define FAT_NAME_CACNT 0
|
||||
|
||||
// <e>Relocate FAT Name Cache Buffer
|
||||
// <i>Locate Cache Buffer at a specific address.
|
||||
#define FAT_NAME_RELOC 0
|
||||
|
||||
// <o>Base address <0x0000-0xFFFFFE00:0x200>
|
||||
// <i>Define the Cache buffer base address.
|
||||
#define FAT_NAME_CADR 0x60000000
|
||||
|
||||
// </e>
|
||||
// <o>CPU Clock Frequency [Hz]<0-1000000000>
|
||||
// <i>Define the CPU Clock frequency used for
|
||||
// <i>flash programming and erasing.
|
||||
#define CPU_CLK 180000000
|
||||
|
||||
// </h>
|
||||
// <e>Flash Drive
|
||||
// ==============
|
||||
// <i>Enable Embedded Flash Drive [F:]
|
||||
#define FL0_EN 0
|
||||
|
||||
// <o>Base address <0x0-0xFFFFF000:0x1000>
|
||||
// <i>Define the target device Base address
|
||||
// <i>Default: 0x80000000
|
||||
#define FL0_BADR 0x80000000
|
||||
|
||||
// <o>Device Size <0x4000-0xFFFFF000:0x4000>
|
||||
// <i>Define the size of Flash device in bytes
|
||||
// <i>Default: 0x100000 (1MB)
|
||||
#define FL0_SIZE 0x0200000
|
||||
|
||||
// <o>Content of Erased Memory <0=>0x00 <0xFF=>0xFF
|
||||
// <i>Define the initial value for erased Flash data
|
||||
// <i>Default: 0xFF
|
||||
#define FL0_INITV 0xFF
|
||||
|
||||
// <s.80>Device Description file
|
||||
// <i>Specify a file name with a relative path
|
||||
// <i>Default: FS_FlashDev.h
|
||||
#define FL0_HFILE "FS_FlashDev.h"
|
||||
|
||||
// <q>Default Drive [F:]
|
||||
// <i>Used when Drive letter not specified
|
||||
#define FL0_DEF 1
|
||||
|
||||
// </e>
|
||||
// <e>SPI Flash Drive
|
||||
// ==================
|
||||
// <i>Enable SPI Flash Drive [S:]
|
||||
#define SF0_EN 0
|
||||
|
||||
// <o>Device Size <0x10000-0xFFFFF000:0x8000>
|
||||
// <i>Define the size of SPI Flash device in bytes
|
||||
// <i>Default: 0x100000 (1MB)
|
||||
#define SF0_SIZE 0x0200000
|
||||
|
||||
// <o>Content of Erased Memory <0=>0x00 <0xFF=>0xFF
|
||||
// <i>Define the initial value for erased Flash data
|
||||
// <i>Default: 0xFF
|
||||
#define SF0_INITV 0xFF
|
||||
|
||||
// <s.80>Device Description file
|
||||
// <i>Specify a file name with a relative path
|
||||
// <i>Default: FS_SPI_FlashDev.h
|
||||
#define SF0_HFILE "FS_SPI_FlashDev.h"
|
||||
|
||||
// <q>Default Drive [S:]
|
||||
// <i>Used when Drive letter not specified
|
||||
#define SF0_DEF 0
|
||||
|
||||
// </e>
|
||||
// <e>RAM Drive
|
||||
// ============
|
||||
// <i>Enable Embedded RAM Drive [R:]
|
||||
#define RAM0_EN 0
|
||||
|
||||
// <o>Device Size <0x4000-0xFFFFF000:0x4000>
|
||||
// <i>Define the size of RAM device in bytes
|
||||
// <i>Default: 0x40000
|
||||
#define RAM0_SIZE 0x004000
|
||||
|
||||
// <o>Number of Sectors <8=>8 <16=>16 <32=>32 <64=>64 <128=>128
|
||||
// <i>Define number of virtual sectors for RAM device
|
||||
// <i>Default: 32
|
||||
#define RAM0_NSECT 64
|
||||
|
||||
// <e>Relocate Device Buffer
|
||||
// <i>Locate RAM Device Buffer at a specific address.
|
||||
// <i>If not enabled, the linker selects base address.
|
||||
#define RAM0_RELOC 1
|
||||
|
||||
// <o>Base address <0x0-0xFFFFF000:0x1000>
|
||||
// <i>Define the target device Base address.
|
||||
// <i>Default: 0x81000000
|
||||
#define RAM0_BADR 0x81010000
|
||||
|
||||
// </e>
|
||||
// <q>Default Drive [R:]
|
||||
// <i>Used when Drive letter not specified
|
||||
#define RAM0_DEF 0
|
||||
|
||||
// </e>
|
||||
// <e>Memory Card Drive 0
|
||||
// ======================
|
||||
// <i>Enable Memory Card Drive [M0:]
|
||||
#define MC0_EN 1
|
||||
|
||||
// <o>Bus Mode <0=>SD-Native <1=>SPI
|
||||
// <i>Define Memory Card bus interface mode.
|
||||
// <i>SD-Native mode needs MCI peripheral.
|
||||
// <i>SPI mode uses SD Card in SPI mode.
|
||||
#define MC0_SPI 0
|
||||
|
||||
// <o>File System Cache <0=>OFF <1=>1 KB <2=>2 KB <4=>4 KB
|
||||
// <8=>8 KB <16=>16 KB <32=>32 KB
|
||||
// <i>Define System Cache buffer size for file IO.
|
||||
// <i>Increase this number for faster r/w access.
|
||||
// <i>Default: 4 kB
|
||||
#define MC0_CASZ 4
|
||||
|
||||
// <e>Relocate Cache Buffer
|
||||
// <i>Locate Cache Buffer at a specific address.
|
||||
// <i>Some devices like NXP LPC23xx require a Cache buffer
|
||||
// <i>for DMA transfer located at specific address.
|
||||
#define MC0_RELOC 0
|
||||
|
||||
// <o>Base address <0x0000-0xFFFFFE00:0x200>
|
||||
// <i>Define the Cache buffer base address.
|
||||
// <i>For LPC23xx/24xx devices this is USB RAM
|
||||
// <i>starting at 0x7FD00000.
|
||||
#define MC0_CADR 0x7FD00000
|
||||
|
||||
// </e>
|
||||
// <q>FAT Journal
|
||||
// <i>Enable FAT Journal in order to guarantee
|
||||
// <i>fail-safe FAT file system operation.
|
||||
#define MC0_FSJ 0
|
||||
|
||||
// <q>Default Drive [M0:]
|
||||
// <i>Used when Drive letter not specified
|
||||
#define MC0_DEF 1
|
||||
|
||||
// </e>
|
||||
// <e>Memory Card Drive 1
|
||||
// ======================
|
||||
// <i>Enable Memory Card Drive [M1:]
|
||||
#define MC1_EN 0
|
||||
|
||||
// <o>Bus Mode <0=>SD-Native <1=>SPI
|
||||
// <i>Define Memory Card bus interface mode.
|
||||
// <i>SD-Native mode needs MCI peripheral.
|
||||
// <i>SPI mode uses SD Card in SPI mode.
|
||||
#define MC1_SPI 1
|
||||
|
||||
// <o>File System Cache <0=>OFF <1=>1 KB <2=>2 KB <4=>4 KB
|
||||
// <8=>8 KB <16=>16 KB <32=>32 KB
|
||||
// <i>Define System Cache buffer size for file IO.
|
||||
// <i>Increase this number for faster r/w access.
|
||||
// <i>Default: 4 kB
|
||||
#define MC1_CASZ 0
|
||||
|
||||
// <e>Relocate Cache Buffer
|
||||
// <i>Locate Cache Buffer at a specific address.
|
||||
// <i>Some devices like NXP LPC23xx require a Cache buffer
|
||||
// <i>for DMA transfer located at specific address.
|
||||
#define MC1_RELOC 0
|
||||
|
||||
// <o>Base address <0x0000-0xFFFFFE00:0x200>
|
||||
// <i>Define the Cache buffer base address.
|
||||
// <i>For LPC23xx/24xx devices this is USB RAM
|
||||
// <i>starting at 0x7FD00000.
|
||||
#define MC1_CADR 0x7FD00000
|
||||
|
||||
// </e>
|
||||
// <q>FAT Journal
|
||||
// <i>Enable FAT Journal in order to guarantee
|
||||
// <i>fail-safe FAT file system operation.
|
||||
#define MC1_FSJ 0
|
||||
|
||||
// <q>Default Drive [M1:]
|
||||
// <i>Used when Drive letter not specified
|
||||
#define MC1_DEF 0
|
||||
|
||||
// </e>
|
||||
// <e>USB Flash Drive 0
|
||||
// ====================
|
||||
// <i>Enable USB Flash Drive [U0:]
|
||||
#define USB0_EN 0
|
||||
|
||||
// <o>File System Cache <0=>OFF <1=>1 KB <2=>2 KB <4=>4 KB
|
||||
// <8=>8 KB <16=>16 KB <32=>32 KB
|
||||
// <i>Define System Cache buffer size for file IO.
|
||||
// <i>Increase this number for faster r/w access.
|
||||
// <i>Default: 4 kB
|
||||
#define USB0_CASZ 8
|
||||
|
||||
// <q>FAT Journal
|
||||
// <i>Enable FAT Journal in order to guarantee
|
||||
// <i>fail-safe FAT file system operation.
|
||||
#define USB0_FSJ 0
|
||||
|
||||
// <q>Default Drive [U0:]
|
||||
// <i>Used when Drive letter not specified
|
||||
#define USB0_DEF 0
|
||||
|
||||
// </e>
|
||||
// <e>USB Flash Drive 1
|
||||
// ====================
|
||||
// <i>Enable USB Flash Drive [U1:]
|
||||
#define USB1_EN 0
|
||||
|
||||
// <o>File System Cache <0=>OFF <1=>1 KB <2=>2 KB <4=>4 KB
|
||||
// <8=>8 KB <16=>16 KB <32=>32 KB
|
||||
// <i>Define System Cache buffer size for file IO.
|
||||
// <i>Increase this number for faster r/w access.
|
||||
// <i>Default: 4 kB
|
||||
#define USB1_CASZ 8
|
||||
|
||||
// <q>FAT Journal
|
||||
// <i>Enable FAT Journal in order to guarantee
|
||||
// <i>fail-safe FAT file system operation.
|
||||
#define USB1_FSJ 0
|
||||
|
||||
// <q>Default Drive [U1:]
|
||||
// <i>Used when Drive letter not specified
|
||||
#define USB1_DEF 0
|
||||
|
||||
// </e>
|
||||
// <e>NAND Flash Drive 0
|
||||
// ===================
|
||||
// <i>Enable NAND Flash Drive [N0:]
|
||||
#define NAND0_EN 0
|
||||
|
||||
// <o>Page size <528=> 512 + 16 bytes
|
||||
// <2112=>2048 + 64 bytes
|
||||
// <4224=>4096 + 128 bytes
|
||||
// <8448=>8192 + 256 bytes
|
||||
// <i>Define program Page size in bytes (User + Spare area).
|
||||
#define NAND0_PGSZ 2112
|
||||
|
||||
// <o>Block Size <8=>8 pages <16=>16 pages <32=>32 pages
|
||||
// <64=>64 pages <128=>128 pages <256=>256 pages
|
||||
// <i>Define number of pages in a block.
|
||||
#define NAND0_PGCNT 64
|
||||
|
||||
// <o>Device Size [blocks] <512-32768>
|
||||
// <i>Define number of blocks in NAND Flash device.
|
||||
#define NAND0_BLCNT 4096
|
||||
|
||||
// <o>Page Caching <0=>OFF <1=>1 page <2=>2 pages <4=>4 pages
|
||||
// <8=>8 pages <16=>16 pages <32=>32 pages
|
||||
// <i>Define number of cached Pages.
|
||||
// <i>Default: 4 pages
|
||||
#define NAND0_CAPG 2
|
||||
|
||||
// <o>Block Indexing <0=>OFF <1=>1 block <2=>2 blocks <4=>4 blocks
|
||||
// <8=>8 blocks <16=>16 blocks <32=>32 blocks
|
||||
// <64=>64 blocks <128=>128 blocks <256=>256 blocks
|
||||
// <i>Define number of indexed Flash Blocks.
|
||||
// <i>Increase this number for better performance.
|
||||
// <i>Default: 16 blocks
|
||||
#define NAND0_CABL 16
|
||||
|
||||
// <o>Software ECC <0=>None <1=>Hamming (SLC)
|
||||
// <i>Enable software ECC calculation only,
|
||||
// <i>if not supported by hardware.
|
||||
#define NAND0_SWECC 1
|
||||
|
||||
// <o>File System Cache <0=>OFF <1=>1 KB <2=>2 KB <4=>4 KB
|
||||
// <8=>8 KB <16=>16 KB <32=>32 KB
|
||||
// <i>Define System Cache buffer size for file IO.
|
||||
// <i>Increase this number for faster r/w access.
|
||||
// <i>Default: 4 kB
|
||||
#define NAND0_CASZ 4
|
||||
|
||||
// <e>Relocate Cache Buffers
|
||||
// <i>Use this option to locate Cache buffers
|
||||
// <i>at specific address in RAM or SDRAM.
|
||||
#define NAND0_RELOC 0
|
||||
|
||||
// <o>Base address <0x0000-0xFFFFFE00:0x200>
|
||||
// <i>Define base address for Cache Buffers.
|
||||
#define NAND0_CADR 0x80000000
|
||||
|
||||
// </e>
|
||||
// <q>FAT Journal
|
||||
// <i>Enable FAT Journal in order to guarantee
|
||||
// <i>fail-safe FAT file system operation.
|
||||
#define NAND0_FSJ 0
|
||||
|
||||
// <q>Default Drive [N0:]
|
||||
// <i>Used when Drive letter not specified
|
||||
#define NAND0_DEF 0
|
||||
|
||||
// </e>
|
||||
// <e>NAND Flash Drive 1
|
||||
// ===================
|
||||
// <i>Enable NAND Flash Drive [N1:]
|
||||
#define NAND1_EN 0
|
||||
|
||||
// <o>Page size <528=> 512 + 16 bytes
|
||||
// <2112=>2048 + 64 bytes
|
||||
// <4224=>4096 + 128 bytes
|
||||
// <8448=>8192 + 256 bytes
|
||||
// <i>Define program Page size in bytes (User + Spare area).
|
||||
#define NAND1_PGSZ 2112
|
||||
|
||||
// <o>Block Size <8=>8 pages <16=>16 pages <32=>32 pages
|
||||
// <64=>64 pages <128=>128 pages <256=>256 pages
|
||||
// <i>Define number of pages in a block.
|
||||
#define NAND1_PGCNT 32
|
||||
|
||||
// <o>Device Size [blocks] <512-32768>
|
||||
// <i>Define number of blocks in NAND Flash device.
|
||||
#define NAND1_BLCNT 512
|
||||
|
||||
// <o>Page Caching <0=>OFF <1=>1 page <2=>2 pages <4=>4 pages
|
||||
// <8=>8 pages <16=>16 pages <32=>32 pages
|
||||
// <i>Define number of cached Pages.
|
||||
// <i>Default: 4 pages
|
||||
#define NAND1_CAPG 4
|
||||
|
||||
// <o>Block Indexing <0=>OFF <1=>1 block <2=>2 blocks <4=>4 blocks
|
||||
// <8=>8 blocks <16=>16 blocks <32=>32 blocks
|
||||
// <64=>64 blocks <128=>128 blocks <256=>256 blocks
|
||||
// <i>Define number of indexed Flash Blocks.
|
||||
// <i>Increase this number for better performance.
|
||||
// <i>Default: 16 blocks
|
||||
#define NAND1_CABL 16
|
||||
|
||||
// <o>Software ECC <0=>None <1=>Hamming (SLC)
|
||||
// <i>Enable software ECC calculation only,
|
||||
// <i>if not supported by hardware.
|
||||
#define NAND1_SWECC 0
|
||||
|
||||
// <o>File System Cache <0=>OFF <1=>1 KB <2=>2 KB <4=>4 KB
|
||||
// <8=>8 KB <16=>16 KB <32=>32 KB
|
||||
// <i>Define System Cache buffer size for file IO.
|
||||
// <i>Increase this number for faster r/w access.
|
||||
// <i>Default: 4 kB
|
||||
#define NAND1_CASZ 4
|
||||
|
||||
// <e>Relocate Cache Buffers
|
||||
// <i>Use this option to locate Cache buffers
|
||||
// <i>at specific address in RAM or SDRAM.
|
||||
#define NAND1_RELOC 0
|
||||
|
||||
// <o>Base address <0x0000-0xFFFFFE00:0x200>
|
||||
// <i>Define base address for Cache Buffers.
|
||||
#define NAND1_CADR 0x80000000
|
||||
|
||||
// </e>
|
||||
// <q>FAT Journal
|
||||
// <i>Enable FAT Journal in order to guarantee
|
||||
// <i>fail-safe FAT file system operation.
|
||||
#define NAND1_FSJ 0
|
||||
|
||||
// <q>Default Drive [N1:]
|
||||
// <i>Used when Drive letter not specified
|
||||
#define NAND1_DEF 0
|
||||
|
||||
// </e>
|
||||
|
||||
//------------- <<< end of configuration section >>> -----------------------
|
||||
|
||||
#ifndef __NO_FILE_LIB_C
|
||||
#include <File_lib.c>
|
||||
#endif
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
* end of file
|
||||
*---------------------------------------------------------------------------*/
|
892
IDE/MDK-ARM/MDK-ARM/config/Net_Config.c
Normal file
892
IDE/MDK-ARM/MDK-ARM/config/Net_Config.c
Normal file
@ -0,0 +1,892 @@
|
||||
/*----------------------------------------------------------------------------
|
||||
* RL-ARM - TCPnet
|
||||
*----------------------------------------------------------------------------
|
||||
* Name: NET_CONFIG.C
|
||||
* Purpose: Configuration of RL TCPnet by user.
|
||||
* Rev.: V4.60
|
||||
*----------------------------------------------------------------------------
|
||||
* This code is part of the RealView Run-Time Library.
|
||||
* Copyright (c) 2004-2012 KEIL - An ARM Company. All rights reserved.
|
||||
*---------------------------------------------------------------------------*/
|
||||
|
||||
#include <Net_Config.h>
|
||||
|
||||
//-------- <<< Use Configuration Wizard in Context Menu >>> -----------------
|
||||
//
|
||||
// <h>System Definitions
|
||||
// =====================
|
||||
// <i> Global TCPnet System definitions
|
||||
// <s.15>Local Host Name
|
||||
// <i> This is the name under which embedded host can be
|
||||
// <i> accessed on a local area network.
|
||||
// <i> Default: "mcb2300"
|
||||
#define LHOST_NAME "mcb2300"
|
||||
|
||||
// <o>Memory Pool size <1500-64000:4><#/4>
|
||||
// <i> This is the size of a memory pool in bytes. Buffers for
|
||||
// <i> TCPnet packets are allocated from this memory pool.
|
||||
// <i> Default: 8000 bytes
|
||||
#define MEM_SIZE 4000
|
||||
|
||||
// <o>Tick Timer interval <10=> 10 ms <20=> 20 ms <25=> 25 ms
|
||||
// <40=> 40 ms <50=> 50 ms <100=> 100 ms
|
||||
// <200=> 200 ms
|
||||
// <i> System Tick Timer interval for software timers
|
||||
// <i> Default: 100 ms
|
||||
#define TICK_INTERVAL 10
|
||||
|
||||
// </h>
|
||||
// <e>Ethernet Network Interface
|
||||
// =============================
|
||||
// <i> Enable or disable Ethernet Network Interface
|
||||
#define ETH_ENABLE 1
|
||||
|
||||
// <h>MAC Address
|
||||
// ==============
|
||||
// <i> Local Ethernet MAC Address
|
||||
// <i> Value FF:FF:FF:FF:FF:FF is not allowed.
|
||||
// <i> It is an ethernet Broadcast MAC address.
|
||||
// <o>Address byte 1 <0x00-0xff:2>
|
||||
// <i> LSB is an ethernet Multicast bit.
|
||||
// <i> Must be 0 for local MAC address.
|
||||
// <i> Default: 0x00
|
||||
#define _MAC1 0x30
|
||||
|
||||
// <o>Address byte 2 <0x00-0xff>
|
||||
// <i> Default: 0x30
|
||||
#define _MAC2 0x06
|
||||
|
||||
// <o>Address byte 3 <0x00-0xff>
|
||||
// <i> Default: 0x6C
|
||||
#define _MAC3 0x6C
|
||||
|
||||
// <o>Address byte 4 <0x00-0xff>
|
||||
// <i> Default: 0x00
|
||||
#define _MAC4 0x00
|
||||
|
||||
// <o>Address byte 5 <0x00-0xff>
|
||||
// <i> Default: 0x00
|
||||
#define _MAC5 0x00
|
||||
|
||||
// <o>Address byte 6 <0x00-0xff>
|
||||
// <i> Default: 0x01
|
||||
#define _MAC6 0x01
|
||||
|
||||
// </h>
|
||||
// <h>IP Address
|
||||
// =============
|
||||
// <i> Local Static IP Address
|
||||
// <i> Value 255.255.255.255 is not allowed.
|
||||
// <i> It is a Broadcast IP address.
|
||||
// <o>Address byte 1 <0-255>
|
||||
// <i> Default: 192
|
||||
#define _IP1 192
|
||||
|
||||
// <o>Address byte 2 <0-255>
|
||||
// <i> Default: 168
|
||||
#define _IP2 168
|
||||
|
||||
// <o>Address byte 3 <0-255>
|
||||
// <i> Default: 0
|
||||
#define _IP3 0
|
||||
|
||||
// <o>Address byte 4 <0-255>
|
||||
// <i> Default: 100
|
||||
#define _IP4 100
|
||||
|
||||
// </h>
|
||||
// <h>Subnet mask
|
||||
// ==============
|
||||
// <i> Local Subnet mask
|
||||
// <o>Mask byte 1 <0-255>
|
||||
// <i> Default: 255
|
||||
#define _MSK1 255
|
||||
|
||||
// <o>Mask byte 2 <0-255>
|
||||
// <i> Default: 255
|
||||
#define _MSK2 255
|
||||
|
||||
// <o>Mask byte 3 <0-255>
|
||||
// <i> Default: 255
|
||||
#define _MSK3 255
|
||||
|
||||
// <o>Mask byte 4 <0-255>
|
||||
// <i> Default: 0
|
||||
#define _MSK4 0
|
||||
|
||||
// </h>
|
||||
// <h>Default Gateway
|
||||
// ==================
|
||||
// <i> Default Gateway IP Address
|
||||
// <o>Address byte 1 <0-255>
|
||||
// <i> Default: 192
|
||||
#define _GW1 192
|
||||
|
||||
// <o>Address byte 2 <0-255>
|
||||
// <i> Default: 168
|
||||
#define _GW2 168
|
||||
|
||||
// <o>Address byte 3 <0-255>
|
||||
// <i> Default: 0
|
||||
#define _GW3 0
|
||||
|
||||
// <o>Address byte 4 <0-255>
|
||||
// <i> Default: 254
|
||||
#define _GW4 254
|
||||
|
||||
// </h>
|
||||
// <h>Primary DNS Server
|
||||
// =====================
|
||||
// <i> Primary DNS Server IP Address
|
||||
// <o>Address byte 1 <0-255>
|
||||
// <i> Default: 194
|
||||
#define _pDNS1 194
|
||||
|
||||
// <o>Address byte 2 <0-255>
|
||||
// <i> Default: 25
|
||||
#define _pDNS2 25
|
||||
|
||||
// <o>Address byte 3 <0-255>
|
||||
// <i> Default: 2
|
||||
#define _pDNS3 2
|
||||
|
||||
// <o>Address byte 4 <0-255>
|
||||
// <i> Default: 129
|
||||
#define _pDNS4 129
|
||||
|
||||
// </h>
|
||||
// <h>Secondary DNS Server
|
||||
// =======================
|
||||
// <i> Secondary DNS Server IP Address
|
||||
// <o>Address byte 1 <0-255>
|
||||
// <i> Default: 194
|
||||
#define _sDNS1 194
|
||||
|
||||
// <o>Address byte 2 <0-255>
|
||||
// <i> Default: 25
|
||||
#define _sDNS2 25
|
||||
|
||||
// <o>Address byte 3 <0-255>
|
||||
// <i> Default: 2
|
||||
#define _sDNS3 2
|
||||
|
||||
// <o>Address byte 4 <0-255>
|
||||
// <i> Default: 130
|
||||
#define _sDNS4 130
|
||||
|
||||
// </h>
|
||||
// <h>ARP Definitions
|
||||
// ==================
|
||||
// <i> Address Resolution Protocol Definitions
|
||||
// <o>Cache Table size <5-100>
|
||||
// <i> Number of cached hardware/IP addresses
|
||||
// <i> Default: 10
|
||||
#define ARP_TABSIZE 10
|
||||
|
||||
// <o>Cache Timeout in seconds <5-255>
|
||||
// <i> A timeout for a cached hardware/IP addresses
|
||||
// <i> Default: 150
|
||||
#define ARP_TIMEOUT 150
|
||||
|
||||
// <o>Number of Retries <0-20>
|
||||
// <i> Number of Retries to resolve an IP address
|
||||
// <i> before ARP module gives up
|
||||
// <i> Default: 4
|
||||
#define ARP_MAXRETRY 4
|
||||
|
||||
// <o>Resend Timeout in seconds <1-10>
|
||||
// <i> A timeout to resend the ARP Request
|
||||
// <i> Default: 2
|
||||
#define ARP_RESEND 10
|
||||
|
||||
// <q>Send Notification on Address changes
|
||||
// <i> When this option is enabled, the embedded host
|
||||
// <i> will send a Gratuitous ARP notification at startup,
|
||||
// <i> or when the device IP address has changed.
|
||||
// <i> Default: Disabled
|
||||
#define ARP_NOTIFY 1
|
||||
|
||||
// </h>
|
||||
// <e>IGMP Group Management
|
||||
// ========================
|
||||
// <i> Enable or disable Internet Group Management Protocol
|
||||
#define IGMP_ENABLE 0
|
||||
|
||||
// <o>Membership Table size <2-50>
|
||||
// <i> Number of Groups this host can join
|
||||
// <i> Default: 5
|
||||
#define IGMP_TABSIZE 5
|
||||
|
||||
// </e>
|
||||
// <q>NetBIOS Name Service
|
||||
// =======================
|
||||
// <i> When this option is enabled, the embedded host can be
|
||||
// <i> accessed by his name on the local LAN using NBNS protocol.
|
||||
// <i> You need to modify also the number of UDP Sockets,
|
||||
// <i> because NBNS protocol uses one UDP socket to run.
|
||||
#define NBNS_ENABLE 0
|
||||
|
||||
// <e>Dynamic Host Configuration
|
||||
// =============================
|
||||
// <i> When this option is enabled, local IP address, Net Mask
|
||||
// <i> and Default Gateway are obtained automatically from
|
||||
// <i> the DHCP Server on local LAN.
|
||||
// <i> You need to modify also the number of UDP Sockets,
|
||||
// <i> because DHCP protocol uses one UDP socket to run.
|
||||
#define DHCP_ENABLE 1
|
||||
|
||||
// <s.40>Vendor Class Identifier
|
||||
// <i> This value is optional. If specified, it is added
|
||||
// <i> to DHCP request message, identifying vendor type.
|
||||
// <i> Default: ""
|
||||
#define DHCP_VCID ""
|
||||
|
||||
// <q>Bootfile Name
|
||||
// <i> This value is optional. If enabled, the Bootfile Name
|
||||
// <i> (option 67) is also requested from DHCP server.
|
||||
// <i> Default: disabled
|
||||
#define DHCP_BOOTF 1
|
||||
|
||||
// </e>
|
||||
// </e>
|
||||
|
||||
// <e>PPP Network Interface
|
||||
// ========================
|
||||
// <i> Enable or disable PPP Network Interface
|
||||
#define PPP_ENABLE 0
|
||||
|
||||
// <h>IP Address
|
||||
// =============
|
||||
// <i> Local Static IP Address
|
||||
// <o>Address byte 1 <0-255>
|
||||
// <i> Default: 192
|
||||
#define _IP1P 192
|
||||
|
||||
// <o>Address byte 2 <0-255>
|
||||
// <i> Default: 168
|
||||
#define _IP2P 168
|
||||
|
||||
// <o>Address byte 3 <0-255>
|
||||
// <i> Default: 125
|
||||
#define _IP3P 125
|
||||
|
||||
// <o>Address byte 4 <0-255>
|
||||
// <i> Default: 1
|
||||
#define _IP4P 1
|
||||
|
||||
// </h>
|
||||
// <h>Subnet mask
|
||||
// ==============
|
||||
// <i> Local Subnet mask
|
||||
// <o>Mask byte 1 <0-255>
|
||||
// <i> Default: 255
|
||||
#define _MSK1P 255
|
||||
|
||||
// <o>Mask byte 2 <0-255>
|
||||
// <i> Default: 255
|
||||
#define _MSK2P 255
|
||||
|
||||
// <o>Mask byte 3 <0-255>
|
||||
// <i> Default: 255
|
||||
#define _MSK3P 255
|
||||
|
||||
// <o>Mask byte 4 <0-255>
|
||||
// <i> Default: 0
|
||||
#define _MSK4P 0
|
||||
|
||||
// </h>
|
||||
// <h>Primary DNS Server
|
||||
// =====================
|
||||
// <i> Primary DNS Server IP Address
|
||||
// <o>Address byte 1 <0-255>
|
||||
// <i> Default: 194
|
||||
#define _pDNS1P 194
|
||||
|
||||
// <o>Address byte 2 <0-255>
|
||||
// <i> Default: 25
|
||||
#define _pDNS2P 25
|
||||
|
||||
// <o>Address byte 3 <0-255>
|
||||
// <i> Default: 2
|
||||
#define _pDNS3P 2
|
||||
|
||||
// <o>Address byte 4 <0-255>
|
||||
// <i> Default: 129
|
||||
#define _pDNS4P 129
|
||||
|
||||
// </h>
|
||||
// <h>Secondary DNS Server
|
||||
// =======================
|
||||
// <i> Secondary DNS Server IP Address
|
||||
// <o>Address byte 1 <0-255>
|
||||
// <i> Default: 194
|
||||
#define _sDNS1P 194
|
||||
|
||||
// <o>Address byte 2 <0-255>
|
||||
// <i> Default: 25
|
||||
#define _sDNS2P 25
|
||||
|
||||
// <o>Address byte 3 <0-255>
|
||||
// <i> Default: 2
|
||||
#define _sDNS3P 2
|
||||
|
||||
// <o>Address byte 4 <0-255>
|
||||
// <i> Default: 130
|
||||
#define _sDNS4P 130
|
||||
|
||||
// </h>
|
||||
// <e>Logon Authentication
|
||||
// =======================
|
||||
// <i> Enable or disable user authentication
|
||||
#define PPP_AUTHEN 1
|
||||
|
||||
// <q>Unsecured password (PAP)
|
||||
// <i>Allow or use Password Authentication Protocol.
|
||||
#define PPP_PAPEN 1
|
||||
|
||||
// <q>Secured password (CHAP-MD5)
|
||||
// <i>Request or use Challenge Handshake Authentication
|
||||
// <i>Protocol with MD5 digest algorithm.
|
||||
#define PPP_CHAPEN 1
|
||||
|
||||
// </e>
|
||||
// <q>Obtain Client IP address automatically
|
||||
// =========================================
|
||||
// <i> This option only applies when PPP Dial-up is used to dial
|
||||
// <i> to remote PPP Server. If checked, network connection
|
||||
// <i> dynamically obtains an IP address from remote PPP Server.
|
||||
#define PPP_GETIP 1
|
||||
|
||||
// <q>Use Default Gateway on remote Network
|
||||
// ========================================
|
||||
// <i> This option only applies when both Ethernet and PPP Dial-up
|
||||
// <i> are used. If checked, data that cannot be sent to local LAN
|
||||
// <i> is forwarded to Dial-up network instead.
|
||||
#define PPP_DEFGW 1
|
||||
|
||||
// <o>Async Control Character Map <0x0-0xffffffff>
|
||||
// <i> A bit-map of control characters 0-31, which are
|
||||
// <i> transmitted escaped as a 2 byte sequence.
|
||||
// <i> For XON/XOFF set this value to: 0x000A 0000
|
||||
// <i> Default: 0x00000000
|
||||
#define PPP_ACCM 0x00000000
|
||||
|
||||
// <o>LCP Echo Interval in seconds <0-3600>
|
||||
// <i> If no frames are received within this interval, PPP sends an
|
||||
// <i> Echo Request and expects an Echo Response from the peer.
|
||||
// <i> If the response is not received, the link is terminated.
|
||||
// <i> A value of 0 disables the LCP Echo test.
|
||||
// <i> Default: 30
|
||||
#define PPP_ECHOTOUT 30
|
||||
|
||||
// <o>Number of Retries <0-20>
|
||||
// <i> How many times PPP will try to retransmit data
|
||||
// <i> before giving up. Increase this value for links
|
||||
// <i> with low baud rates or high latency.
|
||||
// <i> Default: 3
|
||||
#define PPP_MAXRETRY 3
|
||||
|
||||
// <o>Retry Timeout in seconds <1-10>
|
||||
// <i> If no response received within this time frame,
|
||||
// <i> PPP module will try to resend the data again.
|
||||
// <i> Default: 2
|
||||
#define PPP_RETRYTOUT 2
|
||||
|
||||
// </e>
|
||||
// <e>SLIP Network Interface
|
||||
// ========================
|
||||
// <i> Enable or disable SLIP Network Interface
|
||||
#define SLIP_ENABLE 0
|
||||
|
||||
// <h>IP Address
|
||||
// =============
|
||||
// <i> Local Static IP Address
|
||||
// <o>Address byte 1 <0-255>
|
||||
// <i> Default: 192
|
||||
#define _IP1S 192
|
||||
|
||||
// <o>Address byte 2 <0-255>
|
||||
// <i> Default: 168
|
||||
#define _IP2S 168
|
||||
|
||||
// <o>Address byte 3 <0-255>
|
||||
// <i> Default: 225
|
||||
#define _IP3S 225
|
||||
|
||||
// <o>Address byte 4 <0-255>
|
||||
// <i> Default: 1
|
||||
#define _IP4S 1
|
||||
|
||||
// </h>
|
||||
// <h>Subnet mask
|
||||
// ==============
|
||||
// <i> Local Subnet mask
|
||||
// <o>Mask byte 1 <0-255>
|
||||
// <i> Default: 255
|
||||
#define _MSK1S 255
|
||||
|
||||
// <o>Mask byte 2 <0-255>
|
||||
// <i> Default: 255
|
||||
#define _MSK2S 255
|
||||
|
||||
// <o>Mask byte 3 <0-255>
|
||||
// <i> Default: 255
|
||||
#define _MSK3S 255
|
||||
|
||||
// <o>Mask byte 4 <0-255>
|
||||
// <i> Default: 0
|
||||
#define _MSK4S 0
|
||||
|
||||
// </h>
|
||||
// <h>Primary DNS Server
|
||||
// =====================
|
||||
// <i> Primary DNS Server IP Address
|
||||
// <o>Address byte 1 <0-255>
|
||||
// <i> Default: 194
|
||||
#define _pDNS1S 194
|
||||
|
||||
// <o>Address byte 2 <0-255>
|
||||
// <i> Default: 25
|
||||
#define _pDNS2S 25
|
||||
|
||||
// <o>Address byte 3 <0-255>
|
||||
// <i> Default: 2
|
||||
#define _pDNS3S 2
|
||||
|
||||
// <o>Address byte 4 <0-255>
|
||||
// <i> Default: 129
|
||||
#define _pDNS4S 129
|
||||
|
||||
// </h>
|
||||
// <h>Secondary DNS Server
|
||||
// =======================
|
||||
// <i> Secondary DNS Server IP Address
|
||||
// <o>Address byte 1 <0-255>
|
||||
// <i> Default: 194
|
||||
#define _sDNS1S 194
|
||||
|
||||
// <o>Address byte 2 <0-255>
|
||||
// <i> Default: 25
|
||||
#define _sDNS2S 25
|
||||
|
||||
// <o>Address byte 3 <0-255>
|
||||
// <i> Default: 2
|
||||
#define _sDNS3S 2
|
||||
|
||||
// <o>Address byte 4 <0-255>
|
||||
// <i> Default: 130
|
||||
#define _sDNS4S 130
|
||||
|
||||
// </h>
|
||||
// <q>Use Default Gateway on remote Network
|
||||
// ========================================
|
||||
// <i> This option only applies when both Ethernet and SLIP Dial-up
|
||||
// <i> are used. If checked, data that cannot be sent to local LAN
|
||||
// <i> is forwarded to Dial-up network instead.
|
||||
#define SLIP_DEFGW 1
|
||||
|
||||
// </e>
|
||||
// <e>UDP Sockets
|
||||
// ==============
|
||||
// <i> Enable or disable UDP Sockets
|
||||
#define UDP_ENABLE 1
|
||||
|
||||
// <o>Number of UDP Sockets <1-20>
|
||||
// <i> Number of available UDP sockets
|
||||
// <i> Default: 5
|
||||
#define UDP_NUMSOCKS 20
|
||||
|
||||
// </e>
|
||||
// <e>TCP Sockets
|
||||
// ==============
|
||||
// <i> Enable or disable TCP Sockets
|
||||
#define TCP_ENABLE 1
|
||||
|
||||
// <o>Number of TCP Sockets <1-20>
|
||||
// <i> Number of available TCP sockets
|
||||
// <i> Default: 5
|
||||
#define TCP_NUMSOCKS 10
|
||||
|
||||
// <o>Number of Retries <0-20>
|
||||
// <i> How many times TCP module will try to retransmit data
|
||||
// <i> before giving up. Increase this value for high-latency
|
||||
// <i> and low_throughput networks.
|
||||
// <i> Default: 5
|
||||
#define TCP_MAXRETRY 20
|
||||
|
||||
// <o>Retry Timeout in seconds <1-10>
|
||||
// <i> If data frame not acknowledged within this time frame,
|
||||
// <i> TCP module will try to resend the data again.
|
||||
// <i> Default: 4
|
||||
#define TCP_RETRYTOUT 4
|
||||
|
||||
// <o>Default Connect Timeout in seconds <1-600>
|
||||
// <i> Default TCP Socket Keep Alive timeout. When it expires
|
||||
// <i> with no TCP data frame send, TCP Connection is closed.
|
||||
// <i> Default: 120
|
||||
#define TCP_DEFTOUT 120
|
||||
|
||||
// <o>Maximum Segment Size <536-1460>
|
||||
// <i> The Maximum Segment Size specifies the maximum
|
||||
// <i> number of bytes in the TCP segment's Data field.
|
||||
// <i> Default: 1460
|
||||
#define TCP_MAXSEGSZ 1460
|
||||
|
||||
/* TCP fixed timeouts */
|
||||
#define TCP_INIT_RETRY_TOUT 1 /* TCP initial Retransmit period in sec. */
|
||||
#define TCP_SYN_RETRY_TOUT 2 /* TCP SYN frame retransmit period in sec. */
|
||||
#define TCP_CONRETRY 7 /* Number of retries to establish a conn. */
|
||||
|
||||
// </e>
|
||||
// <e>HTTP Server
|
||||
// ==============
|
||||
// <i> Enable or disable HTTP Server
|
||||
#define HTTP_ENABLE 0
|
||||
|
||||
// <o>Number of HTTP Sessions <1-10>
|
||||
// <i> Number of simultaneously active HTTP Sessions.
|
||||
// <i> Default: 3
|
||||
#define HTTP_NUMSESS 3
|
||||
|
||||
// <o>Port Number <1-65535>
|
||||
// <i> Listening port number.
|
||||
// <i> Default: 80
|
||||
#define HTTP_PORTNUM 80
|
||||
|
||||
// <s.50>Server-Id header
|
||||
// <i> This value is optional. If specified, it overrides
|
||||
// <i> the default HTTP Server header from the library.
|
||||
// <i> Default: ""
|
||||
#define HTTP_SRVID ""
|
||||
|
||||
// <e>Enable User Authentication
|
||||
// <i> When enabled, the user will have to authenticate
|
||||
// <i> himself by username and password before accessing
|
||||
// <i> any page on this Embedded WEB server.
|
||||
#define HTTP_ENAUTH 1
|
||||
|
||||
// <s.20>Authentication Realm
|
||||
// <i> Default: "Embedded WEB Server"
|
||||
#define HTTP_AUTHREALM "Embedded WEB Server"
|
||||
|
||||
// <s.15>Authentication Username
|
||||
// <i> Default: "admin"
|
||||
#define HTTP_AUTHUSER "admin"
|
||||
|
||||
// <s.15>Authentication Password
|
||||
// <i> Default: ""
|
||||
#define HTTP_AUTHPASSW ""
|
||||
|
||||
// </e>
|
||||
// </e>
|
||||
// <e>Telnet Server
|
||||
// ================
|
||||
// <i> Enable or disable Telnet Server
|
||||
#define TNET_ENABLE 0
|
||||
|
||||
// <o>Number of Telnet Connections <1-10>
|
||||
// <i> Number of simultaneously active Telnet Connections.
|
||||
// <i> Default: 1
|
||||
#define TNET_NUMSESS 1
|
||||
|
||||
// <o>Port Number <1-65535>
|
||||
// <i> Listening port number.
|
||||
// <i> Default: 23
|
||||
#define TNET_PORTNUM 23
|
||||
|
||||
// <o>Idle Connection Timeout in seconds <0-3600>
|
||||
// <i> When timeout expires, the connection is closed.
|
||||
// <i> A value of 0 disables disconnection on timeout.
|
||||
// <i> Default: 120
|
||||
#define TNET_IDLETOUT 120
|
||||
|
||||
// <q>Disable Echo
|
||||
// <i> When disabled, the server will not echo
|
||||
// <i> characters it receives.
|
||||
// <i> Default: Not disabled
|
||||
#define TNET_NOECHO 0
|
||||
|
||||
// <e>Enable User Authentication
|
||||
// <i> When enabled, the user will have to authenticate
|
||||
// <i> himself by username and password before access
|
||||
// <i> to the system is allowed.
|
||||
#define TNET_ENAUTH 1
|
||||
|
||||
// <s.15>Authentication Username
|
||||
// <i> Default: "admin"
|
||||
#define TNET_AUTHUSER "admin"
|
||||
|
||||
// <s.15>Authentication Password
|
||||
// <i> Default: ""
|
||||
#define TNET_AUTHPASSW ""
|
||||
|
||||
// </e>
|
||||
// </e>
|
||||
// <e>TFTP Server
|
||||
// ==============
|
||||
// <i> Enable or disable TFTP Server
|
||||
#define TFTP_ENABLE 0
|
||||
|
||||
// <o>Number of TFTP Sessions <1-10>
|
||||
// <i> Number of simultaneously active TFTP Sessions
|
||||
// <i> Default: 1
|
||||
#define TFTP_NUMSESS 1
|
||||
|
||||
// <o>Port Number <1-65535>
|
||||
// <i> Listening port number.
|
||||
// <i> Default: 69
|
||||
#define TFTP_PORTNUM 69
|
||||
|
||||
// <q>Enable Firewall Support
|
||||
// <i> Use the same Port Number to receive
|
||||
// <i> requests and send answers to clients.
|
||||
// <i> Default: Not Enabled
|
||||
#define TFTP_ENFWALL 0
|
||||
|
||||
// <o>Inactive Session Timeout in seconds <5-120>
|
||||
// <i> When timeout expires TFTP Session is closed.
|
||||
// <i> Default: 15
|
||||
#define TFTP_DEFTOUT 15
|
||||
|
||||
// <o>Number of Retries <1-10>
|
||||
// <i> How many times TFTP Server will try to
|
||||
// <i> retransmit the data before giving up.
|
||||
// <i> Default: 4
|
||||
#define TFTP_MAXRETRY 4
|
||||
|
||||
// </e>
|
||||
// <e>TFTP Client
|
||||
// ==============
|
||||
// <i> Enable or disable TFTP Client
|
||||
#define TFTPC_ENABLE 0
|
||||
|
||||
// <o>Block Size <128=>128 <256=>256 <512=>512
|
||||
// <1024=>1024 <1428=>1428
|
||||
// <i> Size of transfer block in bytes.
|
||||
// <i> Default: 512
|
||||
#define TFTPC_BLOCKSZ 512
|
||||
|
||||
// <o>Number of Retries <1-10>
|
||||
// <i> How many times TFTP Client will try to
|
||||
// <i> retransmit the data before giving up.
|
||||
// <i> Default: 4
|
||||
#define TFTPC_MAXRETRY 4
|
||||
|
||||
// <o>Retry Timeout <2=>200 ms <5=>500 ms <10=>1 sec
|
||||
// <20=>2 sec <50=>5 sec <100=>10 sec
|
||||
// <i> If data frame not acknowledged within this time frame,
|
||||
// <i> TFTP Client will try to resend the data again.
|
||||
// <i> Default: 500 ms
|
||||
#define TFTPC_RETRYTO 5
|
||||
|
||||
// </e>
|
||||
// <e>FTP Server
|
||||
// ==============
|
||||
// <i> Enable or disable FTP Server
|
||||
#define FTP_ENABLE 0
|
||||
|
||||
// <o>Number of FTP Sessions <1-10>
|
||||
// <i> Number of simultaneously active FTP Sessions
|
||||
// <i> Default: 1
|
||||
#define FTP_NUMSESS 1
|
||||
|
||||
// <o>Port Number <1-65535>
|
||||
// <i> Listening port number.
|
||||
// <i> Default: 21
|
||||
#define FTP_PORTNUM 21
|
||||
|
||||
// <s.50>Welcome Message
|
||||
// <i> This value is optional. If specified,
|
||||
// <i> it overrides the default welcome message.
|
||||
// <i> Default: ""
|
||||
#define FTP_WELMSG ""
|
||||
|
||||
// <o>Idle Session Timeout in seconds <0-3600>
|
||||
// <i> When timeout expires, the connection is closed.
|
||||
// <i> A value of 0 disables disconnection on timeout.
|
||||
// <i> Default: 120
|
||||
#define FTP_IDLETOUT 120
|
||||
|
||||
// <e>Enable User Authentication
|
||||
// <i> When enabled, the user will have to authenticate
|
||||
// <i> himself by username and password before access
|
||||
// <i> to the system is allowed.
|
||||
#define FTP_ENAUTH 1
|
||||
|
||||
// <s.15>Authentication Username
|
||||
// <i> Default: "admin"
|
||||
#define FTP_AUTHUSER "admin"
|
||||
|
||||
// <s.15>Authentication Password
|
||||
// <i> Default: ""
|
||||
#define FTP_AUTHPASSW ""
|
||||
|
||||
// </e>
|
||||
// </e>
|
||||
// <e>FTP Client
|
||||
// =============
|
||||
// <i> Enable or disable FTP Client
|
||||
#define FTPC_ENABLE 0
|
||||
|
||||
// <o>Response Timeout in seconds <1-120>
|
||||
// <i> This is a time for FTP Client to wait for a response from
|
||||
// <i> the Server. If timeout expires, Client aborts operation.
|
||||
// <i> Default: 10
|
||||
#define FTPC_DEFTOUT 10
|
||||
|
||||
// <q>Passive mode (PASV)
|
||||
// <i> The client initiates a data connection to the server.
|
||||
// <i> Default: Not passive (Active)
|
||||
#define FTPC_PASVMODE 0
|
||||
|
||||
// </e>
|
||||
// <e>DNS Client
|
||||
// =============
|
||||
// <i> Enable or disable DNS Client
|
||||
#define DNS_ENABLE 1
|
||||
|
||||
// <o>Cache Table size <5-100>
|
||||
// <i> Number of cached DNS host names/IP addresses
|
||||
// <i> Default: 20
|
||||
#define DNS_TABSIZE 20
|
||||
|
||||
// </e>
|
||||
// <e>SMTP Client
|
||||
// ==============
|
||||
// <i> Enable or disable SMTP Client
|
||||
#define SMTP_ENABLE 0
|
||||
|
||||
// <o>Response Timeout in seconds <5-120>
|
||||
// <i> This is a time for SMTP Client to wait for a response from
|
||||
// <i> SMTP Server. If timeout expires, Client aborts operation.
|
||||
// <i> Default: 20
|
||||
#define SMTP_DEFTOUT 20
|
||||
|
||||
// </e>
|
||||
// <e>SNMP Agent
|
||||
// =============
|
||||
// <i> Enable or disable SNMP Agent
|
||||
#define SNMP_ENABLE 0
|
||||
|
||||
// <s.15>Community Name
|
||||
// <i> Defines where an SNMP message is destined for.
|
||||
// <i> Default: "public"
|
||||
#define SNMP_COMMUNITY "public"
|
||||
|
||||
// <o>Port Number <1-65535>
|
||||
// <i> Listening port number.
|
||||
// <i> Default: 161
|
||||
#define SNMP_PORTNUM 161
|
||||
|
||||
// <o>Trap Port Number <1-65535>
|
||||
// <i> Port number for Trap operations.
|
||||
// <i> Default: 162
|
||||
#define SNMP_TRAPPORT 162
|
||||
|
||||
// <h>Trap Server
|
||||
// ==============
|
||||
// <i> Trap Server IP Address
|
||||
// <o>Address byte 1 <0-255>
|
||||
// <i> Default: 192
|
||||
#define SNMP_TRAPIP1 192
|
||||
|
||||
// <o>Address byte 2 <0-255>
|
||||
// <i> Default: 168
|
||||
#define SNMP_TRAPIP2 168
|
||||
|
||||
// <o>Address byte 3 <0-255>
|
||||
// <i> Default: 0
|
||||
#define SNMP_TRAPIP3 0
|
||||
|
||||
// <o>Address byte 4 <0-255>
|
||||
// <i> Default: 100
|
||||
#define SNMP_TRAPIP4 100
|
||||
|
||||
// </h>
|
||||
// </e>
|
||||
// <e>BSD Socket Interface
|
||||
// =======================
|
||||
// <i> Enable or disable Berkeley Socket Programming Interface
|
||||
#define BSD_ENABLE 1
|
||||
|
||||
// <o>Number of BSD Sockets <1-20>
|
||||
// <i> Number of available Berkeley Sockets
|
||||
// <i> Default: 2
|
||||
#define BSD_NUMSOCKS 10
|
||||
|
||||
// <o>Number of Streaming Server Sockets <0-20>
|
||||
// <i> Defines a number of Streaming (TCP) Server sockets,
|
||||
// <i> that listen for an incoming connection from the client.
|
||||
// <i> Default: 1
|
||||
#define BSD_SRVSOCKS 2
|
||||
|
||||
// <o>Receive Timeout in seconds <0-600>
|
||||
// <i> A timeout for socket receive in blocking mode.
|
||||
// <i> Timeout value of 0 means indefinite timeout.
|
||||
// <i> Default: 20
|
||||
#define BSD_RCVTOUT 20
|
||||
|
||||
// <q>Hostname Resolver
|
||||
// <i> Enable or disable Berkeley style hostname resolver.
|
||||
#define BSD_GETHOSTEN 1
|
||||
|
||||
// </e>
|
||||
//------------- <<< end of configuration section >>> -----------------------
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
* Fatal Error Handler
|
||||
*---------------------------------------------------------------------------*/
|
||||
|
||||
void sys_error (ERROR_CODE code) {
|
||||
/* This function is called when a fatal error is encountered. The normal */
|
||||
/* program execution is not possible anymore. Add your crytical error .*/
|
||||
/* handler code here. */
|
||||
|
||||
switch (code) {
|
||||
case ERR_MEM_ALLOC:
|
||||
/* Out of memory. */
|
||||
break;
|
||||
|
||||
case ERR_MEM_FREE:
|
||||
/* Trying to release non existing memory block. */
|
||||
break;
|
||||
|
||||
case ERR_MEM_CORRUPT:
|
||||
/* Memory Link pointer is Corrupted. */
|
||||
/* More data written than the size of allocated mem block. */
|
||||
break;
|
||||
|
||||
case ERR_MEM_LOCK:
|
||||
/* Locked Memory management function (alloc/free) re-entered. */
|
||||
/* RTX multithread protection malfunctioning, not implemented */
|
||||
/* or interrupt disable is not functioning correctly. */
|
||||
break;
|
||||
|
||||
case ERR_UDP_ALLOC:
|
||||
/* Out of UDP Sockets. */
|
||||
break;
|
||||
|
||||
case ERR_TCP_ALLOC:
|
||||
/* Out of TCP Sockets. */
|
||||
break;
|
||||
|
||||
case ERR_TCP_STATE:
|
||||
/* TCP State machine in undefined state. */
|
||||
break;
|
||||
}
|
||||
|
||||
/* End-less loop */
|
||||
while (1);
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
* TCPnet Config Functions
|
||||
*---------------------------------------------------------------------------*/
|
||||
|
||||
#define __NET_CONFIG__
|
||||
|
||||
#include <Net_lib.c>
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
* end of file
|
||||
*---------------------------------------------------------------------------*/
|
139
IDE/MDK-ARM/MDK-ARM/config/Net_Debug.c
Normal file
139
IDE/MDK-ARM/MDK-ARM/config/Net_Debug.c
Normal file
@ -0,0 +1,139 @@
|
||||
/*----------------------------------------------------------------------------
|
||||
* RL-ARM - TCPnet
|
||||
*----------------------------------------------------------------------------
|
||||
* Name: NET_DEBUG.C
|
||||
* Purpose: Debug Module
|
||||
* Rev.: V4.60
|
||||
*----------------------------------------------------------------------------
|
||||
* This code is part of the RealView Run-Time Library.
|
||||
* Copyright (c) 2004-2012 KEIL - An ARM Company. All rights reserved.
|
||||
*---------------------------------------------------------------------------*/
|
||||
|
||||
#include <Net_Config.h>
|
||||
|
||||
//-------- <<< Use Configuration Wizard in Context Menu >>> -----------------
|
||||
|
||||
// <q>Print Time Stamp
|
||||
// ===================
|
||||
// <i> Enable printing the time-info in debug messages
|
||||
#define DBG_TIME 1
|
||||
|
||||
// <h>TCPnet Debug Definitions
|
||||
// ===========================
|
||||
// <o>Memory Management Debug <0=> Off <1=> Errors only <2=> Full debug
|
||||
// <i> Turn On/Off Dynamic Memory debug messages
|
||||
#define DBG_MEM 1
|
||||
|
||||
// <o>Ethernet Debug <0=> Off <1=> Errors only <2=> Full debug
|
||||
// <i> Turn On/Off Ethernet debug messages
|
||||
#define DBG_ETH 1
|
||||
|
||||
// <o>PPP Debug <0=> Off <1=> Errors only <2=> Full debug
|
||||
// <i> Turn On/Off PPP debug messages
|
||||
#define DBG_PPP 0
|
||||
|
||||
// <o>SLIP Debug <0=> Off <1=> Errors only <2=> Full debug
|
||||
// <i> Turn On/Off SLIP debug messages
|
||||
#define DBG_SLIP 0
|
||||
|
||||
// <o>ARP Debug <0=> Off <1=> Errors only <2=> Full debug
|
||||
// <i> Turn On/Off ARP debug messages
|
||||
#define DBG_ARP 1
|
||||
|
||||
// <o>IP Debug <0=> Off <1=> Errors only <2=> Full debug
|
||||
// <i> Turn On/Off IP debug messages
|
||||
#define DBG_IP 1
|
||||
|
||||
// <o>ICMP Debug <0=> Off <1=> Errors only <2=> Full debug
|
||||
// <i> Turn On/Off ICMP debug messages
|
||||
#define DBG_ICMP 1
|
||||
|
||||
// <o>IGMP Debug <0=> Off <1=> Errors only <2=> Full debug
|
||||
// <i> Turn On/Off IGMP debug messages
|
||||
#define DBG_IGMP 1
|
||||
|
||||
// <o>UDP Debug <0=> Off <1=> Errors only <2=> Full debug
|
||||
// <i> Turn On/Off UDP debug messages
|
||||
#define DBG_UDP 1
|
||||
|
||||
// <o>TCP Debug <0=> Off <1=> Errors only <2=> Full debug
|
||||
// <i> Turn On/Off TCP debug messages
|
||||
#define DBG_TCP 2
|
||||
|
||||
// <o>NBNS Debug <0=> Off <1=> Errors only <2=> Full debug
|
||||
// <i> Turn On/Off NetBIOS Name Service debug messages
|
||||
#define DBG_NBNS 1
|
||||
|
||||
// <o>DHCP Debug <0=> Off <1=> Errors only <2=> Full debug
|
||||
// <i> Turn On/Off Dynamic Host Configuration debug messages
|
||||
#define DBG_DHCP 2
|
||||
|
||||
// <o>DNS Debug <0=> Off <1=> Errors only <2=> Full debug
|
||||
// <i> Turn On/Off Domain Name Service debug messages
|
||||
#define DBG_DNS 1
|
||||
|
||||
// <o>SNMP Debug <0=> Off <1=> Errors only <2=> Full debug
|
||||
// <i> Turn On/Off Simple Network Management debug messages
|
||||
#define DBG_SNMP 1
|
||||
|
||||
// <o>BSD Debug <0=> Off <1=> Errors only <2=> Full debug
|
||||
// <i> Turn On/Off BSD Interface debug messages
|
||||
#define DBG_BSD 2
|
||||
|
||||
// </h>
|
||||
// <h>Application Debug Definitions
|
||||
// ================================
|
||||
// <o>HTTP Server Debug <0=> Off <1=> Errors only <2=> Full debug
|
||||
// <i> Turn On/Off Web Server debug messages
|
||||
#define DBG_HTTP 1
|
||||
|
||||
// <o>FTP Server Debug <0=> Off <1=> Errors only <2=> Full debug
|
||||
// <i> Turn On/Off FTP Server debug messages
|
||||
#define DBG_FTP 1
|
||||
|
||||
// <o>FTP Client Debug <0=> Off <1=> Errors only <2=> Full debug
|
||||
// <i> Turn On/Off FTP Client debug messages
|
||||
#define DBG_FTPC 1
|
||||
|
||||
// <o>Telnet Server Debug <0=> Off <1=> Errors only <2=> Full debug
|
||||
// <i> Turn On/Off Telnet Server debug messages
|
||||
#define DBG_TNET 1
|
||||
|
||||
// <o>TFTP Server Debug <0=> Off <1=> Errors only <2=> Full debug
|
||||
// <i> Turn On/Off TFTP Server debug messages
|
||||
#define DBG_TFTP 1
|
||||
|
||||
// <o>TFTP Client Debug <0=> Off <1=> Errors only <2=> Full debug
|
||||
// <i> Turn On/Off TFTP Client debug messages
|
||||
#define DBG_TFTPC 1
|
||||
|
||||
// <o>SMTP Client Debug <0=> Off <1=> Errors only <2=> Full debug
|
||||
// <i> Turn On/Off SMTP Client debug messages
|
||||
#define DBG_SMTP 1
|
||||
|
||||
// </h>
|
||||
|
||||
//------------- <<< end of configuration section >>> -----------------------
|
||||
|
||||
|
||||
/*--------------------------- init_debug ------------------------------------*/
|
||||
|
||||
void init_debug (void) {
|
||||
/* Add your code to initialize the Debug output. This is usually the */
|
||||
/* serial interface. The function is called at TCPnet system startup. */
|
||||
/* You may need to customize also the 'putchar()' function. */
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
* TCPnet Debug Functions
|
||||
*---------------------------------------------------------------------------*/
|
||||
|
||||
#define __NET_DEBUG__
|
||||
|
||||
#include <Net_lib.c>
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
* end of file
|
||||
*---------------------------------------------------------------------------*/
|
205
IDE/MDK-ARM/MDK-ARM/config/RTX_Conf_CM.c
Normal file
205
IDE/MDK-ARM/MDK-ARM/config/RTX_Conf_CM.c
Normal file
@ -0,0 +1,205 @@
|
||||
/*----------------------------------------------------------------------------
|
||||
* RL-ARM - RTX
|
||||
*----------------------------------------------------------------------------
|
||||
* Name: RTX_CONFIG.C
|
||||
* Purpose: Configuration of RTX Kernel for Cortex-M
|
||||
* Rev.: V4.60
|
||||
*----------------------------------------------------------------------------
|
||||
* This code is part of the RealView Run-Time Library.
|
||||
* Copyright (c) 2004-2012 KEIL - An ARM Company. All rights reserved.
|
||||
*---------------------------------------------------------------------------*/
|
||||
|
||||
#include <RTL.h>
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
* RTX User configuration part BEGIN
|
||||
*---------------------------------------------------------------------------*/
|
||||
|
||||
//-------- <<< Use Configuration Wizard in Context Menu >>> -----------------
|
||||
//
|
||||
// <h>Task Configuration
|
||||
// =====================
|
||||
//
|
||||
// <o>Number of concurrent running tasks <0-250>
|
||||
// <i> Define max. number of tasks that will run at the same time.
|
||||
// <i> Default: 6
|
||||
#ifndef OS_TASKCNT
|
||||
#define OS_TASKCNT 6
|
||||
#endif
|
||||
|
||||
// <o>Number of tasks with user-provided stack <0-250>
|
||||
// <i> Define the number of tasks that will use a bigger stack.
|
||||
// <i> The memory space for the stack is provided by the user.
|
||||
// <i> Default: 0
|
||||
#ifndef OS_PRIVCNT
|
||||
#define OS_PRIVCNT 2
|
||||
#endif
|
||||
|
||||
// <o>Task stack size [bytes] <20-4096:8><#/4>
|
||||
// <i> Set the stack size for tasks which is assigned by the system.
|
||||
// <i> Default: 512
|
||||
#ifndef OS_STKSIZE
|
||||
#define OS_STKSIZE 499
|
||||
#endif
|
||||
|
||||
// <q>Check for the stack overflow
|
||||
// ===============================
|
||||
// <i> Include the stack checking code for a stack overflow.
|
||||
// <i> Note that additional code reduces the Kernel performance.
|
||||
#ifndef OS_STKCHECK
|
||||
#define OS_STKCHECK 1
|
||||
#endif
|
||||
|
||||
// <q>Run in privileged mode
|
||||
// =========================
|
||||
// <i> Run all Tasks in privileged mode.
|
||||
// <i> Default: Unprivileged
|
||||
#ifndef OS_RUNPRIV
|
||||
#define OS_RUNPRIV 1
|
||||
#endif
|
||||
|
||||
// </h>
|
||||
// <h>Tick Timer Configuration
|
||||
// =============================
|
||||
// <o>Hardware timer <0=> Core SysTick <1=> Peripheral Timer
|
||||
// <i> Define the on-chip timer used as a time-base for RTX.
|
||||
// <i> Default: Core SysTick
|
||||
#ifndef OS_TIMER
|
||||
#define OS_TIMER 0
|
||||
#endif
|
||||
|
||||
// <o>Timer clock value [Hz] <1-1000000000>
|
||||
// <i> Set the timer clock value for selected timer.
|
||||
// <i> Default: 6000000 (6MHz)
|
||||
#ifndef OS_CLOCK
|
||||
#define OS_CLOCK 120000000
|
||||
#endif
|
||||
|
||||
// <o>Timer tick value [us] <1-1000000>
|
||||
// <i> Set the timer tick value for selected timer.
|
||||
// <i> Default: 10000 (10ms)
|
||||
#ifndef OS_TICK
|
||||
#define OS_TICK 1000
|
||||
#endif
|
||||
|
||||
// </h>
|
||||
|
||||
// <h>System Configuration
|
||||
// =======================
|
||||
// <e>Round-Robin Task switching
|
||||
// =============================
|
||||
// <i> Enable Round-Robin Task switching.
|
||||
#ifndef OS_ROBIN
|
||||
#define OS_ROBIN 1
|
||||
#endif
|
||||
|
||||
// <o>Round-Robin Timeout [ticks] <1-1000>
|
||||
// <i> Define how long a task will execute before a task switch.
|
||||
// <i> Default: 5
|
||||
#ifndef OS_ROBINTOUT
|
||||
#define OS_ROBINTOUT 5
|
||||
#endif
|
||||
|
||||
// </e>
|
||||
|
||||
// <o>Number of user timers <0-250>
|
||||
// <i> Define max. number of user timers that will run at the same time.
|
||||
// <i> Default: 0 (User timers disabled)
|
||||
#ifndef OS_TIMERCNT
|
||||
#define OS_TIMERCNT 1
|
||||
#endif
|
||||
|
||||
// <o>ISR FIFO Queue size<4=> 4 entries <8=> 8 entries
|
||||
// <12=> 12 entries <16=> 16 entries
|
||||
// <24=> 24 entries <32=> 32 entries
|
||||
// <48=> 48 entries <64=> 64 entries
|
||||
// <96=> 96 entries
|
||||
// <i> ISR functions store requests to this buffer,
|
||||
// <i> when they are called from the iterrupt handler.
|
||||
// <i> Default: 16 entries
|
||||
#ifndef OS_FIFOSZ
|
||||
#define OS_FIFOSZ 16
|
||||
#endif
|
||||
|
||||
// </h>
|
||||
|
||||
//------------- <<< end of configuration section >>> -----------------------
|
||||
|
||||
// Standard library system mutexes
|
||||
// ===============================
|
||||
// Define max. number system mutexes that are used to protect
|
||||
// the arm standard runtime library. For microlib they are not used.
|
||||
#ifndef OS_MUTEXCNT
|
||||
#define OS_MUTEXCNT 8
|
||||
#endif
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
* RTX User configuration part END
|
||||
*---------------------------------------------------------------------------*/
|
||||
|
||||
#define OS_TRV ((U32)(((double)OS_CLOCK*(double)OS_TICK)/1E6)-1)
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
* Global Functions
|
||||
*---------------------------------------------------------------------------*/
|
||||
|
||||
/*--------------------------- os_idle_demon ---------------------------------*/
|
||||
|
||||
__task void os_idle_demon (void) {
|
||||
/* The idle demon is a system task, running when no other task is ready */
|
||||
/* to run. The 'os_xxx' function calls are not allowed from this task. */
|
||||
|
||||
for (;;) {
|
||||
/* HERE: include optional user code to be executed when no task runs.*/
|
||||
}
|
||||
}
|
||||
|
||||
/*--------------------------- os_tick_init ----------------------------------*/
|
||||
|
||||
#if (OS_TIMER != 0)
|
||||
int os_tick_init (void) {
|
||||
/* Initialize hardware timer as system tick timer. */
|
||||
/* ... */
|
||||
return (-1); /* Return IRQ number of timer (0..239) */
|
||||
}
|
||||
#endif
|
||||
|
||||
/*--------------------------- os_tick_irqack --------------------------------*/
|
||||
|
||||
#if (OS_TIMER != 0)
|
||||
void os_tick_irqack (void) {
|
||||
/* Acknowledge timer interrupt. */
|
||||
/* ... */
|
||||
}
|
||||
#endif
|
||||
|
||||
/*--------------------------- os_tmr_call -----------------------------------*/
|
||||
|
||||
void os_tmr_call (U16 info) {
|
||||
/* This function is called when the user timer has expired. Parameter */
|
||||
/* 'info' holds the value, defined when the timer was created. */
|
||||
|
||||
/* HERE: include optional user code to be executed on timeout. */
|
||||
}
|
||||
|
||||
|
||||
/*--------------------------- os_error --------------------------------------*/
|
||||
|
||||
void os_error (U32 err_code) {
|
||||
/* This function is called when a runtime error is detected. Parameter */
|
||||
/* 'err_code' holds the runtime error code (defined in RTL.H). */
|
||||
|
||||
/* HERE: include optional code to be executed on runtime error. */
|
||||
for (;;);
|
||||
}
|
||||
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
* RTX Configuration Functions
|
||||
*---------------------------------------------------------------------------*/
|
||||
|
||||
#include <RTX_lib.c>
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
* end of file
|
||||
*---------------------------------------------------------------------------*/
|
36
IDE/MDK-ARM/MDK-ARM/config/STM32_SWO.ini
Normal file
36
IDE/MDK-ARM/MDK-ARM/config/STM32_SWO.ini
Normal file
@ -0,0 +1,36 @@
|
||||
/******************************************************************************/
|
||||
/* STM32_SWO.ini: STM32 Debugger Initialization File */
|
||||
/******************************************************************************/
|
||||
// <<< Use Configuration Wizard in Context Menu >>> //
|
||||
/******************************************************************************/
|
||||
/* This file is part of the uVision/ARM development tools. */
|
||||
/* Copyright (c) 2005-2009 Keil Software. All rights reserved. */
|
||||
/* This software may only be used under the terms of a valid, current, */
|
||||
/* end user licence from KEIL for a compatible version of KEIL software */
|
||||
/* development tools. Nothing else gives you the right to use this software. */
|
||||
/******************************************************************************/
|
||||
|
||||
|
||||
FUNC void DebugSetup (void) {
|
||||
// <h> Debug MCU Configuration
|
||||
// <o1.0> DBG_SLEEP <i> Debug Sleep Mode
|
||||
// <o1.1> DBG_STOP <i> Debug Stop Mode
|
||||
// <o1.2> DBG_STANDBY <i> Debug Standby Mode
|
||||
// <o1.5> TRACE_IOEN <i> Trace I/O Enable
|
||||
// <o1.6..7> TRACE_MODE <i> Trace Mode
|
||||
// <0=> Asynchronous
|
||||
// <1=> Synchronous: TRACEDATA Size 1
|
||||
// <2=> Synchronous: TRACEDATA Size 2
|
||||
// <3=> Synchronous: TRACEDATA Size 4
|
||||
// <o1.8> DBG_IWDG_STOP <i> Independant Watchdog Stopped when Core is halted
|
||||
// <o1.9> DBG_WWDG_STOP <i> Window Watchdog Stopped when Core is halted
|
||||
// <o1.10> DBG_TIM1_STOP <i> Timer 1 Stopped when Core is halted
|
||||
// <o1.11> DBG_TIM2_STOP <i> Timer 2 Stopped when Core is halted
|
||||
// <o1.12> DBG_TIM3_STOP <i> Timer 3 Stopped when Core is halted
|
||||
// <o1.13> DBG_TIM4_STOP <i> Timer 4 Stopped when Core is halted
|
||||
// <o1.14> DBG_CAN_STOP <i> CAN Stopped when Core is halted
|
||||
// </h>
|
||||
_WDWORD(0xE0042004, 0x00000027); // DBGMCU_CR
|
||||
}
|
||||
|
||||
DebugSetup(); // Debugger Setup
|
419
IDE/MDK-ARM/MDK-ARM/config/startup_stm32f2xx.s
Normal file
419
IDE/MDK-ARM/MDK-ARM/config/startup_stm32f2xx.s
Normal file
@ -0,0 +1,419 @@
|
||||
;******************** (C) COPYRIGHT 2011 STMicroelectronics ********************
|
||||
;* File Name : startup_stm32f2xx.s
|
||||
;* Author : MCD Application Team
|
||||
;* Version : V1.0.0
|
||||
;* Date : 18-April-2011
|
||||
;* Description : STM32F2xx devices vector table for MDK-ARM toolchain.
|
||||
;* This module performs:
|
||||
;* - Set the initial SP
|
||||
;* - Set the initial PC == Reset_Handler
|
||||
;* - Set the vector table entries with the exceptions ISR address
|
||||
;* - Branches to __main in the C library (which eventually
|
||||
;* calls main()).
|
||||
;* After Reset the CortexM3 processor is in Thread mode,
|
||||
;* priority is Privileged, and the Stack is set to Main.
|
||||
;* <<< Use Configuration Wizard in Context Menu >>>
|
||||
;*******************************************************************************
|
||||
; THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS
|
||||
; WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE TIME.
|
||||
; AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY DIRECT,
|
||||
; INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE
|
||||
; CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING
|
||||
; INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
|
||||
;*******************************************************************************
|
||||
|
||||
; Amount of memory (in bytes) allocated for Stack
|
||||
; Tailor this value to your application needs
|
||||
; <h> Stack Configuration
|
||||
; <o> Stack Size (in Bytes) <0x0-0xFFFFFFFF:8>
|
||||
; </h>
|
||||
|
||||
Stack_Size EQU 0x00001000
|
||||
|
||||
AREA STACK, NOINIT, READWRITE, ALIGN=3
|
||||
Stack_Mem SPACE Stack_Size
|
||||
__initial_sp
|
||||
|
||||
|
||||
; <h> Heap Configuration
|
||||
; <o> Heap Size (in Bytes) <0x0-0xFFFFFFFF:8>
|
||||
; </h>
|
||||
|
||||
Heap_Size EQU 0x00009000
|
||||
|
||||
AREA HEAP, NOINIT, READWRITE, ALIGN=3
|
||||
__heap_base
|
||||
Heap_Mem SPACE Heap_Size
|
||||
__heap_limit
|
||||
|
||||
PRESERVE8
|
||||
THUMB
|
||||
|
||||
|
||||
; Vector Table Mapped to Address 0 at Reset
|
||||
AREA RESET, DATA, READONLY
|
||||
EXPORT __Vectors
|
||||
EXPORT __Vectors_End
|
||||
EXPORT __Vectors_Size
|
||||
|
||||
__Vectors DCD __initial_sp ; Top of Stack
|
||||
DCD Reset_Handler ; Reset Handler
|
||||
DCD NMI_Handler ; NMI Handler
|
||||
DCD HardFault_Handler ; Hard Fault Handler
|
||||
DCD MemManage_Handler ; MPU Fault Handler
|
||||
DCD BusFault_Handler ; Bus Fault Handler
|
||||
DCD UsageFault_Handler ; Usage Fault Handler
|
||||
DCD 0 ; Reserved
|
||||
DCD 0 ; Reserved
|
||||
DCD 0 ; Reserved
|
||||
DCD 0 ; Reserved
|
||||
DCD SVC_Handler ; SVCall Handler
|
||||
DCD DebugMon_Handler ; Debug Monitor Handler
|
||||
DCD 0 ; Reserved
|
||||
DCD PendSV_Handler ; PendSV Handler
|
||||
DCD SysTick_Handler ; SysTick Handler
|
||||
|
||||
; External Interrupts
|
||||
DCD WWDG_IRQHandler ; Window WatchDog
|
||||
DCD PVD_IRQHandler ; PVD through EXTI Line detection
|
||||
DCD TAMP_STAMP_IRQHandler ; Tamper and TimeStamps through the EXTI line
|
||||
DCD RTC_WKUP_IRQHandler ; RTC Wakeup through the EXTI line
|
||||
DCD FLASH_IRQHandler ; FLASH
|
||||
DCD RCC_IRQHandler ; RCC
|
||||
DCD EXTI0_IRQHandler ; EXTI Line0
|
||||
DCD EXTI1_IRQHandler ; EXTI Line1
|
||||
DCD EXTI2_IRQHandler ; EXTI Line2
|
||||
DCD EXTI3_IRQHandler ; EXTI Line3
|
||||
DCD EXTI4_IRQHandler ; EXTI Line4
|
||||
DCD DMA1_Stream0_IRQHandler ; DMA1 Stream 0
|
||||
DCD DMA1_Stream1_IRQHandler ; DMA1 Stream 1
|
||||
DCD DMA1_Stream2_IRQHandler ; DMA1 Stream 2
|
||||
DCD DMA1_Stream3_IRQHandler ; DMA1 Stream 3
|
||||
DCD DMA1_Stream4_IRQHandler ; DMA1 Stream 4
|
||||
DCD DMA1_Stream5_IRQHandler ; DMA1 Stream 5
|
||||
DCD DMA1_Stream6_IRQHandler ; DMA1 Stream 6
|
||||
DCD ADC_IRQHandler ; ADC1, ADC2 and ADC3s
|
||||
DCD CAN1_TX_IRQHandler ; CAN1 TX
|
||||
DCD CAN1_RX0_IRQHandler ; CAN1 RX0
|
||||
DCD CAN1_RX1_IRQHandler ; CAN1 RX1
|
||||
DCD CAN1_SCE_IRQHandler ; CAN1 SCE
|
||||
DCD EXTI9_5_IRQHandler ; External Line[9:5]s
|
||||
DCD TIM1_BRK_TIM9_IRQHandler ; TIM1 Break and TIM9
|
||||
DCD TIM1_UP_TIM10_IRQHandler ; TIM1 Update and TIM10
|
||||
DCD TIM1_TRG_COM_TIM11_IRQHandler ; TIM1 Trigger and Commutation and TIM11
|
||||
DCD TIM1_CC_IRQHandler ; TIM1 Capture Compare
|
||||
DCD TIM2_IRQHandler ; TIM2
|
||||
DCD TIM3_IRQHandler ; TIM3
|
||||
DCD TIM4_IRQHandler ; TIM4
|
||||
DCD I2C1_EV_IRQHandler ; I2C1 Event
|
||||
DCD I2C1_ER_IRQHandler ; I2C1 Error
|
||||
DCD I2C2_EV_IRQHandler ; I2C2 Event
|
||||
DCD I2C2_ER_IRQHandler ; I2C2 Error
|
||||
DCD SPI1_IRQHandler ; SPI1
|
||||
DCD SPI2_IRQHandler ; SPI2
|
||||
DCD USART1_IRQHandler ; USART1
|
||||
DCD USART2_IRQHandler ; USART2
|
||||
DCD USART3_IRQHandler ; USART3
|
||||
DCD EXTI15_10_IRQHandler ; External Line[15:10]s
|
||||
DCD RTC_Alarm_IRQHandler ; RTC Alarm (A and B) through EXTI Line
|
||||
DCD OTG_FS_WKUP_IRQHandler ; USB OTG FS Wakeup through EXTI line
|
||||
DCD TIM8_BRK_TIM12_IRQHandler ; TIM8 Break and TIM12
|
||||
DCD TIM8_UP_TIM13_IRQHandler ; TIM8 Update and TIM13
|
||||
DCD TIM8_TRG_COM_TIM14_IRQHandler ; TIM8 Trigger and Commutation and TIM14
|
||||
DCD TIM8_CC_IRQHandler ; TIM8 Capture Compare
|
||||
DCD DMA1_Stream7_IRQHandler ; DMA1 Stream7
|
||||
DCD FSMC_IRQHandler ; FSMC
|
||||
DCD SDIO_IRQHandler ; SDIO
|
||||
DCD TIM5_IRQHandler ; TIM5
|
||||
DCD SPI3_IRQHandler ; SPI3
|
||||
DCD UART4_IRQHandler ; UART4
|
||||
DCD UART5_IRQHandler ; UART5
|
||||
DCD TIM6_DAC_IRQHandler ; TIM6 and DAC1&2 underrun errors
|
||||
DCD TIM7_IRQHandler ; TIM7
|
||||
DCD DMA2_Stream0_IRQHandler ; DMA2 Stream 0
|
||||
DCD DMA2_Stream1_IRQHandler ; DMA2 Stream 1
|
||||
DCD DMA2_Stream2_IRQHandler ; DMA2 Stream 2
|
||||
DCD DMA2_Stream3_IRQHandler ; DMA2 Stream 3
|
||||
DCD DMA2_Stream4_IRQHandler ; DMA2 Stream 4
|
||||
DCD ETH_IRQHandler ; Ethernet
|
||||
DCD ETH_WKUP_IRQHandler ; Ethernet Wakeup through EXTI line
|
||||
DCD CAN2_TX_IRQHandler ; CAN2 TX
|
||||
DCD CAN2_RX0_IRQHandler ; CAN2 RX0
|
||||
DCD CAN2_RX1_IRQHandler ; CAN2 RX1
|
||||
DCD CAN2_SCE_IRQHandler ; CAN2 SCE
|
||||
DCD OTG_FS_IRQHandler ; USB OTG FS
|
||||
DCD DMA2_Stream5_IRQHandler ; DMA2 Stream 5
|
||||
DCD DMA2_Stream6_IRQHandler ; DMA2 Stream 6
|
||||
DCD DMA2_Stream7_IRQHandler ; DMA2 Stream 7
|
||||
DCD USART6_IRQHandler ; USART6
|
||||
DCD I2C3_EV_IRQHandler ; I2C3 event
|
||||
DCD I2C3_ER_IRQHandler ; I2C3 error
|
||||
DCD OTG_HS_EP1_OUT_IRQHandler ; USB OTG HS End Point 1 Out
|
||||
DCD OTG_HS_EP1_IN_IRQHandler ; USB OTG HS End Point 1 In
|
||||
DCD OTG_HS_WKUP_IRQHandler ; USB OTG HS Wakeup through EXTI
|
||||
DCD OTG_HS_IRQHandler ; USB OTG HS
|
||||
DCD DCMI_IRQHandler ; DCMI
|
||||
DCD CRYP_IRQHandler ; CRYP crypto
|
||||
DCD HASH_RNG_IRQHandler ; Hash and Rng
|
||||
__Vectors_End
|
||||
|
||||
__Vectors_Size EQU __Vectors_End - __Vectors
|
||||
|
||||
AREA |.text|, CODE, READONLY
|
||||
|
||||
; Reset handler
|
||||
Reset_Handler PROC
|
||||
EXPORT Reset_Handler [WEAK]
|
||||
IMPORT SystemInit
|
||||
IMPORT __main
|
||||
LDR R0, =SystemInit
|
||||
BLX R0
|
||||
LDR R0, =__main
|
||||
BX R0
|
||||
ENDP
|
||||
|
||||
; Dummy Exception Handlers (infinite loops which can be modified)
|
||||
|
||||
NMI_Handler PROC
|
||||
EXPORT NMI_Handler [WEAK]
|
||||
B .
|
||||
ENDP
|
||||
HardFault_Handler\
|
||||
PROC
|
||||
EXPORT HardFault_Handler [WEAK]
|
||||
B .
|
||||
ENDP
|
||||
MemManage_Handler\
|
||||
PROC
|
||||
EXPORT MemManage_Handler [WEAK]
|
||||
B .
|
||||
ENDP
|
||||
BusFault_Handler\
|
||||
PROC
|
||||
EXPORT BusFault_Handler [WEAK]
|
||||
B .
|
||||
ENDP
|
||||
UsageFault_Handler\
|
||||
PROC
|
||||
EXPORT UsageFault_Handler [WEAK]
|
||||
B .
|
||||
ENDP
|
||||
SVC_Handler PROC
|
||||
EXPORT SVC_Handler [WEAK]
|
||||
B .
|
||||
ENDP
|
||||
DebugMon_Handler\
|
||||
PROC
|
||||
EXPORT DebugMon_Handler [WEAK]
|
||||
B .
|
||||
ENDP
|
||||
PendSV_Handler PROC
|
||||
EXPORT PendSV_Handler [WEAK]
|
||||
B .
|
||||
ENDP
|
||||
SysTick_Handler PROC
|
||||
EXPORT SysTick_Handler [WEAK]
|
||||
B .
|
||||
ENDP
|
||||
|
||||
Default_Handler PROC
|
||||
|
||||
EXPORT WWDG_IRQHandler [WEAK]
|
||||
EXPORT PVD_IRQHandler [WEAK]
|
||||
EXPORT TAMP_STAMP_IRQHandler [WEAK]
|
||||
EXPORT RTC_WKUP_IRQHandler [WEAK]
|
||||
EXPORT FLASH_IRQHandler [WEAK]
|
||||
EXPORT RCC_IRQHandler [WEAK]
|
||||
EXPORT EXTI0_IRQHandler [WEAK]
|
||||
EXPORT EXTI1_IRQHandler [WEAK]
|
||||
EXPORT EXTI2_IRQHandler [WEAK]
|
||||
EXPORT EXTI3_IRQHandler [WEAK]
|
||||
EXPORT EXTI4_IRQHandler [WEAK]
|
||||
EXPORT DMA1_Stream0_IRQHandler [WEAK]
|
||||
EXPORT DMA1_Stream1_IRQHandler [WEAK]
|
||||
EXPORT DMA1_Stream2_IRQHandler [WEAK]
|
||||
EXPORT DMA1_Stream3_IRQHandler [WEAK]
|
||||
EXPORT DMA1_Stream4_IRQHandler [WEAK]
|
||||
EXPORT DMA1_Stream5_IRQHandler [WEAK]
|
||||
EXPORT DMA1_Stream6_IRQHandler [WEAK]
|
||||
EXPORT ADC_IRQHandler [WEAK]
|
||||
EXPORT CAN1_TX_IRQHandler [WEAK]
|
||||
EXPORT CAN1_RX0_IRQHandler [WEAK]
|
||||
EXPORT CAN1_RX1_IRQHandler [WEAK]
|
||||
EXPORT CAN1_SCE_IRQHandler [WEAK]
|
||||
EXPORT EXTI9_5_IRQHandler [WEAK]
|
||||
EXPORT TIM1_BRK_TIM9_IRQHandler [WEAK]
|
||||
EXPORT TIM1_UP_TIM10_IRQHandler [WEAK]
|
||||
EXPORT TIM1_TRG_COM_TIM11_IRQHandler [WEAK]
|
||||
EXPORT TIM1_CC_IRQHandler [WEAK]
|
||||
EXPORT TIM2_IRQHandler [WEAK]
|
||||
EXPORT TIM3_IRQHandler [WEAK]
|
||||
EXPORT TIM4_IRQHandler [WEAK]
|
||||
EXPORT I2C1_EV_IRQHandler [WEAK]
|
||||
EXPORT I2C1_ER_IRQHandler [WEAK]
|
||||
EXPORT I2C2_EV_IRQHandler [WEAK]
|
||||
EXPORT I2C2_ER_IRQHandler [WEAK]
|
||||
EXPORT SPI1_IRQHandler [WEAK]
|
||||
EXPORT SPI2_IRQHandler [WEAK]
|
||||
EXPORT USART1_IRQHandler [WEAK]
|
||||
EXPORT USART2_IRQHandler [WEAK]
|
||||
EXPORT USART3_IRQHandler [WEAK]
|
||||
EXPORT EXTI15_10_IRQHandler [WEAK]
|
||||
EXPORT RTC_Alarm_IRQHandler [WEAK]
|
||||
EXPORT OTG_FS_WKUP_IRQHandler [WEAK]
|
||||
EXPORT TIM8_BRK_TIM12_IRQHandler [WEAK]
|
||||
EXPORT TIM8_UP_TIM13_IRQHandler [WEAK]
|
||||
EXPORT TIM8_TRG_COM_TIM14_IRQHandler [WEAK]
|
||||
EXPORT TIM8_CC_IRQHandler [WEAK]
|
||||
EXPORT DMA1_Stream7_IRQHandler [WEAK]
|
||||
EXPORT FSMC_IRQHandler [WEAK]
|
||||
EXPORT SDIO_IRQHandler [WEAK]
|
||||
EXPORT TIM5_IRQHandler [WEAK]
|
||||
EXPORT SPI3_IRQHandler [WEAK]
|
||||
EXPORT UART4_IRQHandler [WEAK]
|
||||
EXPORT UART5_IRQHandler [WEAK]
|
||||
EXPORT TIM6_DAC_IRQHandler [WEAK]
|
||||
EXPORT TIM7_IRQHandler [WEAK]
|
||||
EXPORT DMA2_Stream0_IRQHandler [WEAK]
|
||||
EXPORT DMA2_Stream1_IRQHandler [WEAK]
|
||||
EXPORT DMA2_Stream2_IRQHandler [WEAK]
|
||||
EXPORT DMA2_Stream3_IRQHandler [WEAK]
|
||||
EXPORT DMA2_Stream4_IRQHandler [WEAK]
|
||||
EXPORT ETH_IRQHandler [WEAK]
|
||||
EXPORT ETH_WKUP_IRQHandler [WEAK]
|
||||
EXPORT CAN2_TX_IRQHandler [WEAK]
|
||||
EXPORT CAN2_RX0_IRQHandler [WEAK]
|
||||
EXPORT CAN2_RX1_IRQHandler [WEAK]
|
||||
EXPORT CAN2_SCE_IRQHandler [WEAK]
|
||||
EXPORT OTG_FS_IRQHandler [WEAK]
|
||||
EXPORT DMA2_Stream5_IRQHandler [WEAK]
|
||||
EXPORT DMA2_Stream6_IRQHandler [WEAK]
|
||||
EXPORT DMA2_Stream7_IRQHandler [WEAK]
|
||||
EXPORT USART6_IRQHandler [WEAK]
|
||||
EXPORT I2C3_EV_IRQHandler [WEAK]
|
||||
EXPORT I2C3_ER_IRQHandler [WEAK]
|
||||
EXPORT OTG_HS_EP1_OUT_IRQHandler [WEAK]
|
||||
EXPORT OTG_HS_EP1_IN_IRQHandler [WEAK]
|
||||
EXPORT OTG_HS_WKUP_IRQHandler [WEAK]
|
||||
EXPORT OTG_HS_IRQHandler [WEAK]
|
||||
EXPORT DCMI_IRQHandler [WEAK]
|
||||
EXPORT CRYP_IRQHandler [WEAK]
|
||||
EXPORT HASH_RNG_IRQHandler [WEAK]
|
||||
|
||||
WWDG_IRQHandler
|
||||
PVD_IRQHandler
|
||||
TAMP_STAMP_IRQHandler
|
||||
RTC_WKUP_IRQHandler
|
||||
FLASH_IRQHandler
|
||||
RCC_IRQHandler
|
||||
EXTI0_IRQHandler
|
||||
EXTI1_IRQHandler
|
||||
EXTI2_IRQHandler
|
||||
EXTI3_IRQHandler
|
||||
EXTI4_IRQHandler
|
||||
DMA1_Stream0_IRQHandler
|
||||
DMA1_Stream1_IRQHandler
|
||||
DMA1_Stream2_IRQHandler
|
||||
DMA1_Stream3_IRQHandler
|
||||
DMA1_Stream4_IRQHandler
|
||||
DMA1_Stream5_IRQHandler
|
||||
DMA1_Stream6_IRQHandler
|
||||
ADC_IRQHandler
|
||||
CAN1_TX_IRQHandler
|
||||
CAN1_RX0_IRQHandler
|
||||
CAN1_RX1_IRQHandler
|
||||
CAN1_SCE_IRQHandler
|
||||
EXTI9_5_IRQHandler
|
||||
TIM1_BRK_TIM9_IRQHandler
|
||||
TIM1_UP_TIM10_IRQHandler
|
||||
TIM1_TRG_COM_TIM11_IRQHandler
|
||||
TIM1_CC_IRQHandler
|
||||
TIM2_IRQHandler
|
||||
TIM3_IRQHandler
|
||||
TIM4_IRQHandler
|
||||
I2C1_EV_IRQHandler
|
||||
I2C1_ER_IRQHandler
|
||||
I2C2_EV_IRQHandler
|
||||
I2C2_ER_IRQHandler
|
||||
SPI1_IRQHandler
|
||||
SPI2_IRQHandler
|
||||
USART1_IRQHandler
|
||||
USART2_IRQHandler
|
||||
USART3_IRQHandler
|
||||
EXTI15_10_IRQHandler
|
||||
RTC_Alarm_IRQHandler
|
||||
OTG_FS_WKUP_IRQHandler
|
||||
TIM8_BRK_TIM12_IRQHandler
|
||||
TIM8_UP_TIM13_IRQHandler
|
||||
TIM8_TRG_COM_TIM14_IRQHandler
|
||||
TIM8_CC_IRQHandler
|
||||
DMA1_Stream7_IRQHandler
|
||||
FSMC_IRQHandler
|
||||
SDIO_IRQHandler
|
||||
TIM5_IRQHandler
|
||||
SPI3_IRQHandler
|
||||
UART4_IRQHandler
|
||||
UART5_IRQHandler
|
||||
TIM6_DAC_IRQHandler
|
||||
TIM7_IRQHandler
|
||||
DMA2_Stream0_IRQHandler
|
||||
DMA2_Stream1_IRQHandler
|
||||
DMA2_Stream2_IRQHandler
|
||||
DMA2_Stream3_IRQHandler
|
||||
DMA2_Stream4_IRQHandler
|
||||
ETH_IRQHandler
|
||||
ETH_WKUP_IRQHandler
|
||||
CAN2_TX_IRQHandler
|
||||
CAN2_RX0_IRQHandler
|
||||
CAN2_RX1_IRQHandler
|
||||
CAN2_SCE_IRQHandler
|
||||
OTG_FS_IRQHandler
|
||||
DMA2_Stream5_IRQHandler
|
||||
DMA2_Stream6_IRQHandler
|
||||
DMA2_Stream7_IRQHandler
|
||||
USART6_IRQHandler
|
||||
I2C3_EV_IRQHandler
|
||||
I2C3_ER_IRQHandler
|
||||
OTG_HS_EP1_OUT_IRQHandler
|
||||
OTG_HS_EP1_IN_IRQHandler
|
||||
OTG_HS_WKUP_IRQHandler
|
||||
OTG_HS_IRQHandler
|
||||
DCMI_IRQHandler
|
||||
CRYP_IRQHandler
|
||||
HASH_RNG_IRQHandler
|
||||
|
||||
B .
|
||||
|
||||
ENDP
|
||||
|
||||
ALIGN
|
||||
|
||||
;*******************************************************************************
|
||||
; User Stack and Heap initialization
|
||||
;*******************************************************************************
|
||||
IF :DEF:__MICROLIB
|
||||
|
||||
EXPORT __initial_sp
|
||||
EXPORT __heap_base
|
||||
EXPORT __heap_limit
|
||||
|
||||
ELSE
|
||||
|
||||
IMPORT __use_two_region_memory
|
||||
EXPORT __user_initial_stackheap
|
||||
|
||||
__user_initial_stackheap
|
||||
|
||||
LDR R0, = Heap_Mem
|
||||
LDR R1, =(Stack_Mem + Stack_Size)
|
||||
LDR R2, = (Heap_Mem + Heap_Size)
|
||||
LDR R3, = Stack_Mem
|
||||
BX LR
|
||||
|
||||
ALIGN
|
||||
|
||||
ENDIF
|
||||
|
||||
END
|
||||
|
||||
;******************* (C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE*****
|
1741
IDE/MDK-ARM/Projects/MDK-ARM-LPC43xx.uvopt
Normal file
1741
IDE/MDK-ARM/Projects/MDK-ARM-LPC43xx.uvopt
Normal file
File diff suppressed because it is too large
Load Diff
3495
IDE/MDK-ARM/Projects/MDK-ARM-LPC43xx.uvproj
Normal file
3495
IDE/MDK-ARM/Projects/MDK-ARM-LPC43xx.uvproj
Normal file
File diff suppressed because it is too large
Load Diff
1753
IDE/MDK-ARM/Projects/MDK-ARM-STM32F2xx.uvopt
Normal file
1753
IDE/MDK-ARM/Projects/MDK-ARM-STM32F2xx.uvopt
Normal file
File diff suppressed because it is too large
Load Diff
3580
IDE/MDK-ARM/Projects/MDK-ARM-STM32F2xx.uvproj
Normal file
3580
IDE/MDK-ARM/Projects/MDK-ARM-STM32F2xx.uvproj
Normal file
File diff suppressed because it is too large
Load Diff
185
IDE/MDK-ARM/STM32F2xx_StdPeriph_Lib/time-STM32F2xx.c
Normal file
185
IDE/MDK-ARM/STM32F2xx_StdPeriph_Lib/time-STM32F2xx.c
Normal file
@ -0,0 +1,185 @@
|
||||
/* main.c
|
||||
*
|
||||
* Copyright (C) 2006-2013 wolfSSL Inc.
|
||||
*
|
||||
* 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 "time.h"
|
||||
#include "stm32f2xx_tim.h"
|
||||
#include "stm32f2xx_rcc.h"
|
||||
|
||||
|
||||
/*-----------------------------------------------------------------------------
|
||||
* initialize RTC
|
||||
*----------------------------------------------------------------------------*/
|
||||
#include "stm32f2xx_rtc.h"
|
||||
#include "stm32f2xx_rcc.h"
|
||||
#include "stm32f2xx_pwr.h"
|
||||
|
||||
static init_RTC()
|
||||
{
|
||||
RTC_InitTypeDef RTC_InitStruct ;
|
||||
|
||||
RTC_TimeTypeDef RTC_Time ;
|
||||
RTC_DateTypeDef RTC_Date ;
|
||||
|
||||
|
||||
/* Enable the PWR clock */
|
||||
RCC_APB1PeriphClockCmd(RCC_APB1Periph_PWR, ENABLE);
|
||||
|
||||
/* Allow access to RTC */
|
||||
PWR_BackupAccessCmd(ENABLE);
|
||||
|
||||
/***Configures the External Low Speed oscillator (LSE)****/
|
||||
|
||||
RCC_LSEConfig(RCC_LSE_ON);
|
||||
|
||||
/* Wait till LSE is ready */
|
||||
while(RCC_GetFlagStatus(RCC_FLAG_LSERDY) == RESET)
|
||||
{
|
||||
}
|
||||
|
||||
/* Select the RTC Clock Source */
|
||||
RCC_RTCCLKConfig(RCC_RTCCLKSource_LSE);
|
||||
|
||||
/* Enable the RTC Clock */
|
||||
RCC_RTCCLKCmd(ENABLE);
|
||||
|
||||
/* Wait for RTC APB registers synchronisation */
|
||||
RTC_WaitForSynchro();
|
||||
|
||||
/* Calendar Configuration with LSI supposed at 32KHz */
|
||||
RTC_InitStruct.RTC_AsynchPrediv = 0x7F;
|
||||
RTC_InitStruct.RTC_SynchPrediv = 0xFF;
|
||||
RTC_InitStruct.RTC_HourFormat = RTC_HourFormat_24;
|
||||
RTC_Init(&RTC_InitStruct);
|
||||
|
||||
RTC_GetTime(RTC_Format_BIN, &RTC_Time) ;
|
||||
RTC_GetDate(RTC_Format_BIN, &RTC_Date) ;
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------------------------------
|
||||
* initialize TIM
|
||||
*----------------------------------------------------------------------------*/
|
||||
static void init_TIM()
|
||||
{
|
||||
TIM_TimeBaseInitTypeDef TIM_TimeBaseStructure ;
|
||||
|
||||
RCC_APB1PeriphClockCmd(RCC_APB1Periph_TIM2, ENABLE) ;
|
||||
|
||||
TIM_TimeBaseStructInit(&TIM_TimeBaseStructure);
|
||||
TIM_TimeBaseStructure.TIM_Prescaler = 60;
|
||||
TIM_TimeBaseStructure.TIM_CounterMode = TIM_CounterMode_Up;
|
||||
TIM_TimeBaseStructure.TIM_Period = 0xffffffff;
|
||||
TIM_TimeBaseStructure.TIM_ClockDivision = 0;
|
||||
TIM_TimeBaseStructure.TIM_RepetitionCounter = 0;
|
||||
|
||||
TIM_TimeBaseInit(TIM2, &TIM_TimeBaseStructure);
|
||||
|
||||
TIM_TimeBaseInit(TIM2, &TIM_TimeBaseStructure) ;
|
||||
TIM_Cmd(TIM2, ENABLE) ;
|
||||
}
|
||||
|
||||
void init_time(void) {
|
||||
init_RTC() ;
|
||||
init_TIM() ;
|
||||
}
|
||||
|
||||
struct tm *Cyassl_MDK_gmtime(const time_t *c)
|
||||
{
|
||||
|
||||
RTC_TimeTypeDef RTC_Time ;
|
||||
RTC_DateTypeDef RTC_Date ;
|
||||
static struct tm date ;
|
||||
|
||||
RTC_GetTime(RTC_Format_BIN, &RTC_Time) ;
|
||||
RTC_GetDate(RTC_Format_BIN, &RTC_Date) ;
|
||||
|
||||
date.tm_year = RTC_Date.RTC_Year + 100 ;
|
||||
date.tm_mon = RTC_Date.RTC_Month - 1 ;
|
||||
date.tm_mday = RTC_Date.RTC_Date ;
|
||||
date.tm_hour = RTC_Time.RTC_Hours ;
|
||||
date.tm_min = RTC_Time.RTC_Minutes ;
|
||||
date.tm_sec = RTC_Time.RTC_Seconds ;
|
||||
|
||||
#if defined(DEBUG_CYASSL)
|
||||
{
|
||||
char msg[100] ;
|
||||
sprintf(msg, "Debug::Cyassl_KEIL_gmtime(DATE=/%4d/%02d/%02d TIME=%02d:%02d:%02d)\n",
|
||||
RTC_Date.RTC_Year+2000, RTC_Date.RTC_Month, RTC_Date.RTC_Date,
|
||||
RTC_Time.RTC_Hours, RTC_Time.RTC_Minutes, RTC_Time.RTC_Seconds) ;
|
||||
CYASSL_MSG(msg) ;
|
||||
}
|
||||
#endif
|
||||
|
||||
return(&date) ;
|
||||
}
|
||||
|
||||
double current_time()
|
||||
{
|
||||
return ((double)TIM2->CNT/1000000.0) ;
|
||||
}
|
||||
|
||||
typedef struct func_args {
|
||||
int argc;
|
||||
char** argv;
|
||||
int return_code;
|
||||
} func_args;
|
||||
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
void time_main(void *args)
|
||||
{
|
||||
char * datetime ;
|
||||
RTC_TimeTypeDef RTC_Time ;
|
||||
RTC_DateTypeDef RTC_Date ;
|
||||
int year ;
|
||||
if( args == NULL || ((func_args *)args)->argc == 1) {
|
||||
RTC_GetTime(RTC_Format_BIN, &RTC_Time) ;
|
||||
RTC_GetDate(RTC_Format_BIN, &RTC_Date) ;
|
||||
printf("Date: %d/%d/%d, Time: %02d:%02d:%02d\n",
|
||||
RTC_Date.RTC_Month, RTC_Date.RTC_Date, RTC_Date.RTC_Year+2000,
|
||||
RTC_Time.RTC_Hours, RTC_Time.RTC_Minutes, RTC_Time.RTC_Seconds) ;
|
||||
} else if(((func_args *)args)->argc == 3 &&
|
||||
((func_args *)args)->argv[1][0] == '-' &&
|
||||
((func_args *)args)->argv[1][1] == 'd' ) {
|
||||
datetime = ((func_args *)args)->argv[2];
|
||||
sscanf(datetime, "%d/%d/%d",
|
||||
(int *)&RTC_Date.RTC_Month, (int *)&RTC_Date.RTC_Date, &year) ;
|
||||
RTC_Date.RTC_Year = year - 2000 ;
|
||||
RTC_Date.RTC_WeekDay = 0 ;
|
||||
RTC_SetDate(RTC_Format_BIN, &RTC_Date) ;
|
||||
} else if(((func_args *)args)->argc == 3 &&
|
||||
((func_args *)args)->argv[1][0] == '-' &&
|
||||
((func_args *)args)->argv[1][1] == 't' ) {
|
||||
datetime = ((func_args *)args)->argv[2];
|
||||
sscanf(datetime, "%d:%d:%d",
|
||||
(int *)&RTC_Time.RTC_Hours,
|
||||
(int *)&RTC_Time.RTC_Minutes,
|
||||
(int *)&RTC_Time.RTC_Seconds
|
||||
) ;
|
||||
RTC_SetTime(RTC_Format_BIN, &RTC_Time) ;
|
||||
} else printf("Invalid argument\n") ;
|
||||
}
|
||||
|
||||
|
78
Makefile.am
78
Makefile.am
@ -15,34 +15,38 @@ check_PROGRAMS =
|
||||
EXTRA_HEADERS =
|
||||
BUILT_SOURCES=
|
||||
EXTRA_DIST=
|
||||
doc_DATA=
|
||||
dist_doc_DATA=
|
||||
|
||||
exampledir = $(docdir)/@PACKAGE@/example
|
||||
example_DATA=
|
||||
EXTRA_DIST+= $(example_DATA)
|
||||
#includes additional rules from aminclude.am
|
||||
@INC_AMINCLUDE@
|
||||
DISTCLEANFILES+= aminclude.am
|
||||
|
||||
certsdir = $(sysconfdir)/ssl/certs
|
||||
certs_DATA=
|
||||
EXTRA_DIST+= $(certs_DATA)
|
||||
exampledir = $(docdir)/example
|
||||
dist_example_DATA=
|
||||
|
||||
EXTRA_DIST+= $(doc_DATA)
|
||||
|
||||
ACLOCAL_AMFLAGS= -I m4 --install
|
||||
ACLOCAL_AMFLAGS= -I m4
|
||||
|
||||
EXTRA_DIST+= lib/dummy
|
||||
|
||||
EXTRA_DIST+= cyassl-ntru.vcproj
|
||||
EXTRA_DIST+= cyassl.vcproj
|
||||
EXTRA_DIST+= cyassl-iphone.xcodeproj/project.pbxproj
|
||||
EXTRA_DIST+= cyassl-ios.xcodeproj/project.pbxproj
|
||||
EXTRA_DIST+= cyassl-ntru.sln
|
||||
EXTRA_DIST+= cyassl.sln
|
||||
EXTRA_DIST+= valgrind-error.sh
|
||||
EXTRA_DIST+= gencertbuf.pl
|
||||
EXTRA_DIST+= IDE
|
||||
|
||||
include cyassl/include.am
|
||||
include certs/include.am
|
||||
include certs/1024/include.am
|
||||
include certs/crl/include.am
|
||||
include doc/include.am
|
||||
include swig/include.am
|
||||
|
||||
include src/include.am
|
||||
include support/include.am
|
||||
include ctaocrypt/benchmark/include.am
|
||||
include ctaocrypt/src/include.am
|
||||
include ctaocrypt/test/include.am
|
||||
@ -53,10 +57,55 @@ include examples/echoserver/include.am
|
||||
include testsuite/include.am
|
||||
include tests/include.am
|
||||
include sslSniffer/sslSnifferTest/include.am
|
||||
include rpm/include.am
|
||||
include mqx/ctaocrypt_test/Sources/include.am
|
||||
include mqx/cyassl/include.am
|
||||
include mqx/cyassl_client/Sources/include.am
|
||||
include mqx/util_lib/Sources/include.am
|
||||
include mplabx/ctaocrypt_benchmark.X/nbproject/include.am
|
||||
include mplabx/ctaocrypt_test.X/nbproject/include.am
|
||||
include mplabx/cyassl.X/nbproject/include.am
|
||||
include mcapi/include.am
|
||||
include mcapi/ctaocrypt_mcapi.X/nbproject/include.am
|
||||
include mcapi/ctaocrypt_test.X/nbproject/include.am
|
||||
include mcapi/cyassl.X/nbproject/include.am
|
||||
include mcapi/zlib.X/nbproject/include.am
|
||||
|
||||
if USE_VALGRIND
|
||||
TESTS_ENVIRONMENT=./valgrind-error.sh
|
||||
endif
|
||||
|
||||
TESTS += $(check_PROGRAMS)
|
||||
test: check
|
||||
|
||||
DISTCLEANFILES+= cyassl-config
|
||||
|
||||
maintainer-clean-local:
|
||||
-rm Makefile.in
|
||||
-rm aclocal.m4
|
||||
-rm build-aux/compile
|
||||
-rm build-aux/config.guess
|
||||
-rm build-aux/config.sub
|
||||
-rm build-aux/depcomp
|
||||
-rm build-aux/install-sh
|
||||
-rm build-aux/ltmain.sh
|
||||
-rm build-aux/missing
|
||||
-rm cyassl-config
|
||||
-rmdir build-aux
|
||||
-rm configure
|
||||
-rm config.log
|
||||
-rm config.status
|
||||
-rm config.in
|
||||
-rm m4/libtool.m4
|
||||
-rm m4/ltoptions.m4
|
||||
-rm m4/ltsugar.m4
|
||||
-rm m4/ltversion.m4
|
||||
-rm m4/lt~obsolete.m4
|
||||
-rm support/cyassl.pc
|
||||
find . -type f -name '*~' -exec rm -f '{}' \;
|
||||
-rm -f @PACKAGE@-*.tar.gz
|
||||
-rm -f @PACKAGE@-*.rpm
|
||||
|
||||
# !!!! first line of rule has to start with a hard (real) tab, not spaces
|
||||
egs:
|
||||
$(MAKE) examples/client/client; \
|
||||
@ -68,6 +117,15 @@ ctc:
|
||||
$(MAKE) ctaocrypt/test/testctaocrypt; \
|
||||
$(MAKE) ctaocrypt/benchmark/benchmark;
|
||||
|
||||
install-exec-local: install-generic-config
|
||||
|
||||
install-generic-config:
|
||||
$(mkinstalldirs) $(DESTDIR)$(bindir)
|
||||
$(INSTALL_SCRIPT) @GENERIC_CONFIG@ $(DESTDIR)$(bindir)
|
||||
|
||||
uninstall-local:
|
||||
-rm -f $(DESTDIR)$(bindir)/@GENERIC_CONFIG@
|
||||
|
||||
merge-clean:
|
||||
@find ./ | $(GREP) \.gcda | xargs rm -f
|
||||
@find ./ | $(GREP) \.gcno | xargs rm -f
|
||||
|
225
README
225
README
@ -12,7 +12,7 @@ harder. Now to run testsuite just do:
|
||||
|
||||
or
|
||||
|
||||
make test (when using autoconf)
|
||||
make check (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
|
||||
@ -32,9 +32,224 @@ SSL_CTX_set_verify(ctx, SSL_VERIFY_NONE, 0);
|
||||
|
||||
before calling SSL_new(); Though it's not recommended.
|
||||
|
||||
*** end Note ***
|
||||
*** end Notes ***
|
||||
|
||||
CyaSSL Release 2.0.8 (2/24/2012)
|
||||
|
||||
CyaSSL Release 2.7.0 (6/17/2013)
|
||||
|
||||
Release 2.7.0 CyaSSL has bug fixes and new features including:
|
||||
- SNI support for client and server
|
||||
- KEIL MDK-ARM projects
|
||||
- Wildcard check to domain name match, and Subject altnames are checked too
|
||||
- Better error messages for certificate verification errors
|
||||
- Ability to discard session during handshake verify
|
||||
- More consistent error returns across all APIs
|
||||
- Ability to unload CAs at the CTX or CertManager level
|
||||
- Authority subject id support for Certificate matching
|
||||
- Persistent session cache functionality
|
||||
- Persistent CA cache functionality
|
||||
- Client session table lookups to push serverID table to library level
|
||||
- Camellia support to sniffer
|
||||
- User controllable settings for DTLS timeout values
|
||||
- Sniffer fixes for caching long lived sessions
|
||||
- DTLS reliability enhancements for the handshake
|
||||
- Better ThreadX support
|
||||
|
||||
When compiling with Mingw, libtool may give the following warning due to
|
||||
path conversion errors:
|
||||
|
||||
libtool: link: Could not determine host file name corresponding to **
|
||||
libtool: link: Continuing, but uninstalled executables may not work.
|
||||
|
||||
If so, examples and testsuite will have problems when run, showing an
|
||||
error while loading shared libraries. To resolve, please run "make install".
|
||||
|
||||
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.6.0 (04/15/2013)
|
||||
|
||||
Release 2.6.0 CyaSSL has bug fixes and new features including:
|
||||
- DTLS 1.2 support including AEAD ciphers
|
||||
- SHA-3 finalist Blake2 support, it's fast and uses little resources
|
||||
- SHA-384 cipher suites including ECC ones
|
||||
- HMAC now supports SHA-512
|
||||
- Track memory use for example client/server with -t option
|
||||
- Better IPv6 examples with --enable-ipv6, before if ipv6 examples/tests were
|
||||
turned on, localhost only was used. Now link-local (with scope ids) and ipv6
|
||||
hosts can be used as well.
|
||||
- Xcode v4.6 project for iOS v6.1 update
|
||||
- settings.h is now checked in all *.c files for true one file setting detection
|
||||
- Better alignment at SSL layer for hardware crypto alignment needs
|
||||
* Note, SSL itself isn't friendly to alignment with 5 byte TLS headers and
|
||||
13 bytes DTLS headers, but every effort is now made to align with the
|
||||
CYASSL_GENERAL_ALIGNMENT flag which sets desired alignment requirement
|
||||
- NO_64BIT flag to turn off 64bit data type accumulators in public key code
|
||||
* Note, some systems are faster with 32bit accumulators
|
||||
- --enable-stacksize for example client/server stack use
|
||||
* Note, modern desktop Operating Systems may add bytes to each stack frame
|
||||
- Updated compression/decompression with direct crypto access
|
||||
- All ./configure options are now lowercase only for consistency
|
||||
- ./configure builds default to fastmath option
|
||||
* Note, if on ia32 and building in shared mode this may produce a problem
|
||||
with a missing register being available because of PIC, there are at least
|
||||
5 solutions to this:
|
||||
1) --disable-fastmath , don't use fastmath
|
||||
2) --disable-shared, don't build a shared library
|
||||
3) C_EXTRA_FLAGS=-DTFM_NO_ASM , turn off assembly use
|
||||
4) use clang, it just seems to work
|
||||
5) play around with no PIC options to force all registers being open
|
||||
- Many new ./configure switches for option enable/disable for example
|
||||
* rsa
|
||||
* dh
|
||||
* dsa
|
||||
* md5
|
||||
* sha
|
||||
* arc4
|
||||
* null (allow NULL ciphers)
|
||||
* oldtls (only use TLS 1.2)
|
||||
* asn (no certs or public keys allowed)
|
||||
- ./configure generates cyassl/options.h which allows a header the user can
|
||||
include in their app to make sure the same options are set at the app and
|
||||
CyaSSL level.
|
||||
- autoconf no longer needs serial-tests which lowers version requirements of
|
||||
automake to 1.11 and autoconf to 2.63
|
||||
|
||||
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.5.0 (02/04/2013)
|
||||
|
||||
Release 2.5.0 CyaSSL has bug fixes and new features including:
|
||||
- Fix for TLS CBC padding timing attack identified by Nadhem Alfardan and
|
||||
Kenny Paterson: http://www.isg.rhul.ac.uk/tls/
|
||||
- Microchip PIC32 (MIPS16, MIPS32) support
|
||||
- Microchip MPLAB X example projects for PIC32 Ethernet Starter Kit
|
||||
- Updated CTaoCrypt benchmark app for embedded systems
|
||||
- 1024-bit test certs/keys and cert/key buffers
|
||||
- AES-CCM-8 crypto and cipher suites
|
||||
- Camellia crypto and cipher suites
|
||||
- Bumped minimum autoconf version to 2.65, automake version to 1.12
|
||||
- Addition of OCSP callbacks
|
||||
- STM32F2 support with hardware crypto and RNG
|
||||
- Cavium NITROX support
|
||||
|
||||
CTaoCrypt now has support for the Microchip PIC32 and has been tested with
|
||||
the Microchip PIC32 Ethernet Starter Kit, the XC32 compiler and
|
||||
MPLAB X IDE in both MIPS16 and MIPS32 instruction set modes. See the README
|
||||
located under the <cyassl_root>/mplabx directory for more details.
|
||||
|
||||
To add Cavium NITROX support do:
|
||||
|
||||
./configure --with-cavium=/home/user/cavium/software
|
||||
|
||||
pointing to your licensed cavium/software directory. Since Cavium doesn't
|
||||
build a library we pull in the cavium_common.o file which gives a libtool
|
||||
warning about the portability of this. Also, if you're using the github source
|
||||
tree you'll need to remove the -Wredundant-decls warning from the generated
|
||||
Makefile because the cavium headers don't conform to this warning. Currently
|
||||
CyaSSL supports Cavium RNG, AES, 3DES, RC4, HMAC, and RSA directly at the crypto
|
||||
layer. Support at the SSL level is partial and currently just does AES, 3DES,
|
||||
and RC4. RSA and HMAC are slower until the Cavium calls can be utilized in non
|
||||
blocking mode. The example client turns on cavium support as does the crypto
|
||||
test and benchmark. Please see the HAVE_CAVIUM define.
|
||||
|
||||
CyaSSL is able to use the STM32F2 hardware-based cryptography and random number
|
||||
generator through the STM32F2 Standard Peripheral Library. For necessary
|
||||
defines, see the CYASSL_STM32F2 define in settings.h. Documentation for the
|
||||
STM32F2 Standard Peripheral Library can be found in the following document:
|
||||
http://www.st.com/internet/com/TECHNICAL_RESOURCES/TECHNICAL_LITERATURE/USER_MANUAL/DM00023896.pdf
|
||||
|
||||
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.4.6 (12/20/2012)
|
||||
|
||||
Release 2.4.6 CyaSSL has bug fixes and a few new features including:
|
||||
- ECC into main version
|
||||
- Lean PSK build (reduced code size, RAM usage, and stack usage)
|
||||
- FreeBSD CRL monitor support
|
||||
- CyaSSL_peek()
|
||||
- CyaSSL_send() and CyaSSL_recv() for I/O flag setting
|
||||
- CodeWarrior Support
|
||||
- MQX Support
|
||||
- Freescale Kinetis support including Hardware RNG
|
||||
- autoconf builds use jobserver
|
||||
- cyassl-config
|
||||
- Sniffer memory reductions
|
||||
|
||||
Thanks to Brian Aker for the improved autoconf system, make rpm, cyassl-config,
|
||||
warning system, and general good ideas for improving CyaSSL!
|
||||
|
||||
The Freescale Kinetis K70 RNGA documentation can be found in Chapter 37 of the
|
||||
K70 Sub-Family Reference Manual:
|
||||
http://cache.freescale.com/files/microcontrollers/doc/ref_manual/K70P256M150SF3RM.pdf
|
||||
|
||||
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.4.0 (10/10/2012)
|
||||
|
||||
Release 2.4.0 CyaSSL has bug fixes and a few new features including:
|
||||
- DTLS reliability
|
||||
- Reduced memory usage after handshake
|
||||
- Updated build process
|
||||
|
||||
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.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)
|
||||
@ -96,7 +311,7 @@ Release 2.0.0rc3 for CyaSSL has bug fixes and a few new features including:
|
||||
- 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
|
||||
- examples and tests all run from home directory so can use certs in ./certs
|
||||
(see note 1)
|
||||
|
||||
So previous applications that used the OpenSSL compatibility header
|
||||
@ -118,7 +333,7 @@ Release 2.0.0rc2 for CyaSSL has bug fixes and a few new features including:
|
||||
- Wshadow warnings removed
|
||||
- asn public header
|
||||
- CTaoCrypt public headers now all have ctc_ prefix (the manual is still being
|
||||
updated to relfect this change)
|
||||
updated to reflect this change)
|
||||
- and more.
|
||||
|
||||
This is the 2nd and perhaps final release candidate for version 2.
|
||||
|
12
autogen.sh
12
autogen.sh
@ -3,4 +3,14 @@
|
||||
# Create configure and makefile stuff...
|
||||
#
|
||||
|
||||
autoreconf -ivf -Wall
|
||||
if test -d .git; then
|
||||
WARNINGS="all,error"
|
||||
else
|
||||
WARNINGS="all"
|
||||
fi
|
||||
|
||||
autoreconf --install --force --verbose
|
||||
|
||||
if test -d .git; then
|
||||
ln -s -f ../../pre-commit.sh .git/hooks/pre-commit
|
||||
fi
|
||||
|
BIN
certs/1024/client-cert.der
Normal file
BIN
certs/1024/client-cert.der
Normal file
Binary file not shown.
59
certs/1024/client-cert.pem
Normal file
59
certs/1024/client-cert.pem
Normal file
@ -0,0 +1,59 @@
|
||||
Certificate:
|
||||
Data:
|
||||
Version: 3 (0x2)
|
||||
Serial Number: 10163970144298616102 (0x8d0dacfec6984526)
|
||||
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: Jan 18 21:42:49 2013 GMT
|
||||
Not After : Oct 15 21:42:49 2015 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
|
||||
Public-Key: (1024 bit)
|
||||
Modulus:
|
||||
00:bc:73:0e:a8:49:f3:74:a2:a9:ef:18:a5:da:55:
|
||||
99:21:f9:c8:ec:b3:6d:48:e5:35:35:75:77:37:ec:
|
||||
d1:61:90:5f:3e:d9:e4:d5:df:94:ca:c1:a9:d7:19:
|
||||
da:86:c9:e8:4d:c4:61:36:82:fe:ab:ad:7e:77:25:
|
||||
bb:8d:11:a5:bc:62:3a:a8:38:cc:39:a2:04:66:b4:
|
||||
f7:f7:f3:aa:da:4d:02:0e:bb:5e:8d:69:48:dc:77:
|
||||
c9:28:0e:22:e9:6b:a4:26:ba:4c:e8:c1:fd:4a:6f:
|
||||
2b:1f:ef:8a:ae:f6:90:62:e5:64:1e:eb:2b:3c:67:
|
||||
c8:dc:27:00:f6:91:68:65:a9
|
||||
Exponent: 65537 (0x10001)
|
||||
X509v3 extensions:
|
||||
X509v3 Subject Key Identifier:
|
||||
81:69:0F:F8:DF:DD:CF:34:29:D5:67:75:71:85:C7:75:10:69:59:EC
|
||||
X509v3 Authority Key Identifier:
|
||||
keyid:81:69:0F:F8:DF:DD:CF:34:29:D5:67:75:71:85:C7:75:10:69:59:EC
|
||||
|
||||
X509v3 Basic Constraints:
|
||||
CA:TRUE
|
||||
Signature Algorithm: sha1WithRSAEncryption
|
||||
72:66:0f:6a:a1:85:95:06:e6:87:1a:ed:2b:da:ed:84:90:89:
|
||||
a6:31:4d:60:f2:7b:63:0c:dc:9b:44:4c:d6:62:41:24:74:30:
|
||||
70:4e:07:10:05:12:5e:14:b3:dd:cf:58:27:93:cf:aa:4f:85:
|
||||
2c:35:0e:ff:5b:a8:6b:b5:95:32:d5:cc:73:68:5b:1b:c4:f8:
|
||||
89:5e:3d:f8:02:39:32:7d:06:a4:32:e9:b3:ef:62:a0:43:5d:
|
||||
4f:fb:ce:3d:08:33:af:3d:7f:12:cb:8a:5a:c2:63:db:3e:dd:
|
||||
ea:5b:67:10:49:9f:5b:96:1b:4e:5d:bc:4e:9a:7c:1f:ab:56:
|
||||
47:4a
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIIC7DCCAlWgAwIBAgIJAI0NrP7GmEUmMA0GCSqGSIb3DQEBBQUAMIGOMQswCQYD
|
||||
VQQGEwJVUzEPMA0GA1UECAwGT3JlZ29uMREwDwYDVQQHDAhQb3J0bGFuZDEOMAwG
|
||||
A1UECgwFeWFTU0wxFDASBgNVBAsMC1Byb2dyYW1taW5nMRYwFAYDVQQDDA13d3cu
|
||||
eWFzc2wuY29tMR0wGwYJKoZIhvcNAQkBFg5pbmZvQHlhc3NsLmNvbTAeFw0xMzAx
|
||||
MTgyMTQyNDlaFw0xNTEwMTUyMTQyNDlaMIGOMQswCQYDVQQGEwJVUzEPMA0GA1UE
|
||||
CAwGT3JlZ29uMREwDwYDVQQHDAhQb3J0bGFuZDEOMAwGA1UECgwFeWFTU0wxFDAS
|
||||
BgNVBAsMC1Byb2dyYW1taW5nMRYwFAYDVQQDDA13d3cueWFzc2wuY29tMR0wGwYJ
|
||||
KoZIhvcNAQkBFg5pbmZvQHlhc3NsLmNvbTCBnzANBgkqhkiG9w0BAQEFAAOBjQAw
|
||||
gYkCgYEAvHMOqEnzdKKp7xil2lWZIfnI7LNtSOU1NXV3N+zRYZBfPtnk1d+UysGp
|
||||
1xnahsnoTcRhNoL+q61+dyW7jRGlvGI6qDjMOaIEZrT39/Oq2k0CDrtejWlI3HfJ
|
||||
KA4i6WukJrpM6MH9Sm8rH++KrvaQYuVkHusrPGfI3CcA9pFoZakCAwEAAaNQME4w
|
||||
HQYDVR0OBBYEFIFpD/jf3c80KdVndXGFx3UQaVnsMB8GA1UdIwQYMBaAFIFpD/jf
|
||||
3c80KdVndXGFx3UQaVnsMAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEFBQADgYEA
|
||||
cmYPaqGFlQbmhxrtK9rthJCJpjFNYPJ7Ywzcm0RM1mJBJHQwcE4HEAUSXhSz3c9Y
|
||||
J5PPqk+FLDUO/1uoa7WVMtXMc2hbG8T4iV49+AI5Mn0GpDLps+9ioENdT/vOPQgz
|
||||
rz1/EsuKWsJj2z7d6ltnEEmfW5YbTl28Tpp8H6tWR0o=
|
||||
-----END CERTIFICATE-----
|
BIN
certs/1024/client-key.der
Normal file
BIN
certs/1024/client-key.der
Normal file
Binary file not shown.
15
certs/1024/client-key.pem
Normal file
15
certs/1024/client-key.pem
Normal file
@ -0,0 +1,15 @@
|
||||
-----BEGIN RSA PRIVATE KEY-----
|
||||
MIICXAIBAAKBgQC8cw6oSfN0oqnvGKXaVZkh+cjss21I5TU1dXc37NFhkF8+2eTV
|
||||
35TKwanXGdqGyehNxGE2gv6rrX53JbuNEaW8YjqoOMw5ogRmtPf386raTQIOu16N
|
||||
aUjcd8koDiLpa6Qmukzowf1Kbysf74qu9pBi5WQe6ys8Z8jcJwD2kWhlqQIDAQAB
|
||||
AoGAE5fq6Dh4JaJcBM4NQHwx5cRwzZuCO1gJhjtmX9wxkPFP1dsV3d7XO5WTMRgx
|
||||
Dl6j1qIacW6BSBxLz9uOeoZhMtz7VcEWbSeSJEWL8bhIsUsdrN7a3Y4vwpH7palu
|
||||
+Dpq8f1QGO+f58PKeOpW09NyW5bdTgZOOsPZvnK2ZQcHTAECQQD6R9R6fJI8Ve+B
|
||||
8EEwLaPPjxzmhycFcA3fmDXW8Ys4LyS10IS2eU9xKZRa8GRqrOdyxu1NWZg+Zzrz
|
||||
dCz5YRdpAkEAwMGCDQzrxi/ckvmdghox6en3S/KChxzuFmrRHRiCcPPAti/28/cd
|
||||
8YYjyE7rj1aOj/W/8fcrtcw9xlc5DBtUQQJBAJ1+Bd7t9Ley+/wwS1Ud4y8BR5Zp
|
||||
Bc0OLiy9g2O2q3y3bcpbZKfOvobfO1PeYdIe66X2N+2sq3jZTOdV+9cRmcECQBiY
|
||||
GCnmHic5cCForAovoXLBIYaVOMZYkKBXnLrjp7EVyN72G8JhI3bvsJ0cRL4TQzln
|
||||
F8idyvv1RWSLOIIs8oECQDmJ5ZwZVTC6t0iMSBQO9J9+d5dD4bQZNTEjdZw7RK1p
|
||||
ElbuAGFkFmbTfHQrFbSi/r8IaxpdP5ASsQWGMSnb2eI=
|
||||
-----END RSA PRIVATE KEY-----
|
BIN
certs/1024/dh1024.der
Normal file
BIN
certs/1024/dh1024.der
Normal file
Binary file not shown.
17
certs/1024/dh1024.pem
Normal file
17
certs/1024/dh1024.pem
Normal file
@ -0,0 +1,17 @@
|
||||
PKCS#3 DH Parameters: (1024 bit)
|
||||
prime:
|
||||
00:a4:d2:b8:6e:78:f5:d9:ed:2d:7c:dd:b6:16:86:
|
||||
5a:4b:05:76:90:dd:66:61:b9:6d:52:a7:1c:af:62:
|
||||
c6:69:47:7b:39:f2:fb:94:ec:bc:79:ff:24:5e:ef:
|
||||
79:bb:59:b2:fc:ca:07:d6:f4:e9:34:f7:e8:38:e7:
|
||||
d7:33:44:1d:a3:64:76:1a:84:97:54:74:40:84:1f:
|
||||
15:fe:7c:25:2a:2b:25:fd:9e:c1:89:33:8c:39:25:
|
||||
2b:40:e6:cd:f8:a8:a1:8a:53:c6:47:b2:a0:d7:8f:
|
||||
eb:2e:60:0a:0d:4b:f8:b4:94:8c:63:0a:ad:c7:10:
|
||||
ea:c7:a1:b9:9d:f2:a8:37:73
|
||||
generator: 2 (0x2)
|
||||
-----BEGIN DH PARAMETERS-----
|
||||
MIGHAoGBAKTSuG549dntLXzdthaGWksFdpDdZmG5bVKnHK9ixmlHezny+5TsvHn/
|
||||
JF7vebtZsvzKB9b06TT36Djn1zNEHaNkdhqEl1R0QIQfFf58JSorJf2ewYkzjDkl
|
||||
K0DmzfiooYpTxkeyoNeP6y5gCg1L+LSUjGMKrccQ6sehuZ3yqDdzAgEC
|
||||
-----END DH PARAMETERS-----
|
BIN
certs/1024/dsa1024.der
Normal file
BIN
certs/1024/dsa1024.der
Normal file
Binary file not shown.
12
certs/1024/dsa1024.pem
Normal file
12
certs/1024/dsa1024.pem
Normal file
@ -0,0 +1,12 @@
|
||||
-----BEGIN DSA PRIVATE KEY-----
|
||||
MIIBvAIBAAKBgQD3S/m7FZjr3d4eTnGIhfK3uuJK2nZAzWlInoN8EfdlMXj1JS33
|
||||
t/hSP77YtsX+GBVbudWShryyF3zYsL6gfPLVc3pYj43lSgCZg0rAnhYJoRA01Rm7
|
||||
Y+Pdg3R/EMpzde4xSt2f4AJqne6yS6drKmzHhnfoBBXckrR6KR9Og2OFVQIVANIF
|
||||
5HP7wZnF3GikjZInPeJSX4mLAoGBAKohAglDbvuiVBSFCvQofMvM2/UeohipId6I
|
||||
iDOMLuuNo/AdyI/2fvjPEvW0oRFvDNTwBq3E/BRFx5QVvBlLru+Tak/MFNhHizlm
|
||||
hwLUKAq47gk39ACgBKd5p9I89zRDVo7QfMLYTQ+J7RTBLJxMGZue3FMJn98t8Awn
|
||||
VDp3FC3eAoGBAOgffLfAVFGnKC1YfN7UXN3VdoQ8NiDAwyXXOjjhVMj9QGgaIVQm
|
||||
ORS/9qOcXtkr98klugAJy38MSiT9FRYVSM0LUkRAe5BjK5AixRgFgFOvgx9U4rCi
|
||||
C1qSJOFiKD+3yrmJ1qC3ra4F4cFZQO1KG2ine/vDIIHvS/NpkbDOOrA4AhQlODuh
|
||||
GXXfm/VyU0854RzsE4SCGA==
|
||||
-----END DSA PRIVATE KEY-----
|
17
certs/1024/include.am
Normal file
17
certs/1024/include.am
Normal file
@ -0,0 +1,17 @@
|
||||
# vim:ft=automake
|
||||
# All paths should be given relative to the root
|
||||
#
|
||||
|
||||
EXTRA_DIST += \
|
||||
certs/1024/client-cert.pem \
|
||||
certs/1024/client-key.pem \
|
||||
certs/1024/dh1024.pem \
|
||||
certs/1024/dsa1024.pem
|
||||
|
||||
EXTRA_DIST += \
|
||||
certs/1024/client-cert.der \
|
||||
certs/1024/client-key.der \
|
||||
certs/1024/dh1024.der \
|
||||
certs/1024/dsa1024.der \
|
||||
certs/1024/rsa1024.der
|
||||
|
BIN
certs/1024/rsa1024.der
Normal file
BIN
certs/1024/rsa1024.der
Normal file
Binary file not shown.
@ -1,3 +1,30 @@
|
||||
-----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-----
|
||||
Certificate:
|
||||
Data:
|
||||
Version: 3 (0x2)
|
||||
@ -58,30 +85,3 @@ Certificate:
|
||||
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-----
|
||||
|
39
certs/crl/cliCrl.pem
Normal file
39
certs/crl/cliCrl.pem
Normal file
@ -0,0 +1,39 @@
|
||||
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: Jun 17 21:32:30 2013 GMT
|
||||
Next Update: Dec 14 21:32:30 2013 GMT
|
||||
CRL extensions:
|
||||
X509v3 CRL Number:
|
||||
87
|
||||
No Revoked Certificates.
|
||||
Signature Algorithm: sha1WithRSAEncryption
|
||||
0f:16:d2:d6:62:f8:c0:db:b2:2c:de:9d:0a:10:72:0e:85:6e:
|
||||
25:1d:38:20:1b:d5:66:d9:d3:9e:0e:a6:9e:e8:60:20:1c:b5:
|
||||
c9:ab:09:c3:a5:d5:c3:91:a3:9a:ff:44:40:68:da:7b:da:4a:
|
||||
3c:15:17:89:0a:49:b9:af:b2:ac:f0:e2:b5:0e:4d:c0:22:d7:
|
||||
5e:c1:02:9e:f3:95:20:62:7c:88:d9:32:97:12:04:1a:6f:8c:
|
||||
d8:7b:9f:0c:1e:91:fe:98:52:17:de:f2:ee:7c:66:e7:db:91:
|
||||
99:7a:f7:09:c9:15:16:3d:a2:1c:13:af:ad:e0:70:b8:6b:e5:
|
||||
dc:8e:f8:b5:ec:ff:f7:88:1b:ce:46:eb:22:ff:10:2f:ea:53:
|
||||
f0:86:62:1a:ab:6f:4d:05:45:e8:5c:ba:b5:8d:0d:38:72:cd:
|
||||
df:a1:74:31:bb:ad:68:7d:56:be:d8:7e:7a:f5:ef:52:be:14:
|
||||
5c:6d:ed:b4:2a:c9:ab:97:ba:e8:93:c5:6b:79:66:c7:52:a8:
|
||||
0d:62:dc:cb:e2:4c:e6:53:f4:c3:5c:ce:47:0f:39:46:9a:cb:
|
||||
82:d9:98:7d:69:41:aa:ac:6a:7a:e9:02:c9:9b:77:59:7f:6a:
|
||||
90:54:10:8a:45:c7:49:5f:ca:be:66:6a:20:e1:cd:e8:10:09:
|
||||
30:7e:16:44
|
||||
-----BEGIN X509 CRL-----
|
||||
MIIB6DCB0QIBATANBgkqhkiG9w0BAQUFADCBjjELMAkGA1UEBhMCVVMxDzANBgNV
|
||||
BAgTBk9yZWdvbjERMA8GA1UEBxMIUG9ydGxhbmQxDjAMBgNVBAoTBXlhU1NMMRQw
|
||||
EgYDVQQLEwtQcm9ncmFtbWluZzEWMBQGA1UEAxMNd3d3Lnlhc3NsLmNvbTEdMBsG
|
||||
CSqGSIb3DQEJARYOaW5mb0B5YXNzbC5jb20XDTEzMDYxNzIxMzIzMFoXDTEzMTIx
|
||||
NDIxMzIzMFqgDjAMMAoGA1UdFAQDAgFXMA0GCSqGSIb3DQEBBQUAA4IBAQAPFtLW
|
||||
YvjA27Is3p0KEHIOhW4lHTggG9Vm2dOeDqae6GAgHLXJqwnDpdXDkaOa/0RAaNp7
|
||||
2ko8FReJCkm5r7Ks8OK1Dk3AItdewQKe85UgYnyI2TKXEgQab4zYe58MHpH+mFIX
|
||||
3vLufGbn25GZevcJyRUWPaIcE6+t4HC4a+Xcjvi17P/3iBvORusi/xAv6lPwhmIa
|
||||
q29NBUXoXLq1jQ04cs3foXQxu61ofVa+2H569e9SvhRcbe20Ksmrl7rok8VreWbH
|
||||
UqgNYtzL4kzmU/TDXM5HDzlGmsuC2Zh9aUGqrGp66QLJm3dZf2qQVBCKRcdJX8q+
|
||||
Zmog4c3oEAkwfhZE
|
||||
-----END X509 CRL-----
|
39
certs/crl/crl.pem
Normal file
39
certs/crl/crl.pem
Normal file
@ -0,0 +1,39 @@
|
||||
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: Jun 17 21:32:30 2013 GMT
|
||||
Next Update: Dec 14 21:32:30 2013 GMT
|
||||
CRL extensions:
|
||||
X509v3 CRL Number:
|
||||
85
|
||||
No Revoked Certificates.
|
||||
Signature Algorithm: sha1WithRSAEncryption
|
||||
4d:9c:63:22:02:91:fe:52:35:93:7c:b6:5b:e8:86:5a:29:a2:
|
||||
4d:9a:bc:d9:16:e0:8a:04:90:4d:ae:21:00:be:9c:81:5b:68:
|
||||
6e:90:1a:fd:1a:37:70:85:50:f2:02:87:1c:38:f4:ef:9d:41:
|
||||
f5:4f:53:66:d4:c0:22:80:00:82:7a:09:42:49:c3:1c:c9:4c:
|
||||
9f:92:f9:66:f4:21:1f:24:67:4f:83:6a:bd:3a:19:f1:04:99:
|
||||
ea:30:05:bf:a7:3d:bf:71:ac:3e:3a:ba:2a:c5:05:12:53:eb:
|
||||
5c:6f:ed:2d:4b:c0:f5:00:e1:95:45:c9:62:b5:89:66:4b:2b:
|
||||
01:fc:66:29:a3:0a:9a:05:ae:f7:9f:51:2a:9c:3b:18:03:ed:
|
||||
c4:7c:33:62:93:30:49:ab:c4:d1:07:f4:18:ac:96:24:1e:c2:
|
||||
fa:37:ed:82:db:06:66:8d:fb:25:93:35:7b:39:88:e8:8e:70:
|
||||
e9:c8:be:00:c4:f7:a7:67:83:f8:3d:af:8b:71:5b:25:3b:1d:
|
||||
56:cd:d0:15:86:31:d1:cb:57:3a:00:b5:1c:7c:3e:99:44:ce:
|
||||
bc:89:a7:78:37:50:ed:a1:b6:16:cd:72:20:c9:1f:60:b2:8a:
|
||||
c5:62:30:26:f0:aa:b6:73:ca:8e:d6:ba:31:0a:21:a2:6e:40:
|
||||
4b:66:30:11
|
||||
-----BEGIN X509 CRL-----
|
||||
MIIB6jCB0wIBATANBgkqhkiG9w0BAQUFADCBkDELMAkGA1UEBhMCVVMxEDAOBgNV
|
||||
BAgTB01vbnRhbmExEDAOBgNVBAcTB0JvemVtYW4xETAPBgNVBAoTCFNhd3Rvb3Ro
|
||||
MRMwEQYDVQQLEwpDb25zdWx0aW5nMRYwFAYDVQQDEw13d3cueWFzc2wuY29tMR0w
|
||||
GwYJKoZIhvcNAQkBFg5pbmZvQHlhc3NsLmNvbRcNMTMwNjE3MjEzMjMwWhcNMTMx
|
||||
MjE0MjEzMjMwWqAOMAwwCgYDVR0UBAMCAVUwDQYJKoZIhvcNAQEFBQADggEBAE2c
|
||||
YyICkf5SNZN8tlvohlopok2avNkW4IoEkE2uIQC+nIFbaG6QGv0aN3CFUPIChxw4
|
||||
9O+dQfVPU2bUwCKAAIJ6CUJJwxzJTJ+S+Wb0IR8kZ0+Dar06GfEEmeowBb+nPb9x
|
||||
rD46uirFBRJT61xv7S1LwPUA4ZVFyWK1iWZLKwH8ZimjCpoFrvefUSqcOxgD7cR8
|
||||
M2KTMEmrxNEH9BisliQewvo37YLbBmaN+yWTNXs5iOiOcOnIvgDE96dng/g9r4tx
|
||||
WyU7HVbN0BWGMdHLVzoAtRx8PplEzryJp3g3UO2hthbNciDJH2CyisViMCbwqrZz
|
||||
yo7WujEKIaJuQEtmMBE=
|
||||
-----END X509 CRL-----
|
41
certs/crl/crl.revoked
Normal file
41
certs/crl/crl.revoked
Normal file
@ -0,0 +1,41 @@
|
||||
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: Jun 17 21:32:30 2013 GMT
|
||||
Next Update: Dec 14 21:32:30 2013 GMT
|
||||
CRL extensions:
|
||||
X509v3 CRL Number:
|
||||
86
|
||||
Revoked Certificates:
|
||||
Serial Number: 02
|
||||
Revocation Date: Jun 17 21:32:30 2013 GMT
|
||||
Signature Algorithm: sha1WithRSAEncryption
|
||||
87:3b:bb:ac:6b:1a:e8:96:87:6f:a3:8e:39:77:28:01:a7:ea:
|
||||
76:36:c2:48:e2:41:02:3f:f3:f7:64:09:60:91:87:9e:57:74:
|
||||
38:a0:c3:20:47:7d:82:4b:2c:34:23:fe:66:dc:2b:3e:8a:a1:
|
||||
d9:e3:06:ec:75:0f:b1:ef:32:e2:28:ab:7d:40:2c:82:59:74:
|
||||
c9:95:b5:62:a6:6a:8e:34:e6:f6:f8:91:ff:aa:c1:21:93:79:
|
||||
cb:6f:dc:be:94:21:b1:c8:dd:9e:b8:fe:ad:e8:50:6e:0d:76:
|
||||
92:32:54:51:96:cd:c7:be:d2:0f:6f:63:69:5f:b3:28:c1:57:
|
||||
0e:61:f7:62:81:9f:ea:e7:a5:14:89:41:56:63:46:da:bc:d8:
|
||||
e0:78:44:c6:c7:1a:ab:1b:f1:0b:59:d5:4e:6d:14:bc:16:c2:
|
||||
02:43:06:0b:f4:16:6e:26:8c:36:09:61:0c:53:3f:72:85:64:
|
||||
33:4d:bf:70:44:c8:23:83:c3:51:98:a8:14:f7:b2:03:a1:7b:
|
||||
72:48:4d:24:d0:a8:a9:22:3d:9b:94:bf:24:24:01:6f:2e:4b:
|
||||
2b:21:24:8f:64:46:20:79:45:b3:45:1a:4f:93:10:e1:8d:04:
|
||||
4c:8d:83:63:96:9f:28:c5:37:0f:10:8e:02:9b:4d:96:8b:ea:
|
||||
a3:31:88:9f
|
||||
-----BEGIN X509 CRL-----
|
||||
MIICADCB6QIBATANBgkqhkiG9w0BAQUFADCBkDELMAkGA1UEBhMCVVMxEDAOBgNV
|
||||
BAgTB01vbnRhbmExEDAOBgNVBAcTB0JvemVtYW4xETAPBgNVBAoTCFNhd3Rvb3Ro
|
||||
MRMwEQYDVQQLEwpDb25zdWx0aW5nMRYwFAYDVQQDEw13d3cueWFzc2wuY29tMR0w
|
||||
GwYJKoZIhvcNAQkBFg5pbmZvQHlhc3NsLmNvbRcNMTMwNjE3MjEzMjMwWhcNMTMx
|
||||
MjE0MjEzMjMwWjAUMBICAQIXDTEzMDYxNzIxMzIzMFqgDjAMMAoGA1UdFAQDAgFW
|
||||
MA0GCSqGSIb3DQEBBQUAA4IBAQCHO7usaxrolodvo445dygBp+p2NsJI4kECP/P3
|
||||
ZAlgkYeeV3Q4oMMgR32CSyw0I/5m3Cs+iqHZ4wbsdQ+x7zLiKKt9QCyCWXTJlbVi
|
||||
pmqONOb2+JH/qsEhk3nLb9y+lCGxyN2euP6t6FBuDXaSMlRRls3HvtIPb2NpX7Mo
|
||||
wVcOYfdigZ/q56UUiUFWY0bavNjgeETGxxqrG/ELWdVObRS8FsICQwYL9BZuJow2
|
||||
CWEMUz9yhWQzTb9wRMgjg8NRmKgU97IDoXtySE0k0KipIj2blL8kJAFvLksrISSP
|
||||
ZEYgeUWzRRpPkxDhjQRMjYNjlp8oxTcPEI4Cm02Wi+qjMYif
|
||||
-----END X509 CRL-----
|
24
certs/crl/eccCliCRL.pem
Normal file
24
certs/crl/eccCliCRL.pem
Normal file
@ -0,0 +1,24 @@
|
||||
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: Jun 17 21:32:30 2013 GMT
|
||||
Next Update: Dec 14 21:32:30 2013 GMT
|
||||
CRL extensions:
|
||||
X509v3 CRL Number:
|
||||
88
|
||||
No Revoked Certificates.
|
||||
Signature Algorithm: ecdsa-with-SHA1
|
||||
30:45:02:21:00:eb:6e:1b:5d:f9:43:f9:67:5b:4e:d1:6d:30:
|
||||
c7:c1:57:a3:e6:25:af:87:7a:77:8d:d9:89:47:1d:a4:64:0e:
|
||||
21:02:20:11:20:49:d5:84:47:fa:12:61:46:ec:b6:db:0e:d0:
|
||||
9d:3d:95:24:4f:a3:43:ab:d0:ad:dd:d9:61:b7:49:e2:5e
|
||||
-----BEGIN X509 CRL-----
|
||||
MIIBIDCByAIBATAJBgcqhkjOPQQBMIGJMQswCQYDVQQGEwJVUzEPMA0GA1UECBMG
|
||||
T3JlZ29uMQ4wDAYDVQQHEwVTYWxlbTETMBEGA1UEChMKQ2xpZW50IEVDQzENMAsG
|
||||
A1UECxMERmFzdDEWMBQGA1UEAxMNd3d3Lnlhc3NsLmNvbTEdMBsGCSqGSIb3DQEJ
|
||||
ARYOaW5mb0B5YXNzbC5jb20XDTEzMDYxNzIxMzIzMFoXDTEzMTIxNDIxMzIzMFqg
|
||||
DjAMMAoGA1UdFAQDAgFYMAkGByqGSM49BAEDSAAwRQIhAOtuG135Q/lnW07RbTDH
|
||||
wVej5iWvh3p3jdmJRx2kZA4hAiARIEnVhEf6EmFG7LbbDtCdPZUkT6NDq9Ct3dlh
|
||||
t0niXg==
|
||||
-----END X509 CRL-----
|
24
certs/crl/eccSrvCRL.pem
Normal file
24
certs/crl/eccSrvCRL.pem
Normal file
@ -0,0 +1,24 @@
|
||||
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: Jun 17 21:32:30 2013 GMT
|
||||
Next Update: Dec 14 21:32:30 2013 GMT
|
||||
CRL extensions:
|
||||
X509v3 CRL Number:
|
||||
89
|
||||
No Revoked Certificates.
|
||||
Signature Algorithm: ecdsa-with-SHA1
|
||||
30:44:02:20:0c:78:df:c4:4b:8b:e0:70:15:4f:f6:7d:82:d6:
|
||||
0d:dd:a5:a0:e2:6a:95:4b:2b:6b:29:14:15:ba:51:0d:e3:1f:
|
||||
02:20:2b:4b:1d:7c:9d:2f:5a:01:3d:9b:c1:94:cd:10:86:fe:
|
||||
e2:9d:a0:b2:3c:97:10:ba:a6:56:43:78:b3:92:9b:0b
|
||||
-----BEGIN X509 CRL-----
|
||||
MIIBITCBygIBATAJBgcqhkjOPQQBMIGLMQswCQYDVQQGEwJVUzETMBEGA1UECBMK
|
||||
V2FzaGluZ3RvbjEQMA4GA1UEBxMHU2VhdHRsZTEQMA4GA1UEChMHRWxpcHRpYzEM
|
||||
MAoGA1UECxMDRUNDMRYwFAYDVQQDEw13d3cueWFzc2wuY29tMR0wGwYJKoZIhvcN
|
||||
AQkBFg5pbmZvQHlhc3NsLmNvbRcNMTMwNjE3MjEzMjMwWhcNMTMxMjE0MjEzMjMw
|
||||
WqAOMAwwCgYDVR0UBAMCAVkwCQYHKoZIzj0EAQNHADBEAiAMeN/ES4vgcBVP9n2C
|
||||
1g3dpaDiapVLK2spFBW6UQ3jHwIgK0sdfJ0vWgE9m8GUzRCG/uKdoLI8lxC6plZD
|
||||
eLOSmws=
|
||||
-----END X509 CRL-----
|
57
certs/crl/gencrls.sh
Executable file
57
certs/crl/gencrls.sh
Executable file
@ -0,0 +1,57 @@
|
||||
#!/bin/bash
|
||||
|
||||
# gencrls, crl config already done, see taoCerts.txt for setup
|
||||
|
||||
|
||||
|
||||
# caCrl
|
||||
openssl ca -gencrl -crldays 180 -out crl.pem -keyfile ~/cyassl/certs/ca-key.pem -cert ~/cyassl/certs/ca-cert.pem
|
||||
|
||||
# metadata
|
||||
openssl crl -in crl.pem -text > tmp
|
||||
mv tmp crl.pem
|
||||
# install
|
||||
cp crl.pem ~/cyassl/certs/crl/crl.pem
|
||||
|
||||
# caCrl server revoked
|
||||
openssl ca -revoke ~/cyassl/certs/server-cert.pem -keyfile ~/cyassl/certs/ca-key.pem -cert ~/cyassl/certs/ca-cert.pem
|
||||
|
||||
# caCrl server revoked generation
|
||||
openssl ca -gencrl -crldays 180 -out crl.revoked -keyfile ~/cyassl/certs/ca-key.pem -cert ~/cyassl/certs/ca-cert.pem
|
||||
|
||||
# metadata
|
||||
openssl crl -in crl.revoked -text > tmp
|
||||
mv tmp crl.revoked
|
||||
# install
|
||||
cp crl.revoked ~/cyassl/certs/crl/crl.revoked
|
||||
|
||||
# remove revoked so next time through the normal CA won't have server revoked
|
||||
cp blank.index.txt demoCA/index.txt
|
||||
|
||||
# cliCrl
|
||||
openssl ca -gencrl -crldays 180 -out cliCrl.pem -keyfile ~/cyassl/certs/client-key.pem -cert ~/cyassl/certs/client-cert.pem
|
||||
|
||||
# metadata
|
||||
openssl crl -in cliCrl.pem -text > tmp
|
||||
mv tmp cliCrl.pem
|
||||
# install
|
||||
cp cliCrl.pem ~/cyassl/certs/crl/cliCrl.pem
|
||||
|
||||
# eccCliCRL
|
||||
openssl ca -gencrl -crldays 180 -out eccCliCRL.pem -keyfile ~/cyassl/certs/ecc-client-key.pem -cert ~/cyassl/certs/client-ecc-cert.pem
|
||||
|
||||
# metadata
|
||||
openssl crl -in eccCliCRL.pem -text > tmp
|
||||
mv tmp eccCliCRL.pem
|
||||
# install
|
||||
cp eccCliCRL.pem ~/cyassl/certs/crl/eccCliCRL.pem
|
||||
|
||||
# eccSrvCRL
|
||||
openssl ca -gencrl -crldays 180 -out eccSrvCRL.pem -keyfile ~/cyassl/certs/ecc-key.pem -cert ~/cyassl/certs/server-ecc.pem
|
||||
|
||||
# metadata
|
||||
openssl crl -in eccSrvCRL.pem -text > tmp
|
||||
mv tmp eccSrvCRL.pem
|
||||
# install
|
||||
cp eccSrvCRL.pem ~/cyassl/certs/crl/eccSrvCRL.pem
|
||||
|
14
certs/crl/include.am
Normal file
14
certs/crl/include.am
Normal file
@ -0,0 +1,14 @@
|
||||
# vim:ft=automake
|
||||
# All paths should be given relative to the root
|
||||
#
|
||||
|
||||
EXTRA_DIST += \
|
||||
certs/crl/crl.pem \
|
||||
certs/crl/cliCrl.pem \
|
||||
certs/crl/eccSrvCRL.pem \
|
||||
certs/crl/eccCliCRL.pem
|
||||
|
||||
EXTRA_DIST += \
|
||||
certs/crl/crl.revoked
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
# All paths should be given relative to the root
|
||||
#
|
||||
|
||||
certs_DATA+= \
|
||||
EXTRA_DIST += \
|
||||
certs/ca-cert.pem \
|
||||
certs/ca-key.pem \
|
||||
certs/client-cert.pem \
|
||||
@ -10,10 +10,13 @@ certs_DATA+= \
|
||||
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 \
|
||||
@ -21,7 +24,7 @@ certs_DATA+= \
|
||||
certs/server-keyPkcs8Enc.pem \
|
||||
certs/server-keyPkcs8.pem
|
||||
|
||||
certs_DATA+= \
|
||||
EXTRA_DIST += \
|
||||
certs/ca-key.der \
|
||||
certs/client-cert.der \
|
||||
certs/client-key.der \
|
||||
@ -30,9 +33,8 @@ certs_DATA+= \
|
||||
certs/dsa2048.der \
|
||||
certs/ecc-key.der
|
||||
|
||||
EXTRA_DIST+= ${certs_DATA}
|
||||
|
||||
doc_DATA+= certs/taoCert.txt
|
||||
dist_doc_DATA+= certs/taoCert.txt
|
||||
|
||||
EXTRA_DIST+= certs/ntru-key.raw
|
||||
|
||||
|
@ -1,28 +1,28 @@
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIIEyTCCA7GgAwIBAgIIASZ+ezr7rN0wDQYJKoZIhvcNAQEFBQAwgZAxCzAJBgNV
|
||||
MIIEyTCCA7GgAwIBAgIIAfivVvmTrhEwDQYJKoZIhvcNAQEFBQAwgZAxCzAJBgNV
|
||||
BAYTAlVTMRAwDgYDVQQIEwdNb250YW5hMRAwDgYDVQQHEwdCb3plbWFuMREwDwYD
|
||||
VQQKEwhTYXd0b290aDETMBEGA1UECxMKQ29uc3VsdGluZzEWMBQGA1UEAxMNd3d3
|
||||
Lnlhc3NsLmNvbTEdMBsGCSqGSIb3DQEJARYOaW5mb0B5YXNzbC5jb20wIhgPMjAx
|
||||
MTEyMDUwMDE2MzdaGA8yMDEzMDQxOTAxMTYzN1owgYoxCzAJBgNVBAYTAlVTMQsw
|
||||
MzA2MTYyMTE1NTdaGA8yMDE0MTAzMDIxMTU1N1owgYoxCzAJBgNVBAYTAlVTMQsw
|
||||
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=
|
||||
AQQBwXABAi4DggItAASCAij5Bo9I8+pNpd+UbAjYSxjlZ9p6zo855iaDFlgwp1mU
|
||||
pJEDcr3RE218YmGaZL9vjqso/rNvP1MOv2GvGkcWU10gc+uD1bdvK8sBLNlm2LXI
|
||||
4x7uaiPZNQSDpHM8NA4sawN7dHir/Xk199qYbG/w3xK3PBZevul1CRob1CjAa9bY
|
||||
K84qC0z1BsGGodP0Lyv2vC5JHxCdh7cUvfElea8lMAbYyzFmrdjxfErj98bq7VNE
|
||||
wAPjwSEzlmTaGZ2BV7R1Gs1HeM6ZV17xzWxcdSf3kPJFYw35+ouhrre7SxxTnJAX
|
||||
65Y+qXj4xChKta1KI3WBrO1DDd0axxPaqw/jGZi1/X3C0sAaG3acyPEq++4GS0Zv
|
||||
eveLZ3OzC5D4qtYe+V4GXtChB+341shmAG9YFo4ot/98u3TwAdO1XSgaP4UYfxMK
|
||||
SNXOFdwRpy+FCjms8b9Qsk8mSj7WVv4+FVr017ce+yFyE0IHeiuRuvZ+QRraqwLI
|
||||
XOfAvp2/PWmlovdk7PKADFSV+Znx+coH4PR0enLq9wkVVAFyFCmCKxpOd+15/1JD
|
||||
Fqtb2+HV7W8254OB70vzzVo9eVzn9DUYA04HHYqN9mY7RB2cHZ5lJa3awKESlg7a
|
||||
7IUfBy3l+q+FdEnNtiz0sAXua3oJgMxagJcIb5FSVMBy8f40ertb6VhDFvlniuNL
|
||||
xE2MAmriJeFaJyO2sXFJByHOwEwxj4+rteeUrmTfCamx5EDG5pN8noAwDQYJKoZI
|
||||
hvcNAQEFBQADggEBAISRCm3JpSm6YoLDgrL0ytSibcAFP9Mtua0ocYy00O2SJ8yM
|
||||
Me+OGE1u89Nj317gPMeDskI2Ifkl80o8l6Gik3jLDGlaRvrlH0iT3B+HFSVGwir9
|
||||
T5agGjVpjcrWZi9BENRtLS8ILttjd0UvkpsR4QViIc50KAyhC4ogut8rsYLBUP87
|
||||
K8iGV/MVWa1COx0WLfIMlSCiz6ryh4aLfFB55kPWfSTOHAIbUZ82mPozJ+MmC1P2
|
||||
EzEhN4Usp+Q3GmikyXcefm8DSUpayN6bXlZ14ikTLFtTw0v/Upgr+MdfKH+SrK4Z
|
||||
lQQlbfJKww4sWKoEfZMFhZco6qOrF7iHo/vmpOc=
|
||||
-----END CERTIFICATE-----
|
||||
|
Binary file not shown.
54
certs/server-ecc-rsa.pem
Normal file
54
certs/server-ecc-rsa.pem
Normal file
@ -0,0 +1,54 @@
|
||||
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-----
|
@ -30,6 +30,22 @@ same as self signed, use ca prefix instead of client
|
||||
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
|
||||
|
||||
|
||||
***** Adding Subject Key ID and Authentication Key ID extensions to a cert *****
|
||||
|
||||
Create a config file for OpenSSL with the example contents:
|
||||
|
||||
[skidakid]
|
||||
subjectKeyIdentifier=hash
|
||||
authorityKeyIdentifier=keyid
|
||||
|
||||
Add to the openssl command for creating a cert signed by a CA step 3 the
|
||||
following options:
|
||||
|
||||
-extfile <file.cnf> -extensions skidakid
|
||||
|
||||
anywhere before the redirect. This will add the cert's public key hash as the
|
||||
Subject Key Identifier, and the signer's SKID as the Authentication Key ID.
|
||||
|
||||
|
||||
***** To create a dsa cert ********************
|
||||
|
||||
@ -112,7 +128,7 @@ openssl dhparam -in dh2048.param -text > dh2048.pem
|
||||
|
||||
1) create a crl
|
||||
|
||||
a) openssl ca -gencrl -out crl.pem -keyfile ./ca-key.pem -cert ./ca-cert.pem
|
||||
a) openssl ca -gencrl -crldays 120 -out crl.pem -keyfile ./ca-key.pem -cert ./ca-cert.pem
|
||||
|
||||
Error No ./CA root/index.txt so:
|
||||
|
||||
|
34
commit-tests.sh
Executable file
34
commit-tests.sh
Executable file
@ -0,0 +1,34 @@
|
||||
#!/bin/bash
|
||||
|
||||
#commit-tests.sh
|
||||
|
||||
|
||||
# make sure current config is ok
|
||||
echo -e "\n\nTesting current config...\n\n"
|
||||
make clean; make -j 8 test;
|
||||
RESULT=$?
|
||||
[ $RESULT -ne 0 ] && echo -e "\n\nCurrent config make test failed" && exit 1
|
||||
|
||||
|
||||
# make sure basic config is ok
|
||||
echo -e "\n\nTesting basic config too...\n\n"
|
||||
./configure --disable-fastmath;
|
||||
RESULT=$?
|
||||
[ $RESULT -ne 0 ] && echo -e "\n\nBasic config ./configure failed" && exit 1
|
||||
|
||||
make -j 8 test;
|
||||
RESULT=$?
|
||||
[ $RESULT -ne 0 ] && echo -e "\n\nBasic config make test failed" && exit 1
|
||||
|
||||
|
||||
# make sure full config is ok
|
||||
echo -e "\n\nTesting full config as well...\n\n"
|
||||
./configure --enable-opensslextra --enable-ecc --enable-dtls --enable-aesgcm --enable-aesccm --enable-hc128 --enable-sniffer --enable-psk --enable-rabbit --enable-camellia --enable-sha512;
|
||||
RESULT=$?
|
||||
[ $RESULT -ne 0 ] && echo -e "\n\nFull config ./configure failed" && exit 1
|
||||
|
||||
make -j 8 test;
|
||||
RESULT=$?
|
||||
[ $RESULT -ne 0 ] && echo -e "\n\nFull config make test failed" && exit 1
|
||||
|
||||
exit 0
|
1281
configure.ac
1281
configure.ac
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -7,3 +7,4 @@ 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
|
||||
DISTCLEANFILES+= ctaocrypt/benchmark/.libs/benchmark
|
||||
|
1679
ctaocrypt/src/aes.c
1679
ctaocrypt/src/aes.c
File diff suppressed because it is too large
Load Diff
@ -1,6 +1,6 @@
|
||||
/* aes_asm.s
|
||||
*
|
||||
* Copyright (C) 2006-2011 Sawtooth Consulting Ltd.
|
||||
* Copyright (C) 2006-2013 wolfSSL Inc.
|
||||
*
|
||||
* This file is part of CyaSSL.
|
||||
*
|
||||
@ -25,12 +25,14 @@
|
||||
*/
|
||||
|
||||
|
||||
//AES_CBC_encrypt (const unsigned char *in,
|
||||
// unsigned char *out,
|
||||
// unsigned char ivec[16],
|
||||
// unsigned long length,
|
||||
// const unsigned char *KS,
|
||||
// int nr)
|
||||
/*
|
||||
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
|
||||
@ -82,12 +84,15 @@ ret
|
||||
|
||||
|
||||
|
||||
//AES_CBC_decrypt (const unsigned char *in,
|
||||
// unsigned char *out,
|
||||
// unsigned char ivec[16],
|
||||
// unsigned long length,
|
||||
// const unsigned char *KS,
|
||||
// int nr)
|
||||
|
||||
/*
|
||||
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
|
||||
@ -258,10 +263,331 @@ DEND_4:
|
||||
ret
|
||||
|
||||
|
||||
/*
|
||||
AES_ECB_encrypt (const unsigned char *in,
|
||||
unsigned char *out,
|
||||
unsigned long length,
|
||||
const unsigned char *KS,
|
||||
int nr)
|
||||
*/
|
||||
.globl AES_ECB_encrypt
|
||||
AES_ECB_encrypt:
|
||||
# parameter 1: %rdi
|
||||
# parameter 2: %rsi
|
||||
# parameter 3: %rdx
|
||||
# parameter 4: %rcx
|
||||
# parameter 5: %r8d
|
||||
movq %rdx, %r10
|
||||
shrq $4, %rdx
|
||||
shlq $60, %r10
|
||||
je EECB_NO_PARTS_4
|
||||
addq $1, %rdx
|
||||
EECB_NO_PARTS_4:
|
||||
movq %rdx, %r10
|
||||
shlq $62, %r10
|
||||
shrq $62, %r10
|
||||
shrq $2, %rdx
|
||||
je EECB_REMAINDER_4
|
||||
subq $64, %rsi
|
||||
EECB_LOOP_4:
|
||||
movdqu (%rdi), %xmm1
|
||||
movdqu 16(%rdi), %xmm2
|
||||
movdqu 32(%rdi), %xmm3
|
||||
movdqu 48(%rdi), %xmm4
|
||||
movdqa (%rcx), %xmm9
|
||||
movdqa 16(%rcx), %xmm10
|
||||
movdqa 32(%rcx), %xmm11
|
||||
movdqa 48(%rcx), %xmm12
|
||||
pxor %xmm9, %xmm1
|
||||
pxor %xmm9, %xmm2
|
||||
pxor %xmm9, %xmm3
|
||||
pxor %xmm9, %xmm4
|
||||
aesenc %xmm10, %xmm1
|
||||
aesenc %xmm10, %xmm2
|
||||
aesenc %xmm10, %xmm3
|
||||
aesenc %xmm10, %xmm4
|
||||
aesenc %xmm11, %xmm1
|
||||
aesenc %xmm11, %xmm2
|
||||
aesenc %xmm11, %xmm3
|
||||
aesenc %xmm11, %xmm4
|
||||
aesenc %xmm12, %xmm1
|
||||
aesenc %xmm12, %xmm2
|
||||
aesenc %xmm12, %xmm3
|
||||
aesenc %xmm12, %xmm4
|
||||
movdqa 64(%rcx), %xmm9
|
||||
movdqa 80(%rcx), %xmm10
|
||||
movdqa 96(%rcx), %xmm11
|
||||
movdqa 112(%rcx), %xmm12
|
||||
aesenc %xmm9, %xmm1
|
||||
aesenc %xmm9, %xmm2
|
||||
aesenc %xmm9, %xmm3
|
||||
aesenc %xmm9, %xmm4
|
||||
aesenc %xmm10, %xmm1
|
||||
aesenc %xmm10, %xmm2
|
||||
aesenc %xmm10, %xmm3
|
||||
aesenc %xmm10, %xmm4
|
||||
aesenc %xmm11, %xmm1
|
||||
aesenc %xmm11, %xmm2
|
||||
aesenc %xmm11, %xmm3
|
||||
aesenc %xmm11, %xmm4
|
||||
aesenc %xmm12, %xmm1
|
||||
aesenc %xmm12, %xmm2
|
||||
aesenc %xmm12, %xmm3
|
||||
aesenc %xmm12, %xmm4
|
||||
movdqa 128(%rcx), %xmm9
|
||||
movdqa 144(%rcx), %xmm10
|
||||
movdqa 160(%rcx), %xmm11
|
||||
cmpl $12, %r8d
|
||||
aesenc %xmm9, %xmm1
|
||||
aesenc %xmm9, %xmm2
|
||||
aesenc %xmm9, %xmm3
|
||||
aesenc %xmm9, %xmm4
|
||||
aesenc %xmm10, %xmm1
|
||||
aesenc %xmm10, %xmm2
|
||||
aesenc %xmm10, %xmm3
|
||||
aesenc %xmm10, %xmm4
|
||||
jb EECB_LAST_4
|
||||
movdqa 160(%rcx), %xmm9
|
||||
movdqa 176(%rcx), %xmm10
|
||||
movdqa 192(%rcx), %xmm11
|
||||
cmpl $14, %r8d
|
||||
aesenc %xmm9, %xmm1
|
||||
aesenc %xmm9, %xmm2
|
||||
aesenc %xmm9, %xmm3
|
||||
aesenc %xmm9, %xmm4
|
||||
aesenc %xmm10, %xmm1
|
||||
aesenc %xmm10, %xmm2
|
||||
aesenc %xmm10, %xmm3
|
||||
aesenc %xmm10, %xmm4
|
||||
jb EECB_LAST_4
|
||||
movdqa 192(%rcx), %xmm9
|
||||
movdqa 208(%rcx), %xmm10
|
||||
movdqa 224(%rcx), %xmm11
|
||||
aesenc %xmm9, %xmm1
|
||||
aesenc %xmm9, %xmm2
|
||||
aesenc %xmm9, %xmm3
|
||||
aesenc %xmm9, %xmm4
|
||||
aesenc %xmm10, %xmm1
|
||||
aesenc %xmm10, %xmm2
|
||||
aesenc %xmm10, %xmm3
|
||||
aesenc %xmm10, %xmm4
|
||||
EECB_LAST_4:
|
||||
addq $64, %rdi
|
||||
addq $64, %rsi
|
||||
decq %rdx
|
||||
aesenclast %xmm11, %xmm1
|
||||
aesenclast %xmm11, %xmm2
|
||||
aesenclast %xmm11, %xmm3
|
||||
aesenclast %xmm11, %xmm4
|
||||
movdqu %xmm1, (%rsi)
|
||||
movdqu %xmm2, 16(%rsi)
|
||||
movdqu %xmm3, 32(%rsi)
|
||||
movdqu %xmm4, 48(%rsi)
|
||||
jne EECB_LOOP_4
|
||||
addq $64, %rsi
|
||||
EECB_REMAINDER_4:
|
||||
cmpq $0, %r10
|
||||
je EECB_END_4
|
||||
EECB_LOOP_4_2:
|
||||
movdqu (%rdi), %xmm1
|
||||
addq $16, %rdi
|
||||
pxor (%rcx), %xmm1
|
||||
movdqu 160(%rcx), %xmm2
|
||||
aesenc 16(%rcx), %xmm1
|
||||
aesenc 32(%rcx), %xmm1
|
||||
aesenc 48(%rcx), %xmm1
|
||||
aesenc 64(%rcx), %xmm1
|
||||
aesenc 80(%rcx), %xmm1
|
||||
aesenc 96(%rcx), %xmm1
|
||||
aesenc 112(%rcx), %xmm1
|
||||
aesenc 128(%rcx), %xmm1
|
||||
aesenc 144(%rcx), %xmm1
|
||||
cmpl $12, %r8d
|
||||
jb EECB_LAST_4_2
|
||||
movdqu 192(%rcx), %xmm2
|
||||
aesenc 160(%rcx), %xmm1
|
||||
aesenc 176(%rcx), %xmm1
|
||||
cmpl $14, %r8d
|
||||
jb EECB_LAST_4_2
|
||||
movdqu 224(%rcx), %xmm2
|
||||
aesenc 192(%rcx), %xmm1
|
||||
aesenc 208(%rcx), %xmm1
|
||||
EECB_LAST_4_2:
|
||||
aesenclast %xmm2, %xmm1
|
||||
movdqu %xmm1, (%rsi)
|
||||
addq $16, %rsi
|
||||
decq %r10
|
||||
jne EECB_LOOP_4_2
|
||||
EECB_END_4:
|
||||
ret
|
||||
|
||||
|
||||
//void AES_128_Key_Expansion(const unsigned char* userkey,
|
||||
// unsigned char* key_schedule);
|
||||
/*
|
||||
AES_ECB_decrypt (const unsigned char *in,
|
||||
unsigned char *out,
|
||||
unsigned long length,
|
||||
const unsigned char *KS,
|
||||
int nr)
|
||||
*/
|
||||
.globl AES_ECB_decrypt
|
||||
AES_ECB_decrypt:
|
||||
# parameter 1: %rdi
|
||||
# parameter 2: %rsi
|
||||
# parameter 3: %rdx
|
||||
# parameter 4: %rcx
|
||||
# parameter 5: %r8d
|
||||
|
||||
movq %rdx, %r10
|
||||
shrq $4, %rdx
|
||||
shlq $60, %r10
|
||||
je DECB_NO_PARTS_4
|
||||
addq $1, %rdx
|
||||
DECB_NO_PARTS_4:
|
||||
movq %rdx, %r10
|
||||
shlq $62, %r10
|
||||
shrq $62, %r10
|
||||
shrq $2, %rdx
|
||||
je DECB_REMAINDER_4
|
||||
subq $64, %rsi
|
||||
DECB_LOOP_4:
|
||||
movdqu (%rdi), %xmm1
|
||||
movdqu 16(%rdi), %xmm2
|
||||
movdqu 32(%rdi), %xmm3
|
||||
movdqu 48(%rdi), %xmm4
|
||||
movdqa (%rcx), %xmm9
|
||||
movdqa 16(%rcx), %xmm10
|
||||
movdqa 32(%rcx), %xmm11
|
||||
movdqa 48(%rcx), %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(%rcx), %xmm9
|
||||
movdqa 80(%rcx), %xmm10
|
||||
movdqa 96(%rcx), %xmm11
|
||||
movdqa 112(%rcx), %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(%rcx), %xmm9
|
||||
movdqa 144(%rcx), %xmm10
|
||||
movdqa 160(%rcx), %xmm11
|
||||
cmpl $12, %r8d
|
||||
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 DECB_LAST_4
|
||||
movdqa 160(%rcx), %xmm9
|
||||
movdqa 176(%rcx), %xmm10
|
||||
movdqa 192(%rcx), %xmm11
|
||||
cmpl $14, %r8d
|
||||
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 DECB_LAST_4
|
||||
movdqa 192(%rcx), %xmm9
|
||||
movdqa 208(%rcx), %xmm10
|
||||
movdqa 224(%rcx), %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
|
||||
DECB_LAST_4:
|
||||
addq $64, %rdi
|
||||
addq $64, %rsi
|
||||
decq %rdx
|
||||
aesdeclast %xmm11, %xmm1
|
||||
aesdeclast %xmm11, %xmm2
|
||||
aesdeclast %xmm11, %xmm3
|
||||
aesdeclast %xmm11, %xmm4
|
||||
movdqu %xmm1, (%rsi)
|
||||
movdqu %xmm2, 16(%rsi)
|
||||
movdqu %xmm3, 32(%rsi)
|
||||
movdqu %xmm4, 48(%rsi)
|
||||
jne DECB_LOOP_4
|
||||
addq $64, %rsi
|
||||
DECB_REMAINDER_4:
|
||||
cmpq $0, %r10
|
||||
je DECB_END_4
|
||||
DECB_LOOP_4_2:
|
||||
movdqu (%rdi), %xmm1
|
||||
addq $16, %rdi
|
||||
pxor (%rcx), %xmm1
|
||||
movdqu 160(%rcx), %xmm2
|
||||
cmpl $12, %r8d
|
||||
aesdec 16(%rcx), %xmm1
|
||||
aesdec 32(%rcx), %xmm1
|
||||
aesdec 48(%rcx), %xmm1
|
||||
aesdec 64(%rcx), %xmm1
|
||||
aesdec 80(%rcx), %xmm1
|
||||
aesdec 96(%rcx), %xmm1
|
||||
aesdec 112(%rcx), %xmm1
|
||||
aesdec 128(%rcx), %xmm1
|
||||
aesdec 144(%rcx), %xmm1
|
||||
jb DECB_LAST_4_2
|
||||
cmpl $14, %r8d
|
||||
movdqu 192(%rcx), %xmm2
|
||||
aesdec 160(%rcx), %xmm1
|
||||
aesdec 176(%rcx), %xmm1
|
||||
jb DECB_LAST_4_2
|
||||
movdqu 224(%rcx), %xmm2
|
||||
aesdec 192(%rcx), %xmm1
|
||||
aesdec 208(%rcx), %xmm1
|
||||
DECB_LAST_4_2:
|
||||
aesdeclast %xmm2, %xmm1
|
||||
movdqu %xmm1, (%rsi)
|
||||
addq $16, %rsi
|
||||
decq %r10
|
||||
jne DECB_LOOP_4_2
|
||||
DECB_END_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:
|
||||
@ -319,8 +645,10 @@ pxor %xmm2, %xmm1
|
||||
ret
|
||||
|
||||
|
||||
//void AES_192_Key_Expansion (const unsigned char *userkey,
|
||||
// unsigned char *key)
|
||||
/*
|
||||
void AES_192_Key_Expansion (const unsigned char *userkey,
|
||||
unsigned char *key)
|
||||
*/
|
||||
.globl AES_192_Key_Expansion
|
||||
AES_192_Key_Expansion:
|
||||
# parameter 1: %rdi
|
||||
@ -403,8 +731,10 @@ pxor %xmm2, %xmm3
|
||||
ret
|
||||
|
||||
|
||||
//void AES_256_Key_Expansion (const unsigned char *userkey,
|
||||
// unsigned char *key)
|
||||
/*
|
||||
void AES_256_Key_Expansion (const unsigned char *userkey,
|
||||
unsigned char *key)
|
||||
*/
|
||||
.globl AES_256_Key_Expansion
|
||||
AES_256_Key_Expansion:
|
||||
# parameter 1: %rdi
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* arc4.c
|
||||
*
|
||||
* Copyright (C) 2006-2012 Sawtooth Consulting Ltd.
|
||||
* Copyright (C) 2006-2013 wolfSSL Inc.
|
||||
*
|
||||
* This file is part of CyaSSL.
|
||||
*
|
||||
@ -23,14 +23,30 @@
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
#include <cyassl/ctaocrypt/settings.h>
|
||||
|
||||
#ifndef NO_RC4
|
||||
|
||||
#include <cyassl/ctaocrypt/arc4.h>
|
||||
|
||||
|
||||
#ifdef HAVE_CAVIUM
|
||||
static void Arc4CaviumSetKey(Arc4* arc4, const byte* key, word32 length);
|
||||
static void Arc4CaviumProcess(Arc4* arc4, byte* out, const byte* in,
|
||||
word32 length);
|
||||
#endif
|
||||
|
||||
|
||||
void Arc4SetKey(Arc4* arc4, const byte* key, word32 length)
|
||||
{
|
||||
word32 i;
|
||||
word32 keyIndex = 0, stateIndex = 0;
|
||||
|
||||
#ifdef HAVE_CAVIUM
|
||||
if (arc4->magic == CYASSL_ARC4_CAVIUM_MAGIC)
|
||||
return Arc4CaviumSetKey(arc4, key, length);
|
||||
#endif
|
||||
|
||||
arc4->x = 1;
|
||||
arc4->y = 0;
|
||||
|
||||
@ -66,8 +82,16 @@ static INLINE byte MakeByte(word32* x, word32* y, byte* s)
|
||||
|
||||
void Arc4Process(Arc4* arc4, byte* out, const byte* in, word32 length)
|
||||
{
|
||||
word32 x = arc4->x;
|
||||
word32 y = arc4->y;
|
||||
word32 x;
|
||||
word32 y;
|
||||
|
||||
#ifdef HAVE_CAVIUM
|
||||
if (arc4->magic == CYASSL_ARC4_CAVIUM_MAGIC)
|
||||
return Arc4CaviumProcess(arc4, out, in, length);
|
||||
#endif
|
||||
|
||||
x = arc4->x;
|
||||
y = arc4->y;
|
||||
|
||||
while(length--)
|
||||
*out++ = *in++ ^ MakeByte(&x, &y, arc4->state);
|
||||
@ -76,3 +100,80 @@ void Arc4Process(Arc4* arc4, byte* out, const byte* in, word32 length)
|
||||
arc4->y = (byte)y;
|
||||
}
|
||||
|
||||
|
||||
#ifdef HAVE_CAVIUM
|
||||
|
||||
#include <cyassl/ctaocrypt/logging.h>
|
||||
#include "cavium_common.h"
|
||||
|
||||
/* Initiliaze Arc4 for use with Nitrox device */
|
||||
int Arc4InitCavium(Arc4* arc4, int devId)
|
||||
{
|
||||
if (arc4 == NULL)
|
||||
return -1;
|
||||
|
||||
if (CspAllocContext(CONTEXT_SSL, &arc4->contextHandle, devId) != 0)
|
||||
return -1;
|
||||
|
||||
arc4->devId = devId;
|
||||
arc4->magic = CYASSL_ARC4_CAVIUM_MAGIC;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/* Free Arc4 from use with Nitrox device */
|
||||
void Arc4FreeCavium(Arc4* arc4)
|
||||
{
|
||||
if (arc4 == NULL)
|
||||
return;
|
||||
|
||||
if (arc4->magic != CYASSL_ARC4_CAVIUM_MAGIC)
|
||||
return;
|
||||
|
||||
CspFreeContext(CONTEXT_SSL, arc4->contextHandle, arc4->devId);
|
||||
arc4->magic = 0;
|
||||
}
|
||||
|
||||
|
||||
static void Arc4CaviumSetKey(Arc4* arc4, const byte* key, word32 length)
|
||||
{
|
||||
word32 requestId;
|
||||
|
||||
if (CspInitializeRc4(CAVIUM_BLOCKING, arc4->contextHandle, length,
|
||||
(byte*)key, &requestId, arc4->devId) != 0) {
|
||||
CYASSL_MSG("Bad Cavium Arc4 Init");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void Arc4CaviumProcess(Arc4* arc4, byte* out, const byte* in,
|
||||
word32 length)
|
||||
{
|
||||
word offset = 0;
|
||||
word32 requestId;
|
||||
|
||||
while (length > CYASSL_MAX_16BIT) {
|
||||
word16 slen = (word16)CYASSL_MAX_16BIT;
|
||||
if (CspEncryptRc4(CAVIUM_BLOCKING, arc4->contextHandle,CAVIUM_UPDATE,
|
||||
slen, (byte*)in + offset, out + offset, &requestId,
|
||||
arc4->devId) != 0) {
|
||||
CYASSL_MSG("Bad Cavium Arc4 Encrypt");
|
||||
}
|
||||
length -= CYASSL_MAX_16BIT;
|
||||
offset += CYASSL_MAX_16BIT;
|
||||
}
|
||||
if (length) {
|
||||
word16 slen = (word16)length;
|
||||
if (CspEncryptRc4(CAVIUM_BLOCKING, arc4->contextHandle,CAVIUM_UPDATE,
|
||||
slen, (byte*)in + offset, out + offset, &requestId,
|
||||
arc4->devId) != 0) {
|
||||
CYASSL_MSG("Bad Cavium Arc4 Encrypt");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* HAVE_CAVIUM */
|
||||
|
||||
#endif /* NO_ARC4 */
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* asm.c
|
||||
*
|
||||
* Copyright (C) 2006-2012 Sawtooth Consulting Ltd.
|
||||
* Copyright (C) 2006-2013 wolfSSL Inc.
|
||||
*
|
||||
* This file is part of CyaSSL.
|
||||
*
|
||||
@ -23,6 +23,8 @@
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
#include <cyassl/ctaocrypt/settings.h>
|
||||
|
||||
/*
|
||||
* Based on public domain TomsFastMath 0.10 by Tom St Denis, tomstdenis@iahu.ca,
|
||||
* http://math.libtomcrypt.com
|
||||
@ -41,7 +43,7 @@
|
||||
mu = c[x] * mp
|
||||
|
||||
#define INNERMUL \
|
||||
asm( \
|
||||
__asm__( \
|
||||
"movl %5,%%eax \n\t" \
|
||||
"mull %4 \n\t" \
|
||||
"addl %1,%%eax \n\t" \
|
||||
@ -51,16 +53,16 @@ asm( \
|
||||
"movl %%edx,%1 \n\t" \
|
||||
:"=g"(_c[LO]), "=r"(cy) \
|
||||
:"0"(_c[LO]), "1"(cy), "g"(mu), "g"(*tmpm++) \
|
||||
: "%eax", "%edx", "%cc")
|
||||
: "%eax", "%edx", "cc")
|
||||
|
||||
#define PROPCARRY \
|
||||
asm( \
|
||||
__asm__( \
|
||||
"addl %1,%0 \n\t" \
|
||||
"setb %%al \n\t" \
|
||||
"movzbl %%al,%1 \n\t" \
|
||||
:"=g"(_c[LO]), "=r"(cy) \
|
||||
:"0"(_c[LO]), "1"(cy) \
|
||||
: "%eax", "%cc")
|
||||
: "%eax", "cc")
|
||||
|
||||
/******************************************************************/
|
||||
#elif defined(TFM_X86_64)
|
||||
@ -73,7 +75,7 @@ asm( \
|
||||
mu = c[x] * mp
|
||||
|
||||
#define INNERMUL \
|
||||
asm( \
|
||||
__asm__( \
|
||||
"movq %5,%%rax \n\t" \
|
||||
"mulq %4 \n\t" \
|
||||
"addq %1,%%rax \n\t" \
|
||||
@ -83,10 +85,10 @@ asm( \
|
||||
"movq %%rdx,%1 \n\t" \
|
||||
:"=g"(_c[LO]), "=r"(cy) \
|
||||
:"0"(_c[LO]), "1"(cy), "r"(mu), "r"(*tmpm++) \
|
||||
: "%rax", "%rdx", "%cc")
|
||||
: "%rax", "%rdx", "cc")
|
||||
|
||||
#define INNERMUL8 \
|
||||
asm( \
|
||||
__asm__( \
|
||||
"movq 0(%5),%%rax \n\t" \
|
||||
"movq 0(%2),%%r10 \n\t" \
|
||||
"movq 0x8(%5),%%r11 \n\t" \
|
||||
@ -176,17 +178,17 @@ asm( \
|
||||
\
|
||||
:"=r"(_c), "=r"(cy) \
|
||||
: "0"(_c), "1"(cy), "g"(mu), "r"(tmpm)\
|
||||
: "%rax", "%rdx", "%r10", "%r11", "%cc")
|
||||
: "%rax", "%rdx", "%r10", "%r11", "cc")
|
||||
|
||||
|
||||
#define PROPCARRY \
|
||||
asm( \
|
||||
__asm__( \
|
||||
"addq %1,%0 \n\t" \
|
||||
"setb %%al \n\t" \
|
||||
"movzbq %%al,%1 \n\t" \
|
||||
:"=g"(_c[LO]), "=r"(cy) \
|
||||
:"0"(_c[LO]), "1"(cy) \
|
||||
: "%rax", "%cc")
|
||||
: "%rax", "cc")
|
||||
|
||||
/******************************************************************/
|
||||
#elif defined(TFM_SSE2)
|
||||
@ -200,13 +202,13 @@ asm( \
|
||||
*/
|
||||
|
||||
#define MONT_START \
|
||||
asm("movd %0,%%mm2"::"g"(mp))
|
||||
__asm__("movd %0,%%mm2"::"g"(mp))
|
||||
|
||||
#define MONT_FINI \
|
||||
asm("emms")
|
||||
__asm__("emms")
|
||||
|
||||
#define LOOP_START \
|
||||
asm( \
|
||||
__asm__( \
|
||||
"movd %0,%%mm1 \n\t" \
|
||||
"pxor %%mm3,%%mm3 \n\t" \
|
||||
"pmuludq %%mm2,%%mm1 \n\t" \
|
||||
@ -214,7 +216,7 @@ asm( \
|
||||
|
||||
/* pmuludq on mmx registers does a 32x32->64 multiply. */
|
||||
#define INNERMUL \
|
||||
asm( \
|
||||
__asm__( \
|
||||
"movd %1,%%mm4 \n\t" \
|
||||
"movd %2,%%mm0 \n\t" \
|
||||
"paddq %%mm4,%%mm3 \n\t" \
|
||||
@ -225,7 +227,7 @@ asm( \
|
||||
:"=g"(_c[LO]) : "0"(_c[LO]), "g"(*tmpm++) );
|
||||
|
||||
#define INNERMUL8 \
|
||||
asm( \
|
||||
__asm__( \
|
||||
"movd 0(%1),%%mm4 \n\t" \
|
||||
"movd 0(%2),%%mm0 \n\t" \
|
||||
"paddq %%mm4,%%mm3 \n\t" \
|
||||
@ -295,16 +297,16 @@ asm( \
|
||||
pointer */
|
||||
|
||||
#define LOOP_END \
|
||||
asm( "movd %%mm3,%0 \n" :"=r"(cy))
|
||||
__asm__( "movd %%mm3,%0 \n" :"=r"(cy))
|
||||
|
||||
#define PROPCARRY \
|
||||
asm( \
|
||||
__asm__( \
|
||||
"addl %1,%0 \n\t" \
|
||||
"setb %%al \n\t" \
|
||||
"movzbl %%al,%1 \n\t" \
|
||||
:"=g"(_c[LO]), "=r"(cy) \
|
||||
:"0"(_c[LO]), "1"(cy) \
|
||||
: "%eax", "%cc")
|
||||
: "%eax", "cc")
|
||||
|
||||
/******************************************************************/
|
||||
#elif defined(TFM_ARM)
|
||||
@ -317,23 +319,23 @@ asm( \
|
||||
mu = c[x] * mp
|
||||
|
||||
#define INNERMUL \
|
||||
asm( \
|
||||
__asm__( \
|
||||
" LDR r0,%1 \n\t" \
|
||||
" ADDS r0,r0,%0 \n\t" \
|
||||
" MOVCS %0,#1 \n\t" \
|
||||
" MOVCC %0,#0 \n\t" \
|
||||
" UMLAL r0,%0,%3,%4 \n\t" \
|
||||
" STR r0,%1 \n\t" \
|
||||
:"=r"(cy),"=m"(_c[0]):"0"(cy),"r"(mu),"r"(*tmpm++),"1"(_c[0]):"r0","%cc");
|
||||
:"=r"(cy),"=m"(_c[0]):"0"(cy),"r"(mu),"r"(*tmpm++),"1"(_c[0]):"r0","cc");
|
||||
|
||||
#define PROPCARRY \
|
||||
asm( \
|
||||
__asm__( \
|
||||
" LDR r0,%1 \n\t" \
|
||||
" ADDS r0,r0,%0 \n\t" \
|
||||
" STR r0,%1 \n\t" \
|
||||
" MOVCS %0,#1 \n\t" \
|
||||
" MOVCC %0,#0 \n\t" \
|
||||
:"=r"(cy),"=m"(_c[0]):"0"(cy),"1"(_c[0]):"r0","%cc");
|
||||
:"=r"(cy),"=m"(_c[0]):"0"(cy),"1"(_c[0]):"r0","cc");
|
||||
|
||||
#elif defined(TFM_PPC32)
|
||||
|
||||
@ -345,7 +347,7 @@ asm( \
|
||||
mu = c[x] * mp
|
||||
|
||||
#define INNERMUL \
|
||||
asm( \
|
||||
__asm__( \
|
||||
" mullw 16,%3,%4 \n\t" \
|
||||
" mulhwu 17,%3,%4 \n\t" \
|
||||
" addc 16,16,%0 \n\t" \
|
||||
@ -354,16 +356,16 @@ asm( \
|
||||
" addc 16,16,18 \n\t" \
|
||||
" addze %0,17 \n\t" \
|
||||
" stw 16,%1 \n\t" \
|
||||
:"=r"(cy),"=m"(_c[0]):"0"(cy),"r"(mu),"r"(tmpm[0]),"1"(_c[0]):"16", "17", "18","%cc"); ++tmpm;
|
||||
:"=r"(cy),"=m"(_c[0]):"0"(cy),"r"(mu),"r"(tmpm[0]),"1"(_c[0]):"16", "17", "18","cc"); ++tmpm;
|
||||
|
||||
#define PROPCARRY \
|
||||
asm( \
|
||||
__asm__( \
|
||||
" lwz 16,%1 \n\t" \
|
||||
" addc 16,16,%0 \n\t" \
|
||||
" stw 16,%1 \n\t" \
|
||||
" xor %0,%0,%0 \n\t" \
|
||||
" addze %0,%0 \n\t" \
|
||||
:"=r"(cy),"=m"(_c[0]):"0"(cy),"1"(_c[0]):"16","%cc");
|
||||
:"=r"(cy),"=m"(_c[0]):"0"(cy),"1"(_c[0]):"16","cc");
|
||||
|
||||
#elif defined(TFM_PPC64)
|
||||
|
||||
@ -375,7 +377,7 @@ asm( \
|
||||
mu = c[x] * mp
|
||||
|
||||
#define INNERMUL \
|
||||
asm( \
|
||||
__asm__( \
|
||||
" mulld 16,%3,%4 \n\t" \
|
||||
" mulhdu 17,%3,%4 \n\t" \
|
||||
" addc 16,16,%0 \n\t" \
|
||||
@ -384,16 +386,16 @@ asm( \
|
||||
" addc 16,16,18 \n\t" \
|
||||
" addze %0,17 \n\t" \
|
||||
" sdx 16,0,%1 \n\t" \
|
||||
:"=r"(cy),"=m"(_c[0]):"0"(cy),"r"(mu),"r"(tmpm[0]),"1"(_c[0]):"16", "17", "18","%cc"); ++tmpm;
|
||||
:"=r"(cy),"=m"(_c[0]):"0"(cy),"r"(mu),"r"(tmpm[0]),"1"(_c[0]):"16", "17", "18","cc"); ++tmpm;
|
||||
|
||||
#define PROPCARRY \
|
||||
asm( \
|
||||
__asm__( \
|
||||
" ldx 16,0,%1 \n\t" \
|
||||
" addc 16,16,%0 \n\t" \
|
||||
" sdx 16,0,%1 \n\t" \
|
||||
" xor %0,%0,%0 \n\t" \
|
||||
" addze %0,%0 \n\t" \
|
||||
:"=r"(cy),"=m"(_c[0]):"0"(cy),"1"(_c[0]):"16","%cc");
|
||||
:"=r"(cy),"=m"(_c[0]):"0"(cy),"1"(_c[0]):"16","cc");
|
||||
|
||||
/******************************************************************/
|
||||
|
||||
@ -407,7 +409,7 @@ asm( \
|
||||
mu = c[x] * mp
|
||||
|
||||
#define INNERMUL \
|
||||
asm( \
|
||||
__asm__( \
|
||||
" ld.w r2,%1 \n\t" \
|
||||
" add r2,%0 \n\t" \
|
||||
" eor r3,r3 \n\t" \
|
||||
@ -418,13 +420,13 @@ asm( \
|
||||
:"=r"(cy),"=r"(_c):"0"(cy),"r"(mu),"r"(*tmpm++),"1"(_c):"r2","r3");
|
||||
|
||||
#define PROPCARRY \
|
||||
asm( \
|
||||
__asm__( \
|
||||
" ld.w r2,%1 \n\t" \
|
||||
" add r2,%0 \n\t" \
|
||||
" st.w %1,r2 \n\t" \
|
||||
" eor %0,%0 \n\t" \
|
||||
" acr %0 \n\t" \
|
||||
:"=r"(cy),"=r"(&_c[0]):"0"(cy),"1"(&_c[0]):"r2","%cc");
|
||||
:"=r"(cy),"=r"(&_c[0]):"0"(cy),"1"(&_c[0]):"r2","cc");
|
||||
|
||||
#else
|
||||
|
||||
@ -437,9 +439,10 @@ asm( \
|
||||
|
||||
#define INNERMUL \
|
||||
do { fp_word t; \
|
||||
_c[0] = t = ((fp_word)_c[0] + (fp_word)cy) + \
|
||||
t = ((fp_word)_c[0] + (fp_word)cy) + \
|
||||
(((fp_word)mu) * ((fp_word)*tmpm++)); \
|
||||
cy = (t >> DIGIT_BIT); \
|
||||
_c[0] = (fp_digit)t; \
|
||||
cy = (fp_digit)(t >> DIGIT_BIT); \
|
||||
} while (0)
|
||||
|
||||
#define PROPCARRY \
|
||||
@ -475,16 +478,16 @@ asm( \
|
||||
#define COMBA_FINI
|
||||
|
||||
#define SQRADD(i, j) \
|
||||
asm( \
|
||||
__asm__( \
|
||||
"movl %6,%%eax \n\t" \
|
||||
"mull %%eax \n\t" \
|
||||
"addl %%eax,%0 \n\t" \
|
||||
"adcl %%edx,%1 \n\t" \
|
||||
"adcl $0,%2 \n\t" \
|
||||
:"=r"(c0), "=r"(c1), "=r"(c2): "0"(c0), "1"(c1), "2"(c2), "m"(i) :"%eax","%edx","%cc");
|
||||
:"=r"(c0), "=r"(c1), "=r"(c2): "0"(c0), "1"(c1), "2"(c2), "m"(i) :"%eax","%edx","cc");
|
||||
|
||||
#define SQRADD2(i, j) \
|
||||
asm( \
|
||||
__asm__( \
|
||||
"movl %6,%%eax \n\t" \
|
||||
"mull %7 \n\t" \
|
||||
"addl %%eax,%0 \n\t" \
|
||||
@ -493,37 +496,37 @@ asm( \
|
||||
"addl %%eax,%0 \n\t" \
|
||||
"adcl %%edx,%1 \n\t" \
|
||||
"adcl $0,%2 \n\t" \
|
||||
:"=r"(c0), "=r"(c1), "=r"(c2): "0"(c0), "1"(c1), "2"(c2), "m"(i), "m"(j) :"%eax","%edx", "%cc");
|
||||
:"=r"(c0), "=r"(c1), "=r"(c2): "0"(c0), "1"(c1), "2"(c2), "m"(i), "m"(j) :"%eax","%edx", "cc");
|
||||
|
||||
#define SQRADDSC(i, j) \
|
||||
asm( \
|
||||
__asm__( \
|
||||
"movl %3,%%eax \n\t" \
|
||||
"mull %4 \n\t" \
|
||||
"movl %%eax,%0 \n\t" \
|
||||
"movl %%edx,%1 \n\t" \
|
||||
"xorl %2,%2 \n\t" \
|
||||
:"=r"(sc0), "=r"(sc1), "=r"(sc2): "g"(i), "g"(j) :"%eax","%edx","%cc");
|
||||
:"=r"(sc0), "=r"(sc1), "=r"(sc2): "g"(i), "g"(j) :"%eax","%edx","cc");
|
||||
|
||||
/* TAO removed sc0,1,2 as input to remove warning so %6,%7 become %3,%4 */
|
||||
|
||||
#define SQRADDAC(i, j) \
|
||||
asm( \
|
||||
__asm__( \
|
||||
"movl %6,%%eax \n\t" \
|
||||
"mull %7 \n\t" \
|
||||
"addl %%eax,%0 \n\t" \
|
||||
"adcl %%edx,%1 \n\t" \
|
||||
"adcl $0,%2 \n\t" \
|
||||
:"=r"(sc0), "=r"(sc1), "=r"(sc2): "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) :"%eax","%edx","%cc");
|
||||
:"=r"(sc0), "=r"(sc1), "=r"(sc2): "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) :"%eax","%edx","cc");
|
||||
|
||||
#define SQRADDDB \
|
||||
asm( \
|
||||
__asm__( \
|
||||
"addl %6,%0 \n\t" \
|
||||
"adcl %7,%1 \n\t" \
|
||||
"adcl %8,%2 \n\t" \
|
||||
"addl %6,%0 \n\t" \
|
||||
"adcl %7,%1 \n\t" \
|
||||
"adcl %8,%2 \n\t" \
|
||||
:"=r"(c0), "=r"(c1), "=r"(c2) : "0"(c0), "1"(c1), "2"(c2), "r"(sc0), "r"(sc1), "r"(sc2) : "%cc");
|
||||
:"=r"(c0), "=r"(c1), "=r"(c2) : "0"(c0), "1"(c1), "2"(c2), "r"(sc0), "r"(sc1), "r"(sc2) : "cc");
|
||||
|
||||
#elif defined(TFM_X86_64)
|
||||
/* x86-64 optimized */
|
||||
@ -545,16 +548,16 @@ asm( \
|
||||
#define COMBA_FINI
|
||||
|
||||
#define SQRADD(i, j) \
|
||||
asm( \
|
||||
__asm__( \
|
||||
"movq %6,%%rax \n\t" \
|
||||
"mulq %%rax \n\t" \
|
||||
"addq %%rax,%0 \n\t" \
|
||||
"adcq %%rdx,%1 \n\t" \
|
||||
"adcq $0,%2 \n\t" \
|
||||
:"=r"(c0), "=r"(c1), "=r"(c2): "0"(c0), "1"(c1), "2"(c2), "g"(i) :"%rax","%rdx","%cc");
|
||||
:"=r"(c0), "=r"(c1), "=r"(c2): "0"(c0), "1"(c1), "2"(c2), "g"(i) :"%rax","%rdx","cc");
|
||||
|
||||
#define SQRADD2(i, j) \
|
||||
asm( \
|
||||
__asm__( \
|
||||
"movq %6,%%rax \n\t" \
|
||||
"mulq %7 \n\t" \
|
||||
"addq %%rax,%0 \n\t" \
|
||||
@ -563,37 +566,37 @@ asm( \
|
||||
"addq %%rax,%0 \n\t" \
|
||||
"adcq %%rdx,%1 \n\t" \
|
||||
"adcq $0,%2 \n\t" \
|
||||
:"=r"(c0), "=r"(c1), "=r"(c2): "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) :"%rax","%rdx","%cc");
|
||||
:"=r"(c0), "=r"(c1), "=r"(c2): "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) :"%rax","%rdx","cc");
|
||||
|
||||
#define SQRADDSC(i, j) \
|
||||
asm( \
|
||||
__asm__( \
|
||||
"movq %3,%%rax \n\t" \
|
||||
"mulq %4 \n\t" \
|
||||
"movq %%rax,%0 \n\t" \
|
||||
"movq %%rdx,%1 \n\t" \
|
||||
"xorq %2,%2 \n\t" \
|
||||
:"=r"(sc0), "=r"(sc1), "=r"(sc2): "g"(i), "g"(j) :"%rax","%rdx","%cc");
|
||||
:"=r"(sc0), "=r"(sc1), "=r"(sc2): "g"(i), "g"(j) :"%rax","%rdx","cc");
|
||||
|
||||
/* TAO removed sc0,1,2 as input to remove warning so %6,%7 become %3,%4 */
|
||||
|
||||
#define SQRADDAC(i, j) \
|
||||
asm( \
|
||||
__asm__( \
|
||||
"movq %6,%%rax \n\t" \
|
||||
"mulq %7 \n\t" \
|
||||
"addq %%rax,%0 \n\t" \
|
||||
"adcq %%rdx,%1 \n\t" \
|
||||
"adcq $0,%2 \n\t" \
|
||||
:"=r"(sc0), "=r"(sc1), "=r"(sc2): "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) :"%rax","%rdx","%cc");
|
||||
:"=r"(sc0), "=r"(sc1), "=r"(sc2): "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) :"%rax","%rdx","cc");
|
||||
|
||||
#define SQRADDDB \
|
||||
asm( \
|
||||
__asm__( \
|
||||
"addq %6,%0 \n\t" \
|
||||
"adcq %7,%1 \n\t" \
|
||||
"adcq %8,%2 \n\t" \
|
||||
"addq %6,%0 \n\t" \
|
||||
"adcq %7,%1 \n\t" \
|
||||
"adcq %8,%2 \n\t" \
|
||||
:"=r"(c0), "=r"(c1), "=r"(c2) : "0"(c0), "1"(c1), "2"(c2), "r"(sc0), "r"(sc1), "r"(sc2) : "%cc");
|
||||
:"=r"(c0), "=r"(c1), "=r"(c2) : "0"(c0), "1"(c1), "2"(c2), "r"(sc0), "r"(sc1), "r"(sc2) : "cc");
|
||||
|
||||
#elif defined(TFM_SSE2)
|
||||
|
||||
@ -613,10 +616,10 @@ asm( \
|
||||
do { c0 = c1; c1 = c2; c2 = 0; } while (0);
|
||||
|
||||
#define COMBA_FINI \
|
||||
asm("emms");
|
||||
__asm__("emms");
|
||||
|
||||
#define SQRADD(i, j) \
|
||||
asm( \
|
||||
__asm__( \
|
||||
"movd %6,%%mm0 \n\t" \
|
||||
"pmuludq %%mm0,%%mm0\n\t" \
|
||||
"movd %%mm0,%%eax \n\t" \
|
||||
@ -625,10 +628,10 @@ asm( \
|
||||
"movd %%mm0,%%eax \n\t" \
|
||||
"adcl %%eax,%1 \n\t" \
|
||||
"adcl $0,%2 \n\t" \
|
||||
:"=r"(c0), "=r"(c1), "=r"(c2): "0"(c0), "1"(c1), "2"(c2), "m"(i) :"%eax","%cc");
|
||||
:"=r"(c0), "=r"(c1), "=r"(c2): "0"(c0), "1"(c1), "2"(c2), "m"(i) :"%eax","cc");
|
||||
|
||||
#define SQRADD2(i, j) \
|
||||
asm( \
|
||||
__asm__( \
|
||||
"movd %6,%%mm0 \n\t" \
|
||||
"movd %7,%%mm1 \n\t" \
|
||||
"pmuludq %%mm1,%%mm0\n\t" \
|
||||
@ -641,10 +644,10 @@ asm( \
|
||||
"addl %%eax,%0 \n\t" \
|
||||
"adcl %%edx,%1 \n\t" \
|
||||
"adcl $0,%2 \n\t" \
|
||||
:"=r"(c0), "=r"(c1), "=r"(c2): "0"(c0), "1"(c1), "2"(c2), "m"(i), "m"(j) :"%eax","%edx","%cc");
|
||||
:"=r"(c0), "=r"(c1), "=r"(c2): "0"(c0), "1"(c1), "2"(c2), "m"(i), "m"(j) :"%eax","%edx","cc");
|
||||
|
||||
#define SQRADDSC(i, j) \
|
||||
asm( \
|
||||
__asm__( \
|
||||
"movd %3,%%mm0 \n\t" \
|
||||
"movd %4,%%mm1 \n\t" \
|
||||
"pmuludq %%mm1,%%mm0\n\t" \
|
||||
@ -657,7 +660,7 @@ asm( \
|
||||
/* TAO removed sc0,1,2 as input to remove warning so %6,%7 become %3,%4 */
|
||||
|
||||
#define SQRADDAC(i, j) \
|
||||
asm( \
|
||||
__asm__( \
|
||||
"movd %6,%%mm0 \n\t" \
|
||||
"movd %7,%%mm1 \n\t" \
|
||||
"pmuludq %%mm1,%%mm0\n\t" \
|
||||
@ -667,17 +670,17 @@ asm( \
|
||||
"addl %%eax,%0 \n\t" \
|
||||
"adcl %%edx,%1 \n\t" \
|
||||
"adcl $0,%2 \n\t" \
|
||||
:"=r"(sc0), "=r"(sc1), "=r"(sc2): "0"(sc0), "1"(sc1), "2"(sc2), "m"(i), "m"(j) :"%eax","%edx","%cc");
|
||||
:"=r"(sc0), "=r"(sc1), "=r"(sc2): "0"(sc0), "1"(sc1), "2"(sc2), "m"(i), "m"(j) :"%eax","%edx","cc");
|
||||
|
||||
#define SQRADDDB \
|
||||
asm( \
|
||||
__asm__( \
|
||||
"addl %6,%0 \n\t" \
|
||||
"adcl %7,%1 \n\t" \
|
||||
"adcl %8,%2 \n\t" \
|
||||
"addl %6,%0 \n\t" \
|
||||
"adcl %7,%1 \n\t" \
|
||||
"adcl %8,%2 \n\t" \
|
||||
:"=r"(c0), "=r"(c1), "=r"(c2) : "0"(c0), "1"(c1), "2"(c2), "r"(sc0), "r"(sc1), "r"(sc2) : "%cc");
|
||||
:"=r"(c0), "=r"(c1), "=r"(c2) : "0"(c0), "1"(c1), "2"(c2), "r"(sc0), "r"(sc1), "r"(sc2) : "cc");
|
||||
|
||||
#elif defined(TFM_ARM)
|
||||
|
||||
@ -701,16 +704,16 @@ asm( \
|
||||
|
||||
/* multiplies point i and j, updates carry "c1" and digit c2 */
|
||||
#define SQRADD(i, j) \
|
||||
asm( \
|
||||
__asm__( \
|
||||
" UMULL r0,r1,%6,%6 \n\t" \
|
||||
" ADDS %0,%0,r0 \n\t" \
|
||||
" ADCS %1,%1,r1 \n\t" \
|
||||
" ADC %2,%2,#0 \n\t" \
|
||||
:"=r"(c0), "=r"(c1), "=r"(c2) : "0"(c0), "1"(c1), "2"(c2), "r"(i) : "r0", "r1", "%cc");
|
||||
:"=r"(c0), "=r"(c1), "=r"(c2) : "0"(c0), "1"(c1), "2"(c2), "r"(i) : "r0", "r1", "cc");
|
||||
|
||||
/* for squaring some of the terms are doubled... */
|
||||
#define SQRADD2(i, j) \
|
||||
asm( \
|
||||
__asm__( \
|
||||
" UMULL r0,r1,%6,%7 \n\t" \
|
||||
" ADDS %0,%0,r0 \n\t" \
|
||||
" ADCS %1,%1,r1 \n\t" \
|
||||
@ -718,31 +721,31 @@ asm( \
|
||||
" ADDS %0,%0,r0 \n\t" \
|
||||
" ADCS %1,%1,r1 \n\t" \
|
||||
" ADC %2,%2,#0 \n\t" \
|
||||
:"=r"(c0), "=r"(c1), "=r"(c2) : "0"(c0), "1"(c1), "2"(c2), "r"(i), "r"(j) : "r0", "r1", "%cc");
|
||||
:"=r"(c0), "=r"(c1), "=r"(c2) : "0"(c0), "1"(c1), "2"(c2), "r"(i), "r"(j) : "r0", "r1", "cc");
|
||||
|
||||
#define SQRADDSC(i, j) \
|
||||
asm( \
|
||||
__asm__( \
|
||||
" UMULL %0,%1,%6,%7 \n\t" \
|
||||
" SUB %2,%2,%2 \n\t" \
|
||||
:"=r"(sc0), "=r"(sc1), "=r"(sc2) : "0"(sc0), "1"(sc1), "2"(sc2), "r"(i), "r"(j) : "%cc");
|
||||
:"=r"(sc0), "=r"(sc1), "=r"(sc2) : "0"(sc0), "1"(sc1), "2"(sc2), "r"(i), "r"(j) : "cc");
|
||||
|
||||
#define SQRADDAC(i, j) \
|
||||
asm( \
|
||||
__asm__( \
|
||||
" UMULL r0,r1,%6,%7 \n\t" \
|
||||
" ADDS %0,%0,r0 \n\t" \
|
||||
" ADCS %1,%1,r1 \n\t" \
|
||||
" ADC %2,%2,#0 \n\t" \
|
||||
:"=r"(sc0), "=r"(sc1), "=r"(sc2) : "0"(sc0), "1"(sc1), "2"(sc2), "r"(i), "r"(j) : "r0", "r1", "%cc");
|
||||
:"=r"(sc0), "=r"(sc1), "=r"(sc2) : "0"(sc0), "1"(sc1), "2"(sc2), "r"(i), "r"(j) : "r0", "r1", "cc");
|
||||
|
||||
#define SQRADDDB \
|
||||
asm( \
|
||||
__asm__( \
|
||||
" ADDS %0,%0,%3 \n\t" \
|
||||
" ADCS %1,%1,%4 \n\t" \
|
||||
" ADC %2,%2,%5 \n\t" \
|
||||
" ADDS %0,%0,%3 \n\t" \
|
||||
" ADCS %1,%1,%4 \n\t" \
|
||||
" ADC %2,%2,%5 \n\t" \
|
||||
:"=r"(c0), "=r"(c1), "=r"(c2) : "r"(sc0), "r"(sc1), "r"(sc2), "0"(c0), "1"(c1), "2"(c2) : "%cc");
|
||||
:"=r"(c0), "=r"(c1), "=r"(c2) : "r"(sc0), "r"(sc1), "r"(sc2), "0"(c0), "1"(c1), "2"(c2) : "cc");
|
||||
|
||||
#elif defined(TFM_PPC32)
|
||||
|
||||
@ -766,17 +769,17 @@ asm( \
|
||||
|
||||
/* multiplies point i and j, updates carry "c1" and digit c2 */
|
||||
#define SQRADD(i, j) \
|
||||
asm( \
|
||||
__asm__( \
|
||||
" mullw 16,%6,%6 \n\t" \
|
||||
" addc %0,%0,16 \n\t" \
|
||||
" mulhwu 16,%6,%6 \n\t" \
|
||||
" adde %1,%1,16 \n\t" \
|
||||
" addze %2,%2 \n\t" \
|
||||
:"=r"(c0), "=r"(c1), "=r"(c2):"0"(c0), "1"(c1), "2"(c2), "r"(i):"16","%cc");
|
||||
:"=r"(c0), "=r"(c1), "=r"(c2):"0"(c0), "1"(c1), "2"(c2), "r"(i):"16","cc");
|
||||
|
||||
/* for squaring some of the terms are doubled... */
|
||||
#define SQRADD2(i, j) \
|
||||
asm( \
|
||||
__asm__( \
|
||||
" mullw 16,%6,%7 \n\t" \
|
||||
" mulhwu 17,%6,%7 \n\t" \
|
||||
" addc %0,%0,16 \n\t" \
|
||||
@ -785,33 +788,33 @@ asm( \
|
||||
" addc %0,%0,16 \n\t" \
|
||||
" adde %1,%1,17 \n\t" \
|
||||
" addze %2,%2 \n\t" \
|
||||
:"=r"(c0), "=r"(c1), "=r"(c2):"0"(c0), "1"(c1), "2"(c2), "r"(i), "r"(j):"16", "17","%cc");
|
||||
:"=r"(c0), "=r"(c1), "=r"(c2):"0"(c0), "1"(c1), "2"(c2), "r"(i), "r"(j):"16", "17","cc");
|
||||
|
||||
#define SQRADDSC(i, j) \
|
||||
asm( \
|
||||
__asm__( \
|
||||
" mullw %0,%6,%7 \n\t" \
|
||||
" mulhwu %1,%6,%7 \n\t" \
|
||||
" xor %2,%2,%2 \n\t" \
|
||||
:"=r"(sc0), "=r"(sc1), "=r"(sc2):"0"(sc0), "1"(sc1), "2"(sc2), "r"(i),"r"(j) : "%cc");
|
||||
:"=r"(sc0), "=r"(sc1), "=r"(sc2):"0"(sc0), "1"(sc1), "2"(sc2), "r"(i),"r"(j) : "cc");
|
||||
|
||||
#define SQRADDAC(i, j) \
|
||||
asm( \
|
||||
__asm__( \
|
||||
" mullw 16,%6,%7 \n\t" \
|
||||
" addc %0,%0,16 \n\t" \
|
||||
" mulhwu 16,%6,%7 \n\t" \
|
||||
" adde %1,%1,16 \n\t" \
|
||||
" addze %2,%2 \n\t" \
|
||||
:"=r"(sc0), "=r"(sc1), "=r"(sc2):"0"(sc0), "1"(sc1), "2"(sc2), "r"(i), "r"(j):"16", "%cc");
|
||||
:"=r"(sc0), "=r"(sc1), "=r"(sc2):"0"(sc0), "1"(sc1), "2"(sc2), "r"(i), "r"(j):"16", "cc");
|
||||
|
||||
#define SQRADDDB \
|
||||
asm( \
|
||||
__asm__( \
|
||||
" addc %0,%0,%3 \n\t" \
|
||||
" adde %1,%1,%4 \n\t" \
|
||||
" adde %2,%2,%5 \n\t" \
|
||||
" addc %0,%0,%3 \n\t" \
|
||||
" adde %1,%1,%4 \n\t" \
|
||||
" adde %2,%2,%5 \n\t" \
|
||||
:"=r"(c0), "=r"(c1), "=r"(c2) : "r"(sc0), "r"(sc1), "r"(sc2), "0"(c0), "1"(c1), "2"(c2) : "%cc");
|
||||
:"=r"(c0), "=r"(c1), "=r"(c2) : "r"(sc0), "r"(sc1), "r"(sc2), "0"(c0), "1"(c1), "2"(c2) : "cc");
|
||||
|
||||
#elif defined(TFM_PPC64)
|
||||
/* PPC64 */
|
||||
@ -834,17 +837,17 @@ asm( \
|
||||
|
||||
/* multiplies point i and j, updates carry "c1" and digit c2 */
|
||||
#define SQRADD(i, j) \
|
||||
asm( \
|
||||
__asm__( \
|
||||
" mulld 16,%6,%6 \n\t" \
|
||||
" addc %0,%0,16 \n\t" \
|
||||
" mulhdu 16,%6,%6 \n\t" \
|
||||
" adde %1,%1,16 \n\t" \
|
||||
" addze %2,%2 \n\t" \
|
||||
:"=r"(c0), "=r"(c1), "=r"(c2):"0"(c0), "1"(c1), "2"(c2), "r"(i):"16","%cc");
|
||||
:"=r"(c0), "=r"(c1), "=r"(c2):"0"(c0), "1"(c1), "2"(c2), "r"(i):"16","cc");
|
||||
|
||||
/* for squaring some of the terms are doubled... */
|
||||
#define SQRADD2(i, j) \
|
||||
asm( \
|
||||
__asm__( \
|
||||
" mulld 16,%6,%7 \n\t" \
|
||||
" mulhdu 17,%6,%7 \n\t" \
|
||||
" addc %0,%0,16 \n\t" \
|
||||
@ -853,33 +856,33 @@ asm( \
|
||||
" addc %0,%0,16 \n\t" \
|
||||
" adde %1,%1,17 \n\t" \
|
||||
" addze %2,%2 \n\t" \
|
||||
:"=r"(c0), "=r"(c1), "=r"(c2):"0"(c0), "1"(c1), "2"(c2), "r"(i), "r"(j):"16", "17","%cc");
|
||||
:"=r"(c0), "=r"(c1), "=r"(c2):"0"(c0), "1"(c1), "2"(c2), "r"(i), "r"(j):"16", "17","cc");
|
||||
|
||||
#define SQRADDSC(i, j) \
|
||||
asm( \
|
||||
__asm__( \
|
||||
" mulld %0,%6,%7 \n\t" \
|
||||
" mulhdu %1,%6,%7 \n\t" \
|
||||
" xor %2,%2,%2 \n\t" \
|
||||
:"=r"(sc0), "=r"(sc1), "=r"(sc2):"0"(sc0), "1"(sc1), "2"(sc2), "r"(i),"r"(j) : "%cc");
|
||||
:"=r"(sc0), "=r"(sc1), "=r"(sc2):"0"(sc0), "1"(sc1), "2"(sc2), "r"(i),"r"(j) : "cc");
|
||||
|
||||
#define SQRADDAC(i, j) \
|
||||
asm( \
|
||||
__asm__( \
|
||||
" mulld 16,%6,%7 \n\t" \
|
||||
" addc %0,%0,16 \n\t" \
|
||||
" mulhdu 16,%6,%7 \n\t" \
|
||||
" adde %1,%1,16 \n\t" \
|
||||
" addze %2,%2 \n\t" \
|
||||
:"=r"(sc0), "=r"(sc1), "=r"(sc2):"0"(sc0), "1"(sc1), "2"(sc2), "r"(i), "r"(j):"16", "%cc");
|
||||
:"=r"(sc0), "=r"(sc1), "=r"(sc2):"0"(sc0), "1"(sc1), "2"(sc2), "r"(i), "r"(j):"16", "cc");
|
||||
|
||||
#define SQRADDDB \
|
||||
asm( \
|
||||
__asm__( \
|
||||
" addc %0,%0,%3 \n\t" \
|
||||
" adde %1,%1,%4 \n\t" \
|
||||
" adde %2,%2,%5 \n\t" \
|
||||
" addc %0,%0,%3 \n\t" \
|
||||
" adde %1,%1,%4 \n\t" \
|
||||
" adde %2,%2,%5 \n\t" \
|
||||
:"=r"(c0), "=r"(c1), "=r"(c2) : "r"(sc0), "r"(sc1), "r"(sc2), "0"(c0), "1"(c1), "2"(c2) : "%cc");
|
||||
:"=r"(c0), "=r"(c1), "=r"(c2) : "r"(sc0), "r"(sc1), "r"(sc2), "0"(c0), "1"(c1), "2"(c2) : "cc");
|
||||
|
||||
|
||||
#elif defined(TFM_AVR32)
|
||||
@ -904,7 +907,7 @@ asm( \
|
||||
|
||||
/* multiplies point i and j, updates carry "c1" and digit c2 */
|
||||
#define SQRADD(i, j) \
|
||||
asm( \
|
||||
__asm__( \
|
||||
" mulu.d r2,%6,%6 \n\t" \
|
||||
" add %0,%0,r2 \n\t" \
|
||||
" adc %1,%1,r3 \n\t" \
|
||||
@ -913,7 +916,7 @@ asm( \
|
||||
|
||||
/* for squaring some of the terms are doubled... */
|
||||
#define SQRADD2(i, j) \
|
||||
asm( \
|
||||
__asm__( \
|
||||
" mulu.d r2,%6,%7 \n\t" \
|
||||
" add %0,%0,r2 \n\t" \
|
||||
" adc %1,%1,r3 \n\t" \
|
||||
@ -924,7 +927,7 @@ asm( \
|
||||
:"=r"(c0), "=r"(c1), "=r"(c2):"0"(c0), "1"(c1), "2"(c2), "r"(i), "r"(j):"r2", "r3");
|
||||
|
||||
#define SQRADDSC(i, j) \
|
||||
asm( \
|
||||
__asm__( \
|
||||
" mulu.d r2,%6,%7 \n\t" \
|
||||
" mov %0,r2 \n\t" \
|
||||
" mov %1,r3 \n\t" \
|
||||
@ -932,7 +935,7 @@ asm( \
|
||||
:"=r"(sc0), "=r"(sc1), "=r"(sc2):"0"(sc0), "1"(sc1), "2"(sc2), "r"(i),"r"(j) : "r2", "r3");
|
||||
|
||||
#define SQRADDAC(i, j) \
|
||||
asm( \
|
||||
__asm__( \
|
||||
" mulu.d r2,%6,%7 \n\t" \
|
||||
" add %0,%0,r2 \n\t" \
|
||||
" adc %1,%1,r3 \n\t" \
|
||||
@ -940,14 +943,14 @@ asm( \
|
||||
:"=r"(sc0), "=r"(sc1), "=r"(sc2):"0"(sc0), "1"(sc1), "2"(sc2), "r"(i), "r"(j):"r2", "r3");
|
||||
|
||||
#define SQRADDDB \
|
||||
asm( \
|
||||
__asm__( \
|
||||
" add %0,%0,%3 \n\t" \
|
||||
" adc %1,%1,%4 \n\t" \
|
||||
" adc %2,%2,%5 \n\t" \
|
||||
" add %0,%0,%3 \n\t" \
|
||||
" adc %1,%1,%4 \n\t" \
|
||||
" adc %2,%2,%5 \n\t" \
|
||||
:"=r"(c0), "=r"(c1), "=r"(c2) : "r"(sc0), "r"(sc1), "r"(sc2), "0"(c0), "1"(c1), "2"(c2) : "%cc");
|
||||
:"=r"(c0), "=r"(c1), "=r"(c2) : "r"(sc0), "r"(sc1), "r"(sc2), "0"(c0), "1"(c1), "2"(c2) : "cc");
|
||||
|
||||
|
||||
#else
|
||||
@ -975,8 +978,9 @@ asm( \
|
||||
/* multiplies point i and j, updates carry "c1" and digit c2 */
|
||||
#define SQRADD(i, j) \
|
||||
do { fp_word t; \
|
||||
t = c0 + ((fp_word)i) * ((fp_word)j); c0 = t; \
|
||||
t = c1 + (t >> DIGIT_BIT); c1 = t; c2 += t >> DIGIT_BIT; \
|
||||
t = c0 + ((fp_word)i) * ((fp_word)j); c0 = (fp_digit)t; \
|
||||
t = c1 + (t >> DIGIT_BIT); c1 = (fp_digit)t; \
|
||||
c2 +=(fp_digit) (t >> DIGIT_BIT); \
|
||||
} while (0);
|
||||
|
||||
|
||||
@ -984,10 +988,12 @@ asm( \
|
||||
#define SQRADD2(i, j) \
|
||||
do { fp_word t; \
|
||||
t = ((fp_word)i) * ((fp_word)j); \
|
||||
tt = (fp_word)c0 + t; c0 = tt; \
|
||||
tt = (fp_word)c1 + (tt >> DIGIT_BIT); c1 = tt; c2 += tt >> DIGIT_BIT; \
|
||||
tt = (fp_word)c0 + t; c0 = tt; \
|
||||
tt = (fp_word)c1 + (tt >> DIGIT_BIT); c1 = tt; c2 += tt >> DIGIT_BIT; \
|
||||
tt = (fp_word)c0 + t; c0 = (fp_digit)tt; \
|
||||
tt = (fp_word)c1 + (tt >> DIGIT_BIT); c1 = (fp_digit)tt; \
|
||||
c2 +=(fp_digit)( tt >> DIGIT_BIT); \
|
||||
tt = (fp_word)c0 + t; c0 = (fp_digit)tt; \
|
||||
tt = (fp_word)c1 + (tt >> DIGIT_BIT); c1 = (fp_digit)tt; \
|
||||
c2 +=(fp_digit) (tt >> DIGIT_BIT); \
|
||||
} while (0);
|
||||
|
||||
#define SQRADDSC(i, j) \
|
||||
@ -1059,13 +1065,13 @@ asm( \
|
||||
|
||||
/* this should multiply i and j */
|
||||
#define MULADD(i, j) \
|
||||
asm( \
|
||||
__asm__( \
|
||||
"movl %6,%%eax \n\t" \
|
||||
"mull %7 \n\t" \
|
||||
"addl %%eax,%0 \n\t" \
|
||||
"adcl %%edx,%1 \n\t" \
|
||||
"adcl $0,%2 \n\t" \
|
||||
:"=r"(c0), "=r"(c1), "=r"(c2): "0"(c0), "1"(c1), "2"(c2), "m"(i), "m"(j) :"%eax","%edx","%cc");
|
||||
:"=r"(c0), "=r"(c1), "=r"(c2): "0"(c0), "1"(c1), "2"(c2), "m"(i), "m"(j) :"%eax","%edx","cc");
|
||||
|
||||
#elif defined(TFM_X86_64)
|
||||
/* x86-64 optimized */
|
||||
@ -1094,13 +1100,13 @@ asm( \
|
||||
|
||||
/* this should multiply i and j */
|
||||
#define MULADD(i, j) \
|
||||
asm ( \
|
||||
__asm__ ( \
|
||||
"movq %6,%%rax \n\t" \
|
||||
"mulq %7 \n\t" \
|
||||
"addq %%rax,%0 \n\t" \
|
||||
"adcq %%rdx,%1 \n\t" \
|
||||
"adcq $0,%2 \n\t" \
|
||||
:"=r"(c0), "=r"(c1), "=r"(c2): "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) :"%rax","%rdx","%cc");
|
||||
:"=r"(c0), "=r"(c1), "=r"(c2): "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) :"%rax","%rdx","cc");
|
||||
|
||||
#elif defined(TFM_SSE2)
|
||||
/* use SSE2 optimizations */
|
||||
@ -1126,11 +1132,11 @@ asm ( \
|
||||
|
||||
/* anything you need at the end */
|
||||
#define COMBA_FINI \
|
||||
asm("emms");
|
||||
__asm__("emms");
|
||||
|
||||
/* this should multiply i and j */
|
||||
#define MULADD(i, j) \
|
||||
asm( \
|
||||
__asm__( \
|
||||
"movd %6,%%mm0 \n\t" \
|
||||
"movd %7,%%mm1 \n\t" \
|
||||
"pmuludq %%mm1,%%mm0\n\t" \
|
||||
@ -1140,7 +1146,7 @@ asm( \
|
||||
"movd %%mm0,%%eax \n\t" \
|
||||
"adcl %%eax,%1 \n\t" \
|
||||
"adcl $0,%2 \n\t" \
|
||||
:"=r"(c0), "=r"(c1), "=r"(c2): "0"(c0), "1"(c1), "2"(c2), "m"(i), "m"(j) :"%eax","%cc");
|
||||
:"=r"(c0), "=r"(c1), "=r"(c2): "0"(c0), "1"(c1), "2"(c2), "m"(i), "m"(j) :"%eax","cc");
|
||||
|
||||
#elif defined(TFM_ARM)
|
||||
/* ARM code */
|
||||
@ -1162,12 +1168,12 @@ asm( \
|
||||
#define COMBA_FINI
|
||||
|
||||
#define MULADD(i, j) \
|
||||
asm( \
|
||||
__asm__( \
|
||||
" UMULL r0,r1,%6,%7 \n\t" \
|
||||
" ADDS %0,%0,r0 \n\t" \
|
||||
" ADCS %1,%1,r1 \n\t" \
|
||||
" ADC %2,%2,#0 \n\t" \
|
||||
:"=r"(c0), "=r"(c1), "=r"(c2) : "0"(c0), "1"(c1), "2"(c2), "r"(i), "r"(j) : "r0", "r1", "%cc");
|
||||
:"=r"(c0), "=r"(c1), "=r"(c2) : "0"(c0), "1"(c1), "2"(c2), "r"(i), "r"(j) : "r0", "r1", "cc");
|
||||
|
||||
#elif defined(TFM_PPC32)
|
||||
/* For 32-bit PPC */
|
||||
@ -1190,7 +1196,7 @@ asm( \
|
||||
|
||||
/* untested: will mulhwu change the flags? Docs say no */
|
||||
#define MULADD(i, j) \
|
||||
asm( \
|
||||
__asm__( \
|
||||
" mullw 16,%6,%7 \n\t" \
|
||||
" addc %0,%0,16 \n\t" \
|
||||
" mulhwu 16,%6,%7 \n\t" \
|
||||
@ -1219,7 +1225,7 @@ asm( \
|
||||
|
||||
/* untested: will mulhwu change the flags? Docs say no */
|
||||
#define MULADD(i, j) \
|
||||
asm( \
|
||||
____asm__( \
|
||||
" mulld 16,%6,%7 \n\t" \
|
||||
" addc %0,%0,16 \n\t" \
|
||||
" mulhdu 16,%6,%7 \n\t" \
|
||||
@ -1248,7 +1254,7 @@ asm( \
|
||||
#define COMBA_FINI
|
||||
|
||||
#define MULADD(i, j) \
|
||||
asm( \
|
||||
____asm__( \
|
||||
" mulu.d r2,%6,%7 \n\t"\
|
||||
" add %0,r2 \n\t"\
|
||||
" adc %1,%1,r3 \n\t"\
|
||||
@ -1274,10 +1280,11 @@ asm( \
|
||||
|
||||
#define COMBA_FINI
|
||||
|
||||
#define MULADD(i, j) \
|
||||
do { fp_word t; \
|
||||
t = (fp_word)c0 + ((fp_word)i) * ((fp_word)j); c0 = t; \
|
||||
t = (fp_word)c1 + (t >> DIGIT_BIT); c1 = t; c2 += t >> DIGIT_BIT; \
|
||||
#define MULADD(i, j) \
|
||||
do { fp_word t; \
|
||||
t = (fp_word)c0 + ((fp_word)i) * ((fp_word)j); c0 = (fp_digit)t; \
|
||||
t = (fp_word)c1 + (t >> DIGIT_BIT); \
|
||||
c1 = (fp_digit)t; c2 += (fp_digit)(t >> DIGIT_BIT); \
|
||||
} while (0);
|
||||
|
||||
#endif
|
||||
|
3208
ctaocrypt/src/asn.c
3208
ctaocrypt/src/asn.c
File diff suppressed because it is too large
Load Diff
467
ctaocrypt/src/blake2b.c
Normal file
467
ctaocrypt/src/blake2b.c
Normal file
@ -0,0 +1,467 @@
|
||||
/*
|
||||
BLAKE2 reference source code package - reference C implementations
|
||||
|
||||
Written in 2012 by Samuel Neves <sneves@dei.uc.pt>
|
||||
|
||||
To the extent possible under law, the author(s) have dedicated all copyright
|
||||
and related and neighboring rights to this software to the public domain
|
||||
worldwide. This software is distributed without any warranty.
|
||||
|
||||
You should have received a copy of the CC0 Public Domain Dedication along with
|
||||
this software. If not, see <http://creativecommons.org/publicdomain/zero/1.0/>.
|
||||
*/
|
||||
/* blake2b.c
|
||||
*
|
||||
* Copyright (C) 2006-2013 wolfSSL Inc.
|
||||
*
|
||||
* 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/settings.h>
|
||||
|
||||
#ifdef HAVE_BLAKE2
|
||||
|
||||
#include <cyassl/ctaocrypt/blake2.h>
|
||||
#include <cyassl/ctaocrypt/blake2-impl.h>
|
||||
|
||||
|
||||
static const word64 blake2b_IV[8] =
|
||||
{
|
||||
0x6a09e667f3bcc908ULL, 0xbb67ae8584caa73bULL,
|
||||
0x3c6ef372fe94f82bULL, 0xa54ff53a5f1d36f1ULL,
|
||||
0x510e527fade682d1ULL, 0x9b05688c2b3e6c1fULL,
|
||||
0x1f83d9abfb41bd6bULL, 0x5be0cd19137e2179ULL
|
||||
};
|
||||
|
||||
static const byte blake2b_sigma[12][16] =
|
||||
{
|
||||
{ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 } ,
|
||||
{ 14, 10, 4, 8, 9, 15, 13, 6, 1, 12, 0, 2, 11, 7, 5, 3 } ,
|
||||
{ 11, 8, 12, 0, 5, 2, 15, 13, 10, 14, 3, 6, 7, 1, 9, 4 } ,
|
||||
{ 7, 9, 3, 1, 13, 12, 11, 14, 2, 6, 5, 10, 4, 0, 15, 8 } ,
|
||||
{ 9, 0, 5, 7, 2, 4, 10, 15, 14, 1, 11, 12, 6, 8, 3, 13 } ,
|
||||
{ 2, 12, 6, 10, 0, 11, 8, 3, 4, 13, 7, 5, 15, 14, 1, 9 } ,
|
||||
{ 12, 5, 1, 15, 14, 13, 4, 10, 0, 7, 6, 3, 9, 2, 8, 11 } ,
|
||||
{ 13, 11, 7, 14, 12, 1, 3, 9, 5, 0, 15, 4, 8, 6, 2, 10 } ,
|
||||
{ 6, 15, 14, 9, 11, 3, 0, 8, 12, 2, 13, 7, 1, 4, 10, 5 } ,
|
||||
{ 10, 2, 8, 4, 7, 6, 1, 5, 15, 11, 9, 14, 3, 12, 13 , 0 } ,
|
||||
{ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 } ,
|
||||
{ 14, 10, 4, 8, 9, 15, 13, 6, 1, 12, 0, 2, 11, 7, 5, 3 }
|
||||
};
|
||||
|
||||
|
||||
static INLINE int blake2b_set_lastnode( blake2b_state *S )
|
||||
{
|
||||
S->f[1] = ~0ULL;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static INLINE int blake2b_clear_lastnode( blake2b_state *S )
|
||||
{
|
||||
S->f[1] = 0ULL;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Some helper functions, not necessarily useful */
|
||||
static INLINE int blake2b_set_lastblock( blake2b_state *S )
|
||||
{
|
||||
if( S->last_node ) blake2b_set_lastnode( S );
|
||||
|
||||
S->f[0] = ~0ULL;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static INLINE int blake2b_clear_lastblock( blake2b_state *S )
|
||||
{
|
||||
if( S->last_node ) blake2b_clear_lastnode( S );
|
||||
|
||||
S->f[0] = 0ULL;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static INLINE int blake2b_increment_counter( blake2b_state *S, const word64
|
||||
inc )
|
||||
{
|
||||
S->t[0] += inc;
|
||||
S->t[1] += ( S->t[0] < inc );
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* Parameter-related functions */
|
||||
static INLINE int blake2b_param_set_digest_length( blake2b_param *P,
|
||||
const byte digest_length )
|
||||
{
|
||||
P->digest_length = digest_length;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static INLINE int blake2b_param_set_fanout( blake2b_param *P, const byte fanout)
|
||||
{
|
||||
P->fanout = fanout;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static INLINE int blake2b_param_set_max_depth( blake2b_param *P,
|
||||
const byte depth )
|
||||
{
|
||||
P->depth = depth;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static INLINE int blake2b_param_set_leaf_length( blake2b_param *P,
|
||||
const word32 leaf_length )
|
||||
{
|
||||
store32( &P->leaf_length, leaf_length );
|
||||
return 0;
|
||||
}
|
||||
|
||||
static INLINE int blake2b_param_set_node_offset( blake2b_param *P,
|
||||
const word64 node_offset )
|
||||
{
|
||||
store64( &P->node_offset, node_offset );
|
||||
return 0;
|
||||
}
|
||||
|
||||
static INLINE int blake2b_param_set_node_depth( blake2b_param *P,
|
||||
const byte node_depth )
|
||||
{
|
||||
P->node_depth = node_depth;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static INLINE int blake2b_param_set_inner_length( blake2b_param *P,
|
||||
const byte inner_length )
|
||||
{
|
||||
P->inner_length = inner_length;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static INLINE int blake2b_param_set_salt( blake2b_param *P,
|
||||
const byte salt[BLAKE2B_SALTBYTES] )
|
||||
{
|
||||
XMEMCPY( P->salt, salt, BLAKE2B_SALTBYTES );
|
||||
return 0;
|
||||
}
|
||||
|
||||
static INLINE int blake2b_param_set_personal( blake2b_param *P,
|
||||
const byte personal[BLAKE2B_PERSONALBYTES] )
|
||||
{
|
||||
XMEMCPY( P->personal, personal, BLAKE2B_PERSONALBYTES );
|
||||
return 0;
|
||||
}
|
||||
|
||||
static INLINE int blake2b_init0( blake2b_state *S )
|
||||
{
|
||||
int i;
|
||||
XMEMSET( S, 0, sizeof( blake2b_state ) );
|
||||
|
||||
for( i = 0; i < 8; ++i ) S->h[i] = blake2b_IV[i];
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* init xors IV with input parameter block */
|
||||
int blake2b_init_param( blake2b_state *S, const blake2b_param *P )
|
||||
{
|
||||
word32 i;
|
||||
blake2b_init0( S );
|
||||
byte *p = ( byte * )( P );
|
||||
|
||||
/* IV XOR ParamBlock */
|
||||
for( i = 0; i < 8; ++i )
|
||||
S->h[i] ^= load64( p + sizeof( S->h[i] ) * i );
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
int blake2b_init( blake2b_state *S, const byte outlen )
|
||||
{
|
||||
blake2b_param P[1];
|
||||
|
||||
if ( ( !outlen ) || ( outlen > BLAKE2B_OUTBYTES ) ) return -1;
|
||||
|
||||
P->digest_length = outlen;
|
||||
P->key_length = 0;
|
||||
P->fanout = 1;
|
||||
P->depth = 1;
|
||||
store32( &P->leaf_length, 0 );
|
||||
store64( &P->node_offset, 0 );
|
||||
P->node_depth = 0;
|
||||
P->inner_length = 0;
|
||||
XMEMSET( P->reserved, 0, sizeof( P->reserved ) );
|
||||
XMEMSET( P->salt, 0, sizeof( P->salt ) );
|
||||
XMEMSET( P->personal, 0, sizeof( P->personal ) );
|
||||
return blake2b_init_param( S, P );
|
||||
}
|
||||
|
||||
|
||||
int blake2b_init_key( blake2b_state *S, const byte outlen, const void *key,
|
||||
const byte keylen )
|
||||
{
|
||||
blake2b_param P[1];
|
||||
|
||||
if ( ( !outlen ) || ( outlen > BLAKE2B_OUTBYTES ) ) return -1;
|
||||
|
||||
if ( !key || !keylen || keylen > BLAKE2B_KEYBYTES ) return -1;
|
||||
|
||||
P->digest_length = outlen;
|
||||
P->key_length = keylen;
|
||||
P->fanout = 1;
|
||||
P->depth = 1;
|
||||
store32( &P->leaf_length, 0 );
|
||||
store64( &P->node_offset, 0 );
|
||||
P->node_depth = 0;
|
||||
P->inner_length = 0;
|
||||
XMEMSET( P->reserved, 0, sizeof( P->reserved ) );
|
||||
XMEMSET( P->salt, 0, sizeof( P->salt ) );
|
||||
XMEMSET( P->personal, 0, sizeof( P->personal ) );
|
||||
|
||||
if( blake2b_init_param( S, P ) < 0 ) return -1;
|
||||
|
||||
{
|
||||
byte block[BLAKE2B_BLOCKBYTES];
|
||||
XMEMSET( block, 0, BLAKE2B_BLOCKBYTES );
|
||||
XMEMCPY( block, key, keylen );
|
||||
blake2b_update( S, block, BLAKE2B_BLOCKBYTES );
|
||||
secure_zero_memory( block, BLAKE2B_BLOCKBYTES ); /* Burn the key from */
|
||||
/*stack */
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int blake2b_compress( blake2b_state *S,
|
||||
const byte block[BLAKE2B_BLOCKBYTES] )
|
||||
{
|
||||
word64 m[16];
|
||||
word64 v[16];
|
||||
int i;
|
||||
|
||||
for( i = 0; i < 16; ++i )
|
||||
m[i] = load64( block + i * sizeof( m[i] ) );
|
||||
|
||||
for( i = 0; i < 8; ++i )
|
||||
v[i] = S->h[i];
|
||||
|
||||
v[ 8] = blake2b_IV[0];
|
||||
v[ 9] = blake2b_IV[1];
|
||||
v[10] = blake2b_IV[2];
|
||||
v[11] = blake2b_IV[3];
|
||||
v[12] = S->t[0] ^ blake2b_IV[4];
|
||||
v[13] = S->t[1] ^ blake2b_IV[5];
|
||||
v[14] = S->f[0] ^ blake2b_IV[6];
|
||||
v[15] = S->f[1] ^ blake2b_IV[7];
|
||||
#define G(r,i,a,b,c,d) \
|
||||
do { \
|
||||
a = a + b + m[blake2b_sigma[r][2*i+0]]; \
|
||||
d = rotr64(d ^ a, 32); \
|
||||
c = c + d; \
|
||||
b = rotr64(b ^ c, 24); \
|
||||
a = a + b + m[blake2b_sigma[r][2*i+1]]; \
|
||||
d = rotr64(d ^ a, 16); \
|
||||
c = c + d; \
|
||||
b = rotr64(b ^ c, 63); \
|
||||
} while(0)
|
||||
#define ROUND(r) \
|
||||
do { \
|
||||
G(r,0,v[ 0],v[ 4],v[ 8],v[12]); \
|
||||
G(r,1,v[ 1],v[ 5],v[ 9],v[13]); \
|
||||
G(r,2,v[ 2],v[ 6],v[10],v[14]); \
|
||||
G(r,3,v[ 3],v[ 7],v[11],v[15]); \
|
||||
G(r,4,v[ 0],v[ 5],v[10],v[15]); \
|
||||
G(r,5,v[ 1],v[ 6],v[11],v[12]); \
|
||||
G(r,6,v[ 2],v[ 7],v[ 8],v[13]); \
|
||||
G(r,7,v[ 3],v[ 4],v[ 9],v[14]); \
|
||||
} while(0)
|
||||
ROUND( 0 );
|
||||
ROUND( 1 );
|
||||
ROUND( 2 );
|
||||
ROUND( 3 );
|
||||
ROUND( 4 );
|
||||
ROUND( 5 );
|
||||
ROUND( 6 );
|
||||
ROUND( 7 );
|
||||
ROUND( 8 );
|
||||
ROUND( 9 );
|
||||
ROUND( 10 );
|
||||
ROUND( 11 );
|
||||
|
||||
for( i = 0; i < 8; ++i )
|
||||
S->h[i] = S->h[i] ^ v[i] ^ v[i + 8];
|
||||
|
||||
#undef G
|
||||
#undef ROUND
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* inlen now in bytes */
|
||||
int blake2b_update( blake2b_state *S, const byte *in, word64 inlen )
|
||||
{
|
||||
while( inlen > 0 )
|
||||
{
|
||||
word64 left = S->buflen;
|
||||
word64 fill = 2 * BLAKE2B_BLOCKBYTES - left;
|
||||
|
||||
if( inlen > fill )
|
||||
{
|
||||
XMEMCPY( S->buf + left, in, (word)fill ); /* Fill buffer */
|
||||
S->buflen += fill;
|
||||
blake2b_increment_counter( S, BLAKE2B_BLOCKBYTES );
|
||||
blake2b_compress( S, S->buf ); /* Compress */
|
||||
XMEMCPY( S->buf, S->buf + BLAKE2B_BLOCKBYTES, BLAKE2B_BLOCKBYTES );
|
||||
/* Shift buffer left */
|
||||
S->buflen -= BLAKE2B_BLOCKBYTES;
|
||||
in += fill;
|
||||
inlen -= fill;
|
||||
}
|
||||
else /* inlen <= fill */
|
||||
{
|
||||
XMEMCPY( S->buf + left, in, (word)inlen );
|
||||
S->buflen += inlen; /* Be lazy, do not compress */
|
||||
in += inlen;
|
||||
inlen -= inlen;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Is this correct? */
|
||||
int blake2b_final( blake2b_state *S, byte *out, byte outlen )
|
||||
{
|
||||
byte buffer[BLAKE2B_OUTBYTES];
|
||||
int i;
|
||||
|
||||
if( S->buflen > BLAKE2B_BLOCKBYTES )
|
||||
{
|
||||
blake2b_increment_counter( S, BLAKE2B_BLOCKBYTES );
|
||||
blake2b_compress( S, S->buf );
|
||||
S->buflen -= BLAKE2B_BLOCKBYTES;
|
||||
XMEMCPY( S->buf, S->buf + BLAKE2B_BLOCKBYTES, (word)S->buflen );
|
||||
}
|
||||
|
||||
blake2b_increment_counter( S, S->buflen );
|
||||
blake2b_set_lastblock( S );
|
||||
XMEMSET( S->buf + S->buflen, 0, (word)(2 * BLAKE2B_BLOCKBYTES - S->buflen) );
|
||||
/* Padding */
|
||||
blake2b_compress( S, S->buf );
|
||||
|
||||
for( i = 0; i < 8; ++i ) /* Output full hash to temp buffer */
|
||||
store64( buffer + sizeof( S->h[i] ) * i, S->h[i] );
|
||||
|
||||
XMEMCPY( out, buffer, outlen );
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* inlen, at least, should be word64. Others can be size_t. */
|
||||
int blake2b( byte *out, const void *in, const void *key, const byte outlen,
|
||||
const word64 inlen, byte keylen )
|
||||
{
|
||||
blake2b_state S[1];
|
||||
|
||||
/* Verify parameters */
|
||||
if ( NULL == in ) return -1;
|
||||
|
||||
if ( NULL == out ) return -1;
|
||||
|
||||
if( NULL == key ) keylen = 0;
|
||||
|
||||
if( keylen > 0 )
|
||||
{
|
||||
if( blake2b_init_key( S, outlen, key, keylen ) < 0 ) return -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
if( blake2b_init( S, outlen ) < 0 ) return -1;
|
||||
}
|
||||
|
||||
blake2b_update( S, ( byte * )in, inlen );
|
||||
blake2b_final( S, out, outlen );
|
||||
return 0;
|
||||
}
|
||||
|
||||
#if defined(BLAKE2B_SELFTEST)
|
||||
#include <string.h>
|
||||
#include "blake2-kat.h"
|
||||
int main( int argc, char **argv )
|
||||
{
|
||||
byte key[BLAKE2B_KEYBYTES];
|
||||
byte buf[KAT_LENGTH];
|
||||
|
||||
for( word32 i = 0; i < BLAKE2B_KEYBYTES; ++i )
|
||||
key[i] = ( byte )i;
|
||||
|
||||
for( word32 i = 0; i < KAT_LENGTH; ++i )
|
||||
buf[i] = ( byte )i;
|
||||
|
||||
for( word32 i = 0; i < KAT_LENGTH; ++i )
|
||||
{
|
||||
byte hash[BLAKE2B_OUTBYTES];
|
||||
blake2b( hash, buf, key, BLAKE2B_OUTBYTES, i, BLAKE2B_KEYBYTES );
|
||||
|
||||
if( 0 != memcmp( hash, blake2b_keyed_kat[i], BLAKE2B_OUTBYTES ) )
|
||||
{
|
||||
puts( "error" );
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
puts( "ok" );
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
/* CTaoCrypt API */
|
||||
|
||||
/* Init Blake2b digest, track size incase final doesn't want to "remember" */
|
||||
int InitBlake2b(Blake2b* b2b, word32 digestSz)
|
||||
{
|
||||
b2b->digestSz = digestSz;
|
||||
|
||||
return blake2b_init(b2b->S, (byte)digestSz);
|
||||
}
|
||||
|
||||
|
||||
/* Blake2b Update */
|
||||
int Blake2bUpdate(Blake2b* b2b, const byte* data, word32 sz)
|
||||
{
|
||||
return blake2b_update(b2b->S, data, sz);
|
||||
}
|
||||
|
||||
|
||||
/* Blake2b Final, if pass in zero size we use init digestSz */
|
||||
int Blake2bFinal(Blake2b* b2b, byte* final, word32 requestSz)
|
||||
{
|
||||
word32 sz = requestSz ? requestSz : b2b->digestSz;
|
||||
|
||||
return blake2b_final(b2b->S, final, (byte)sz);
|
||||
}
|
||||
|
||||
|
||||
/* end CTaoCrypt API */
|
||||
|
||||
#endif /* HAVE_BLAKE2 */
|
||||
|
1572
ctaocrypt/src/camellia.c
Normal file
1572
ctaocrypt/src/camellia.c
Normal file
File diff suppressed because it is too large
Load Diff
@ -1,6 +1,6 @@
|
||||
/* coding.c
|
||||
*
|
||||
* Copyright (C) 2006-2012 Sawtooth Consulting Ltd.
|
||||
* Copyright (C) 2006-2013 wolfSSL Inc.
|
||||
*
|
||||
* This file is part of CyaSSL.
|
||||
*
|
||||
@ -23,6 +23,10 @@
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
#include <cyassl/ctaocrypt/settings.h>
|
||||
|
||||
#ifndef NO_CODING
|
||||
|
||||
#include <cyassl/ctaocrypt/coding.h>
|
||||
#include <cyassl/ctaocrypt/error.h>
|
||||
#include <cyassl/ctaocrypt/logging.h>
|
||||
@ -54,6 +58,7 @@ 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;
|
||||
@ -75,6 +80,16 @@ int Base64_Decode(const byte* in, word32 inLen, byte* out, word32* outLen)
|
||||
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];
|
||||
@ -93,16 +108,18 @@ int Base64_Decode(const byte* in, word32 inLen, byte* out, word32* outLen)
|
||||
break;
|
||||
|
||||
inLen -= 4;
|
||||
if (in[j] == ' ' || in[j] == '\r' || in[j] == '\n') {
|
||||
if (inLen && (in[j] == ' ' || in[j] == '\r' || in[j] == '\n')) {
|
||||
byte endLine = in[j++];
|
||||
inLen--;
|
||||
while (endLine == ' ') { /* allow trailing whitespace */
|
||||
while (inLen && endLine == ' ') { /* allow trailing whitespace */
|
||||
endLine = in[j++];
|
||||
inLen--;
|
||||
}
|
||||
if (endLine == '\r') {
|
||||
endLine = in[j++];
|
||||
inLen--;
|
||||
if (inLen) {
|
||||
endLine = in[j++];
|
||||
inLen--;
|
||||
}
|
||||
}
|
||||
if (endLine != '\n') {
|
||||
CYASSL_MSG("Bad end of line in Base64 Decode");
|
||||
@ -251,4 +268,5 @@ int Base16_Decode(const byte* in, word32 inLen, byte* out, word32* outLen)
|
||||
}
|
||||
|
||||
|
||||
#endif /* OPENSSL_EXTRA */
|
||||
#endif /* defined(OPENSSL_EXTRA) || defined (SESSION_CERTS) || defined(CYASSL_KEY_GEN) || defined(CYASSL_CERT_GEN) || defined(HAVE_WEBSERVER) */
|
||||
#endif /* NO_CODING */
|
||||
|
169
ctaocrypt/src/compress.c
Normal file
169
ctaocrypt/src/compress.c
Normal file
@ -0,0 +1,169 @@
|
||||
/* compress.c
|
||||
*
|
||||
* Copyright (C) 2006-2013 wolfSSL Inc.
|
||||
*
|
||||
* 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/settings.h>
|
||||
|
||||
#ifdef HAVE_LIBZ
|
||||
|
||||
|
||||
#include <cyassl/ctaocrypt/compress.h>
|
||||
#include <cyassl/ctaocrypt/error.h>
|
||||
#include <cyassl/ctaocrypt/logging.h>
|
||||
#ifdef NO_INLINE
|
||||
#include <cyassl/ctaocrypt/misc.h>
|
||||
#else
|
||||
#include <ctaocrypt/src/misc.c>
|
||||
#endif
|
||||
|
||||
#include <zlib.h>
|
||||
|
||||
|
||||
/* alloc user allocs to work with zlib */
|
||||
static void* myAlloc(void* opaque, unsigned int item, unsigned int size)
|
||||
{
|
||||
(void)opaque;
|
||||
return XMALLOC(item * size, opaque, DYNAMIC_TYPE_LIBZ);
|
||||
}
|
||||
|
||||
|
||||
static void myFree(void* opaque, void* memory)
|
||||
{
|
||||
(void)opaque;
|
||||
XFREE(memory, opaque, DYNAMIC_TYPE_LIBZ);
|
||||
}
|
||||
|
||||
|
||||
#ifdef HAVE_MCAPI
|
||||
#define DEFLATE_DEFAULT_WINDOWBITS 11
|
||||
#define DEFLATE_DEFAULT_MEMLEVEL 1
|
||||
#else
|
||||
#define DEFLATE_DEFAULT_WINDOWBITS 15
|
||||
#define DEFLATE_DEFAULT_MEMLEVEL 8
|
||||
#endif
|
||||
|
||||
|
||||
int Compress(byte* out, word32 outSz, const byte* in, word32 inSz, word32 flags)
|
||||
/*
|
||||
* out - pointer to destination buffer
|
||||
* outSz - size of destination buffer
|
||||
* in - pointer to source buffer to compress
|
||||
* inSz - size of source to compress
|
||||
* flags - flags to control how compress operates
|
||||
*
|
||||
* return:
|
||||
* negative - error code
|
||||
* positive - bytes stored in out buffer
|
||||
*
|
||||
* Note, the output buffer still needs to be larger than the input buffer.
|
||||
* The right chunk of data won't compress at all, and the lookup table will
|
||||
* add to the size of the output. The libz code says the compressed
|
||||
* buffer should be srcSz + 0.1% + 12.
|
||||
*/
|
||||
{
|
||||
z_stream stream;
|
||||
int result = 0;
|
||||
|
||||
stream.next_in = (Bytef*)in;
|
||||
stream.avail_in = (uInt)inSz;
|
||||
#ifdef MAXSEG_64K
|
||||
/* Check for source > 64K on 16-bit machine: */
|
||||
if ((uLong)stream.avail_in != inSz) return COMPRESS_INIT_E;
|
||||
#endif
|
||||
stream.next_out = out;
|
||||
stream.avail_out = (uInt)outSz;
|
||||
if ((uLong)stream.avail_out != outSz) return COMPRESS_INIT_E;
|
||||
|
||||
stream.zalloc = (alloc_func)myAlloc;
|
||||
stream.zfree = (free_func)myFree;
|
||||
stream.opaque = (voidpf)0;
|
||||
|
||||
if (deflateInit2(&stream, Z_DEFAULT_COMPRESSION, Z_DEFLATED,
|
||||
DEFLATE_DEFAULT_WINDOWBITS, DEFLATE_DEFAULT_MEMLEVEL,
|
||||
flags ? Z_FIXED : Z_DEFAULT_STRATEGY) != Z_OK)
|
||||
return COMPRESS_INIT_E;
|
||||
|
||||
if (deflate(&stream, Z_FINISH) != Z_STREAM_END) {
|
||||
deflateEnd(&stream);
|
||||
return COMPRESS_E;
|
||||
}
|
||||
|
||||
result = (int)stream.total_out;
|
||||
|
||||
if (deflateEnd(&stream) != Z_OK)
|
||||
result = COMPRESS_E;
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
int DeCompress(byte* out, word32 outSz, const byte* in, word32 inSz)
|
||||
/*
|
||||
* out - pointer to destination buffer
|
||||
* outSz - size of destination buffer
|
||||
* in - pointer to source buffer to compress
|
||||
* inSz - size of source to compress
|
||||
* flags - flags to control how compress operates
|
||||
*
|
||||
* return:
|
||||
* negative - error code
|
||||
* positive - bytes stored in out buffer
|
||||
*/
|
||||
{
|
||||
z_stream stream;
|
||||
int result = 0;
|
||||
|
||||
stream.next_in = (Bytef*)in;
|
||||
stream.avail_in = (uInt)inSz;
|
||||
/* Check for source > 64K on 16-bit machine: */
|
||||
if ((uLong)stream.avail_in != inSz) return DECOMPRESS_INIT_E;
|
||||
|
||||
stream.next_out = out;
|
||||
stream.avail_out = (uInt)outSz;
|
||||
if ((uLong)stream.avail_out != outSz) return DECOMPRESS_INIT_E;
|
||||
|
||||
stream.zalloc = (alloc_func)myAlloc;
|
||||
stream.zfree = (free_func)myFree;
|
||||
stream.opaque = (voidpf)0;
|
||||
|
||||
if (inflateInit2(&stream, DEFLATE_DEFAULT_WINDOWBITS) != Z_OK)
|
||||
return DECOMPRESS_INIT_E;
|
||||
|
||||
if (inflate(&stream, Z_FINISH) != Z_STREAM_END) {
|
||||
inflateEnd(&stream);
|
||||
return DECOMPRESS_E;
|
||||
}
|
||||
|
||||
result = (int)stream.total_out;
|
||||
|
||||
if (inflateEnd(&stream) != Z_OK)
|
||||
result = DECOMPRESS_E;
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
#endif /* HAVE_LIBZ */
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* des3.c
|
||||
*
|
||||
* Copyright (C) 2006-2012 Sawtooth Consulting Ltd.
|
||||
* Copyright (C) 2006-2013 wolfSSL Inc.
|
||||
*
|
||||
* This file is part of CyaSSL.
|
||||
*
|
||||
@ -23,6 +23,8 @@
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
#include <cyassl/ctaocrypt/settings.h>
|
||||
|
||||
#ifndef NO_DES3
|
||||
|
||||
#include <cyassl/ctaocrypt/des3.h>
|
||||
@ -34,6 +36,232 @@
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef HAVE_CAVIUM
|
||||
static void Des3_CaviumSetKey(Des3* des3, const byte* key, const byte* iv);
|
||||
static void Des3_CaviumCbcEncrypt(Des3* des3, byte* out, const byte* in,
|
||||
word32 length);
|
||||
static void Des3_CaviumCbcDecrypt(Des3* des3, byte* out, const byte* in,
|
||||
word32 length);
|
||||
#endif
|
||||
|
||||
#ifdef STM32F2_CRYPTO
|
||||
/*
|
||||
* STM32F2 hardware DES/3DES support through the STM32F2 standard
|
||||
* peripheral library. Documentation located in STM32F2xx Standard
|
||||
* Peripheral Library document (See note in README).
|
||||
*/
|
||||
#include "stm32f2xx.h"
|
||||
#include "stm32f2xx_cryp.h"
|
||||
|
||||
void Des_SetKey(Des* des, const byte* key, const byte* iv, int dir)
|
||||
{
|
||||
word32 *dkey = des->key;
|
||||
|
||||
XMEMCPY(dkey, key, 8);
|
||||
ByteReverseWords(dkey, dkey, 8);
|
||||
|
||||
Des_SetIV(des, iv);
|
||||
}
|
||||
|
||||
void Des3_SetKey(Des3* des, const byte* key, const byte* iv, int dir)
|
||||
{
|
||||
word32 *dkey1 = des->key[0];
|
||||
word32 *dkey2 = des->key[1];
|
||||
word32 *dkey3 = des->key[2];
|
||||
|
||||
XMEMCPY(dkey1, key, 8); /* set key 1 */
|
||||
XMEMCPY(dkey2, key + 8, 8); /* set key 2 */
|
||||
XMEMCPY(dkey3, key + 16, 8); /* set key 3 */
|
||||
|
||||
ByteReverseWords(dkey1, dkey1, 8);
|
||||
ByteReverseWords(dkey2, dkey2, 8);
|
||||
ByteReverseWords(dkey3, dkey3, 8);
|
||||
|
||||
Des3_SetIV(des, iv);
|
||||
}
|
||||
|
||||
void DesCrypt(Des* des, byte* out, const byte* in, word32 sz,
|
||||
int dir, int mode)
|
||||
{
|
||||
word32 *dkey, *iv;
|
||||
CRYP_InitTypeDef DES_CRYP_InitStructure;
|
||||
CRYP_KeyInitTypeDef DES_CRYP_KeyInitStructure;
|
||||
CRYP_IVInitTypeDef DES_CRYP_IVInitStructure;
|
||||
|
||||
dkey = des->key;
|
||||
iv = des->reg;
|
||||
|
||||
/* crypto structure initialization */
|
||||
CRYP_KeyStructInit(&DES_CRYP_KeyInitStructure);
|
||||
CRYP_StructInit(&DES_CRYP_InitStructure);
|
||||
CRYP_IVStructInit(&DES_CRYP_IVInitStructure);
|
||||
|
||||
/* reset registers to their default values */
|
||||
CRYP_DeInit();
|
||||
|
||||
/* set direction, mode, and datatype */
|
||||
if (dir == DES_ENCRYPTION) {
|
||||
DES_CRYP_InitStructure.CRYP_AlgoDir = CRYP_AlgoDir_Encrypt;
|
||||
} else { /* DES_DECRYPTION */
|
||||
DES_CRYP_InitStructure.CRYP_AlgoDir = CRYP_AlgoDir_Decrypt;
|
||||
}
|
||||
|
||||
if (mode == DES_CBC) {
|
||||
DES_CRYP_InitStructure.CRYP_AlgoMode = CRYP_AlgoMode_DES_CBC;
|
||||
} else { /* DES_ECB */
|
||||
DES_CRYP_InitStructure.CRYP_AlgoMode = CRYP_AlgoMode_DES_ECB;
|
||||
}
|
||||
|
||||
DES_CRYP_InitStructure.CRYP_DataType = CRYP_DataType_8b;
|
||||
CRYP_Init(&DES_CRYP_InitStructure);
|
||||
|
||||
/* load key into correct registers */
|
||||
DES_CRYP_KeyInitStructure.CRYP_Key1Left = dkey[0];
|
||||
DES_CRYP_KeyInitStructure.CRYP_Key1Right = dkey[1];
|
||||
CRYP_KeyInit(&DES_CRYP_KeyInitStructure);
|
||||
|
||||
/* set iv */
|
||||
ByteReverseWords(iv, iv, DES_BLOCK_SIZE);
|
||||
DES_CRYP_IVInitStructure.CRYP_IV0Left = iv[0];
|
||||
DES_CRYP_IVInitStructure.CRYP_IV0Right = iv[1];
|
||||
CRYP_IVInit(&DES_CRYP_IVInitStructure);
|
||||
|
||||
/* enable crypto processor */
|
||||
CRYP_Cmd(ENABLE);
|
||||
|
||||
while (sz > 0)
|
||||
{
|
||||
/* flush IN/OUT FIFOs */
|
||||
CRYP_FIFOFlush();
|
||||
|
||||
/* if input and output same will overwrite input iv */
|
||||
XMEMCPY(des->tmp, in + sz - DES_BLOCK_SIZE, DES_BLOCK_SIZE);
|
||||
|
||||
CRYP_DataIn(*(uint32_t*)&in[0]);
|
||||
CRYP_DataIn(*(uint32_t*)&in[4]);
|
||||
|
||||
/* wait until the complete message has been processed */
|
||||
while(CRYP_GetFlagStatus(CRYP_FLAG_BUSY) != RESET) {}
|
||||
|
||||
*(uint32_t*)&out[0] = CRYP_DataOut();
|
||||
*(uint32_t*)&out[4] = CRYP_DataOut();
|
||||
|
||||
/* store iv for next call */
|
||||
XMEMCPY(des->reg, des->tmp, DES_BLOCK_SIZE);
|
||||
|
||||
sz -= DES_BLOCK_SIZE;
|
||||
in += DES_BLOCK_SIZE;
|
||||
out += DES_BLOCK_SIZE;
|
||||
}
|
||||
|
||||
/* disable crypto processor */
|
||||
CRYP_Cmd(DISABLE);
|
||||
}
|
||||
|
||||
void Des_CbcEncrypt(Des* des, byte* out, const byte* in, word32 sz)
|
||||
{
|
||||
DesCrypt(des, out, in, sz, DES_ENCRYPTION, DES_CBC);
|
||||
}
|
||||
|
||||
void Des_CbcDecrypt(Des* des, byte* out, const byte* in, word32 sz)
|
||||
{
|
||||
DesCrypt(des, out, in, sz, DES_DECRYPTION, DES_CBC);
|
||||
}
|
||||
|
||||
void Des_EcbEncrypt(Des* des, byte* out, const byte* in, word32 sz)
|
||||
{
|
||||
DesCrypt(des, out, in, sz, DES_ENCRYPTION, DES_ECB);
|
||||
}
|
||||
|
||||
void Des3Crypt(Des3* des, byte* out, const byte* in, word32 sz,
|
||||
int dir)
|
||||
{
|
||||
word32 *dkey1, *dkey2, *dkey3, *iv;
|
||||
CRYP_InitTypeDef DES3_CRYP_InitStructure;
|
||||
CRYP_KeyInitTypeDef DES3_CRYP_KeyInitStructure;
|
||||
CRYP_IVInitTypeDef DES3_CRYP_IVInitStructure;
|
||||
|
||||
dkey1 = des->key[0];
|
||||
dkey2 = des->key[1];
|
||||
dkey3 = des->key[2];
|
||||
iv = des->reg;
|
||||
|
||||
/* crypto structure initialization */
|
||||
CRYP_KeyStructInit(&DES3_CRYP_KeyInitStructure);
|
||||
CRYP_StructInit(&DES3_CRYP_InitStructure);
|
||||
CRYP_IVStructInit(&DES3_CRYP_IVInitStructure);
|
||||
|
||||
/* reset registers to their default values */
|
||||
CRYP_DeInit();
|
||||
|
||||
/* set direction, mode, and datatype */
|
||||
if (dir == DES_ENCRYPTION) {
|
||||
DES3_CRYP_InitStructure.CRYP_AlgoDir = CRYP_AlgoDir_Encrypt;
|
||||
} else {
|
||||
DES3_CRYP_InitStructure.CRYP_AlgoDir = CRYP_AlgoDir_Decrypt;
|
||||
}
|
||||
|
||||
DES3_CRYP_InitStructure.CRYP_AlgoMode = CRYP_AlgoMode_TDES_CBC;
|
||||
DES3_CRYP_InitStructure.CRYP_DataType = CRYP_DataType_8b;
|
||||
CRYP_Init(&DES3_CRYP_InitStructure);
|
||||
|
||||
/* load key into correct registers */
|
||||
DES3_CRYP_KeyInitStructure.CRYP_Key1Left = dkey1[0];
|
||||
DES3_CRYP_KeyInitStructure.CRYP_Key1Right = dkey1[1];
|
||||
DES3_CRYP_KeyInitStructure.CRYP_Key2Left = dkey2[0];
|
||||
DES3_CRYP_KeyInitStructure.CRYP_Key2Right = dkey2[1];
|
||||
DES3_CRYP_KeyInitStructure.CRYP_Key3Left = dkey3[0];
|
||||
DES3_CRYP_KeyInitStructure.CRYP_Key3Right = dkey3[1];
|
||||
CRYP_KeyInit(&DES3_CRYP_KeyInitStructure);
|
||||
|
||||
/* set iv */
|
||||
ByteReverseWords(iv, iv, DES_BLOCK_SIZE);
|
||||
DES3_CRYP_IVInitStructure.CRYP_IV0Left = iv[0];
|
||||
DES3_CRYP_IVInitStructure.CRYP_IV0Right = iv[1];
|
||||
CRYP_IVInit(&DES3_CRYP_IVInitStructure);
|
||||
|
||||
/* enable crypto processor */
|
||||
CRYP_Cmd(ENABLE);
|
||||
|
||||
while (sz > 0)
|
||||
{
|
||||
/* flush IN/OUT FIFOs */
|
||||
CRYP_FIFOFlush();
|
||||
|
||||
CRYP_DataIn(*(uint32_t*)&in[0]);
|
||||
CRYP_DataIn(*(uint32_t*)&in[4]);
|
||||
|
||||
/* wait until the complete message has been processed */
|
||||
while(CRYP_GetFlagStatus(CRYP_FLAG_BUSY) != RESET) {}
|
||||
|
||||
*(uint32_t*)&out[0] = CRYP_DataOut();
|
||||
*(uint32_t*)&out[4] = CRYP_DataOut();
|
||||
|
||||
/* store iv for next call */
|
||||
XMEMCPY(des->reg, out + sz - DES_BLOCK_SIZE, DES_BLOCK_SIZE);
|
||||
|
||||
sz -= DES_BLOCK_SIZE;
|
||||
in += DES_BLOCK_SIZE;
|
||||
out += DES_BLOCK_SIZE;
|
||||
}
|
||||
|
||||
/* disable crypto processor */
|
||||
CRYP_Cmd(DISABLE);
|
||||
|
||||
}
|
||||
|
||||
void Des3_CbcEncrypt(Des3* des, byte* out, const byte* in, word32 sz)
|
||||
{
|
||||
Des3Crypt(des, out, in, sz, DES_ENCRYPTION);
|
||||
}
|
||||
|
||||
void Des3_CbcDecrypt(Des3* des, byte* out, const byte* in, word32 sz)
|
||||
{
|
||||
Des3Crypt(des, out, in, sz, DES_DECRYPTION);
|
||||
}
|
||||
|
||||
#else /* CTaoCrypt software implementation */
|
||||
|
||||
/* permuted choice table (key) */
|
||||
static const byte pc1[] = {
|
||||
57, 49, 41, 33, 25, 17, 9,
|
||||
@ -327,20 +555,6 @@ static INLINE int Reverse(int 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);
|
||||
@ -351,6 +565,11 @@ void Des_SetKey(Des* des, const byte* key, const byte* iv, int dir)
|
||||
|
||||
void Des3_SetKey(Des3* des, const byte* key, const byte* iv, int dir)
|
||||
{
|
||||
#ifdef HAVE_CAVIUM
|
||||
if (des->magic == CYASSL_3DES_CAVIUM_MAGIC)
|
||||
return Des3_CaviumSetKey(des, key, iv);
|
||||
#endif
|
||||
|
||||
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]);
|
||||
@ -460,7 +679,7 @@ void Des_CbcEncrypt(Des* des, byte* out, const byte* in, word32 sz)
|
||||
void Des_CbcDecrypt(Des* des, byte* out, const byte* in, word32 sz)
|
||||
{
|
||||
word32 blocks = sz / DES_BLOCK_SIZE;
|
||||
byte hold[16];
|
||||
byte hold[DES_BLOCK_SIZE];
|
||||
|
||||
while (blocks--) {
|
||||
XMEMCPY(des->tmp, in, DES_BLOCK_SIZE);
|
||||
@ -479,8 +698,14 @@ void Des_CbcDecrypt(Des* des, byte* out, const byte* in, word32 sz)
|
||||
|
||||
void Des3_CbcEncrypt(Des3* des, byte* out, const byte* in, word32 sz)
|
||||
{
|
||||
word32 blocks = sz / DES_BLOCK_SIZE;
|
||||
word32 blocks;
|
||||
|
||||
#ifdef HAVE_CAVIUM
|
||||
if (des->magic == CYASSL_3DES_CAVIUM_MAGIC)
|
||||
return Des3_CaviumCbcEncrypt(des, out, in, sz);
|
||||
#endif
|
||||
|
||||
blocks = sz / DES_BLOCK_SIZE;
|
||||
while (blocks--) {
|
||||
xorbuf((byte*)des->reg, in, DES_BLOCK_SIZE);
|
||||
Des3ProcessBlock(des, (byte*)des->reg, (byte*)des->reg);
|
||||
@ -494,8 +719,14 @@ void Des3_CbcEncrypt(Des3* des, byte* out, const byte* in, word32 sz)
|
||||
|
||||
void Des3_CbcDecrypt(Des3* des, byte* out, const byte* in, word32 sz)
|
||||
{
|
||||
word32 blocks = sz / DES_BLOCK_SIZE;
|
||||
word32 blocks;
|
||||
|
||||
#ifdef HAVE_CAVIUM
|
||||
if (des->magic == CYASSL_3DES_CAVIUM_MAGIC)
|
||||
return Des3_CaviumCbcDecrypt(des, out, in, sz);
|
||||
#endif
|
||||
|
||||
blocks = sz / DES_BLOCK_SIZE;
|
||||
while (blocks--) {
|
||||
XMEMCPY(des->tmp, in, DES_BLOCK_SIZE);
|
||||
Des3ProcessBlock(des, (byte*)des->tmp, out);
|
||||
@ -524,5 +755,136 @@ void Des_EcbEncrypt(Des* des, byte* out, const byte* in, word32 sz)
|
||||
|
||||
#endif /* CYASSL_DES_ECB */
|
||||
|
||||
#endif /* STM32F2_CRYPTO */
|
||||
|
||||
void Des_SetIV(Des* des, const byte* iv)
|
||||
{
|
||||
if (des && iv)
|
||||
XMEMCPY(des->reg, iv, DES_BLOCK_SIZE);
|
||||
else if (des)
|
||||
XMEMSET(des->reg, 0, DES_BLOCK_SIZE);
|
||||
}
|
||||
|
||||
|
||||
void Des3_SetIV(Des3* des, const byte* iv)
|
||||
{
|
||||
if (des && iv)
|
||||
XMEMCPY(des->reg, iv, DES_BLOCK_SIZE);
|
||||
else if (des)
|
||||
XMEMSET(des->reg, 0, DES_BLOCK_SIZE);
|
||||
}
|
||||
|
||||
|
||||
#ifdef HAVE_CAVIUM
|
||||
|
||||
#include <cyassl/ctaocrypt/logging.h>
|
||||
#include "cavium_common.h"
|
||||
|
||||
/* Initiliaze Des3 for use with Nitrox device */
|
||||
int Des3_InitCavium(Des3* des3, int devId)
|
||||
{
|
||||
if (des3 == NULL)
|
||||
return -1;
|
||||
|
||||
if (CspAllocContext(CONTEXT_SSL, &des3->contextHandle, devId) != 0)
|
||||
return -1;
|
||||
|
||||
des3->devId = devId;
|
||||
des3->magic = CYASSL_3DES_CAVIUM_MAGIC;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/* Free Des3 from use with Nitrox device */
|
||||
void Des3_FreeCavium(Des3* des3)
|
||||
{
|
||||
if (des3 == NULL)
|
||||
return;
|
||||
|
||||
if (des3->magic != CYASSL_3DES_CAVIUM_MAGIC)
|
||||
return;
|
||||
|
||||
CspFreeContext(CONTEXT_SSL, des3->contextHandle, des3->devId);
|
||||
des3->magic = 0;
|
||||
}
|
||||
|
||||
|
||||
static void Des3_CaviumSetKey(Des3* des3, const byte* key, const byte* iv)
|
||||
{
|
||||
if (des3 == NULL)
|
||||
return;
|
||||
|
||||
/* key[0] holds key, iv in reg */
|
||||
XMEMCPY(des3->key[0], key, DES_BLOCK_SIZE*3);
|
||||
|
||||
Des3_SetIV(des3, iv);
|
||||
}
|
||||
|
||||
|
||||
static void Des3_CaviumCbcEncrypt(Des3* des3, byte* out, const byte* in,
|
||||
word32 length)
|
||||
{
|
||||
word offset = 0;
|
||||
word32 requestId;
|
||||
|
||||
while (length > CYASSL_MAX_16BIT) {
|
||||
word16 slen = (word16)CYASSL_MAX_16BIT;
|
||||
if (CspEncrypt3Des(CAVIUM_BLOCKING, des3->contextHandle,
|
||||
CAVIUM_NO_UPDATE, slen, (byte*)in + offset,
|
||||
out + offset, (byte*)des3->reg, (byte*)des3->key[0],
|
||||
&requestId, des3->devId) != 0) {
|
||||
CYASSL_MSG("Bad Cavium 3DES Cbc Encrypt");
|
||||
}
|
||||
length -= CYASSL_MAX_16BIT;
|
||||
offset += CYASSL_MAX_16BIT;
|
||||
XMEMCPY(des3->reg, out + offset - DES_BLOCK_SIZE, DES_BLOCK_SIZE);
|
||||
}
|
||||
if (length) {
|
||||
word16 slen = (word16)length;
|
||||
|
||||
if (CspEncrypt3Des(CAVIUM_BLOCKING, des3->contextHandle,
|
||||
CAVIUM_NO_UPDATE, slen, (byte*)in + offset,
|
||||
out + offset, (byte*)des3->reg, (byte*)des3->key[0],
|
||||
&requestId, des3->devId) != 0) {
|
||||
CYASSL_MSG("Bad Cavium 3DES Cbc Encrypt");
|
||||
}
|
||||
XMEMCPY(des3->reg, out+offset+length - DES_BLOCK_SIZE, DES_BLOCK_SIZE);
|
||||
}
|
||||
}
|
||||
|
||||
static void Des3_CaviumCbcDecrypt(Des3* des3, byte* out, const byte* in,
|
||||
word32 length)
|
||||
{
|
||||
word32 requestId;
|
||||
word offset = 0;
|
||||
|
||||
while (length > CYASSL_MAX_16BIT) {
|
||||
word16 slen = (word16)CYASSL_MAX_16BIT;
|
||||
XMEMCPY(des3->tmp, in + offset + slen - DES_BLOCK_SIZE, DES_BLOCK_SIZE);
|
||||
if (CspDecrypt3Des(CAVIUM_BLOCKING, des3->contextHandle,
|
||||
CAVIUM_NO_UPDATE, slen, (byte*)in+offset, out+offset,
|
||||
(byte*)des3->reg, (byte*)des3->key[0], &requestId,
|
||||
des3->devId) != 0) {
|
||||
CYASSL_MSG("Bad Cavium 3Des Decrypt");
|
||||
}
|
||||
length -= CYASSL_MAX_16BIT;
|
||||
offset += CYASSL_MAX_16BIT;
|
||||
XMEMCPY(des3->reg, des3->tmp, DES_BLOCK_SIZE);
|
||||
}
|
||||
if (length) {
|
||||
word16 slen = (word16)length;
|
||||
XMEMCPY(des3->tmp, in + offset + slen - DES_BLOCK_SIZE,DES_BLOCK_SIZE);
|
||||
if (CspDecrypt3Des(CAVIUM_BLOCKING, des3->contextHandle,
|
||||
CAVIUM_NO_UPDATE, slen, (byte*)in+offset, out+offset,
|
||||
(byte*)des3->reg, (byte*)des3->key[0], &requestId,
|
||||
des3->devId) != 0) {
|
||||
CYASSL_MSG("Bad Cavium 3Des Decrypt");
|
||||
}
|
||||
XMEMCPY(des3->reg, des3->tmp, DES_BLOCK_SIZE);
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* HAVE_CAVIUM */
|
||||
|
||||
#endif /* NO_DES3 */
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* dh.c
|
||||
*
|
||||
* Copyright (C) 2006-2012 Sawtooth Consulting Ltd.
|
||||
* Copyright (C) 2006-2013 wolfSSL Inc.
|
||||
*
|
||||
* This file is part of CyaSSL.
|
||||
*
|
||||
@ -23,6 +23,8 @@
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
#include <cyassl/ctaocrypt/settings.h>
|
||||
|
||||
#ifndef NO_DH
|
||||
|
||||
#include <cyassl/ctaocrypt/dh.h>
|
||||
@ -83,8 +85,8 @@ static word32 DiscreteLogWorkFactor(word32 n)
|
||||
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);
|
||||
|
||||
sz = min(sz, 2 * DiscreteLogWorkFactor(sz * CYASSL_BIT_SIZE) /
|
||||
CYASSL_BIT_SIZE + 1);
|
||||
RNG_GenerateBlock(rng, priv, sz);
|
||||
priv[0] |= 0x0C;
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* dsa.c
|
||||
*
|
||||
* Copyright (C) 2006-2012 Sawtooth Consulting Ltd.
|
||||
* Copyright (C) 2006-2013 wolfSSL Inc.
|
||||
*
|
||||
* This file is part of CyaSSL.
|
||||
*
|
||||
@ -23,6 +23,8 @@
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
#include <cyassl/ctaocrypt/settings.h>
|
||||
|
||||
#ifndef NO_DSA
|
||||
|
||||
#include <cyassl/ctaocrypt/dsa.h>
|
||||
|
1552
ctaocrypt/src/ecc.c
1552
ctaocrypt/src/ecc.c
File diff suppressed because it is too large
Load Diff
329
ctaocrypt/src/error.c
Normal file
329
ctaocrypt/src/error.c
Normal file
@ -0,0 +1,329 @@
|
||||
/* error.c
|
||||
*
|
||||
* Copyright (C) 2006-2013 wolfSSL Inc.
|
||||
*
|
||||
* 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/settings.h>
|
||||
|
||||
#include <cyassl/ctaocrypt/error.h>
|
||||
|
||||
#ifdef _MSC_VER
|
||||
/* 4996 warning to use MS extensions e.g., strcpy_s instead of XSTRNCPY */
|
||||
#pragma warning(disable: 4996)
|
||||
#endif
|
||||
|
||||
|
||||
void CTaoCryptErrorString(int error, char* buffer)
|
||||
{
|
||||
const int max = CYASSL_MAX_ERROR_SZ; /* shorthand */
|
||||
|
||||
#ifdef NO_ERROR_STRINGS
|
||||
|
||||
(void)error;
|
||||
XSTRNCPY(buffer, "no support for error strings built in", max);
|
||||
|
||||
#else
|
||||
|
||||
switch (error) {
|
||||
|
||||
case OPEN_RAN_E :
|
||||
XSTRNCPY(buffer, "opening random device error", max);
|
||||
break;
|
||||
|
||||
case READ_RAN_E :
|
||||
XSTRNCPY(buffer, "reading random device error", max);
|
||||
break;
|
||||
|
||||
case WINCRYPT_E :
|
||||
XSTRNCPY(buffer, "windows crypt init error", max);
|
||||
break;
|
||||
|
||||
case CRYPTGEN_E :
|
||||
XSTRNCPY(buffer, "windows crypt generation error", max);
|
||||
break;
|
||||
|
||||
case RAN_BLOCK_E :
|
||||
XSTRNCPY(buffer, "random device read would block error", max);
|
||||
break;
|
||||
|
||||
case MP_INIT_E :
|
||||
XSTRNCPY(buffer, "mp_init error state", max);
|
||||
break;
|
||||
|
||||
case MP_READ_E :
|
||||
XSTRNCPY(buffer, "mp_read error state", max);
|
||||
break;
|
||||
|
||||
case MP_EXPTMOD_E :
|
||||
XSTRNCPY(buffer, "mp_exptmod error state", max);
|
||||
break;
|
||||
|
||||
case MP_TO_E :
|
||||
XSTRNCPY(buffer, "mp_to_xxx error state, can't convert", max);
|
||||
break;
|
||||
|
||||
case MP_SUB_E :
|
||||
XSTRNCPY(buffer, "mp_sub error state, can't subtract", max);
|
||||
break;
|
||||
|
||||
case MP_ADD_E :
|
||||
XSTRNCPY(buffer, "mp_add error state, can't add", max);
|
||||
break;
|
||||
|
||||
case MP_MUL_E :
|
||||
XSTRNCPY(buffer, "mp_mul error state, can't multiply", max);
|
||||
break;
|
||||
|
||||
case MP_MULMOD_E :
|
||||
XSTRNCPY(buffer, "mp_mulmod error state, can't multiply mod", max);
|
||||
break;
|
||||
|
||||
case MP_MOD_E :
|
||||
XSTRNCPY(buffer, "mp_mod error state, can't mod", max);
|
||||
break;
|
||||
|
||||
case MP_INVMOD_E :
|
||||
XSTRNCPY(buffer, "mp_invmod error state, can't inv mod", max);
|
||||
break;
|
||||
|
||||
case MP_CMP_E :
|
||||
XSTRNCPY(buffer, "mp_cmp error state", max);
|
||||
break;
|
||||
|
||||
case MP_ZERO_E :
|
||||
XSTRNCPY(buffer, "mp zero result, not expected", max);
|
||||
break;
|
||||
|
||||
case MEMORY_E :
|
||||
XSTRNCPY(buffer, "out of memory error", max);
|
||||
break;
|
||||
|
||||
case RSA_WRONG_TYPE_E :
|
||||
XSTRNCPY(buffer, "RSA wrong block type for RSA function", max);
|
||||
break;
|
||||
|
||||
case RSA_BUFFER_E :
|
||||
XSTRNCPY(buffer, "RSA buffer error, output too small or input too big",
|
||||
max);
|
||||
break;
|
||||
|
||||
case BUFFER_E :
|
||||
XSTRNCPY(buffer, "Buffer error, output too small or input too big",max);
|
||||
break;
|
||||
|
||||
case ALGO_ID_E :
|
||||
XSTRNCPY(buffer, "Setting Cert AlogID error", max);
|
||||
break;
|
||||
|
||||
case PUBLIC_KEY_E :
|
||||
XSTRNCPY(buffer, "Setting Cert Public Key error", max);
|
||||
break;
|
||||
|
||||
case DATE_E :
|
||||
XSTRNCPY(buffer, "Setting Cert Date validity error", max);
|
||||
break;
|
||||
|
||||
case SUBJECT_E :
|
||||
XSTRNCPY(buffer, "Setting Cert Subject name error", max);
|
||||
break;
|
||||
|
||||
case ISSUER_E :
|
||||
XSTRNCPY(buffer, "Setting Cert Issuer name error", max);
|
||||
break;
|
||||
|
||||
case CA_TRUE_E :
|
||||
XSTRNCPY(buffer, "Setting basic constraint CA true error", max);
|
||||
break;
|
||||
|
||||
case EXTENSIONS_E :
|
||||
XSTRNCPY(buffer, "Setting extensions error", max);
|
||||
break;
|
||||
|
||||
case ASN_PARSE_E :
|
||||
XSTRNCPY(buffer, "ASN parsing error, invalid input", max);
|
||||
break;
|
||||
|
||||
case ASN_VERSION_E :
|
||||
XSTRNCPY(buffer, "ASN version error, invalid number", max);
|
||||
break;
|
||||
|
||||
case ASN_GETINT_E :
|
||||
XSTRNCPY(buffer, "ASN get big int error, invalid data", max);
|
||||
break;
|
||||
|
||||
case ASN_RSA_KEY_E :
|
||||
XSTRNCPY(buffer, "ASN key init error, invalid input", max);
|
||||
break;
|
||||
|
||||
case ASN_OBJECT_ID_E :
|
||||
XSTRNCPY(buffer, "ASN object id error, invalid id", max);
|
||||
break;
|
||||
|
||||
case ASN_TAG_NULL_E :
|
||||
XSTRNCPY(buffer, "ASN tag error, not null", max);
|
||||
break;
|
||||
|
||||
case ASN_EXPECT_0_E :
|
||||
XSTRNCPY(buffer, "ASN expect error, not zero", max);
|
||||
break;
|
||||
|
||||
case ASN_BITSTR_E :
|
||||
XSTRNCPY(buffer, "ASN bit string error, wrong id", max);
|
||||
break;
|
||||
|
||||
case ASN_UNKNOWN_OID_E :
|
||||
XSTRNCPY(buffer, "ASN oid error, unknown sum id", max);
|
||||
break;
|
||||
|
||||
case ASN_DATE_SZ_E :
|
||||
XSTRNCPY(buffer, "ASN date error, bad size", max);
|
||||
break;
|
||||
|
||||
case ASN_BEFORE_DATE_E :
|
||||
XSTRNCPY(buffer, "ASN date error, current date before", max);
|
||||
break;
|
||||
|
||||
case ASN_AFTER_DATE_E :
|
||||
XSTRNCPY(buffer, "ASN date error, current date after", max);
|
||||
break;
|
||||
|
||||
case ASN_SIG_OID_E :
|
||||
XSTRNCPY(buffer, "ASN signature error, mismatched oid", max);
|
||||
break;
|
||||
|
||||
case ASN_TIME_E :
|
||||
XSTRNCPY(buffer, "ASN time error, unkown time type", max);
|
||||
break;
|
||||
|
||||
case ASN_INPUT_E :
|
||||
XSTRNCPY(buffer, "ASN input error, not enough data", max);
|
||||
break;
|
||||
|
||||
case ASN_SIG_CONFIRM_E :
|
||||
XSTRNCPY(buffer, "ASN sig error, confirm failure", max);
|
||||
break;
|
||||
|
||||
case ASN_SIG_HASH_E :
|
||||
XSTRNCPY(buffer, "ASN sig error, unsupported hash type", max);
|
||||
break;
|
||||
|
||||
case ASN_SIG_KEY_E :
|
||||
XSTRNCPY(buffer, "ASN sig error, unsupported key type", max);
|
||||
break;
|
||||
|
||||
case ASN_DH_KEY_E :
|
||||
XSTRNCPY(buffer, "ASN key init error, invalid input", max);
|
||||
break;
|
||||
|
||||
case ASN_NTRU_KEY_E :
|
||||
XSTRNCPY(buffer, "ASN NTRU key decode error, invalid input", max);
|
||||
break;
|
||||
|
||||
case ECC_BAD_ARG_E :
|
||||
XSTRNCPY(buffer, "ECC input argument wrong type, invalid input", max);
|
||||
break;
|
||||
|
||||
case ASN_ECC_KEY_E :
|
||||
XSTRNCPY(buffer, "ECC ASN1 bad key data, invalid input", max);
|
||||
break;
|
||||
|
||||
case ECC_CURVE_OID_E :
|
||||
XSTRNCPY(buffer, "ECC curve sum OID unsupported, invalid input", max);
|
||||
break;
|
||||
|
||||
case BAD_FUNC_ARG :
|
||||
XSTRNCPY(buffer, "Bad function argument", max);
|
||||
break;
|
||||
|
||||
case NOT_COMPILED_IN :
|
||||
XSTRNCPY(buffer, "Feature not compiled in", max);
|
||||
break;
|
||||
|
||||
case UNICODE_SIZE_E :
|
||||
XSTRNCPY(buffer, "Unicode password too big", max);
|
||||
break;
|
||||
|
||||
case NO_PASSWORD :
|
||||
XSTRNCPY(buffer, "No password provided by user", max);
|
||||
break;
|
||||
|
||||
case ALT_NAME_E :
|
||||
XSTRNCPY(buffer, "Alt Name problem, too big", max);
|
||||
break;
|
||||
|
||||
case AES_GCM_AUTH_E:
|
||||
XSTRNCPY(buffer, "AES-GCM Authentication check fail", max);
|
||||
break;
|
||||
|
||||
case AES_CCM_AUTH_E:
|
||||
XSTRNCPY(buffer, "AES-CCM Authentication check fail", max);
|
||||
break;
|
||||
|
||||
case CAVIUM_INIT_E:
|
||||
XSTRNCPY(buffer, "Cavium Init type error", max);
|
||||
break;
|
||||
|
||||
case COMPRESS_INIT_E:
|
||||
XSTRNCPY(buffer, "Compress Init error", max);
|
||||
break;
|
||||
|
||||
case COMPRESS_E:
|
||||
XSTRNCPY(buffer, "Compress error", max);
|
||||
break;
|
||||
|
||||
case DECOMPRESS_INIT_E:
|
||||
XSTRNCPY(buffer, "DeCompress Init error", max);
|
||||
break;
|
||||
|
||||
case DECOMPRESS_E:
|
||||
XSTRNCPY(buffer, "DeCompress error", max);
|
||||
break;
|
||||
|
||||
case BAD_ALIGN_E:
|
||||
XSTRNCPY(buffer, "Bad alignment error, no alloc help", max);
|
||||
break;
|
||||
|
||||
case ASN_NO_SIGNER_E :
|
||||
XSTRNCPY(buffer, "ASN no signer error to confirm failure", max);
|
||||
break;
|
||||
|
||||
case ASN_CRL_CONFIRM_E :
|
||||
XSTRNCPY(buffer, "ASN CRL sig error, confirm failure", max);
|
||||
break;
|
||||
|
||||
case ASN_CRL_NO_SIGNER_E :
|
||||
XSTRNCPY(buffer, "ASN CRL no signer error to confirm failure", max);
|
||||
break;
|
||||
|
||||
case ASN_OCSP_CONFIRM_E :
|
||||
XSTRNCPY(buffer, "ASN OCSP sig error, confirm failure", max);
|
||||
break;
|
||||
|
||||
default:
|
||||
XSTRNCPY(buffer, "unknown error number", max);
|
||||
|
||||
}
|
||||
|
||||
#endif /* NO_ERROR_STRINGS */
|
||||
|
||||
}
|
@ -1,6 +1,6 @@
|
||||
/* fp_mont_small.i
|
||||
*
|
||||
* Copyright (C) 2006-2011 Sawtooth Consulting Ltd.
|
||||
* Copyright (C) 2006-2013 wolfSSL Inc.
|
||||
*
|
||||
* This file is part of CyaSSL.
|
||||
*
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* fp_mul_comba_12.i
|
||||
*
|
||||
* Copyright (C) 2006-2011 Sawtooth Consulting Ltd.
|
||||
* Copyright (C) 2006-2013 wolfSSL Inc.
|
||||
*
|
||||
* This file is part of CyaSSL.
|
||||
*
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* fp_mul_comba_17.i
|
||||
*
|
||||
* Copyright (C) 2006-2011 Sawtooth Consulting Ltd.
|
||||
* Copyright (C) 2006-2013 wolfSSL Inc.
|
||||
*
|
||||
* This file is part of CyaSSL.
|
||||
*
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* fp_mul_comba_20.i
|
||||
*
|
||||
* Copyright (C) 2006-2011 Sawtooth Consulting Ltd.
|
||||
* Copyright (C) 2006-2013 wolfSSL Inc.
|
||||
*
|
||||
* This file is part of CyaSSL.
|
||||
*
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* fp_mul_comba_24.i
|
||||
*
|
||||
* Copyright (C) 2006-2011 Sawtooth Consulting Ltd.
|
||||
* Copyright (C) 2006-2013 wolfSSL Inc.
|
||||
*
|
||||
* This file is part of CyaSSL.
|
||||
*
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* fp_mul_comba_28.i
|
||||
*
|
||||
* Copyright (C) 2006-2011 Sawtooth Consulting Ltd.
|
||||
* Copyright (C) 2006-2013 wolfSSL Inc.
|
||||
*
|
||||
* This file is part of CyaSSL.
|
||||
*
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* fp_mul_comba_3.i
|
||||
*
|
||||
* Copyright (C) 2006-2011 Sawtooth Consulting Ltd.
|
||||
* Copyright (C) 2006-2013 wolfSSL Inc.
|
||||
*
|
||||
* This file is part of CyaSSL.
|
||||
*
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* fp_mul_comba_32.i
|
||||
*
|
||||
* Copyright (C) 2006-2011 Sawtooth Consulting Ltd.
|
||||
* Copyright (C) 2006-2013 wolfSSL Inc.
|
||||
*
|
||||
* This file is part of CyaSSL.
|
||||
*
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* fp_mul_comba_4.i
|
||||
*
|
||||
* Copyright (C) 2006-2011 Sawtooth Consulting Ltd.
|
||||
* Copyright (C) 2006-2013 wolfSSL Inc.
|
||||
*
|
||||
* This file is part of CyaSSL.
|
||||
*
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* fp_mul_comba_48.i
|
||||
*
|
||||
* Copyright (C) 2006-2011 Sawtooth Consulting Ltd.
|
||||
* Copyright (C) 2006-2013 wolfSSL Inc.
|
||||
*
|
||||
* This file is part of CyaSSL.
|
||||
*
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* fp_mul_comba_6.i
|
||||
*
|
||||
* Copyright (C) 2006-2011 Sawtooth Consulting Ltd.
|
||||
* Copyright (C) 2006-2013 wolfSSL Inc.
|
||||
*
|
||||
* This file is part of CyaSSL.
|
||||
*
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* fp_mul_comba_64.i
|
||||
*
|
||||
* Copyright (C) 2006-2011 Sawtooth Consulting Ltd.
|
||||
* Copyright (C) 2006-2013 wolfSSL Inc.
|
||||
*
|
||||
* This file is part of CyaSSL.
|
||||
*
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* fp_mul_comba_7.i
|
||||
*
|
||||
* Copyright (C) 2006-2011 Sawtooth Consulting Ltd.
|
||||
* Copyright (C) 2006-2013 wolfSSL Inc.
|
||||
*
|
||||
* This file is part of CyaSSL.
|
||||
*
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* fp_mul_comba_8.i
|
||||
*
|
||||
* Copyright (C) 2006-2011 Sawtooth Consulting Ltd.
|
||||
* Copyright (C) 2006-2013 wolfSSL Inc.
|
||||
*
|
||||
* This file is part of CyaSSL.
|
||||
*
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* fp_mul_comba_9.i
|
||||
*
|
||||
* Copyright (C) 2006-2011 Sawtooth Consulting Ltd.
|
||||
* Copyright (C) 2006-2013 wolfSSL Inc.
|
||||
*
|
||||
* This file is part of CyaSSL.
|
||||
*
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* fp_mul_comba_small_set.i
|
||||
*
|
||||
* Copyright (C) 2006-2011 Sawtooth Consulting Ltd.
|
||||
* Copyright (C) 2006-2013 wolfSSL Inc.
|
||||
*
|
||||
* This file is part of CyaSSL.
|
||||
*
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* fp_sqr_comba_12.i
|
||||
*
|
||||
* Copyright (C) 2006-2011 Sawtooth Consulting Ltd.
|
||||
* Copyright (C) 2006-2013 wolfSSL Inc.
|
||||
*
|
||||
* This file is part of CyaSSL.
|
||||
*
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* fp_sqr_comba_17.i
|
||||
*
|
||||
* Copyright (C) 2006-2011 Sawtooth Consulting Ltd.
|
||||
* Copyright (C) 2006-2013 wolfSSL Inc.
|
||||
*
|
||||
* This file is part of CyaSSL.
|
||||
*
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* fp_sqr_comba_20.i
|
||||
*
|
||||
* Copyright (C) 2006-2011 Sawtooth Consulting Ltd.
|
||||
* Copyright (C) 2006-2013 wolfSSL Inc.
|
||||
*
|
||||
* This file is part of CyaSSL.
|
||||
*
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* fp_sqr_comba_24.i
|
||||
*
|
||||
* Copyright (C) 2006-2011 Sawtooth Consulting Ltd.
|
||||
* Copyright (C) 2006-2013 wolfSSL Inc.
|
||||
*
|
||||
* This file is part of CyaSSL.
|
||||
*
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* fp_sqr_comba_28.i
|
||||
*
|
||||
* Copyright (C) 2006-2011 Sawtooth Consulting Ltd.
|
||||
* Copyright (C) 2006-2013 wolfSSL Inc.
|
||||
*
|
||||
* This file is part of CyaSSL.
|
||||
*
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* fp_sqr_comba_3.i
|
||||
*
|
||||
* Copyright (C) 2006-2011 Sawtooth Consulting Ltd.
|
||||
* Copyright (C) 2006-2013 wolfSSL Inc.
|
||||
*
|
||||
* This file is part of CyaSSL.
|
||||
*
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* fp_sqr_comba_32.i
|
||||
*
|
||||
* Copyright (C) 2006-2011 Sawtooth Consulting Ltd.
|
||||
* Copyright (C) 2006-2013 wolfSSL Inc.
|
||||
*
|
||||
* This file is part of CyaSSL.
|
||||
*
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* fp_sqr_comba_4.i
|
||||
*
|
||||
* Copyright (C) 2006-2011 Sawtooth Consulting Ltd.
|
||||
* Copyright (C) 2006-2013 wolfSSL Inc.
|
||||
*
|
||||
* This file is part of CyaSSL.
|
||||
*
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* fp_sqr_comba_48.i
|
||||
*
|
||||
* Copyright (C) 2006-2011 Sawtooth Consulting Ltd.
|
||||
* Copyright (C) 2006-2013 wolfSSL Inc.
|
||||
*
|
||||
* This file is part of CyaSSL.
|
||||
*
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* fp_sqr_comba_6.i
|
||||
*
|
||||
* Copyright (C) 2006-2011 Sawtooth Consulting Ltd.
|
||||
* Copyright (C) 2006-2013 wolfSSL Inc.
|
||||
*
|
||||
* This file is part of CyaSSL.
|
||||
*
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* fp_sqr_comba_64.i
|
||||
*
|
||||
* Copyright (C) 2006-2011 Sawtooth Consulting Ltd.
|
||||
* Copyright (C) 2006-2013 wolfSSL Inc.
|
||||
*
|
||||
* This file is part of CyaSSL.
|
||||
*
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* fp_sqr_comba_7.i
|
||||
*
|
||||
* Copyright (C) 2006-2011 Sawtooth Consulting Ltd.
|
||||
* Copyright (C) 2006-2013 wolfSSL Inc.
|
||||
*
|
||||
* This file is part of CyaSSL.
|
||||
*
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* fp_sqr_comba_8.i
|
||||
*
|
||||
* Copyright (C) 2006-2011 Sawtooth Consulting Ltd.
|
||||
* Copyright (C) 2006-2013 wolfSSL Inc.
|
||||
*
|
||||
* This file is part of CyaSSL.
|
||||
*
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user