Compare commits

..

3358 Commits

Author SHA1 Message Date
4f0e3504d1 For bug 68532 2024-07-08 01:53:47 +03:00
f70b5c0939 Merge pull request #1580 from ONLYOFFICE/hotfix/v8.1.1
Hotfix/v8.1.1
2024-06-27 23:34:50 -07:00
49a9205aad Merge pull request #1576 from ONLYOFFICE/fix/bug68834
Fix bug #68834
2024-06-26 11:58:10 +03:00
ebadb754c5 fix bug #68471 2024-06-26 08:59:12 +03:00
cd7b39acf2 fix bug #68852 2024-06-25 18:47:51 +03:00
95d2939a73 Fix bug 61747 2024-06-25 17:39:06 +03:00
da06f82447 [x2t] Fix bug 68805 2024-06-25 17:17:03 +03:00
5ad4cca9f4 Fix bug #68834 2024-06-25 20:15:58 +06:00
6d9bccee65 fix bug #68601 2024-06-25 16:22:35 +03:00
cc3528c226 Merge pull request #1573 from ONLYOFFICE/fix/bug-68549
Fix bug 68549
2024-06-25 03:36:54 -07:00
db4ae797a1 Fix bug 68549 2024-06-25 13:25:47 +03:00
4c08e60ecc Merge pull request #1572 from ONLYOFFICE/fix/bug-68712
Fix bugs 68712, 68751
2024-06-24 07:27:18 -07:00
ce9268f166 Fix for PdfWriter 2024-06-24 15:46:28 +03:00
a3a734a558 fix bug #68769 2024-06-23 10:43:21 +03:00
7326f88aa0 Create CAnnotFonts 2024-06-21 17:23:00 +03:00
83f98f3186 Merge branch 'fix/pre-hotfix' into hotfix/v8.1.1 2024-06-21 17:19:38 +03:00
2d6ef9a38b fix bug #68767 2024-06-21 16:02:21 +03:00
baae7b0a15 Fix bug 68754 2024-06-21 12:17:51 +03:00
5e7caad32a fix bug#68764 2024-06-20 16:16:28 +03:00
a517809a5d fix bug #68766 2024-06-20 16:11:44 +03:00
255fa70292 Fix bug 68751 2024-06-20 12:44:32 +03:00
71ecf1a1e0 Fix bug 68712 2024-06-19 18:29:03 +03:00
8d092ad6e4 Fix bug #68711 2024-06-19 17:55:43 +06:00
2f45e0952e Fix bug with cloud images 2024-06-19 11:28:22 +03:00
05293f43ce Merge branch release/v8.1.0 into master 2024-06-19 08:22:01 +00:00
e80e545024 Merge pull request #1566 from ONLYOFFICE/fix/bug-68688 2024-06-17 07:56:13 -07:00
2245952739 Merge pull request #1567 from ONLYOFFICE/fix/bug-68252 2024-06-17 07:55:25 -07:00
ff52afecc9 Fix bug #68252 2024-06-17 17:50:50 +03:00
5503208e95 Fix bug 68237 2024-06-17 17:29:04 +03:00
90c1ffe7de Fix bugs 68688, 68689
Related bugs 46629, 61014, 68479, 68545
2024-06-17 17:08:18 +03:00
23ef8fd8af Merge pull request #1565 from ONLYOFFICE/fix/bug-68638
Fix bug #68638
2024-06-17 05:01:09 -07:00
e5559e4cf8 Fix bug #68638 2024-06-17 14:22:19 +03:00
76623ec66d [pdf=>image] Support orientation 2024-06-14 15:51:28 +03:00
d5a4cf73ec Merge pull request #1564 from ONLYOFFICE/feature/StarMath
Fix StarMath
2024-06-14 05:36:03 -07:00
ef530fea0b fix bug 68587 2024-06-14 14:10:51 +03:00
e20f98aa4a Merge pull request #1563 from ONLYOFFICE/fix/bug-68629
Fix bug 68629
2024-06-14 02:48:42 -07:00
cc27db504f Fix embedded fonts 2024-06-14 12:34:34 +03:00
1da9dc12b5 Merge pull request #1562 from ONLYOFFICE/fix/svg
Fix svg
2024-06-14 02:11:45 -07:00
6cf95e6151 Fix bug #68638 2024-06-14 12:06:45 +03:00
ad4ba02895 For bug 65310 2024-06-14 11:16:08 +03:00
79c7fced0a For bug 68629 2024-06-14 11:15:33 +03:00
b63ff91ce4 Merge pull request #1561 from ONLYOFFICE/fix/bug-68629
For bug 68237
2024-06-13 23:34:45 -07:00
d0b6c55347 For bug 68237 2024-06-14 09:16:09 +03:00
53f9629194 Merge pull request #1560 from ONLYOFFICE/fix/bug-68609
Fix bug #68609
2024-06-13 09:56:58 -07:00
272b69ae70 Fix bug #68609 2024-06-13 19:43:25 +03:00
8c081c83c9 fix bug 68586 2024-06-13 19:31:38 +03:00
37bef7c398 Merge pull request #1559 from ONLYOFFICE/fix/bug-68546
Fix bug 68546
2024-06-13 08:26:39 -07:00
aae80a161c Clear 2024-06-13 18:04:39 +03:00
a498117748 Fix bug 68546 2024-06-13 17:54:14 +03:00
a8787e9220 Merge pull request #1558 from ONLYOFFICE/fix/bug68545
Fix bug 68545
2024-06-13 07:01:20 -07:00
17bc68d102 Fix bug 68545 2024-06-13 16:49:13 +03:00
ca17a96d32 Fix null 2024-06-13 13:08:21 +03:00
04419326f4 Fix bug 68545 2024-06-13 13:00:13 +03:00
adfbf6ea3f Merge pull request #1549 from ONLYOFFICE/fix/bug-68532
Fix bug 68532
2024-06-13 02:15:00 -07:00
61397b67c1 Merge pull request #1557 from ONLYOFFICE/fix/propsbinary 2024-06-13 02:06:29 -07:00
a6e87b589c add props to binary 2024-06-13 11:56:10 +03:00
5927b0113f Merge pull request #1556 from ONLYOFFICE/fix/bug68540
fix bug #68540
2024-06-11 22:01:39 +03:00
e03b3e9f1b fix bug #68540 2024-06-11 22:01:06 +03:00
ecef6154ff Merge pull request #1555 from ONLYOFFICE/fix/bug65788
fix bug #65788
2024-06-11 21:38:19 +03:00
e16578c3a1 fix bug #65788 2024-06-11 21:36:15 +03:00
3e709a99ed Merge pull request #1548 from ONLYOFFICE/fix/bug68485
Fix bug #68485
2024-06-11 19:56:16 +03:00
c2f0390b6a Merge pull request #1550 from ONLYOFFICE/fix/bug68503
Fix bug #68503
2024-06-11 19:56:04 +03:00
27619798b9 Merge pull request #1551 from ONLYOFFICE/fix/bug68510
Fix bug #68510
2024-06-11 19:55:50 +03:00
e62585a7fc Merge pull request #1553 from ONLYOFFICE/fix/bug68404
Fix bug #68404
2024-06-11 19:45:19 +03:00
19c4a674f6 Merge pull request #1554 from ONLYOFFICE/fix/bug68238
fix bug #68238
2024-06-11 19:45:06 +03:00
505d8093ef fix bug #68238 2024-06-11 19:42:41 +03:00
3316216f8e Fix bug #68404 2024-06-11 19:35:41 +06:00
7131129ba0 Merge pull request #1552 from ONLYOFFICE/feature/StarMath
Fix StarMath
2024-06-11 06:19:47 -07:00
4070725515 Fix bug #68510 2024-06-11 18:34:27 +06:00
5dfeeeb809 Fix bug #68503 2024-06-11 15:52:14 +06:00
14b66e2bb3 Fix bug 68532 2024-06-11 11:39:04 +03:00
9a5e1464bd Fix bug #68485 2024-06-11 12:32:39 +06:00
819e568a35 Merge pull request #1547 from ONLYOFFICE/fix/bug-64722
Fix bug #64722
2024-06-10 03:36:46 -07:00
c8ce9c8a35 Merge pull request #1546 from ONLYOFFICE/fix/bug-68479
Fix bug 68479
2024-06-10 01:39:53 -07:00
95f91b816a Fix bug #64722 2024-06-10 11:18:54 +03:00
29788a5d1b Fix bug 68479 2024-06-10 11:14:55 +03:00
a81fb19e1a fix bug 68445 2024-06-10 10:35:08 +03:00
c82c8743f8 improvement of parsing and bracket conversion 2024-06-10 10:08:23 +03:00
ebef9ad556 Merge pull request #1545 from ONLYOFFICE/fix/bug68186 2024-06-07 18:45:05 +03:00
a564d289b7 Merge pull request #1543 from ONLYOFFICE/fix/html-bugs
Fix html bugs
2024-06-07 18:31:25 +03:00
a98ee52dc5 Fix bug 68186 2024-06-07 17:32:55 +03:00
99a560bebd Merge pull request #1544 from ONLYOFFICE/fix/bug68390
Fix bug #68390
2024-06-07 14:28:46 +03:00
cb10bccd6a Merge pull request #1538 from ONLYOFFICE/fix/bug68404
Fix bug #68404
2024-06-07 14:27:57 +03:00
c219ce8b06 Merge pull request #1537 from ONLYOFFICE/fix/bug68402
Fix bug #68402
2024-06-07 14:27:04 +03:00
afc8dd6e48 Merge pull request #1536 from ONLYOFFICE/fix/bug68400
Fix bug #68400
2024-06-07 14:24:14 +03:00
505c28f88d Merge pull request #1532 from ONLYOFFICE/fix/bug68238
Fix bug #68238
2024-06-07 14:23:44 +03:00
49d789dc77 Merge pull request #1524 from ONLYOFFICE/fix/bug65172
Fix bug #65172
2024-06-07 14:22:56 +03:00
2da89c8b03 Fix bug #68390 2024-06-07 15:59:35 +06:00
24fb53ac6f Fix bug #68426 2024-06-07 12:20:28 +03:00
4af39960da Fix bug #50286 2024-06-07 12:20:08 +03:00
dc485997f0 Merge pull request #1539 from ONLYOFFICE/feature/StarMath
Fix StarMath
2024-06-06 22:15:52 +03:00
2e6d5450b4 fix bug #66811 2024-06-06 16:22:04 +03:00
4ed4c5596f Fix bug #68404 2024-06-06 17:38:26 +06:00
dea44f1829 Fix bug #68402 2024-06-06 16:57:06 +06:00
b428487d07 Merge pull request #1535 from ONLYOFFICE/fix/bug-68123
Fix bug 68123
2024-06-06 13:22:30 +03:00
f366cae604 Fix bug #68400 2024-06-06 16:20:11 +06:00
96ea86e3c0 Fix bug 68123 2024-06-06 13:09:07 +03:00
5c7d0a61be fix bug 68332 2024-06-06 11:59:48 +03:00
4014d4914f fix bug 68327 2024-06-06 11:02:30 +03:00
0b77fb2bba fix bug 68333 2024-06-06 10:38:01 +03:00
2e1ccbc985 For bug 46629 2024-06-06 10:21:51 +03:00
f5202108a1 Merge pull request #1534 from ONLYOFFICE/fix/bug-68252
Fix bug #68252
2024-06-06 09:45:18 +03:00
2f7407bd8e Merge pull request #1533 from ONLYOFFICE/fix/bug-67967
Fix bug 67967
2024-06-06 09:45:00 +03:00
ac721572f2 Fix bug #67967 2024-06-06 08:51:59 +03:00
33da43b2f4 Fix bug 67747 2024-06-05 19:57:56 +03:00
6000944cc9 Fix bug #68238 2024-06-05 19:20:58 +06:00
591dffc965 Merge pull request #1531 from ONLYOFFICE/feature/StarMath
fix bug 68328
2024-06-05 15:57:20 +03:00
cd74ef4ded fix bug 68328 2024-06-05 15:52:33 +03:00
c7612a259d Add support create & save pdf forms 2024-06-05 14:41:41 +03:00
586455310a Merge pull request #1530 from ONLYOFFICE/fix/pdf-tilingPattern
Fix swap RGB pdf tilingPattern
2024-06-05 12:25:31 +03:00
96008085d6 Fix swap RGB 2024-06-05 11:46:30 +03:00
282b87e518 Merge pull request #1529 from ONLYOFFICE/fix/bug-63346
Fix bugs 63346, 66523
2024-06-05 11:16:00 +03:00
115a60c273 For bug 68216 2024-06-05 02:26:58 +03:00
66d48673cf Fix min tilingPattern 2024-06-04 15:41:58 +03:00
29ef74770a Fix bug 66523 2024-06-04 13:22:18 +03:00
15247d39f0 Fix bug 63346 2024-06-04 12:22:21 +03:00
145154690b Merge pull request #1528 from ONLYOFFICE/fix/bug-68349
For bug 68349
2024-06-04 09:59:16 +03:00
4f28d8d3d8 For bug 68349 2024-06-04 09:55:42 +03:00
2fdd88bee2 Merge remote-tracking branch 'origin/fix/bug68170' into release/v8.1.0 2024-06-03 14:50:28 +03:00
7c501fe5a3 Fix bug #68252 2024-06-03 12:06:29 +03:00
acbf5b0c40 Fix bug #68170
Add image alternative text and description
2024-06-03 13:22:38 +05:00
d843cf1fe1 Fix bug #63489
Convert text divided into columns
2024-06-03 13:21:35 +05:00
50529346e4 Merge remote-tracking branch 'origin/release/v8.1.0' into fix/bug63489 2024-06-03 13:21:03 +05:00
803fcf3602 fix bug #68304 2024-06-02 17:35:48 +03:00
d83930bf67 fix bug #68307 2024-06-02 16:59:20 +03:00
cd5ca284e1 Change IsDouble method: return true if value has integer type 2024-06-02 15:37:04 +03:00
7a1a59a883 For bug 68028 2024-06-02 10:20:52 +03:00
bfb97ef026 Merge pull request #1526 from ONLYOFFICE/fix/pdf-tilepattern
Fix pdf rotate point
2024-05-31 16:47:41 +03:00
742cfde620 Fix rotate point 2024-05-31 16:39:41 +03:00
600fd26e30 fix build 2024-05-31 13:45:15 +03:00
92fa08303e Merge pull request #1525 from ONLYOFFICE/fix/pdf-default-color
Fix default color
2024-05-31 11:52:22 +03:00
17bd0f99dd Fix default color 2024-05-31 11:49:05 +03:00
4eaf500040 Fix bug #65172 2024-05-30 23:20:35 +06:00
d5d4d06553 Merge pull request #1517 from ONLYOFFICE/fix/bug66009
Fix bug #66009
2024-05-30 16:47:53 +03:00
400da99fa9 Merge pull request #1522 from ONLYOFFICE/fix/bug68229
Fix bug #68229
2024-05-30 16:46:56 +03:00
b209e00333 fix bug #68276 2024-05-30 16:30:59 +03:00
1859173fb6 Merge pull request #1523 from ONLYOFFICE/fix/bug-68256
Fix bug 68256
2024-05-30 13:06:54 +03:00
dfb0aeefcb Fix read/write tilingPattern in pdf 2024-05-30 12:45:56 +03:00
6ba5d1141e Fix bug 68256 2024-05-30 12:45:17 +03:00
8d6a13b24a Fix bug #68229 2024-05-30 15:41:52 +06:00
a66fdc73a5 fix bug #68264 2024-05-29 20:35:44 +03:00
a2b8fcc5e1 for bug #61035 2024-05-29 20:03:17 +03:00
7ac5ff5383 Merge pull request #1521 from ONLYOFFICE/fix/bug-68233
Fix bug 68233
2024-05-29 15:50:42 +03:00
5e560528a4 Fix bug 68233 2024-05-29 15:08:32 +03:00
b8c57da779 Merge pull request #1519 from ONLYOFFICE/fix/html
Fix html/mht bugs
2024-05-29 11:43:39 +03:00
19951d807c Merge pull request #1520 from ONLYOFFICE/feature/jsc-inspectable-context
Set contexts inspectable for JSC
2024-05-29 09:58:59 +03:00
49d1426831 Fix bug #68230 2024-05-29 01:33:56 +03:00
e8ae960a26 Fix bug #68235 2024-05-29 01:32:54 +03:00
11ddc0ab4f Set contexts inspectable for JSC 2024-05-28 23:50:21 +04:00
5361740a02 Merge pull request #1518 from ONLYOFFICE/fix/bug-68225
Fix bug 68225
2024-05-28 16:44:09 +03:00
0050c6148c Fix bug 68225 2024-05-28 16:33:41 +03:00
8e3df68ffc fix bug #50594 2024-05-28 15:27:12 +03:00
ab829fa8db fix bug #68213 2024-05-28 11:28:19 +03:00
bc56de19c1 Fix bug #66009 2024-05-27 20:11:30 +06:00
1de6787014 Merge pull request #1516 from ONLYOFFICE/feature/StarMath
fix StarMath attribute
2024-05-27 13:32:11 +03:00
b02189c14d Merge pull request #1504 from ONLYOFFICE/fix/html
Fix html bugs
2024-05-27 13:23:40 +03:00
63003a5e76 fix bug 68094 2024-05-27 11:57:54 +03:00
499810dbae . 2024-05-27 08:01:06 +03:00
f55d822c4f fix build 2024-05-26 20:17:44 +03:00
4c51371b96 Merge pull request #1513 from ONLYOFFICE/fix/pdf-rotate
Fix pdf rotate
2024-05-25 21:53:19 +03:00
986bcae0e2 Merge pull request #1514 from ONLYOFFICE/fix/bug68109
Fix bug #68109
2024-05-24 17:20:27 +03:00
96b87265bb Merge pull request #1515 from ONLYOFFICE/fix/bug68113
Fix bug #68113
2024-05-24 17:19:24 +03:00
0be217ba05 Fix bug #68109 2024-05-24 18:23:17 +06:00
af12226bfa Fix FlateDecode for annot view 2024-05-24 14:51:30 +03:00
d51f035561 Fix AddShape for NewPage 2024-05-24 14:32:29 +03:00
d01681bb1e Fix bug #66549 2024-05-24 12:02:18 +03:00
72e975f7d9 Merge pull request #1512 from ONLYOFFICE/fix/pdf-bug
Fix bugs 54371, 67641
2024-05-24 09:57:00 +03:00
ba87df6b9d Fix bug 67641 2024-05-24 09:36:51 +03:00
a1fed79a78 Fix bug 54371 2024-05-24 09:36:31 +03:00
08111e8fde fix bug #67992 2024-05-23 17:46:02 +03:00
1286b7f458 fix bug #68122 2024-05-23 17:27:42 +03:00
dcb4364410 Fix bug 67641 2024-05-23 17:23:06 +03:00
55a009713e Fix bug 54371 2024-05-23 16:56:40 +03:00
474828364f Merge remote-tracking branch 'origin/release/v8.1.0' into fix/pdf-rotate 2024-05-23 16:31:30 +03:00
9e145ef9e0 Merge pull request #1511 from ONLYOFFICE/fix/pdf-bug
Fix 67740
2024-05-23 16:27:40 +03:00
40b6178a0d Fix c_nPenWidth0As1px for annot/field renderer 2024-05-23 16:22:52 +03:00
a70f50206d fix bug #67917 2024-05-23 14:36:14 +03:00
40fa3e60c4 Merge remote-tracking branch 'origin/release/v8.1.0' into fix/bug63489 2024-05-23 16:35:05 +05:00
105a193742 fix bug #68143 2024-05-23 14:00:28 +03:00
4ca9a94609 Fix bugs in html 2024-05-23 13:00:50 +03:00
3bfb3ee045 Fix bug #68113 2024-05-23 15:17:23 +06:00
512df584ba Merge branch 'release/v8.1.0' of https://github.com/ONLYOFFICE/core into release/v8.1.0 2024-05-23 12:03:20 +03:00
84eebc69e1 fix bug #68135 2024-05-23 12:03:14 +03:00
7abb3899a7 Merge pull request #1499 from ONLYOFFICE/fix/bug65948
fix bug #65948
2024-05-23 11:48:49 +03:00
f19906c14c Merge pull request #1500 from ONLYOFFICE/fix/bug66694
Fix bug #66694
2024-05-23 11:48:09 +03:00
fd15cdf4d0 Merge pull request #1508 from ONLYOFFICE/fix/bug66675
Fix bug #66675
2024-05-23 11:47:32 +03:00
9d3e553086 Merge pull request #1510 from ONLYOFFICE/fix/bug68111
Fix bug #68111
2024-05-23 11:46:11 +03:00
a19b4a03b3 Fixed a bug with attributes of functions and indexes 2024-05-23 11:27:28 +03:00
90650b1af8 Merge remote-tracking branch 'origin/fix/bug67380' into release/v8.1.0 2024-05-22 19:27:19 +03:00
3780922610 Fix bug #68111 2024-05-22 21:42:33 +06:00
fbb7ab93d6 Fix bug 67740 2024-05-22 17:37:33 +03:00
ca5201e704 FreeText has Rotate 2024-05-22 16:49:19 +03:00
2b13696379 Merge pull request #1509 from ONLYOFFICE/feature/docbuilder-python
Add new features to python docbuilder wrapper
2024-05-22 16:41:20 +03:00
24b32a2ba7 Fix bug #67380 2024-05-22 17:56:53 +05:00
1cdb2b0f15 Add list constructor and automatic conversion to CValue in functions 2024-05-22 16:52:13 +04:00
7758da7173 Add number constants for file types 2024-05-22 15:55:39 +04:00
3cd89354bc Fix pdf rotate for drawingfile 2024-05-22 11:08:12 +03:00
5fbed3db1c Fix double hashtag for color in RC 2024-05-22 10:30:09 +03:00
f28119e646 fix bug #68010 2024-05-21 20:47:23 +03:00
a2b0495254 Fix bug #66675 2024-05-21 21:11:57 +06:00
28f873be5c Merge pull request #1507 from ONLYOFFICE/feature/docbuilder-python
Add functionality in docbuilder python wrapper
2024-05-21 18:10:39 +03:00
5dede9304b Add support added images on recognize 2024-05-21 16:52:54 +03:00
ab52ee7486 Move PATH modify to windows-only section 2024-05-21 17:37:34 +04:00
8f711f607f fix bug #67989 2024-05-21 11:25:57 +03:00
f2c5fed3c1 Merge pull request #1506 from ONLYOFFICE/fix/pdf-free-text
Fix FreeText renderer length
2024-05-21 10:54:01 +03:00
1602fb2106 Fix FreeText renderer length 2024-05-21 10:49:49 +03:00
c3f72756a4 Merge pull request #1505 from ONLYOFFICE/fix/pdf-build 2024-05-21 10:19:51 +03:00
5f8b557eb5 Fix pdf build 2024-05-21 10:18:18 +03:00
9d8e75a957 Fix library names for linux and mac 2024-05-20 19:40:40 +04:00
839844cb4f Merge pull request #1503 from ONLYOFFICE/fix/pdf-shape-img
Fix pdf shape image
2024-05-20 17:57:59 +03:00
fac976a22e Read and write image ref for OShapes 2024-05-20 17:52:22 +03:00
84cb59d7b2 Merge pull request #1502 from ONLYOFFICE/fix/pdf-freetext-rc
Fix pdf freetext
2024-05-20 14:09:06 +03:00
788620079d Add loadLibrary() check and automatic Dispose() 2024-05-20 14:33:43 +04:00
0e5b95f1d8 Refactoring 2024-05-20 13:29:38 +04:00
d0a82d71ee Fix build 2024-05-20 12:29:00 +03:00
97f742f816 Merge remote-tracking branch 'origin/release/v8.1.0' into fix/pdf-freetext-rc
# Conflicts:
#	PdfFile/PdfEditor.cpp
2024-05-20 10:14:57 +03:00
58980e61b7 Fix typo and create folder for tests 2024-05-19 12:02:37 +03:00
5a04f9033b Fix build 2024-05-19 11:33:45 +03:00
28785f13bc Merge pull request #1501 from ONLYOFFICE/feature/docbuilder-python
Feature/docbuilder python
2024-05-19 11:23:46 +03:00
7a73d3288c Refactoring 2024-05-19 11:21:18 +03:00
d82b2dc6ef Fix bug #68073 2024-05-18 14:14:05 +03:00
6ad319554d Fix bug with font-size 2024-05-18 13:42:32 +03:00
ff3b94a23a Fix bug #68036 2024-05-18 13:05:58 +03:00
5227a593ed Fix bug #68034 2024-05-18 13:05:34 +03:00
c802944d3b Fixes in docbuilder.py
+ Add more complex example
+ Add .gitignore
2024-05-17 23:16:02 +04:00
93d77ee945 Added all classes to docbuilder.py 2024-05-17 22:09:38 +04:00
4c101b21d0 Changed lines ending for consistency 2024-05-17 22:07:17 +04:00
05366635c1 Remove development 2024-05-17 18:10:30 +03:00
d853d42090 Fix calculating glyph widths for Base14 fonts 2024-05-17 16:00:23 +03:00
cb06eae63e Merge remote-tracking branch 'origin/release/v8.1.0' into fix/bug63489 2024-05-17 17:20:42 +05:00
6ba40aba51 Fix bug #67380 2024-05-17 16:57:40 +05:00
b8d54fb295 fix bug #65948 2024-05-17 17:55:02 +06:00
84d7eb03f2 Add example of python wrapper 2024-05-17 14:11:22 +04:00
28cd584393 Fix delete functions and add simple c++ example 2024-05-17 14:10:50 +04:00
bd6cc8a759 Merge remote-tracking branch 'origin/fix/bug67926' into release/v8.1.0 2024-05-17 12:21:01 +03:00
7cfd4e2dfa Merge remote-tracking branch 'origin/fix/bug67822' into release/v8.1.0 2024-05-17 12:20:45 +03:00
f923f4e03d Merge remote-tracking branch 'origin/fix/bug67823' into release/v8.1.0 2024-05-17 12:20:32 +03:00
e8898ce424 Merge remote-tracking branch 'origin/fix/bug61378' into release/v8.1.0 2024-05-17 12:19:39 +03:00
ebe045a833 fix bug #67995 2024-05-17 11:56:18 +03:00
140f9970f9 Add wrapper library docbuilder_functions.dll and tests for it 2024-05-17 12:07:22 +04:00
3d23e74818 Fix bug #61378 2024-05-16 21:48:26 +05:00
c24c78267b Write Base14 fonts to pdf 2024-05-16 18:56:59 +03:00
a7501e370b Fix bug #66694 2024-05-16 19:06:13 +06:00
68200895d0 Merge pull request #1496 from ONLYOFFICE/fix/StarMath
Fix/StarMath
2024-05-16 13:57:28 +03:00
b6b99ee9f0 Redirect to annotation rendering 2024-05-15 17:43:59 +03:00
5ea601cde9 fix bug #67973 2024-05-15 16:25:51 +03:00
1e7611f3f9 Add method for duplicate image links on recognize 2024-05-15 13:20:20 +03:00
c14856ac6f fix bug #68011 2024-05-15 11:15:31 +03:00
8857d3daca fix bug #67972 2024-05-15 11:00:27 +03:00
ad1bd06bb3 fix bug #67968 2024-05-15 09:55:58 +03:00
52555f4d9d fix bug #67963 2024-05-15 09:24:08 +03:00
d85b3dd7f0 Support images on recognize 2024-05-14 21:43:21 +03:00
6af44146e5 Merge pull request #1495 from ONLYOFFICE/fix/bug66658
Fix bug 66658
2024-05-14 18:30:42 +03:00
f704c44e9e Merge pull request #1497 from ONLYOFFICE/fix/bug66678
Fix bug #66678
2024-05-14 18:30:10 +03:00
a9884c1efb Merge pull request #1498 from ONLYOFFICE/fix/bug66677
Fix bug #66677
2024-05-14 18:29:50 +03:00
2dc0956b3c Create CAnnotRenderer 2024-05-14 17:52:04 +03:00
7dbe7eb3e1 Fix bug #66677 2024-05-14 19:16:08 +06:00
5617968a0c Fix bug #67926 2024-05-14 17:51:19 +05:00
3b029ae4cd Merge branch 'release/v8.1.0' into fix/StarMath 2024-05-14 14:43:16 +03:00
73dc770870 Fix bug #66678 2024-05-14 17:41:48 +06:00
46e56afa5c bug fix(crashes, parsing correction) 2024-05-14 14:31:24 +03:00
e6842f50b3 Fix bug #bug66658 2024-05-14 15:20:51 +06:00
f008857ab2 Find Font for FreeText 2024-05-13 18:12:23 +03:00
e7022472ff Merge pull request #1492 from ONLYOFFICE/fix/bug67936
Fix bug #67936
2024-05-13 18:00:11 +03:00
b470c4b259 Merge pull request #1493 from ONLYOFFICE/fix/bug67933
Fix bug #67933
2024-05-13 17:59:56 +03:00
155103b40f Fix bug #67933 2024-05-13 15:30:01 +06:00
0eee7ea548 Merge pull request #1491 from ONLYOFFICE/fix/bug-67916
Fix bug #67916
2024-05-13 01:58:54 -07:00
b53527c9fd Fix bug #67936 2024-05-13 14:53:32 +06:00
7a842c4b14 Merge pull request #1489 from ONLYOFFICE/fix/html
Fix html
2024-05-12 12:45:44 -07:00
9779e53fe7 The algorithm for checking arrays has been rewritten 2024-05-12 21:50:04 +03:00
6bccf233ee Merge pull request #1477 from ONLYOFFICE/fix/html
Fix bugs in html converter
2024-05-12 06:46:37 -07:00
83e020f492 Fix bug #67916 2024-05-10 14:32:23 +03:00
84e4797ddf fix bug #67940 2024-05-10 10:53:02 +03:00
40e7685751 fix bug #67941 2024-05-10 10:40:07 +03:00
bfdd7be53c Merge pull request #1487 from ONLYOFFICE/fix/bug67919
Fix bug #67919
2024-05-08 17:41:06 +03:00
198498a26d Merge pull request #1486 from ONLYOFFICE/fix/bug67922
Fix bug #67922
2024-05-08 17:40:34 +03:00
3ba74a0373 Merge pull request #1485 from ONLYOFFICE/fix/bug67923
Fix bug #67923
2024-05-08 17:40:17 +03:00
5c7b7615dd Fix find FreeText Fonts object 2024-05-08 17:40:11 +03:00
e2992c2a79 Fix bug #67919 2024-05-08 19:33:43 +06:00
aab5cfe30c Fix bug #67922 2024-05-08 19:15:45 +06:00
f32ace9737 Fix bug #67923 2024-05-08 18:50:17 +06:00
d8bed77b67 Fix bug #67823 2024-05-08 17:05:49 +05:00
7ae79f20b8 Fix bug #67822 2024-05-08 15:12:22 +05:00
0a09d4a872 Merge pull request #1482 from ONLYOFFICE/fix/bug67897
Fix bug67897
2024-05-08 13:06:42 +03:00
68e778ba1f Merge pull request #1483 from ONLYOFFICE/fix/bug67898
Fix bug #67898
2024-05-08 13:06:20 +03:00
6d28d1af1d Merge pull request #1484 from ONLYOFFICE/fix/bug67891
Fix bug #67891
2024-05-08 13:05:52 +03:00
7e7bc0eb0e Fix bug #67891 2024-05-08 15:39:02 +06:00
b32728c9f0 fix bug #66842 2024-05-08 12:06:28 +03:00
39748f9d9e fix bug #67895 2024-05-08 11:49:04 +03:00
dabe547fb4 [android] Build only arm arch 2024-05-08 11:33:09 +03:00
3104f84768 fix bug #67876 2024-05-08 10:53:05 +03:00
bb2967c3ea Write RD and CA for FreeText AP.N 2024-05-07 17:43:26 +03:00
de1c08d65a Fix bug #67898 2024-05-07 20:40:12 +06:00
a68f18c9f2 Fix bug #67897 2024-05-07 19:55:22 +06:00
d16d7a1e76 Merge pull request #1479 from ONLYOFFICE/fix/bug67867
Fix bug #67867
2024-05-07 15:21:18 +03:00
2338218fa6 Merge pull request #1478 from ONLYOFFICE/fix/bug67864
Fix bug67864
2024-05-07 15:21:05 +03:00
a46115f056 Merge pull request #1480 from ONLYOFFICE/fix/bug67860
Fix bug #67860
2024-05-07 15:20:53 +03:00
d61747c283 Merge pull request #1481 from ONLYOFFICE/feature/libvlc-player-vout
Add video output signal to libvlc
2024-05-07 05:12:50 -07:00
10afcda7a3 Add new signal to CVlcPlayer 2024-05-07 14:31:02 +04:00
680c3824f7 Fix bug #67860 2024-05-07 16:00:34 +06:00
194d1c2208 Fix bug #67864 2024-05-07 15:04:29 +06:00
88aba1cb02 Fix MK.IF.A default value 2024-05-07 11:43:20 +03:00
fd664bafae Fix bug #67867 2024-05-07 14:20:46 +06:00
c03ec96966 . 2024-05-07 10:40:24 +03:00
5e02a7c21e Merge remote-tracking branch 'origin/fix/xlsb_conversion' into release/v8.1.0 2024-05-07 10:25:34 +03:00
bce25e9788 Fix mac build 2024-05-06 22:14:57 +03:00
b8332ae05b Merge pull request #1461 from ONLYOFFICE/feature/libvlc-functions
Add some functionality to libvlc player
2024-05-06 09:39:26 -07:00
f1fbcf653b Create StartDrawFreeText 2024-05-06 17:48:12 +03:00
283d611ad7 Fix sparkline conversion 2024-05-06 20:44:19 +06:00
045ca4ad9e . 2024-05-06 16:03:34 +03:00
f7a623a052 Merge branch 'release/v8.1.0' of https://github.com/ONLYOFFICE/core into release/v8.1.0 2024-05-06 15:49:06 +03:00
0439347bc3 fix bug #67782 2024-05-06 15:49:01 +03:00
441716773f Add property for strip x2t library 2024-05-06 15:12:02 +03:00
801e068abb Merge remote-tracking branch 'origin/fix/bug67815' into release/v8.1.0 2024-05-06 14:35:09 +03:00
a44e22c726 fix bug #67818 2024-05-06 14:34:06 +03:00
63bd2a1cbf Fix bug #67815 2024-05-06 15:49:48 +05:00
c88c1aac96 [android] Fix copy libs and build 2024-05-04 20:52:51 +03:00
a2e76364e9 Fix bug #67827 2024-05-04 15:19:06 +03:00
051ae3fab6 Fix bug #67836 2024-05-04 00:34:50 +03:00
f1544a6f6c Fix bug#67829 2024-05-03 22:50:16 +03:00
715facaefc Create AP for FreeText 2024-05-03 17:32:37 +03:00
6de671ccd5 Added language consideration when converting EPUB files 2024-05-03 15:57:29 +03:00
e61a727180 Merge pull request #1475 from ONLYOFFICE/fix/pdf-link
Fix pdf link
2024-05-03 15:42:40 +03:00
30e09e731b Fix delete Link annot in edit mode 2024-05-03 15:39:54 +03:00
d516c625eb Fix EditPage when adding Link in edit mode 2024-05-03 15:39:13 +03:00
9dceffdbeb Fix write RC to NSStringUtils::CStringBuilder 2024-05-03 15:36:51 +03:00
e107a67f55 Fix delete Link annot in edit mode 2024-05-03 15:36:14 +03:00
ee85c3597e fix bug #67011 2024-05-03 15:06:19 +03:00
ddc413a1b3 Fix EditPage when adding Link in edit mode 2024-05-03 13:39:03 +03:00
5c6aaed51f Fix svg file size 2024-05-03 13:18:53 +03:00
234c1766dc Fix bug #67770 2024-05-03 13:18:26 +03:00
95d8fd2871 Fix bug #67767 2024-05-03 13:17:41 +03:00
a6d9af576d . 2024-05-03 12:38:06 +03:00
23c54255e3 Fix ptg conversion 2024-05-03 13:55:29 +06:00
013d6990ce Write RC to FreeText 2024-05-02 18:32:32 +03:00
25b33244a4 fix bug #67011 2024-05-02 15:57:47 +03:00
c8c4127fbb Merge pull request #1474 from ONLYOFFICE/fix/bug62568
Fix/bug62568
2024-05-02 14:53:13 +03:00
33fdfadcf7 fix bug #66679 2024-05-02 11:33:28 +03:00
3d7fa985f7 Change libraries list for x2t 2024-05-01 21:51:58 +03:00
e69dc4f898 Remove unneeded files from compilation 2024-04-27 16:45:28 +03:00
32b5dfc04a for bug #67352 2024-04-27 16:43:18 +03:00
2d78eda6ad Merge remote-tracking branch 'origin/fix/bug65612' into release/v8.1.0 2024-04-27 16:35:59 +03:00
ae03967fb6 Merge remote-tracking branch 'origin/fix/bug61378' into release/v8.1.0 2024-04-27 16:26:27 +03:00
5db50d2ff7 Merge branch 'release/v8.1.0' into fix/xlsb_conversion 2024-04-27 17:43:35 +06:00
af226ceb67 Merge pull request #1473 from ONLYOFFICE/fix/bug67544
fix bug #67544
2024-04-27 14:41:34 +03:00
b17a6be4d5 fix bug #67679 2024-04-27 14:27:17 +03:00
7f791ad265 fix bug #67544 2024-04-27 17:27:11 +06:00
03b568ad49 fix bug #67673 2024-04-27 12:24:30 +03:00
f9bfdee8c3 Merge pull request #1470 from ONLYOFFICE/release/v8.1.0
Release/v8.1.0
2024-04-27 11:53:22 +03:00
123fcf9d3c Merge pull request #1472 from ONLYOFFICE/fix/bug-63701
Fix bug #63701
2024-04-27 11:29:56 +03:00
e673fd5b38 Merge pull request #1471 from ONLYOFFICE/fix/bug-67716
Fix bug #67716
2024-04-27 11:29:24 +03:00
0b07bef0de Fix for pptx shapes 2024-04-27 02:22:33 +03:00
ba4c5b31d1 Fix previous commit 2024-04-27 01:46:43 +03:00
6b5f930a1e Add custom image storage to docxrenderer 2024-04-27 01:44:26 +03:00
4880ff705b Merge branch 'release/v8.1.0' into fix/StarMath 2024-04-26 17:30:39 +03:00
4f7841fa85 Merge pull request #1464 from ONLYOFFICE/fix/bug67231
Fix bug 67231
2024-04-26 17:23:34 +03:00
3acb44a5c9 Fixed drop in assessment. fix bugs. 2024-04-26 17:08:50 +03:00
5108fa6b94 Fix bug 66740 2024-04-26 14:44:03 +03:00
db5909fdf5 Fix bug #67716 2024-04-26 14:39:34 +03:00
051a1fa7ef Fix bug 67444 2024-04-26 12:47:51 +03:00
2fa4cdebb9 Fix table conversion 2024-04-25 21:35:11 +06:00
3c2f4874fc Fix bug #63701 2024-04-25 16:15:48 +03:00
66d8690dc3 Fix bug 66872 2024-04-25 12:08:44 +03:00
0f9b8f14e6 Fix bug #61378 2024-04-24 22:19:35 +05:00
eb1bc2779b Fix formula types conversion 2024-04-24 18:35:38 +06:00
ed9a5f1a24 editing tabs 2024-04-23 15:55:32 +03:00
31090af440 Fix array formula conversion 2024-04-22 16:32:40 +06:00
73624f28ac Fix android build 2024-04-20 14:02:19 +03:00
9daa8a1239 Fix build 2024-04-20 13:21:45 +03:00
82b634878f Fix build 2024-04-20 12:40:01 +03:00
033f61576e Merge pull request #1466 from ONLYOFFICE/fix/mht
Improved html and mht conversion
2024-04-19 20:50:11 +03:00
6de60d2543 Fix bugs in html to ooxml conversion 2024-04-19 19:20:45 +03:00
b7af10970a Merge pull request #1465 from ONLYOFFICE/fix/csv-date-conversion
Fix csv date conversion
2024-04-19 14:26:56 +03:00
c18224ea07 Fix csv date conversion 2024-04-19 17:17:14 +06:00
0a088eb949 fix bug 67231 2024-04-18 21:32:51 +03:00
48df470387 Merge pull request #1463 from ONLYOFFICE/fix/pdf-text-annot
Fix pdf text annot
2024-04-18 18:19:01 +03:00
c3767cf68e Fix bug 67439 2024-04-18 18:01:23 +03:00
663248ae2b Merge branch 'release/v8.1.0' into fix/xlsb_conversion 2024-04-18 20:53:34 +06:00
040ead411f Fixed a bug with encoding detection 2024-04-18 15:04:50 +03:00
a94a068202 Fix cell error conversion 2024-04-18 17:58:50 +06:00
05ad136231 Draw AP for 11-16 types text annot 2024-04-18 12:18:57 +03:00
b6c81a1f05 Draw AP for 0-10 types text annot 2024-04-17 17:52:20 +03:00
513b39b156 Fix bugs in html to ooxml conversion 2024-04-17 16:33:44 +03:00
2956768477 Merge pull request #1462 from ONLYOFFICE/fix/pdf-annot-text
Fix pdf annot text
2024-04-17 13:17:01 +03:00
a782d26621 Fix build 2024-04-17 13:04:55 +03:00
c859b5c440 Rename IsEditPage 2024-04-17 12:50:43 +03:00
6065c8b1f2 Fix bug 67337 2024-04-17 12:47:42 +03:00
bd39d887cf Create DrawTextComment-N and -R 2024-04-16 17:35:52 +03:00
6778a4c0da Add operators check in pthtypesParsing 2024-04-16 18:17:49 +06:00
2901f337e7 Add some functionality to libvlc player 2024-04-16 15:15:37 +04:00
ca179304c3 Fix bugs in html to ooxml conversion 2024-04-15 21:46:24 +03:00
cb53604c13 Add parsing ptg types method 2024-04-15 19:27:19 +06:00
2ad2ad9dfd Merge pull request #1460 from ONLYOFFICE/fix/pdf-shape
Fix clear content
2024-04-15 14:34:47 +03:00
6431ba5245 Fix clear content 2024-04-15 14:02:43 +03:00
2e74e8fa11 fix bug #67398 2024-04-14 17:06:40 +03:00
1e18eb4335 Merge pull request #1459 from ONLYOFFICE/fix/x2t_date_time 2024-04-12 20:32:58 +03:00
ddb01d9478 Sets bDateTime true by default 2024-04-12 20:19:12 +03:00
e11ddf9153 Merge pull request #1458 from ONLYOFFICE/feature/pdf-shape
Feature pdf shape
2024-04-12 17:48:38 +03:00
2f916dcd11 Fix build 2024-04-12 17:45:31 +03:00
8b2b4d1bbf Add support shapes from metadata 2024-04-12 17:07:20 +03:00
6adc289948 Merge remote-tracking branch 'origin/release/v8.1.0' into feature/pdf-shape 2024-04-12 13:57:53 +03:00
4f3d495b3a Rotate page 2024-04-12 13:56:05 +03:00
79fa4f26a7 Remove GetShapes test 2024-04-12 13:55:14 +03:00
52a07814f4 Improving the quality of converting html tables to ooxml and refactoring 2024-04-12 13:17:13 +03:00
2e32a1b70a Remove GetShapes 2024-04-12 12:50:07 +03:00
79d90b89bd Merge pull request #1457 from ONLYOFFICE/fix/office_utils
Fix bug with headers in zip
2024-04-12 10:03:29 +03:00
43c05c6041 Fix fromJS method 2024-04-11 17:02:21 +03:00
3015aff491 . 2024-04-11 16:35:23 +03:00
490e3be6c4 Merge pull request #1456 from ONLYOFFICE/fix/bug66286
For bug 66286
2024-04-11 16:18:48 +03:00
1929e2e5c9 Fix page scale 2024-04-11 16:02:48 +03:00
b7ca461ba5 Fix coord shift 2024-04-11 14:42:11 +03:00
8309c5bbfe End every paragraph with a:endParaRPr 2024-04-11 15:12:26 +05:00
ad60357f6f Merge remote-tracking branch 'origin/release/v8.1.0' into feature/pdf-shape
# Conflicts:
#	DocxRenderer/src/resources/VectorGraphics.h
2024-04-11 11:13:32 +03:00
de2ecb08a0 . 2024-04-10 22:09:51 +03:00
897c7493da Fixes for .m files 2024-04-10 20:31:35 +03:00
d733af03aa Fix icon set conversion 2024-04-10 20:30:26 +06:00
13b0458d47 Add support for external headers 2024-04-10 15:30:52 +03:00
defbcd77fb Add originIndex for drawingfile 2024-04-10 13:12:08 +03:00
5e02d5d943 Fix begin/end-MarkedContent 2024-04-10 13:07:21 +03:00
aa83a2dda2 ShapeStart, ShapeEnd for RendererOutputDev 2024-04-10 12:44:03 +03:00
5c7ebcd3ff BMC replaced by BDC for marked content 2024-04-10 12:42:32 +03:00
82d577c335 ShapeStart, ShapeEnd to DocInfo 2024-04-10 12:40:25 +03:00
cecf3fe9a8 Fix bug with headers in zip 2024-04-10 11:41:15 +03:00
b4556c0254 Refactoring 2024-04-09 22:55:42 +03:00
5708517a0e fix bug #67016 2024-04-09 21:02:22 +03:00
e728a58222 Fix cond fmt conversion from xlsb to xlsx 2024-04-09 22:17:25 +06:00
7db54c9cef Merge pull request #1454 from ONLYOFFICE/fix/bug66286
Fix bug 66286
2024-04-09 17:55:59 +03:00
a9dd418841 Fix build 2024-04-09 17:39:45 +03:00
8491d20439 Add fmla test case 2024-04-09 20:31:24 +06:00
30ae04fd6e Update test files 2024-04-09 20:31:09 +06:00
85980186ac Fix bug 66286 2024-04-09 16:46:52 +03:00
471c9a4ebd Improved work with caption tables when html to ooxml conversion 2024-04-09 16:18:46 +03:00
2481f7f257 Fix build with old compilers 2024-04-09 13:09:01 +03:00
f5ca81240b Fix connection conversion 2024-04-09 14:13:29 +06:00
2038ace911 Fix build 2024-04-09 10:03:19 +03:00
2277feb87d fix bug #67327 2024-04-08 19:55:37 +03:00
229c88a7be fix build 2024-04-08 19:55:08 +03:00
7accccb3ab Merge remote-tracking branch 'origin/release/v8.1.0' into feature/pdf-shape
# Conflicts:
#	DesktopEditor/graphics/pro/js/wasm/src/drawingfile.cpp
#	DocxRenderer/src/logic/Page.cpp
2024-04-08 18:02:41 +03:00
e33e659c22 Restore write xfrm to docx shapes. Add pptx shapes to wasm module 2024-04-08 17:35:40 +03:00
4ddde8246d Add ctPageRotate, AddPage and RemovePage 2024-04-08 17:17:06 +03:00
2ab2cb7cf2 Fix connections conversion 2024-04-08 18:45:59 +06:00
dbbd6cbbe6 Merge pull request #1452 from ONLYOFFICE/feature/docx_renderer2
Feature/docx renderer2
2024-04-08 13:22:00 +03:00
8c522aa006 Fix repeat fonts 2024-04-05 17:21:51 +03:00
bb858cc24a . 2024-04-05 16:59:03 +03:00
31079f91be Merge remote-tracking branch 'origin/fix/bug60279' into release/v8.1.0 2024-04-05 16:54:46 +03:00
8ad98fae68 Merge remote-tracking branch 'origin/fix/bug61378' into release/v8.1.0 2024-04-05 16:50:09 +03:00
790f51dd1b Merge remote-tracking branch 'origin/fix/bug67089' into release/v8.1.0 2024-04-05 16:48:05 +03:00
d13e5dc3da Merge remote-tracking branch 'origin/feature/odg' into release/v8.1.0 2024-04-05 16:47:48 +03:00
10c6def10e Bug fixed. Editing sqrt and nroot, dropping parentheses. 2024-04-05 15:54:31 +03:00
b2bcdbc2bc Fix bug #61378 2024-04-05 16:02:06 +05:00
bfefe4d1b7 Merge remote-tracking branch 'origin/release/v8.1.0' into feature/pdf-shape
# Conflicts:
#	DesktopEditor/graphics/pro/js/wasm/src/pdfwriter.cpp
#	PdfFile/PdfReader.cpp
#	PdfFile/SrcWriter/Document.cpp
2024-04-05 12:25:30 +03:00
7f17f30650 for bug 67231 2024-04-04 20:42:29 +03:00
6fdac51409 Merge pull request #1451 from ONLYOFFICE/fix/bug66986
For bug #66986
2024-04-04 16:53:58 +03:00
463ca006ee Fixed bugs with tables in html to ooxml conversion 2024-04-04 16:48:52 +03:00
e8a69e39bc Fix bugs #67249, #65628 2024-04-04 16:40:41 +03:00
8b9c0d79bb Fix bug #67210 2024-04-04 14:27:48 +03:00
12fd3bd3ce Comment conditional formattings ext 2024-04-04 17:20:59 +06:00
2f7447f918 For bug #66986 2024-04-04 12:40:16 +03:00
078e9afcc2 Fix conditional formatting conversion 2024-04-03 21:31:09 +06:00
91bc306369 Fix bug #67089 2024-04-03 19:58:18 +05:00
ab4a3ef546 fix bug #67231 2024-04-03 11:53:12 +03:00
3d2e43b5d7 fix namespace math 2024-04-03 11:50:09 +03:00
fcb4ae3909 Merge pull request #1446 from ONLYOFFICE/fix/bug66934
Fix bug #66934
2024-04-02 19:04:57 +03:00
ebe0248c3f fix bug #67016 2024-04-02 13:08:08 +03:00
083ced27c8 fix build 2024-04-02 12:32:04 +03:00
3c8604390e Fix table styles conversion 2024-04-01 16:03:16 +06:00
d23268b76e Merge branch 'release/v8.1.0' into fix/xlsb_conversion 2024-04-01 14:30:24 +06:00
2b72bf3f53 Fix bugs (correction of indexes, without elements between them, editing of frac and binom)
(cherry picked from commit 43bee348aa)
2024-04-01 10:48:20 +03:00
110617547c improvements to attribute parsing
(cherry picked from commit 7776f15a35)
2024-04-01 10:47:46 +03:00
db95af6c58 refinement of parsing and conversion of indexes. editing and writing tests.
(cherry picked from commit 62b3b7b3c6)
2024-04-01 10:47:39 +03:00
b1794fcf96 editing parsing of indexes with operators. adding alignment.
(cherry picked from commit 1dff8bb868)
2024-04-01 10:47:27 +03:00
fcd0bec3ac conversion of unary symbols. code refactoring.
(cherry picked from commit 89287887a0)
2024-04-01 10:47:11 +03:00
3d394b173c fix bugs
(cherry picked from commit 97ddd35653)
2024-04-01 10:46:56 +03:00
0b05f25488 Merge commit '835f4ba89db4bf52993519a88948923821db17be' into feature/odf-math-2 2024-04-01 10:45:07 +03:00
c44aed0e9a Refactoring 2024-03-30 12:53:30 +03:00
2156d6e134 fix bug #66842 2024-03-29 17:28:02 +03:00
9094965909 Fix bug #60279 2024-03-29 17:04:39 +05:00
8332560d06 Fix data validations 2024-03-29 15:31:52 +06:00
b7a4c739eb fix bug #67121 2024-03-28 13:40:59 +03:00
db9015a3e7 Change ms placeholder presentation type 2024-03-28 14:01:38 +05:00
f203f73a4b fix bug #67087 2024-03-27 18:40:38 +03:00
7a31de1708 Merge branch 'release/v8.1.0' into fix/xlsb_conversion 2024-03-27 14:55:31 +06:00
e2d278c74b Fix dxfs conversion 2024-03-27 14:54:22 +06:00
c961f00fd1 fix bug #67043 2024-03-26 20:06:43 +03:00
a31361fe05 Added a method for equating any one to the nearest of the given ones 2024-03-26 19:38:12 +03:00
53b93ed9f2 fix bug #67109 2024-03-26 19:34:29 +03:00
22a255f351 Fix images bug 2024-03-26 17:57:31 +03:00
cbac820495 fix bug #67066 2024-03-26 17:37:06 +03:00
4cc7ec1ed0 Fix dxfs conversion 2024-03-26 18:03:51 +06:00
8b16b1625f Fix bug 2024-03-26 11:46:30 +03:00
9e260897b3 Fixed a bug with the percentage size of the svg file 2024-03-26 10:56:52 +03:00
b10e482fbb Fix dxf prop conversion 2024-03-25 22:21:22 +06:00
510a6a621d fix bug #67054 2024-03-25 18:13:10 +03:00
4a1f483315 Fix alignment + fix logic 2024-03-24 22:47:03 +03:00
7e1c27e5ad Merge pull request #1448 from ONLYOFFICE/fix/bug67066
Fix bug 67066
2024-03-22 14:17:39 +03:00
c223714b52 Fix bug 67066 2024-03-22 13:54:48 +03:00
23f6a3a3df Merge branch 'release/v8.1.0' into fix/xlsb_conversion 2024-03-22 13:48:24 +06:00
aad7f089e4 Fix pivot tables conversion 2024-03-21 20:31:04 +06:00
03244e9e83 For bug #65612
Fix Split/Cover transition parameter conversion
2024-03-21 14:44:44 +05:00
8adf556ea8 Merge pull request #1447 from ONLYOFFICE/fix/pdf-cropbox-ap
Fix cropbox offset for AP annots
2024-03-21 12:23:40 +03:00
bb84209b05 Fix cropbox offset for AP annots 2024-03-21 12:02:59 +03:00
e01aa641a0 Remove PdfWriter_empty 2024-03-20 18:15:42 +03:00
c9fbe4189c Added merging of extra cells in html to ooxml conversion 2024-03-20 13:51:18 +03:00
475d0be0bf fix bug #59931 2024-03-20 11:54:48 +03:00
70a4e3e792 fix bug #67008 2024-03-20 10:55:55 +03:00
7c349dfa18 Create PdfEditor 2024-03-19 18:58:52 +03:00
4943193ef7 fix bug #66868 2024-03-19 16:44:26 +03:00
3a6f74dc82 fix flags 2024-03-19 16:08:21 +03:00
8c00325004 Merge remote-tracking branch 'origin/feature/pdf-freetext' into feature/pdf-shape 2024-03-19 14:48:33 +03:00
4deae80350 Fix right alignments 2024-03-19 12:27:22 +03:00
d5a4cd43e3 Fix bug 2024-03-19 11:23:58 +03:00
6eaf5cc9d3 Fix ScanPagePptx 2024-03-19 11:15:25 +03:00
ad2c6b67f1 fix bug #66864 2024-03-19 11:00:37 +03:00
13542b1388 fIx content types writing for worksheets and pivot tables 2024-03-18 22:38:46 +06:00
1b865e9b13 Refactoring AnnotField and FormField 2024-03-18 17:53:32 +03:00
cfee077b9d Merge remote-tracking branch 'origin/fix/bug66795' into release/v8.1.0 2024-03-18 15:57:32 +03:00
30d4dbae5a Merge branch 'release/v8.1.0' into fix/xlsb_conversion 2024-03-18 18:28:44 +06:00
6874e110bb fix build 2024-03-18 15:21:21 +03:00
f89becf68f Fix bug #66934 2024-03-18 18:18:08 +06:00
88008a9e7e fix bug #66959 2024-03-17 11:34:53 +03:00
b20e29daaf fix bug #66960 2024-03-17 09:24:24 +03:00
95cf8bc4bd Merge branch 'feature/docx_renderer2' of https://github.com/ONLYOFFICE/core into feature/docx_renderer2 2024-03-15 18:38:51 +03:00
b311bb319b ScanPagePptx done 2024-03-15 18:37:48 +03:00
21f73ba724 Merge pull request #1445 from ONLYOFFICE/feature/json-strings
JSON: Simplification of working with strings
2024-03-15 17:41:20 +03:00
ce9d61a3aa Fixed json test 2024-03-15 18:31:42 +04:00
b2c8696d1d Change strings conversion function 2024-03-15 18:16:58 +04:00
be0c6b13e7 Strings unify 2024-03-15 17:56:17 +04:00
ba307e8d2b Merge pull request #1444 from ONLYOFFICE/fix/bug66947
Fix bug 66947
2024-03-15 16:43:28 +03:00
4364f95fb6 Fix bug 66947 2024-03-15 16:30:12 +03:00
fb4c8ebf32 Refactoring and fix bugs 2024-03-15 15:57:57 +03:00
e53416e934 Add worksheet write before another parts 2024-03-15 18:10:58 +06:00
1a92ec57e1 Fix multisheet reference conversion 2024-03-15 18:09:36 +06:00
d0adabc5f7 Fix bug #66795 2024-03-15 17:04:33 +05:00
b9bf82d932 Merge branch hotfix/v8.0.1 into release/v8.1.0 2024-03-15 11:12:33 +00:00
f067fc3268 Merge branch hotfix/v8.0.1 into develop 2024-03-15 11:12:29 +00:00
dc3a4a3ed9 Merge branch hotfix/v8.0.1 into master 2024-03-15 11:12:24 +00:00
53ca119a99 Improved conversion of tables from html to ooxml 2024-03-15 12:58:03 +03:00
bf63f5322c Merge pull request #1440 from ONLYOFFICE/fix/bug66933
Fix bug 66933
2024-03-15 12:51:36 +03:00
f682f51481 Fix bug 66933 2024-03-15 12:17:11 +03:00
933741ca88 Fix ios build 2024-03-15 12:12:53 +03:00
7adcec27ff Merge pull request #1439 from ONLYOFFICE/release/v8.1.0
Release/v8.1.0
2024-03-14 20:08:12 +03:00
a684336b72 Fix build 2024-03-14 20:06:20 +03:00
c3ef38b1e1 For bug 66933 2024-03-14 18:53:22 +03:00
94ceab0a03 Add multysheet xti using 2024-03-14 19:33:07 +06:00
8769924fe2 Merge pull request #1438 from ONLYOFFICE/fix/bug66721
Fix bug 66721
2024-03-14 16:06:30 +03:00
08ae2f5d2e Fix bug 66721 2024-03-14 15:37:38 +03:00
b436a70662 Merge pull request #1437 from ONLYOFFICE/fix/bug66537
Fix bug 66537
2024-03-14 12:43:05 +03:00
7d15bbc7c2 Fix build 2024-03-14 12:17:51 +03:00
00769d01c1 Fix bug 66537 2024-03-14 11:42:25 +03:00
3b1fa0a9bd Merge branch 'release/v8.1.0' of https://github.com/ONLYOFFICE/core into release/v8.1.0 2024-03-13 18:43:29 +03:00
1a676ace8b fix bug #66857 2024-03-13 18:43:13 +03:00
601ba0cedc Merge pull request #1436 from ONLYOFFICE/release/v8.1.0
Release/v8.1.0
2024-03-13 18:24:43 +03:00
261d8aad37 Merge pull request #1435 from ONLYOFFICE/hotfix/v8.0.1
Hotfix/v8.0.1
2024-03-13 18:21:50 +03:00
27ebebdd0e fix flags 2024-03-13 17:27:31 +03:00
0053b72656 Remove unused files 2024-03-13 17:13:25 +03:00
9832010dd7 Add xti reading while xml read 2024-03-13 19:22:40 +06:00
dfbb20035b Merge remote-tracking branch 'origin/feature/docx_renderer2' into feature/pdf-freetext
# Conflicts:
#	PdfFile/PdfReader.cpp
2024-03-13 13:11:58 +03:00
112dbd9e88 Fixes for build module 2024-03-13 12:18:59 +03:00
6995a5ef34 Fix endless formula conversion 2024-03-13 14:42:40 +06:00
e18edba2ba Merge pull request #1434 from ONLYOFFICE/fix/8.0.2
Fix/8.0.2
2024-03-13 11:12:36 +03:00
38ce36fa75 . 2024-03-13 11:11:58 +03:00
e518efc5e1 . 2024-03-13 11:10:31 +03:00
53677bf8cc Revert test changes 2024-03-13 11:04:55 +03:00
b065aff618 Fixes for android 2024-03-13 10:57:11 +03:00
a6370ec0a6 fix bug #66842 2024-03-13 10:37:33 +03:00
245ba212c4 fix bug #66849 2024-03-12 23:55:01 +03:00
48c1478374 fix bug #66840 2024-03-12 19:58:47 +03:00
65112e860e Fix query table conversion 2024-03-12 21:46:19 +06:00
4a22b26ac1 Fix connection conversion 2024-03-12 20:24:02 +06:00
e18883f126 Fix bugs in html to ooxml conversion 2024-03-12 14:54:08 +03:00
29a4119546 Fix inline string conversion 2024-03-12 15:04:00 +06:00
9ffc34b7e2 Developing DocxRenderer
- pptx shapes (in progress)
- no br logic
2024-03-12 11:51:47 +03:00
8a9e5ad267 Fix bugs in html to ooxml conversion 2024-03-12 10:46:05 +03:00
69a71d78ed [x2t] For bug 66819 2024-03-12 01:33:24 +03:00
db3d665f8c fix bug #66821 2024-03-11 19:27:53 +03:00
5c52489394 Fix function calling order 2024-03-11 18:04:37 +03:00
e8a4dab0ea Add office_drawing file to visual studio project 2024-03-11 18:40:48 +05:00
320dcf8a0f Add odg file format conversion 2024-03-11 18:25:03 +05:00
f10ad91f0f Merge remote-tracking branch 'origin/release/v8.1.0' into develop 2024-03-11 11:16:30 +03:00
1d594b93ea Merge remote-tracking branch 'origin/fix/xlsb_conv_errors' into release/v8.1.0 2024-03-11 11:15:00 +03:00
d68f4cedff Merge pull request #1433 from ONLYOFFICE/fix/bug27583
Fix bug 27583
2024-03-11 11:05:22 +03:00
c3571838ef Merge pull request #1432 from ONLYOFFICE/fix/bug66657
Fix bug #66657
2024-03-11 11:05:15 +03:00
76e05db9da Fix bug #66657 2024-03-11 13:54:41 +06:00
f93a628c24 Refactoring build 2024-03-10 21:58:34 +03:00
d81e70cfee fix bug #66798 2024-03-10 14:37:48 +03:00
26658a7189 fix bug #66796 2024-03-09 16:20:20 +03:00
e2ebe6a6d3 fix bug #66783 2024-03-07 16:39:55 +03:00
f9cd49a756 Fix bugs 2024-03-07 16:05:31 +03:00
e30c5fb79d fix bug #66777 2024-03-07 15:59:01 +03:00
57e06222c7 fix bug #66773 2024-03-07 15:52:13 +03:00
8bd978d2c6 Merge remote-tracking branch 'origin/fix/bug27583' into release/v8.1.0 2024-03-07 15:06:34 +03:00
04480bb9eb fix bug #66766 2024-03-06 20:06:43 +03:00
82cd32aa85 fix bug #66772 2024-03-06 19:38:20 +03:00
d92ab67b21 Fix validation 2024-03-06 16:20:28 +03:00
36dbd4f0e1 Refactoring 2024-03-06 15:55:12 +03:00
e787102046 Fix bug #27583 2024-03-06 18:47:52 +06:00
2445f6f2e3 Merge remote-tracking branch 'origin/release/v8.1.0' into develop 2024-03-06 15:38:39 +03:00
422f0736c4 Fix colot conversion 2024-03-06 17:45:57 +06:00
296383bd6f fix bug #66744 2024-03-06 12:05:45 +03:00
f6713d751b fix bug #66750 2024-03-06 11:41:39 +03:00
46fc80f423 fix bug #45218 2024-03-06 10:15:20 +03:00
b88d303ceb fix bug #66722 2024-03-04 19:43:28 +03:00
583f7b0d0c Create CFile.prototype["getShapes"] 2024-03-04 17:08:42 +03:00
86f288541f Merge branch 'release/v8.1.0' into fix/xlsb_conv_errors 2024-03-04 19:55:56 +06:00
9e24a89fd4 Fix bugs 2024-03-04 15:56:02 +03:00
f369715c55 Fix book view conversion 2024-03-04 18:12:00 +06:00
29852ddf25 Fix BeginShape to BeginMarkedContent 2024-03-04 10:31:02 +03:00
d88fc239b8 fix convert to xlsb 2024-03-02 15:42:11 +03:00
aad25c3da8 fix bug #66699 2024-03-02 15:22:30 +03:00
6bbf1190a7 Fix reference limits 2024-03-01 22:25:33 +06:00
3d1b8e64ac Fix shared formula conversion 2024-03-01 22:25:03 +06:00
e1ce2150dc Merge pull request #1431 from ONLYOFFICE/fix/bug66671
Fix bug 66671
2024-03-01 17:22:14 +03:00
1a86da3559 Fix bug #66670 2024-03-01 16:33:44 +03:00
1ff92a8e71 Fix def name conversion 2024-03-01 19:33:15 +06:00
00c95da6c0 Merge pull request #1430 from ONLYOFFICE/fix/66463
Fix bug #66463
2024-03-01 15:37:29 +03:00
bb1d5401d2 Refactoring 2024-03-01 15:24:09 +03:00
c9aad72ecc Fix bug 66671 2024-03-01 18:00:36 +06:00
e2dc625b0a Fix bugs and refactoring 2024-03-01 13:54:47 +03:00
c649de088a .
(cherry picked from commit bba6d180dc)
2024-03-01 13:29:13 +03:00
0476dedbac fix bug #66656 2024-02-29 21:54:50 +03:00
b71ed594da Add tests result 2024-02-29 20:03:36 +03:00
9c2e696710 Add words 2024-02-29 19:59:39 +03:00
f5ee86c94e Add tests for dictionaries 2024-02-29 19:44:28 +03:00
808782c1c8 Write BDC/EMC for MetaOForm 2024-02-29 17:34:37 +03:00
0dd978c000 Exist folder check: Add white list for some folders 2024-02-29 16:02:38 +03:00
bba6d180dc . 2024-02-29 15:54:56 +03:00
25ca9b5fcd meta in cell from/to bin 2024-02-29 12:24:02 +03:00
c7a1e3536d Meta from Cell 2024-02-29 12:02:26 +03:00
18e3ef0932 Merge remote-tracking branch 'origin/release/v8.1.0' into feature/pdf-shape 2024-02-29 11:37:43 +03:00
448156c905 Merge pull request #1429 from ONLYOFFICE/release/v8.1.0
Release/v8.1.0
2024-02-29 10:12:09 +03:00
db340198d6 Create GetShapesXML 2024-02-29 10:04:48 +03:00
7dd1dd3c8a Disable clear font streams in ScanPage mode 2024-02-28 22:33:07 +03:00
ec2687e5d1 for bug #57082 2024-02-28 21:29:46 +03:00
1ab06e503a Fix bug 2024-02-28 21:25:25 +03:00
f973a0a952 fix bug #66651 2024-02-28 21:13:35 +03:00
6a628a21fb Add 3dParty list 2024-02-28 17:08:44 +03:00
63c38399ad fix build 2024-02-28 14:50:08 +03:00
56c3b1a6d3 Fix bugs 2024-02-28 14:31:52 +03:00
163e21acf4 fix bug #53909 2024-02-27 17:56:13 +03:00
8ebd23defb UserProtectedRangeType 2024-02-27 17:17:35 +03:00
487c750020 Create CShapeStart::Read 2024-02-27 16:26:20 +03:00
4dc1751d89 Fix color conversion 2024-02-27 18:42:33 +06:00
fc3e6592f4 Fixes for support in js module 2024-02-27 15:00:33 +03:00
ed0d1fbdb0 Refactoring 2024-02-27 14:54:45 +03:00
849ad8ac87 Fixed bugs with styles in html->ooxml conversion and refactoring 2024-02-27 14:18:04 +03:00
9bb45aa05d fix bug #66622 2024-02-27 14:15:20 +03:00
306a61ba14 Fix NSFonts::IFontList::Add 2024-02-27 12:12:56 +03:00
a91500c4b7 Fix table conversion 2024-02-26 21:10:22 +06:00
88a6f5815c Add ScanPage 2024-02-26 17:29:21 +03:00
168aa04b8f Separate CAnnotMarkup::ReadRC 2024-02-26 17:27:37 +03:00
147d8ca783 for bug #66596 2024-02-26 16:14:04 +03:00
bb9e5c590a Create ctShapeStart and ctShapeEnd 2024-02-26 14:34:31 +03:00
7733825458 Fix compile 2024-02-26 11:56:48 +03:00
8ca63e5013 Merge branch hotfix/v8.0.1 into master 2024-02-26 07:33:51 +00:00
0c998e318b fix bug #34418 2024-02-24 12:10:57 +03:00
f8184532c8 Added support for reading @page and bug fixes in html to ooxml conversion 2024-02-22 18:10:26 +03:00
0927217246 Fix repeat font 2024-02-22 16:59:39 +03:00
0a1d3ddd91 Fix SetFont for FreeText annot 2024-02-22 15:03:28 +03:00
0bc356ebff fix bug #66057 2024-02-22 13:13:37 +03:00
620827ad53 . 2024-02-22 10:28:49 +03:00
c1025cf70b Merge remote-tracking branch 'origin/fix/xlsb_conversion' into release/v8.1.0 2024-02-22 10:27:33 +03:00
3320547735 Fix bug #66463 2024-02-21 22:41:35 +03:00
c1f1c3a683 add support oleObjects from Word 2003 XML 2024-02-21 20:45:07 +03:00
e8c375c864 Add FontSelection to FreeText 2024-02-21 18:54:58 +03:00
3d2ebf31b3 Fix sheet protection conversion 2024-02-21 14:32:01 +06:00
25be75004d Merge remote-tracking branch 'origin/hotfix/v8.0.1' into develop 2024-02-20 23:14:38 +03:00
cf90cd9e12 Merge pull request #1426 from ONLYOFFICE/fix/bug61241
fix bug #61241
2024-02-20 22:47:29 +03:00
690d17f6c4 fix bug #61241 2024-02-20 22:29:13 +03:00
ef0e18e1c9 Fix conditional formating refs conversion 2024-02-20 23:24:20 +06:00
001768d0c6 Try get by symbol 2024-02-20 19:58:30 +03:00
5cb6c32635 Merge pull request #1424 from ONLYOFFICE/feature/pdf-metaoform
Feature pdf metaoform
2024-02-20 16:21:16 +03:00
9c6c3e845b Merge remote-tracking branch 'origin/develop' into feature/docx_renderer2 2024-02-20 16:17:05 +03:00
f3bdeacf7e Fix bugs 2024-02-20 13:15:44 +03:00
7776743d8d Fix bug 66567 2024-02-19 22:15:10 +03:00
f672fcc665 oleObjects from ppt 2024-02-19 20:07:17 +03:00
b56e21d6c7 Improved padding in html to ooxml conversion 2024-02-19 18:33:31 +03:00
5326058947 Get fotn from AP 2024-02-19 18:06:42 +03:00
159ffec93b Merge pull request #1423 from ONLYOFFICE/fix/bug66562
Fix bug #66562
2024-02-19 17:37:53 +03:00
aba868b9ac Fix bug #66562 2024-02-19 18:25:05 +06:00
91e5fae5de fix bug #62141 2024-02-19 10:55:23 +03:00
efb18b5864 [x2t] Fix fromDraw 2024-02-19 01:52:06 +03:00
7d6a95d521 Fix bug 65583 2024-02-18 22:10:54 +03:00
49f5df9f88 [x2t] Fix COfficeFileFormatChecker::isOOXFormatFile for vsdx 2024-02-18 12:42:42 +03:00
8a6974a020 Add define to use default font to recalc 2024-02-17 14:57:38 +03:00
0ff68fcd8d Merge pull request #1422 from ONLYOFFICE/fix/bug66545 2024-02-17 10:42:05 +03:00
25fc759e61 Fix bug 66545 2024-02-17 10:18:10 +03:00
22508420d8 [x2t] To fix build 2024-02-16 23:30:42 +03:00
30fa4b0ea4 [x2t] For vsdx printing 2024-02-16 20:05:07 +03:00
c90394b50a Update logic 2024-02-16 19:37:52 +03:00
6b74d80cd9 Merge branch 'develop' into fix/xlsb_conversion 2024-02-16 20:48:28 +06:00
ace094fc2a for bug #63610 2024-02-16 17:31:21 +03:00
56a09831cc Improved conversion of style settings of html tables to ooxml 2024-02-16 16:39:50 +03:00
8442596372 Fix conversion table formulas with empty square brackets 2024-02-16 15:58:57 +06:00
4ee1d59803 Fix default values setting up 2024-02-16 15:56:48 +06:00
77901663a0 Fix bug 66513 2024-02-16 12:50:59 +03:00
65a483461e Fix RC parser - span and #text 2024-02-16 11:57:58 +03:00
aa89e7fd4e Merge remote-tracking branch 'origin/hotfix/v8.0.1' into feature/pdf-metaoform 2024-02-16 10:48:22 +03:00
b7bc83f37d Create ValidMetaData 2024-02-16 10:47:08 +03:00
e11f145d30 Merge pull request #1420 from ONLYOFFICE/fix/bug66504
Fix bug 66504
2024-02-15 17:26:44 +03:00
5c69cb0358 Fix MemStream::setPos 2024-02-15 17:20:57 +03:00
2f4fee3555 Fix bug 66504 2024-02-15 16:35:27 +03:00
8eee4d470c Fix sparkline conversion 2024-02-15 19:29:51 +06:00
7710090d31 Merge pull request #1419 from ONLYOFFICE/fix/pdf-name
Fix T name due to Adobe
2024-02-15 16:16:16 +03:00
c7df1bc3ce Merge pull request #1418 from ONLYOFFICE/fix/bug66504
Fix bug 66504
2024-02-15 16:15:56 +03:00
7fdead0eda Fix T name due to Adobe 2024-02-15 16:13:33 +03:00
e78a4c84b4 Fix bug 66504 2024-02-15 15:50:36 +03:00
d1da32b922 add error style initialization check 2024-02-15 17:54:50 +06:00
ebc94a2615 Add new string removing from column names 2024-02-15 17:54:17 +06:00
b9a11bc30d Add ID with MetaOForm 2024-02-15 13:11:19 +03:00
17a2172673 for bug #66495 2024-02-15 12:27:23 +03:00
34dfdf970f Merge remote-tracking branch 'origin/hotfix/v8.0.1' into develop 2024-02-15 12:17:01 +03:00
62481e5def Fix bug 66473 2024-02-15 11:20:01 +03:00
192704636f Fix build 2024-02-14 20:47:26 +03:00
0a9356f54b For bug 65400 2024-02-14 20:06:36 +03:00
ae8b458f79 fix bug #66497 2024-02-14 18:58:12 +03:00
8a88fce72f Merge pull request #1417 from ONLYOFFICE/feature/pdf-line
Write AP of pdf line annot
2024-02-14 14:58:44 +03:00
d23ebbdb38 Fix BC,BG for widget, C,S Line endpoint offset 2024-02-14 14:40:10 +03:00
5a9f74f5ad fix bug #66467 2024-02-14 14:22:44 +03:00
ef3cbf03b3 Merge pull request #1416 from ONLYOFFICE/fix/66463
Fix bug #66463
2024-02-14 13:30:19 +03:00
a6a73ffe3a Refactoring 2024-02-14 13:20:08 +03:00
95146474ff Fix comma processing 2024-02-14 16:15:37 +06:00
fa90923000 Fix table styles conversion 2024-02-14 16:03:53 +06:00
3d3daed655 Add table and column names to global info for formulas 2024-02-14 16:03:24 +06:00
c6b3238fa4 Fix dvals conversion 2024-02-14 16:02:06 +06:00
9a612d4543 Fix ptg list conversion 2024-02-14 16:01:11 +06:00
47a485999f . 2024-02-14 12:07:35 +03:00
e6ebc76ae6 metadata spreadsheets 2024-02-13 21:17:18 +03:00
33c5852834 Fix bug #66436 2024-02-13 20:25:30 +03:00
4736f93aa8 Fixed the unnecessary appearance of the table border in html to ooxml conversion 2024-02-13 18:10:17 +03:00
f055d0d592 Fix Line endpoint offset 2024-02-13 17:48:55 +03:00
bf68f87aa7 fix bug #65975 2024-02-13 14:41:10 +03:00
1eec0cffdb Update paragraph logic
in progress
2024-02-13 14:08:28 +03:00
d65cbf194a Added TextAssociationTypes 2024-02-13 10:21:49 +03:00
d4c245029d Create AdjustLineEndpoint and DrawLineArrow 2024-02-12 17:42:24 +03:00
071f27a305 Merge remote-tracking branch 'origin/fix/bug61378' into develop 2024-02-12 17:16:53 +03:00
20cd784510 Merge remote-tracking branch 'origin/fix/bug65611' into develop 2024-02-12 17:12:16 +03:00
9c33ec3518 Merge remote-tracking branch 'origin/fix/bug58244' into develop 2024-02-12 17:10:29 +03:00
6f0af189e1 Fix bug #61378 2024-02-12 16:05:06 +05:00
8a58381223 Merge remote-tracking branch 'origin/hotfix/v8.0.1' into develop 2024-02-12 10:55:12 +03:00
fb72c73ca0 fix bug #66440 2024-02-10 18:40:10 +03:00
cf19a912ee fix bug #66392 2024-02-10 16:16:20 +03:00
01d76af52f Create AP for Line annots 2024-02-09 18:01:16 +03:00
479943f5e2 Improved conversion of html tables to ooxml 2024-02-09 16:36:54 +03:00
795274a886 for bug #66401 2024-02-09 16:15:17 +03:00
5ccef7bdff Merge pull request #1415 from ONLYOFFICE/fix/WmfSize
Fix Wmf file Size
2024-02-09 13:15:06 +03:00
581e54691b Fix Wmf file Size 2024-02-09 12:59:17 +03:00
80782f371c Fix pcdi conversion 2024-02-09 15:01:14 +06:00
c43536c618 Fix strings to shared strings conversion 2024-02-09 15:00:55 +06:00
835f4ba89d bug fixing 2024-02-09 11:20:24 +03:00
29fb134033 Merge remote-tracking branch 'origin/hotfix/v8.0.1' into develop 2024-02-08 20:50:47 +03:00
a7a80cb92e Fixed some inaccuracies in the conversion of html tables 2024-02-08 18:55:17 +03:00
593a7ba176 RC parser 2024-02-08 18:53:15 +03:00
ba79959955 fix bug #66419 2024-02-08 17:59:20 +03:00
0aa03275f4 Fix worbook defined names conversion 2024-02-08 19:27:33 +06:00
ea9ef2349d fix bug #66401
remove template
2024-02-08 15:09:27 +03:00
aaf9772805 Fix getting the cache key for qt tool (#1414) 2024-02-08 14:06:47 +03:00
8b62c50107 [android][x2t] Add format checker 2024-02-08 12:34:33 +03:00
3889ca0c94 Add codeql check (#1413)
* Add new action with codeql scanner

* Cosmetic changes

* Disable scanning on PR event

* codeql: ignore some unimportant paths

---------

Co-authored-by: Danil Titarenko <77471369+danilapog@users.noreply.github.com>
2024-02-08 12:11:41 +03:00
ca4c17847d fix bug #63352 2024-02-07 15:30:13 +03:00
33058fbbce Fix worksheet parts conversion 2024-02-07 16:00:59 +06:00
587bd78f2f Fix build on macos/ios 2024-02-07 12:56:55 +03:00
127d70203c Fix worksheet writing sequence 2024-02-07 15:50:23 +06:00
4abd650b01 Merge pull request #1412 from ONLYOFFICE/fix/x2ttester
Fix/x2ttester
2024-02-07 12:13:44 +03:00
d3ea527e66 Fix output 2024-02-07 12:03:15 +03:00
b81fc6b3c7 Fix bug 2024-02-07 11:51:34 +03:00
ce2044a223 Fix default values for some structs 2024-02-07 14:42:40 +06:00
2160c86556 Fix underline xml reading 2024-02-07 14:39:57 +06:00
ae61dc5db9 Fix xml pattern fill writing 2024-02-07 14:39:30 +06:00
3e39bd8d13 Fix xf prop 2024-02-07 14:38:24 +06:00
1994a25b61 fix bug #66396 2024-02-07 11:38:03 +03:00
1e59463499 fix bug #66395 2024-02-07 11:33:07 +03:00
5d642ff7c4 fix bug #66394 2024-02-07 11:30:26 +03:00
74baaca570 Merge pull request #1411 from ONLYOFFICE/feature/android
Feature/android
2024-02-07 11:11:10 +03:00
5609c5fc7d fix bug #55873 2024-02-06 19:49:46 +03:00
a9394ac989 fix bug #66333 2024-02-06 17:43:33 +03:00
6b29728c46 Merge pull request #1410 from ONLYOFFICE/feature/standardtester
Add diff-only arg in standardtester
2024-02-06 17:39:53 +03:00
ace39650e1 Merge pull request #1409 from ONLYOFFICE/feature/x2ttester
Feature/x2ttester
2024-02-06 17:33:13 +03:00
51a8984ab8 Merge pull request #1408 from ONLYOFFICE/fix/pdf-refactoring
Fix pdf bug
2024-02-06 17:16:48 +03:00
92663a7ae3 Fix bug #62568 2024-02-06 17:37:12 +05:00
ee0ab7f042 Fix gradient path conversion 2024-02-06 17:36:36 +05:00
2e22646c34 Convert table templates 2024-02-06 17:36:06 +05:00
f189e20064 Merge remote-tracking branch 'origin/hotfix/v8.0.1' into develop 2024-02-06 14:06:35 +03:00
b413dbfb4a fix bug #66345 2024-02-06 14:03:17 +03:00
22bf7a149a Fix bug 66223 2024-02-06 12:26:52 +03:00
8a655f8600 deleting a file entry 2024-02-06 11:17:47 +03:00
0ec05761ea Merge remote-tracking branch 'origin/fix/odf-tests' into develop 2024-02-06 11:00:28 +03:00
7e5da0b22c Fix bug #63701 2024-02-06 10:38:49 +03:00
1089bb3226 Fix bug 2024-02-06 09:30:17 +03:00
eb8e7866aa Add diff-only arg in standardtester 2024-02-06 07:57:47 +03:00
cce60166a4 Add extract mode in x2ttester 2024-02-06 03:42:48 +03:00
0e114331de Fix bug #58244 2024-02-06 02:35:06 +05:00
430adb678d Fix typo 2024-02-06 00:34:18 +03:00
0d1e5198c4 Converting lim families with upper and lower indexes. Converting csub and csup. Bug fixing.Code refactoring. 2024-02-05 21:01:58 +03:00
b36c1ae9e7 Fix bug #59451 2024-02-05 18:05:55 +03:00
d5126dbda9 PdfAnnot refactoring, For bug 66223 2024-02-05 18:00:18 +03:00
f6eb25b3f1 GetButtonIcon without W,H 2024-02-05 17:27:55 +03:00
84f58b7b08 Add row col initialization check 2024-02-05 15:41:14 +06:00
c2231fca7c Add BaseThreadMonitor class 2024-02-05 12:32:41 +03:00
0529bc9d82 Merge remote-tracking branch 'origin/hotfix/v8.0.1' into fix/pdf-refactoring 2024-02-05 11:24:37 +03:00
29eb5bed4d Add new class 2024-02-05 10:54:54 +03:00
157c8acf57 fix bug #66312 2024-02-03 15:51:14 +03:00
397421c9c1 Fix build 2024-02-02 22:43:23 +03:00
aa8a0cfbc2 FIx array formula conversion 2024-02-02 23:18:05 +06:00
59e977d94c Fix typo 2024-02-02 14:21:12 +03:00
e25071cecf Merge pull request #1407 from ONLYOFFICE/fix/bug66076
Fix bug 66076
2024-02-02 12:02:24 +03:00
c3e19a6376 Merge pull request #1406 from ONLYOFFICE/fix/pdf-formfield-fonts
Fix create unused font for CheckBox FormField
2024-02-02 12:01:03 +03:00
00671ffdd6 Fix shared formulas conversion 2024-02-02 14:47:45 +06:00
4868df7e10 Fix refactoring 2024-02-02 11:21:06 +03:00
7d55ebafbc Add openssl and logging 2024-02-02 11:16:43 +03:00
03078b01d1 Revert "Without static Decrypt"
This reverts commit 0ee70f03c1.
2024-02-02 10:52:31 +03:00
4c1420a3a6 PdfReader refactoring 2024-02-01 17:55:41 +03:00
ba6267570b Merge pull request #1405 from ONLYOFFICE/feature/StarMathToOOXML
StarMathToOoxml
2024-02-01 16:59:47 +03:00
5b1385ca20 Merge remote-tracking branch 'origin/hotfix/v8.0.1' into develop 2024-02-01 11:44:16 +03:00
ff6866c68a Merge pull request #1404 from ONLYOFFICE/fix/fix-bugs-v8.0
Fix/fix bugs v8.0
2024-02-01 11:41:33 +03:00
79bb09f2c2 Fix odf tests 2024-01-31 19:06:37 +05:00
4d3f925a11 fix bug #65994 2024-01-31 14:46:24 +03:00
b05bdc68ce Fix create unused font for CheckBox FormField 2024-01-31 13:50:09 +03:00
4ddc517b93 fix bug #65786 2024-01-30 19:58:51 +03:00
fb78b3b611 for bug #66201 2024-01-30 19:14:47 +03:00
617714a907 fix same bugs 2024-01-30 19:13:55 +03:00
0ee70f03c1 Without static Decrypt 2024-01-30 17:00:08 +03:00
e30abd06a2 Merge branch release/v8.0.0 into master 2024-01-30 11:25:04 +00:00
d4f4f4d500 Fix whitespace showing in worksheet 2024-01-30 15:00:13 +06:00
278d629418 . 2024-01-30 11:54:32 +03:00
9bd5d10480 Merge remote-tracking branch 'origin/fix/fix-bugs-v8.0' into develop 2024-01-30 11:17:40 +03:00
70d8a1a927 For bug 66076 2024-01-30 01:17:31 +03:00
8e12b946a8 Merge pull request #1401 from ONLYOFFICE/fix/bug66223
Fix bug 66223
2024-01-29 18:53:44 +03:00
6e8c2d46fa Merge pull request #1402 from ONLYOFFICE/fix/bug66185
Fix bug #66185
2024-01-29 18:53:07 +03:00
efead80648 Fix bug #66185 2024-01-29 18:28:11 +03:00
3efd9aebc9 Fix bug 66223 2024-01-29 18:00:04 +03:00
efbb6f38a0 Fix cell protection 2024-01-29 20:05:20 +06:00
2eed2729cc Merge pull request #1400 from ONLYOFFICE/fix/savingAnnots
Fix saving annots
2024-01-29 14:54:44 +03:00
f9000aba58 Fix saving annots 2024-01-29 14:49:00 +03:00
e61999c5fe fix bug #66192 2024-01-29 12:18:08 +03:00
71fc5323c7 Fix formula value conversion 2024-01-29 15:04:34 +06:00
7d3940a382 Fix area ptg conversion 2024-01-29 15:04:03 +06:00
108b749d4f fix unknown codepage 2024-01-29 11:51:33 +03:00
7adaba30da Merge pull request #1388 from ONLYOFFICE/fix/bug62427
Fix bug 62427
2024-01-29 11:28:36 +03:00
cb2dff90b9 Fix bug 63590 2024-01-29 00:02:55 +03:00
48a055d390 Fix metafiles with bad sizes. And revert one commit. 2024-01-29 00:00:37 +03:00
f8293950ca Merge pull request #1398 from ONLYOFFICE/fix/pdf-forms
Fix Opt for radiobutton, fix unicode for JS
2024-01-26 19:03:50 +03:00
84b19f48c7 Fix Opt for radiobutton, fix unicode for JS 2024-01-26 18:19:32 +03:00
ec107421bb Merge remote-tracking branch 'origin/fix/bug66175' into fix/fix-bugs-v8.0 2024-01-26 17:33:26 +03:00
7333e6943b Fix bug #65611 2024-01-26 19:18:28 +05:00
d2acd7d86d Fix bug #66175 2024-01-26 16:54:30 +03:00
18d274cff2 Merge pull request #1396 from ONLYOFFICE/fix/bug65955
fix bug #65955
2024-01-26 15:51:23 +03:00
1686efd6ba Fix bug 66147 2024-01-26 15:11:51 +03:00
e73992f869 fix bug #65955 2024-01-26 15:10:46 +03:00
3fbbf754a2 Fixed a bug in reading a function without an element. Adding a base attribute read. Code refactoring. 2024-01-26 12:22:13 +03:00
13a1d953b8 Merge pull request #1395 from ONLYOFFICE/fix/bug66136
Fix bug #66136
2024-01-25 17:02:40 +03:00
0764850b79 Fix bug #66136 2024-01-25 16:55:57 +03:00
9cfbb0012c Merge remote-tracking branch 'origin/fix/footersConversion' into fix/fix-bugs-v8.0 2024-01-25 16:35:24 +03:00
afdc28dbe4 Fix page setup 2024-01-25 18:44:32 +06:00
dfb8359d11 Merge pull request #1394 from ONLYOFFICE/fix/bug-pdf-web
[x2t] Fix bug with pdf opening in web
2024-01-25 13:54:36 +03:00
bd4d242aee [x2t] Fix bug with pdf opening in web 2024-01-25 13:52:16 +03:00
06cf8b4a3d Fix footer converion from xlsb to xlsx 2024-01-25 16:52:08 +06:00
bccdeedc4e Fix cell refs conversion 2024-01-25 15:55:14 +06:00
16fec2e641 fix bug #66123 2024-01-25 12:08:44 +03:00
d5de6a710d Fix ZipFile func for linux 2024-01-25 00:07:00 +03:00
08c9dd34ac Fix build 65925 2024-01-24 21:59:09 +03:00
0ed9b41710 Merge pull request #1393 from ONLYOFFICE/fix/bug66122
fix bug #66122
2024-01-24 21:23:20 +03:00
fefe6b3053 fix bug #66122 2024-01-24 21:18:37 +03:00
50f3ad5d65 Merge branch 'release/v8.0.0' of https://github.com/ONLYOFFICE/core into release/v8.0.0 2024-01-24 21:03:16 +03:00
f134870e73 Fix bug 66072 2024-01-24 21:02:27 +03:00
180451e272 Merge pull request #1392 from ONLYOFFICE/fix/wmf
Fixed a bug with calculating the image size in wmf
2024-01-24 20:59:51 +03:00
9b97070db7 Fixed a bug with calculating the image size in wmf 2024-01-24 20:44:47 +03:00
9b16f92ae5 Merge pull request #1391 from ONLYOFFICE/fix/pdf-forms
Fix xref stream for big file
2024-01-24 16:49:50 +03:00
edb2a0f503 Fix xref stream for big file 2024-01-24 16:46:01 +03:00
39b61f1094 Merge pull request #1390 from ONLYOFFICE/fix/pdf-forms
Fix pdf forms
2024-01-24 15:52:46 +03:00
0e68fac03d Fix test 2024-01-24 15:36:40 +03:00
9947e80e6c Fix XLUnicodeString_T operator= 2024-01-24 17:50:21 +06:00
46ce3f962e Create SetEmptyAP 2024-01-24 14:35:20 +03:00
292830aa15 Merge remote-tracking branch 'origin/fix/bug65838' into develop 2024-01-24 13:59:45 +03:00
8a03329e15 Merge remote-tracking branch 'origin/fix/bug65838' into feature/odf 2024-01-24 13:59:06 +03:00
0ac9b0bee8 Merge branch 'develop' into fix/xlsb_conversion 2024-01-24 16:42:57 +06:00
71afe4a0d5 Add relative reference saving 2024-01-24 16:41:41 +06:00
2be05c4439 Fix write AP_V with parent V, read/write AA 2024-01-24 12:47:14 +03:00
5b6735e3bf Fix formula conversion 2024-01-24 15:36:14 +06:00
cb5d6d72b9 Fix convertation pdf/xps/djvu to doct 2024-01-24 12:30:50 +03:00
9f9da695d0 Add format detector to export 2024-01-24 10:54:43 +03:00
755ea7761c Conversion of Greek characters, universal input of functions and operators. Writing tests. 2024-01-24 10:36:31 +03:00
6f3dae7d5d Fix bug #65838
Convert text href odp to pptx
2024-01-24 01:35:26 +05:00
ae7854d23f For bug #65838
Convert text href pptx to odp
2024-01-24 01:34:57 +05:00
809ed0f91d Fix convertation to forms from forms format 2024-01-23 22:58:25 +03:00
1f4f05d52e Fix bug 65244 2024-01-23 21:59:25 +03:00
daaf4f0390 Fix bug 66011 2024-01-23 21:28:16 +03:00
6537a1998a add starmath convert 2024-01-23 19:36:48 +03:00
1432c7b07e Fix pdf write 2024-01-23 18:44:36 +03:00
e9b9f0f550 Fix color precision 2024-01-23 18:41:29 +03:00
0be57e7316 Merge remote-tracking branch 'origin/feature/StarMathToOOXML' into feature/odf 2024-01-23 18:36:00 +03:00
312e010978 Merge remote-tracking branch 'origin/release/v8.0.0' into develop 2024-01-23 17:43:35 +03:00
d61a309ca0 fix bug #66085 2024-01-23 15:12:10 +03:00
daaeaee4df Add tests for time 2024-01-23 13:27:47 +03:00
5c54ec3280 Fix bug 63779 2024-01-23 13:21:51 +03:00
aefce8c03c Merge pull request #1387 from ONLYOFFICE/fix/bug65989
Fix bug 65989
2024-01-23 10:41:46 +03:00
a879cd94c6 Fix bug 65989 2024-01-23 10:32:59 +03:00
42b86ceb53 Fix work in embedded mode (xp) 2024-01-22 21:25:44 +03:00
5cb048e074 Merge remote-tracking branch 'origin/fix/bug65600' into release/v8.0.0 2024-01-22 21:05:01 +03:00
d1a35c2e9c Refactoring in HtmlFile2 2024-01-22 18:39:00 +03:00
eac27ae43b Fix bug #65600 2024-01-22 19:10:31 +05:00
0415a3ec56 Fix write unicode with encrypt 2024-01-22 16:45:27 +03:00
ad4754f7fc fix bug #65595 2024-01-22 16:17:15 +03:00
b589d8e3ce fix bug #65975 2024-01-22 16:02:48 +03:00
84ae9da444 fix bug #65976 2024-01-22 12:48:45 +03:00
bd7bcc6b4d fix bug #65977 2024-01-22 12:20:24 +03:00
7259f9b376 Merge remote-tracking branch 'origin/fix/bug50186' into release/v8.0.0 2024-01-22 11:28:18 +03:00
44b1abf27d Fix convertation to forms from forms format 2024-01-22 11:11:12 +03:00
bc4449f7a7 Fix bug 62427
CFileBinary::GetTime,
CFileBinary::SetTime was updated
Fix bugs with time in Zip/Unzip
2024-01-22 02:23:23 +03:00
d878291091 Fix bug 65650 2024-01-21 21:00:39 +03:00
4ee2ca7098 Fix bug 65965 2024-01-20 22:25:01 +03:00
78cb8a7d55 Fix bug #50186 2024-01-19 21:32:51 +05:00
29fe342a1c Merge pull request #1386 from ONLYOFFICE/fix/pdf-pushbutton
Fix pdf pushbutton
2024-01-19 14:36:32 +03:00
a2916309b3 Fix ShiftRespectBorder 2024-01-19 13:21:28 +03:00
9b38a17d5f Merge pull request #1385 from ONLYOFFICE/fix/pdf-font
Fix pdf font
2024-01-19 11:09:10 +03:00
0803b33067 Write PushButton 2024-01-18 18:37:54 +03:00
004fcbe7ba Merge remote-tracking branch 'origin/fix/bug65838' into release/v8.0.0 2024-01-18 17:49:51 +03:00
bbfdab9231 Fix bug #65838 2024-01-18 19:42:37 +05:00
14d9d2b01e fix bug #65829 2024-01-18 17:15:52 +03:00
0bbd2d6d35 Fix xfs conversion 2024-01-18 20:03:38 +06:00
7b6a706ca3 Merge remote-tracking branch 'origin/fix/bug65600' into release/v8.0.0 2024-01-18 13:17:36 +03:00
ec89b34514 editing diacritics, unary marks. bug fixing. 2024-01-18 13:05:41 +03:00
d593418616 Fix bug #65600 2024-01-18 01:12:15 +05:00
6e0a28f8c8 Fix merged cellc conversion 2024-01-17 22:02:15 +06:00
7d82d4a8b7 Fix conditional formating conversion 2024-01-17 22:01:51 +06:00
a160bc7ad1 Find dShiftY for pushbutton 2024-01-17 18:05:06 +03:00
f341dac2c3 Merge pull request #1384 from ONLYOFFICE/fix/Metafiles
Fix bugs in metafiles conversion
2024-01-17 15:52:36 +03:00
4041e5b31c Fix bug #65918 2024-01-17 13:52:58 +03:00
0774df72ca fix bug #65914 2024-01-17 13:43:10 +03:00
a3b0bb2294 Fix bug #65915 2024-01-16 23:13:40 +03:00
20a2424605 Fix WriteString method 2024-01-16 22:13:46 +03:00
a871295ad7 fix bug #65827 2024-01-16 18:28:49 +03:00
2cf11468d4 fix bug #65831 2024-01-16 18:12:04 +03:00
b59b2ba039 Merge pull request #1366 from ONLYOFFICE/feature/js-serialize-update
Added IsInit() function and more exceptions
2024-01-16 17:28:45 +03:00
950449b8de Merge pull request #1383 from ONLYOFFICE/feature/json-stringify
Add JSON_stringify
2024-01-16 17:24:21 +03:00
15ba22dc5c Implemented for V8 2024-01-16 18:16:22 +04:00
63b2b0b432 Merge pull request #1382 from ONLYOFFICE/release/v8.0.0
Release/v8.0.0
2024-01-16 16:22:09 +03:00
86eddff91d Add tests 2024-01-16 15:32:03 +04:00
c426474c50 Implement function 2024-01-16 15:31:40 +04:00
4fc9fc68e2 Merge pull request #1381 from ONLYOFFICE/fix/bug65853
Fix bug 65853
2024-01-16 12:46:06 +03:00
540fce9ab8 Fix bug 65853 2024-01-16 12:44:51 +03:00
505231291f Fix bug 65853 2024-01-16 12:42:34 +03:00
441e9276f4 Merge remote-tracking branch 'origin/fix/bug65779' into release/v8.0.0 2024-01-16 11:07:29 +03:00
9bbea65319 Merge remote-tracking branch 'origin/fix/bug65359' into release/v8.0.0 2024-01-16 10:59:43 +03:00
ba9d6b430a Fix bug 65862 2024-01-15 20:09:42 +03:00
95073fd590 Fix bug #65779 2024-01-15 20:05:28 +05:00
6bc58b973c Fix selection font for standard fonts 2024-01-15 17:26:35 +03:00
9da99f35b8 Fix duplicate for button font = DA font 2024-01-15 16:30:44 +03:00
d81efffbef Write m_sButtonFontName 2024-01-15 16:04:32 +03:00
fb27d00490 Fix hyperlinks conversion 2024-01-15 15:49:20 +06:00
01ac03f24b Fix comment convert condition 2024-01-15 13:44:52 +06:00
650db9c31f Add run_path addon params 2024-01-14 22:07:49 +03:00
a22882af85 Merge remote-tracking branch 'origin/fix/bug65485' into release/v8.0.0 2024-01-13 15:26:17 +03:00
c5436f38fa Fix bug #65485 2024-01-13 15:13:34 +03:00
fe2779824b Fix comment conversion error 2024-01-12 21:37:42 +06:00
5c18827224 fix chartEx 2024-01-12 17:26:47 +03:00
4064aba5fb Create SetButtonFont 2024-01-12 17:25:28 +03:00
7af7b50f66 Fix autofilter conversion 2024-01-12 20:12:33 +06:00
88ea658a9c Merge pull request #1380 from ONLYOFFICE/fix/bug65392
Fix bug #65392 and other minor fixes
2024-01-12 16:12:15 +03:00
b263eab373 Fixed a bug with the minimum pen size in converting a metafile to svg 2024-01-12 16:10:55 +03:00
457332f5f4 Removing excess 2024-01-12 15:57:07 +03:00
f763e6bad5 Fixed bugs with image sizes when converting a metafile to svg 2024-01-12 15:49:37 +03:00
079814117c Fixed missing radial gradient color in metafile to svg conversion 2024-01-12 15:17:37 +03:00
69595f9211 Fix bug #65392 2024-01-11 18:18:27 +03:00
1a8ada7858 Merge pull request #1374 from ONLYOFFICE/fix/bug64722
Fix bug #64722
2024-01-11 17:24:39 +03:00
6d5d74de0c Write border for pushbutton AP 2024-01-11 17:24:00 +03:00
e42c3ac2d2 Merge pull request #1378 from ONLYOFFICE/fix/bug65687
Fix bug 65687
2024-01-11 15:44:25 +03:00
1633ad4ec7 Fix big files 2024-01-11 15:32:26 +03:00
81caee014c Fix bug 65687 2024-01-11 15:28:40 +03:00
508167f0f9 Fix conditional formating conversion 2024-01-11 18:08:00 +06:00
57497bc14b Add caption to pushbutton AP 2024-01-11 14:30:09 +03:00
5663169473 Include stdexcept for windows 2024-01-11 14:57:02 +04:00
af04c2bac1 Added more exceptions 2024-01-11 14:57:02 +04:00
e4477c9926 Add IsInit() function 2024-01-11 14:57:02 +04:00
759d5e3ee9 Fix bug 65685 2024-01-11 13:56:45 +03:00
5d4f785cc1 Add support chunked resources in xps 2024-01-11 13:29:00 +03:00
3dae061381 Merge remote-tracking branch 'origin/release/v8.0.0' into develop 2024-01-11 12:09:34 +03:00
1b04d28591 fix bug - read slide(AlternateContent) 2024-01-11 12:06:48 +03:00
5c251c1924 . 2024-01-10 18:56:19 +03:00
e674248d94 Add plugin for private rooms without desktop 2024-01-10 18:48:49 +03:00
2ba62286d0 Create SetAP for pushbutton 2024-01-10 18:19:58 +03:00
28768e32af Fix bug #65359 2024-01-10 16:07:38 +05:00
1017b30776 Add numeric value cache for cell value 2024-01-10 14:14:09 +06:00
522564eb72 Develop... 2024-01-10 00:08:49 +03:00
498b5da2b6 Rebuild module 2024-01-09 20:29:08 +03:00
39d46ca94e Fix typo 2024-01-09 20:15:49 +03:00
8813f65345 Develop new engone for private rooms 2024-01-09 20:12:09 +03:00
7266619e24 fix build 2024-01-09 17:58:25 +03:00
cdf10bbc38 fix build 2024-01-09 17:22:38 +03:00
54ec885316 Fix cell value parsing 2024-01-09 20:21:40 +06:00
3cf686e08e Merge branch 'develop' into fix/xlsb_conversion 2024-01-09 18:19:32 +06:00
83a053a1dd Fix numbers conversion 2024-01-09 18:15:15 +06:00
ec12f550af Fix typo 2024-01-09 14:13:37 +03:00
5bb50ffd47 . 2024-01-09 14:00:21 +03:00
0de4c876af Develop new engone for private rooms 2024-01-09 13:34:42 +03:00
fc99dedbd4 fix build 2024-01-09 12:37:47 +03:00
2588d45ffe . 2024-01-09 12:33:57 +03:00
48883ca955 Merge remote-tracking branch 'origin/fix/bug65600' into release/v8.0.0 2024-01-09 12:28:52 +03:00
87289a2bd8 Fix bug #65601 2024-01-07 04:19:35 +05:00
ceede2a1ad Convert hidden slides pptx to odp 2024-01-06 02:47:02 +05:00
96a826ff3f Merge pull request #1377 from ONLYOFFICE/fix/pdf-widget 2023-12-30 21:10:41 +03:00
8c2e8c3b0d Fix bug #65600 2023-12-29 18:40:38 +05:00
1f92b15aae Fix blank cell conversion 2023-12-29 19:05:03 +06:00
9b06b9e7a8 Remove unused code 2023-12-29 19:04:40 +06:00
189269031a Fix shared string conversion 2023-12-29 17:49:12 +06:00
8d804aee3a Improved security when accessing an image file in svg 2023-12-29 14:22:29 +03:00
84bffd422b Fix Action for forms 2023-12-29 13:59:38 +03:00
9aeaa6931e Merge pull request #1376 from ONLYOFFICE/fix/pdf-widget
Fix/pdf widget
2023-12-29 12:37:16 +03:00
e23809622c Fix CheckBox value for AP 2023-12-29 11:24:19 +03:00
58d068a4dd Fix CheckBox/RadioButton form's switch value 2023-12-29 11:14:45 +03:00
75cf6858b6 Fix dShiftY for text in forms 2023-12-29 10:47:43 +03:00
c13b4cb209 Write combobox/listbox forms 2023-12-28 18:24:30 +03:00
b568f5a4e3 Merge pull request #1375 from ONLYOFFICE/fix/bug65621-xlsb
fix bug #65621
2023-12-28 16:58:37 +03:00
0288ee87bd fix bug #65621 2023-12-28 19:08:09 +06:00
7227630d5e Merge pull request #1373 from ONLYOFFICE/fix/bug65486
fix bug #65486
2023-12-28 13:22:29 +03:00
e8f9489f83 fix build 2023-12-28 13:16:51 +03:00
183744efc4 Merge pull request #1372 from ONLYOFFICE/fix/bug65284
Fix bug #65284
2023-12-28 12:17:23 +03:00
4751706525 Fix convert pdf => pdf 2023-12-27 21:09:23 +03:00
a311f6f73f Fix decoding a pict image from a color map 2023-12-27 19:38:29 +03:00
b949cf7c72 Merge pull request #1371 from ONLYOFFICE/fix/pdf-widget
Fix pdf widget
2023-12-27 18:42:54 +03:00
2c29a5a02f Fix pdf=>pdf convertation 2023-12-27 18:42:00 +03:00
4a2595ed7d Fix build 2023-12-27 18:11:47 +03:00
faf4273c2a Write Text Widget 2023-12-27 18:00:37 +03:00
4ae8962af2 . 2023-12-27 16:53:05 +03:00
41fc05cdbb Merge remote-tracking branch 'origin/fix/bug65359' into release/v8.0.0 2023-12-27 16:30:51 +03:00
794f10f42f Merge remote-tracking branch 'origin/fix/bug65366' into release/v8.0.0 2023-12-27 16:30:22 +03:00
8137e2bac1 Merge remote-tracking branch 'origin/fix/bug65691' into release/v8.0.0 2023-12-27 16:30:05 +03:00
0b79546f14 Merge branch 'fix/bug65691' of https://github.com/ONLYOFFICE/core into fix/bug65691 2023-12-27 17:50:50 +05:00
c1689caf7e Fix bug #65691 2023-12-27 17:49:54 +05:00
d907167da6 Fix bug #65366 2023-12-27 17:46:29 +05:00
8eb5a078d8 Fix bug #65284 2023-12-27 13:00:00 +03:00
a7173cfefe Fix download image for button icon's 2023-12-27 11:24:16 +03:00
6f5fa6c4ca Switching to case-insensitive search in html2 2023-12-26 20:31:04 +03:00
59fcd227ea Create ChangePassword for pdf 2023-12-26 17:31:19 +03:00
3273ac74cf . 2023-12-26 16:49:50 +03:00
f651c3286d Fix bug #65591 2023-12-26 17:23:10 +05:00
2cc1ff4843 Fix attribure name conversion 2023-12-26 17:22:54 +05:00
96929ac63a Write Underline border for forms 2023-12-26 11:21:03 +03:00
153f522a82 Merge pull request #1370 from ONLYOFFICE/fix/bug65620
Fix bug #65620
2023-12-25 19:52:01 +03:00
057eed59c1 xlst->xlsb 2023-12-25 19:42:49 +03:00
f9a40c77f8 Merge remote-tracking branch 'origin/release/v8.0.0' into develop 2023-12-25 18:38:59 +03:00
177de8c7f6 Write Beveled and Inset border for forms 2023-12-25 18:00:56 +03:00
a6bfc5ed2d Fix C and IC for Text/FreeText annots 2023-12-25 18:00:05 +03:00
e5eb83e53a Fix bug #65359 2023-12-25 18:36:24 +05:00
4b6044da56 Convert accel deccel attribures 2023-12-25 15:35:26 +05:00
2278c88d63 Add accelerate decelerate attributes 2023-12-25 15:34:33 +05:00
578a792fda fix bug #65259 2023-12-24 17:20:56 +03:00
b26d9ca0a1 Fixed a bug with missing gradient color in MetafileToSvg 2023-12-22 20:10:02 +03:00
e7dff77c8e Fix bug #65620 2023-12-22 20:04:27 +03:00
15c555ffa6 Try to find dBaseLine for Text Form 2023-12-22 17:56:21 +03:00
bc6e7e2831 Refinement of attributes. Code refactoring. Editing logic. 2023-12-22 17:17:18 +03:00
aa8e26f366 Fix swivel and bounce effects conversion 2023-12-22 17:53:14 +05:00
bd37046d7b Fix Grow & Turn entrance effect conversion 2023-12-22 17:25:33 +05:00
30757ef731 Fix wipe etrance effect conversion 2023-12-22 17:25:12 +05:00
cf4cc21e5f For bug 65620 2023-12-22 13:51:59 +03:00
84108b9617 Merge pull request #1369 from ONLYOFFICE/feature/pdf-widget
Fix getButtonIcons
2023-12-22 10:59:20 +03:00
ff12c4a4ba Return getButtonIcons only XObject image 2023-12-22 10:38:36 +03:00
752829d819 Create GetFontData for save widget 2023-12-22 09:52:04 +03:00
4c549a1f81 fix bug #65548 2023-12-21 20:41:46 +03:00
292fcf7e6f Merge remote-tracking branch 'origin/fix/bug65366' into release/v8.0.0 2023-12-21 17:37:33 +03:00
9e5c896098 Merge remote-tracking branch 'origin/fix/bug65360' into release/v8.0.0 2023-12-21 17:37:12 +03:00
600e59b356 Merge remote-tracking branch 'origin/fix/bug50186' into release/v8.0.0 2023-12-21 17:36:52 +03:00
af2c49b9c7 Merge pull request #1368 from ONLYOFFICE/fix/bug65636
Fix bug #65636
2023-12-21 17:14:17 +03:00
292f079872 Fix bug #50186 2023-12-21 19:13:54 +05:00
2b26449e5b Fix bug #65636 2023-12-21 17:11:02 +03:00
dfc9434174 Merge pull request #1367 from ONLYOFFICE/feature/pdf-widget
Fix pdf save forms
2023-12-21 16:36:38 +03:00
48c122a200 Add write I, array of V and fix Opt 2023-12-21 15:57:52 +03:00
631fce0c35 . 2023-12-21 12:57:13 +03:00
2007619d78 . 2023-12-21 12:34:23 +03:00
fee163957b . 2023-12-21 12:27:06 +03:00
5ef77d25a9 Merge remote-tracking branch 'origin/release/v8.0.0' into feature/pdf-widget 2023-12-21 10:13:31 +03:00
dc538180a4 for bug #65626 2023-12-20 23:20:36 +03:00
6e9f7fff71 Fix fonts, I and V 2023-12-20 18:10:41 +03:00
0f055f696f fix bug #65626 2023-12-20 16:56:52 +03:00
086fc272df fix bug #65566 2023-12-20 16:54:00 +03:00
58fb5b715c Fix x2t manifest 2023-12-20 11:24:39 +03:00
da2fd8f9b4 Create AP value 2023-12-19 18:07:03 +03:00
0cde91fed2 Fix bug #65360 2023-12-19 19:07:26 +05:00
77bd3703c6 Fix manifest file 2023-12-19 15:59:25 +03:00
503b9140e3 Fix bug #65366
Convert preset subtype
2023-12-19 17:33:11 +05:00
8ee116de7e Fix included headers paths 2023-12-19 15:04:56 +06:00
c4f49171cd Merge pull request #1362 from ONLYOFFICE/feature/xlsb_write
Add xlsb writing
2023-12-19 11:06:09 +03:00
98dfe303ca fix bug #65483 2023-12-18 22:06:35 +03:00
8fc6368a05 Fix bug 63615 2023-12-18 21:22:25 +03:00
69a255a3f1 Fix build 2023-12-18 20:56:02 +03:00
1370043ce4 Merge branch 'release/v8.0.0' of https://github.com/ONLYOFFICE/core into release/v8.0.0 2023-12-18 20:05:37 +03:00
085337230a Fix build 2023-12-18 20:05:34 +03:00
14555839b5 Merge branch 'release/v8.0.0' of https://github.com/ONLYOFFICE/core into release/v8.0.0 2023-12-18 19:54:06 +03:00
8bb77f373d Create write caption for pushbutton 2023-12-18 17:37:15 +03:00
d1364c4b80 Merge pull request #1364 from ONLYOFFICE/feature/pdf-widget
Fix pdf font
2023-12-18 16:53:18 +03:00
8287f4c9ff Merge pull request #1363 from ONLYOFFICE/fix/SvgReader
Fix build
2023-12-18 15:59:33 +03:00
8243a284a1 Fix build 2023-12-18 15:57:59 +03:00
910a68765a Fix empty font and StemV from FontDescriptor 2023-12-18 15:54:11 +03:00
f599ad625f Merge pull request #1360 from ONLYOFFICE/fix/MetafileBugs
Fix metafile bugs
2023-12-18 15:27:07 +03:00
13236c4a81 For bug 65437. Add param --use-system-user-fonts to allfontsgen 2023-12-18 15:23:32 +03:00
186674d749 . 2023-12-18 13:06:38 +03:00
9d0f8ec414 . 2023-12-18 12:48:40 +03:00
75845fd471 . 2023-12-17 19:46:44 +03:00
f3836e86cb fix bug #65567 2023-12-17 15:06:57 +03:00
b83d5abbe0 remove download 2023-12-17 14:45:44 +03:00
288fb4d812 fix build 2023-12-17 14:33:02 +03:00
787f394ca8 fix bug #65566 2023-12-17 12:45:58 +03:00
2db233fa7b fix convert bin 2023-12-17 11:35:46 +03:00
ea6f4a7295 fix build 2023-12-16 19:19:36 +03:00
e5370989dd del unused 2023-12-15 18:18:19 +03:00
940af313fd for bug #65061 2023-12-15 18:03:50 +03:00
35eb2849ef Adding conversion of indexed brackets, diacritics and attributes. Editing operator conversion. 2023-12-15 17:55:00 +03:00
ce8effaaa1 Merge remote-tracking branch 'origin/fix/bug65359' into release/v8.0.0 2023-12-15 17:19:31 +03:00
fce70b0c0c Merge remote-tracking branch 'origin/fix/bug65362' into release/v8.0.0 2023-12-15 17:15:56 +03:00
423411b679 Merge remote-tracking branch 'origin/fix/bug65503' into release/v8.0.0 2023-12-15 17:14:54 +03:00
48053414c9 Add frtpivot cache def version set 2023-12-15 20:02:44 +06:00
eb95a37dfe Fix bug #65503 2023-12-15 17:54:58 +05:00
492f2d3dc0 Merge pull request #1361 from ONLYOFFICE/fix/bug58972
Fix bug 58972
2023-12-15 15:52:17 +03:00
aa9bbbaa62 Add Named action for Link annots, fix CropBox 2023-12-15 15:26:24 +03:00
a50c8701f4 Merge branch 'release/v8.0.0' into fix/MetafileBugs 2023-12-15 13:23:44 +03:00
244061bbb7 Fixed a bug with extra spaces 2023-12-15 13:17:44 +03:00
62fc4066fd Merge pull request #1359 from ONLYOFFICE/fix/pdf-fonts
Fix GetFontBinary and build
2023-12-15 12:21:16 +03:00
75c855a1d0 . 2023-12-15 12:11:10 +03:00
8e38736cf5 for bug #65516 2023-12-15 12:05:20 +03:00
607d32e32b Fix bug #65362 2023-12-15 14:01:10 +05:00
67ca3c57b8 Fix GetFontBinary and build 2023-12-15 11:46:55 +03:00
9908c9e507 fix bug #65516 2023-12-14 19:58:16 +03:00
2869ef8ab6 fix bug #65485 2023-12-14 19:11:56 +03:00
3aa91fcfd4 Fix bug #65241 and other fixes 2023-12-14 18:54:39 +03:00
f8c664daef Fix smil attribute name conversion 2023-12-14 20:34:22 +05:00
63f6190da8 Fix pptx transition conversion 2023-12-14 20:28:40 +05:00
a2aeb83fa8 fix bug #65523 2023-12-14 17:46:39 +03:00
ed65322e03 Merge pull request #1358 from ONLYOFFICE/feature/pdf-widget
Write pdf widget text and button
2023-12-14 17:27:10 +03:00
5c52d72932 Fix duration serialization 2023-12-14 17:44:56 +05:00
e3eb812659 fix bug #65528 2023-12-14 14:42:42 +03:00
a096d0787f Clear comments 2023-12-14 14:37:18 +03:00
e6496a34a8 Merge remote-tracking branch 'origin/release/v8.0.0' into feature/pdf-widget 2023-12-14 13:49:23 +03:00
d933472b53 Fix unique XObject name 2023-12-14 13:48:49 +03:00
ef664af175 fix bug #65522 2023-12-14 12:52:30 +03:00
2f2578dacd Write pushbutton widget to pdf 2023-12-14 11:56:39 +03:00
951ebdc479 Add support builder variables before open 2023-12-14 10:30:44 +03:00
7ff4d0e167 Add chart sheet conversion test 2023-12-13 22:16:19 +06:00
03af151c30 Fix conversion 2023-12-13 22:15:23 +06:00
06dba97bf1 Fix documentation for jsValue 2023-12-13 19:06:37 +03:00
bbddaf0bb7 [android] Update dependencies. Remove support api 23-25 2023-12-13 13:37:53 +03:00
07e43a64e6 Fix build 2023-12-13 10:51:35 +03:00
e01ba114d8 Add chart sheet conversion 2023-12-13 13:47:09 +06:00
4cdc234418 for bug #46216 2023-12-12 20:37:53 +03:00
a651f3a29d fix bug #46216 2023-12-12 20:03:04 +03:00
f59f34eda9 Merge branch 'release/v8.0.0' into feature/xlsb_write 2023-12-12 20:43:21 +06:00
e2759153dc Fix JS 2023-12-12 17:36:15 +03:00
9ce4444aa7 Merge pull request #1357 from ONLYOFFICE/fix/pdf-fonts
Fix JS
2023-12-12 17:31:46 +03:00
20c56559d9 Fix JS 2023-12-12 17:30:34 +03:00
02cce6ff1b Write PushButton widget to pdf 2023-12-12 16:45:19 +03:00
018ddb1540 Added dependency of the permission for embedded metafiles on the parent metafile 2023-12-12 15:11:35 +03:00
7c46dc9d3b Fix bug #65392 2023-12-12 15:09:08 +03:00
e93f270621 . 2023-12-12 14:51:19 +03:00
228feb9487 fix custom shape 2023-12-12 14:35:52 +03:00
b05c240439 Fix indents 2023-12-12 14:10:27 +03:00
470f64ca41 Merge pull request #1355 from ONLYOFFICE/fix/AlphaMask
Changing the working principle of the alpha mask
2023-12-12 14:00:44 +03:00
864b9c3da6 Add missed file 2023-12-12 13:58:50 +03:00
89059d71bd Move blend functions from library header 2023-12-12 13:55:40 +03:00
50cb0b543e Fix indent 2023-12-11 22:41:01 +03:00
ae58e99e04 fix build 2023-12-11 19:00:45 +03:00
ac711129e3 Test radiobutton и checkbox annots 2023-12-11 18:07:13 +03:00
ad51957b5e Fix bug #65359 2023-12-11 19:33:52 +05:00
36c2e3dd22 . 2023-12-11 14:42:13 +03:00
d9637f12e1 fix build 2023-12-11 13:23:33 +03:00
bba7826ba3 Merge remote-tracking branch 'origin/fix/bug50186' into release/v8.0.0 2023-12-11 12:45:59 +03:00
83ba8e890f Merge remote-tracking branch 'origin/fix/bug65399' into release/v8.0.0 2023-12-11 12:45:44 +03:00
99d72986d8 Merge remote-tracking branch 'origin/release/v8.0.0' into feature/pdf-widget
# Conflicts:
#	DesktopEditor/graphics/pro/js/wasm/src/drawingfile_test.cpp
#	PdfFile/SrcReader/PdfAnnot.cpp
#	PdfFile/SrcReader/RendererOutputDev.cpp
2023-12-11 12:04:46 +03:00
462bd9f302 Merge pull request #1356 from ONLYOFFICE/feature/serialize-js
Removed virtual functions from json functionality
2023-12-11 10:19:28 +03:00
3042dc08cc Make IValue desctructor non-virtual 2023-12-11 11:14:21 +04:00
c196f282af Bugfix BuildParagraphes 2023-12-11 05:25:02 +03:00
bea162aef9 BuildParagraphes update
(in progress)
2023-12-11 00:25:17 +03:00
3cb014edd9 Merge pull request #1353 from ONLYOFFICE/feature/pdf-fonts
Get widget's Embedded, Standard and All fonts
2023-12-09 14:24:48 +03:00
4efc453cc4 Refactoring drawing base module 2023-12-09 14:24:10 +03:00
61e5896830 Fix bug #65399 2023-12-09 00:57:22 +05:00
032b61f532 Fix bug #65284 2023-12-07 20:16:00 +03:00
07be7f5de4 for bug #65355 2023-12-07 18:25:34 +03:00
bfa6a6d826 Fix bug #50186 2023-12-07 20:12:46 +05:00
daba967cdc Add pivot tables tests 2023-12-07 21:10:08 +06:00
5c7f07f71d Fix frtslicercache conversion 2023-12-07 20:57:56 +06:00
92312df5ad Add slicer tests 2023-12-07 20:57:20 +06:00
285cbdc9c5 Fix GetWidgetFonts for Info 2023-12-07 12:18:11 +03:00
72cc8a1566 Minor improvements 2023-12-07 12:16:18 +03:00
e4031da0ba Add comments and tables test 2023-12-07 14:24:13 +06:00
5deee7049f Fix RD field 2023-12-07 10:25:58 +03:00
22943e61bc Add GetFontByParams 2023-12-06 18:51:18 +03:00
6298d21b5a Fix worksheet conversion 2023-12-06 21:43:18 +06:00
f5ff9b5b9b Merge pull request #1354 from ONLYOFFICE/feature/graphics-pict
Feature/graphics pict
2023-12-06 18:42:11 +03:00
78d50a329a Merge remote-tracking branch 'origin/release/v8.0.0' into develop 2023-12-06 18:40:42 +03:00
5fe5efb001 fix bug #59795 2023-12-06 18:23:33 +03:00
f3b23b3b47 Change example file 2023-12-06 21:05:51 +06:00
af7d46dbf7 Remove rgce check 2023-12-06 20:59:59 +06:00
93b8a80fa9 Fix parsed formula binary writing 2023-12-06 20:59:10 +06:00
87f0b9cb05 fix bug #53908 2023-12-06 16:21:11 +03:00
3537f9edfa Get widget's Embedded, Standard and All fonts 2023-12-06 15:46:08 +03:00
2fde5de8b0 Fix defined names conversion 2023-12-06 17:54:11 +06:00
1709ef0c08 For bug #50186 2023-12-06 15:51:33 +05:00
0c7963f427 Fix slicercache ext conversion 2023-12-06 15:53:17 +06:00
f62859046e Fix bug 2023-12-05 21:22:29 +03:00
5b93fb7fe3 fix bug #61791 2023-12-05 21:01:39 +03:00
848204d7d0 fix bug #65151 2023-12-05 18:41:53 +03:00
2896e00e0f Create BlendMode for pdf ap 2023-12-05 18:31:48 +03:00
d5330086cc Merge branch 'feature/xlsb_write' into feature/addXlsbTests 2023-12-05 21:23:44 +06:00
45c7abfc36 Merge branch 'release/v8.0.0' into feature/xlsb_write 2023-12-05 21:23:06 +06:00
986b1114be Change test file 2023-12-05 21:21:23 +06:00
5af35f3b09 Fix styles conversion 2023-12-05 21:21:10 +06:00
63e16a4967 Merge branch 'release/v8.0.0' into feature/AddOoxmlTests 2023-12-05 13:25:43 +06:00
b7a89a93a8 Merge branch 'feature/xlsb_write' into feature/addXlsbTests 2023-12-05 13:24:57 +06:00
04580a2fac Merge branch 'release/v8.0.0' into feature/xlsb_write 2023-12-05 13:13:32 +06:00
4f32c84e8a Add defaults for style colors 2023-12-05 13:10:51 +06:00
bfbae147f0 Add tests for simple xlsb 2023-12-05 13:10:22 +06:00
1e43922247 Fix bug in blending 2023-12-04 19:44:19 +03:00
a0d3d402a3 Redesigned work with the alpha mask 2023-12-04 19:37:38 +03:00
09ab798f0d Merge pull request #1351 from ONLYOFFICE/fix/bug38048
Fix bug #38048
2023-12-04 17:40:55 +03:00
4497e59602 Fix build 2023-12-04 17:39:46 +03:00
13c6193f42 Merge branch 'feature/xlsb_write' into feature/addXlsbTests 2023-12-04 20:22:00 +06:00
fcc7708a85 Merge branch 'release/v7.6.0' into feature/xlsb_write 2023-12-04 20:21:21 +06:00
0a157c4afd Remove formats from test convert params 2023-12-04 20:19:08 +06:00
b7627222d3 Fix bug #38048 2023-12-04 17:07:54 +03:00
3f020f9e16 Create SetAP for CButtonWidget 2023-12-04 16:35:30 +03:00
b0257d138f Merge pull request #1341 from ONLYOFFICE/fix/pdf-widget
Add getInteractiveFormsFonts and getFontByID for drawingfile
2023-12-04 10:12:52 +03:00
1bf45a3c23 Add xlsx 2 xlsb tests 2023-12-04 13:07:30 +06:00
54efbc22fc Fix indents 2023-12-03 22:04:47 +03:00
1a47ad9c31 fix bug #65352 2023-12-03 14:08:13 +03:00
27dcc07cee Merge pull request #1342 from ONLYOFFICE/feature/GraphicsLayers
Feature/graphics layers
2023-12-01 22:27:01 +03:00
69305816f7 Merge pull request #1350 from ONLYOFFICE/feature/serialize-js
JSC: Automatic Dispose for CJSContext on destruction
2023-12-01 21:30:31 +03:00
7ca14893b9 JSC: Added Dispose() to ~CJSContext() 2023-12-01 18:38:22 +04:00
ccfaa64cc1 fix bug #65340 2023-12-01 16:48:52 +03:00
5533ac8a59 Adding conversion of brackets, matrices, scores and indexes. Tests. 2023-12-01 16:27:26 +03:00
365f73df56 Merge branch 'release/v7.6.0' into develop 2023-12-01 16:14:41 +03:00
a1f149945c Merge remote-tracking branch 'origin/fix/bug65311' into release/v7.6.0 2023-12-01 16:13:43 +03:00
2c3ebd218e fix bug #65309 2023-12-01 16:13:34 +03:00
e0437fcf77 Merge branch 'feature/xlsb_write' into feature/addXlsbTests 2023-12-01 19:06:17 +06:00
d404457744 FIx tables and cols conversion 2023-12-01 18:17:12 +06:00
6da3453104 Merge pull request #1348 from ONLYOFFICE/fix/bug19081
Fix bug #19081
2023-12-01 10:31:50 +03:00
7e9c6bd266 Merge pull request #1347 from ONLYOFFICE/feature/serialize-js
Feature/serialize js
2023-11-30 18:21:03 +03:00
a432af9b7e Fix indents 2023-11-30 18:17:35 +03:00
766c4b61a1 Added test: serialization usage with script 2023-11-30 19:10:57 +04:00
372ae97780 Fix bug #65311 2023-11-30 20:02:29 +05:00
5b1dea7a19 fix bug #65265 2023-11-30 17:27:02 +03:00
4871e28398 Fix getInt to getNum 2023-11-30 17:15:21 +03:00
3a69bf7b3a Fix bug #19081 2023-11-30 17:13:28 +03:00
7373566cd5 Fix indents 2023-11-30 17:06:13 +03:00
c1c15d067a Remove theme from test params file 2023-11-30 16:54:45 +06:00
22e0772cdb move tests to ooxml 2023-11-30 16:32:53 +06:00
3426704f80 mend 2023-11-30 14:00:19 +06:00
b317d304df Merge branch 'release/v7.6.0' into feature/xlsb_write 2023-11-30 13:59:46 +06:00
61d75ed092 revert test 2023-11-30 10:38:21 +03:00
8550cec836 Fix EditWidgets 2023-11-30 10:27:22 +03:00
f82b8ad14f Merge pull request #1345 from ONLYOFFICE/fix/pdf-build
Fix build
2023-11-30 10:01:14 +03:00
0258c03400 Fix build 2023-11-30 09:46:52 +03:00
cb7247a3cd Merge remote-tracking branch 'origin/release/v7.6.0' into develop 2023-11-29 19:40:01 +03:00
8dab6c0b7a Merge remote-tracking branch 'origin/feature/AddX2tTests' into release/v7.6.0 2023-11-29 19:39:12 +03:00
0cf46a4ca5 fix bug #65292 2023-11-29 19:37:06 +03:00
610b0b0831 JSC: fixed json tests 2023-11-29 20:13:07 +04:00
8ad3170a26 JSC: fixed createString() functions 2023-11-29 20:12:49 +04:00
9c5e02de53 Fix bug 65301 2023-11-29 19:00:44 +03:00
6678012307 Fix write CO, Add read FileAttachment 2023-11-29 17:36:59 +03:00
97c314e379 All tests were added. Small serialization rework.
- Code coverage: 100%
- Restructured serialization code to handle primitives first
2023-11-29 14:22:51 +04:00
765cf636d4 Remove unused files 2023-11-29 16:20:34 +06:00
e29016e803 Add tests for simple2.xlsx 2023-11-29 15:53:24 +06:00
f892a000ff Add second test file 2023-11-29 15:53:13 +06:00
a18c2c1d4c Add test to qmake project 2023-11-29 15:52:50 +06:00
a2b75cabf0 Update common files 2023-11-29 15:52:23 +06:00
8a511c45bd Add tests for simple file 2023-11-29 15:52:06 +06:00
a3f414bb3a Change simple1 file 2023-11-29 15:51:10 +06:00
be7a51989d Add content types test 2023-11-29 15:50:49 +06:00
15b4eee571 Add xlsb2xlsx files test preparation 2023-11-29 15:50:15 +06:00
02fbbc6ce5 Fix test common files 2023-11-29 15:49:59 +06:00
ca885745f2 Add x2t test projects 2023-11-29 15:49:26 +06:00
e50d21e9ea fix bug #65257 2023-11-28 20:34:40 +03:00
b4dd7230ca fix bug #65190 2023-11-28 19:04:42 +03:00
0ce7733113 Fix the shaping of a rtl text 2023-11-28 18:21:17 +03:00
411495ee0d Fix align and font for text widget 2023-11-28 18:03:38 +03:00
0ec39e3d32 Write widget's parent 2023-11-28 16:04:04 +03:00
8d7692d6f2 Add FontStyle for widgets 2023-11-28 14:58:58 +03:00
2895e27c32 Made code coverage 100% for CValue & CValueRef 2023-11-28 15:19:51 +04:00
a5351fbf12 . 2023-11-28 14:15:39 +03:00
d75c7c93f0 Optimization 2023-11-28 13:47:02 +03:00
9366c7e2a3 Refactoring 2023-11-28 13:32:50 +03:00
565bab2d4d Remove warnings 2023-11-28 13:21:51 +03:00
230fe73eb4 Fix DecodeHeader() and DestroyImage() 2023-11-28 12:50:06 +03:00
d84f8b3146 fix bug #65265 2023-11-28 11:43:38 +03:00
36677119e8 Merge pull request #1343 from ONLYOFFICE/feature/refactoringX2tConverter
Feature/refactoring x2t converter
2023-11-28 10:40:25 +03:00
dd07e9d868 Small fix 2023-11-28 10:38:44 +03:00
be08b9c6c6 Fix pivot conversion 2023-11-28 13:33:33 +06:00
5807ffa45a Fix bugs with oformpdf format 2023-11-28 00:43:39 +03:00
c002de1ad3 Fix build 2023-11-27 23:40:56 +03:00
94c4e22b8e Add oform_pdf format 2023-11-27 23:38:06 +03:00
01776552f5 fix bug #65260 2023-11-27 23:17:54 +03:00
3e5eb3d251 Added tests to basic CValue functionality 2023-11-27 21:29:56 +04:00
b4ddfac5ed Refactoring 2023-11-27 18:49:31 +03:00
d50451739c Create FileAttachment annot 2023-11-27 18:19:32 +03:00
bb3de819cd Added the use of multi-layer rendering in Svg reader 2023-11-27 17:22:07 +03:00
1eeaea8c34 Refactoring 2023-11-27 17:21:14 +03:00
2d9206b79b Changed some places where set() were used 2023-11-27 18:05:53 +04:00
f6e126026a Changed set()-s and add() for JSC 2023-11-27 17:55:57 +04:00
14962ccaef set()-s and add() now take JSSmart<CJSValue> 2023-11-27 17:44:16 +04:00
282e1fe025 Refactoring 2023-11-27 14:45:48 +03:00
f633fad046 [Test] Add macro to parse excel dates format 2023-11-26 11:27:51 +03:00
fd95d72a08 Update ascent/descent
values in objects
crossing using ascent/descent
2023-11-26 01:17:33 +03:00
3a73292e81 Refactoring 2023-11-24 18:43:25 +03:00
4b658617b3 for bug #65241 2023-11-24 17:39:54 +03:00
f024c9fb8f DashPattern for border Text Widget 2023-11-24 17:34:38 +03:00
a096559e29 Changed the order of comparison in toJS() 2023-11-24 17:07:09 +04:00
fdaf8e6c6b Fixed fromJS() 2023-11-24 16:23:16 +04:00
bfb113170f Merge branch 'release/v7.6.0' into feature/xlsb_write 2023-11-24 14:19:32 +06:00
2532063e41 Revert "."
This reverts commit 8b21497c2a.
2023-11-24 11:14:46 +03:00
8b21497c2a . 2023-11-24 10:53:33 +03:00
6ebdc0f530 Remove duplicated code 2023-11-23 22:39:26 +03:00
b0dfb4c731 Added allocator and deallocator for typed arrays 2023-11-23 19:13:03 +04:00
53770e3ba3 . 2023-11-23 16:36:36 +03:00
2ac2874c94 fix bug #65190 2023-11-23 16:33:28 +03:00
254e5168af Added a test example of using graphics layers 2023-11-23 16:32:46 +03:00
fe6590366d Added implementation of graphic layers 2023-11-23 16:32:27 +03:00
86d5b5920f Test write TextWidget 2023-11-23 15:49:39 +03:00
f7af725d77 [Test] Add macro to parse excel dates format 2023-11-23 15:32:47 +03:00
3ae6927ac3 Reworked CValue, added CValueRef 2023-11-23 16:25:21 +04:00
4e0db82b68 fix bug #65199 2023-11-23 13:23:08 +03:00
4988c1853e Refactoring 2023-11-22 21:49:13 +03:00
6588e1d80b Fix changes 2023-11-22 17:26:04 +03:00
07c9efd29f Fix changes 2023-11-22 17:24:19 +03:00
2fba8eb6d7 Merge branch 'release/v7.6.0' into develop 2023-11-22 17:16:27 +03:00
7f9164ddb2 Fix 2023-11-22 16:32:23 +03:00
0c28276753 Create getInteractiveFormsFonts and getFontByID 2023-11-22 16:20:46 +03:00
5e13f2c7ce Merge remote-tracking branch 'origin/fix/bug65171' into release/v7.6.0 2023-11-22 13:53:09 +03:00
c1956ffd3f Fix group xml id 2023-11-22 15:36:09 +05:00
44ef271b92 Release GetWidgetFonts 2023-11-22 11:58:19 +03:00
68cfa314b6 Add PictDecoder to BgraFrame 2023-11-21 18:43:22 +03:00
9eee80b43e Merge remote-tracking branch 'origin/release/v7.6.0' into fix/pdf-widget 2023-11-21 18:27:20 +03:00
49d3e46a0f Create GetWidgetFonts 2023-11-21 18:25:32 +03:00
03ad40b12c for bug #65159 2023-11-21 17:36:29 +03:00
b85d5d9385 Fix bug #65171 2023-11-21 18:42:16 +05:00
bcea33ed19 Implemented reference mechanism for CValue 2023-11-21 16:53:48 +04:00
730efcd993 Fix content.xml file format error 2023-11-21 17:37:58 +05:00
f403f4aa20 Merge pull request #1337 from ONLYOFFICE/feature/pdf-widget
Read and Write MetaData
2023-11-21 13:20:28 +03:00
e9f3821f60 Merge pull request #1340 from ONLYOFFICE/fix/bug61021
Fix bug #61021
2023-11-21 13:19:41 +03:00
ef2e1ca336 Fix bug #61021 2023-11-21 11:41:28 +03:00
acfd0f02c1 Merge remote-tracking branch 'origin/fix/bug65162' into release/v7.6.0 2023-11-21 10:58:33 +03:00
390e6772da Fix PdfWriter_empty for build drawingfile 2023-11-21 10:28:26 +03:00
4d710c0503 Fix typo. And add test for local fonts 2023-11-20 22:26:55 +03:00
79e474f503 Fix bug #65162 2023-11-20 21:48:33 +05:00
1d17c51ea6 Merge pull request #1339 from ONLYOFFICE/fix/x2t_test
Fix bugs
2023-11-20 19:19:40 +03:00
45f3994e49 Fix in x2t 2023-11-20 18:19:19 +03:00
086b502648 Fix bugs 2023-11-20 18:14:05 +03:00
a8f9ff175e Create StartAP, AddLineToAP, EndAP 2023-11-20 17:56:17 +03:00
d6a60d3b02 Fix changes 2023-11-20 17:51:42 +03:00
60586843f9 Merge pull request #1338 from ONLYOFFICE/fix/bug64756
Fix bug #64756
2023-11-20 16:42:13 +03:00
e6b2f1aecf Fix bug #64756 2023-11-20 12:36:50 +03:00
6301240a92 fix PICTDecoder 2023-11-20 11:55:23 +03:00
f6c0ffc644 CValue major rework 2023-11-18 00:56:32 +04:00
fddacca6b0 Remove unused code 2023-11-17 21:25:01 +03:00
f11d335477 Fix path to vendor scripts 2023-11-17 21:19:38 +03:00
66c0c1f6e7 Remove unused code 2023-11-17 21:05:57 +03:00
9e5a3c7290 Remove temp directory 2023-11-17 21:03:24 +03:00
0a9ba05fc3 Add xml 2023-11-17 21:02:01 +03:00
59671e55dd Add test for x2t convertation with xml 2023-11-17 20:23:57 +03:00
b0dc27edfa Fix build hb on unix 2023-11-17 17:12:47 +03:00
4b91197bdf Fix trash 2023-11-17 17:05:05 +03:00
107377b905 Fix AddMetada and GetMetaData 2023-11-17 16:58:59 +03:00
8c5c08bcfb fix bug #65109
(cherry picked from commit 1ab39932c4)
2023-11-17 16:00:55 +03:00
02a32b8eef for bug #60963 2023-11-17 15:52:04 +03:00
8289a0534f Add method for auto-check modules 2023-11-17 15:09:49 +03:00
01c735bc71 Create GoogleTest for pdf 2023-11-17 13:26:59 +03:00
d646876347 V8: Exclude undefined properties from result 2023-11-17 13:52:24 +04:00
84c34eed65 Fixes
+ Fixed build for mac
+ Removed undefined properties from tests
2023-11-17 13:52:24 +04:00
c23eece6ae JSC: Implemented CJSObject::getPropertyNames() 2023-11-17 13:52:24 +04:00
31f52731f6 Added tests for CJSObject::getPropertyNames() 2023-11-17 13:52:24 +04:00
59806039ed V8: Implemented CJSObject::getPropertyNames() 2023-11-17 13:52:24 +04:00
7eebede9a6 Tests rearrangement 2023-11-17 13:52:24 +04:00
eecc623723 Add some new functionality
+ Getters for CValue
+ Reworked CObject
+ Partly functioning fromJS() function
+ Changed test example
2023-11-17 13:52:24 +04:00
85f86c2de6 Added typed arrays 2023-11-17 13:52:24 +04:00
62f5b03bb4 Added arrays 2023-11-17 13:52:24 +04:00
eecd983377 Rewrited toJS() as a static function 2023-11-17 13:52:24 +04:00
6bafc84285 Made destructors virtual 2023-11-17 13:52:24 +04:00
a4ac108c7c Some minor improvements 2023-11-17 13:52:23 +04:00
20e782bf5b Test example improvements 2023-11-17 13:52:23 +04:00
dddd37af12 Refactoring: added base class 2023-11-17 13:52:23 +04:00
87d9ad5b88 Basic functionality 2023-11-17 13:52:23 +04:00
c7c0ed28f6 Fix GetMetaData and SetMetaData 2023-11-17 12:29:22 +03:00
f9b4f8402b added conversion of operations on sets and connections. tests added 2023-11-17 12:04:13 +03:00
f78ab48afa Add fPIC option for arm64 platform 2023-11-17 11:36:37 +03:00
d4fd09d72e fix bug #65138 2023-11-16 18:41:56 +03:00
3d498c142b fix bug #59573 2023-11-16 18:06:20 +03:00
6a723f50e0 Fix memory 2023-11-16 17:54:53 +03:00
925614f5f4 fix bug #64732 2023-11-16 17:39:22 +03:00
f40d53c64f Create GetMetaData for pdf 2023-11-16 17:25:27 +03:00
272288f899 Update emcc and support it in fonts module 2023-11-16 14:18:57 +03:00
d974dc4351 Merge pull request #1336 from ONLYOFFICE/feature/refactoringWasmModulesBuild
Update emcc and support it in fonts module
2023-11-16 10:50:24 +03:00
a1c2d9dd82 Update emcc and support it in fonts module 2023-11-15 22:36:32 +03:00
e3a0b16578 Fix styles conversion 2023-11-16 00:45:21 +06:00
b8094c63fc . 2023-11-15 20:53:38 +03:00
3113fb7e89 fix timelines & chart userShapes 2023-11-15 20:43:07 +03:00
a1e90d1904 Test with password and sign 2023-11-15 17:49:26 +03:00
11b979faff Create CStreamData for wtire data to pdf 2023-11-15 16:52:12 +03:00
5b37d5d11d Fix DashPattern for pdf border annots 2023-11-15 14:49:36 +03:00
1ab39932c4 fix bug #65109 2023-11-15 13:23:48 +03:00
bef3b3f9a8 Write MetaData to pdf 2023-11-15 11:52:08 +03:00
41dddaf9ae Test write data to pdf 2023-11-14 18:12:13 +03:00
8213524b6b DecodePICT project 2023-11-14 16:43:08 +03:00
c6fc3eb7c3 Create SetAP for Text Widget annots 2023-11-14 15:02:19 +03:00
fb608d3dd5 Fix connection conversion 2023-11-14 16:33:26 +06:00
2d53f96522 Add query table conversion 2023-11-14 15:15:43 +06:00
c712f888c4 fix bug #54433 2023-11-14 11:58:52 +03:00
501419523d Refactoring 2023-11-14 11:24:17 +03:00
31930c5279 fix bug #65056 2023-11-13 21:26:49 +03:00
caa50dbc47 Fix bug #45384 2023-11-13 19:47:22 +03:00
499509ed6b Fix Dash Pattern for drawingfile 2023-11-13 15:55:05 +03:00
d5a8460fbb Fix bug #64900 2023-11-13 12:06:04 +03:00
5bfbd3e0ad Merge remote-tracking branch 'origin/feature/oo-presentation' into develop 2023-11-10 17:20:54 +03:00
c4085ed698 Fix xlsx 2 xlsb conversion 2023-11-10 17:21:44 +06:00
6fcd76a469 Refactoring 2023-11-10 12:23:27 +03:00
6f8df69990 timeslicer 2023-11-09 22:57:21 +03:00
088c9f527a Merge remote-tracking branch 'origin/fix/v7.5.1-fix-bugs' into develop 2023-11-09 17:41:44 +03:00
311cbe468b Merge branch 'develop' into feature/xlsb_write 2023-11-09 14:30:07 +06:00
8787625ba8 fix bug #64994 2023-11-08 17:46:26 +03:00
3a17ce21ef Reworking of the CElementOperator class, reworking of some part of the conversion, tests 2023-11-08 17:24:09 +03:00
50a83e819f Merge branch hotfix/v7.5.1 into master 2023-11-08 12:05:57 +00:00
21fc54b493 Fix bug #64967 2023-11-08 15:26:47 +06:00
468cf179ec Fix ellipse conversion 2023-11-07 03:22:10 +05:00
e5a4ea21b0 Fix move 2023-11-06 17:19:48 +03:00
07b33be69a Fix bug
- shared -> wear ptrs
- fix bug with sort
2023-11-06 15:49:29 +03:00
6a1d9224cb fix bug #64987 2023-11-04 17:55:06 +03:00
4fd2f6f2de fix bug #64986 2023-11-04 17:49:27 +03:00
ba12ec9375 fix bug #63720 2023-11-04 10:47:55 +03:00
1d155e35d2 For bug 46717 2023-11-03 23:11:58 +03:00
d9168ddadb Test pptx interactions conversion 2023-11-03 16:14:52 +05:00
9f096e2c2d Merge remote-tracking branch 'origin/hotfix/v7.5.1' into develop 2023-11-03 13:56:25 +03:00
c62583ab39 fix bug #64969 2023-11-03 13:54:48 +03:00
9686cd72d9 for bug #64957 2023-11-03 13:35:35 +03:00
21d8353cdc Fix bug with highlighting 2023-11-03 13:00:11 +03:00
49e052fbce fix bug #64957 2023-11-03 12:52:05 +03:00
29e44fb12c Refactoring
- tables romoved (for now)
- paragraph logic is broken (fix soon)
2023-11-03 12:22:14 +03:00
3824b6fbd5 Test odp interactions conversion 2023-11-03 13:20:01 +05:00
91fad82d6a Refactoring
in progress
2023-11-02 23:10:29 +03:00
8b9d5c9f51 Refactoring (still in porgress) 2023-11-02 18:34:45 +03:00
aa5af32b27 Fix bug #52825 2023-11-02 17:49:24 +03:00
83e37ba5f0 Refactoring (in progress) 2023-11-02 14:12:58 +03:00
37a81e3fed . 2023-11-02 14:06:25 +03:00
7b65e3d24c Fix typo 2023-11-02 14:45:22 +05:00
5336657025 fix bug #64949 2023-11-02 10:26:59 +03:00
3a2389273c Merge remote-tracking branch 'origin/hotfix/v7.5.1' into develop 2023-11-02 10:06:01 +03:00
d3db4b7318 fix build 2023-11-02 09:28:06 +03:00
743e83420d fix 2023-11-01 21:49:29 +03:00
6a6d8e6414 for bug #64944 2023-11-01 18:11:41 +03:00
cbadfac9dd Convert pptx open document hyperlink to odp 2023-11-01 19:44:15 +05:00
ab0bed2675 Convert pptx sound hyperlink to odp presentation:sound 2023-11-01 17:06:14 +05:00
3868ba4846 . 2023-11-01 14:23:04 +03:00
5272f00216 Merge branch 'develop' into feature/xlsb_write 2023-11-01 16:12:41 +06:00
5a24c2895c Fix bug #64863 2023-11-01 15:10:35 +06:00
c850a78a68 xlsx timelines 2023-10-31 19:29:26 +03:00
a5234788f7 Update odf test build file 2023-10-31 21:12:16 +05:00
b0866263e3 Convert open document interaction 2023-10-31 21:11:30 +05:00
954f3d5471 Merge branch hotfix/v7.5.1 into master 2023-10-31 14:41:39 +00:00
6374e3ba23 Refactoring 2023-10-31 17:17:17 +03:00
65d6644841 Merge remote-tracking branch 'origin/fix/pdf' into develop
# Conflicts:
#	DesktopEditor/graphics/pro/js/wasm/js/drawingfile_base.js
#	DesktopEditor/graphics/pro/js/wasm/src/drawingfile.h
#	DesktopEditor/graphics/pro/js/wasm/src/drawingfile_test.cpp
#	PdfFile/PdfFile.h
#	PdfFile/PdfReader.cpp
#	PdfFile/PdfReader.h
2023-10-31 12:13:46 +03:00
4c94c647cc Added a restriction on the use of the file system 2023-10-31 11:41:12 +03:00
9d3713c73d Convert interaction play audio 2023-10-31 02:35:28 +05:00
9db264ae4b Test play animation on trigger 2023-10-31 01:57:43 +05:00
c21df7a9da Convert play animation on trigger opd to pptx 2023-10-30 21:19:14 +05:00
9e23e0ae5e Merge pull request #1331 from ONLYOFFICE/fix/bug64530
Fix bug #64530
2023-10-30 17:58:38 +03:00
335e1c3979 Fix bug #64530 2023-10-30 17:53:53 +03:00
d48fdf1da0 . 2023-10-30 17:34:42 +03:00
fea638a44f Merge remote-tracking branch 'origin/hotfix/v7.5.1' into develop 2023-10-30 17:28:18 +03:00
28336a9584 [android] Fix build 2023-10-30 16:54:09 +03:00
a16451fa7a Convert play animation on trigger 2023-10-30 16:30:40 +05:00
c991e6058f Fix linux build 2023-10-30 13:54:59 +03:00
22c488bdd8 Merge pull request #1330 from ONLYOFFICE/fix/pdf-button-widget
Fix getButtonIcons with base64 image
2023-10-30 13:42:28 +03:00
423a6982e5 Add script for minimize js files 2023-10-30 13:38:24 +03:00
eff62b475b fix bug #64779 2023-10-30 13:13:57 +03:00
0e82e1bca5 Fix getButtonIcons with base64 image 2023-10-30 13:03:27 +03:00
470be78b16 Merge pull request #1329 from ONLYOFFICE/fix/bug64865
Fix bug 64865 and refactoring
2023-10-30 12:45:18 +03:00
b561ec0f14 Merge remote-tracking branch 'origin/fix/bug64635-xlsb' into hotfix/v7.5.1 2023-10-30 12:11:14 +03:00
3908dff2d7 fix bug #64704 2023-10-30 11:56:43 +03:00
0f9fc29854 Add mp3 audio to default content type 2023-10-29 00:59:48 +05:00
3a40c08045 Set global temp path for x2t process 2023-10-27 22:49:45 +03:00
49a440d393 Fix bug #64635 2023-10-27 21:04:23 +06:00
5b0516e398 Architecture refinement (adding connections, functions and operators) 2023-10-27 17:23:25 +03:00
2921ead849 fix bug #64856 2023-10-27 14:36:59 +03:00
075211ba63 Add correction for pdf module 2023-10-27 11:14:19 +03:00
d1c8df7ae4 Fix go to specific page interaction odp to pptx 2023-10-27 03:25:28 +05:00
82c469a0a6 Changed the comparison of double values 2023-10-26 19:02:23 +03:00
0bef9667c6 fix bug #63772 2023-10-26 18:20:06 +03:00
6c0060adbd Fix bug #64865 2023-10-26 18:07:25 +03:00
2ba87bf204 Merge branch 'feature/oo-presentation' of https://github.com/ONLYOFFICE/core into feature/oo-presentation 2023-10-26 19:45:19 +05:00
5a17d2f89e Fix go to specific slide hyperlink conversion pptx to odp 2023-10-26 19:43:11 +05:00
33bfee2eee Merge pull request #1327 from ONLYOFFICE/fix/bug64845
Fix bug #64845
2023-10-26 16:30:52 +03:00
641fb754d7 Fix bug #64845
Fixed search for cmap need - now also checks AcroForm, annots and widgets.
2023-10-26 15:57:26 +03:00
b3fde49cd8 . 2023-10-26 14:52:57 +03:00
922db1270e Release GetFont without renderer 2023-10-26 13:55:44 +03:00
02b6eb939e [x2t] Fix utf16 size in Editor.bin; For bug 64790 2023-10-26 13:33:19 +03:00
c8f4a6410f fix bugs 2023-10-26 10:34:40 +03:00
2c631fbb5e Merge remote-tracking branch 'origin/hotfix/v7.5.1' into develop 2023-10-25 18:32:10 +03:00
aba022beb3 Merge pull request #1326 from ONLYOFFICE/fix/bug64636-xlsb
Fix bug #64636
2023-10-25 11:30:03 -04:00
0e384091ea Fix bug 64602 2023-10-25 18:17:59 +03:00
96447813e3 Add ctWidgetsInfo for widget's CO and Parents 2023-10-25 17:39:38 +03:00
8402eb786a Develop GetFont without renderer 2023-10-25 17:38:17 +03:00
7e8dc8c46a Refactoring AnnotField 2023-10-25 17:37:11 +03:00
e1d8a5a0f5 Fix bug #64636 2023-10-25 18:32:23 +06:00
3bc10354d6 fix bug #64822 2023-10-25 14:16:09 +03:00
48075c46d2 Fix deploy builder 2023-10-25 11:30:24 +03:00
1691529fc4 fix bug #64834 2023-10-24 22:19:49 +03:00
f91bedcb5c Fix DR and develop Actions 2023-10-24 17:58:13 +03:00
7448aabbc2 Merge pull request #1325 from ONLYOFFICE/hotfix/v7.5.1
Hotfix/v7.5.1
2023-10-24 14:10:48 +03:00
fc27496f1b Merge pull request #1324 from ONLYOFFICE/fix/pre7.5.1
Fix/pre7.5.1
2023-10-24 13:19:35 +03:00
284c5836e2 Fix bug #64722 2023-10-24 12:10:20 +03:00
48c0e8bf5f Fix bug #45334 2023-10-24 10:02:17 +03:00
9e945d6d1b Add read FontInfo for Widget annots 2023-10-24 09:47:19 +03:00
3004b093da small fix for odf 2023-10-24 09:46:19 +03:00
a2984e2633 . 2023-10-23 19:34:46 +03:00
865d50ada8 Merge branch 'hotfix/v7.5.1' of https://github.com/ONLYOFFICE/core into hotfix/v7.5.1 2023-10-23 16:54:24 +03:00
169151532a Merge branch 'fix/bug64790' of https://github.com/ONLYOFFICE/core into hotfix/v7.5.1 2023-10-23 16:54:20 +03:00
b0b7f95230 Merge pull request #1322 from ONLYOFFICE/fix/bug64790
[x2t] Fix utf16 size in Editor.bin; Fix bug 64790
2023-10-23 09:53:19 -04:00
7d08f10720 Add URI href animation audio conversion 2023-10-23 18:41:02 +05:00
89a11bc86d Refactor code 2023-10-23 18:41:02 +05:00
eefee24efa Test pptx to odp animation audio, refactor tests project 2023-10-23 18:41:01 +05:00
ad3b3b9a47 Fix relative path animation audio conversion 2023-10-23 18:41:01 +05:00
e659d7a298 Fix p:from p:to attributes serrialization 2023-10-23 18:41:00 +05:00
2cf2bc8480 PPTX to ODP anim audio conversion 2023-10-23 18:41:00 +05:00
0d96f5d102 Test animaition audio 2023-10-23 18:40:59 +05:00
7364393abb Refactor odf test project 2023-10-23 18:40:59 +05:00
e74e1aa1c6 Add example test file 2023-10-23 18:40:58 +05:00
65ebc2120b Convert anim:audio 2023-10-23 18:40:58 +05:00
64616f9eb3 Fix bug #61634 2023-10-23 18:40:57 +05:00
b3ef5b54d9 For bug #61378 2023-10-23 18:40:57 +05:00
9a3cf6b2a9 For bug #61378
Fix converting tab character into text:tab tag
2023-10-23 18:40:57 +05:00
93312b56a3 Skip list items with no text 2023-10-23 18:40:56 +05:00
7cb45353ca For bug #61378
Convert tab character into text:tab tag
2023-10-23 18:40:56 +05:00
308337ff85 Revert "Fix OpenOffice 2.0 list bug"
This reverts commit b71fce9d06.
2023-10-23 18:40:55 +05:00
8885675fac Fix OpenOffice 2.0 list bug 2023-10-23 18:40:55 +05:00
914225d868 Read font's name, size, color from DA 2023-10-23 15:11:41 +03:00
5c93af24b5 Delete TextFormField 2023-10-23 14:40:46 +03:00
9ce6fba289 Release CActionJavaScript 2023-10-23 14:40:19 +03:00
385a9bfac6 Fix string escape 2023-10-23 14:39:28 +03:00
8ff3c2efb0 Add URI href animation audio conversion 2023-10-23 16:35:04 +05:00
c1178d9eb3 Fix bug #45334 2023-10-23 10:21:15 +03:00
754ff95632 Fix copy memory 2023-10-23 10:00:57 +03:00
06eb5c26ee Refactor code 2023-10-23 00:55:21 +05:00
b4169bbd8d Test pptx to odp animation audio, refactor tests project 2023-10-22 00:48:26 +05:00
eeea52787c [x2t] Fix utf16 size in Editor.bin; Fix bug 64790 2023-10-21 13:01:37 +03:00
65d1ea716c Merge remote-tracking branch 'origin/fix/bug64634-xlsb' into fix/pre7.5.1 2023-10-20 17:27:28 +03:00
e84824efc5 Fix bug #64634 2023-10-20 19:43:58 +06:00
0b1e208a53 Fix relative path animation audio conversion 2023-10-20 17:57:33 +05:00
73fc65f472 Fix p:from p:to attributes serrialization 2023-10-20 17:57:06 +05:00
f6686eb67b For bug #64776 2023-10-20 15:16:24 +03:00
9871f3c0f1 Release getButtonIcons with base64 image 2023-10-20 14:33:25 +03:00
82ce157652 PPTX to ODP anim audio conversion 2023-10-19 23:42:36 +05:00
afb5b2c4cf Fix AcroForm 2023-10-19 18:45:16 +03:00
343937fe94 Add CActionResetForm 2023-10-19 18:44:53 +03:00
79bfba881f Merge branch 'fix/v7.5.1-fix-bugs' into fix/pre7.5.1 2023-10-19 11:05:41 +03:00
9ab1f5937b Merge pull request #1320 from ONLYOFFICE/fix/bug64637-xlsb
Fix bug #64637
2023-10-19 04:03:46 -04:00
83f83b69f9 fix bug #64745 2023-10-19 10:45:56 +03:00
63d77784d1 [Test] Add id-ID locale 2023-10-19 00:03:20 +03:00
03c3dc1f22 fix bug #64744 2023-10-18 20:09:41 +03:00
f06ce2c824 fix bug #64704 2023-10-18 19:49:17 +03:00
fc04d3e98f Create Text Widget annots 2023-10-18 14:40:20 +03:00
477024d612 Fix NSCorrectFontName::CheckFontNamePDF 2023-10-18 12:18:28 +03:00
2c82255a7d Fix build nativegraphics 2023-10-18 12:18:02 +03:00
50aaa413d2 Fix bug #64637 2023-10-17 20:30:01 +06:00
177e605e00 Merge branch release/v7.5.0 into master 2023-10-17 12:06:52 +00:00
007904d170 Merge pull request #1316 from ONLYOFFICE/fix/pdf
Fix pdf save
2023-10-16 18:58:56 +03:00
e06f3f3b8c Refactoring 2023-10-16 18:57:50 +03:00
9a1c824ba4 Revert For bug #45334 2023-10-16 18:46:52 +03:00
6fdd4e6cb9 Merge pull request #1318 from ONLYOFFICE/fix/bug55487
Fix bug #55487
2023-10-16 18:15:04 +03:00
c24148dd24 Fix bug #55487 2023-10-16 17:58:00 +03:00
d77f79a131 Merge pull request #1317 from ONLYOFFICE/fix/videoplayer
Added plugins to libvlc build for supporting .avi and .mts formats
2023-10-16 15:55:19 +03:00
99a5e46b67 win_32 rebuild 2023-10-16 16:49:33 +04:00
311175cae2 Fix delete IRT annots 2023-10-16 15:32:15 +03:00
a189612b1a Added plugins to support .avi and .mts formats 2023-10-16 15:50:08 +04:00
d215e4d654 Fix generation number 2023-10-16 13:55:39 +03:00
be9216d376 For bug #45334 2023-10-16 12:53:03 +03:00
714cec2e37 Test animaition audio 2023-10-16 14:28:26 +05:00
bbf2d57bf5 Refactor odf test project 2023-10-16 13:19:17 +05:00
18ea39ed17 Add example test file 2023-10-16 09:42:30 +05:00
4842f39a3c English comments 2023-10-15 23:16:46 +03:00
40eaca6e49 Merge pull request #1315 from ONLYOFFICE/fix/bug64669
Fix bugs
2023-10-14 19:27:32 +03:00
3e4e28e546 For bug #64665 2023-10-14 14:18:42 +03:00
876b0a11ef Fix bug #64669 2023-10-14 13:32:09 +03:00
137c083f5b Merge pull request #1314 from ONLYOFFICE/fix/bug64638
Fix bug #64638
2023-10-13 22:47:27 +03:00
330882a00e Fix bug #64638 2023-10-13 20:59:26 +03:00
da899c72b0 Convert anim:audio 2023-10-13 21:06:25 +05:00
5435266b48 Merge pull request #1313 from ONLYOFFICE/fix/bug64659
Fix bug #64659
2023-10-13 18:36:03 +03:00
12a5f4ada3 Fix bug #64659 2023-10-13 18:33:32 +03:00
eec0075e54 Сhange of architecture 2023-10-13 18:18:06 +03:00
c343625e6f Add connections conversion 2023-10-13 21:14:26 +06:00
832a57bed1 Add comments conversion 2023-10-13 20:47:35 +06:00
1f4388cad5 Merge pull request #1312 from ONLYOFFICE/fix/bug64192
Fix bug #64192
2023-10-13 13:38:05 +03:00
28ceda5cf2 Fix bug #64192 2023-10-13 13:31:33 +03:00
02c6d4f8fb Fix build
(cherry picked from commit 8ae967ad99)
2023-10-13 11:39:19 +03:00
c87c4057eb Merge pull request #1310 from ONLYOFFICE/fix/SvgBug
Fixed a bug with the lag of the closing <g> element
2023-10-13 11:23:01 +03:00
4bd9864129 Fix hyphen bugs & add tests 2023-10-12 22:46:23 +03:00
aca346e32b Update test files 2023-10-12 20:46:05 +03:00
07c18f64d2 Fixed a bug with the lag of the closing <g> element 2023-10-12 19:22:39 +03:00
86e293040d Merge pull request #1309 from ONLYOFFICE/fix/pdf
Fix pdf
2023-10-12 18:00:39 +03:00
5e34a8dc8b Fix new annots and clear edit 2023-10-12 17:55:45 +03:00
0ef5482609 . 2023-10-12 17:29:36 +03:00
9185943d0c Add files for tests 2023-10-12 17:16:56 +03:00
102fa4d4b6 Merge branch 'release/v7.5.0' into feature/xlsb_write 2023-10-12 16:25:25 +06:00
8ab1c22f29 Fix bugs #64531, #64212 2023-10-12 12:39:27 +03:00
83a5fc463e Merge pull request #1308 from ONLYOFFICE/fix/bug64604-xlsb
Fix bug #64604
2023-10-12 12:29:07 +03:00
989135319a . 2023-10-12 12:28:10 +03:00
1d87532ab7 Fix bug #64604 2023-10-12 15:15:00 +06:00
30fda467b3 Widget Edit 2023-10-11 18:25:20 +03:00
ab29fce4ed Merge pull request #1307 from ONLYOFFICE/fix/v7.5.0-fix-bugs 2023-10-11 17:50:45 +03:00
5498352aae fix bug #64594 2023-10-11 17:42:56 +03:00
dc09bd4e01 Add external links binary writing 2023-10-11 19:30:01 +06:00
9bdbf87e96 Merge pull request #1306 from ONLYOFFICE/fix/pdfRotate
Without Rotate
2023-10-11 12:04:16 +03:00
ad52f52bcb Without Rotate 2023-10-11 12:01:34 +03:00
16b14b9428 fix bug #47084 2023-10-10 23:20:02 +03:00
e9e3ad1e2a Fix bug 64470 2023-10-10 21:59:03 +03:00
bdbf405d87 Merge pull request #1305 from ONLYOFFICE/fix/bug64554
Refactoring
2023-10-10 14:19:48 +03:00
3fa9e9b13c Refactoring 2023-10-10 14:13:57 +03:00
b4d03d002f Merge pull request #1304 from ONLYOFFICE/fix/bug64554
Fix bug #64554
2023-10-10 13:49:35 +03:00
9bfe9efd8c Fix bug #64554 2023-10-10 13:47:57 +03:00
a20d28d83c Merge branch 'release/v7.5.0' into feature/xlsb_write 2023-10-10 15:27:37 +06:00
6f839a24de Merge pull request #1303 from ONLYOFFICE/fix/pdf
Fix pdf save and bug #63529
2023-10-09 18:25:18 +03:00
6cbadd661c Fix IRTID and ParentID 2023-10-09 18:13:29 +03:00
95e5f331ff Fix bug #61634 2023-10-09 20:07:19 +05:00
3ce05adc4d Fix bug #63529 2023-10-09 16:29:19 +03:00
5ce26e6dca Add StartID, AP.have. Fix color for Text annot 2023-10-09 16:08:06 +03:00
e848a63587 Merge pull request #1302 from ONLYOFFICE/fix/v7.5.0-fix-bugs
Fix/v7.5.0 fix bugs
2023-10-09 15:33:03 +03:00
de1204db14 fix bug #64398 2023-10-09 15:26:07 +03:00
33bb7f4dc6 Merge pull request #1301 from ONLYOFFICE/fix/bug64277-xlsb
fix bug #64277
2023-10-09 14:29:01 +03:00
8dea4fbf05 fix bug #64277 2023-10-09 15:53:19 +06:00
e549301b52 fix bug #64546 2023-10-09 11:05:13 +03:00
c1a31ce729 Merge branch 'release/v7.5.0' into develop 2023-10-08 21:26:07 +03:00
bed059e447 Merge pull request #1299 from ONLYOFFICE/feature/pdfSave
Feature pdf save
2023-10-08 19:23:50 +03:00
c26e66e74e Fix create new annots 2023-10-08 17:39:18 +03:00
b825aa0f3f Fix Icon, Y=H-Y, change page. Add EditAnnot 2023-10-08 17:02:28 +03:00
42bfe749f7 Fix Popup, Icon, Signature 2023-10-07 19:59:12 +03:00
07731f3883 Add support changes in pdf 2023-10-07 18:22:33 +03:00
46391f8bfd Fix EditPdf 2023-10-07 13:17:16 +03:00
c80acbd26d Fix signature 2023-10-07 11:07:29 +03:00
4692e6ef01 Fix build 2023-10-07 09:05:02 +03:00
92b43a26f5 Add CWidgetAnnot 2023-10-06 18:43:28 +03:00
86ba0915a2 For bug #61378 2023-10-06 15:25:08 +05:00
2518a8029c Merge pull request #1298 from ONLYOFFICE/fix/v7.5.0-fix-bugs
Fix/v7.5.0 fix bugs
2023-10-06 11:58:38 +03:00
97b95de08b fix bug #63925 2023-10-06 11:57:01 +03:00
a3636c7c24 fix bug #64451 2023-10-06 10:41:18 +03:00
d0947edfc1 Merge pull request #1297 from ONLYOFFICE/fix/bug64469
Fix bug #64469
2023-10-05 23:05:08 +03:00
c13b925ac5 Fix bug #64469 2023-10-05 22:42:15 +03:00
e5e8262839 First read for AddBinToPdf 2023-10-05 18:37:24 +03:00
8bb6765e4b Fix build 2023-10-05 17:50:34 +03:00
68d82e3b96 Merge pull request #1296 from ONLYOFFICE/fix/MetafileBugs
Fix metafile bugs
2023-10-05 16:46:06 +03:00
a3ec3d9ef5 Fix bug #64470 2023-10-05 16:32:16 +03:00
829c0d235c Add DeleteAnnotation 2023-10-05 15:47:44 +03:00
a1c3d4732d Fix CreationDate, Popup, DeleteAnnotation 2023-10-05 15:47:10 +03:00
1efe6bb361 Merge remote-tracking branch 'origin/fix/pdfForms' into feature/pdfSave 2023-10-05 11:18:05 +03:00
f2a5380461 Without Popup annot 2023-10-05 11:14:16 +03:00
0282e25b10 Delete new commands 2023-10-05 11:10:30 +03:00
9491c3309b Add method for save added annotations 2023-10-05 10:30:03 +03:00
aa80101cf6 fix bug #63735 2023-10-04 20:29:20 +03:00
14fff46d03 Fixed a sharp color change in the gradient 2023-10-04 20:03:14 +03:00
dd0ede1405 Remove nodiscard 2023-10-04 19:20:42 +03:00
5fe1083387 For bug #63859 2023-10-04 19:05:39 +03:00
ac9ea5b5f1 Prepare to write pdf 2023-10-04 18:48:49 +03:00
f6ea600873 Fix bug #64211 2023-10-04 15:23:15 +03:00
24920d070f For bug #61378
Fix converting tab character into text:tab tag
2023-10-04 17:19:49 +05:00
a0ca15f74b Skip list items with no text 2023-10-04 17:15:04 +05:00
46d3b94bc6 Merge branch 'develop' into feature/xlsb_write 2023-10-04 16:13:58 +06:00
994e6fac46 For bug #61378
Convert tab character into text:tab tag
2023-10-04 11:58:46 +05:00
83f280d739 fix bug #47084 2023-10-03 18:22:03 +03:00
1eae69b047 Fix rotate 2023-10-03 13:55:44 +03:00
45ed2badad fix bug #63769 2023-10-02 19:54:27 +03:00
beeab08a97 Merge pull request #1295 from ONLYOFFICE/fix/bug61604
For bug 61604
2023-10-02 18:54:51 +03:00
4b1281c53d For bug 61604 2023-10-02 18:31:11 +03:00
416ef9c03c Add table slicer conversion 2023-10-02 20:57:53 +06:00
4cb9841158 Merge pull request #1294 from ONLYOFFICE/fix/bug45334
Fix bug 45334
2023-10-02 17:57:36 +03:00
f3bbfdb022 Fix bug 45334 2023-10-02 17:15:10 +03:00
da5cad5a81 fix bug #64267 2023-10-02 17:13:42 +03:00
7ed274c3e9 Fix lines below text & size of super/sub script 2023-10-02 17:00:34 +03:00
891b740072 Fix bug #63859 2023-10-02 16:23:25 +03:00
ed37844057 fix build 2023-09-30 22:48:17 +03:00
d92d493343 Refactoring work with paths and clips in metafiles 2023-09-29 18:55:35 +03:00
5a464c217c Merge pull request #1293 from ONLYOFFICE/fix/pdfForms
Fix pdf forms
2023-09-29 18:19:42 +03:00
a844cb3874 Fix setDrawAnnotations(gFalse) 2023-09-29 18:14:18 +03:00
004af5b9cc add default column width 2023-09-29 21:04:18 +06:00
1879ea36e9 Add Rotate for PdfReader 2023-09-29 17:57:10 +03:00
2193366443 Fix pivot tables conversion 2023-09-29 20:12:31 +06:00
8997b9e01a fix bug #64412 2023-09-29 16:42:31 +03:00
9ae8b82589 Reader&Writer Caret annots 2023-09-29 16:27:38 +03:00
60c7808789 fix bug #64409 2023-09-29 15:41:43 +03:00
5c0a9fc2e2 Revert "Fix OpenOffice 2.0 list bug"
This reverts commit b71fce9d06.
2023-09-29 16:49:22 +05:00
1f51ef0a36 Merge pull request #1292 from ONLYOFFICE/feature/docbuilder-net
.NET constructor from an array for CDocBuilderValue was implemented
2023-09-29 11:51:37 +03:00
2420bef4f4 Fix negative coordinates for AP 2023-09-29 11:48:01 +03:00
231fda79f6 Merge pull request #1291 from ONLYOFFICE/fix/bug64256
Fix bug 64256
2023-09-29 11:42:34 +03:00
05c0d0b279 Rewrited test .net example 2023-09-29 12:42:04 +04:00
8d0eeff890 Added example of usage of new CValue constructor 2023-09-29 12:29:24 +04:00
b797b55000 CDocBuilderValue constructor from arrays in .net 2023-09-29 12:29:24 +04:00
4e281f55fc Added static CreateArray function to docbuilder 2023-09-29 12:29:24 +04:00
e91c5eafce Fix BE for empty border style 2023-09-29 11:14:14 +03:00
690665fa63 minor 2023-09-29 08:31:29 +03:00
06122b70ee Fix bug 64256 2023-09-29 08:12:18 +03:00
3ce03846e7 try read config 2023-09-29 07:49:00 +03:00
b71fce9d06 Fix OpenOffice 2.0 list bug 2023-09-29 00:08:53 +05:00
6f03b59e70 fix bug #63063 2023-09-28 17:42:49 +03:00
6e9fe42407 Fix for local files 2023-09-28 16:05:39 +03:00
60a13719e7 [android] Update AGP, kotlin, compose. Migrate dagger kapt to ksp. Update dependencies 2023-09-28 13:06:10 +03:00
23c93145b1 Fix pivot table stream writing 2023-09-28 13:32:10 +06:00
01bd1a2947 Fix build 2023-09-27 21:23:05 +03:00
9ee50b8949 Add script for deploy to sdkjs 2023-09-27 18:14:36 +03:00
14d3176fd3 Merge pull request #1290 from ONLYOFFICE/fix/pdfForms
Fix pdf forms
2023-09-27 17:50:54 +03:00
3d8782e616 Fix NM field for pdf annot Writer 2023-09-27 17:43:55 +03:00
e322c6585d Writer FreeText annots 2023-09-27 16:40:28 +03:00
ca32b0823c Fix bug 64190 2023-09-27 13:59:25 +03:00
1d62dc0be7 Fix empty Action 2023-09-27 13:57:02 +03:00
77be5dd49e Fix bug 64352 2023-09-27 12:45:01 +03:00
a0108fbe10 Add method for decompile font stream to uint8array 2023-09-26 22:46:21 +03:00
66531a70d1 for bug #64340 2023-09-26 20:36:01 +03:00
23e17b5875 Merge remote-tracking branch 'origin/release/v7.5.0' into develop 2023-09-26 19:16:46 +03:00
e7f43c0b50 fix bug #64350 2023-09-26 19:13:46 +03:00
0768ba2289 Reader FreeText annots 2023-09-26 18:24:46 +03:00
d9a47c0d5a Fix scale for TilingPattern 2023-09-26 18:24:09 +03:00
40fd4c8b21 Refactoring 2023-09-26 16:47:16 +03:00
8ae967ad99 Fix build 2023-09-26 15:45:13 +03:00
4bbaa018c7 Merge remote-tracking branch 'origin/feature/oo-animation' into feature/oo-presentation 2023-09-26 14:49:17 +03:00
1ccda64166 . 2023-09-26 14:42:52 +03:00
c1ad13c2ee Revert "Merge branch 'develop' into release/v7.5.0"
This reverts commit 1002ded983, reversing
changes made to 9ef092fcc3.
2023-09-26 13:17:40 +03:00
1842d408cb Merge pull request #1289 from ONLYOFFICE/release/v7.5.0
Release/v7.5.0
2023-09-26 12:59:35 +03:00
1002ded983 Merge branch 'develop' into release/v7.5.0 2023-09-26 12:59:12 +03:00
9ef092fcc3 Fix build 2023-09-26 10:34:41 +03:00
94d50c60b6 Fix typo 2023-09-26 10:04:37 +03:00
9eca9dacac Merge pull request #1288 from ONLYOFFICE/fix/v7.5.0-fix-bugs
Fix/v7.5.0 fix bugs
2023-09-26 10:01:33 +03:00
04917dca92 fix bug #64305 2023-09-26 10:00:49 +03:00
dcc429c264 Fix bug #62308 2023-09-25 22:48:36 +05:00
4c76f425ff Merge pull request #1287 from ONLYOFFICE/fix/pdfForms
Fix bugs 64278, 59250, 64228
2023-09-25 19:10:15 +03:00
b579bbb31e Fix tilingPatternFill 2023-09-25 18:33:44 +03:00
ae860dfd97 Fix bug 64228 2023-09-25 16:41:19 +03:00
417267a963 adding parsing of structures such as matrices, indexes 2023-09-25 16:12:50 +03:00
4b82619fdc Fix bug 59250 2023-09-25 16:03:44 +03:00
8e7b0e94c3 Merge pull request #1286 from ONLYOFFICE/fix/videoplayer
Implemented singleton for libvlc instance
2023-09-25 16:01:55 +03:00
20fb306f18 Set default verbosity to 1 for libvlc test example 2023-09-25 16:47:40 +04:00
e57f156b4c Added CVlcInstance class 2023-09-25 16:41:30 +04:00
7c088dd937 Merge pull request #1274 from ONLYOFFICE/fix/x2ttester
Add enviroment vars support
2023-09-25 14:50:27 +03:00
7a198ac6db Fix paragpraph logic
finally
2023-09-25 14:29:33 +03:00
a930749d1e Merge branch 'release/v7.5.0' of https://github.com/ONLYOFFICE/core into release/v7.5.0 2023-09-25 14:15:14 +03:00
c0defc81a7 Fix bug 64333 2023-09-25 14:14:22 +03:00
6424a6d61b TilingPattern not for Release 2023-09-25 13:26:49 +03:00
541e3d8029 For bug 64278 2023-09-25 13:23:44 +03:00
c8a379dae3 [mac] Fix build with xcode 15+ 2023-09-25 11:05:55 +03:00
b9fa020c89 Code refactoring 2023-09-25 02:11:36 +05:00
978dd76503 Implement smil:accelerate smil:decelerate odp to pptx conversion 2023-09-24 03:51:11 +05:00
340e3adb46 fix bug #64306 2023-09-23 10:38:05 +03:00
83ddf062bc Implement advanced transition type conversion 2023-09-23 02:17:54 +05:00
9eeeb141ab . 2023-09-22 07:32:09 +03:00
85c420d501 Add pivot cache records conversion 2023-09-21 22:05:22 +06:00
88963ec183 Release tilingPatternFill for PdfReader 2023-09-21 18:23:11 +03:00
6b004b035d fix bug #64275 2023-09-21 16:19:37 +03:00
b87cdeacc2 fix bug #64276
sxi - new elements
2023-09-21 13:28:43 +03:00
b06ae52a13 Merge pull request #1285 from ONLYOFFICE/fix/bug64272
Fix bug 64272
2023-09-21 12:50:49 +03:00
fc5c38c0bf Fix bug 64272 2023-09-21 12:45:23 +03:00
f031f3e303 fix bug #63874
.
2023-09-21 10:37:43 +03:00
96b9517448 Fix Ch widget have V as an array 2023-09-21 10:04:31 +03:00
9d51928b36 Delete test nativegraphics 2023-09-21 10:03:03 +03:00
e87a97b74f Fix build 2023-09-20 22:46:48 +03:00
87810bc984 Add env support for windows 2023-09-20 20:42:34 +03:00
0395e010e2 Fix for tilingPatternFill 2023-09-20 18:49:59 +03:00
8be0395bd6 Fix bug 63914 2023-09-20 15:08:02 +03:00
cc1999e803 Merge pull request #1284 from ONLYOFFICE/fix/bug49447
Fix bug 49447
2023-09-20 13:29:07 +03:00
9a8930b54e Fix spaces replaced with tabs for Fb2File 2023-09-20 13:26:55 +03:00
2da1886fd2 Fix bug 49447
Fixed duplication of footnotes for Fb2File
2023-09-20 13:23:43 +03:00
aa160bb5fd Merge pull request #1283 from ONLYOFFICE/fix/MetafileTester
Refactoring the console matafile Tester
2023-09-20 12:46:11 +03:00
46af1f43f7 Refactoring the console matafile Tester 2023-09-20 12:26:56 +03:00
0e83957554 Merge pull request #1281 from ONLYOFFICE/fix/videoplayer
Improvements to the libvlc player widget and its example
2023-09-20 12:18:57 +03:00
8e41434bc6 Added positionChanged events to vlc player widget
+ Updated libvlc player example to use only vlc widget functions
2023-09-20 12:46:52 +04:00
6a4a5cfa0d Add param for env vars 2023-09-19 22:06:14 +03:00
e474aaa429 fix & refactoring odf custom shapes 2023-09-19 18:04:43 +03:00
4ab4f74166 Add pivot cache definition conversion 2023-09-19 20:37:28 +06:00
c8fdc99777 Merge pull request #1280 from ONLYOFFICE/fix/bug64197
Fix bug 64197
2023-09-19 17:15:14 +03:00
69cf20e5e3 Fix bug 64197
Fixed character escaping in description. Also fixed is the recording of Relationships for hyperlinks located in footnotes.
2023-09-19 17:06:47 +03:00
63cb2081de Small fix of libvlc resources releasing 2023-09-19 14:18:34 +04:00
cf3c8f6383 fix bug #64091 2023-09-19 11:26:39 +03:00
0495ea681c fix bug #64189 2023-09-19 11:06:01 +03:00
432233677c Merge pull request #1279 from ONLYOFFICE/fix/SvgConversion
Fixes in svg conversion
2023-09-18 20:36:43 +03:00
c450202bd7 Merge pull request #1278 from ONLYOFFICE/feature/MetafileTest
Added a console application for the metafile conversion test
2023-09-18 20:35:40 +03:00
d97c132c36 Merge pull request #1277 from ONLYOFFICE/fix/bug64115
Fix bugs in Epub
2023-09-18 20:35:14 +03:00
9180ef65bf Fixed working with units of measurement in CSSCalculator 2023-09-18 20:10:20 +03:00
83baa789e2 Add missed space 2023-09-18 19:31:44 +03:00
7e2ce67e18 Fix bug #64201 2023-09-18 18:58:55 +03:00
4d8e81637f For bug 64200 2023-09-18 18:39:11 +03:00
ee00a0e9b0 Merge pull request #1276 from ONLYOFFICE/fix/bug49447
Fix bug 49447
2023-09-18 18:30:55 +03:00
50e4fb6b4f Fix bug 49447 2023-09-18 18:24:43 +03:00
275740cba4 For bug 64190 2023-09-18 17:45:43 +03:00
d833190a9d Add support hyphenation in desktop/server/builder 2023-09-17 18:27:42 +03:00
083191b13a Update test_odf.pro 2023-09-16 22:53:42 +05:00
0fe27d3b65 Fix bug #64115 2023-09-15 17:23:39 +03:00
adcfe31832 Add pivot tables conversion 2023-09-15 19:26:02 +06:00
be1a452a7f Merge pull request #1275 from ONLYOFFICE/fix/externalEmbed
Fixed regex parsing with `JS_DECL` in class declaration
2023-09-15 10:41:20 +03:00
af3e06a4b0 Fix get certain appearance 2023-09-15 10:36:59 +03:00
e38349e59c Fixed regex parsing with JS_DECL in class 2023-09-15 10:58:00 +04:00
74cb8e90b3 Fix typo 2023-09-15 06:39:45 +03:00
fd47f149f7 Regenerate wrappers for js engines 2023-09-14 23:11:40 +03:00
69da0f9250 odf - fix convert custom vml 2023-09-14 16:50:03 +03:00
35fbf84683 Change logic 2023-09-14 15:17:15 +03:00
b184a1700f Merge pull request #1273 from ONLYOFFICE/fix/pdfForms
Fix pdf build
2023-09-14 12:39:56 +03:00
87f49546b4 Fix build 2023-09-14 11:21:51 +03:00
d2fa55dcef fix build 2023-09-14 10:58:47 +03:00
40d77ad1c5 Fix build 2023-09-14 10:53:30 +03:00
7fafbeb07a Fix build 2023-09-14 10:36:44 +03:00
3103777fb1 Fix build 2023-09-14 10:09:20 +03:00
707d43f90d Merge pull request #1272 from ONLYOFFICE/feature/pdfForms
Feature/pdf forms
2023-09-14 01:04:20 +03:00
7c54d1258d Fix empty writer realizaion 2023-09-14 00:59:57 +03:00
c44bf8a0f6 Refactoring advanced renderer commands 2023-09-14 00:52:11 +03:00
e747134131 Delete comment 2023-09-13 17:32:54 +03:00
3ecfc82667 Fix IOfficeDrawingFile for CPdfReader 2023-09-13 16:58:36 +03:00
80a8c536e7 Added a console application for the metafile conversion test 2023-09-13 15:51:20 +03:00
adc2abc171 Fix merge 2 2023-09-13 13:28:54 +03:00
ef872204e7 Fix merge 2023-09-13 13:17:57 +03:00
74044a8247 Merge remote-tracking branch 'origin/release/v7.5.0' into feature/pdfForms
# Conflicts:
#	DesktopEditor/common/StringExt.h
#	DesktopEditor/graphics/pro/js/drawingfile.json
2023-09-13 12:10:11 +03:00
56e026a2da Fix unsigned double 2023-09-13 11:52:57 +03:00
23557ad1ea Merge pull request #1270 from ONLYOFFICE/fix/videoplayer
Updated libvlc builds with new build configuration flags
2023-09-13 10:39:25 +03:00
455b0fdc45 odf - fix cache data in chart for external tables 2023-09-12 23:06:48 +03:00
fc9abc72f2 fix bug #64128 2023-09-12 20:15:53 +03:00
8674982f52 fix bug #64089 2023-09-12 20:04:09 +03:00
0250921707 Fix build js modules 2023-09-12 18:28:20 +03:00
4c47e0e6b0 Fox bug 64115
Fix empty file because of script tag
2023-09-12 17:57:08 +03:00
476bcfed71 Refactoring and refinement of working with clips in svg-reader 2023-09-12 16:45:03 +03:00
7cee2951e8 Fix slicers conversion 2023-09-12 19:23:31 +06:00
3408e2c09a Merge pull request #1271 from ONLYOFFICE/fix/bug63831
Fix bug 63831
2023-09-12 16:13:59 +03:00
3664be0de5 Fix bug 63831 2023-09-12 16:06:13 +03:00
01c99e841f Working on improving gradient rendering in Svg-reader 2023-09-12 15:10:16 +03:00
c4f1f0a31c Fixed malfunctions in svg conversion 2023-09-12 14:55:38 +03:00
f092bee428 Fixed a bug with the work of clips in converting a metafile to svg 2023-09-12 14:54:13 +03:00
ce16e1db84 Updated win_64 build to be the same as win_32
+ Removed some plugins from `README.md`
2023-09-12 12:50:48 +04:00
51d3d5770e Fix bug #63781 2023-09-12 11:11:21 +03:00
c9a722205e Fixed bug #63807 2023-09-12 11:08:01 +03:00
905654e98e Fix signed Rect and QuadPoints 2023-09-12 10:23:24 +03:00
8a203f4851 Add slicer Cache conversion 2023-09-11 21:30:12 +06:00
dc41ee2ed9 Fix bug #63764 2023-09-11 18:21:59 +03:00
e72afe11d3 Adding tests 2023-09-11 18:14:38 +03:00
73c7478ae4 Removed libcompat.a from mac builds 2023-09-11 17:57:00 +04:00
d7b07659ff Fix bug #39980 2023-09-11 18:17:31 +05:00
4f490f0121 Rebuilt libvlc for mac_64 2023-09-11 17:08:28 +04:00
e70589f943 Fix default values for workbook definde names 2023-09-11 18:24:48 +06:00
ceaf5ad1fb Rebuilt libvlc for mac_arm64
+ Updated plugins info in README.md
2023-09-11 16:16:49 +04:00
0bccde1891 Fix bug #50186 2023-09-11 17:10:56 +05:00
d4edb26079 Fix readImage 2023-09-11 15:01:35 +03:00
4bc58a1835 Add m_mImages for HtmlFile2 2023-09-11 15:00:38 +03:00
e2bb5c4a25 Added mkv plugin to linux_64 build 2023-09-11 15:52:26 +04:00
823535bf9a Fix bug 63749 2023-09-11 14:16:35 +03:00
4755657bb7 Rebuilt libvlc win_32 build with new flags
+ Applying new patch to win_32 build.sh
2023-09-11 12:02:55 +04:00
4dfd8723f8 Applying patch for win_64 build 2023-09-11 11:02:57 +04:00
ec58f76a85 For bug #50186
Add pptx to odp animation conversion
2023-09-11 02:16:25 +05:00
be4f2dfc4d Implement animation attribute methods 2023-09-11 00:26:09 +05:00
2b7e2f241a Add animation_attlists to build 2023-09-11 00:23:48 +05:00
d6337e0eae Add animation_attlists to build 2023-09-11 00:22:45 +05:00
5cc471570b Add transform attribute name 2023-09-11 00:21:42 +05:00
66b1f038c7 Add oox to odp entrance tests 2023-09-11 00:19:54 +05:00
0a593dcdcf Fix AnimClr smil:by 2023-09-11 00:16:21 +05:00
0c55adc82a Conversion development 2023-09-10 15:19:45 +03:00
e5013a8c9a Rebuilt libvlc win_64 build with new flags
+ Added even more flags to build config
+ Updated plugins info in README.md
2023-09-09 20:02:05 +04:00
144cc5ef2d Added more flags to libVLC build configuration
+ Rebuilt linux and removed some plugins from README.md
2023-09-09 13:02:57 +04:00
49fc7bc51e Add enviroment vars support 2023-09-08 20:59:18 +03:00
6743757a94 Add slicer conversion 2023-09-08 16:35:45 +06:00
daba15e142 Fix workbook names conversion 2023-09-08 16:14:24 +06:00
02c8e36985 Merge pull request #1265 from ONLYOFFICE/fix/bug63927
Fix bug 63927
2023-09-08 12:15:20 +03:00
a120bae784 Writer Polygon, PolyLine annots 2023-09-08 11:46:35 +03:00
0eabc52e8a Added README for plugins in linux build 2023-09-08 12:08:12 +04:00
ebab6439f4 Merge pull request #1264 from ONLYOFFICE/fix/bug63778
Fix bug #63778 and acceleration of metafile conversion to svg
2023-09-07 19:00:42 +03:00
6e6229d4d2 Merge pull request #1269 from ONLYOFFICE/fix/bug64026
Fix bug #64026
2023-09-07 19:00:25 +03:00
213dcaf6ca Merge pull request #1268 from ONLYOFFICE/fix/bug63755
Fix bug #63755
2023-09-07 19:00:10 +03:00
2f50994b01 for bug #64012 2023-09-07 18:03:18 +03:00
9ae35fe594 Add default values for workbook records 2023-09-07 19:30:45 +06:00
bfaca9d414 Fix wokkbook binary type 2023-09-07 19:27:47 +06:00
8103978a55 Merge pull request #1267 from ONLYOFFICE/fix/bug63784
Fix missing gc_allowNetworkRequest
2023-09-07 15:57:15 +03:00
c0afcc18a8 Fix missing gc_allowNetworkRequest 2023-09-07 15:51:18 +03:00
f192bbcbaa Merge pull request #1266 from ONLYOFFICE/fix/bug63784
Fix bug 63784
2023-09-07 15:38:24 +03:00
29c4851a1d Add ValidExtension for HtmlFile2 2023-09-07 15:35:42 +03:00
86fef4c54f Fix bug 63784 2023-09-07 15:23:52 +03:00
5605a0b5b4 Rebuilt libvlc for linux_64 platform 2023-09-07 14:56:27 +04:00
f567f81f55 Fix build 2023-09-07 12:07:41 +03:00
7c46a8997c Fix bug #64026 2023-09-06 20:44:28 +03:00
8ec437b717 Fix bug #63755 2023-09-06 20:32:05 +03:00
e3c6135ffa Add key for processenv 2023-09-06 20:00:15 +03:00
add2c29954 Add ProcessEnv class for global process properties 2023-09-06 19:57:49 +03:00
ab079f6776 . 2023-09-06 18:45:59 +03:00
ab2eb4a19b for bug #64012 2023-09-06 18:31:10 +03:00
a417e9a38c Reader Polygon, PolyLine annots 2023-09-06 15:23:48 +03:00
1194fcb012 Fix typo 2023-09-06 15:09:17 +03:00
0c099cb4a3 Fix bug 63779 2023-09-06 15:06:48 +03:00
b4b4596657 Fix table conversion 2023-09-06 16:05:26 +06:00
5359c81335 Fix indents 2023-09-06 12:58:27 +03:00
e79d743ef3 Reformat file & add define for xp 2023-09-06 11:50:13 +03:00
4498c5a60f Remove double binary file writing 2023-09-05 22:19:51 +06:00
eb5d2089a8 For bug 63927 2023-09-05 18:39:48 +03:00
f27492c2c5 Fix build drawingfile 2023-09-05 18:39:14 +03:00
440897ac3f Fix action type for pdf annots 2023-09-05 16:29:53 +03:00
f456f18983 Fix minimization bug 2023-09-05 13:19:17 +03:00
29f4ef2b6a Add stroke color convetsion 2023-09-04 19:15:29 +03:00
17ec4bb463 Fix bug
Add stroke, strokeColor to smil:attributeName odf type
2023-09-04 19:14:29 +03:00
cf4e339a33 Fix bug
Add AnimScale to TimeNodeBase conversion
2023-09-04 19:13:53 +03:00
95cb21e63d Acceleration of metafile conversion to svg and refactoring 2023-09-04 18:43:46 +03:00
268ce153c9 Fix build files 2023-09-04 15:36:23 +03:00
79077202ef fix bug #63969 2023-09-04 13:31:57 +03:00
c78d742b6f Additions to working with clips in converting a metafile to svg 2023-09-04 12:31:02 +03:00
87735da5d9 Merge remote-tracking branch 'origin/release/v7.5.0' into develop 2023-09-04 10:29:04 +03:00
9e009cc0f8 Revision of reading brackets. Conversion development. 2023-09-02 10:11:57 +03:00
ec97ccaaeb Fix fonts module 2023-09-01 21:10:48 +03:00
ef6787d5d8 Fix bug #63778 2023-09-01 19:41:09 +03:00
3ee2130e1d Merge branch 'feature/hyphen' into release/v7.5.0 2023-09-01 19:24:38 +03:00
a4468e3775 Add flag for disable xml engine 2023-09-01 19:17:37 +03:00
7dc8a4bb9b Fix bug
dropcaps fix
2023-09-01 18:52:29 +03:00
b6f11208c9 Add table writing 2023-09-01 21:24:56 +06:00
d4f4d2b29e Fix "randombar" transition filter conversion 2023-09-01 17:36:02 +03:00
5dcc05611c Fix typo 2023-09-01 17:34:45 +03:00
dc80e021a3 Merge pull request #1262 from ONLYOFFICE/hotfix/v7.4.2
Hotfix/v7.4.2
2023-09-01 16:21:26 +03:00
a37b2cfbd9 For bug 59036 2023-09-01 16:16:37 +03:00
ac54723746 fix bug #63935 2023-09-01 14:09:52 +03:00
a1e3852283 Fix typo 2023-08-31 23:42:52 +03:00
26f2fbb582 Merge branch 'release/v7.5.0' into develop 2023-08-31 21:16:00 +03:00
babbb67881 Square, Circle annots 2023-08-31 18:02:39 +03:00
dd532eb823 Add table conversion 2023-08-31 17:21:58 +06:00
5354f99677 fix & update ods filters/sort 2023-08-31 11:19:28 +03:00
bd99a2e2b2 Merge pull request #1259 from ONLYOFFICE/fix/bug63891
Fix bug #63891
2023-08-30 21:46:50 +03:00
6eecc91192 Fix bug #63891 2023-08-30 21:41:07 +03:00
0142a86c6d Merge pull request #1255 from ONLYOFFICE/feature/vsdx
[x2t] Add AVS_OFFICESTUDIO_FILE_DRAW_VSDX filetype and vsdx->vsdx con…
2023-08-30 18:49:30 +03:00
f26e91aa16 Merge pull request #1258 from ONLYOFFICE/fix/bug63617
Fix bug #63617 and refactoring
2023-08-30 18:27:33 +03:00
4c5fa9b924 fix bug #63762 2023-08-30 17:47:08 +03:00
64cd058a43 Refactoring 2023-08-30 15:46:47 +03:00
890bc3b85b Refactoring 2023-08-30 15:37:55 +03:00
86a51d6f98 Fix QuadPoints for Text Markup annots 2023-08-30 14:42:36 +03:00
0b1873866e remove extra allocations 2023-08-30 13:27:36 +03:00
edb5dfea27 Merge pull request #1256 from ONLYOFFICE/fix/bug63718
Fix bug #63718
2023-08-30 12:29:43 +03:00
3c140e505a Fix bug #63718 2023-08-30 12:09:22 +03:00
e11e314b22 Update drop caps
drop caps is shapes now
2023-08-29 22:51:37 +03:00
797dbc02d5 Convert anim:animateTransform 2023-08-29 22:43:46 +03:00
345ce701ae Add libo motionpath preset ids 2023-08-29 22:43:02 +03:00
ed2d89e907 fix bug #63868 2023-08-29 19:18:54 +03:00
6a1897d342 Fix book views conversion 2023-08-29 18:19:30 +06:00
53bb025ac7 Convert OOX animations to ODF 2023-08-29 02:26:08 +03:00
ff2196dbec . 2023-08-28 20:01:40 +03:00
e4d3e6357b fix Hyphenation in binary 2023-08-28 19:49:13 +03:00
f05c77a218 Fix password for pdf 2023-08-28 14:34:50 +03:00
cd64b42c03 Fixes for fonts module 2023-08-28 12:33:49 +03:00
31f9c44689 [x2t] Add AVS_OFFICESTUDIO_FILE_DRAW_VSDX filetype and vsdx->vsdx conversion with apply_changes 2023-08-26 14:57:16 +03:00
f94f196efb Convert animation attribs 2023-08-25 20:23:10 +03:00
5ac9df5d89 Improvement of functionality (brackets, scalable brackets, attributes) 2023-08-25 18:28:53 +03:00
e2143e170a Fix sheet format pr conversion 2023-08-25 20:30:42 +06:00
b844027144 fix bug #53042 2023-08-25 16:53:51 +03:00
fa785c0b6b Highlight, Underline, Squiggly, StrikeOut annots 2023-08-25 15:23:13 +03:00
30345dd213 Add zlib (with images) module to fonts module 2023-08-25 14:33:07 +03:00
8a02c684f4 Fix characters 2023-08-25 14:11:18 +06:00
e02064e0e7 Convert par and seq tags with attributes 2023-08-25 01:29:38 +03:00
8adc809521 Match annotations in end of page 2023-08-24 17:33:06 +03:00
a38a0c302d Fix sheet view conversion 2023-08-24 20:06:32 +06:00
b3f27b4f19 Fix bug #63617 2023-08-24 12:08:48 +03:00
bb18b8fad8 Developing an annotation writer in PdfWriter 2023-08-24 11:45:07 +03:00
e6674ca546 Fixes from updated engine.js 2023-08-23 22:33:28 +03:00
b88b7db389 Add module for hyphenation 2023-08-23 22:11:00 +03:00
568582f2b5 Add default values for xlsb conversion 2023-08-23 20:37:30 +06:00
4a631bb00a fix bug #62851 2023-08-23 17:09:17 +03:00
fb4d3bb82c fix bug #63770 2023-08-23 16:21:03 +03:00
223055d0a5 fix bug #63750 2023-08-23 12:18:08 +03:00
b3a5ad58a7 fix pdf-> non_auto 2023-08-23 11:58:29 +03:00
1a95501cbb Refactoring hyphen module 2023-08-22 20:47:34 +03:00
e748918821 odf gradient extended 2023-08-22 18:14:57 +03:00
60b7fabad9 Fix shared strings conversion 2023-08-22 20:24:45 +06:00
c5987335fd Merge branch 'develop' into feature/oo-animation 2023-08-22 16:37:03 +03:00
629c679ee1 Ad support docxf/oform to docbuilder class 2023-08-22 15:48:05 +03:00
83ce3dbb90 Update windows project files 2023-08-22 15:36:10 +03:00
a85caec975 Fix DNS and email in NID_subject_alt_name openssl 2023-08-22 15:13:59 +03:00
d37e178c0c Developing 2023-08-22 14:52:11 +03:00
14e78b8a93 Add shared strings writing 2023-08-22 17:37:33 +06:00
45767a407d Add motion conversion tests 2023-08-22 01:35:49 +03:00
a48e560b5b Rename test file 2023-08-22 01:35:22 +03:00
744e97295a Add "end" command to svg path 2023-08-22 01:34:29 +03:00
cac6536b71 fix bug #62515 2023-08-21 22:35:49 +03:00
65ffbda373 . 2023-08-21 19:18:44 +03:00
60797121d2 Add shared strings conversion 2023-08-21 22:01:47 +06:00
db59e3e338 Fix slide animation conversion 2023-08-21 18:23:47 +03:00
bdba9b75fa Fix generate extension for cert 2023-08-21 18:04:32 +03:00
a4b7c81280 Merge pull request #1253 from ONLYOFFICE/fix/videoplayer
Fixed mouse events for videoplayer
2023-08-21 11:12:39 +03:00
705eeaa379 Merge pull request #1254 from ONLYOFFICE/release/v7.5.0
Release/v7.5.0
2023-08-21 11:08:04 +03:00
1305bcef52 Move entrance tests to its own file 2023-08-20 22:09:01 +03:00
036e02f8d7 Test each attribute separately 2023-08-20 20:19:28 +03:00
aa9ff37320 Development of algorithms 2023-08-18 19:44:42 +03:00
748f7d0a72 Removed default input handlers from vlc player 2023-08-18 20:11:42 +04:00
7668a96ef8 Add Odf2Oox conversion tests
Odp to pptx conversion enterence tests
2023-08-18 18:23:15 +03:00
344d973374 Update OdfFormat test build file 2023-08-18 18:20:01 +03:00
ec4f13d5fb Update linux build files 2023-08-18 18:18:21 +03:00
d5dcce1f54 Remove redundant test file 2023-08-18 18:13:22 +03:00
0e608bc8a6 Merge pull request #1252 from ONLYOFFICE/feature/libvlc
Feature/libvlc
2023-08-18 17:01:00 +05:00
d568b7956c Refactoring 2023-08-18 14:51:03 +03:00
40f4a6e45b small fix for building on linux 2023-08-18 15:24:08 +04:00
61ab65058d fix xml like sheet 2023-08-18 14:22:39 +03:00
e9dc0d4c2c Fix worksheet conversion 2023-08-18 16:25:17 +06:00
f21d337c41 Refactoring 2023-08-18 11:01:15 +03:00
9675286d54 Merge pull request #1251 from ONLYOFFICE/release/v7.5.0
Release/v7.5.0
2023-08-18 12:43:19 +05:00
5f1cf58692 Fix bug 63699 2023-08-17 23:16:59 +03:00
46f1196090 . 2023-08-17 20:09:07 +03:00
b3340fcc95 . 2023-08-17 20:06:57 +03:00
91714a6644 . 2023-08-17 19:11:09 +03:00
9a76c1947d . 2023-08-17 19:08:53 +03:00
17067b9d35 . 2023-08-17 19:05:07 +03:00
5a208494ea Development ctAnnotField 2023-08-17 17:35:58 +03:00
9cf0528e75 fix bug #63704 2023-08-17 17:30:48 +03:00
095d82a780 Add seq animation default attributes
Only in PowerPoint these attributes are not applied by default
2023-08-17 14:57:34 +03:00
b741954d14 Reserve id = 1 for p:nvGrpSpPr 2023-08-17 14:23:56 +03:00
6aae88e521 Merge branch 'release/v7.5.0' into feature/docx_renderer2 2023-08-17 11:09:18 +03:00
cc9c219d62 Fix fonts conversion defaults 2023-08-17 13:43:20 +06:00
c0fd800149 Merge pull request #1247 from ONLYOFFICE/fix/x2ttester
Fix bug 63562
2023-08-17 12:39:03 +05:00
3568ce5e84 Fixed some issues with libvlc player 2023-08-16 19:31:45 +04:00
82d4fa068f Remove reduntant include 2023-08-16 18:19:33 +03:00
4a6b0f1b56 Implement smil:fill odf type 2023-08-16 18:19:14 +03:00
d93934a2d4 Fix xfs conversion 2023-08-16 19:38:18 +06:00
f127e316f1 ECDSA with SHA512 openssl for PdfWriter 2023-08-16 14:45:55 +03:00
0eb442dceb Fix bug 63609 2023-08-16 13:48:43 +03:00
5a52de4b2e Add styles conversion 2023-08-16 16:46:44 +06:00
7de8902320 Fix test 2023-08-16 13:21:59 +03:00
01d734f157 ECDSA openssl for PdfWriter 2023-08-16 13:10:53 +03:00
a23d7864aa Add drawing ext conversion for styles 2023-08-16 15:23:10 +06:00
6737ac2122 Add dxfs converting 2023-08-16 15:21:31 +06:00
399add2545 fix bug #63682 2023-08-16 09:01:12 +03:00
f245a5b6a5 fix bug #63681 2023-08-16 08:37:42 +03:00
bc3867f281 Fix bug 63558 2023-08-15 20:56:53 +03:00
7e27726dc2 Merge branch 'release/v7.5.0' of https://github.com/ONLYOFFICE/core into release/v7.5.0 2023-08-15 18:29:42 +03:00
ab1bc5e2a9 Merge remote-tracking branch 'origin/feature/android-fix-build' into release/v7.5.0 2023-08-15 18:29:00 +03:00
68ea0b5875 Fix crash with 2+ emf inside wmf 2023-08-15 18:25:33 +03:00
512547d169 fix NID_ecdsa_with_SHA256 2023-08-15 17:13:15 +03:00
e180b49191 Add style colors conversion 2023-08-15 18:51:32 +06:00
796cd30b09 Merge pull request #1249 from ONLYOFFICE/fix/Svg_Reader
Refactoring and added support for some properties in Svg Reader
2023-08-15 14:45:07 +05:00
58d023e023 Merge pull request #1248 from ONLYOFFICE/fix/MetafileToSvg
Editing metafile conversion to svg
2023-08-15 14:44:42 +05:00
0ecf5e8eee Refactoring and added support for some properties 2023-08-15 11:28:00 +03:00
a9d4749edc Merge remote-tracking branch 'origin/release/v7.5.0' into feature/pdfForms 2023-08-15 11:26:22 +03:00
4ba077d0b1 Create fields for CAnnotFieldInfo 2023-08-15 11:22:14 +03:00
6f11dd441b Refactoring 2023-08-15 11:21:14 +03:00
5b91e643bb Fix bug #63608 2023-08-15 11:21:14 +03:00
c884f2a99d Refactoring 2023-08-15 11:21:14 +03:00
fa82a15c07 Tab refactoring 2023-08-15 11:21:14 +03:00
5006bc3349 Fixed a bug with metafiles embedded in the metafile 2023-08-15 11:21:14 +03:00
e3d5921c83 tmRoot par animation test 2023-08-15 11:03:20 +03:00
d87283e485 fix bug #57247 2023-08-15 10:48:57 +03:00
a420375411 Fix include file paths 2023-08-14 21:13:07 +06:00
5b00fc4ad4 Add Table styles conversion 2023-08-14 20:48:13 +06:00
83cb27d123 Add cell styles conversion 2023-08-14 19:26:41 +06:00
a791775acf Add cell xfs conversion 2023-08-14 19:10:03 +06:00
48e3f55411 Add cell style xfs conversion 2023-08-14 18:58:10 +06:00
77ff0a5f15 Fix bug 63609 2023-08-14 14:47:12 +03:00
15cf8de9bf Add borders conversion 2023-08-14 17:32:25 +06:00
44fb83dc3a Add Fills conversion 2023-08-14 16:07:00 +06:00
deb206fad2 Add nubFmts conversion 2023-08-14 16:06:43 +06:00
38b6a583d2 Add fonts conversion 2023-08-14 16:06:26 +06:00
e4ba29ddcd Added CVlcMedia class 2023-08-11 19:51:31 +04:00
a735af265d fix zero height cells 2023-08-11 21:39:12 +06:00
7197545541 Started development of StarMath string parser 2023-08-11 17:38:50 +03:00
32c86f6deb added formula conversion 2023-08-11 19:11:36 +06:00
b24c771a36 test animation conversion 2023-08-11 13:45:03 +03:00
b6dc29364e fix bug #62237 2023-08-11 11:36:20 +03:00
363d1d7af9 fix bug #63502 2023-08-11 11:35:49 +03:00
2968e8e303 Add DropCaps support
commented for now
2023-08-10 21:23:33 +03:00
5eb4aaa5c0 Separate class CVlcPlayer with vlc player logic 2023-08-10 20:45:18 +04:00
d6ce980b12 Add base method for sign data 2023-08-10 18:49:30 +03:00
e2289ce58d Merge pull request #1246 from ONLYOFFICE/fix/bug63540
Fix bug 63540
2023-08-10 20:25:14 +05:00
2b70cb8338 Development text annot for PdfWriter 2023-08-10 17:52:13 +03:00
e0b9117c30 Fix var for drawingfile_base.js 2023-08-10 17:51:22 +03:00
bc5ab2719c Remove unused files 2023-08-10 14:37:30 +03:00
f7ecbf8ddb added Ccell conversion 2023-08-10 15:42:33 +06:00
96da686f32 odf test project initialized 2023-08-10 12:08:20 +03:00
571e257211 fix bug #63608 2023-08-09 19:46:32 +03:00
7aebb18254 Development AddAnnotField 2023-08-09 17:39:31 +03:00
195f54567b [Test] Update tests 2023-08-09 17:06:03 +03:00
14493b4fcb connector glue points conversion bug fixed 2023-08-09 15:41:59 +03:00
80fc9dbb05 elements parsing changed 2023-08-09 15:41:08 +03:00
fc4fadd4a6 fix bug #62851 2023-08-08 19:35:41 +03:00
4864a3c303 fix bug #62763 2023-08-08 18:20:54 +03:00
0634a1bf2a Create CAnnotFieldInfo, Change inheritance IAnnotField 2023-08-08 16:53:55 +03:00
ec760c2aef for bug #56671 2023-08-08 16:17:10 +03:00
69bf4d64fb fix bug #63580 2023-08-08 15:36:05 +03:00
4ebbfad654 Fix spacing in different cconts 2023-08-08 12:05:01 +03:00
6e3804df33 fix bug #63536 2023-08-08 10:56:36 +03:00
fd81de66bf corrected file types 2023-08-08 13:55:00 +06:00
6afb01da00 ParagraphStyle Fix 2023-08-08 10:06:13 +03:00
3cef531788 connector glue point odp to pptx conversion 2023-08-07 20:30:54 +03:00
1f79847c78 added xlsb type changing 2023-08-07 22:35:15 +06:00
7aa61809a6 corrected conversion 2023-08-07 22:33:56 +06:00
b5f1cfc578 Create AnnotField for MetafileToRenderer 2023-08-07 17:54:05 +03:00
19f28facf6 fix bug #63535 2023-08-07 17:50:43 +03:00
f45eee1fd6 fix bug 63540 2023-08-07 14:16:05 +03:00
a0e1760e94 fix bug #63259 2023-08-07 11:36:56 +03:00
435bd6a195 draw:connector conversion implemented 2023-08-07 01:20:58 +03:00
d57d0457dd Bug fix 2023-08-06 02:26:16 +03:00
e57b3e22fd for bug #37564 2023-08-05 17:01:36 +03:00
4c3f983cb4 Fix bug 63562 2023-08-05 16:43:44 +03:00
5db60c2581 for bug #37564 2023-08-05 11:18:22 +03:00
2bc4ccd343 for bug #37564 2023-08-05 09:40:43 +03:00
ff42774a3d added anim:formula conversion 2023-08-05 01:54:50 +03:00
944f325f2e Update cpcommon.vcxproj 2023-08-05 01:53:59 +03:00
dd4488dc69 smil:values odf type implemented 2023-08-05 01:53:28 +03:00
7eaca72d6f smil:keyTimes opf type implemented 2023-08-05 01:53:12 +03:00
ca95fab62d Merge branch 'feature/xlsb_write' of github.com:ONLYOFFICE/core into feature/xlsb_write 2023-08-04 21:54:00 +06:00
3f75431018 started sheet data conversion 2023-08-04 21:49:02 +06:00
9cfb0ee82a addede worksheet writing 2023-08-04 20:59:20 +06:00
bcc465396c Create Line for PdfAnnot 2023-08-04 17:02:45 +03:00
eef5b9b9cc . 2023-08-04 12:08:47 +03:00
dc95b8a92c . 2023-08-04 12:04:07 +03:00
65675e2c54 . 2023-08-04 11:52:15 +03:00
7304553448 fix bug #63551 2023-08-03 17:31:50 +03:00
e6ed8d096e Create Ink for PdfAnnot
Fix read empty AP
2023-08-03 16:36:44 +03:00
6a26c78816 . 2023-08-03 15:12:20 +03:00
d38694d94a Merge remote-tracking branch 'origin/release/v7.5.0' into feature/xlsb_write 2023-08-03 14:53:33 +03:00
fe4e668973 ExternalReference for chart 2023-08-03 14:50:49 +03:00
211647cd16 Fix Actions from PdfAnnot 2023-08-03 13:18:50 +03:00
72c5fcfe1a svg path conversion format changed 2023-08-03 14:43:06 +05:00
74e99d964d Update pptx_slide_context.cpp 2023-08-03 14:42:28 +05:00
2611973bc3 seq animation attributes serrialization changed 2023-08-03 14:42:06 +05:00
bd8589e586 fix bug #63506 2023-08-02 21:38:06 +03:00
fb228b0481 libvlc: automatic plugins.dat generation on mac 2023-08-02 19:06:13 +04:00
a1fdb2de00 fix tabs for PdfFile 2023-08-02 17:54:23 +03:00
f5773119b5 Create GetAnnotationsAP for PdfAnnot 2023-08-02 17:49:06 +03:00
1a0f88547f libvlc: cache fix for mac_arm64 2023-08-02 17:42:46 +04:00
dfd48c57d5 libvlc: cache fix for mac_64 2023-08-02 17:42:46 +04:00
d29b90c636 libvlc: Rebuild linux_64 with ignoring cache time
+ Form build outside of docker container
2023-08-02 16:44:32 +04:00
d358f2eb5f added conversion attributes check 2023-08-02 14:46:55 +06:00
58f886e398 animColor dim attribute name implemented 2023-08-02 05:37:34 +05:00
e84f0ad50f reduntant space bug fixed 2023-08-02 04:19:07 +05:00
c840748483 Text Annot to WASM, create Popup annots for PDF 2023-08-01 18:36:25 +03:00
790a41cb04 . 2023-08-01 15:45:23 +03:00
a742ca9a2d libvlc: Rebuild win_32 with ignoring cache time 2023-08-01 15:51:33 +04:00
eab9825d98 libvlc: Rebuild win_64 with ingoring cache time 2023-07-31 20:51:22 +04:00
f2c439d8bc create Markup annots for pdf 2023-07-31 18:10:46 +03:00
2a298710a7 Fix build on new linux systems 2023-07-31 14:35:20 +03:00
83fc19672d Merge branch hotfix/v7.4.1 into master 2023-07-31 07:22:04 +00:00
18662c1a6c Bug fix 2023-07-28 22:31:01 +05:00
26cea78ada try ETSI.CAdES.detached 2023-07-28 17:54:45 +03:00
c9b4550fb9 presentation:node-type odf_type implemented, anim:seq animation fixed 2023-07-28 18:38:35 +05:00
13367a03fe Merge remote-tracking branch 'origin/develop' into feature/pdfForms 2023-07-28 12:33:10 +03:00
314dc0e212 fix build 2023-07-28 12:32:46 +03:00
3217ac7d51 Add method for cert&key generation 2023-07-28 12:09:51 +03:00
e2db126b66 fixed build for mac_arm64 2023-07-28 12:46:58 +04:00
7118da40a2 Fix bug
reload fonts
2023-07-28 11:36:33 +03:00
c2748fcff4 Add check buffer size for password generation 2023-07-27 18:14:06 +03:00
dbbf0a9999 "fill" attribute name added 2023-07-27 19:28:32 +05:00
010c58f110 fix bug #58959 2023-07-27 17:27:46 +03:00
4604601125 libvlc: added mac_arm64 build 2023-07-27 18:02:52 +04:00
16f90cc5bc Merge remote-tracking branch 'origin/develop' into feature/pdfForms
# Conflicts:
#	DesktopEditor/xmlsec/src/src/Certificate_mscrypto.h
#	PdfFile/PdfFile.cpp
#	PdfFile/PdfFile.h
#	PdfFile/PdfReader.cpp
#	PdfFile/PdfReader.h
2023-07-27 16:55:09 +03:00
b6ac531040 fix 2023-07-27 16:25:20 +03:00
308187eb47 now use PDFAnnot 2023-07-27 16:04:43 +03:00
2618aa6e4e libvlc: added mac_64 build
tested on OS X 10.11
2023-07-27 16:51:36 +04:00
cbf1c9eb16 Fix builf 2023-07-27 14:56:35 +03:00
f1236fd01e . 2023-07-27 14:15:23 +03:00
ba10fb7e97 for bug #63199 2023-07-27 13:56:32 +03:00
8e2d5ee209 Fix build 2023-07-27 13:31:23 +03:00
433a0973e5 Change indents 2023-07-27 12:57:20 +03:00
3a94430a64 Fix build 2023-07-27 12:52:22 +03:00
40ca82c584 fix build 2023-07-27 11:34:07 +03:00
24b7b59af0 FIx build 2023-07-27 10:56:46 +03:00
2b494e3590 Fix indents 2023-07-26 23:21:47 +03:00
f3746f4bb8 Merge pull request #1242 from ONLYOFFICE/feature/svg_pull
Svg pull
2023-07-27 01:15:28 +05:00
9cfe99acae Add support python3+ 2023-07-26 22:33:41 +03:00
0eafab1f08 create Action and ToWasm for PdfAnnot 2023-07-26 18:35:06 +03:00
6b406945f7 for bug #63199 2023-07-26 18:10:23 +03:00
a13e245d86 Updated test.pro for libvlc
+ Restored plugins cache for windows
2023-07-26 18:45:49 +04:00
18b59bf8f8 Troubleshooting issues after merge 2023-07-26 14:37:51 +03:00
b481b0ef12 Troubleshooting issues after merge 2023-07-26 14:32:25 +03:00
48f01452ce text:p element animation implemented 2023-07-26 16:31:50 +05:00
caaf664633 Merge pull request #1241 from ONLYOFFICE/feature/svg
Pull svg
2023-07-26 13:33:09 +03:00
23167f6460 Merge branch 'feature/svg_pull' into feature/svg 2023-07-26 13:31:42 +03:00
6707cd05a9 fix htmlfile2.cpp 2023-07-26 12:35:57 +03:00
125d2e8b16 Remove unused class 2023-07-25 21:33:34 +03:00
5bf77b761d create split PDF Annots for Reader 2023-07-25 18:50:41 +03:00
85f138322d temp files deleted 2023-07-25 18:40:59 +05:00
79d830f2cf . 2023-07-25 16:02:51 +03:00
cba75df9d0 Fix ios build 2023-07-25 16:14:37 +05:00
323d92a121 Included base.pri in libvlc test example
+ Updated plugins cache for windows
+ Removed unnecessary deps.py script for Linux
2023-07-25 14:52:03 +04:00
38177a2793 Merge pull request #1239 from ONLYOFFICE/feature/office_utils
Feature/office utils
2023-07-25 15:41:20 +05:00
dd9ca63b54 Remove empty lines 2023-07-25 13:40:40 +03:00
ced55d3cde Remove unused sources 2023-07-25 13:39:02 +03:00
c72e44f44e Refactoring 2023-07-25 13:30:08 +03:00
bc00d63250 add non auto convert 2023-07-25 12:16:01 +03:00
94fd1d94bd Remove bad test 2023-07-25 11:42:27 +03:00
cb01a629bc . 2023-07-25 11:00:14 +03:00
39e4d1c8ea pdf create GetAnnotations 2023-07-24 17:50:57 +03:00
f395507825 fix pdf test 2023-07-24 17:50:37 +03:00
a738fbabef fix initialize openssl 2023-07-24 17:50:23 +03:00
9f709f96f8 rotate animation conversion implemented 2023-07-24 18:59:38 +05:00
08a1be70b0 anim:animateTrasnsform conversion implemented 2023-07-24 13:12:26 +05:00
cc307ba537 Update cpcommon.vcxproj 2023-07-24 13:11:52 +05:00
e986a66525 svg:type odf_type implemented 2023-07-24 13:10:48 +05:00
93dc58c49e . 2023-07-24 10:03:53 +03:00
fa2595612e for bug #63441 2023-07-24 09:51:17 +03:00
f10c620ddb Merge remote-tracking branch 'origin/hotfix/v7.4.1' into develop 2023-07-24 09:31:56 +03:00
b79e13ae85 bug fix 2023-07-24 01:24:09 +05:00
b113e196d4 smil:additive odf type implemented 2023-07-24 01:24:00 +05:00
3c26e50b5d for bug #62990 2023-07-23 15:42:28 +03:00
9286bd4615 Add possible fix to winrar unzipping 2023-07-23 05:06:06 +03:00
9705759618 anim:animate smil:from smil:to attributes implemented 2023-07-23 03:43:51 +05:00
0dc63d2629 smil:attributeName odf type implemented 2023-07-23 02:05:44 +05:00
2d1f53d952 Merge pull request #1238 from ONLYOFFICE/fix/v7.4.1-fix-bugs
fix bug #63443
2023-07-22 12:18:13 -04:00
5e5fb5ea6d fix bug #63443 2023-07-22 19:16:59 +03:00
34902e06cf Add test
- LoadFileFromArchive (memory)
2023-07-21 22:23:43 +03:00
1db7a6ae2a Refactoring + tests
Add new class CunzFileWrapped,
Add tests for:
- IsArchive
- IsFileExistInArchive
- LoadFileFromArchive
2023-07-21 22:20:31 +03:00
ec72a22aab Merge pull request #1237 from ONLYOFFICE/fix/bug61780
Fix bug 61780
2023-07-21 20:08:55 +05:00
6f0539df86 Fix bug 61780 2023-07-21 17:28:09 +03:00
36109d2ba8 Merge pull request #1236 from ONLYOFFICE/fix/v7.4.1-fix-bugs
fix bug #63441
2023-07-21 10:09:22 -04:00
a283d0c4ad fix bug #63441 2023-07-21 17:08:38 +03:00
1cefed92b2 Refactoring path elements in svg-reader 2023-07-21 11:47:01 +03:00
de53f09cc5 Fix Line Cap and Line Join for PDF 2023-07-21 11:35:55 +03:00
bfd2627269 Disable xml logs in release build 2023-07-20 22:37:53 +03:00
d690281b8d Fix bug with reading registry 2023-07-20 21:49:36 +03:00
b07c308e9b Fixed bugs 2023-07-20 19:32:05 +03:00
739a1d2a35 Refactoring 2023-07-20 17:28:37 +03:00
1e2964ccbe Fix bug
release obj
2023-07-20 17:20:36 +03:00
b445369410 Add more tests
Unzip file from memory
2023-07-20 17:08:50 +03:00
57cc43371c for bug #63199 2023-07-20 17:02:02 +03:00
de826c1f0f Add UnzipToDir from memory 2023-07-20 16:55:43 +03:00
e74b75a087 Fix bug 62990 2023-07-20 13:12:55 +03:00
3dc29f27de fix PDFCoordsToMM for put_PenMiterLimit 2023-07-20 13:12:23 +03:00
15730ae7de Fix bug MitirLimit in PDF 2023-07-20 12:57:59 +03:00
dc47903ceb fix CA and without annots 2023-07-20 12:55:31 +03:00
c0ffc1dd0f . 2023-07-20 09:58:39 +03:00
c1a6b85431 back to Transitional Migration Features 2023-07-19 22:55:44 +03:00
b29d5ea566 Update drawing_object_description.h 2023-07-20 00:48:41 +05:00
9920a53007 animation id resolving implemented 2023-07-20 00:45:25 +05:00
a8978265ea Use winapi function instead ostream 2023-07-19 21:48:22 +03:00
a714f0626c libvlc: added dockerfile for linux building 2023-07-19 17:13:17 +04:00
7ec41517e1 for bug #63394 2023-07-19 16:01:06 +03:00
43880f909a fixx bug #52210 2023-07-19 11:42:34 +03:00
a871e0be8c fix border bug 2023-07-18 17:08:26 +03:00
24d1a9b220 Add more tests 2023-07-18 16:00:42 +03:00
ebc81eb7d3 Add tests 2023-07-18 15:34:05 +03:00
ff5bb009b3 fix 2023-07-18 14:42:42 +03:00
529acfbd5f Refactoring 2023-07-18 10:55:09 +03:00
55e171f86e Merge pull request #1235 from ONLYOFFICE/fix/office_utils2
Fix/office utils2
2023-07-18 01:57:11 +05:00
d7254e46c9 Add support unicode names 2023-07-17 23:55:49 +03:00
633041d07f Remove unised code 2023-07-17 23:09:55 +03:00
d782ebf6c5 libvlc: dependencies installation fix 2023-07-17 21:49:40 +04:00
d0afc0fdc0 Merge pull request #1234 from ONLYOFFICE/hotfix/v7.4.1
Fix NormalizePath method
2023-07-17 22:19:09 +05:00
f1b4b2ac29 Fix NormalizePath method 2023-07-17 20:13:55 +03:00
80665983a8 libvlc: Made deps.py executable 2023-07-17 20:35:29 +04:00
8661656ae8 fixed incompatible line endings 2023-07-17 20:32:32 +04:00
a6b590be74 Fix check paths 2023-07-17 18:45:17 +03:00
76f64547a3 Fix create directories bug 2023-07-17 18:29:52 +03:00
db3d12af5b libvlc: added dependencies installation script 2023-07-17 19:28:20 +04:00
0a56b4348f Fix folders creation 2023-07-17 18:07:57 +03:00
f0130f92dc Added support for record <a> to svg-reader's 2023-07-17 17:50:47 +03:00
1aa1d63f61 Refactoring 2023-07-17 16:03:01 +03:00
efa6115a34 +dataDisplayOptions16 2023-07-17 14:24:56 +03:00
9d33b7403b delete hidden, print, noView 2023-07-17 13:28:27 +03:00
3ffd8f5752 change pdf const for API 2023-07-17 13:09:24 +03:00
26f344ab99 Refactoring 2023-07-17 12:54:39 +03:00
8bc6c5abb7 Merge pull request #1233 from ONLYOFFICE/develop
Develop
2023-07-17 13:29:42 +05:00
a65183616f Fix check files in test 2023-07-17 10:40:12 +03:00
03335551b6 Clear fonts cache & font streams on each convertaion 2023-07-17 10:35:47 +03:00
2c294d5be6 Fix freeze on destroy 2023-07-16 01:24:40 +05:00
bbfb8553b1 Merge pull request #1232 from ONLYOFFICE/hotfix/v7.4.1
Hotfix/v7.4.1
2023-07-16 01:07:08 +05:00
d11b0c814e Fix bug 63166 2023-07-16 01:06:36 +05:00
1dba84f407 Add GetUrl method to DownloadTask 2023-07-15 22:59:27 +05:00
c6de6cd26a libvlc: added build for linux_64 2023-07-15 18:43:33 +04:00
2a84964f3c Fix download manager 2023-07-15 04:29:46 +05:00
781338fb1e Sets Gid to 0 2023-07-14 18:17:22 +03:00
b792f98dea added workbook conversion 2023-07-14 19:45:12 +06:00
537e7aa9f5 added drawing ext conversion of workbook 2023-07-14 19:44:43 +06:00
281d9abd8f added file sharing conversion 2023-07-14 18:49:04 +06:00
5398d4598b added external references conversion 2023-07-14 18:05:55 +06:00
ff6bcdbe0d fix bug #63352 2023-07-14 13:52:21 +03:00
0d9d8fad80 Fix bug 63357 2023-07-14 15:25:24 +05:00
29bdbb8898 fix image in header/footer sheets 2023-07-14 12:17:35 +03:00
8f8d9050fa Fix android build 2023-07-14 13:34:13 +05:00
988d41bee5 Merge pull request #1231 from ONLYOFFICE/hotfix/v7.4.1
Fix bug 63357
2023-07-14 13:22:39 +05:00
9a242f16b7 test files deleted 2023-07-13 21:07:41 +05:00
ae530c614a preset-class, preset-id odf types implemented 2023-07-13 21:04:54 +05:00
18cc4c74a6 fix previus refact binary 2023-07-13 18:14:45 +03:00
23dee6d7ef added workbook protection conversion 2023-07-13 20:42:42 +06:00
588040c7ee fix bug #63211 2023-07-13 16:51:50 +03:00
6146180408 . 2023-07-13 16:24:13 +03:00
a707eddabc fix bug #63269 2023-07-13 16:06:36 +03:00
092df2d20e Fix bug 63357 2023-07-13 15:49:11 +03:00
368fdbec18 added workbookPr conversion 2023-07-13 18:30:38 +06:00
f6e6e22401 added sheets conversion 2023-07-13 17:01:00 +06:00
c4e9d3ce66 S, SW, Type not string 2023-07-13 13:06:39 +03:00
a0262cf5f9 added defined names conversion 2023-07-13 15:34:44 +06:00
367b2c5317 Refactoring 2023-07-13 11:46:44 +03:00
54a85f17fb added calcPr conversion 2023-07-13 14:45:36 +06:00
4d0f156452 Fix build 2023-07-13 04:03:36 +05:00
f8ad0484e7 Remove test code 2023-07-13 01:02:07 +03:00
bf19d59626 Merge pull request #1230 from ONLYOFFICE/feature/osign_library
Feature/osign library
2023-07-13 00:08:42 +03:00
20ec85f92f Full version 2023-07-13 00:07:28 +03:00
c0d6375bb4 Fix merge bug 2023-07-12 22:46:06 +05:00
507b86f6a2 Add tests for osign library 2023-07-12 19:49:50 +03:00
21d883e083 added book views conversion 2023-07-12 21:55:13 +06:00
6191c1798b Revert "Merge branch 'feature/xml_writer' of https://github.com/ONLYOFFICE/core into develop"
This reverts commit fe9284ebb2, reversing
changes made to 25ddb5d8d1.
2023-07-12 18:45:36 +03:00
fe9284ebb2 Merge branch 'feature/xml_writer' of https://github.com/ONLYOFFICE/core into develop 2023-07-12 18:43:24 +03:00
c4fe64423c Calc width in selected font 2023-07-12 17:19:43 +03:00
cae0e85363 Merge pull request #1229 from ONLYOFFICE/develop
Develop
2023-07-12 17:19:36 +03:00
25ddb5d8d1 Merge branch 'hotfix/v7.4.1' into develop 2023-07-12 17:16:26 +03:00
96208a1c54 Fix bug 59649 2023-07-12 16:33:42 +03:00
1864a6d0c0 added worksheet conversion 2023-07-12 18:08:56 +06:00
81031ce22b highlight & type of action not string 2023-07-12 15:08:41 +03:00
bc7bbb94aa added extension list conversion 2023-07-12 18:08:02 +06:00
d47bd4a0ae Merge pull request #1227 from ONLYOFFICE/fix/v7.4.1-fix-bugs
for bug #63315
2023-07-12 07:43:01 -04:00
b626b23794 for bug #63315 2023-07-12 14:41:59 +03:00
0c6a72df99 Fix bug with left sort
+ Changed consts space width
2023-07-12 13:31:35 +03:00
841ff873a7 Merge pull request #1226 from ONLYOFFICE/fix/v7.4.1-fix-bugs
fix bug #61780
2023-07-12 03:57:47 -04:00
9614b81aa4 fix bug #61780 2023-07-12 10:55:51 +03:00
0e1a1ca586 Refactoring 2023-07-11 21:49:10 +03:00
f7cb1e0716 Add TestBuffer 2023-07-11 18:57:01 +03:00
e1743bcc58 try verify cert with openssl 2023-07-11 17:58:33 +03:00
e354b3b3d5 Fixed bugs 2023-07-11 17:37:34 +03:00
321c36baf3 Merge remote-tracking branch 'origin/develop' into feature/pdfForms 2023-07-11 15:57:35 +03:00
42bbf6a487 Merge pull request #1225 from ONLYOFFICE/fix/docbuilder
Fix bugs with builderJS object
2023-07-10 22:57:19 +03:00
4973b92435 Fix bugs with builderJS object 2023-07-10 22:55:44 +03:00
e99eb7cc81 Merge pull request #1224 from ONLYOFFICE/fix/v7.4.1-fix-bugs
fix bug #63315
2023-07-10 15:44:29 -04:00
4beedf8e03 fix bug #63315 2023-07-10 22:43:44 +03:00
4bea49ed5a animClr, presetID implemented 2023-07-11 00:43:02 +05:00
49cdde75b3 Fixed bugs 2023-07-10 21:11:41 +03:00
22972aad5b . 2023-07-10 19:00:46 +03:00
e2932091e8 added conditional formatting conversion 2023-07-10 21:49:44 +06:00
4ab6bded11 anim:animate -> p:anim conversion implemented 2023-07-10 18:03:44 +05:00
822a488f0c . 2023-07-10 14:57:02 +03:00
1e86a93229 . 2023-07-10 14:45:49 +03:00
2e8820e81c xls/xlsb lib refactoring 2023-07-10 14:18:33 +03:00
b0721b2c16 Rename param for x2t & remove src dependency for library (paragraph) 2023-07-09 21:35:44 +03:00
9602c52fae Merge branch 'develop' into feature/docx_renderer2 2023-07-09 21:19:50 +03:00
410db159e4 Merge pull request #1219 from ONLYOFFICE/feature/externalEmbed3
Feature/external embed3
2023-07-09 17:09:04 +03:00
08f6b4c77e Remove unused files and move base to core-ext 2023-07-09 17:04:37 +05:00
18c7bd3375 animEffect implemented 2023-07-09 04:08:03 +05:00
0f98321581 Bug fix 2023-07-09 04:06:10 +05:00
afae625458 Bug fix 2023-07-09 04:05:17 +05:00
5c5f5eb7e2 libvlc: added build for win64 and win32 2023-07-08 22:16:16 +04:00
0b31bc5dc9 Fix build 2023-07-08 18:28:39 +05:00
5d888e64b0 Merge pull request #1218 from ONLYOFFICE/develop
Develop
2023-07-08 13:40:58 +03:00
a55f4b91bc Fix typo 2023-07-08 11:52:01 +03:00
f6f9c522ed Fix typos 2023-07-08 13:50:30 +05:00
2bb2890f73 libvlc: added in /core/Common/3dParty 2023-07-07 21:27:30 +04:00
e111445699 Refactoring 2023-07-07 22:13:04 +05:00
3ca59f7775 Refacroring 2023-07-07 20:10:08 +03:00
35cec4cbd8 added data validation conversion 2023-07-07 21:01:31 +06:00
daa80a1662 fix SaveToFile when not create CPdfFile 2023-07-07 17:35:41 +03:00
f8dc7e2197 Fix bug 63267
fix WriteEncodeXmlString for attribute, fix m_bInP & m_bInTable, implementation m_oDocXmlRels for external referenses
2023-07-07 17:33:54 +03:00
69e5dd8cdf added ProtectedRange conversion 2023-07-07 19:54:52 +06:00
dac999e9e6 Clearing cache after document, not page
more optimization
no error if convert wasnt called
2023-07-07 13:48:58 +03:00
8b3fdbe50a Added support for the stroke-miterlimit argument 2023-07-07 11:40:33 +03:00
5ae7d4f5cb Add session interface for downoad/upload engine 2023-07-07 01:40:43 +03:00
ae185f6cd3 added data consolifate conversion 2023-07-06 21:10:34 +06:00
e779cb0b4d Fix bug 49447
implementation html & epub footnote
2023-07-06 17:05:41 +03:00
60c8623980 Fixed bug 2023-07-06 16:35:06 +03:00
6ace3e2e80 Merge pull request #1217 from ONLYOFFICE/fix/v7.4.1-fix-bugs
fix bug #63282
2023-07-06 14:48:37 +03:00
1baf789bb5 fix bug #63282 2023-07-06 14:47:49 +03:00
df147106b3 added breaks conversion 2023-07-06 16:12:49 +06:00
b52e28294f implementation Fb2 footnote 2023-07-06 13:02:32 +03:00
f70718822b added picture worksheet conversion 2023-07-06 15:31:33 +06:00
9c119635da added cheetpr conversion 2023-07-06 15:15:00 +06:00
7fb9fbd2ce . 2023-07-06 10:27:29 +03:00
55d09d1b45 Add allocator methods to export 2023-07-06 00:05:52 +03:00
3a08a4527f Multiple slides animation implemented 2023-07-06 01:27:44 +05:00
2fac19bbb8 Add export for defaults 2023-07-05 22:16:39 +03:00
c495089022 added controls conversion 2023-07-05 21:31:25 +06:00
cc11daedda create readFootnotes 2023-07-05 17:53:34 +03:00
8c43dbc8b9 Refactoring 2023-07-05 16:54:10 +03:00
a1ac26ada9 added ole objects convertation 2023-07-05 19:48:11 +06:00
0732e26b1f Par animation attributes conversion implemented 2023-07-05 17:14:06 +05:00
ef81980755 Fb2 update For bug 49447 2023-07-05 15:07:36 +03:00
1915846291 odf math 2023-07-05 11:47:14 +03:00
da3edc4ba5 Merge pull request #1216 from ONLYOFFICE/develop
Develop
2023-07-05 10:42:31 +03:00
44c58e9566 . 2023-07-04 16:39:10 +03:00
1e7d4586b3 Removed unused gradient-related methods 2023-07-04 13:50:59 +03:00
5318dc1238 Refactoring 2023-07-04 13:18:12 +03:00
927585ad86 Refactoring 2023-07-04 12:25:53 +03:00
77efe21913 To the previous commit 2023-07-04 10:58:42 +03:00
cf88f807cd Added restriction on plug-in files from CssCalculator 2023-07-04 10:56:03 +03:00
b6d108dd01 Fixed bugs 2023-07-04 10:54:11 +03:00
9bd952135b par, seq, animMotion conversions implemented 2023-07-04 01:55:15 +05:00
c239040756 Merge pull request #1215 from ONLYOFFICE/fix/bug60993
Fix bug 60993
2023-07-03 17:28:58 +03:00
45a2b682e4 Merge pull request #1214 from ONLYOFFICE/fix/refactoring
Refactoring XLS
2023-07-03 16:17:04 +03:00
421c1017c2 . 2023-07-03 16:12:46 +03:00
b89d16691a Fix bug 60993 2023-07-03 16:10:52 +03:00
2ed02ddfac Fix build on xp 2023-07-03 09:41:26 +03:00
488adeb4ea Fix previous commit 2023-07-03 01:47:55 +03:00
6173c39da9 Refactoring XLS 2023-07-03 01:42:43 +03:00
1b155518c2 Less comparsions 2023-07-02 19:18:16 +03:00
e2a3e82770 Fix bug
iterator exeption
2023-07-02 18:31:27 +03:00
e42f3031f8 Add caching fontstyle
like in fontmanager
2023-07-02 18:19:07 +03:00
0a5f9070de Adds for previous commit 2023-07-02 14:17:38 +03:00
4306486c3c Refactoring 2023-07-02 13:39:49 +03:00
9788d38a69 Merge pull request #1207 from nightBulb/patch-1
Change github URL Cyrillic "es" to latin "C" in URL
2023-07-02 10:37:04 +03:00
9c7ce59ab8 Merge pull request #1212 from ONLYOFFICE/vboxtester
Vboxtester
2023-07-02 00:40:15 +03:00
e86cde33c2 Remove extra flags 2023-07-02 00:38:59 +03:00
50e0538f06 Developing 2023-07-01 00:39:13 +03:00
5e1c67b29e added table parts conversion 2023-06-30 19:31:57 +06:00
b2b628b5b7 added autofilter conversion 2023-06-30 18:55:13 +06:00
950212b23b corrected conversion 2023-06-30 18:54:39 +06:00
a3fd4e26c2 fix bug #63197 2023-06-30 13:41:45 +03:00
e78eff38ef . 2023-06-30 12:58:11 +03:00
dee93bae01 added sortstate conversion 2023-06-30 15:14:57 +06:00
88a3128b87 Added display:none support and refactoring 2023-06-30 11:27:51 +03:00
17b632844a Fixed bugs 2023-06-30 10:51:38 +03:00
571a6f897b Developing 2023-06-29 23:14:25 +03:00
8fe5139272 added protection and headerfooter conversion 2023-06-29 17:35:19 +06:00
bf6d4b00e3 Merge pull request #1211 from ONLYOFFICE/fix/bug61780
move For bug 61780
2023-06-29 13:28:13 +03:00
4a452ee47f move For bug 61780 2023-06-29 13:27:27 +03:00
2d13189051 added print options conversion 2023-06-29 16:12:31 +06:00
62b480b00c added page setup conversion 2023-06-29 16:03:29 +06:00
1e068075f4 added page margins conversion 2023-06-29 14:12:54 +06:00
d1d35b5ccb minor 2023-06-29 07:22:56 +03:00
c75527ed3b wait network loading
test
2023-06-29 06:20:24 +03:00
264bec5feb added sheet view conversion 2023-06-28 22:50:08 +06:00
8e61cd7f70 . 2023-06-28 18:48:58 +03:00
cbe7f93387 verbose log option 2023-06-28 18:47:36 +03:00
7bf8a55d25 added sheetformatpr conversion 2023-06-28 17:56:42 +06:00
4f068159d7 add merged cells conversion 2023-06-28 17:55:59 +06:00
3a46d8a909 Merge pull request #1210 from ONLYOFFICE/fix/pre7.4.1
Fix/pre7.4.1
2023-06-28 14:18:27 +03:00
f63eac7883 Merge remote-tracking branch 'origin/hotfix/v7.4.1' into develop 2023-06-28 14:13:02 +03:00
8539dc168b Merge pull request #1209 from ONLYOFFICE/fix/v7.4-fix-bugs
Fix/v7.4 fix bugs
2023-06-28 14:10:48 +03:00
1e6e6032ee fix bug #63196 2023-06-28 14:04:49 +03:00
0fb4c8f13a Fixed bugs 2023-06-28 14:02:49 +03:00
7f4236a643 change getButtonIcons 2023-06-28 13:12:13 +03:00
03df0edd54 . 2023-06-28 09:27:44 +03:00
eb8e90cd94 fix bug #62861 2023-06-27 19:34:33 +03:00
f56a6ecc85 Move precompile_header detection to base.pri 2023-06-27 18:41:56 +03:00
311c70816f added hyperlinks conversion 2023-06-27 21:22:23 +06:00
f56184505f added BrtLegacyDrawing conversion 2023-06-27 20:45:24 +06:00
a42b20a0a6 get unique XObject icon for button annots 2023-06-27 17:02:43 +03:00
d651d5166b Update copyright 2023-06-27 15:36:16 +03:00
75853c8cb3 added Cdimension conversion 2023-06-27 16:24:22 +06:00
98eb856641 add drawning conversion 2023-06-27 16:20:26 +06:00
a74bb35ecd added cols convertation 2023-06-27 16:02:49 +06:00
20f77081d7 fix bug #59708 2023-06-27 11:10:55 +03:00
f5d972573e Fix bug (tabulation)
\t symbol skipped and addded during analysis
2023-06-27 10:44:25 +03:00
42767c9748 hardcoded context animation conversion implemented 2023-06-27 01:41:02 +05:00
bc3dfa5b3f Added the ability to install an external alpha mask 2023-06-26 20:20:53 +03:00
7af5e05ea0 Refactoring the alpha mask 2023-06-26 18:35:50 +03:00
eaefe5891f optimization getButtonIcons 2023-06-26 18:33:02 +03:00
84d19cdbe4 new features
- using custom setup scripts
- run VMs using list
2023-06-26 17:45:48 +03:00
b3a0012222 fix bug #63158 2023-06-26 17:38:11 +03:00
575ef4ec54 Merge branch 'develop' of https://github.com/ONLYOFFICE/core into develop 2023-06-26 17:09:45 +03:00
699acd0516 Fix bug 60851 2023-06-26 15:11:05 +03:00
7a93ec740d Fix bug 61780 2023-06-26 12:56:29 +03:00
144ef42626 fix bug #63157 2023-06-26 11:44:29 +03:00
5e9e15be57 Refactoring verify signatures 2023-06-25 13:13:36 +03:00
f2b01ac574 Merge branch 'develop' of https://github.com/ONLYOFFICE/core into develop 2023-06-24 20:40:39 +03:00
32d2a16b2a Merge pull request #1208 from ONLYOFFICE/fix/x2ttester
Fix/x2ttester
2023-06-24 15:58:37 +03:00
e027275481 Fix bug 63073
new feature, conversion trough *t formats
2023-06-24 15:34:28 +03:00
a8e19af53c Fix bug 63072 2023-06-23 21:31:10 +03:00
3061670f2a Fix bug 62747 2023-06-23 21:30:22 +03:00
43f1d76032 testing using simple config 2023-06-23 19:30:09 +03:00
afe4cc60a5 x2ttester update 2023-06-23 19:14:02 +03:00
a63d9480e5 fix bug #56949 2023-06-23 18:00:53 +03:00
ee3d054373 completed external links converting 2023-06-23 21:00:47 +06:00
8669470692 Fix bug 2023-06-23 17:15:42 +03:00
0b46254fed Fix rescale pen bug 2023-06-23 17:09:54 +03:00
Sky
2eec32df98 Change URL Cyrillic "es" to latin "C" in URL
Fix URL to github code repository,
the "code" in URL used Cyrillic "es" i.e. %d1 %81,
whereas url  https://github.com/ONLYOFFICE/core
uses latin "c"
2023-06-23 16:43:36 +05:30
505739a4f0 For bug 61780 2023-06-23 13:24:41 +03:00
a3e1ddc538 Fix bug 62362 2023-06-23 13:21:25 +03:00
b30a85bfad context par animation attributes implemented 2023-06-23 03:52:56 +05:00
6013f5e5a1 serialize par animation implemented 2023-06-22 21:27:06 +05:00
d676270cac Refactoring 2023-06-22 16:49:56 +03:00
a92805e33a small refactoring 2023-06-22 15:30:55 +03:00
5f8c470273 fix CO, Hide, ResetForm name 2023-06-22 13:05:07 +03:00
df8092017c Astra (CE, Orel), Kubuntu added 2023-06-22 12:26:21 +03:00
12dbc4aeb4 Manjaro(mandriva) added 2023-06-21 17:41:20 +03:00
5446ebc58a debian added
fix installation on openSUSE
2023-06-21 12:40:34 +03:00
77ea7fd3df Fix use private sources in export header 2023-06-21 11:58:42 +03:00
cb40323b31 Fix parse Argument param 2023-06-21 11:57:54 +03:00
5f1fbdce31 minor 2023-06-21 11:42:41 +03:00
22f5da518d openSUSE added 2023-06-21 11:40:53 +03:00
6811fc9877 openSUSE, debian 2023-06-21 09:51:30 +03:00
d7978a5cbd pptx_animation_context structs fillled in 2023-06-21 03:52:32 +05:00
de863ef8e9 fix typo 2023-06-21 02:04:04 +05:00
fef91ed63c minor fix 2023-06-21 01:58:49 +05:00
fecaf8cda1 pptx_animation_context created 2023-06-21 01:51:04 +05:00
5d16f3a6a6 getTextColorSpace 2023-06-20 14:24:57 +03:00
ccfb56fc2e Added support for Symbol record to svg 2023-06-19 20:05:54 +03:00
601da93f28 fix Parents 2023-06-19 15:40:59 +03:00
054ddda825 . 2023-06-19 15:00:22 +03:00
85817c68c1 fix bug #63074 2023-06-19 12:55:36 +03:00
01b114770a . 2023-06-19 12:11:36 +03:00
24ff96efae . 2023-06-19 12:10:27 +03:00
540e89d7a0 Added alpha channel mode for alpha mask 2023-06-19 11:43:50 +03:00
865190ffd1 fix GetButtonIcon 2023-06-16 14:41:50 +03:00
26ab48321a Parents of annotations, and bool fields 2023-06-16 12:41:36 +03:00
f44ec6ed76 xml elements anim:set, anim:AnimateMotion, anim:AnimateColor implemented 2023-06-15 18:54:10 +05:00
12824bc071 Merge remote-tracking branch 'origin/develop' into feature/pdfForms
# Conflicts:
#	PdfFile/SrcReader/RendererOutputDev.cpp
2023-06-14 16:28:54 +03:00
7517621bf4 Added mutex to CAllowedCreationScope 2023-06-14 16:46:28 +04:00
bec99465a9 Added a test example with the use of a mask on the alpha channel 2023-06-14 14:23:08 +03:00
03da8bc41a [JSC] Refactoring
+ Renamed methods in CGraphicsEmbed and CNativeControlEmbed
+ Generated new embed files
+ Added check for allowed embed creation
2023-06-14 15:14:03 +04:00
0c48bd4cc2 Refactoring for JSC 2023-06-14 14:29:45 +04:00
1450093760 Raw pointers from functions -> JSSmart 2023-06-14 14:15:41 +04:00
b8aac93241 fix bug #63020 2023-06-14 10:48:08 +03:00
c724ddf65c . 2023-06-14 10:05:03 +03:00
c7964fd079 Refactoring 2023-06-14 00:51:51 +03:00
6cf8f74592 odf sparkline 2023-06-13 19:56:44 +03:00
87c986a71d Change embed mode for native JS builders 2023-06-13 20:17:47 +04:00
b1a87e2ca9 Merge pull request #1206 from ONLYOFFICE/fix/src_over_unpremulti_alpha
Fix/src over unpremulti alpha
2023-06-13 20:08:13 +05:00
ae2ab76803 Fix crash when draw 0 alpha on 0 alpha 2023-06-13 18:06:40 +03:00
7a822494aa Merge branch release/v7.4.0 into master 2023-06-13 11:17:31 +00:00
2d07e41ccf fix typo 2023-06-13 13:12:25 +03:00
d6292219d2 Singleton rework.
Added `CAllowedCreationScope`.
2023-06-13 14:06:18 +04:00
f4661150c6 Added alpha mask support reset and selection of draw mode 2023-06-13 10:32:36 +03:00
d1e87e342f NativeBuilderEmbed refactoring
+ PointerEmbed extra files added
+ Fix for generator when ifdef blocks are empty
+ Added CJSContext::createEmbedObject()
2023-06-12 23:16:46 +04:00
442756f964 Added alpha-mask support in graphics and svg-reader 2023-06-12 15:43:14 +03:00
eedff7a840 fix morph 2023-06-12 12:13:40 +03:00
dda3d75bcf Fix for multiple-lined methods 2023-06-12 00:23:24 +04:00
39cbad3ebf Added #ifdef and [noexport] support for code generation. Replaced most of internal classes.
Removed unnecessary V8 code.
2023-06-11 23:30:40 +04:00
1397f4f150 Improve speed 2023-06-11 00:44:33 +03:00
b5e84edbe7 Add new blender and use in by default 2023-06-11 00:36:45 +03:00
284d2730e2 Merge remote-tracking branch 'origin/release/v7.4.0' into fix/v7.4-fix-bugs 2023-06-10 21:10:46 +03:00
7a36d76298 Merge pull request #1204 from ONLYOFFICE/fix/v7.4.0-fix-bugs
fix bug #62988
2023-06-10 22:06:59 +05:00
c3b7447c04 fix bug #62988 2023-06-10 19:50:52 +03:00
e0cc9c0409 Revert use .net 4.7.2 2023-06-10 16:11:26 +03:00
6590643894 Refactoring 2023-06-10 13:57:33 +03:00
075d6c849b . 2023-06-09 18:43:31 +03:00
a0ff455786 for bug #61780 2023-06-09 18:27:12 +03:00
ca75468fca Merge remote-tracking branch 'origin/feature/xml-sheets-2' into develop 2023-06-09 16:07:37 +03:00
c4f475167d Change .net version to 4.5.2 2023-06-09 15:54:48 +03:00
d72d03d449 Merge pull request #1203 from ONLYOFFICE/feature/pluginsmanager
fix ignore option for rmp package
2023-06-09 17:16:09 +05:00
322c7af962 fix --ignore option for rpm package 2023-06-09 14:42:25 +03:00
879ce1a66d Revert "Merge branch 'vboxtester' into feature/pluginsmanager"
This reverts commit 25a909d7a7, reversing
changes made to ed46c8521d.
2023-06-09 14:37:40 +03:00
a01b535609 minor
exclude vboxtester from release branch
2023-06-09 14:32:35 +03:00
25a909d7a7 Merge branch 'vboxtester' into feature/pluginsmanager 2023-06-09 14:06:05 +03:00
2c081fedc9 fix --ignore option 2023-06-09 14:05:13 +03:00
9fc7aa5bca for bug #61780 2023-06-09 10:02:13 +03:00
35e10ff9cd Merge branch 'release/v7.4.0' into vboxtester 2023-06-08 18:37:02 +03:00
bce86077af Merge branch 'release/v7.4.0' into vboxtester 2023-06-08 18:00:39 +03:00
ed46c8521d Merge branch 'release/v7.4.0' into feature/pluginsmanager 2023-06-08 17:58:11 +03:00
7d18fa5753 Merge pull request #1201 from ONLYOFFICE/feature/pluginsmanager
ignore option
2023-06-08 19:56:20 +05:00
bdddc1ac67 no --restore if --ignore 2023-06-08 17:48:59 +03:00
a02bd8f383 --ignore option
comma-separated quoted list of plugins to ignore actions,                        such as update, remove or rename
2023-06-08 17:30:46 +03:00
549c288bda - fix bug #59142 2023-06-08 20:14:49 +06:00
0d77b62c2d Documentation finished 2023-06-08 17:07:49 +04:00
1f59fa87d7 pdf fix V becomes shared when owned by Parent 2023-06-08 15:33:23 +03:00
98aa840fc0 similarly done for resetform and hide actions 2023-06-08 12:11:44 +03:00
caa0a45931 fix epub title 2023-06-08 11:03:33 +03:00
cab7233652 fix findFieldName 2023-06-08 10:51:41 +03:00
ade9cda2e4 Merge pull request #1200 from ONLYOFFICE/release/v7.4.0
Release/v7.4.0
2023-06-08 12:46:49 +05:00
a867a168e0 [V8] Singleton embed creation rework 2023-06-07 19:28:30 +04:00
07e8cda08d Add defined for version 2023-06-07 17:58:55 +03:00
dc4ca0fe52 fix findFirstFieldIdx 2023-06-07 14:18:04 +03:00
af0836e379 Added some more description to documentation. 2023-06-07 13:30:05 +04:00
53e8fa7731 Fix bug 62923 2023-06-06 20:50:43 +03:00
cc4056a18b minor 2023-06-06 16:31:16 +03:00
37e03d6bcc Wrote some documentation for classes in js_base.h. 2023-06-06 17:26:28 +04:00
63b425763e fix no args 2023-06-06 16:06:29 +03:00
bf859f9763 Fix bug 62341 2023-06-06 16:01:47 +03:00
650c993fa0 end work 2023-06-06 15:01:50 +03:00
abba98d9d3 to test 2023-06-06 14:21:13 +03:00
e85923d94e need timeouts 2023-06-06 12:49:53 +03:00
6d548d27bc . 2023-06-06 11:54:35 +03:00
29167e6267 rpm support 2023-06-06 11:27:29 +03:00
80e2c75a54 . 2023-06-06 10:14:01 +03:00
65d5b5c628 Revision of the test example 2023-06-06 09:52:38 +03:00
98ef894a67 create CO 2023-06-05 18:14:16 +03:00
9c67404b69 fixes for linux 2023-06-05 17:03:04 +03:00
c82b5c9994 fixes 2023-06-05 15:59:00 +03:00
e6205fcff9 Merge branch 'release/v7.4.0' into vboxtester 2023-06-05 15:58:44 +03:00
842103a7a0 Merge remote-tracking branch 'origin/release/v7.4.0' into develop 2023-06-05 13:35:55 +03:00
1ec0142c25 Fix bug #59143
Change the default value for shd for unknown types of pattern
2023-06-05 03:21:22 +05:00
859e96a3ab Added alpha mask test 2023-06-04 22:13:20 +03:00
f65463c96f fix bug #61612 2023-06-04 15:18:26 +03:00
133ad365f4 Fix bug 62746 2023-06-03 14:53:51 +03:00
4c077a28b8 Fix bug 62856 2023-06-03 12:15:23 +03:00
1bd7c77ead Merge pull request #1199 from ONLYOFFICE/fix/bug60993
fix bug 60993
2023-06-03 00:42:56 +03:00
fa6e1c41fe correct cell inserting 2023-06-03 00:45:49 +06:00
26e5245cf6 fixes 2023-06-02 21:23:03 +03:00
672b9fd118 fix space before table 2023-06-02 18:56:00 +03:00
c96b59cbbf [android] Fix merge 2023-06-02 18:25:41 +03:00
bc18191931 [V8] Added new adapter generation 2023-06-02 17:53:25 +04:00
11d91891a8 [V8] New adapter for external embed. js_base.h celaned up. 2023-06-02 17:31:01 +04:00
81ec34b6f9 Remove initialize/dispose v8 in x2t on mobile platforms 2023-06-02 16:05:18 +03:00
f29d83a80b Merge branch 'release/v7.4.0' into vboxtester 2023-06-02 15:59:47 +03:00
b5c44805fb Merge pull request #1198 from ONLYOFFICE/fix/bug61651
Fix bug 61651
2023-06-02 15:05:14 +03:00
01bfa49aba fix epub EncodeXmlString 2023-06-02 14:52:28 +03:00
7c0bef3c04 fix bug #62853 2023-06-02 14:23:10 +03:00
7aeaec211a fix fb2 EncodeXmlString 2023-06-02 14:08:23 +03:00
a3de9703bf fix bug #62855 2023-06-02 13:18:48 +03:00
855a04ebbc Merge remote-tracking branch 'origin/feature/xml-sheets-2' into develop 2023-06-02 13:04:22 +03:00
af743b7e25 Fix linux build 2023-06-02 10:46:56 +03:00
d4b6a05717 For bug 61940 2023-06-02 00:52:09 +03:00
de51600d34 [android] Copy icu extra to assets 2023-06-01 16:51:46 +03:00
a29605e1b7 Added adapter code generation to scipt 2023-06-01 17:03:57 +04:00
e74d681589 Merge branch 'feature/xml-sheets-2' of github.com:ONLYOFFICE/core into feature/xml-sheets-2 2023-06-01 18:58:36 +06:00
f40b6f849d [JSC] Implemented adapter. Removed Native2Value and Value2Native from js_base.h 2023-06-01 16:27:16 +04:00
3fcd251831 - fix bug #55431 2023-06-01 17:47:47 +06:00
375b5a5f4f [V8] added an option for removing void* functions from js_base.h 2023-06-01 15:28:19 +04:00
c64379636e fixes 2023-06-01 14:05:45 +03:00
d2f9c59b5f Merge branch 'release/v7.4.0' into vboxtester 2023-06-01 13:32:17 +03:00
30675ab8b9 Merge pull request #1197 from ONLYOFFICE/feature/pluginsmanager
Fix bug 62807
2023-06-01 13:31:23 +03:00
fbadc56797 Fix bug 62807 2023-06-01 13:17:42 +03:00
a568aa02c4 fix bug #62840 2023-06-01 13:12:12 +03:00
099d49b3a7 Merge branch 'release/v7.4.0' into feature/pluginsmanager 2023-06-01 12:10:12 +03:00
55a200e71d for bug 62807 2023-06-01 12:09:46 +03:00
c6586a9a17 fixes 2023-06-01 12:05:11 +03:00
fbcf56be9e . 2023-05-31 21:47:49 +03:00
83fdc52baf Merge branch 'release/v7.4.0' into vboxtester 2023-05-31 17:21:15 +03:00
966eac2367 fix bug #60467 2023-05-31 15:26:11 +03:00
76c570721c Merge remote-tracking branch 'origin/release/v7.4.0' into develop 2023-05-31 14:41:07 +03:00
32c185c089 fix bug #62303 2023-05-31 14:00:30 +03:00
623c7a9e12 correct month format, added local default date format 2023-05-31 14:22:09 +06:00
8762ec12ff add xml convert from param 2023-05-31 10:11:14 +03:00
cb66e15faf for bug #62789 2023-05-30 15:59:07 +03:00
f6a102353d fixes 2023-05-30 10:08:49 +03:00
2247d47e4b working test
alfa
2023-05-29 23:15:14 +03:00
8d945ba094 Moved CJSContext::AddEmbedCreator() definition to js_base.cpp 2023-05-29 23:51:12 +04:00
3ad595817e Refactoring: removed CreateContext, removed RegistratorPool, made Embed static function 2023-05-29 21:23:23 +04:00
cb77b0989c Merge pull request #1196 from ONLYOFFICE/feature/pluginsmanager
Fix bug 62807
2023-05-29 20:14:30 +03:00
5832049ebc . 2023-05-29 19:28:49 +03:00
43bc3c92b3 working script 2023-05-29 19:22:22 +03:00
50007b47ee Fix bug 62807 2023-05-29 19:19:45 +03:00
b98c51b020 fix bug #62790 2023-05-29 19:07:14 +03:00
0c5e670ad1 fix bug #45218 2023-05-29 17:54:49 +03:00
a623458a0c Merge pull request #1195 from ONLYOFFICE/release/v7.4.0
Release/v7.4.0
2023-05-29 17:52:44 +03:00
e41b892b58 Fix typo 2023-05-29 18:01:30 +05:00
527af6f669 Refactoring android build 2023-05-29 15:49:49 +03:00
19ce026b5c . 2023-05-29 15:37:17 +03:00
5e6f84ec74 Add files to docker archive 2023-05-29 15:23:11 +03:00
3b54172c0a . 2023-05-29 15:15:39 +03:00
8efb543bed Merge branch 'feature/xml-sheets2' into develop 2023-05-29 12:16:39 +03:00
21e5090b59 Merge branch 'feature/xml-sheets' into feature/xml-sheets2 2023-05-29 12:13:36 +03:00
4b38ce7d91 Merge remote-tracking branch 'origin/release/v7.4.0' into develop 2023-05-29 12:09:15 +03:00
59c4f17f88 removed local setting for every cell 2023-05-29 14:36:16 +06:00
3c7d05a33e Fix build 2023-05-29 12:49:26 +05:00
881da23a59 correct attribute parsing 2023-05-29 12:39:14 +06:00
c2d48fdd32 Fix typo 2023-05-28 21:38:43 +03:00
ae26678a53 Implemented RegistratorPool for JSC 2023-05-28 19:11:50 +04:00
428d92e654 Added RegistratorPool for embedding in multiple contexts simultaneously 2023-05-28 18:42:39 +04:00
ebf6e9e995 Update v8 version for android 2023-05-28 17:09:09 +05:00
f87f2a47d5 Fix bug 62751 2023-05-28 11:55:11 +03:00
5728bcda76 new base funcs 2023-05-27 20:00:02 +03:00
21ee5ceecf Implemented code generation for internal embed 2023-05-27 18:19:57 +04:00
ceadb68bc6 ExecuteCommand and base funcs
GetVms, StartVm, StopVm, GetScreenshot
2023-05-27 11:26:15 +03:00
3aa94ae6ae command runner 2023-05-27 09:57:20 +03:00
b8095b3f82 to linux development 2023-05-26 22:47:05 +03:00
7554d92ed9 Removed dependency from current directory when running script 2023-05-26 21:48:45 +04:00
36dd828a73 Refactoring for external embed 2023-05-26 21:30:56 +04:00
17976500bc Added option for internal embed in JSC 2023-05-26 20:05:09 +04:00
e4895fe035 Added option for internal embed in V8 2023-05-26 19:12:50 +04:00
7448a331e9 Merge pull request #1194 from ONLYOFFICE/feature/pluginsmanager
Fixes 62704, 62727
2023-05-26 13:53:39 +03:00
940bb840be minors 2023-05-26 13:42:27 +03:00
967b0aec72 autorename options 2023-05-26 11:31:27 +03:00
59dcc3eb5c Added an option for compiling with v8_Embed.cpp but it's just terrifying 2023-05-25 20:32:03 +04:00
852989d0c9 fix bug 62704
checking permissions for the working folder
2023-05-25 17:39:52 +03:00
73ae7ceef9 Trying to understand template for generation of V8 embed file 2023-05-25 18:31:50 +04:00
c733399b88 fix bug #60467 2023-05-25 16:32:33 +03:00
8c92a944ad Merge branch 'release/v7.4.0' of https://github.com/ONLYOFFICE/core into release/v7.4.0 2023-05-25 14:32:33 +03:00
0456f9b362 fix bug #62728 2023-05-25 14:32:03 +03:00
4ec7942649 Fix typo 2023-05-25 13:49:46 +03:00
13410416a5 fix bud 62727 2023-05-25 13:30:46 +03:00
e103bcb562 correct xml conversion 2023-05-25 13:29:25 +06:00
b4d00a7a47 fix bug #62498 2023-05-24 15:40:33 +03:00
c703722372 Improved work with embedded images in svg-reader 2023-05-24 11:19:13 +03:00
4a4a05fd8a Added partial support for record Mask in svg-reader 2023-05-23 22:23:00 +03:00
9d497e48c9 Merge pull request #1193 from ONLYOFFICE/feature/pluginsmanager
Restore error description
2023-05-23 17:47:36 +05:00
759a159005 bug fix #62707 2023-05-23 15:36:36 +03:00
92e6fa06b5 Merge branch 'release/v7.4.0' into feature/pluginsmanager 2023-05-23 15:26:57 +03:00
7b93de3e8a bug fix #62707 2023-05-23 15:26:46 +03:00
ca3e65468b fix bug #62712 2023-05-22 21:55:39 +03:00
099f3f5632 Refactoring 2023-05-22 20:26:19 +03:00
5d378ddb41 minor 2023-05-22 20:03:57 +03:00
ba05993073 settings folder tolower 2023-05-22 19:42:33 +03:00
a18bae045a Added generation of jsc_ files. Refactoring for js_base_embed.pri usage. 2023-05-22 20:38:06 +04:00
2386c8e1a9 Revert some files 2023-05-22 13:55:43 +03:00
96662a2382 Adding flag support for marker and refactoring in svg-reader 2023-05-22 13:52:58 +03:00
6438c1cd4b For bug 62605 2023-05-22 12:49:06 +03:00
25db8ee837 Fix bug 2023-05-21 15:22:31 +03:00
e626d013a8 Fix bug 2023-05-21 15:13:37 +03:00
05e6f2a4fe Refactoring 2023-05-21 14:27:58 +05:00
07ad714d3a Merge pull request #1191 from ONLYOFFICE/fix/build-linux
linux fix build debug
2023-05-21 00:42:16 +05:00
1c87c34db9 Add flags for convertation to images 2023-05-20 21:57:38 +03:00
8f4956102a Fix bug 62696 2023-05-20 20:09:56 +03:00
cbed11f00b Added rgba support and refactoring in svg-reader 2023-05-20 18:21:10 +03:00
ab9fe80669 Finally made to work embedding in JSC 2023-05-20 18:13:28 +04:00
332fb3e318 Add working method of manually embeding FunctionGet into JSC 2023-05-20 15:41:56 +04:00
0d8fcd1bef linux fix build debug 2023-05-20 09:22:38 +03:00
4db5c55544 Merge pull request #1190 from ONLYOFFICE/fix/pm-linux
Refactoring config parsing
2023-05-20 01:24:55 +05:00
709ac0b868 Merge branch 'release/v7.4.0' into fix/pm-linux 2023-05-19 21:53:57 +03:00
a10849ada1 jsc_Embed.mm protocol methods need to be implemented at runtime? 2023-05-19 22:21:58 +04:00
ed28078a9e correct xml reading 2023-05-19 20:27:14 +06:00
390e036b25 add value name check 2023-05-19 18:38:51 +06:00
dd73d3347f Fix build 2023-05-19 11:55:43 +03:00
66d846dcfc Fix bug 2023-05-19 01:26:33 +03:00
c012741f7f Fix memory leaks
Finally
2023-05-19 00:29:22 +03:00
4accc90216 Trying to make it build with generated jsc_Embed.mm 2023-05-18 21:47:06 +04:00
d3f75c5033 correct digit format 2023-05-18 23:19:33 +06:00
e98f981a46 fix bug #59026 2023-05-18 18:49:08 +03:00
4d4e4a5ed7 change currency format 2023-05-18 17:44:16 +06:00
71d63d560a added common fraction processing 2023-05-18 15:50:34 +06:00
6a1de3467a add leading zeros to digit format 2023-05-18 13:29:11 +06:00
d6b7aefe51 bullshit off 2023-05-17 23:31:07 +03:00
f612ca64e0 Merge pull request #1189 from ONLYOFFICE/fix/pm-linux
minor fixes
2023-05-18 01:08:00 +05:00
e3a582ee67 minor 2023-05-17 21:57:15 +03:00
fa68ba2f0d fix config spaces 2023-05-17 21:07:49 +03:00
3387f67f7e Merge pull request #1187 from ONLYOFFICE/fix/pm-linux
linux fixes
2023-05-17 22:32:28 +05:00
383e9bc971 speedup 2023-05-17 20:15:33 +03:00
c67aea9543 fix bug #62630 2023-05-17 19:53:56 +03:00
0e64e3467b linux: fix plugin version 2023-05-17 19:49:38 +03:00
cc2027edab For bug 62654 2023-05-17 19:33:08 +03:00
da3739942f Merge pull request #1186 from ONLYOFFICE/fix/pm-linux
linux fix: args
2023-05-17 21:06:58 +05:00
439f52be3d Writed code generation inside of an embedded class [V8] 2023-05-17 17:49:48 +04:00
80d5783b3b linux fix: args 2023-05-17 16:21:31 +03:00
b663d3599a correct digit reading 2023-05-17 18:59:05 +06:00
dbd5aeadd2 fix bug #62634 2023-05-17 13:49:04 +03:00
e0caa9effc add digit reader and currency reader 2023-05-16 21:17:53 +06:00
d57b69731b fix bug #62610 2023-05-16 15:44:33 +03:00
7d6b82554b Added viewBox support for markers in svg-reader 2023-05-16 15:34:01 +03:00
bb8fda207b add format creating method 2023-05-16 17:09:24 +06:00
248f9a5362 fix bug #62498 2023-05-16 12:22:50 +03:00
204ef06b1a . 2023-05-16 10:30:06 +03:00
f9171cb342 small optimization 2023-05-16 08:55:25 +03:00
6d80b8537f fix bug #62174 2023-05-15 19:40:02 +03:00
1c894b7896 Line, polyline, and polygon records are remade as heirs of path 2023-05-15 19:28:59 +03:00
c5a09b75d6 fix bug #62115 2023-05-15 18:44:55 +03:00
be77e4a00a add processing dates before 1900 2023-05-15 20:02:37 +06:00
1c8687e07f Fix build with c++11 2023-05-15 17:58:19 +05:00
28745ae49f Refacroring work with arraybuffer for support new v8 versions 2023-05-15 15:33:35 +03:00
d6b5523406 Merge pull request #1185 from ONLYOFFICE/fix/metafile_bugs
Fix metafile bugs
2023-05-15 16:17:09 +05:00
fc1d61799b Merge branch hotfix/v7.3.3 into master 2023-05-15 06:44:54 +00:00
358903d331 Fix typo 2023-05-14 01:41:32 +05:00
46e8d03eeb fix bug #62579 2023-05-12 18:29:52 +03:00
554ad261cf fix bug #62572 2023-05-12 18:15:49 +03:00
50c8f69956 removed unused methods 2023-05-12 20:35:03 +06:00
87b46539c8 correct data format 2023-05-12 20:33:27 +06:00
7ddc3234a7 Added Marker record support for Paths in svg-reader and refactoring 2023-05-12 17:19:03 +03:00
9a2d9daa87 upgrade format controller 2023-05-12 15:53:38 +06:00
78c662ea55 Merge pull request #1183 from ONLYOFFICE/feature/pluginsmanager
pluginsmanager - update on server
2023-05-12 12:29:48 +05:00
98a02441de [server] update by config
- update if plugin exists
- install if plugin is not installed and not removed before
2023-05-12 10:27:14 +03:00
efb3075e0e removing by config 2023-05-12 09:43:48 +03:00
da703d88ca Merge pull request #1182 from ONLYOFFICE/feature/pluginsmanager
pluginsmanager
2023-05-12 11:02:24 +05:00
dc73c8b2b6 minor 2023-05-12 08:33:20 +03:00
1404829b68 change settings folder 2023-05-12 08:18:48 +03:00
be9f8ba8e6 minor 2023-05-11 22:46:50 +03:00
f858b76fd4 minors
--print-removed option
2023-05-11 22:26:20 +03:00
3914b9a9d5 fix update 2023-05-11 20:47:41 +03:00
e19d1c6735 fix bug #62530 2023-05-11 19:11:43 +03:00
041d8a3dc4 install/remove settings feature 2023-05-11 18:42:12 +03:00
31ee203b92 Fix bugs in metafile to svg conversion 2023-05-11 18:03:56 +03:00
3d7eefcd3d Merge pull request #1179 from ONLYOFFICE/feature/shape-vertical-text-align
Feature/shape vertical text align
2023-05-11 16:24:19 +03:00
82db1cd0d1 fix bug #62327 2023-05-11 15:25:49 +03:00
ad3a23a708 Fix bug 2023-05-11 15:23:22 +03:00
14ea99e880 fix bug #32006 2023-05-11 14:55:17 +03:00
d17d1f05ca Merge branch 'release/v7.4.0' into develop 2023-05-11 14:13:49 +03:00
7363c995dd fix bug #62527 2023-05-10 21:04:26 +03:00
7e16297d33 Changing how the use record works in svg-reader and refactoring 2023-05-10 20:48:50 +03:00
66a2edf5d2 fix bug #62525 2023-05-10 20:38:35 +03:00
36e5cada88 Fix bug 62353 2023-05-10 18:21:38 +03:00
01e9bb8cef Merge branch 'release/v7.4.0' of https://github.com/ONLYOFFICE/core into release/v7.4.0 2023-05-10 18:04:49 +03:00
9887883626 Fix build for macos/ios 2023-05-10 18:03:56 +03:00
1833bb1333 Trying to export some class dynamically to JSC. It still seems not possible. 2023-05-10 18:44:05 +04:00
3d828f9683 fix bug #62512 2023-05-10 17:29:57 +03:00
2d890247ab fix bug #62443 2023-05-10 16:40:07 +03:00
41c351b72d Fix memory leaks 2023-05-10 13:10:29 +03:00
f82dc027de add format controller using to csv reader 2023-05-10 16:04:02 +06:00
bac28708c1 Fix bug 2023-05-10 12:36:10 +03:00
5acc2513c8 . 2023-05-10 11:02:18 +03:00
d3dc902f23 Fix export methods 2023-05-09 11:40:02 +05:00
11ae76f9f0 Fix build 2023-05-07 10:29:50 +03:00
7340469a8c Fix bug 61386 2023-05-07 00:23:47 +03:00
92e03fd7b6 Merge branch 'release/v7.4.0' of https://github.com/ONLYOFFICE/core into release/v7.4.0 2023-05-06 17:16:40 +03:00
7a12a4d43e Fix typo 2023-05-06 17:15:49 +03:00
c59f679043 Merge pull request #1177 from ONLYOFFICE/feature/pmutility
Bug fix #62372
2023-05-06 18:35:43 +05:00
3cb1503632 Disable ssl in wget commands on old macos 2023-05-05 22:17:49 +03:00
b2b0c74cd4 unknown param check 2023-05-05 21:44:20 +03:00
a1376d647f help changes 2023-05-05 20:06:02 +03:00
dc17f5fe2e Fix bug #62372 2023-05-05 19:44:50 +03:00
45d23ed87d add format controller 2023-05-05 19:49:47 +06:00
6d45b90ac0 Add info class to export 2023-05-05 15:41:54 +03:00
5be6b6ebe5 Embed for jsc. It doesn't works for now. 2023-05-04 20:14:43 +04:00
0c971e9b12 add cell sorting 2023-05-04 20:24:56 +06:00
7130c2d1bb fix bug #62358 2023-05-04 15:54:22 +03:00
0c5521e4f4 fix AP coords 2023-05-04 14:09:19 +03:00
e19db2847f Merge pull request #1176 from ONLYOFFICE/fix/bug62184
Fix bugs 62184, 61326, 59302
2023-05-04 15:49:08 +05:00
2e8bb7177c Fix NSImageReSaver::CorrectImage 2023-05-04 13:43:21 +03:00
5d4adb482a correct attribute processing 2023-05-04 16:15:22 +06:00
c8ca57ea40 fix bug #62360 2023-05-03 20:20:02 +03:00
e7931e73d1 fix bug #62379 2023-05-03 19:54:46 +03:00
26cbeecb76 add attribute filling 2023-05-03 22:09:31 +06:00
bc7eab7f1d Fixed problems with working with styles 2023-05-03 19:06:39 +03:00
28bc145659 CZipEmbed test minor fix 2023-05-03 19:47:53 +04:00
115a68eb09 some refactofing 2023-05-03 19:40:39 +04:00
ab291fa199 . 2023-05-03 17:47:31 +03:00
46e5937c36 clean 2023-05-03 15:19:23 +03:00
0dd18f4159 try to verify signature 2023-05-03 15:16:35 +03:00
a25b62472c add repeatable values reading 2023-05-03 17:34:43 +06:00
b096ce8098 Correction of font selection in metafile to svg conversion 2023-05-03 14:05:44 +03:00
ffc3149d4b Fixed a bug with font size in metafile to svg conversion 2023-05-03 12:07:58 +03:00
f4cc9ec38a Fix bug #62404 2023-05-03 12:07:19 +03:00
5c3760a907 Merge pull request #1175 from ONLYOFFICE/fix/swscanf
fix swscanf
2023-05-03 13:16:59 +05:00
6320c543c0 fix build linux 2023-05-03 11:14:29 +03:00
324dd2de49 . 2023-05-03 10:24:49 +03:00
e07fd5ed24 Merge pull request #1174 from ONLYOFFICE/feature/pmutility
pluginsmanager: fix sync names
2023-05-03 12:17:27 +05:00
f0feaf5e1b Test version 2023-05-03 01:20:13 +03:00
19295c1037 minor 2023-05-02 21:51:52 +03:00
7ad0e7e9fe minor 2023-05-02 20:52:23 +03:00
ce9ede6820 fix: sync plugins names 2023-05-02 20:38:43 +03:00
1fb1c37bf9 Removed switch from Call() function 2023-05-02 21:10:52 +04:00
379f474739 fix bug #60760 2023-05-02 20:03:33 +03:00
a2662a6f2b Merge pull request #1173 from ONLYOFFICE/feature/pmutility
Feature/pmutility
2023-05-02 21:23:31 +05:00
c52893306d minors 2023-05-02 19:05:41 +03:00
3a9a2b5ee7 Merge branch 'release/v7.4.0' into feature/pmutility 2023-05-02 19:00:31 +03:00
8df04c48ad update plugins feature 2023-05-02 18:57:45 +03:00
3bb66721a1 Fix bug 2023-05-02 18:57:40 +03:00
3515db7e10 add processing repeatable value columns 2023-05-02 14:28:27 +06:00
f7b0565233 odf chart 2023-05-02 11:06:56 +03:00
afc6a72b14 Add variant for external objects 2023-05-01 00:25:24 +03:00
ef7fb15efe Fix build android on macos 2023-04-29 01:49:50 +05:00
8e7d91c143 Merge pull request #1172 from ONLYOFFICE/release/v7.4.0
Release/v7.4.0
2023-04-28 21:36:11 +05:00
e32b53d662 Merge pull request #1171 from ONLYOFFICE/feature/pmutility
Feature/pmutility
2023-04-28 21:34:23 +05:00
0b683226e9 Fix linux/macos build 2023-04-28 19:33:15 +03:00
73924f3ae0 restore plugin feature 2023-04-28 18:33:22 +03:00
15fdb5a8ce Refactoring and fix 2023-04-28 18:02:01 +03:00
e8ecef51dd fix locale 2023-04-28 16:58:47 +03:00
5bf730e1d6 minors 2023-04-28 16:23:57 +03:00
091f3a3a8e fix search 2023-04-28 14:11:40 +03:00
ffa8467c9e default init, backup feature 2023-04-28 13:28:17 +03:00
398c69c01e odf chart refactoring 2023-04-28 12:39:29 +03:00
a48ed74102 Merge pull request #1170 from ONLYOFFICE/fix/bug62143
Fix bug #62143
2023-04-28 13:29:11 +05:00
45628154d9 Fix bug #62143 2023-04-28 11:23:02 +03:00
2921e476c3 remove all plugins feature 2023-04-28 09:47:00 +03:00
cf85c54f43 Fix font selection 2023-04-28 00:52:58 +03:00
e97fd44489 plugin manager utility 2023-04-27 21:52:38 +03:00
1d864d7f37 realize VerifyPKCS7 2023-04-27 17:43:11 +03:00
7e799bd3cb add xmlConverter2 interface 2023-04-27 20:23:43 +06:00
1dba0723c7 Add settings for disable all warnings 2023-04-27 14:34:26 +03:00
217ec901ed Merge pull request #1169 from ONLYOFFICE/fix/bug62305
Fix bug 62305
2023-04-27 13:51:17 +05:00
68723a5e81 Fix bug 62305 2023-04-27 11:28:10 +03:00
53810c07ac Merge branch 'release/v7.4.0' of https://github.com/ONLYOFFICE/core into release/v7.4.0 2023-04-27 10:47:04 +03:00
14fcc4dfac fix bug #62269 2023-04-27 10:46:43 +03:00
b4b1cae18e Fix typo 2023-04-27 10:41:12 +03:00
dcddfd15b5 Merge pull request #1168 from ONLYOFFICE/release/v7.4.0
Release/v7.4.0
2023-04-27 02:13:48 +05:00
973aeb4e8b Merge branch 'release/v7.4.0' into develop 2023-04-27 00:06:41 +03:00
ab74e3fce7 Add test for font picker 2023-04-26 23:57:40 +03:00
4f48287d28 Fix font select (use unicode names for symbols > 128) 2023-04-26 23:40:15 +03:00
3b20ac3825 fix bug #62155 2023-04-26 23:08:57 +03:00
3f782ab389 odf chart refactoring 2023-04-26 20:35:23 +03:00
c22d4c60c0 Merge pull request #1166 from ONLYOFFICE/fix/bug62304
Fix bug 62304
2023-04-26 20:55:12 +05:00
9349ddf604 Fix bug 62304 2023-04-26 18:50:15 +03:00
70c4f045ea Fix build 2023-04-26 20:34:11 +05:00
9fa57133ad create VerifySign 2023-04-26 17:53:45 +03:00
52e52ee720 Fix 2023-04-26 17:35:01 +03:00
0343d7989d Added transparency support in stroke and fill in svg-reader 2023-04-26 16:52:10 +03:00
d955de5bdb Merge pull request #1165 from ONLYOFFICE/fix/metafile_bugs
Fix metafile bugs
2023-04-26 18:46:14 +05:00
0bd9cead65 Revert previous commits and just export CHash class. 2023-04-26 16:23:18 +03:00
c282e86832 Fix build hash wasm module 2023-04-26 16:16:10 +03:00
cd91baaabe Refactoring and move hash algs outside js embeds engine 2023-04-26 16:15:02 +03:00
5c7a285bb9 add new realisation with map reading 2023-04-26 17:11:03 +06:00
727a7722bb Merge pull request #1164 from ONLYOFFICE/feature/hash
Feature/hash
2023-04-26 03:05:15 +05:00
0d47bdc47d Fix bug 61888 2023-04-26 00:43:09 +03:00
cd458b81ec fix bug #62274 2023-04-25 20:45:57 +03:00
4beb4c8d70 fix bug #62116 2023-04-25 16:44:19 +03:00
aa56efb495 Fix bug #62144 2023-04-25 13:50:31 +03:00
2fe4a3e47f Merge pull request #1163 from ONLYOFFICE/fix/epub-page-break
epub page break
2023-04-25 10:22:55 +03:00
44016b4ccc Merge branch 'release/v7.4.0' into feature/shape-vertical-text-align 2023-04-25 14:08:12 +07:00
265e9d8af8 Fix bug 2023-04-25 03:37:21 +03:00
d2158ded6f Merge branch 'release/v7.4.0' into 'feature/hash' 2023-04-24 19:43:31 +04:00
34790c680a Hash in embed and WASM were reworked to prevent code duplication 2023-04-24 16:40:23 +04:00
4dfa989980 Test reworked. Added 76 tests. 2023-04-24 16:36:06 +04:00
a4f8205cee Merge remote-tracking branch 'origin/develop' into feature/pdfForms
# Conflicts:
#	PdfFile/PdfWriter_empty.cpp
2023-04-24 14:30:36 +03:00
9f435b90c0 GoTo action 2023-04-24 14:06:56 +03:00
64cfee514f updated license text 2023-04-24 13:50:03 +06:00
99ba013151 Merge branch 'release/v7.4.0' of https://github.com/ONLYOFFICE/core into release/v7.4.0 2023-04-23 21:46:18 +03:00
857957e824 [builder] Fix error on first start (with fonts in user folder) 2023-04-22 22:00:40 +03:00
c0972a5b4a Disable any exports in js engine 2023-04-22 21:48:06 +05:00
c0f231fa92 Fix export/import classes 2023-04-22 21:12:47 +05:00
6ec0609de3 Remove empty doctrenderer mode 2023-04-22 20:41:27 +05:00
43aacc8dd9 Fix for build_tools 7.4.0 2023-04-22 10:56:32 +03:00
f75d977661 Moved docterenderer embed and js_internal test to doctrenderer/test/ 2023-04-21 19:42:15 +04:00
48d19d9aa0 Fix bug #61968
Add support for datetime field when saving to pdf
2023-04-21 17:51:38 +05:00
16448245b8 Refactoring gtests 2023-04-21 14:02:36 +03:00
c8a03fec41 Fix html save 2023-04-21 11:12:38 +03:00
f973bd2df3 refactored node reading 2023-04-21 14:06:52 +06:00
db05f4d373 Fix compile with gcc >= 10 2023-04-21 02:57:52 +03:00
b6e741c4a5 Refactoring 2023-04-21 01:19:40 +03:00
ff75d14e29 Fixes for comments 2023-04-21 00:42:32 +03:00
ed0bcfc642 Implemented google tests for Hash (works on mac) 2023-04-20 23:27:46 +04:00
12e6957600 fix validation 2023-04-20 18:43:14 +03:00
33e6c14a04 Add toXml method to Api of PdfFile 2023-04-20 20:31:38 +05:00
f7b3ab2411 reincarnation pdf ToXml 2023-04-20 20:31:37 +05:00
331400c14b fix 2023-04-20 18:01:58 +03:00
51958eec9f reincarnation pdf ToXml 2023-04-20 17:59:49 +03:00
491f9d9384 create CXmlSeparator 2023-04-20 17:55:29 +03:00
ea49ffe242 Merge branch 'release/v7.4.0' of https://github.com/ONLYOFFICE/core into release/v7.4.0 2023-04-20 17:32:14 +03:00
471f739a66 Fix typo 2023-04-20 17:25:54 +03:00
a710a7b77c Merge branch 'release/v7.4.0' of https://github.com/ONLYOFFICE/core into release/v7.4.0 2023-04-20 17:19:47 +03:00
13ff65c6e9 Refactoring builder .com example 2023-04-20 17:17:26 +03:00
5050726d47 Fix bug #61761
Fix issue with saving text appearance in pdf in case of multiline text
2023-04-20 18:50:25 +05:00
3296d32168 Merge branch 'release/v7.4.0' of https://github.com/ONLYOFFICE/core into release/v7.4.0 2023-04-20 15:04:27 +03:00
11b59048cd Fix bug #62176 2023-04-20 13:32:42 +03:00
6b0513cd81 Fix bug #62178 2023-04-20 13:21:27 +03:00
e335a237a5 Update htmlrenderer test (ONLINE_WORD_TO_PDF case) 2023-04-20 14:47:37 +05:00
af6802e035 Update htmlrenderer test 2023-04-20 14:20:29 +05:00
01f01ec85f vertical text align 2023-04-20 08:15:05 +03:00
ac8019e6fd removed test vars 2023-04-19 20:33:36 +06:00
f0ea14790c add styles inserting 2023-04-19 20:29:37 +06:00
5e9677cc7a . 2023-04-19 16:22:20 +03:00
cb64312b80 correct attribute inserting 2023-04-19 16:25:48 +06:00
2e9de3748b Added implementation of arc splitting into Bezier curves and their rotation by a given angle in svg-reader 2023-04-19 12:53:04 +03:00
3a31507acc fix findFieldIdx with string 2023-04-19 10:53:53 +03:00
acb9af928f Add paragraph styles 2023-04-18 22:05:29 +03:00
68ad7412f6 упорядочил вставку ячеек в строку 2023-04-18 20:33:15 +06:00
a3f7e83ccf Fixed memory leaks. Fixed tests for V8 2023-04-18 14:02:21 +03:00
7d3334b8a7 доработал код конвертации 2023-04-18 15:47:35 +06:00
09d87538e7 Embeded to V8. Also made some renamings 2023-04-18 13:21:31 +04:00
2f9726e455 fix bug #62117 2023-04-18 10:59:51 +03:00
1d1dff5021 fix GoTo, Hide, ResetForm actions 2023-04-18 09:40:40 +03:00
a4b6d57786 Changed the principle of working with arcs in svg-reader 2023-04-17 19:56:33 +03:00
5178cf0cb7 Embeded hash() and hash2() for JSC 2023-04-17 20:11:56 +04:00
28e80a705c . 2023-04-17 16:22:56 +03:00
9b4aa190c2 alternateUrls
refactoring
2023-04-17 15:39:40 +03:00
a0b65df462 fix offset accuracy, findFieldIdx with ref and string 2023-04-17 14:16:14 +03:00
cc933d8316 обновил контроллер имён 2023-04-17 14:43:21 +06:00
0a517af106 Disable inspector for no main platforms 2023-04-15 08:36:27 +03:00
76fea998ea Fix build 2023-04-14 23:12:50 +03:00
721805535e . 2023-04-14 21:02:08 +03:00
1f5025b136 Begin to embeding hash functions 2023-04-14 21:21:44 +04:00
a61c267941 Merge pull request #1162 from ONLYOFFICE/hotfix/v7.3.3
Add define for reconnect timeout
2023-04-14 17:25:52 +03:00
35f0861e82 ResetForm and Next Action 2023-04-14 17:08:10 +03:00
a270168f7f доработки кода 2023-04-14 19:13:11 +06:00
a115bbc64e correct code 2023-04-14 15:40:01 +06:00
6f4041b476 Fix build 2023-04-14 12:02:46 +05:00
97aad68726 Refactoring setup v8 version 2023-04-13 23:51:11 +03:00
e83a86ee56 Fix build 2023-04-13 23:33:15 +03:00
a6882895a5 Fix linux build 2023-04-13 22:25:41 +03:00
ffffddfd45 рефакторинг работы конвертаии xml 2023-04-14 00:05:34 +06:00
debfdebe8d GetButtonIcons and GetInteractiveFormsAP to js 2023-04-13 18:31:03 +03:00
99a7234dec . 2023-04-13 18:25:40 +03:00
85ab308f80 Refactoring 2023-04-13 16:49:02 +03:00
c4bda0b403 Merge branch 'release/v7.4.0' of https://github.com/ONLYOFFICE/core into release/v7.4.0 2023-04-13 15:33:30 +03:00
0f492bce2b Refactoring 2023-04-13 15:32:38 +03:00
92f114a30f fix bug #61674 2023-04-13 13:08:53 +03:00
867918e69d add SetCoordTransformOffset
TODO fix offset accuracy
2023-04-13 12:56:30 +03:00
98f33c04be Merge pull request #1161 from ONLYOFFICE/fix/metafile_bugs
Fix metafile bugs
2023-04-13 12:43:16 +03:00
34c36cae01 Added initialization of variables in CSvgClip 2023-04-13 12:22:14 +03:00
8780587532 merged 2023-04-13 13:45:27 +06:00
22fe4574ad update project file on doctrennderer.pro 2023-04-13 13:42:40 +06:00
9bb4d16555 Merge pull request #1160 from ONLYOFFICE/release/v7.4.0
Release/v7.4.0
2023-04-13 10:21:26 +03:00
a6a4d74304 Merge pull request #1159 from ONLYOFFICE/feature/v8-inspector
Feature/v8 inspector
2023-04-12 20:49:11 +03:00
1fda842bc2 test GetButtonIcon 2023-04-12 18:19:59 +03:00
58112c000c Enable v8 8.9 by default 2023-04-12 15:37:59 +03:00
76c00154af fix bug #62056 2023-04-12 14:19:54 +03:00
4fec85c60b fix bug #62045 2023-04-12 13:47:32 +03:00
19c56e1b4d Changes for use _ITERATOR_DEBUG_LEVEL in debug by default 2023-04-12 11:23:45 +03:00
f77b8387f4 create GetButtonIcon and GetAPWidget 2023-04-12 11:20:50 +03:00
71e3768ed9 fix bug #61996 2023-04-11 22:30:46 +03:00
577cd11bd5 вернул и доработалcolumnName controller 2023-04-11 20:50:22 +06:00
2402ceb055 добавил вектор с нодами-предками 2023-04-11 14:44:01 +06:00
8f378140cb изменил тип значения, добавляемого в ячейку на Ctext 2023-04-11 13:42:05 +06:00
fb0e7f8d3f Fix xp build 2023-04-10 20:28:52 +03:00
9a0d42b957 Update shape merging 2023-04-10 19:11:42 +03:00
531fae1486 FontStyles refactoring 2023-04-10 18:41:44 +03:00
e7a0b204d5 SV and Lock Sig 2023-04-10 18:38:19 +03:00
f59e5745af V8 inspector now works only when environment variable is set 2023-04-10 17:57:06 +04:00
6b9ae7e71e [xp] Disable inspector 2023-04-09 13:39:00 +03:00
c16d7d16c7 Merge remote-tracking branch 'origin/release/v7.4.0' into develop 2023-04-09 08:42:47 +03:00
2601448513 [windows] Use _ITERATOR_DEBUG_LEVEL=0 in debug build 2023-04-08 22:18:31 +03:00
263e50601a Merge branch 'release/v7.4.0' into feature/v8-inspector 2023-04-08 22:16:44 +03:00
5d302dde81 fix bug #61586 2023-04-08 19:55:14 +03:00
fb22675e69 Fix bug
or not
2023-04-08 17:09:47 +03:00
e7e2e6b448 fix bug #61958 2023-04-07 17:23:28 +03:00
428f391bcd fix AS name 2023-04-07 16:41:48 +03:00
12932ec1a7 исправил парсинг xml 2023-04-07 18:53:06 +06:00
4d9d61a3e4 style checkbox&radiobutton 2023-04-07 15:48:19 +03:00
8fa2aff28d fix style checkbox&radiobutton 2023-04-07 14:44:14 +03:00
eb45d8dadc Correct pro files 2023-04-07 10:30:23 +03:00
3621bea6e1 Enable core_static_link_libstd by default 2023-04-07 09:41:24 +03:00
c60d06733b For bug #61864 2023-04-06 18:54:14 +03:00
4a833af5aa MK - I/RI/IX/IF 2023-04-06 15:54:16 +03:00
802c66c18c AP - N/R/D 2023-04-05 18:08:24 +03:00
9d9edd2cfc For bug #61784 2023-04-05 17:44:32 +03:00
7bc69064f7 Fix bug #61941 2023-04-05 17:35:42 +03:00
85a6bd84b6 correct cell indexes 2023-04-05 20:26:53 +06:00
f4cabdc7ef заменил map на vector для временного хранения xml 2023-04-05 17:42:48 +06:00
7f92930c18 correct code 2023-04-05 14:30:51 +06:00
a43a03d84d fix bug #61239 2023-04-04 18:24:46 +03:00
647dd62537 Merge branch 'release/v7.4.0' of https://github.com/ONLYOFFICE/core into release/v7.4.0 2023-04-04 17:48:31 +03:00
942a9c6a79 fix bug #60282 2023-04-04 17:48:13 +03:00
b652c5754c Fix bug 61799 2023-04-04 17:48:08 +03:00
dc4fd44f71 different AP 2023-04-04 17:39:27 +03:00
d9ed8f4780 fix bug #61586 2023-04-03 22:36:07 +03:00
44928cf416 fix bug #61721 2023-04-03 21:55:25 +03:00
1adfa0ea7e fix bug #47084 2023-04-03 21:55:01 +03:00
2dd276c427 Changed the principle of converting an Emf record DrawDriverString to svg 2023-04-03 20:11:47 +03:00
222d847356 fix hide annotations 2023-04-03 12:07:51 +03:00
775d06de9d Fix build js module 2023-04-02 20:16:15 +03:00
49f9c96570 Refactoring 2023-04-02 10:15:43 +03:00
c3bd31a38e Add optimization 2023-04-02 05:27:15 +03:00
c69da0df04 Add path merging 2023-04-02 04:39:08 +03:00
4ee588b1ab Revert bad commit 2023-04-01 00:13:07 +03:00
9e62296b29 Fixed a bug with drawing DrawDriverString record in Emf+ 2023-03-31 18:37:44 +03:00
6c76366705 For bug#61864 2023-03-31 18:36:39 +03:00
3755f31bae Contents, C, A action, fix Dash Pattern, fix Solid 2023-03-30 18:00:15 +03:00
be7cd036b8 add xml parsing into x2t converter 2023-03-30 20:40:04 +06:00
58ad19b395 add xml reader realisation 2023-03-30 19:44:31 +06:00
7380c666f2 убрал не использующийся names controller 2023-03-30 18:58:07 +06:00
224eb82f58 доработана обработка нод 2023-03-30 18:53:33 +06:00
09f45b2c02 restructured xml2table converter 2023-03-30 16:21:45 +06:00
abcfc66a41 Improved arc calculations in svg-reader 2023-03-29 20:16:26 +03:00
e9aa3b4e81 fix bug #61811 2023-03-29 18:52:14 +03:00
df3ccf1837 fix bug #61814 2023-03-29 18:19:43 +03:00
6aee8d6374 add new files to build 2023-03-29 17:10:08 +06:00
f2d0ae5e23 . 2023-03-29 11:31:53 +03:00
baaf79a5dd . 2023-03-29 10:44:09 +03:00
5ed129e7ae . 2023-03-28 23:43:05 +03:00
71da997cc2 . 2023-03-28 20:31:58 +03:00
954ee0a3a2 . 2023-03-28 18:55:55 +03:00
ebd00bbc8e add xml reader files 2023-03-28 21:26:47 +06:00
b980b6649c fix build drawingfile 2023-03-28 18:15:47 +03:00
0a4d680956 . 2023-03-28 17:22:16 +03:00
b28094bed1 add v8_89 using 2023-03-28 16:39:37 +06:00
26f296b03c . 2023-03-28 12:36:13 +03:00
3ce68727b4 . 2023-03-28 12:08:10 +03:00
4ce0f6ac2d . 2023-03-28 11:45:36 +03:00
e1d6360c66 . 2023-03-28 11:37:30 +03:00
5ce37c69f1 font info 2023-03-28 11:36:25 +03:00
fd2d602f55 . 2023-03-28 11:23:50 +03:00
57866e2589 . 2023-03-28 11:10:58 +03:00
b3ea4afe3f Merge pull request #1157 from ONLYOFFICE/fix/license
Fix license
2023-03-28 10:05:54 +03:00
fdbc72e1b4 Working with text in svg-reader 2023-03-27 19:58:06 +03:00
8cc343b885 DV, TI, rect update 2023-03-27 18:51:24 +03:00
a9acb55e73 fix build 2023-03-27 17:30:12 +03:00
d001298fcd Fix license 2023-03-27 15:47:53 +03:00
6e10ac6710 update licence 2023-03-27 14:06:08 +03:00
33d119e611 Merge remote-tracking branch 'origin/develop' into feature/xlsb_write 2023-03-27 10:51:56 +03:00
bec3d1877d . 2023-03-27 10:29:31 +03:00
50c65fe0fd for bug #61784 2023-03-24 18:37:14 +03:00
8851731c74 fix bug #61768 2023-03-24 16:19:53 +03:00
77ef5ead99 Fixed bugs with texts records in svg-reader 2023-03-24 13:44:02 +03:00
cde80a6277 AP widget round 2023-03-24 12:29:21 +03:00
a91c5767dc update cryptopp to actual
update test projects
fix same warnings
2023-03-24 11:29:53 +03:00
0e456d167b . 2023-03-23 22:10:57 +03:00
c7a5f5bdb2 Fixed bugs with clip-path in svg-reader 2023-03-23 19:57:19 +03:00
9e246ae8ba Fixed bugs in rendering svg textPath record 2023-03-23 19:01:05 +03:00
a50753c0d5 fix pallor 2023-03-23 16:10:07 +03:00
57b5394ce7 fix AP info 2023-03-23 12:49:30 +03:00
283ec810a2 separation of information and appearance of widgets 2023-03-23 12:38:48 +03:00
a246923dce UserProtectedRange update 2023-03-23 11:26:37 +03:00
dcea017b51 Added character rendering on textPath in svg 2023-03-22 21:58:47 +03:00
8750543f0e fix 2023-03-22 13:50:25 +03:00
dc7eb408bc fix AP obj 2023-03-22 13:43:29 +03:00
9a827d9c14 draw AP widget to js, separation of AP widgets drawing 2023-03-21 16:26:05 +03:00
2a3d138459 Updated calculations of control points for working with textPath in svg reader 2023-03-21 16:07:38 +03:00
c7c2ab02a7 fix bug #59365 2023-03-21 13:32:47 +03:00
0f59c2254d Fix compile 2023-03-21 10:20:07 +03:00
69cbba7b2b Refactoring 2023-03-21 01:35:08 +03:00
caea7fbe2f Fix bug + refactoring 2023-03-21 01:27:58 +03:00
9d9f6165b5 fix bug #61670 2023-03-20 21:34:14 +03:00
92a8bd2ed5 Added calculation of the position of points on a curve in svg-reader 2023-03-20 19:44:00 +03:00
84f8a65cd5 draw AP widget 2023-03-20 17:57:09 +03:00
fdd3685df3 xml 2023-03-20 10:59:25 +03:00
4007b826bf Refactoring 2023-03-20 03:44:36 +03:00
39c19db22a Refactoring (faster) 2023-03-20 02:55:43 +03:00
bacbfbf221 Fix bug 2023-03-20 02:51:15 +03:00
9cc07e916b Refactoring 2023-03-20 02:21:04 +03:00
8de7d01012 Add FontSelector (Refactoring) 2023-03-19 18:45:10 +03:00
8a89a05b32 Create graphics widgets 2023-03-17 17:43:57 +03:00
9ffb756c4f for bug #61641 2023-03-17 12:02:17 +03:00
4910d69a40 Add define for reconnect timeout 2023-03-16 22:36:48 +05:00
78d1f6f1e4 fix bug #61633 2023-03-16 20:27:30 +03:00
ecec9e2e39 Start of work on textPath record, fixing bugs and refactoring in svg reader 2023-03-16 18:37:20 +03:00
f8717b5af0 fix bug #61635 2023-03-16 14:41:22 +03:00
b921bebc79 chart filtering 2023-03-15 19:47:48 +03:00
e18ed76b48 Refactoring and working with paths in svg reader 2023-03-15 16:25:52 +03:00
fa85b389f2 Merge branch hotfix/v7.3.3 into master 2023-03-15 10:47:21 +00:00
8807404baf Move ECMACryptFile to CryproPP library project 2023-03-15 12:37:59 +05:00
21544a7ff7 Refactoring 2023-03-14 19:02:58 +03:00
2ab9f06493 Refactoring 2023-03-14 18:10:33 +03:00
d4dee32fe7 Work with transforms and normalization text size in svg reader 2023-03-14 13:31:46 +03:00
0f9084456a MK R and BG 2023-03-14 13:16:44 +03:00
f499793b27 MK BC 2023-03-14 12:48:18 +03:00
d5b46f74fc Fixed bugs with the position of rotated objects and others in reading svg 2023-03-13 16:22:22 +03:00
18f2810572 Get FormField text 2023-03-13 15:54:14 +03:00
ae92f47e54 Make it works for Windows
+ removed unnecessary `readFileContent()` from utils
+ moved `getPort()` from InspectorPool to WebsocketServer
2023-03-13 14:43:35 +04:00
9688ed3d4c Merge branch 'develop' of https://github.com/ONLYOFFICE/core into develop 2023-03-12 13:54:39 +03:00
673b733a8d Add gcc version to base.pri 2023-03-12 13:53:59 +03:00
1a89252004 Fix typo 2023-03-12 12:11:14 +03:00
a1fd606050 Fix build 2023-03-12 11:52:13 +03:00
6d7a1421b2 Merge pull request #1155 from ONLYOFFICE/hotfix/v7.3.3
Hotfix/v7.3.3
2023-03-12 11:16:21 +03:00
5b8510353d Push changes for base file (pdf/xps/djvu module) 2023-03-12 10:26:49 +03:00
6df5bf924a Merge pull request #1154 from ONLYOFFICE/fix/fix-bugs-v7.3.3
Fix/fix bugs v7.3.3
2023-03-12 00:02:52 +03:00
8ca40a44ce fix bug #61586 2023-03-11 13:38:14 +03:00
3fa6152e69 fix bug #61588 2023-03-11 12:42:23 +03:00
8bd4dcece3 Merge pull request #1152 from ONLYOFFICE/fix/v7.3.3-fix-bugs
Fix/v7.3.3 fix bugs
2023-03-10 18:15:01 +03:00
7afe09ce09 fix bug #59365 2023-03-10 17:18:34 +03:00
3df0892752 Merge pull request #1153 from ONLYOFFICE/fix/bug61577
Fix bug #61577
2023-03-10 17:04:07 +03:00
deffa006b5 Fixed bug #61577 2023-03-10 17:02:48 +03:00
12326b3a4f fix bug #61456 2023-03-10 14:09:39 +03:00
ad72c997f2 fix bug #61459 2023-03-10 12:18:14 +03:00
4552ab2d6f font embedding comment 2023-03-10 12:16:20 +03:00
45c0c521bf Fix Border, Highlighting and RadiosInUnison 2023-03-10 11:03:54 +03:00
2b3d784d6a Merge remote-tracking branch 'origin/develop' into feature/pdfForms 2023-03-10 07:48:04 +03:00
741213b126 Merge pull request #1151 from ONLYOFFICE/fix/bug61404
Fix bug 61404
2023-03-09 22:33:44 +03:00
73524ccc22 Fix build 2023-03-09 14:45:10 +03:00
b4d1b2e8c5 fix 2023-03-09 13:00:25 +03:00
f9fc707c11 Merge remote-tracking branch 'origin/develop' into feature/pdfForms 2023-03-09 12:53:15 +03:00
4ca669b9cd Fixed a bug with clips in metafile -> svg conversion 2023-03-09 12:34:29 +03:00
55578a0026 Changed the principle of working with clips in the metafile -> svg conversion 2023-03-07 19:14:46 +03:00
530d1d1763 Fixed bug with rotated text position in metafile -> svg conversion 2023-03-07 15:23:47 +03:00
b2a8407617 Inspector code wrapped in namespace NSJSBase
+ Added comment about based on repository
+ Removed unnecessary rows from `js_base.pri`
2023-03-07 11:33:29 +03:00
0a0a7baaf7 Merge remote-tracking branch 'origin/hotfix/v7.3.3' into develop 2023-03-07 11:14:48 +03:00
f41c850c0e Moved my_inspector to inspector
+ Prevented `call_func()` to break on first line
2023-03-07 10:40:07 +03:00
8206a74694 Merge branch 'develop' of https://github.com/ONLYOFFICE/core into develop 2023-03-06 18:46:42 +03:00
0aaff62cba . 2023-03-06 18:46:32 +03:00
062628ec8d Merge remote-tracking branch 'origin/develop' into feature/pdfForms 2023-03-06 18:19:30 +03:00
0d66a203d6 PathCommandText for CPdfWriter
analogue of PathCommandText from graphic renderer for CPdfWriter
2023-03-06 18:14:54 +03:00
0d9052d25c Fixed bug with text position in metafile -> svg conversion 2023-03-06 14:13:19 +03:00
3c28cf6022 Fix build with c++17 2023-03-05 19:02:07 +05:00
118783c716 Fix bug 2023-03-05 13:27:15 +03:00
0d06216215 Refactoring 2023-03-05 13:06:18 +03:00
a977fe30f0 Added 'C' prefix to all class names 2023-03-03 18:17:01 +03:00
2c799de36a Now inspector works for older version of V8 too
- Replaced some arguments to `V8IsolateFirstArg`
- Fixed breakpoints issue on old V8 version
2023-03-03 18:11:22 +03:00
49a339ad56 Working with clips in metafile -> svg conversion 2023-03-03 17:26:16 +03:00
a736c35880 Code reformatted to satisfy codestyle 2023-03-03 13:51:52 +03:00
7f6ceb3fc3 Hide action 2023-03-03 12:35:47 +03:00
00e54401da Fixed old inspector code 2023-03-02 21:00:07 +03:00
486ff2087c Implemented inspector for CJSObject::call_func() method
Redesigned websocket server connection initialization
2023-03-02 20:59:40 +03:00
b3cef38315 Merge pull request #1147 from ONLYOFFICE/feature/x2ttester
Fix bug 61452
2023-03-02 17:42:11 +03:00
8646fd4271 Fix bug 61452
passwords
2023-03-02 17:36:48 +03:00
66050307ce Refactoring
CStyleManager* in conttext is useless
2023-03-02 16:48:47 +03:00
b0cbf8520a Make server automatically disconnect when runScript() ends
+ Moved bool flag from CJSContextPrivate to Inspector
+ Replaced members JSContext* in Inspector and CInspectorPool to
v8::Isolate* cause of `call_func()` support
2023-03-02 16:22:13 +03:00
ea181c8110 Now code of runScript() continues on connecting to CDT
Before that, just another `runScript()` was calles from loop
+ Fixed error "Adress already in use" that used to appear sometimes
2023-03-02 14:19:42 +03:00
2f4756138c Inspector Pool implemented
Now inspector works with different CJSContext-s and different
CJSContextScope-s. But sometimes shows "Address already in use" error.
2023-03-02 13:12:28 +03:00
3ef0ed1d36 [copyright] Update address in Copyright 2023-03-01 23:21:57 +03:00
32a046f4d2 Now value from runScript() returns correctly
+ writed some TODOs
+ formatted brakets
+ restyled class definitions
+ added some comments
2023-03-01 18:42:30 +03:00
239d6d9a62 GoTo, Named, URI 2023-03-01 18:36:06 +03:00
9f18768e5d Added support for recording EMR_GRADIENT FILL in EMF and working with clips 2023-03-01 17:10:35 +03:00
163ab8da25 Fixed segfault on deleting WebsocketServer
+ removed unnecessary `Listener` classes
2023-03-01 16:45:29 +03:00
fd1e49ec2d [FontMaps] Change built-in license to Common/license/header.license 2023-03-01 14:17:05 +03:00
03d88de461 Merge pull request #1145 from ONLYOFFICE/feature/copyright-2023
Feature/copyright 2023
2023-03-01 10:10:48 +03:00
e412983314 Added the removal of excess from the font when converting metafile->svg 2023-02-28 19:25:05 +03:00
de278ff550 Fix bug #61404 2023-02-28 19:10:51 +03:00
da6e71386d Action developing 2023-02-28 19:09:49 +03:00
fad145455e Moved all inspector initializing stuff to runScript()
Also now programm continues when debugging session is ending!
2023-02-28 16:42:07 +03:00
7e5332eba5 [x2t] Add mhtml ext for bug 61381 2023-02-28 16:27:11 +03:00
a32ce7650f Used our runSript() method instead of one in utils.h 2023-02-28 15:43:15 +03:00
f7f5bb89c1 [copyright] Add Copyright 2023-02-28 14:56:22 +03:00
5102820231 [copyright] Fix invalid Copyright 2023-02-28 14:18:51 +03:00
57ccbc0fb6 [copyright] Update Copyright 2023-02-28 11:16:40 +03:00
ff427c547d [copyright] Fix invalid Copyright 2023-02-28 01:12:57 +03:00
4d5a2967e3 [copyright] Update Copyright 2023-02-28 00:57:11 +03:00
d2db5abe89 Working with text in svg and refactoring 2023-02-27 18:59:17 +03:00
53bbeb0cdc Refactoring + VectrosGraphics update 2023-02-27 15:46:54 +03:00
9ea4cd8ba5 Writed my_inspector with working functionality 2023-02-27 12:20:02 +03:00
a61543bff9 to develop 2023-02-22 18:47:05 +03:00
299e91c747 CurvedLeftArrow revert 2023-02-22 16:23:11 +03:00
6633335912 fix shapes scaling 2023-02-22 15:46:17 +03:00
db7297f5c1 Svg has added support for the use entry and improved work with the line style 2023-02-22 14:26:11 +03:00
adc5e4fd38 Add JS action 2023-02-22 11:14:00 +03:00
7de16d2d49 Fix bug 2023-02-21 17:01:22 +03:00
ad1dc1ebf9 Added support for writing stroke-dasharray to svg 2023-02-21 16:52:34 +03:00
fc3e54c485 Added support for recording clip-path in svg and refactoring 2023-02-21 16:44:00 +03:00
7ba98fe047 initial 2023-02-21 15:55:23 +03:00
c47e0369a1 . 2023-02-21 14:21:14 +03:00
db772a9dac fix two Opt 2023-02-21 13:31:50 +03:00
416b120842 Merge remote-tracking branch 'origin/fix/coderefact' into develop 2023-02-21 13:09:12 +03:00
1e34dc736e . 2023-02-21 13:08:33 +03:00
4c20531b30 Merge remote-tracking branch 'origin/hotfix/v7.3.3' into develop 2023-02-21 13:06:23 +03:00
2ee8dead85 Merge branch 'develop' into fix/coderefact 2023-02-21 11:56:16 +03:00
88ae812a90 common shapetypes for doc, xls, pptx
TODO: make ShapeType as parent for PptShape
2023-02-21 11:55:59 +03:00
bad7cc3c86 Refactoring 2023-02-21 11:16:46 +03:00
6c1fda3932 fix drawingfile 2023-02-21 10:17:48 +03:00
835f88edf5 add userProtectedRanges 2023-02-21 00:20:14 +03:00
ea7030d58e Added svg file scanning for defs and styles 2023-02-20 14:12:43 +03:00
6228c41af4 chart refactoring
chart external rels
2023-02-20 09:59:06 +03:00
623e664478 indents update
tabs instead of spaces
2023-02-19 12:37:53 +03:00
5cac25286d Refactoring 2023-02-19 12:27:08 +03:00
dded7e69ef Working on the gradient in svg and refactoring 2023-02-17 18:07:33 +03:00
bb0d2eea84 Merge branch 'develop' into fix/coderefact 2023-02-17 15:27:58 +03:00
a704a74fed common shapes for xls, pptx 2023-02-17 15:23:50 +03:00
a4fd9eba94 Merge remote-tracking branch 'origin/fix/v.7.3.3-chart-ex' into develop 2023-02-16 19:29:00 +03:00
1f3a104356 chart refactoring 2023-02-16 19:24:16 +03:00
bacec90b2e Fixed a bug in rendering roundrect in svg 2023-02-16 19:08:28 +03:00
cfe6264404 Started working with gradients in svg and refactoring 2023-02-16 17:04:56 +03:00
712fb04ddc create Action 2023-02-16 16:22:15 +03:00
478e3e9dc3 Changed the principle of working with Patterns in Svg 2023-02-16 13:39:32 +03:00
907734a202 pptx short project
Logic pri
2023-02-15 20:04:19 +03:00
3a4792e858 add extension 2023-02-15 17:52:27 +03:00
223c16f90e refactoring chart ooxml 2023-02-15 17:51:17 +03:00
e0c35867c6 fixes and captions 2023-02-15 17:36:51 +03:00
2eeaaa7197 xls short project
Logic pri
2023-02-15 17:28:12 +03:00
9b419ce470 pptx refact 2023-02-15 13:15:39 +03:00
7f17ec7b29 doc: shapetypes pri 2023-02-14 16:21:32 +03:00
2f5035d0e3 Fix bugы 2023-02-14 14:13:08 +03:00
5633b92d19 Added support for text-decoration in svg text 2023-02-14 14:12:23 +03:00
b2f2017158 Added support for multiple values in svg transform 2023-02-14 14:11:47 +03:00
1fbbabeff0 . 2023-02-14 13:31:37 +03:00
0ed1fa08e1 Working with svg text styles 2023-02-13 19:58:41 +03:00
bd895669f5 Merge branch 'hotfix/v7.3.3' into fix/v.7.3.3-chart-ex 2023-02-13 17:47:34 +03:00
76b90d43a4 Added support for Pattern record 2023-02-13 15:06:57 +03:00
ce6aeb48b7 - test project 2023-02-13 14:47:56 +03:00
1427de8435 Merge branch 'develop' into fix/coderefact 2023-02-13 11:02:06 +03:00
f89f66df45 Added partial support for Image records 2023-02-10 17:22:22 +03:00
7550c08748 Removed unnecessary variable m_nEntered from CJSContextPrivate 2023-02-10 13:06:20 +03:00
4f19118934 Border Style, Border Effect 2023-02-09 18:00:24 +03:00
68922675b5 Improved work with Transform property and refactoring 2023-02-09 16:44:50 +03:00
33de9f0362 Annotation Flag, Border, Dash Pattern 2023-02-09 16:32:41 +03:00
57145240be Merge pull request #1141 from ONLYOFFICE/feature/x2ttester
Fix bug 60966
2023-02-08 21:01:13 +03:00
7d6a29d063 Fix bug 60966
Add timeouts & update README
2023-02-08 20:18:21 +03:00
dc0c6c369c Added support for Transform properties in svg reader 2023-02-08 19:21:06 +03:00
f5c4dab90b Update x2ttester
timeouts in lunix
2023-02-08 18:42:54 +03:00
a765789b41 flag processing, Q, DS, RV 2023-02-08 17:29:29 +03:00
fc0f496c5f Fixed crash on multiple Enters on same context 2023-02-08 17:01:58 +03:00
4c9e904d10 . 2023-02-08 09:45:16 +03:00
24acad0cd2 Method implementations moved to js_base.cpp. Exported CreateDefaults(). CJSLocalScope implemented. 2023-02-08 00:05:58 +03:00
0661c9b552 Changed working with svg records data and refactoring 2023-02-07 18:42:34 +03:00
edeebcc438 . 2023-02-07 17:53:37 +03:00
6fb6021ad3 Update x2ttester
Windows (bug 60966)
2023-02-07 15:56:53 +03:00
c14083795f . 2023-02-07 15:22:24 +03:00
62d05c02fb Merge branch 'feature/odf_4' into develop 2023-02-07 11:56:50 +03:00
117edc9c96 fix main_document 2023-02-07 11:54:42 +03:00
2c73c6044f Merge remote-tracking branch 'origin/develop' into feature/pdfForms
# Conflicts:
#	DesktopEditor/graphics/pro/js/wasm/src/drawingfile.cpp
2023-02-07 11:31:09 +03:00
a1195e038e add chart extensible 2023-02-07 10:25:47 +03:00
ff1e280d7d Merge branch 'develop' into feature/odf_4 2023-02-07 10:22:36 +03:00
000f64267f Merge pull request #1138 from ONLYOFFICE/fix/fix-develop
Fix/fix develop
2023-02-07 10:21:41 +03:00
1e5e533d68 Merge remote-tracking branch 'origin/hotfix/v7.3.3' into fix/fix-develop 2023-02-07 10:20:49 +03:00
ac0cdd8fa2 Merge branch 'develop' into fix/coderefact 2023-02-07 11:43:00 +05:00
bc33a5b2e3 Removed m_globalTemplate from CJSContextPrivate. Removed js_base.pri from test.pro 2023-02-06 18:36:43 +03:00
f8b9847e28 Text, ComboBox, ListBox 2023-02-06 17:40:42 +03:00
43514de87e CJSContext scopes rework. Global template added. 2023-02-06 14:51:28 +03:00
f121da9f47 Merge remote-tracking branch 'origin/release/v7.3.0' into develop 2023-02-04 17:49:33 +03:00
c18251dcfd Refactoring is finished 2023-02-03 18:12:32 +03:00
61d26acf71 Implemented methods Enter() and Exit() in class CJSContext 2023-02-03 17:42:10 +03:00
214477d2c9 fix TU 2023-02-03 16:55:32 +03:00
47316e337e Pushbutton, Checkbox, RadioButton 2023-02-03 15:26:54 +03:00
532856e460 creating custom fields 2023-02-02 17:28:58 +03:00
d6dfe0623f pptx forward decs 2023-02-02 15:14:17 +03:00
f86ef63f58 Continuing refactoring 2023-02-02 14:51:42 +03:00
7b604d08b4 create GetInteractiveForms 2023-02-01 13:50:51 +03:00
6f8251fe04 pptx forward decs 2023-02-01 10:06:56 +03:00
2b29420eb1 Continuing refactoring 2023-01-31 19:44:21 +03:00
cfa55dc3ce test 2023-01-31 16:49:48 +03:00
a31d124661 refactoring IsNeedCMap 2023-01-31 16:42:45 +03:00
d5ab557578 fix build 2023-01-31 16:35:31 +03:00
085940c37b The beginning of refactoring 2023-01-30 19:08:55 +03:00
3b779ded76 pptx minor forward decs 2023-01-25 18:45:15 +03:00
d49b74c0e0 minors 2023-01-25 13:03:11 +03:00
43ebeec93c . 2023-01-23 20:32:21 +03:00
32a851b4e4 Merge commit 'a039a36b8fec3c6060b38aef476d8ce8e1845c76' into feature/odf_4 2023-01-23 19:56:11 +03:00
74c4bf6236 Fix docx_renderer test build 2023-01-19 14:02:27 +03:00
6f1018aa50 Merge pull request #1115 from ONLYOFFICE/develop
develop -> docx_renderer2
2023-01-19 13:38:23 +03:00
830ef2ad60 refactoring
includes using forward declarations
2023-01-17 15:42:33 +03:00
1792a24827 Merge branch 'develop' into fix/coderefact 2023-01-16 21:17:13 +03:00
0f1d473360 [test] Update test 2023-01-15 17:40:51 +03:00
c0097de544 docx refactoring
Correct includes using forward declarations
2023-01-14 10:59:34 +03:00
c07ae1bbb4 Merge branch 'develop' into fix/coderefact 2023-01-13 17:23:19 +03:00
b848c1b828 . 2023-01-13 17:14:51 +03:00
1a7be8a6e8 Merge branch 'develop' into fix/coderefact 2023-01-13 15:52:36 +03:00
06716f1607 . 2023-01-13 12:07:22 +03:00
6a5f065833 Merge branch 'develop' into fix/coderefact 2023-01-13 07:22:12 +03:00
1b6c278b87 minor 2023-01-12 22:45:54 +03:00
996475fca2 . 2023-01-12 22:29:34 +03:00
243214b060 . 2023-01-12 22:14:07 +03:00
7382845517 . 2023-01-12 22:02:50 +03:00
891dab4016 Refactoring and working styles in SVG 2023-01-12 19:34:29 +03:00
463befcc67 Merge remote-tracking branch 'origin/fix/coderefact' into develop 2023-01-12 16:08:55 +03:00
b1148caaed Merge remote-tracking branch 'origin/fix/bug59621' into develop 2023-01-12 16:08:39 +03:00
c37105e4ae Xlsx refactoring
Correct includes using forward declarations.
x2t compiled(debug/release) and checked.
2023-01-12 15:44:13 +03:00
ec547778b5 Xlsx refactoring
correct includes using forward declarations
2023-01-12 09:26:29 +03:00
c14b1c73bf Xlsx refactoring
correct includes vai forward declarations
2023-01-11 21:53:50 +03:00
2e2bdcdbf1 Working with SVG styles and transformation 2023-01-09 13:30:39 +03:00
ec0b85511b Added support for Polyline and polygon records 2023-01-05 12:37:33 +03:00
24236ed509 Merge branch 'develop' into fix/coderefact 2022-12-30 16:56:59 +03:00
11f645cb2b Merge branch 'develop' of https://github.com/ONLYOFFICE/core into develop 2022-12-30 16:54:42 +03:00
dd02f82697 Merge branch 'develop' into fix/coderefact 2022-12-30 16:36:19 +03:00
fba7ca95f8 . 2022-12-30 15:08:19 +03:00
d2a7f573c6 . 2022-12-30 12:38:56 +03:00
b0769432d3 Merge remote-tracking branch 'origin/fix/coderefact' into develop 2022-12-30 12:16:52 +03:00
bd343c88d1 Merge remote-tracking branch 'origin/release/v7.3.0' into develop 2022-12-30 12:15:42 +03:00
243d8dd2e1 xls impl separation
current step is needed to compare the implementations of shapes and further merge with pptx
2022-12-30 12:15:40 +03:00
2a8e7667bd xls changes
revert common xls-pptx shapes (required common BaseShape)
2022-12-29 19:27:45 +03:00
4fa275fd55 bindoc: -unused includes 2022-12-29 14:16:08 +03:00
8182c95dfc txt: -unused includes 2022-12-29 08:20:01 +03:00
36a4aaad45 docx: - unused includes 2022-12-28 20:29:38 +03:00
e3e3f8a4e6 upd for #6e14576
ComplexTypes_AdditionConstructors: constructor calls a virtual function
2022-12-28 09:05:05 +03:00
62710bb443 Working with SVG styles 2022-12-27 21:15:36 +03:00
5d666a0d10 Working with SVG styles 2022-12-26 19:28:37 +03:00
5c46c77beb Merge remote-tracking branch 'origin/fix/coderefact' into develop 2022-12-26 15:43:26 +03:00
975a2409ab Merge remote-tracking branch 'origin/release/v7.3.0' into develop 2022-12-26 15:42:48 +03:00
6e14576097 fix: constructor calls a virtual function
docx, pptx
2022-12-26 12:15:47 +03:00
4f97c72212 Started working with svg styles 2022-12-22 16:14:11 +03:00
c280e9c829 ppt, xls common shapes
duplicate shapes have been removed
2022-12-21 13:48:44 +03:00
dadd3987f0 Added a draft version of working with text 2022-12-19 18:51:27 +03:00
1e8d0d62b2 Added support for ellipses and working with the path 2022-12-19 14:42:47 +03:00
d60d5eca86 ppt shapes (pri impl separation) 2022-12-18 10:02:52 +03:00
6a966c9cb9 xls, ppt, pptx changes
- implicit includes have been resolved
- preparation before common shapes(pri)
- x2t compiled
2022-12-17 14:19:53 +03:00
a637e40bad Merge remote-tracking branch 'origin/fix/coderefact' into develop 2022-12-16 16:01:31 +03:00
cdf3918489 Merge remote-tracking branch 'origin/release/v7.3.0' into develop 2022-12-16 15:57:52 +03:00
4d94f248e2 pri for all shapes (ppt + pptx)
x2t compiled and checked.
TODO: _T->L
2022-12-15 12:51:42 +03:00
e91f52ca16 minors
DEFINE_SHAPE_CLASS for ppt & pptx
2022-12-15 09:47:48 +03:00
e77311983a fix build
x2t compiled
2022-12-14 21:44:42 +03:00
c0a833fac6 pptx shapes refact + pri 2022-12-14 21:13:51 +03:00
2093579b77 limits pri 2022-12-14 15:50:01 +03:00
3bd847237b beauty code pptx limits 2022-12-14 00:23:15 +03:00
7aea6bf451 operator= by string problem 2022-12-13 21:00:29 +03:00
417aab6cee Added path implementation in svg 2022-12-13 17:40:37 +03:00
35dc17e584 The creation of a new svg-reader has begun 2022-12-13 11:27:17 +03:00
db6ab0b003 Merge remote-tracking branch 'origin/release/v7.3.0' into develop 2022-12-12 17:43:44 +03:00
2e2258f369 . 2022-12-12 17:39:53 +03:00
fc3f8e61fa Merge remote-tracking branch 'origin/release/v7.3.0' into develop 2022-12-12 17:26:03 +03:00
74866e2898 . 2022-12-12 17:19:31 +03:00
14f04509a7 . 2022-12-12 17:18:51 +03:00
6a14a4daad Merge remote-tracking branch 'origin/release/v7.3.0' into develop 2022-12-12 11:37:20 +03:00
1ed96f295a Fix unzip without path 2022-12-11 18:36:02 +03:00
b3e95df084 Fix pro file 2022-12-11 18:21:23 +03:00
2942452a61 unzip fix + add tests 2022-12-11 18:00:14 +03:00
2212c3b26f Fix chdir 2022-12-05 03:28:21 +03:00
7efd8f5962 Merge pull request #1080 from ONLYOFFICE/release/v7.3.0
Fix build
2022-11-24 10:43:55 +03:00
e544845048 Merge pull request #1079 from ONLYOFFICE/release/v7.3.0
Fix build
2022-11-24 10:02:56 +03:00
26c2029300 Merge pull request #1077 from ONLYOFFICE/release/v7.3.0
Release/v7.3.0
2022-11-23 19:25:39 +03:00
3e092303c1 Merge branch 'release/v7.3.0' into develop 2022-11-23 10:47:04 +03:00
d173bfa1be [x2t] For bug 55472 2022-11-07 14:51:50 +03:00
c971cc1199 Change project params 2022-11-05 13:48:47 +03:00
0d95984c2a Change framework version (4.7.5 => 4.5) 2022-11-05 13:42:04 +03:00
e4d8ee832f Merge pull request #1064 from ONLYOFFICE/release/v7.3.0
Release/v7.3.0
2022-11-04 22:20:37 +03:00
0a1e90958c Added base classes for table decoding.
Added a Converter class for use in various objects.
Added additional comments to the code.
Added tasks under the //todo label.
2022-10-20 14:00:12 +03:00
742ed66df1 Refactoring. Optimized operating logic. Conversion time is reduced. 2022-10-14 15:06:40 +03:00
9c0b3b33c4 Merge pull request #1046 from ONLYOFFICE/hotfix/v7.2.1
Hotfix/v7.2.1
2022-10-02 21:54:35 +03:00
e35a27e9dc Added recognition of Diacritical Symbols.
Paragraphs are allocated to shapes based on the distance between them.
2022-09-26 13:38:52 +03:00
cc69b4b830 All paragraphs on one page add to general text shape now. 2022-09-26 13:38:52 +03:00
35cc9e4f20 Added new TextAssociationType - tatParagraphToShape.
Added changes to logic of determing paragraphs.
Some fixes 6.
2022-09-26 13:38:51 +03:00
7a276227d3 Modified the packing of lines by paragraphs and the definition of the type of paragraph alignment. 2022-09-26 13:38:51 +03:00
791be217af Fix problem with determine of font name. 2022-09-26 13:38:51 +03:00
b4bc017fc8 [xlsb][write] add Pivots 2022-06-29 14:49:21 +03:00
7ee3a81c7c [xlsb][write] add ExternalLinks 2022-06-25 13:05:45 +03:00
66e35a9c0e [xlsb][write] add slicers. slicerCaches, FRT parts for some objects 2022-06-22 22:34:11 +03:00
5f43e353f6 [xlsb][write] fix writing comments (workBookComments.bin not saving!) 2022-06-16 13:16:54 +03:00
ca5724f6fb [xlsb][write] add comment 2022-06-14 19:14:38 +03:00
91d2d3cf72 [xlsb][write] add Connections 2022-06-10 11:09:34 +03:00
101390bb16 [xlsb][write] add queryTable 2022-06-03 19:36:05 +03:00
2b7290468a [xlsb][write] add chartSheet 2022-06-02 14:51:52 +03:00
0730423db5 [xlsb][write] fixes formulas, exceptions 2022-06-01 01:14:06 +03:00
76b8b83952 Merge remote-tracking branch 'origin/feature/odf_3' into feature/odf_4 2022-05-30 13:23:27 +03:00
e79c577a14 Fonts 2022-05-30 12:42:47 +04:00
f67c76eef0 Fonts 2022-05-30 12:41:10 +04:00
256825c1e8 [xlsb][write] add parser for table formula 2022-05-26 20:24:53 +03:00
35b7a817f6 Merge remote-tracking branch 'origin/feature/odf_3' into feature/odf_4 2022-05-25 10:36:43 +03:00
569ef80535 Fonts and size 2022-05-24 18:16:56 +04:00
eda9f4637c [xlsb][write] add Table 2022-05-20 15:50:58 +03:00
3a3e8bb169 [xlsb][write] fix bug with DXFs (LPWideString writing, and "u" tag for font) 2022-05-19 00:32:42 +03:00
67ed846a63 [xlsb][write] fix bugs DXFs 2022-05-18 20:31:22 +03:00
70ecd637fa [xlsb][write] add deserialize and writing DXFs 2022-05-16 21:30:24 +03:00
affd63ee09 Fonts and size 2022-05-13 15:58:14 +04:00
da1f26f028 Fonts and size 2022-05-13 14:00:06 +04:00
de3f61b02c [xlsb][write] fix styles (font index, vertical aligment) 2022-05-11 13:33:31 +03:00
b62bab2efe [xlsb][write] fix font 2022-05-07 11:29:13 +03:00
6bec943712 [xlsb][write] fix fonts for Si in SharedStrings 2022-05-05 18:56:53 +03:00
3e512ea620 [xlsb][write] fix for Style property 2022-05-05 13:25:16 +03:00
9dae5286fd [xlsb][write] add Type Bin, add toBin in Styles 2022-05-01 20:04:08 +03:00
0ef1791261 [xlsb][write] add Styles (recors and unions part) without Differential Formatting (DXFs), add FRTWORKBOOK, FRTWORKSHEET (recors and unions part) 2022-04-29 16:06:30 +03:00
817b91e1e8 [xlsb][write] fix bugs with formulas, and value of some property 2022-04-26 20:32:51 +03:00
e18016e764 [xlsb][write] add .Bin type for worksheet, sharedStrings. Add writeToXlsx flag 2022-04-25 22:30:48 +03:00
5dc27cdb2e [xlsb][write] add branch for xlsb in isOfficeFile 2022-04-25 22:27:06 +03:00
fb2a323179 [xlsb][write] add sharedStrings 2022-04-22 16:43:56 +03:00
690d83e1d4 [xlsb][write] add DataValidation, OleObjects, Controls, SheetPr, Picture, RowBreaks, ColBreaks, DataConsolidate, ProtectedRanges 2022-04-22 00:22:43 +03:00
4a0ad3aa09 [xlsb][write] add autofilter, conditionalFormatting 2022-04-20 22:26:04 +03:00
230b11a060 colorized log and lim 2022-04-20 17:29:15 +04:00
4d7a9341f5 [xlsb][write] add part of worksheet (toBin functions) 2022-04-15 15:55:18 +03:00
b3b1b89b1f colorized diacritics 2022-04-14 12:22:24 +04:00
aadea510b0 colorized formulas 2022-04-13 10:20:12 +04:00
dc9db9c4fc colorized math formulas 2022-04-11 21:33:05 +04:00
ca1243b328 [xlsb][write] add writeField, saveContent, save functions for workSheetStream (unions, records, structs) 2022-04-11 19:37:37 +03:00
544ff4afea [xlsb][write] add all workbook (without writing ext part) 2022-04-05 20:14:57 +03:00
ddee54c7c5 color styles 2022-04-05 19:54:35 +04:00
ccbff2b46f [xlsb][write] add writeFields in all ptgs, add save in CellRangeRef 2022-04-04 17:32:34 +03:00
06027b0de0 [xlsb][write] add old parseStringFormula 2022-03-31 13:20:33 +03:00
c28e4a14d5 [xlsb][write] add write to wideString 2022-03-29 12:02:17 +03:00
e71caf0513 [xlsb][write] add calc prop writing 2022-03-28 14:19:04 +03:00
2d778e85f9 Merge branch 'feature/xlsb_write' of https://github.com/ONLYOFFICE/core.git 2022-03-25 00:08:35 +03:00
02ffd2c680 [xlsb][write] delete extra prop 2022-03-25 00:06:15 +03:00
e98067d279 . 2022-03-24 13:10:05 +03:00
3917422889 [xlsb][write] add logic for writing binary records/unions to stream/file. add test writing for piece of workbook 2022-03-24 09:10:38 +03:00
a98ad6fde8 [xlsb] add xlsx2lsb branch in converter 2022-03-18 13:26:44 +03:00
124439448c [xlsb] clean trash code 2022-03-18 13:22:18 +03:00
f44b313bb8 [X2tConverter_win_test] fix properties for build win_64 2022-03-15 17:46:56 +03:00
c6bbf92e5c [xlsb] free trash/useless code 2022-03-11 17:53:13 +03:00
11278 changed files with 578982 additions and 302156 deletions

162
.github/workflows/codeql.yaml vendored Normal file
View File

@ -0,0 +1,162 @@
name: "CodeQL Scanner"
on:
push:
branches:
- 'master'
- 'release/**'
- 'hotfix/**'
paths-ignore:
- '**/README.md'
- '**/LICENSE'
- '.github/**'
#pull_request:
# branches:
# - 'master'
# - 'release/**'
# - 'hotfix/**'
schedule:
- cron: '00 19 * * 5'
# This job take a lot of time, so if the number of worker
# processes from one branch or one PR exceeds 1, all previous
# running processes will be automatically canceled to avoid the accumulation
# of a large number of concurrent workers
concurrency:
group: codeql-${{ github.event.pull_request.number || github.ref_name }}
cancel-in-progress: true
env:
SOURCE_ROOT: "/build/core"
jobs:
analyze:
name: Analyze
runs-on: ${{ 'ubuntu-latest' }}
container:
image: ${{ matrix.image }}
options: --privileged
volumes:
- /usr/local/lib:/foovolume/android
- /usr/local/share:/foovolume/boost
- /usr/share:/foovolume/dotnet
- /opt:/foovolume/opt
- /opt/hostedtoolcache:/foovolume/tool
timeout-minutes: ${{ (matrix.language == 'swift' && 120) || 360 }}
permissions:
actions: read
contents: read
security-events: write
strategy:
fail-fast: false
matrix:
language: [ 'c-cpp' ]
image: ["ubuntu:20.04"]
# CodeQL supports [ 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'swift' ]
# Use only 'java-kotlin' to analyze code written in Java, Kotlin or both
# Use only 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
steps:
- uses: actions/setup-node@v4
with:
node-version: 20
- name: make free space in container
run: |
rm -rf /foovolume/android/android
rm -rf /foovolume/dotnet/dotnet
rm -rf /foovolume/boost/boost
rm -rf /foovolume/opt/ghc
rm -rf /foovolume/tool/*
df -h
# Prepare container environment
# Install some deps
# Set cache restore keys
- name: Prepare environment
id: prepare
shell: bash
env:
TZ: Etc/UTC
run: |
pwd
ls -la
ln -snf /usr/share/zoneinfo/$TZ /etc/localtime
echo $TZ > /etc/timezone
apt-get update
apt-get install -y python3 python2 sudo curl jq git
apt-get install -y python || true
rm /usr/bin/python || true
ln -s /usr/bin/python2 /usr/bin/python
mkdir -p /build
git clone --depth 1 \
--single-branch \
--branch ${{ github.base_ref || github.ref_name }} https://github.com/ONLYOFFICE/core.git ${SOURCE_ROOT}
git clone --depth 1 \
--single-branch \
--branch ${{ github.base_ref || github.ref_name }} https://github.com/ONLYOFFICE/build_tools.git /build/build_tools
echo "party-key=$(curl -L -H "Accept: application/vnd.github+json" \
-H "X-GitHub-Api-Version: 2022-11-28" \
"https://api.github.com/repos/ONLYOFFICE/core/commits?per_page=1&path=/Common/3dParty&sha=${{ github.base_ref || github.ref_name }}" | \
jq -r '.[].sha')" >> "$GITHUB_OUTPUT"
echo "qt-key=$(cat /build/build_tools/tools/linux/automate.py | egrep -m1 -o "qt_source_([0-9])?.([0-9])?.([0-9])?")" >> "$GITHUB_OUTPUT"
# Restore 3dParty from cache if cache key is match
- uses: actions/cache/restore@v3
id: restore-3d
with:
path: /build/core/Common/3dParty
key: 3dParty-${{ steps.prepare.outputs.party-key }}
# Restore qt tool from cache if cache key is match
- uses: actions/cache/restore@v3
id: restore-qt
with:
path: /build/build_tools/tools/linux/qt_build
key: qt-${{ steps.prepare.outputs.qt-key }}
# NOTE:
# init codeql with custom source-root dir
# because sources code was checkout with git from cli
# NOT with checkout action
# Also. Init and scan with codeql only if all cache hit
# otherwise will no initialization, just build and cache depends
- name: Initialize CodeQL
if: >
steps.restore-3d.outputs.cache-hit == 'true'
&& steps.restore-qt.outputs.cache-hit == 'true'
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
source-root: ${{ env.SOURCE_ROOT }}
- name: build
shell: bash
run: |
cd /build/build_tools/tools/linux
python3 ./automate.py core
- name: Perform CodeQL Analysis
if: >
steps.restore-3d.outputs.cache-hit == 'true'
&& steps.restore-qt.outputs.cache-hit == 'true'
uses: github/codeql-action/analyze@v3
with:
category: "/language:${{matrix.language}}"
# Make new 3dParty cache if restore action do not restore any cache
- uses: actions/cache/save@v3
if: steps.restore-3d.outputs.cache-hit != 'true'
id: save-3d
with:
path: /build/core/Common/3dParty
key: 3dParty-${{ steps.prepare.outputs.party-key }}
# Make new qt tool cache if restore action do not restore any cache
- uses: actions/cache/save@v3
if: steps.restore-qt.outputs.cache-hit != 'true'
id: save-qt
with:
path: /build/build_tools/tools/linux/qt_build
key: qt-${{ steps.prepare.outputs.qt-key }}

2
.gitignore vendored
View File

@ -40,7 +40,7 @@ Thumbs.db
*.opendb
.vs
.vscode
DesktopEditor/fontengine/js/common/freetype-2.10.4
*_resource.rc

18
3DPARTY.md Normal file
View File

@ -0,0 +1,18 @@
## Third-party
- boost ([BSL](https://raw.githubusercontent.com/boostorg/boost/master/LICENSE_1_0.txt))
- icu ([UNICODE LICENSE V3](https://raw.githubusercontent.com/unicode-org/icu/main/LICENSE))
- freetype ([FTL](https://raw.githubusercontent.com/freetype/freetype/master/docs/FTL.TXT))
- harfbuzz ([MIT](https://raw.githubusercontent.com/harfbuzz/harfbuzz/main/COPYING))
- hyphen ([MPL](https://raw.githubusercontent.com/hunspell/hyphen/master/COPYING))
- hunspell ([MPL](https://raw.githubusercontent.com/hunspell/hunspell/master/COPYING.MPL))
- gumbo ([Apache-2.0](https://raw.githubusercontent.com/google/gumbo-parser/master/COPYING))
- katana ([MIT](https://raw.githubusercontent.com/jasenhuang/katana-parser/master/LICENSE))
- cximage ([CXIMAGE LICENCE](https://raw.githubusercontent.com/movableink/cximage/master/license.txt))
- openjpeg ([2-clause BSD License](https://raw.githubusercontent.com/uclouvain/openjpeg/master/LICENSE))
- socket.io-client-cpp ([MIT](https://raw.githubusercontent.com/socketio/socket.io-client-cpp/master/LICENSE))
- curl ([CURL LICENCE](https://raw.githubusercontent.com/curl/curl/master/COPYING))
- cryptopp ([BSL](https://raw.githubusercontent.com/weidai11/cryptopp/master/License.txt))
- openssl ([Apache-2.0](https://raw.githubusercontent.com/openssl/openssl/master/LICENSE.txt))
- v8 ([3-clause BSD License](https://raw.githubusercontent.com/v8/v8/main/LICENSE))

View File

@ -1,9 +1,20 @@
INCLUDEPATH += $$PWD/build/$$CORE_BUILDS_PLATFORM_PREFIX/include
CORE_BOOST_LIBS = $$PWD/build/$$CORE_BUILDS_PLATFORM_PREFIX/lib
core_ios:CONFIG += disable_enum_constexpr_conversion
core_android:CONFIG += disable_enum_constexpr_conversion
core_mac:CONFIG += disable_enum_constexpr_conversion
core_android {
INCLUDEPATH += $$PWD/build/android/include
CORE_BOOST_LIBS = $$PWD/build/android/lib/$$CORE_BUILDS_PLATFORM_PREFIX
DEFINES += "_HAS_AUTO_PTR_ETC=0"
}
disable_enum_constexpr_conversion {
QMAKE_CFLAGS += -Wno-enum-constexpr-conversion
QMAKE_CXXFLAGS += -Wno-enum-constexpr-conversion
}
bundle_xcframeworks {

View File

@ -1,326 +0,0 @@
#!/bin/bash
cd boost_1_72_0
OUTPUT_DIR="../build/android"
BOOST_LIBS="filesystem system date_time regex"
CPPSTD="-std=c++11 -frtti -fexceptions"
# Must set these after parseArgs to fill in overriden values
# Todo: -g -DNDEBUG are for debug builds only...
# Boost.test defines are needed to build correct instrumentable boost_unit_test_framework static lib
# it does not affect the functionality of <boost/test/included/unit_test.hpp> single-header usage.
# See http://www.boost.org/doc/libs/1_66_0/libs/test/doc/html/boost_test/adv_scenarios/static_lib_customizations/entry_point.html
EXTRA_FLAGS="-DBOOST_AC_USE_PTHREADS -DBOOST_SP_USE_PTHREADS \
-DBOOST_TEST_NO_MAIN -DBOOST_TEST_ALTERNATIVE_INIT_API -DANDROID_STL=c++_static \
-Wno-unused-local-typedef"
EXTRA_ANDROID_FLAGS="$EXTRA_FLAGS"
if [[ -n "$USE_CXX11_ABI" ]]; then
EXTRA_LINUX_FLAGS="$EXTRA_FLAGS -D_GLIBCXX_USE_CXX11_ABI=$USE_CXX11_ABI"
else
EXTRA_LINUX_FLAGS="$EXTRA_FLAGS"
fi
doneSection()
{
echo
echo "Done"
echo "================================================================="
echo
}
bootstrapBoost()
{
BOOTSTRAP_LIBS=$BOOST_LIBS
BOOST_LIBS_COMMA=$(echo $BOOTSTRAP_LIBS | sed -e "s/ /,/g")
echo "Bootstrapping for $1 (with libs $BOOST_LIBS_COMMA)"
./bootstrap.sh --with-libraries=$BOOST_LIBS_COMMA
doneSection
}
generateAndroidUserConfig()
{
HOSTOS="$(uname | awk '{ print $1}' | tr [:upper:] [:lower:])-" # darwin or linux
OSARCH="$(uname -m)"
# Boost doesn't build with <compileflags>-Werror
# Reported to boost-users@lists.boost.org
cat > "./tools/build/src/user-config.jam" <<EOF
using clang : 5.0~x86
: $ANDROID_NDK_ROOT/toolchains/llvm/prebuilt/$HOSTOS$OSARCH/bin/clang++ $EXTRA_ANDROID_FLAGS
:
<architecture>x86 <target-os>android
<compileflags>--target=i686-none-linux-android
<compileflags>--gcc-toolchain=$ANDROID_NDK_ROOT/toolchains/x86-4.9/prebuilt/$HOSTOS$OSARCH
<compileflags>--sysroot=$ANDROID_NDK_ROOT/sysroot
<compileflags>-isystem <compileflags>$ANDROID_NDK_ROOT/sources/cxx-stl/llvm-libc++/include
<compileflags>-isystem <compileflags>$ANDROID_NDK_ROOT/sources/cxx-stl/llvm-libc++abi/include
<compileflags>-isystem <compileflags>$ANDROID_NDK_ROOT/sources/android/support/include
<compileflags>-isystem <compileflags>$ANDROID_NDK_ROOT/sysroot/usr/include
<compileflags>-isystem <compileflags>$ANDROID_NDK_ROOT/sysroot/usr/include/i686-linux-android
<compileflags>-DANDROID
<compileflags>-D__ANDROID_API__=19
<compileflags>-ffunction-sections
<compileflags>-funwind-tables
<compileflags>-fstack-protector-strong
<compileflags>-fno-limit-debug-info
<compileflags>-fPIC
<compileflags>-no-canonical-prefixes
<compileflags>-mstackrealign
<compileflags>-Wa,--noexecstack
<compileflags>-Wformat
<compileflags>-Werror=format-security
<compileflags>-Wall
<compileflags>-Wshadow
;
using clang : 5.0~x86_64
: $ANDROID_NDK_ROOT/toolchains/llvm/prebuilt/$HOSTOS$OSARCH/bin/clang++ $EXTRA_ANDROID_FLAGS
:
<architecture>x86 <target-os>android
<compileflags>--target=x86_64-none-linux-android
<compileflags>--gcc-toolchain=$ANDROID_NDK_ROOT/toolchains/x86_64-4.9/prebuilt/$HOSTOS$OSARCH
<compileflags>--sysroot=$ANDROID_NDK_ROOT/sysroot
<compileflags>-isystem <compileflags>$ANDROID_NDK_ROOT/sources/cxx-stl/llvm-libc++/include
<compileflags>-isystem <compileflags>$ANDROID_NDK_ROOT/sources/cxx-stl/llvm-libc++abi/include
<compileflags>-isystem <compileflags>$ANDROID_NDK_ROOT/sources/android/support/include
<compileflags>-isystem <compileflags>$ANDROID_NDK_ROOT/sysroot/usr/include
<compileflags>-isystem <compileflags>$ANDROID_NDK_ROOT/sysroot/usr/include/x86_64-linux-android
<compileflags>-DANDROID
<compileflags>-D__ANDROID_API__=21
<compileflags>-ffunction-sections
<compileflags>-funwind-tables
<compileflags>-fstack-protector-strong
<compileflags>-fno-limit-debug-info
<compileflags>-fPIC
<compileflags>-no-canonical-prefixes
<compileflags>-mstackrealign
<compileflags>-Wa,--noexecstack
<compileflags>-Wformat
<compileflags>-Werror=format-security
<compileflags>-Wall
<compileflags>-Wshadow
;
using clang : 5.0~arm
: $ANDROID_NDK_ROOT/toolchains/llvm/prebuilt/$HOSTOS$OSARCH/bin/clang++ $EXTRA_ANDROID_FLAGS
:
<architecture>arm <target-os>android
<compileflags>--target=armv7-none-linux-androideabi
<compileflags>--gcc-toolchain=$ANDROID_NDK_ROOT/toolchains/arm-linux-androideabi-4.9/prebuilt/$HOSTOS$OSARCH
<compileflags>--sysroot=$ANDROID_NDK_ROOT/sysroot
<compileflags>-isystem <compileflags>$ANDROID_NDK_ROOT/sources/cxx-stl/llvm-libc++/include
<compileflags>-isystem <compileflags>$ANDROID_NDK_ROOT/sources/cxx-stl/llvm-libc++abi/include
<compileflags>-isystem <compileflags>$ANDROID_NDK_ROOT/sources/android/support/include
<compileflags>-isystem <compileflags>$ANDROID_NDK_ROOT/sysroot/usr/include
<compileflags>-isystem <compileflags>$ANDROID_NDK_ROOT/sysroot/usr/include/arm-linux-androideabi
<compileflags>-DANDROID
<compileflags>-D__ANDROID_API__=19
<compileflags>-ffunction-sections
<compileflags>-funwind-tables
<compileflags>-fstack-protector-strong
<compileflags>-fno-limit-debug-info
<compileflags>-fPIC
<compileflags>-fno-integrated-as
<compileflags>-no-canonical-prefixes
<compileflags>-Wa,--noexecstack
<compileflags>-Wformat
<compileflags>-Werror=format-security
<compileflags>-Wall
<compileflags>-Wshadow
<compileflags>-march=armv7-a
<compileflags>-mfloat-abi=softfp
<compileflags>-mfpu=vfpv3-d16
<compileflags>-mthumb
;
using clang : 5.0~arm64
: $ANDROID_NDK_ROOT/toolchains/llvm/prebuilt/$HOSTOS$OSARCH/bin/clang++ $EXTRA_ANDROID_FLAGS
:
<architecture>arm <target-os>android
<compileflags>--target=aarch64-none-linux-android
<compileflags>--gcc-toolchain=$ANDROID_NDK_ROOT/toolchains/aarch64-linux-android-4.9/prebuilt/$HOSTOS$OSARCH
<compileflags>--sysroot=$ANDROID_NDK_ROOT/sysroot
<compileflags>-isystem <compileflags>$ANDROID_NDK_ROOT/sources/cxx-stl/llvm-libc++/include
<compileflags>-isystem <compileflags>$ANDROID_NDK_ROOT/sources/cxx-stl/llvm-libc++abi/include
<compileflags>-isystem <compileflags>$ANDROID_NDK_ROOT/sources/android/support/include
<compileflags>-isystem <compileflags>$ANDROID_NDK_ROOT/sysroot/usr/include
<compileflags>-isystem <compileflags>$ANDROID_NDK_ROOT/sysroot/usr/include/aarch64-linux-android
<compileflags>-DANDROID
<compileflags>-D__ANDROID_API__=21
<compileflags>-ffunction-sections
<compileflags>-funwind-tables
<compileflags>-fstack-protector-strong
<compileflags>-fno-limit-debug-info
<compileflags>-fPIC
<compileflags>-no-canonical-prefixes
<compileflags>-Wa,--noexecstack
<compileflags>-Wformat
<compileflags>-Werror=format-security
<compileflags>-Wall
<compileflags>-Wshadow
;
EOF
}
buildBoost_Android()
{
mkdir -p $OUTPUT_DIR
echo > ${OUTPUT_DIR}/android-build.log
if [[ -z "$ANDROID_NDK_ROOT" ]]; then
echo "Must specify ANDROID_NDK_ROOT"
exit 1
fi
export NO_BZIP2=1
# build libicu if locale requested but not provided
# if echo $LIBRARIES | grep locale; then
# if [ -e libiconv-libicu-android ]; then
# echo "ICONV and ICU already compiled"
# else
# echo "boost_locale selected - compiling ICONV and ICU"
# git clone https://github.com/pelya/libiconv-libicu-android.git
# cd libiconv-libicu-android
# ./build.sh || exit 1
# cd ..
# fi
# fi
echo clean
./b2 --clean
echo Building release x86 Boost for Android Emulator
./b2 --build-dir=android-build --stagedir=android-build/stage \
--prefix="$OUTPUT_DIR" \
--libdir="$OUTPUT_DIR/lib/x86" toolset=clang-5.0~x86 \
architecture=x86 target-os=android define=_LITTLE_ENDIAN \
optimization=speed \
address-model=32 variant=release cxxflags="${CPPSTD}" \
link=static threading=multi install >> "${OUTPUT_DIR}/android-build.log" 2>&1
if [ $? != 0 ]; then echo "Error staging Android. Check ${OUTPUT_DIR}/android-build.log"; exit 1; fi
doneSection
echo Building release x86_64 Boost for Android Emulator
./b2 --build-dir=android-build --stagedir=android-build/stage \
--prefix="$OUTPUT_DIR" \
--libdir="$OUTPUT_DIR/lib/x86_64" toolset=clang-5.0~x86_64 \
architecture=x86 target-os=android define=_LITTLE_ENDIAN \
optimization=speed \
address-model=64 variant=release cxxflags="${CPPSTD}" \
link=static threading=multi install >> "${OUTPUT_DIR}/android-build.log" 2>&1
if [ $? != 0 ]; then echo "Error staging Android. Check ${OUTPUT_DIR}/android-build.log"; exit 1; fi
doneSection
echo Building release armv7 Boost for Android
./b2 --build-dir=android-build --stagedir=android-build/stage \
--prefix="$OUTPUT_DIR" \
--libdir="$OUTPUT_DIR/lib/armeabi-v7a" toolset=clang-5.0~arm \
abi=aapcs architecture=arm address-model=32 binary-format=elf threading=multi \
optimization=space \
target-os=android variant=release cxxflags="${CPPSTD}" \
link=static install >> "${OUTPUT_DIR}/android-build.log" 2>&1
if [ $? != 0 ]; then echo "Error installing Android. Check ${OUTPUT_DIR}/android-build.log"; exit 1; fi
doneSection
echo Building release arm64 Boost for Android
./b2 --build-dir=android-build --stagedir=android-build/stage \
--prefix="$OUTPUT_DIR" \
--libdir="$OUTPUT_DIR/lib/arm64-v8a" toolset=clang-5.0~arm64 \
abi=aapcs architecture=arm address-model=64 binary-format=elf threading=multi \
optimization=space \
target-os=android variant=release cxxflags="${CPPSTD}" \
link=static install >> "${OUTPUT_DIR}/android-build.log" 2>&1
if [ $? != 0 ]; then echo "Error installing Android. Check ${OUTPUT_DIR}/android-build.log"; exit 1; fi
doneSection
}
buildBoost_Android_debug()
{
mkdir -p $OUTPUT_DIR
echo > ${OUTPUT_DIR}/android-build.log
export NO_BZIP2=1
# build libicu if locale requested but not provided
# if echo $LIBRARIES | grep locale; then
# if [ -e libiconv-libicu-android ]; then
# echo "ICONV and ICU already compiled"
# else
# echo "boost_locale selected - compiling ICONV and ICU"
# git clone https://github.com/pelya/libiconv-libicu-android.git
# cd libiconv-libicu-android
# ./build.sh || exit 1
# cd ..
# fi
# fi
echo Building debug x86 Boost for Android Emulator
./b2 $THREADS --build-dir=android-build --stagedir=android-build/stage \
--prefix="$OUTPUT_DIR" \
--libdir="$OUTPUT_DIR/lib/debug/x86" toolset=clang-5.0~x86 \
architecture=x86 target-os=android define=_LITTLE_ENDIAN \
optimization=speed \
address-model=32 variant=debug cxxflags="${CPPSTD}" \
link=static threading=multi install >> "${OUTPUT_DIR}/android-build.log" 2>&1
if [ $? != 0 ]; then echo "Error staging Android. Check ${OUTPUT_DIR}/android-build.log"; exit 1; fi
doneSection
echo Building debug x86_64 Boost for Android Emulator
./b2 $THREADS --build-dir=android-build --stagedir=android-build/stage \
--prefix="$OUTPUT_DIR" \
--libdir="$OUTPUT_DIR/lib/debug/x86_64" toolset=clang-5.0~x86_64 \
architecture=x86 target-os=android define=_LITTLE_ENDIAN \
optimization=speed \
address-model=64 variant=debug cxxflags="${CPPSTD}" \
link=static threading=multi install >> "${OUTPUT_DIR}/android-build.log" 2>&1
if [ $? != 0 ]; then echo "Error staging Android. Check ${OUTPUT_DIR}/android-build.log"; exit 1; fi
doneSection
echo Building debug armv7 Boost for Android
./b2 $THREADS --build-dir=android-build --stagedir=android-build/stage \
--prefix="$OUTPUT_DIR" \
--libdir="$OUTPUT_DIR/lib/debug/armeabi-v7a" toolset=clang-5.0~arm \
abi=aapcs architecture=arm address-model=32 binary-format=elf threading=multi \
optimization=space \
target-os=android variant=debug cxxflags="${CPPSTD}" \
link=static install >> "${OUTPUT_DIR}/android-build.log" 2>&1
if [ $? != 0 ]; then echo "Error installing Android. Check ${OUTPUT_DIR}/android-build.log"; exit 1; fi
doneSection
echo Building debug arm64 Boost for Android
./b2 $THREADS --build-dir=android-build --stagedir=android-build/stage \
--prefix="$OUTPUT_DIR" \
--libdir="$OUTPUT_DIR/lib/debug/arm64-v8a" toolset=clang-5.0~arm64 \
abi=aapcs architecture=arm address-model=64 binary-format=elf threading=multi \
optimization=space \
target-os=android variant=debug cxxflags="${CPPSTD}" \
link=static install >> "${OUTPUT_DIR}/android-build.log" 2>&1
if [ $? != 0 ]; then echo "Error installing Android. Check ${OUTPUT_DIR}/android-build.log"; exit 1; fi
doneSection
}
bootstrapBoost
generateAndroidUserConfig
buildBoost_Android
#buildBoost_Android_debug
echo "Completed successfully"

View File

@ -4,11 +4,15 @@ Thanks for taking the time to report an issue. Reporting issues helps us improve
Please do not ask questions in the bug tracker. Please ask questions on the Crypto++ Users List at http://groups.google.com/forum/#!forum/cryptopp-users.
Please do not ask questions about unsupported build systems, like Autotools, CMake, Conan and NuGet. They are other people's projects. We don't know anything about them.
Please do not ask questions at Stack Overflow. We do not patrol Stack Overflow. We will not be able to answer your question.
There is a wiki page with information on filing useful bug reports. If you have some time please visit http://www.cryptopp.com/wiki/Bug_Report on the wiki. The executive summary is:
* State the operating system and version (Ubutnu 17 x86_64, Windows 7 Professional x64, etc)
* State the version of the Crypto++ library (Crypto++ 5.6.5, Master, etc)
* State how you built the library (Makefile, Cmake, distro, etc)
* State the version of the Crypto++ library (Crypto++ 7.0, Master, etc)
* State how you built the library (Visual Studio, Makefile, distro provided, etc)
* Show a typical command line (the output of the compiler for cryptlib.cpp)
* Show the link command (the output of the linker for libcryptopp.so or cryptest.exe)
* Show the exact error message you are receiving (copy and paste it); or

View File

@ -1,4 +1,4 @@
// 3way.cpp - modifed by Wei Dai from Joan Daemen's 3way.c
// 3way.cpp - modified by Wei Dai from Joan Daemen's 3way.c
// The original code and all modifications are in the public domain.
#include "pch.h"

View File

@ -1,4 +1,4 @@
# Doxyfile 1.8.9
# Doxyfile 1.8.13
# This file describes the settings to be used by the documentation system
# doxygen (www.doxygen.org) for a project.
@ -12,9 +12,6 @@
# For lists, items can also be appended using:
# TAG += value [value, ...]
# Values that contain spaces should be placed between quotes (\" \").
#
# The file can be upgraded to the latest version of Doxygen with `doxygen -u <file`
#
#---------------------------------------------------------------------------
# Project related configuration options
@ -41,14 +38,13 @@ PROJECT_NAME = Crypto++
# could be handy for archiving the generated documentation or if some version
# control system is used.
PROJECT_NUMBER = 7.0
PROJECT_NUMBER = 8.7
# Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer a
# quick idea about the purpose of the project. Keep the description short.
# Without the HTML escape characters, Doxygen concatenates the string below...
PROJECT_BRIEF = Free&nbsp;C&#43;&#43;&nbsp;class&nbsp;library&nbsp;of&nbsp;cryptographic&nbsp;schemes
PROJECT_BRIEF = "Free&nbsp;C&#43;&#43;&nbsp;class&nbsp;library&nbsp;of&nbsp;cryptographic&nbsp;schemes"
# With the PROJECT_LOGO tag one can specify a logo or an icon that is included
# in the documentation. The maximum height of the logo should not exceed 55
@ -235,12 +231,6 @@ TAB_SIZE = 4
ALIASES =
# This tag can be used to specify a number of word-keyword mappings (TCL only).
# A mapping has the form "name=value". For example adding "class=itcl::class"
# will allow you to use the command class in the itcl::class meaning.
TCL_SUBST =
# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources
# only. Doxygen will then generate output that is more tailored for C. For
# instance, some of the names that are used will be different. The list of all
@ -298,6 +288,15 @@ EXTENSION_MAPPING =
MARKDOWN_SUPPORT = NO
# When the TOC_INCLUDE_HEADINGS tag is set to a non-zero value, all headings up
# to that level are automatically included in the table of contents, even if
# they do not have an id attribute.
# Note: This feature currently applies only to Markdown headings.
# Minimum value: 0, maximum value: 99, default value: 0.
# This tag requires that the tag MARKDOWN_SUPPORT is set to YES.
TOC_INCLUDE_HEADINGS = 0
# When enabled doxygen tries to link words that correspond to documented
# classes, or namespaces to their corresponding documentation. Such a link can
# be prevented in individual cases by putting a % sign in front of the word or
@ -348,6 +347,13 @@ IDL_PROPERTY_SUPPORT = NO
DISTRIBUTE_GROUP_DOC = NO
# If one adds a struct or class to a group and this option is enabled, then also
# any nested class or struct is added to the same group. By default this option
# is disabled and one has to add nested compounds explicitly via \ingroup.
# The default value is: NO.
GROUP_NESTED_COMPOUNDS = NO
# Set the SUBGROUPING tag to YES to allow class member groups of the same type
# (for instance a group of public functions) to be put as a subgroup of that
# type (e.g. under the Public Functions section). Set it to NO to prevent
@ -737,6 +743,12 @@ WARN_IF_DOC_ERROR = YES
WARN_NO_PARAMDOC = NO
# If the WARN_AS_ERROR tag is set to YES then doxygen will immediately stop when
# a warning is encountered.
# The default value is: NO.
WARN_AS_ERROR = NO
# The WARN_FORMAT tag determines the format of the warning messages that doxygen
# can produce. The string should contain the $file, $line, and $text tags, which
# will be replaced by the file and line number from which the warning originated
@ -760,14 +772,13 @@ WARN_LOGFILE =
# The INPUT tag is used to specify the files and/or directories that contain
# documented source files. You may enter file names like myfile.cpp or
# directories like /usr/src/myproject. Separate the files or directories with
# spaces.
# spaces. See also FILE_PATTERNS and EXTENSION_MAPPING
# Note: If this tag is empty the current directory is searched.
INPUT = . \
GNUmakefile \
GNUmakefile-cross \
rdrand.asm \
rdrand.s
rdrand.asm
# This tag can be used to specify the character encoding of the source files
# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses
@ -780,12 +791,17 @@ INPUT_ENCODING = UTF-8
# If the value of the INPUT tag contains directories, you can use the
# FILE_PATTERNS tag to specify one or more wildcard patterns (like *.cpp and
# *.h) to filter out the source-files in the directories. If left blank the
# following patterns are tested:*.c, *.cc, *.cxx, *.cpp, *.c++, *.java, *.ii,
# *.ixx, *.ipp, *.i++, *.inl, *.idl, *.ddl, *.odl, *.h, *.hh, *.hxx, *.hpp,
# *.h++, *.cs, *.d, *.php, *.php4, *.php5, *.phtml, *.inc, *.m, *.markdown,
# *.md, *.mm, *.dox, *.py, *.f90, *.f, *.for, *.tcl, *.vhd, *.vhdl, *.ucf,
# *.qsf, *.as and *.js.
# *.h) to filter out the source-files in the directories.
#
# Note that for custom extensions or not directly supported extensions you also
# need to set EXTENSION_MAPPING for the extension otherwise the files are not
# read by doxygen.
#
# If left blank the following patterns are tested:*.c, *.cc, *.cxx, *.cpp,
# *.c++, *.java, *.ii, *.ixx, *.ipp, *.i++, *.inl, *.idl, *.ddl, *.odl, *.h,
# *.hh, *.hxx, *.hpp, *.h++, *.cs, *.d, *.php, *.php4, *.php5, *.phtml, *.inc,
# *.m, *.markdown, *.md, *.mm, *.dox, *.py, *.pyw, *.f90, *.f95, *.f03, *.f08,
# *.f, *.for, *.tcl, *.vhd, *.vhdl, *.ucf and *.qsf.
FILE_PATTERNS = *.h \
*.cpp
@ -803,7 +819,7 @@ RECURSIVE = NO
# Note that relative paths are relative to the directory from which doxygen is
# run.
EXCLUDE = adhoc.cpp cryptlib_bds.cpp
EXCLUDE = adhoc.cpp
# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or
# directories that are symbolic links (a Unix file system feature) are excluded
@ -819,7 +835,8 @@ EXCLUDE_SYMLINKS = NO
# Note that the wildcards are matched against the file with absolute path, so to
# exclude all test directories for example use the pattern */test/*
EXCLUDE_PATTERNS = *test* *validat*
EXCLUDE_PATTERNS = *test* \
*validat*
# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names
# (namespaces, classes, functions, etc.) that should be excluded from the
@ -872,6 +889,10 @@ IMAGE_PATH =
# Note that the filter must not add or remove lines; it is applied before the
# code is scanned, but not when the output code is generated. If lines are added
# or removed, the anchors will not be placed correctly.
#
# Note that for custom extensions or not directly supported extensions you also
# need to set EXTENSION_MAPPING for the extension otherwise the files are not
# properly processed by doxygen.
INPUT_FILTER =
@ -881,6 +902,10 @@ INPUT_FILTER =
# (like *.cpp=my_cpp_filter). See INPUT_FILTER for further information on how
# filters are used. If the FILTER_PATTERNS tag is empty or if none of the
# patterns match the file name, INPUT_FILTER is applied.
#
# Note that for custom extensions or not directly supported extensions you also
# need to set EXTENSION_MAPPING for the extension otherwise the files are not
# properly processed by doxygen.
FILTER_PATTERNS =
@ -992,6 +1017,25 @@ USE_HTAGS = NO
VERBATIM_HEADERS = YES
# If the CLANG_ASSISTED_PARSING tag is set to YES then doxygen will use the
# clang parser (see: http://clang.llvm.org/) for more accurate parsing at the
# cost of reduced performance. This can be particularly helpful with template
# rich C++ code for which doxygen's built-in parser lacks the necessary type
# information.
# Note: The availability of this option depends on whether or not doxygen was
# generated with the -Duse-libclang=ON option for CMake.
# The default value is: NO.
CLANG_ASSISTED_PARSING = NO
# If clang assisted parsing is enabled you can provide the compiler with command
# line options that you would normally use when invoking the compiler. Note that
# the include paths will already be set by doxygen for the files and directories
# specified with INPUT and INCLUDE_PATH.
# This tag requires that the tag CLANG_ASSISTED_PARSING is set to YES.
CLANG_OPTIONS =
#---------------------------------------------------------------------------
# Configuration options related to the alphabetical class index
#---------------------------------------------------------------------------
@ -1139,8 +1183,9 @@ HTML_COLORSTYLE_GAMMA = 80
# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML
# page will contain the date and time when the page was generated. Setting this
# to NO can help when comparing the output of multiple runs.
# The default value is: YES.
# to YES can help to show when doxygen was last run and thus if the
# documentation is up to date.
# The default value is: NO.
# This tag requires that the tag GENERATE_HTML is set to YES.
HTML_TIMESTAMP = YES
@ -1226,7 +1271,7 @@ DOCSET_PUBLISHER_NAME = Crypto++
# The default value is: NO.
# This tag requires that the tag GENERATE_HTML is set to YES.
GENERATE_HTMLHELP = YES
GENERATE_HTMLHELP = NO
# The CHM_FILE tag can be used to specify the file name of the resulting .chm
# file. You can add a path in front of the file if the result should not be
@ -1614,9 +1659,12 @@ COMPACT_LATEX = NO
PAPER_TYPE = a4
# The EXTRA_PACKAGES tag can be used to specify one or more LaTeX package names
# that should be included in the LaTeX output. To get the times font for
# instance you can specify
# EXTRA_PACKAGES=times
# that should be included in the LaTeX output. The package can be specified just
# by its name or with the correct syntax as to be used with the LaTeX
# \usepackage command. To get the times font for instance you can specify :
# EXTRA_PACKAGES=times or EXTRA_PACKAGES={times}
# To use the option intlimits with the amsmath package you can specify:
# EXTRA_PACKAGES=[intlimits]{amsmath}
# If left blank no extra packages will be included.
# This tag requires that the tag GENERATE_LATEX is set to YES.
@ -1719,6 +1767,14 @@ LATEX_SOURCE_CODE = NO
LATEX_BIB_STYLE = plain
# If the LATEX_TIMESTAMP tag is set to YES then the footer of each generated
# page will contain the date and time when the page was generated. Setting this
# to NO can help when comparing the output of multiple runs.
# The default value is: NO.
# This tag requires that the tag GENERATE_LATEX is set to YES.
LATEX_TIMESTAMP = NO
#---------------------------------------------------------------------------
# Configuration options related to the RTF output
#---------------------------------------------------------------------------
@ -2060,12 +2116,6 @@ EXTERNAL_GROUPS = YES
EXTERNAL_PAGES = YES
# The PERL_PATH should be the absolute path and name of the perl script
# interpreter (i.e. the result of 'which perl').
# The default file (with absolute path) is: /usr/bin/perl.
PERL_PATH = /usr/bin/perl
#---------------------------------------------------------------------------
# Configuration options related to the dot tool
#---------------------------------------------------------------------------
@ -2079,15 +2129,6 @@ PERL_PATH = /usr/bin/perl
CLASS_DIAGRAMS = YES
# You can define message sequence charts within doxygen comments using the \msc
# command. Doxygen will then run the mscgen tool (see:
# http://www.mcternan.me.uk/mscgen/)) to produce the chart and insert it in the
# documentation. The MSCGEN_PATH tag allows you to specify the directory where
# the mscgen tool resides. If left empty the tool is assumed to be found in the
# default search path.
MSCGEN_PATH =
# You can include diagrams made with dia in doxygen documentation. Doxygen will
# then run dia to produce the diagram and insert it in the documentation. The
# DIA_PATH tag allows you to specify the directory where the dia binary resides.
@ -2106,7 +2147,7 @@ HIDE_UNDOC_RELATIONS = YES
# http://www.graphviz.org/), a graph visualization toolkit from AT&T and Lucent
# Bell Labs. The other options in this section have no effect if this option is
# set to NO
# The default value is: NO.
# The default value is: YES.
HAVE_DOT = NO
@ -2128,7 +2169,7 @@ DOT_NUM_THREADS = 0
# The default value is: Helvetica.
# This tag requires that the tag HAVE_DOT is set to YES.
# DOT_FONTNAME = FreeSans.ttf
DOT_FONTNAME = Helvetica
# The DOT_FONTSIZE tag can be used to set the size (in points) of the font of
# dot graphs.
@ -2220,7 +2261,8 @@ INCLUDED_BY_GRAPH = YES
#
# Note that enabling this option will significantly increase the time of a run.
# So in most cases it will be better to enable call graphs for selected
# functions only using the \callgraph command.
# functions only using the \callgraph command. Disabling a call graph can be
# accomplished by means of the command \hidecallgraph.
# The default value is: NO.
# This tag requires that the tag HAVE_DOT is set to YES.
@ -2231,7 +2273,8 @@ CALL_GRAPH = NO
#
# Note that enabling this option will significantly increase the time of a run.
# So in most cases it will be better to enable caller graphs for selected
# functions only using the \callergraph command.
# functions only using the \callergraph command. Disabling a caller graph can be
# accomplished by means of the command \hidecallergraph.
# The default value is: NO.
# This tag requires that the tag HAVE_DOT is set to YES.
@ -2254,11 +2297,17 @@ GRAPHICAL_HIERARCHY = YES
DIRECTORY_GRAPH = YES
# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images
# generated by dot.
# generated by dot. For an explanation of the image formats see the section
# output formats in the documentation of the dot tool (Graphviz (see:
# http://www.graphviz.org/)).
# Note: If you choose svg you need to set HTML_FILE_EXTENSION to xhtml in order
# to make the SVG files visible in IE 9+ (other browsers do not have this
# requirement).
# Possible values are: png, jpg, gif and svg.
# Possible values are: png, png:cairo, png:cairo:cairo, png:cairo:gd, png:gd,
# png:gd:gd, jpg, jpg:cairo, jpg:cairo:gd, jpg:gd, jpg:gd:gd, gif, gif:cairo,
# gif:cairo:gd, gif:gd, gif:gd:gd, svg, png:gd, png:gd:gd, png:cairo,
# png:cairo:gd, png:cairo:cairo, png:cairo:gdiplus, png:gdiplus and
# png:gdiplus:gdiplus.
# The default value is: png.
# This tag requires that the tag HAVE_DOT is set to YES.
@ -2309,6 +2358,11 @@ DIAFILE_DIRS =
PLANTUML_JAR_PATH =
# When using plantuml, the PLANTUML_CFG_FILE tag can be used to specify a
# configuration file for plantuml.
PLANTUML_CFG_FILE =
# When using plantuml, the specified paths are searched for files specified by
# the !include statement in a plantuml block.

View File

@ -1,21 +1,26 @@
3way.cpp
3way.h
adhoc.cpp.proto
adv-simd.h
adv_simd.h
adler32.cpp
adler32.h
aes.h
aes_armv4.h
aes_armv4.S
algebra.cpp
algebra.h
algparam.cpp
algparam.h
allocate.cpp
allocate.h
arc4.cpp
arc4.h
ariatab.cpp
aria.cpp
aria-simd.cpp
aria_simd.cpp
aria.h
argnames.h
arm_simd.h
asn.cpp
asn.h
authenc.cpp
@ -30,9 +35,11 @@ bench.h
bds10.zip
bench1.cpp
bench2.cpp
bench3.cpp
bfinit.cpp
blake2.cpp
blake2-simd.cpp
blake2s_simd.cpp
blake2b_simd.cpp
blake2.h
blowfish.cpp
blowfish.h
@ -48,20 +55,36 @@ cbcmac.h
ccm.cpp
ccm.h
chacha.cpp
chacha_avx.cpp
chacha_simd.cpp
chacha.h
chachapoly.cpp
chachapoly.h
cham.cpp
cham_simd.cpp
cham.h
channels.cpp
channels.h
cmac.cpp
cmac.h
config.h
config_align.h
config_asm.h
config_cpu.h
config_cxx.h
config_dll.h
config_int.h
config_misc.h
config_ns.h
config_os.h
config_ver.h
cpu.cpp
cpu.h
crc.cpp
crc-simd.cpp
crc_simd.cpp
crc.h
cryptdll.vcxproj
cryptdll.vcxproj.filters
cryptest.sh
cryptest.sln
cryptest.vcxproj
cryptest.vcxproj.user
@ -73,6 +96,8 @@ cryptlib.h
cryptlib.vcxproj
cryptlib.vcxproj.filters
cryptopp.rc
darn.cpp
darn.h
datatest.cpp
default.cpp
default.h
@ -90,6 +115,13 @@ dlltest.vcxproj
dlltest.vcxproj.filters
dmac.h
drbg.h
donna.h
donna_32.h
donna_64.h
donna_sse.h
donna_32.cpp
donna_64.cpp
donna_sse.cpp
dsa.cpp
dsa.h
eax.cpp
@ -121,13 +153,14 @@ fips140.h
fipsalgt.cpp
fipstest.cpp
fltrimpl.h
gcm-simd.cpp
gcm_simd.cpp
gcm.cpp
gcm.h
gf256.cpp
gf256.h
gf2_32.cpp
gf2_32.h
gf2n_simd.cpp
gf2n.cpp
gf2n.h
gfpcrypt.cpp
@ -137,8 +170,14 @@ gost.h
gzip.cpp
gzip.h
hashfwd.h
hc128.cpp
hc128.h
hc256.cpp
hc256.h
hex.cpp
hex.h
hight.h
hight.cpp
hkdf.h
hmac.cpp
hmac.h
@ -158,8 +197,20 @@ kalynatab.cpp
kalyna.cpp
kalyna.h
keccak.cpp
keccak_core.cpp
keccak_simd.cpp
keccak.h
lubyrack.h
lea.cpp
lea_simd.cpp
lea.h
lsh256.cpp
lsh256_sse.cpp
lsh256_avx.cpp
lsh512.cpp
lsh512_sse.cpp
lsh512_avx.cpp
lsh.h
luc.cpp
luc.h
mars.cpp
@ -186,9 +237,7 @@ mqv.h
naclite.h
nbtheory.cpp
nbtheory.h
neon-simd.cpp
network.cpp
network.h
neon_simd.cpp
nr.h
oaep.cpp
oaep.h
@ -208,8 +257,11 @@ poly1305.cpp
poly1305.h
polynomi.cpp
polynomi.h
ppc-simd.h
ppc-simd.cpp
power7_ppc.cpp
power8_ppc.cpp
power9_ppc.cpp
ppc_simd.cpp
ppc_simd.h
pssr.cpp
pssr.h
pubkey.cpp
@ -221,25 +273,26 @@ rabin.cpp
rabin.h
randpool.cpp
randpool.h
rabbit.cpp
rabbit.h
rc2.cpp
rc2.h
rc5.cpp
rc5.h
rc6.cpp
rc6.h
rdrand-masm.cmd
rdrand-nasm.sh
rdrand.s
rdrand.asm
rdrand.cpp
rdrand.h
rdseed.asm
rdtables.cpp
regtest1.cpp
regtest2.cpp
regtest3.cpp
regtest4.cpp
resource.h
rijndael.cpp
rijndael-simd.cpp
rijndael_simd.cpp
rijndael.h
ripemd.cpp
ripemd.h
@ -258,6 +311,7 @@ scrypt.h
seal.cpp
seal.h
secblock.h
secblockfwd.h
seckey.h
seed.cpp
seed.h
@ -265,40 +319,49 @@ serpent.cpp
serpent.h
serpentp.h
sha.cpp
sha-simd.cpp
sha_simd.cpp
sha.h
sha1_armv4.h
sha1_armv4.S
sha256_armv4.h
sha256_armv4.S
sha512_armv4.h
sha512_armv4.S
sha3.cpp
sha3.h
shacal2.cpp
shacal2-simd.cpp
shacal2_simd.cpp
shacal2.h
shake.cpp
shake.h
shark.cpp
shark.h
sharkbox.cpp
simple.cpp
simple.h
siphash.h
simeck.cpp
simeck.h
simon.cpp
simon-simd.cpp
simon128_simd.cpp
simon.h
skipjack.cpp
skipjack.h
sm3.cpp
sm3.h
sm4.cpp
sm4_simd.cpp
sm4.h
smartptr.h
socketft.cpp
socketft.h
sosemanuk.cpp
sosemanuk.h
speck.cpp
speck-simd.cpp
speck128_simd.cpp
speck.h
square.cpp
square.h
squaretb.cpp
sse-simd.cpp
sse_simd.cpp
stdcpp.h
strciphr.cpp
strciphr.h
@ -312,8 +375,6 @@ threefish.h
tiger.cpp
tiger.h
tigertab.cpp
trdlocal.cpp
trdlocal.h
trunhash.h
ttmac.cpp
ttmac.h
@ -326,25 +387,31 @@ validat1.cpp
validat2.cpp
validat3.cpp
validat4.cpp
validat5.cpp
validat6.cpp
validat7.cpp
validat8.cpp
validat9.cpp
validat10.cpp
validate.h
vmac.cpp
vmac.h
vs2005.zip
wait.cpp
wait.h
wake.cpp
wake.h
whrlpool.cpp
whrlpool.h
winpipes.cpp
winpipes.h
words.h
x64dll.asm
x64masm.asm
xed25519.h
xed25519.cpp
xtr.cpp
xtr.h
xtrcrypt.cpp
xtrcrypt.h
xts.cpp
xts.h
zdeflate.cpp
zdeflate.h
zinflate.cpp
@ -366,6 +433,8 @@ TestData/aria.dat
TestData/camellia.dat
TestData/cast128v.dat
TestData/cast256v.dat
TestData/defdmac1.bin
TestData/defdmac2.bin
TestData/descert.dat
TestData/dh1024.dat
TestData/dh2048.dat
@ -374,6 +443,12 @@ TestData/dlie2048.dat
TestData/dsa1024.dat
TestData/dsa1024b.dat
TestData/dsa512.dat
TestData/ecies_p160.dat
TestData/ecies_t163.dat
TestData/ed25519.dat
TestData/ed25519_ver.dat
TestData/ed25519v0.dat
TestData/ed25519v1.dat
TestData/elgc1024.dat
TestData/esig1023.dat
TestData/esig1536.dat
@ -409,10 +484,10 @@ TestData/rc6val.dat
TestData/rijndael.dat
TestData/rsa1024.dat
TestData/rsa2048.dat
TestData/rsa2048a.dat
TestData/rsa400pb.dat
TestData/rsa400pv.dat
TestData/rsa512a.dat
TestData/rsa2048a.dat
TestData/rw1024.dat
TestData/rw2048.dat
TestData/saferval.dat
@ -423,59 +498,79 @@ TestData/skipjack.dat
TestData/squareva.dat
TestData/twofishv.dat
TestData/usage.dat
TestData/x25519.dat
TestData/x25519v0.dat
TestData/x25519v1.dat
TestData/xtrdh171.dat
TestData/xtrdh342.dat
TestVectors/Readme.txt
TestVectors/aead.txt
TestVectors/aes.txt
TestVectors/all.txt
TestVectors/aria.txt
TestVectors/blake2.txt
TestVectors/blake2b.txt
TestVectors/blake2s.txt
TestVectors/aria.txt
TestVectors/camellia.txt
TestVectors/ccm.txt
TestVectors/chacha.txt
TestVectors/chacha_tls.txt
TestVectors/chacha20poly1305.txt
TestVectors/cham.txt
TestVectors/cmac.txt
TestVectors/dlies.txt
TestVectors/dsa.txt
TestVectors/dsa_1363.txt
TestVectors/dsa_rfc6979.txt
TestVectors/eax.txt
TestVectors/esign.txt
TestVectors/gcm.txt
TestVectors/hc128.txt
TestVectors/hc256.txt
TestVectors/hight.txt
TestVectors/hkdf.txt
TestVectors/hmac.txt
TestVectors/kalyna.txt
TestVectors/keccak.txt
TestVectors/lea.txt
TestVectors/lsh.txt
TestVectors/lsh256.txt
TestVectors/lsh512.txt
TestVectors/lsh512_256.txt
TestVectors/mars.txt
TestVectors/nr.txt
TestVectors/panama.txt
TestVectors/poly1305aes.txt
TestVectors/poly1305_tls.txt
TestVectors/rabbit.txt
TestVectors/Readme.txt
TestVectors/rsa_oaep.txt
TestVectors/rsa_pkcs1_1_5.txt
TestVectors/rsa_pss.txt
TestVectors/dsa_rfc6979.txt
TestVectors/rw.txt
TestVectors/salsa.txt
TestVectors/seal.txt
TestVectors/seed.txt
TestVectors/sha.txt
TestVectors/sha2.txt
TestVectors/sha3.txt
TestVectors/sha1_fips_180.txt
TestVectors/sha1_160_fips_180.txt
TestVectors/sha2_fips_180.txt
TestVectors/sha1_fips_180.txt
TestVectors/sha2.txt
TestVectors/sha2_224_fips_180.txt
TestVectors/sha2_256_fips_180.txt
TestVectors/sha2_384_fips_180.txt
TestVectors/sha2_512_fips_180.txt
TestVectors/sha3_fips_202.txt
TestVectors/sha2_fips_180.txt
TestVectors/sha3.txt
TestVectors/sha3_224_fips_202.txt
TestVectors/sha3_256_fips_202.txt
TestVectors/sha3_384_fips_202.txt
TestVectors/sha3_512_fips_202.txt
TestVectors/sha3_fips_202.txt
TestVectors/shake.txt
TestVectors/shacal2.txt
TestVectors/simeck.txt
TestVectors/simon.txt
TestVectors/siphash.txt
TestVectors/skipjack.txt
TestVectors/sm3.txt
TestVectors/sm4.txt
TestVectors/sosemanuk.txt
@ -486,3 +581,72 @@ TestVectors/ttmac.txt
TestVectors/vmac.txt
TestVectors/wake.txt
TestVectors/whrlpool.txt
TestVectors/xchacha.txt
TestVectors/xts.txt
TestPrograms/test_32bit.cpp
TestPrograms/test_64bit.cpp
TestPrograms/test_arm_acle_header.cpp
TestPrograms/test_arm_aes.cpp
TestPrograms/test_arm_armv7.cpp
TestPrograms/test_arm_asimd.cpp
TestPrograms/test_arm_crc.cpp
TestPrograms/test_arm_neon.cpp
TestPrograms/test_arm_neon_header.cpp
TestPrograms/test_arm_pmull.cpp
TestPrograms/test_arm_sha1.cpp
TestPrograms/test_arm_sha256.cpp
TestPrograms/test_arm_sha3.cpp
TestPrograms/test_arm_sha512.cpp
TestPrograms/test_arm_sm3.cpp
TestPrograms/test_arm_sm4.cpp
TestPrograms/test_asm_mixed.cpp
TestPrograms/test_cxx11_alignas.cpp
TestPrograms/test_cxx11_alignof.cpp
TestPrograms/test_cxx11_assert.cpp
TestPrograms/test_cxx11_atomic.cpp
TestPrograms/test_cxx11_auto.cpp
TestPrograms/test_cxx11_constexpr.cpp
TestPrograms/test_cxx11.cpp
TestPrograms/test_cxx11_deletefn.cpp
TestPrograms/test_cxx11_enumtype.cpp
TestPrograms/test_cxx11_initializer.cpp
TestPrograms/test_cxx11_lambda.cpp
TestPrograms/test_cxx11_noexcept.cpp
TestPrograms/test_cxx11_nullptr.cpp
TestPrograms/test_cxx11_staticinit.cpp
TestPrograms/test_cxx11_sync.cpp
TestPrograms/test_cxx11_vartemplates.cpp
TestPrograms/test_cxx14.cpp
TestPrograms/test_cxx17_assert.cpp
TestPrograms/test_cxx17.cpp
TestPrograms/test_cxx17_exceptions.cpp
TestPrograms/test_cxx98_exception.cpp
TestPrograms/test_cxx.cpp
TestPrograms/test_glibc.cpp
TestPrograms/test_newlib.cpp
TestPrograms/test_nodevirtualize.cpp
TestPrograms/test_ppc_aes.cpp
TestPrograms/test_ppc_altivec.cpp
TestPrograms/test_ppc_power7.cpp
TestPrograms/test_ppc_power8.cpp
TestPrograms/test_ppc_power9.cpp
TestPrograms/test_ppc_sha.cpp
TestPrograms/test_ppc_vmull.cpp
TestPrograms/test_pthreads.cpp
TestPrograms/test_x86_aes.cpp
TestPrograms/test_x86_avx2.cpp
TestPrograms/test_x86_avx512.cpp
TestPrograms/test_x86_avx.cpp
TestPrograms/test_x86_clmul.cpp
TestPrograms/test_x86_cpuid.cpp
TestPrograms/test_x86_rdrand.cpp
TestPrograms/test_x86_rdseed.cpp
TestPrograms/test_x86_sha.cpp
TestPrograms/test_x86_sse2.cpp
TestPrograms/test_x86_sse3.cpp
TestPrograms/test_x86_sse41.cpp
TestPrograms/test_x86_sse42.cpp
TestPrograms/test_x86_ssse3.cpp
TestPrograms/test_x86_via_aes.cpp
TestPrograms/test_x86_via_rng.cpp
TestPrograms/test_x86_via_sha.cpp

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -4,7 +4,8 @@ The History file contains the items that comprise the release notes. The
items in the list below used to be in Readme.txt. Readme.txt now contans the
last several releases.
1.0 - First public release. Withdrawn at the request of RSA DSI.
1.0 - First public release
- Withdrawn at the request of RSA DSI over patent claims
- included Blowfish, BBS, DES, DH, Diamond, DSA, ElGamal, IDEA,
MD5, RC4, RC5, RSA, SHA, WAKE, secret sharing, DEFLATE compression
- had a serious bug in the RSA key generation code.
@ -432,3 +433,150 @@ last several releases.
- remove s_nullNameValuePairs from unnamed namespace
- ported to MSVC 2017, Xcode 9.3, Sun Studio 12.5, GCC 8.0.1,
MacPorts GCC 7.0, Clang 4.0, Intel C++ 17.00, IBM XL C/C++ 13.1
8.0.0 - December 28, 2018
- major release, recompile of programs required
- expanded community input and support
* 54 unique contributors as of this release
- add x25519 key exchange and ed25519 signature scheme
- add limited Asymmetric Key Package support from RFC 5958
- add Power9 DARN random number generator support
- add CHAM, HC-128, HC-256, Hight, LEA, Rabbit, Simeck
- fix FixedSizeAllocatorWithCleanup may be unaligned on some platforms
- cutover to GNU Make-based cpu feature tests
- rename files with dashes to underscores
- fix LegacyDecryptor and LegacyDecryptorWithMAC use wrong MAC
- fix incorrect AES/CBC decryption on Windows
- avoid Singleton<T> when possible, avoid std::call_once completely
- fix SPARC alignment problems due to GetAlignmentOf<T>() on word64
- add ARM AES asm implementation from Cryptogams
- remove CRYPTOPP_ALLOW_UNALIGNED_DATA_ACCESS support
8.1.0 - February 22, 2019
- minor release, no recompile of programs required
- expanded community input and support
* 56 unique contributors as of this release
- fix OS X PowerPC builds with Clang
- add Microsoft ARM64 support
- fix iPhone Simulator build due to missing symbols
- add CRYPTOPP_BUGGY_SIMD_LOAD_AND_STORE
- add carryless multiplies for NIST b233 and k233 curves
- fix OpenMP build due to use of OpenMP 4 with down-level compilers
- add SignStream and VerifyStream for ed25519 and large files
- fix missing AlgorithmProvider in PanamaHash
- add SHAKE-128 and SHAKE-256
- fix AVX2 build due to _mm256_broadcastsi128_si256
- add IETF ChaCha, XChaCha, ChaChaPoly1305 and XChaChaPoly1305
8.2.0 - April 28, 2019
- minor release, no recompile of programs required
- expanded community input and support
* 56 unique contributors as of this release
- use PowerPC unaligned loads and stores with Power8
- add SKIPJACK test vectors
- fix SHAKE-128 and SHAKE-256 compile
- removed IS_NEON from Makefile
- fix Aarch64 build on Fedora 29
- fix missing GF2NT_233_Multiply_Reduce_CLMUL in FIPS DLL
- add missing BLAKE2 constructors
- fix missing BlockSize() in BLAKE2 classes
8.3.0 - December 20, 2020
- minor release, recompile of programs required
- expanded community input and support
* 66 unique contributors as of this release
- fix use of macro CRYPTOPP_ALIGN_DATA
- fix potential out-of-bounds read in ECDSA
- fix std::bad_alloc when using ByteQueue in pipeline
- fix missing CRYPTOPP_CXX17_EXCEPTIONS with Clang
- fix potential out-of-bounds read in GCM mode
- add configure.sh when preprocessor macros fail
- fix potential out-of-bounds read in SipHash
- fix compile error on POWER9 due to vec_xl_be
- fix K233 curve on POWER8
- add Cirrus CI testing
- fix broken encryption for some 64-bit ciphers
- fix Android cpu-features.c using C++ compiler
- disable RDRAND and RDSEED for some AMD processors
- fix BLAKE2 hash calculation using Salt and Personalization
- refresh Android and iOS build scripts
- add XTS mode
- fix circular dependency between misc.h and secblock.h
- add Certificate interface
- fix recursion in AES::Encryption without AESNI
- add missing OID for ElGamal encryption
- fix missing override in KeyDerivationFunction-derived classes
- fix RDSEED assemble under MSVC
- fix elliptic curve timing leaks (CVE-2019-14318)
- add link-library variable to Makefiles
- fix SIZE_MAX definition in misc.h
- add GetWord64 and PutWord64 to BufferedTransformation
- use HKDF in AutoSeededX917RNG::Reseed
- fix Asan finding in VMAC on i686 in inline asm
- fix undeclared identifier _mm_roti_epi64 on Gentoo
- fix ECIES and GetSymmetricKeyLength
- fix possible divide by zero in PKCS5_PBKDF2_HMAC
- refine ASN.1 encoders and decoders
- disable BMI2 code paths in Integer class
- fix use of CRYPTOPP_CLANG_VERSION
- add NEON SHA1, SHA256 and SHA512 from Cryptogams
- add ARM SHA1, SHA256 and SHA512 from Cryptogams
- make config.h more autoconf friendly
- handle Clang triplet armv8l-unknown-linux-gnueabihf
- fix reference binding to misaligned address in xed25519
- clear asserts in TestDataNameValuePairs
8.4.0 - January 2, 2021
- minor release, recompile of programs required
- expanded community input and support
* 67 unique contributors as of this release
- fix SIGILL on POWER8 when compiling with GCC 10
- fix potential out-of-bounds write in FixedSizeAllocatorWithCleanup
- fix compile on AIX POWER7 with IBM XLC 12.01
- fix compile on Solaris with SunCC 12.6
- revert changes for constant-time elliptic curve algorithms
- fix makefile clean and distclean recipes
8.5.0 - March 7, 2021
- minor release, no recompile of programs required
- expanded community input and support
* 70 unique contributors as of this release
- port to Apple M1 hardware
8.6.0 - September 21, 2021
- minor release, recompile of programs required
- expanded community input and support
* 74 unique contributors as of this release
- fix ElGamal encryption
- fix ChaCha20 AVX2 implementation
- add octal and decimal literal prefix parsing to Integer
- add missing overload in ed25519Signer and ed25519Verifier
- make SHA-NI independent of AVX and AVX2
- fix OldRandomPool GenerateWord32
- use CPPFLAGS during feature testing
- fix compile on CentOS 5
- fix compile on FreeBSD
- fix feature testing on ARM A-32 and Aarch64
- enable inline ASM for CRC and PMULL on Apple M1
- fix Intel oneAPI compile
- rename test files with *.cpp extension
- fix GCC compile error due to missing _mm256_set_m128i
- add LSH-256 and LSH-512 hash functions
- add ECIES_P1363 for backwards compatibility
- fix AdditiveCipherTemplate<T> ProcessData
- remove CRYPTOPP_NO_CXX11 define
- add -fno-common for Darwin builds
- update documentation
8.7.0 - August 7, 2022
- minor release, recompile of programs required
- expanded community input and support
* 81 unique contributors as of this release
- fix RSA key generation for small moduli
- fix AES-GCM with AESNI but without CLMUL
- fix Clang warning with C++17
- fix MinGW builds due to use of O_NOFOLLOW
- rework CFB_CipherTemplate::ProcessData and AdditiveCipherTemplate::ProcessData
* restored performance and avoided performance penalty of a temp buffer
- fix undersized SecBlock buffer in Integer bit operations
- work around several GCC 11 & 12 problems

View File

@ -2,6 +2,7 @@ CONTENTS OF THIS FILE
---------------------
* Introduction
* Prerequisites
* Building the Library
* Alternate Build Systems
* Installing the Library
@ -16,27 +17,34 @@ INTRODUCTION
Crypto++ Library is a free C++ class library of cryptographic algorithms and schemes. The library was originally written and placed in public domain by Wei Dai, but it is now maintained by the community. The library homepage is at http://www.cryptopp.com/. The latest library source code can be found at http://github.com/weidai11/cryptopp. For licensing and copyright information, please see License.txt.
These are general instructions for the AIX, BSDs, Linux, OS X, Solaris and Unix. The library uses a GNU makefile, which combines configuration and a non-anemic make. On AIX, BSD and Solaris you will likely have to use `gmake` to build the library. On Linux, OS X and Unix, the system's make should be OK. On Windows, Crypto++ provides Visual Studio solutions.
These are general instructions for AIX, BSDs, Linux, OS X, Solaris and Unix. The library uses GNU Make and a GNUmakefile to avoid anemic make. On AIX, BSD and Solaris you will likely have to use `gmake` to build the library. On Linux and OS X, the system's make should be OK. On Windows, Crypto++ provides Visual Studio solutions.
You should look through the GNUmakefile and config.h to ensure settings look reasonable before building. There are two wiki pages that help explain them at http://www.cryptopp.com/wiki/GNUmakefile and http://www.cryptopp.com/wiki/Config.h.
Wiki pages are available for some platforms with specific build instructions. The pages include Android, ARM, iOS, MSBuild and Solaris. Solaris users should visit the wiki for important information on compiling the library with different versions of SunCC and options, and information on improving library performance and features.
Crypto++ does not depend upon other tools or libraries. It does not use Autotools, does not use CMake, and does not use Boost. If you use an alternate build system, like Autotools or CMake, then see the warning below about CXXFLAGS and lack of -DNDEBUG. CMake is available in Master as a matter of convenience, but its not officially supported.
Crypto++ does not depend upon other tools or libraries. The library only needs GNU Make 3.80 on Unix & Linux; or Visual Studio 2010 and above build tools on Windows. The library does not use Autotools, does not use CMake, and does not use Boost.
There is a partially complete CmakeList.txt available on the wiki at http://www.cryptopp.com/wiki/CMake. It is not recommended for use because it is not in a good state. If you have CMake expertise and can work some problems, then please see the wiki page for tasks related to CMake.
Autotools and CMake projects are not officially supported. The build systems take too much time and effort. Unofficial projects are available at https://github.com/noloader/cryptopp-autotools and https://github.com/abdes/cryptopp-cmake. The projects provide a central location to support Autotools and CMake. Collaborators for Autotools and CMake are welcomed.
PREREQUISITES
-------------
The library requires a semi-modern C++ compiler and GNU Make 3.81 or above. The compiler must support 64-bit words, C++03, namespaces, RTTI and exceptions.
The library does not depend on other build systems, like Autotools or CMake. The library does not depend on other libraries, like Boost.
BUILDING THE LIBRARY
--------------------
In general, all you should have to do is open a terminal, and then:
In general, all you should have to do is open a terminal, cd to the cryptopp directory, and then:
make
make test
sudo make install
The command above builds the static library and cryptest.exe program. It also uses a sane set of default flags, which are usually "-DNDEBUG -g2 -O3 -fPIC".
The command above builds the static library and cryptest.exe program. It also uses a sane default flags, which are usually "-DNDEBUG -g2 -O3 -fPIC".
If you want to build the shared object, then issue:
@ -70,7 +78,16 @@ LLVM's libc++ is also supported, so you can:
export CXXFLAGS="-std=c++11 -stdlib=libc++"
make
If you target 32-bit IA-32 machines (i386, i586 or i686), then the makefile forgoes -fPIC due to register pressures. You should add -fPIC yourself in this case:
If you are using the library on OS X with XCode then you should add LLVM's libc++. You can do so by modifying CXXFLAGS, or you can modify the GNUmakefile. To modify the GNUmakefile, open it and find the line for OS X builds around line 150:
ifneq ($(IS_DARWIN),0)
CXX ?= c++
CRYPTOPP_CXXFLAGS += -stdlib=libc++
AR = libtool
ARFLAGS = -static -o
endif
If you target 32-bit IA-32 machines (i386, i586 or i686), then the makefile forgoes -fPIC due to register pressures. You should add -fPIC yourself, if needed:
CXXFLAGS="-DNDEBUG -g2 -O3 -fPIC" make
@ -78,10 +95,27 @@ You can also override a variable so that only your flags are present. That is, t
make CXXFLAGS="-std=c++11"
Crypto++ does not enagage Specter remediations at this time. You can build with Specter resistance with the following flags:
Crypto++ does not engage Specter remediations at this time. You can build with Specter resistance with the following flags:
CXXFLAGS="-DNDEBUG -g2 -O3 -mfunction-return=thunk -mindirect-branch=thunk" make
The library does not support out-of-tree builds. You must cd to the Crypto++ directory before building. `make distclean` will return the Crypto++ directory to a pristine state.
BUILDING WITH VCPKG
-------------------
You can download and install cryptopp using the [vcpkg](https://github.com/Microsoft/vcpkg/) dependency manager:
git clone https://github.com/Microsoft/vcpkg.git
cd vcpkg
./bootstrap-vcpkg.sh
./vcpkg integrate install
./vcpkg install cryptopp
The cryptopp port in vcpkg is kept up to date by Microsoft team members and community contributors.
If the version is out of date, please [create an issue or pull request](https://github.com/Microsoft/vcpkg) on the vcpkg repository.
ALTERNATE BUILD SYSTEMS
-----------------------
@ -124,7 +158,7 @@ The following are some of the targets provided by the GNU makefile.
`make cryptest.exe` builds the library test harness.
`make test` and `make check` are the same recipe and invoke the test harness with the the validation option. That is, it executes `cryptest.exe v`.
`make test` and `make check` are the same recipe and invoke the test harness with the validation option. That is, it executes `cryptest.exe v`.
`make install` installs the library. By default, the makefile copies into `/usr/local` by default.
@ -147,18 +181,16 @@ The Crypto++ embraces tools like Undefined Behavior sanitizer (UBsan), Address s
UBsan and Asan are mutually exclusive options, so you can perform only one of these at a time:
make ubsan
./cryptest.exe v 2>&1 | egrep "(error|FAILED)"
./cryptest.exe tv all 2>&1 | egrep "(error|FAILED)"
./cryptest.exe v 2>&1 | grep -E "(error:|FAILED)"
./cryptest.exe tv all 2>&1 | grep -E "(error:|FAILED)"
Or:
make asan
./cryptest.exe v 2>&1 | egrep "(error|FAILED)"
./cryptest.exe tv all 2>&1 | egrep "(error|FAILED)"
./cryptest.exe v 2>&1 | grep -E "(error:|FAILED)"
./cryptest.exe tv all 2>&1 | grep -E "(error:|FAILED)"
If you experience self test failures or see reports of undefined behavior, then you should ensure CRYPTOPP_NO_UNALIGNED_DATA_ACCESS is defined in config.h. CRYPTOPP_NO_UNALIGNED_DATA_ACCESS is not defined due to historical purposes.
If you experience failures under Asan, then gather more information with:
If you experience failures under Asan, then gather more information with asan_symbolize. You may not need asan_symbolize nowadays:
./cryptest.exe v 2>&1 | asan_symbolize
@ -172,7 +204,7 @@ ACCEPTANCE TESTING
Crypto++ uses five security gates in its engineering process. The library must maintain the quality provided by the review system and integrity of the test suites. You can use the information to decide if the Crypto++ library suits your needs and provides a compatible security posture.
The first gate is code review and discussion of proposed chnages. Git commits often cross reference a User Group discussions.
The first gate is code review and discussion of proposed changes. Git commits often cross reference a User Group discussions.
Second is the compiler warning system. The code must clean compile under the equivalent of GCC's -Wall -Wextra (modulo -Wno-type-limits -Wno-unknown-pragmas). This is a moving target as compiler analysis improves.
@ -185,25 +217,25 @@ Fifth, the test harness provides a "validation" option which performs basic syst
./cryptest.exe v
...
All tests passed!
Test ended at Sun Jul 26 02:10:57 2015
Seed used was: 1437891055
Seed used was 1612313449
Test started at Tue Feb 2 19:50:49 2021
Test ended at Tue Feb 2 19:50:52 2021
Sixth, the test harness provides a "test vector" option which uses many known test vectors, even those published by other people (like Brian Gladman for AES). You run the test vectors as shown below. The tail of the output should indicate 0 failed tests.
./cryptest.exe tv all
...
Testing SymmetricCipher algorithm MARS/ECB.
.................
Tests complete. Total tests = 4094. Failed tests = 0.
Testing SymmetricCipher algorithm AES/XTS.
.....................
Tests complete. Total tests = 11260. Failed tests = 0.
The library also offers its test script for those who want to use it. The test script is names cryptest.sh, and it repeatedly builds the library and exectues the tests under various configurations. It takes 2 to 4 hours to run on a semi-modern desktop or server; and days to run on an IoT gadget. Also see http://github.com/weidai11/cryptopp/blob/master/cryptest.sh and http://cryptopp.com/wiki/Cryptest.sh.
The library also offers its test script for those who want to use it. The test script is names cryptest.sh, and it repeatedly builds the library and exectues the tests under various configurations. It takes about 4 hours to run on a semi-modern desktop or server; and several days to run on an IoT gadget. Also see http://github.com/weidai11/cryptopp/blob/master/cryptest.sh and http://cryptopp.com/wiki/Cryptest.sh.
REPORTING PROBLEMS
------------------
Dirty compiles and failures in the validation suite or test vectors should be reported at the Crypto++ User Group. The User Group is located at http://groups.google.com/forum/#!forum/cryptopp-users.
Build failures, dirty compiles and failures in the validation suite or test vectors should be reported at the Crypto++ User Group. The User Group is located at http://groups.google.com/forum/#!forum/cryptopp-users.
The library uses Wei Dai's GitHub to track issues. The tracker is located at http://github.com/weidai11/cryptopp/issues. Please do not ask questions in the bug tracker; ask questions on the mailing list instead. Also see http://www.cryptopp.com/wiki/Bug_Report.

View File

@ -1,4 +1,4 @@
Compilation Copyright (c) 1995-2016 by Wei Dai. All rights reserved.
Compilation Copyright (c) 1995-2019 by Wei Dai. All rights reserved.
This copyright applies only to this software distribution package
as a compilation, and does not imply a copyright on any particular
file in the package.
@ -22,6 +22,20 @@ Richard De Moliner - safer.cpp
Matthew Skala - twofish.cpp
Kevin Springle - camellia.cpp, shacal2.cpp, ttmac.cpp, whrlpool.cpp, ripemd.cpp
Ronny Van Keer - sha3.cpp
Aumasson, Neves, Wilcox-O'Hearn and Winnerlein - blake2.cpp, blake2b_simd.cpp, blake2s_simd.cpp
Aaram Yun - aria.cpp, aria_simd.cpp
Han Lulu, Markku-Juhani O. Saarinen - sm4.cpp sm4_simd.cpp
Daniel J. Bernstein, Jack Lloyd - chacha.cpp, chacha_simd.cpp, chacha_avx.cpp
Andrew Moon - ed25519, x25519, donna_32.cpp, donna_64.cpp, donna_sse.cpp
The Crypto++ Library uses portions of Andy Polyakov's CRYPTOGAMS on Linux
for 32-bit ARM with files aes_armv4.S, sha1_armv4.S and sha256_armv4.S.
CRYPTOGAMS is dual licensed with a permissive BSD-style license. The
CRYPTOGAMS license is reproduced below. You can disable Cryptogams code by
undefining the relevant macros in config_asm.h.
The Crypto++ Library uses portions of Jack Lloyd's Botan for ChaCha SSE2 and
AVX. Botan placed the code in public domain for Crypto++ to use.
The Crypto++ Library (as a compilation) is currently licensed under the Boost
Software License 1.0 (http://www.boost.org/users/license.html).
@ -49,3 +63,22 @@ SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
CRYPTOGAMS License
Copyright (c) 2006-2017, CRYPTOGAMS by <appro@openssl.org>
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
* Redistributions of source code must retain copyright notices,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following
disclaimer in the documentation and/or other materials
provided with the distribution.
* Neither the name of the CRYPTOGAMS nor the names of its copyright
holder and contributors may be used to endorse or promote products
derived from this software without specific prior written permission.

View File

@ -1,37 +1,39 @@
Crypto++: free C++ Class Library of Cryptographic Schemes
Version 7.0 - APR/08/2018
Version 8.8 - TBD
Crypto++ Library is a free C++ class library of cryptographic schemes.
Currently the library contains the following algorithms:
algorithm type name
authenticated encryption schemes GCM, CCM, EAX
authenticated encryption schemes GCM, CCM, EAX, ChaCha20Poly1305 and
XChaCha20Poly1305
high speed stream ciphers ChaCha (8/12/20), Panama, Sosemanuk, Salsa20,
XSalsa20
high speed stream ciphers ChaCha (8/12/20), ChaCha (IETF), Panama, Salsa20,
Sosemanuk, XSalsa20, XChaCha20
AES and AES candidates AES (Rijndael), RC6, MARS, Twofish, Serpent,
CAST-256
ARIA, IDEA, Blowfish, Triple-DES (DES-EDE2 and
DES-EDE3), Camellia, SEED, Kalyna (128/256/512),
other block ciphers RC5, SIMON-64, SIMON-128, SPECK-64, SPECK-128,
Skipjack, SHACAL-2, SM4, Threefish (256/512/1024),
TEA, XTEA
ARIA, Blowfish, Camellia, CHAM, HIGHT, IDEA,
Kalyna (128/256/512), LEA, SEED, RC5, SHACAL-2,
other block ciphers SIMON (64/128), Skipjack, SPECK (64/128),
Simeck, SM4, Threefish (256/512/1024),
Triple-DES (DES-EDE2 and DES-EDE3), TEA, XTEA
block cipher modes of operation ECB, CBC, CBC ciphertext stealing (CTS),
CFB, OFB, counter mode (CTR)
CFB, OFB, counter mode (CTR), XTS
message authentication codes BLAKE2s, BLAKE2b, CMAC, CBC-MAC, DMAC, GMAC, HMAC,
Poly1305, SipHash, Two-Track-MAC, VMAC,
Poly1305, Poly1305 (IETF), SipHash, Two-Track-MAC,
VMAC
BLAKE2s, BLAKE2b, Keccack (F1600), SHA-1,
hash functions SHA-2 (224/256/384/512), SHA-3 (224/256/384/512),
SipHash, SM3, Tiger, RIPEMD-128, RIPEMD-160,
RIPEMD-256, RIPEMD-320, WHIRLPOOL
BLAKE2s, BLAKE2b, Keccack (F1600), LSH (256/512),
hash functions SHA-1, SHA-2 (224/256/384/512), SHA-3 (224/256),
SHA-3 (384/512), SHAKE (128/256), SipHash, SM3, Tiger,
RIPEMD (128/160/256/320), WHIRLPOOL
RSA, DSA, Determinsitic DSA, ElGamal,
RSA, DSA, Deterministic DSA, ElGamal,
public-key cryptography Nyberg-Rueppel (NR), Rabin-Williams (RW), LUC,
LUCELG, EC-based German Digital Signature (ECGDSA),
DLIES (variants of DHAES), ESIGN
@ -39,11 +41,12 @@ Currently the library contains the following algorithms:
padding schemes for public-key PKCS#1 v2.0, OAEP, PSS, PSSR, IEEE P1363
systems EMSA2 and EMSA5
Diffie-Hellman (DH), Unified Diffie-Hellman
key agreement schemes (DH2), Menezes-Qu-Vanstone (MQV), Hashed MQV (HMQV),
Diffie-Hellman (DH), Unified Diffie-Hellman (DH2),
key agreement schemes Menezes-Qu-Vanstone (MQV), Hashed MQV (HMQV),
Fully Hashed MQV (FHMQV), LUCDIF, XTR-DH
elliptic curve cryptography ECDSA, Determinsitic ECDSA, ECNR, ECIES, ECDH, ECMQV
elliptic curve cryptography ECDSA, Deterministic ECDSA, ed25519, ECNR, ECIES,
ECDH, ECMQV, x25519
insecure or obsolescent MD2, MD4, MD5, Panama Hash, DES, ARC4, SEAL
algorithms retained for backwards 3.0, WAKE-OFB, DESX (DES-XEX3), RC2,
@ -53,7 +56,7 @@ algorithms retained for backwards 3.0, WAKE-OFB, DESX (DES-XEX3), RC2,
Other features include:
* pseudo random number generators (PRNG): ANSI X9.17 appendix C, RandomPool,
VIA Padlock, RDRAND, RDSEED, NIST Hash and HMAC DRBGs
DARN, VIA Padlock, RDRAND, RDSEED, NIST Hash and HMAC DRBGs
* password based key derivation functions: PBKDF1 and PBKDF2 from PKCS #5,
PBKDF from PKCS #12 appendix B, HKDF from RFC 5869, Scrypt from RFC 7914
* Shamir's secret sharing scheme and Rabin's information dispersal algorithm
@ -68,36 +71,34 @@ Other features include:
+ 32-bit CRC, CRC-C and Adler32 checksum
* class wrappers for these platform and operating system features (optional):
+ high resolution timers on Windows, Unix, and Mac OS
+ Berkeley and Windows style sockets
+ Windows named pipes
+ /dev/random, /dev/urandom, /dev/srandom
+ Microsoft's CryptGenRandom or BCryptGenRandom on Windows
* A high level interface for most of the above, using a filter/pipeline
metaphor
* benchmarks and validation testing
* x86, x64 (x86-64), x32 (ILP32), ARM-32, Aarch32, Aarch64 and Power8 in-core code
for the commonly used algorithms
* x86, x64 (x86-64), x32 (ILP32), ARM-32, Aarch32, Aarch64 and Power8
in-core code for the commonly used algorithms
+ run-time CPU feature detection and code selection
+ supports GCC-style and MSVC-style inline assembly, and MASM for x64
+ x86, x64 (x86-64), x32 provides MMX, SSE2, and SSE4 implementations
+ ARM-32, Aarch32 and Aarch64 provides NEON, ASIMD and ARMv8 implementations
+ Power8 provides in-core AES using NX Crypto Acceleration
The Crypto++ library was orginally written by Wei Dai. The library is now
The Crypto++ library was originally written by Wei Dai. The library is now
maintained by several team members and the community. You are welcome to use it
for any purpose without paying anyone, but see License.txt for the fine print.
The following compilers are supported for this release. Please visit
http://www.cryptopp.com the most up to date build instructions and porting notes.
* Visual Studio 2003 - 2017
* GCC 3.3 - 8.0
* Apple Clang 4.3 - 9.3
* LLVM Clang 2.9 - 4.0
* C++Builder 2010
* Visual Studio 2003 - 2022
* GCC 3.3 - 12.2
* Apple Clang 4.3 - 12.0
* LLVM Clang 2.9 - 14.0
* C++ Builder 2015
* Intel C++ Compiler 9 - 16.0
* Sun Studio 12u1 - 12.5
* IBM XL C/C++ 10.0 - 13.1
* Sun Studio 12u1 - 12.7
* IBM XL C/C++ 10.0 - 14.0
*** Important Usage Notes ***
@ -127,9 +128,8 @@ cryptdll - This builds the DLL. Please note that if you wish to use Crypto++
dlltest - This builds a sample application that only uses the DLL.
The DLL used to provide FIPS validated cryptography. The library was moved
to the CMVP's <A HREF=
"http://csrc.nist.gov/groups/STM/cmvp/documents/140-1/140val-historical.htm">
Historical Validation List</A>. The library and the DLL are no longer considered
to the CMVP's [Historical Validation List](http://csrc.nist.gov/groups/STM/cmvp/documents/140-1/140val-historical.htm).
The library and the DLL are no longer considered
validated. You should no longer use the DLL.
To use the Crypto++ DLL in your application, #include "dll.h" before including
@ -204,16 +204,28 @@ library in your programs to help avoid unwanted redirections.
*** Side Channel Attacks ***
Crypto++ attempts to resist side channel attacks using various remediations. We
believe the library is hardened but the remdiations may be incomplete. The first
line of defense uses hardware instructions when possible. The library also uses
cache-aware algoirthms and access patterns to minimize leakage. If you suspect
or find an information leak then please report it.
Crypto++ attempts to resist side channel attacks using various remediations.
The remdiations are applied as a best effort but are probably incomplete. They
are incomplete due to cpu speculation bugs like Spectre, Meltdown, Foreshadow.
The attacks target both cpu caches and internal buffers. Intel generally refers
to internal buffer attacks as "Microarchitectural Data Sampling" (MDS).
Crypto++ does not enagage Specter remediations at this time. The GCC options for
Specter are -mfunction-return=thunk and -mindirect-branch=thunk, and the library
uses them during testing. If you want the Specter workarounds then add the GCC
options to your CXXFLAGS when building the library.
The library uses hardware instructions when possible for block ciphers, hashes
and other operations. The hardware acceleration remediates some timing
attacks. The library also uses cache-aware algorithms and access patterns
to minimize leakage cache evictions.
Elliptic curves over binary fields are believed to leak information. The task is a
work in progress. We don't believe binary fields are used in production, so we feel it
is a low risk at the moment.
Crypto++ does not engage Specter remediations at this time. The GCC options
for Specter are -mfunction-return=thunk and -mindirect-branch=thunk, and the
library uses them during testing. If you want the Specter workarounds then add
the GCC options to your CXXFLAGS when building the library.
To help resist attacks you should disable hyperthreading on cpus. If you
suspect or find an information leak then please report it.
*** Documentation and Support ***
@ -235,7 +247,7 @@ The source code and its planned changes are available at the following locations
* The Crypto++ GitHub repository allows you to view the latest (unreleased)
Crypto++ source code via the Linux kernel's git beginning around June 2015.
Its also serves as an incubator to nuture and grow the library.
Its also serves as an incubator to nurture and grow the library.
* The former Crypto++ SourceForge repository allows you to view the Crypto++
source code via Apache's subversion until about July 2015. At that time,
SourceForge had infrastructure problems and a cutover to GutHub was performed.
@ -282,124 +294,152 @@ documentation is one of the highest returns on investment.
The items in this section comprise the most recent history. Please see History.txt
for the record back to Crypto++ 1.0.
7.0.0 - April 8, 2018
8.7.0 - August 7, 2022
- minor release, recompile of programs required
- expanded community input and support
* 81 unique contributors as of this release
- fix RSA key generation for small moduli
- fix AES-GCM with AESNI but without CLMUL
- fix Clang warning with C++17
- fix MinGW builds due to use of O_NOFOLLOW
- rework CFB_CipherTemplate::ProcessData and AdditiveCipherTemplate::ProcessData
* restored performance and avoided performance penalty of a temp buffer
- fix undersized SecBlock buffer in Integer bit operations
- work around several GCC 11 & 12 problems
8.6.0 - September 21, 2021
- minor release, recompile of programs required
- expanded community input and support
* 74 unique contributors as of this release
- fix ElGamal encryption
- fix ChaCha20 AVX2 implementation
- add octal and decimal literal prefix parsing to Integer
- add missing overload in ed25519Signer and ed25519Verifier
- make SHA-NI independent of AVX and AVX2
- fix OldRandomPool GenerateWord32
- use CPPFLAGS during feature testing
- fix compile on CentOS 5
- fix compile on FreeBSD
- fix feature testing on ARM A-32 and Aarch64
- enable inline ASM for CRC and PMULL on Apple M1
- fix Intel oneAPI compile
- rename test files with *.cpp extension
- fix GCC compile error due to missing _mm256_set_m128i
- add LSH-256 and LSH-512 hash functions
- add ECIES_P1363 for backwards compatibility
- fix AdditiveCipherTemplate<T> ProcessData
- remove CRYPTOPP_NO_CXX11 define
- add -fno-common for Darwin builds
- update documentation
8.5.0 - March 7, 2021
- minor release, no recompile of programs required
- expanded community input and support
* 70 unique contributors as of this release
- port to Apple M1 hardware
8.4.0 - January 2, 2021
- minor release, recompile of programs required
- expanded community input and support
* 67 unique contributors as of this release
- fix SIGILL on POWER8 when compiling with GCC 10
- fix potential out-of-bounds write in FixedSizeAllocatorWithCleanup
- fix compile on AIX POWER7 with IBM XLC 12.01
- fix compile on Solaris with SunCC 12.6
- revert changes for constant-time elliptic curve algorithms
- fix makefile clean and distclean recipes
8.3.0 - December 20, 2020
- minor release, recompile of programs required
- expanded community input and support
* 66 unique contributors as of this release
- fix use of macro CRYPTOPP_ALIGN_DATA
- fix potential out-of-bounds read in ECDSA
- fix std::bad_alloc when using ByteQueue in pipeline
- fix missing CRYPTOPP_CXX17_EXCEPTIONS with Clang
- fix potential out-of-bounds read in GCM mode
- add configure.sh when preprocessor macros fail
- fix potential out-of-bounds read in SipHash
- fix compile error on POWER9 due to vec_xl_be
- fix K233 curve on POWER8
- add Cirrus CI testing
- fix broken encryption for some 64-bit ciphers
- fix Android cpu-features.c using C++ compiler
- disable RDRAND and RDSEED for some AMD processors
- fix BLAKE2 hash calculation using Salt and Personalization
- refresh Android and iOS build scripts
- add XTS mode
- fix circular dependency between misc.h and secblock.h
- add Certificate interface
- fix recursion in AES::Encryption without AESNI
- add missing OID for ElGamal encryption
- fix missing override in KeyDerivationFunction-derived classes
- fix RDSEED assemble under MSVC
- fix elliptic curve timing leaks (CVE-2019-14318)
- add link-library variable to Makefiles
- fix SIZE_MAX definition in misc.h
- add GetWord64 and PutWord64 to BufferedTransformation
- use HKDF in AutoSeededX917RNG::Reseed
- fix Asan finding in VMAC on i686 in inline asm
- fix undeclared identifier _mm_roti_epi64 on Gentoo
- fix ECIES and GetSymmetricKeyLength
- fix possible divide by zero in PKCS5_PBKDF2_HMAC
- refine ASN.1 encoders and decoders
- disable BMI2 code paths in Integer class
- fix use of CRYPTOPP_CLANG_VERSION
- add NEON SHA1, SHA256 and SHA512 from Cryptogams
- add ARM SHA1, SHA256 and SHA512 from Cryptogams
- make config.h more autoconf friendly
- handle Clang triplet armv8l-unknown-linux-gnueabihf
- fix reference binding to misaligned address in xed25519
- clear asserts in TestDataNameValuePairs
8.2.0 - April 28, 2019
- minor release, no recompile of programs required
- expanded community input and support
* 56 unique contributors as of this release
- use PowerPC unaligned loads and stores with Power8
- add SKIPJACK test vectors
- fix SHAKE-128 and SHAKE-256 compile
- removed IS_NEON from Makefile
- fix Aarch64 build on Fedora 29
- fix missing GF2NT_233_Multiply_Reduce_CLMUL in FIPS DLL
- add missing BLAKE2 constructors
- fix missing BlockSize() in BLAKE2 classes
8.1.0 - February 22, 2019
- minor release, no recompile of programs required
- expanded community input and support
* 56 unique contributors as of this release
- fix OS X PowerPC builds with Clang
- add Microsoft ARM64 support
- fix iPhone Simulator build due to missing symbols
- add CRYPTOPP_BUGGY_SIMD_LOAD_AND_STORE
- add carryless multiplies for NIST b233 and k233 curves
- fix OpenMP build due to use of OpenMP 4 with down-level compilers
- add SignStream and VerifyStream for ed25519 and large files
- fix missing AlgorithmProvider in PanamaHash
- add SHAKE-128 and SHAKE-256
- fix AVX2 build due to _mm256_broadcastsi128_si256
- add IETF ChaCha, XChaCha, ChaChaPoly1305 and XChaChaPoly1305
8.0.0 - December 28, 2018
- major release, recompile of programs required
- expanded community input and support
* 48 unique contributors as of this release
- fix incorrect result when using Integer::ModInverse
* may be CVE worthy, but request was not submitted
- fix ARIA/CTR bus error on Sparc64
- fix incorrect result when using a_exp_b_mod_c
- fix undeclared identifier uint32_t on early Visual Studio
- fix iPhoneSimulator build on i386
- fix incorrect adler32 in ZlibDecompressor
- fix Power7 test using PPC_FEATURE_ARCH_2_06
- workaround incorrect Glibc sysconf return value on ppc64-le
- add KeyDerivationFunction interface
- add scrypt key derivation function
- add Salsa20_Core transform callable from outside class
- add sbyte, sword16, sword32 and sword64
- remove s_nullNameValuePairs from unnamed namespace
- ported to MSVC 2017, Xcode 9.3, Sun Studio 12.5, GCC 8.0.1,
MacPorts GCC 7.0, Clang 4.0, Intel C++ 17.00, IBM XL C/C++ 13.1
6.1.0 - February 22, 2018
- minor release, maintenance items
- expanded community input and support
* 46 unique contributors as of this release
- use 2048-bit modulus default for DSA
- fix build under Linuxbrew
- use /bin/sh in GNUmakefile
- fix missing flags for SIMON and SPECK in GNUMakefile-cross
- fix ARM and MinGW misdetection
- port setenv-android.sh to latest NDK
- fix Clang check for C++11 lambdas
- Simon and Speck to little-endian implementation
- use LIB_MAJOR for ABI compatibility
- fix ODR violation in AdvancedProcessBlocks_{ARCH} templates
- handle C++17 std::uncaught_exceptions
- ported to MSVC 2017, Xcode 8.1, Sun Studio 12.5, GCC 8.0.1,
MacPorts GCC 7.0, Clang 4.0, Intel C++ 17.00, IBM XL C/C++ 13.1
6.0.0 - January 22, 2018
- major release, recompile of programs required
- expanded community input and support
* 43 unique contributors as of this release
- fixed CVE-2016-9939 (Issue 346, transient DoS)
- fixed CVE-2017-9434 (Issue 414, misidentified memory error)
- converted to BASE+SIMD implementation
* BASE provides an architecture neutral C++ implementation
* SIMD provides architecture specific hardware acceleration
- improved PowerPC Power4, Power7 and Power8 support
- added ARIA, EC German DSA, Deterministic signatures (RFC 6979),
Kalyna, NIST Hash and HMAC DRBG, Padlock RNG, Poly1305, SipHash,
Simon, Speck, SM3, SM4, Threefish algorithms
- added NaCl interface from the compact library
* x25519 key exhange and ed25519 signing provided through NaCl interface
- improved Testing and QA
- ported to MSVC 2017, Xcode 8.1, Sun Studio 12.5, GCC 7.3,
MacPorts GCC 7.0, Clang 4.0, Intel C++ 17.00, IBM XL C/C++ 13.1
5.6.5 - October 11, 2016
- maintenance release, recompile of programs recommended
- expanded community input and support
* 25 unique contributors as of this release
- fixed CVE-2016-7420 (Issue 277, document NDEBUG for production/release)
- fixed CVE-2016-7544 (Issue 302, avoid _malloca and _freea)
- shipped library in recommended state
* backwards compatibility achieved with <config.compat>
- Visual Studio project file cleanup
* improved X86 and X64 MSBuild support
* added ARM-based MSBuild awareness
- improved Testing and QA
* expanded platforms and compilers
* expanded Coverity into OS X and Windows platforms
* added Windows test scripts using Strawberry Perl
- ported to MSVC 2015 SP3, Xcode 7.3, Sun Studio 12.5, GCC 7.0,
MacPorts GCC 7.0, Clang 3.8, Intel C++ 17.00
5.6.4 - September 11, 2016
- maintenance release, honored API/ABI/Versioning requirements
- expanded community input and support
* 22 unique contributors for this release
- fixed CVE-2016-3995
- changed SHA3 to FIPS 202 (F1600, XOF d=0x06)
- added Keccak (F1600, XOF d=0x01)
- added ChaCha (ChaCha8/12/20)
- added HMQV and FHMQV
* Hashed and Fully Hashed MQV
- added BLAKE2 (BLAKE2s and BLAKE2b)
* C++, SSE2, SSE4, ARM NEON and ARMv8 ASIMD
- added CRC32-C
* C/C++, Amd64 CRC, and ARMv8 CRC
- improved Rabin-William signatures
* Tweaked roots <em>e</em> and <em>f</em>
- improved C++11 support
* atomics, threads and fences
* alginof, alignas
* constexpr
* noexcept
- improved GCM mode
* ARM NEON and ARMv8 ASIMD
* ARMv8 carry-less multiply
- improved Windows 8 and 10 support
* Windows Phone, Universal Windows Platform, Windows Store
- improved MIPS, ARMv7 and ARMv8 support
* added scripts setenv-{android|embedded|ios}.sh for GNUmakefile-cross
* aggressive use of -march=<arch> and -mfpu=<fpu> in cryptest.sh
- improved build systems
* Visual Studio 2010 default
* added CMake support (lacks FindCryptopp.cmake)
* archived VC++ 5/0/6.0 project files (vc60.zip)
* archived VS2005 project files (vs2005.zip)
* archived Borland project files (bds10.zip)
- improved Testing and QA
* expanded platforms and compilers
* added code generation tests based on CPU features
* added C++03, C++11, C++14, C++17 testing
* added -O3, -O5, -Ofast and -Os testing
- ported to MSVC 2015 SP3, Xcode 9.0, Sun Studio 12.5, GCC 7.0,
MacPorts GCC 7.0, Clang 3.8, Intel C++ 17.00
* 54 unique contributors as of this release
- add x25519 key exchange and ed25519 signature scheme
- add limited Asymmetric Key Package support from RFC 5958
- add Power9 DARN random number generator support
- add CHAM, HC-128, HC-256, Hight, LEA, Rabbit, Simeck
- fix FixedSizeAllocatorWithCleanup may be unaligned on some platforms
- cutover to GNU Make-based cpu feature tests
- rename files with dashes to underscores
- fix LegacyDecryptor and LegacyDecryptorWithMAC use wrong MAC
- fix incorrect AES/CBC decryption on Windows
- avoid Singleton<T> when possible, avoid std::call_once completely
- fix SPARC alignment problems due to GetAlignmentOf<T>() on word64
- add ARM AES asm implementation from Cryptogams
- remove CRYPTOPP_ALLOW_UNALIGNED_DATA_ACCESS support
June 2015 - Changing of the guard. Wei Dai turned the library over to the
community. The first community release was Crypto++ 5.6.3. Wei is

View File

@ -0,0 +1,15 @@
# Security Policy
## Supported Versions
We support modern versions of the Crypto++ library. Modern versions include the tip of Master and the latest release.
We also support versions of the library supplied by distributions such as Debian, Fedora, Red Hat and Ubuntu. We don't leave distros unsupported simply because we have released a new version of the library. And we don't expect a package maintainer to fix our bugs for us.
## Reporting a Vulnerability
You can report a security related bug in the [GitHub bug tracker](https://github.com/weidai11/cryptopp) or at the [mailing list](https://groups.google.com/g/cryptopp-users).
If we receive a report of a security related bug then we will ensure a Github issue is opened and we will make an announcement on the mailing list. If you corresponded by private email then we will open the Github issue and make the announcement.
All information will be made public. We do not withhold information from users because stake holders need accurate information to access risk and place controls to remediate the risk.

View File

@ -18,7 +18,7 @@ USING_NAMESPACE(std)
#endif
// Used for testing the compiler and linker in cryptest.sh
#if defined(CRYPTOPP_ADHOC_MAIN)
#if defined(CRYPTOPP_ADHOC_MAIN) || defined(ADHOC_MAIN)
int main(int argc, char *argv[])
{

View File

@ -72,7 +72,7 @@ void Adler32::TruncatedFinal(byte *hash, size_t size)
hash[0] = byte(m_s2 >> 8);
// fall through
case 0:
;;
;
// fall through
}

View File

@ -14,7 +14,7 @@ NAMESPACE_BEGIN(CryptoPP)
class Adler32 : public HashTransformation
{
public:
CRYPTOPP_CONSTANT(DIGESTSIZE = 4)
CRYPTOPP_CONSTANT(DIGESTSIZE = 4);
Adler32() {Reset();}
void Update(const byte *input, size_t length);
void TruncatedFinal(byte *hash, size_t size);

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -20,7 +20,7 @@ NAMESPACE_BEGIN(CryptoPP)
/// \sa <a href="http://www.cryptolounge.org/wiki/AES">AES</a> winner, announced on 10/2/2000
/// \since Rijndael since Crypto++ 3.1, Intel AES-NI since Crypto++ 5.6.1, ARMv8 AES since Crypto++ 6.0,
/// Power8 AES since Crypto++ 6.0
DOCUMENTED_TYPEDEF(Rijndael, AES)
DOCUMENTED_TYPEDEF(Rijndael, AES);
typedef RijndaelEncryption AESEncryption;
typedef RijndaelDecryption AESDecryption;

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,30 @@
/* Header file for use with Cryptogam's ARMv4 AES. */
/* Also see http://www.openssl.org/~appro/cryptogams/ and */
/* https://wiki.openssl.org/index.php?title=Cryptogams_AES */
#ifndef CRYPTOGAMS_AES_ARMV4_H
#define CRYPTOGAMS_AES_ARMV4_H
#ifdef __cplusplus
extern "C" {
#endif
//#define AES_MAXNR 14
//typedef struct AES_KEY_st {
// unsigned int rd_key[4 * (AES_MAXNR + 1)];
// int rounds;
//} AES_KEY;
// Instead of AES_KEY we use a 'word32 rkey[4*15+4]'. It has space for
// both the AES_MAXNR round keys and the number of rounds in the tail.
int cryptogams_AES_set_encrypt_key(const unsigned char *userKey, const int bits, unsigned int *rkey);
int cryptogams_AES_set_decrypt_key(const unsigned char *userKey, const int bits, unsigned int *rkey);
void cryptogams_AES_encrypt_block(const unsigned char *in, unsigned char *out, const unsigned int *rkey);
void cryptogams_AES_decrypt_block(const unsigned char *in, unsigned char *out, const unsigned int *rkey);
#ifdef __cplusplus
}
#endif
#endif /* CRYPTOGAMS_AES_ARMV4_H */

View File

@ -260,7 +260,7 @@ void AbstractGroup<T>::SimultaneousMultiply(T *results, const T &base, const Int
exponents.reserve(expCount);
unsigned int i;
for (i=0; i<expCount; i++)
for (i=0; expBegin && i<expCount; i++)
{
CRYPTOPP_ASSERT(expBegin->NotNegative());
exponents.push_back(WindowSlider(*expBegin++, InversionIsFast(), 0));

View File

@ -33,56 +33,56 @@ public:
/// \brief Compare two elements for equality
/// \param a first element
/// \param b second element
/// \returns true if the elements are equal, false otherwise
/// \return true if the elements are equal, false otherwise
/// \details Equal() tests the elements for equality using <tt>a==b</tt>
virtual bool Equal(const Element &a, const Element &b) const =0;
/// \brief Provides the Identity element
/// \returns the Identity element
/// \return the Identity element
virtual const Element& Identity() const =0;
/// \brief Adds elements in the group
/// \param a first element
/// \param b second element
/// \returns the sum of <tt>a</tt> and <tt>b</tt>
/// \return the sum of <tt>a</tt> and <tt>b</tt>
virtual const Element& Add(const Element &a, const Element &b) const =0;
/// \brief Inverts the element in the group
/// \param a first element
/// \returns the inverse of the element
/// \return the inverse of the element
virtual const Element& Inverse(const Element &a) const =0;
/// \brief Determine if inversion is fast
/// \returns true if inversion is fast, false otherwise
/// \return true if inversion is fast, false otherwise
virtual bool InversionIsFast() const {return false;}
/// \brief Doubles an element in the group
/// \param a the element
/// \returns the element doubled
/// \return the element doubled
virtual const Element& Double(const Element &a) const;
/// \brief Subtracts elements in the group
/// \param a first element
/// \param b second element
/// \returns the difference of <tt>a</tt> and <tt>b</tt>. The element <tt>a</tt> must provide a Subtract member function.
/// \return the difference of <tt>a</tt> and <tt>b</tt>. The element <tt>a</tt> must provide a Subtract member function.
virtual const Element& Subtract(const Element &a, const Element &b) const;
/// \brief TODO
/// \param a first element
/// \param b second element
/// \returns TODO
/// \return TODO
virtual Element& Accumulate(Element &a, const Element &b) const;
/// \brief Reduces an element in the congruence class
/// \param a element to reduce
/// \param b the congruence class
/// \returns the reduced element
/// \return the reduced element
virtual Element& Reduce(Element &a, const Element &b) const;
/// \brief Performs a scalar multiplication
/// \param a multiplicand
/// \param e multiplier
/// \returns the product
/// \return the product
virtual Element ScalarMultiply(const Element &a, const Integer &e) const;
/// \brief TODO
@ -90,7 +90,7 @@ public:
/// \param e1 the first multiplier
/// \param y second multiplicand
/// \param e2 the second multiplier
/// \returns TODO
/// \return TODO
virtual Element CascadeScalarMultiply(const Element &x, const Integer &e1, const Element &y, const Integer &e2) const;
/// \brief Multiplies a base to multiple exponents in a group
@ -135,17 +135,17 @@ public:
/// \brief Determines whether an element is a unit in the group
/// \param a the element
/// \returns true if the element is a unit after reduction, false otherwise.
/// \return true if the element is a unit after reduction, false otherwise.
virtual bool IsUnit(const Element &a) const =0;
/// \brief Retrieves the multiplicative identity
/// \returns the multiplicative identity
/// \return the multiplicative identity
virtual const Element& MultiplicativeIdentity() const =0;
/// \brief Multiplies elements in the group
/// \param a the multiplicand
/// \param b the multiplier
/// \returns the product of a and b
/// \return the product of a and b
virtual const Element& Multiply(const Element &a, const Element &b) const =0;
/// \brief Calculate the multiplicative inverse of an element in the group
@ -154,19 +154,19 @@ public:
/// \brief Square an element in the group
/// \param a the element
/// \returns the element squared
/// \return the element squared
virtual const Element& Square(const Element &a) const;
/// \brief Divides elements in the group
/// \param a the dividend
/// \param b the divisor
/// \returns the quotient
/// \return the quotient
virtual const Element& Divide(const Element &a, const Element &b) const;
/// \brief Raises a base to an exponent in the group
/// \param a the base
/// \param e the exponent
/// \returns the exponentiation
/// \return the exponentiation
virtual Element Exponentiate(const Element &a, const Integer &e) const;
/// \brief TODO
@ -174,7 +174,7 @@ public:
/// \param e1 first exponent
/// \param y second element
/// \param e2 second exponent
/// \returns TODO
/// \return TODO
virtual Element CascadeExponentiate(const Element &x, const Integer &e1, const Element &y, const Integer &e2) const;
/// \brief Exponentiates a base to multiple exponents in the Ring
@ -190,7 +190,7 @@ public:
virtual void SimultaneousExponentiate(Element *results, const Element &base, const Integer *exponents, unsigned int exponentsCount) const;
/// \brief Retrieves the multiplicative group
/// \returns the multiplicative group
/// \return the multiplicative group
virtual const AbstractGroup<T>& MultiplicativeGroup() const
{return m_mg;}
@ -288,13 +288,13 @@ public:
/// \brief Performs a modular reduction in the ring
/// \param a the element
/// \param b the modulus
/// \returns the result of <tt>a%b</tt>.
/// \return the result of <tt>a%b</tt>.
virtual const Element& Mod(const Element &a, const Element &b) const =0;
/// \brief Calculates the greatest common denominator in the ring
/// \param a the first element
/// \param b the second element
/// \returns the the greatest common denominator of a and b.
/// \return the greatest common denominator of a and b.
virtual const Element& Gcd(const Element &a, const Element &b) const;
protected:

View File

@ -14,6 +14,10 @@
#include "integer.h"
#include "misc.h"
#include <string>
#include <typeinfo>
#include <exception>
NAMESPACE_BEGIN(CryptoPP)
/// \brief Used to pass byte array input as part of a NameValuePairs object
@ -28,7 +32,7 @@ public:
ConstByteArrayParameter(const char *data = NULLPTR, bool deepCopy = false)
: m_deepCopy(false), m_data(NULLPTR), m_size(0)
{
Assign((const byte *)data, data ? strlen(data) : 0, deepCopy);
Assign(reinterpret_cast<const byte *>(data), data ? strlen(data) : 0, deepCopy);
}
/// \brief Construct a ConstByteArrayParameter
@ -44,8 +48,8 @@ public:
}
/// \brief Construct a ConstByteArrayParameter
/// \tparam T a std::basic_string<char> class
/// \param string a std::basic_string<char> class
/// \tparam T a std::basic_string<char> or std::vector<byte> class
/// \param string a std::basic_string<char> or std::vector<byte> object
/// \param deepCopy flag indicating whether the data should be copied
/// \details The deepCopy option is used when the NameValuePairs object can't
/// keep a copy of the data available
@ -53,7 +57,7 @@ public:
: m_deepCopy(false), m_data(NULLPTR), m_size(0)
{
CRYPTOPP_COMPILE_ASSERT(sizeof(typename T::value_type) == 1);
Assign((const byte *)string.data(), string.size(), deepCopy);
Assign(reinterpret_cast<const byte *>(&string[0]), string.size(), deepCopy);
}
/// \brief Assign contents from a memory buffer
@ -309,9 +313,9 @@ public:
virtual ~AlgorithmParametersBase() CRYPTOPP_THROW
{
#if defined(CRYPTOPP_CXX17_EXCEPTIONS)
#if defined(CRYPTOPP_CXX17_UNCAUGHT_EXCEPTIONS)
if (std::uncaught_exceptions() == 0)
#elif defined(CRYPTOPP_UNCAUGHT_EXCEPTION_AVAILABLE)
#elif defined(CRYPTOPP_CXX98_UNCAUGHT_EXCEPTION)
if (std::uncaught_exception() == false)
#else
try
@ -320,10 +324,12 @@ public:
if (m_throwIfNotUsed && !m_used)
throw ParameterNotUsed(m_name);
}
#if !defined(CRYPTOPP_CXX17_EXCEPTIONS) && !defined(CRYPTOPP_UNCAUGHT_EXCEPTION_AVAILABLE)
#if !defined(CRYPTOPP_CXX98_UNCAUGHT_EXCEPTION)
# if !defined(CRYPTOPP_CXX17_UNCAUGHT_EXCEPTIONS)
catch(const Exception&)
{
}
# endif
#endif
}

View File

@ -0,0 +1,107 @@
// allocate.cpp - written and placed in the public domain by Jeffrey Walton
// The functions in allocate.h and allocate.cpp were originally in misc.h
// and misc.cpp. They were extracted in September 2019 to sidestep a circular
// dependency with misc.h and secblock.h.
#include "pch.h"
#include "config.h"
#ifndef CRYPTOPP_IMPORTS
#include "allocate.h"
#include "stdcpp.h"
#include "misc.h"
#include "trap.h"
// for memalign
#if defined(CRYPTOPP_MEMALIGN_AVAILABLE) || defined(CRYPTOPP_MM_MALLOC_AVAILABLE) || defined(QNX)
# include <malloc.h>
#endif
// for posix_memalign
#if defined(CRYPTOPP_POSIX_MEMALIGN_AVAILABLE)
# include <stdlib.h>
#endif
NAMESPACE_BEGIN(CryptoPP)
void CallNewHandler()
{
using std::new_handler;
using std::set_new_handler;
new_handler newHandler = set_new_handler(NULLPTR);
if (newHandler)
set_new_handler(newHandler);
if (newHandler)
newHandler();
else
throw std::bad_alloc();
}
void * AlignedAllocate(size_t size)
{
byte *p;
#if defined(CRYPTOPP_MM_MALLOC_AVAILABLE)
while ((p = (byte *)_mm_malloc(size, 16)) == NULLPTR)
#elif defined(CRYPTOPP_MEMALIGN_AVAILABLE)
while ((p = (byte *)memalign(16, size)) == NULLPTR)
#elif defined(CRYPTOPP_MALLOC_ALIGNMENT_IS_16)
while ((p = (byte *)malloc(size)) == NULLPTR)
#elif defined(CRYPTOPP_POSIX_MEMALIGN_AVAILABLE)
while (posix_memalign(reinterpret_cast<void**>(&p), 16, size) != 0)
#else
while ((p = (byte *)malloc(size + 16)) == NULLPTR)
#endif
CallNewHandler();
#ifdef CRYPTOPP_NO_ALIGNED_ALLOC
size_t adjustment = 16-((size_t)p%16);
CRYPTOPP_ASSERT(adjustment > 0);
p += adjustment;
p[-1] = (byte)adjustment;
#endif
// If this assert fires then there are problems that need
// to be fixed. Please open a bug report.
CRYPTOPP_ASSERT(IsAlignedOn(p, 16));
return p;
}
void AlignedDeallocate(void *p)
{
// Guard pointer due to crash on AIX when CRYPTOPP_NO_ALIGNED_ALLOC
// is in effect. The guard was previously in place in SecBlock,
// but it was removed at f4d68353ca7c as part of GH #875.
CRYPTOPP_ASSERT(p);
if (p != NULLPTR)
{
#ifdef CRYPTOPP_MM_MALLOC_AVAILABLE
_mm_free(p);
#elif defined(CRYPTOPP_NO_ALIGNED_ALLOC)
p = (byte *)p - ((byte *)p)[-1];
free(p);
#else
free(p);
#endif
}
}
void * UnalignedAllocate(size_t size)
{
void *p;
while ((p = malloc(size)) == NULLPTR)
CallNewHandler();
return p;
}
void UnalignedDeallocate(void *p)
{
free(p);
}
NAMESPACE_END
#endif // CRYPTOPP_IMPORTS

View File

@ -0,0 +1,74 @@
// allocate.h - written and placed in the public domain by Jeffrey Walton
// The functions in allocate.h and allocate.cpp were originally in misc.h
// and misc.cpp. They were extracted in September 2019 to sidestep a circular
// dependency with misc.h and secblock.h.
/// \file allocate.h
/// \brief Functions for allocating aligned buffers
#ifndef CRYPTOPP_ALLOCATE_H
#define CRYPTOPP_ALLOCATE_H
#include "config.h"
#include "cryptlib.h"
NAMESPACE_BEGIN(CryptoPP)
/// \brief Attempts to reclaim unused memory
/// \throw bad_alloc
/// \details In the normal course of running a program, a request for memory
/// normally succeeds. If a call to AlignedAllocate or UnalignedAllocate fails,
/// then CallNewHandler is called in n effort to recover. Internally,
/// CallNewHandler calls set_new_handler(nullptr) in an effort to free memory.
/// There is no guarantee CallNewHandler will be able to obtain more memory so
/// an allocation succeeds. If the call to set_new_handler fails, then CallNewHandler
/// throws a bad_alloc exception.
/// \throw bad_alloc on failure
/// \since Crypto++ 5.0
/// \sa AlignedAllocate, AlignedDeallocate, UnalignedAllocate, UnalignedDeallocate
CRYPTOPP_DLL void CRYPTOPP_API CallNewHandler();
/// \brief Allocates a buffer on 16-byte boundary
/// \param size the size of the buffer
/// \details AlignedAllocate is primarily used when the data will be
/// processed by SSE, NEON, ARMv8 or PowerPC instructions. The assembly
/// language routines rely on the alignment. If the alignment is not
/// respected, then a SIGBUS could be generated on Unix and Linux, and an
/// EXCEPTION_DATATYPE_MISALIGNMENT could be generated on Windows.
/// \details Formerly, AlignedAllocate and AlignedDeallocate were only
/// available on certain platforms when CRYTPOPP_DISABLE_ASM was not in
/// effect. However, Android and iOS debug simulator builds got into a
/// state where the aligned allocator was not available and caused link
/// failures.
/// \since AlignedAllocate for SIMD since Crypto++ 1.0, AlignedAllocate
/// for all builds since Crypto++ 8.1
/// \sa AlignedDeallocate, UnalignedAllocate, UnalignedDeallocate, CallNewHandler,
/// <A HREF="http://github.com/weidai11/cryptopp/issues/779">Issue 779</A>
CRYPTOPP_DLL void* CRYPTOPP_API AlignedAllocate(size_t size);
/// \brief Frees a buffer allocated with AlignedAllocate
/// \param ptr the buffer to free
/// \since AlignedDeallocate for SIMD since Crypto++ 1.0, AlignedAllocate
/// for all builds since Crypto++ 8.1
/// \sa AlignedAllocate, UnalignedAllocate, UnalignedDeallocate, CallNewHandler,
/// <A HREF="http://github.com/weidai11/cryptopp/issues/779">Issue 779</A>
CRYPTOPP_DLL void CRYPTOPP_API AlignedDeallocate(void *ptr);
/// \brief Allocates a buffer
/// \param size the size of the buffer
/// \since Crypto++ 1.0
/// \sa AlignedAllocate, AlignedDeallocate, UnalignedDeallocate, CallNewHandler,
/// <A HREF="http://github.com/weidai11/cryptopp/issues/779">Issue 779</A>
CRYPTOPP_DLL void * CRYPTOPP_API UnalignedAllocate(size_t size);
/// \brief Frees a buffer allocated with UnalignedAllocate
/// \param ptr the buffer to free
/// \since Crypto++ 1.0
/// \sa AlignedAllocate, AlignedDeallocate, UnalignedAllocate, CallNewHandler,
/// <A HREF="http://github.com/weidai11/cryptopp/issues/779">Issue 779</A>
CRYPTOPP_DLL void CRYPTOPP_API UnalignedDeallocate(void *ptr);
NAMESPACE_END
#endif // CRYPTOPP_ALLOCATE_H

View File

@ -49,7 +49,7 @@ protected:
/// \brief Alleged RC4
/// \sa <a href="http://www.cryptopp.com/wiki/RC4">Alleged RC4</a>
/// \since Crypto++ 3.1
DOCUMENTED_TYPEDEF(SymmetricCipherFinal<ARC4_Base>, ARC4)
DOCUMENTED_TYPEDEF(SymmetricCipherFinal<ARC4_Base>, ARC4);
/// \brief MARC4 base class
/// \details Implementations and overrides in \p Base apply to both \p ENCRYPTION and \p DECRYPTION directions
@ -70,7 +70,7 @@ protected:
/// \brief Modified Alleged RC4
/// \sa <a href="http://www.cryptopp.com/wiki/RC4">Alleged RC4</a>
/// \since Crypto++ 3.1
DOCUMENTED_TYPEDEF(SymmetricCipherFinal<MARC4_Base>, MARC4)
DOCUMENTED_TYPEDEF(SymmetricCipherFinal<MARC4_Base>, MARC4);
}
#if CRYPTOPP_ENABLE_NAMESPACE_WEAK >= 1

View File

@ -1,158 +0,0 @@
// aria-simd.cpp - written and placed in the public domain by
// Jeffrey Walton, Uri Blumenthal and Marcel Raad.
//
// This source file uses intrinsics to gain access to ARMv7a and
// ARMv8a NEON instructions. A separate source file is needed
// because additional CXXFLAGS are required to enable the
// appropriate instructions sets in some build configurations.
#include "pch.h"
#include "config.h"
#include "misc.h"
#if (CRYPTOPP_SSSE3_AVAILABLE)
# include <tmmintrin.h>
#endif
#if (CRYPTOPP_ARM_NEON_AVAILABLE)
# include <arm_neon.h>
#endif
// Can't use CRYPTOPP_ARM_XXX_AVAILABLE because too many
// compilers don't follow ACLE conventions for the include.
#if defined(CRYPTOPP_ARM_ACLE_AVAILABLE)
# include <stdint.h>
# include <arm_acle.h>
#endif
// Clang __m128i casts, http://bugs.llvm.org/show_bug.cgi?id=20670
#define M128_CAST(x) ((__m128i *)(void *)(x))
#define CONST_M128_CAST(x) ((const __m128i *)(const void *)(x))
// GCC cast warning
#define UINT32_CAST(x) ((uint32_t *)(void *)(x))
#define CONST_UINT32_CAST(x) ((const uint32_t *)(const void *)(x))
NAMESPACE_BEGIN(CryptoPP)
NAMESPACE_BEGIN(ARIATab)
extern const word32 S1[256];
extern const word32 S2[256];
extern const word32 X1[256];
extern const word32 X2[256];
extern const word32 KRK[3][4];
NAMESPACE_END
NAMESPACE_END
NAMESPACE_BEGIN(CryptoPP)
using CryptoPP::ARIATab::S1;
using CryptoPP::ARIATab::S2;
using CryptoPP::ARIATab::X1;
using CryptoPP::ARIATab::X2;
using CryptoPP::ARIATab::KRK;
#if (CRYPTOPP_ARM_NEON_AVAILABLE)
template <unsigned int N>
inline void ARIA_GSRK_NEON(const uint32x4_t X, const uint32x4_t Y, byte RK[16])
{
static const unsigned int Q1 = (4-(N/32)) % 4;
static const unsigned int Q2 = (3-(N/32)) % 4;
static const unsigned int R = N % 32;
vst1q_u32(UINT32_CAST(RK),
veorq_u32(X, veorq_u32(
vshrq_n_u32(vextq_u32(Y, Y, Q1), R),
vshlq_n_u32(vextq_u32(Y, Y, Q2), 32-R))));
}
void ARIA_UncheckedSetKey_Schedule_NEON(byte* rk, word32* ws, unsigned int keylen)
{
const uint32x4_t w0 = vld1q_u32(CONST_UINT32_CAST(ws+ 0));
const uint32x4_t w1 = vld1q_u32(CONST_UINT32_CAST(ws+ 8));
const uint32x4_t w2 = vld1q_u32(CONST_UINT32_CAST(ws+12));
const uint32x4_t w3 = vld1q_u32(CONST_UINT32_CAST(ws+16));
ARIA_GSRK_NEON<19>(w0, w1, rk + 0);
ARIA_GSRK_NEON<19>(w1, w2, rk + 16);
ARIA_GSRK_NEON<19>(w2, w3, rk + 32);
ARIA_GSRK_NEON<19>(w3, w0, rk + 48);
ARIA_GSRK_NEON<31>(w0, w1, rk + 64);
ARIA_GSRK_NEON<31>(w1, w2, rk + 80);
ARIA_GSRK_NEON<31>(w2, w3, rk + 96);
ARIA_GSRK_NEON<31>(w3, w0, rk + 112);
ARIA_GSRK_NEON<67>(w0, w1, rk + 128);
ARIA_GSRK_NEON<67>(w1, w2, rk + 144);
ARIA_GSRK_NEON<67>(w2, w3, rk + 160);
ARIA_GSRK_NEON<67>(w3, w0, rk + 176);
ARIA_GSRK_NEON<97>(w0, w1, rk + 192);
if (keylen > 16)
{
ARIA_GSRK_NEON<97>(w1, w2, rk + 208);
ARIA_GSRK_NEON<97>(w2, w3, rk + 224);
if (keylen > 24)
{
ARIA_GSRK_NEON< 97>(w3, w0, rk + 240);
ARIA_GSRK_NEON<109>(w0, w1, rk + 256);
}
}
}
void ARIA_ProcessAndXorBlock_Xor_NEON(const byte* xorBlock, byte* outBlock)
{
vst1q_u32(UINT32_CAST(outBlock), veorq_u32(
vld1q_u32(CONST_UINT32_CAST(outBlock)),
vld1q_u32(CONST_UINT32_CAST(xorBlock))));
}
#endif // CRYPTOPP_ARM_NEON_AVAILABLE
#if (CRYPTOPP_SSSE3_AVAILABLE)
inline byte ARIA_BRF(const word32 x, const int y) {
return GETBYTE(x, y);
}
void ARIA_ProcessAndXorBlock_Xor_SSSE3(const byte* xorBlock, byte* outBlock, const byte *rk, word32 *t)
{
const __m128i MASK = _mm_set_epi8(12,13,14,15, 8,9,10,11, 4,5,6,7, 0,1,2,3);
outBlock[ 0] = (byte)(X1[ARIA_BRF(t[0],3)] );
outBlock[ 1] = (byte)(X2[ARIA_BRF(t[0],2)]>>8);
outBlock[ 2] = (byte)(S1[ARIA_BRF(t[0],1)] );
outBlock[ 3] = (byte)(S2[ARIA_BRF(t[0],0)] );
outBlock[ 4] = (byte)(X1[ARIA_BRF(t[1],3)] );
outBlock[ 5] = (byte)(X2[ARIA_BRF(t[1],2)]>>8);
outBlock[ 6] = (byte)(S1[ARIA_BRF(t[1],1)] );
outBlock[ 7] = (byte)(S2[ARIA_BRF(t[1],0)] );
outBlock[ 8] = (byte)(X1[ARIA_BRF(t[2],3)] );
outBlock[ 9] = (byte)(X2[ARIA_BRF(t[2],2)]>>8);
outBlock[10] = (byte)(S1[ARIA_BRF(t[2],1)] );
outBlock[11] = (byte)(S2[ARIA_BRF(t[2],0)] );
outBlock[12] = (byte)(X1[ARIA_BRF(t[3],3)] );
outBlock[13] = (byte)(X2[ARIA_BRF(t[3],2)]>>8);
outBlock[14] = (byte)(S1[ARIA_BRF(t[3],1)] );
outBlock[15] = (byte)(S2[ARIA_BRF(t[3],0)] );
// 'outBlock' may be unaligned.
_mm_storeu_si128(M128_CAST(outBlock),
_mm_xor_si128(_mm_loadu_si128(CONST_M128_CAST(outBlock)),
_mm_shuffle_epi8(_mm_load_si128(CONST_M128_CAST(rk)), MASK)));
// 'outBlock' and 'xorBlock' may be unaligned.
if (xorBlock != NULLPTR)
{
_mm_storeu_si128(M128_CAST(outBlock),
_mm_xor_si128(
_mm_loadu_si128(CONST_M128_CAST(outBlock)),
_mm_loadu_si128(CONST_M128_CAST(xorBlock))));
}
}
#endif // CRYPTOPP_SSSE3_AVAILABLE
NAMESPACE_END

View File

@ -15,10 +15,6 @@
# define CRYPTOPP_ENABLE_ARIA_SSSE3_INTRINSICS 1
#endif
// GCC cast warning. Note: this is used on round key table,
// which is word32 and naturally aligned.
#define UINT32_CAST(x) ((word32 *)(void *)(x))
NAMESPACE_BEGIN(CryptoPP)
NAMESPACE_BEGIN(ARIATab)
@ -39,57 +35,75 @@ using CryptoPP::ARIATab::X1;
using CryptoPP::ARIATab::X2;
using CryptoPP::ARIATab::KRK;
inline byte ARIA_BRF(const word32 x, const int y) {
return GETBYTE(x, y);
inline word32* UINT32_CAST(const byte* ptr) {
return reinterpret_cast<word32*>(const_cast<byte*>(ptr));
}
// Key XOR Layer
#define ARIA_KXL { \
typedef BlockGetAndPut<word32, NativeByteOrder, true, true> NativeBlock; \
NativeBlock::Put(rk, t)(t[0])(t[1])(t[2])(t[3]); \
}
inline byte ARIA_BRF(const word32 x, const int y) {
return static_cast<byte>(GETBYTE(x, y));
}
// Key XOR Layer. Bumps the round key pointer.
inline const byte* ARIA_KXL(const byte rk[16], word32 t[4]) {
typedef BlockGetAndPut<word32, NativeByteOrder, true, true> NativeBlock;
NativeBlock::Put(rk, t)(t[0])(t[1])(t[2])(t[3]);
return rk+16;
}
// S-Box Layer 1 + M
#define SBL1_M(T0,T1,T2,T3) { \
T0=S1[ARIA_BRF(T0,3)]^S2[ARIA_BRF(T0,2)]^X1[ARIA_BRF(T0,1)]^X2[ARIA_BRF(T0,0)]; \
T1=S1[ARIA_BRF(T1,3)]^S2[ARIA_BRF(T1,2)]^X1[ARIA_BRF(T1,1)]^X2[ARIA_BRF(T1,0)]; \
T2=S1[ARIA_BRF(T2,3)]^S2[ARIA_BRF(T2,2)]^X1[ARIA_BRF(T2,1)]^X2[ARIA_BRF(T2,0)]; \
T3=S1[ARIA_BRF(T3,3)]^S2[ARIA_BRF(T3,2)]^X1[ARIA_BRF(T3,1)]^X2[ARIA_BRF(T3,0)]; \
}
inline void SBL1_M(word32& T0, word32& T1, word32& T2, word32& T3) {
T0=S1[ARIA_BRF(T0,3)]^S2[ARIA_BRF(T0,2)]^X1[ARIA_BRF(T0,1)]^X2[ARIA_BRF(T0,0)];
T1=S1[ARIA_BRF(T1,3)]^S2[ARIA_BRF(T1,2)]^X1[ARIA_BRF(T1,1)]^X2[ARIA_BRF(T1,0)];
T2=S1[ARIA_BRF(T2,3)]^S2[ARIA_BRF(T2,2)]^X1[ARIA_BRF(T2,1)]^X2[ARIA_BRF(T2,0)];
T3=S1[ARIA_BRF(T3,3)]^S2[ARIA_BRF(T3,2)]^X1[ARIA_BRF(T3,1)]^X2[ARIA_BRF(T3,0)];
}
// S-Box Layer 2 + M
#define SBL2_M(T0,T1,T2,T3) { \
T0=X1[ARIA_BRF(T0,3)]^X2[ARIA_BRF(T0,2)]^S1[ARIA_BRF(T0,1)]^S2[ARIA_BRF(T0,0)]; \
T1=X1[ARIA_BRF(T1,3)]^X2[ARIA_BRF(T1,2)]^S1[ARIA_BRF(T1,1)]^S2[ARIA_BRF(T1,0)]; \
T2=X1[ARIA_BRF(T2,3)]^X2[ARIA_BRF(T2,2)]^S1[ARIA_BRF(T2,1)]^S2[ARIA_BRF(T2,0)]; \
T3=X1[ARIA_BRF(T3,3)]^X2[ARIA_BRF(T3,2)]^S1[ARIA_BRF(T3,1)]^S2[ARIA_BRF(T3,0)]; \
inline void SBL2_M(word32& T0, word32& T1, word32& T2, word32& T3) {
T0=X1[ARIA_BRF(T0,3)]^X2[ARIA_BRF(T0,2)]^S1[ARIA_BRF(T0,1)]^S2[ARIA_BRF(T0,0)];
T1=X1[ARIA_BRF(T1,3)]^X2[ARIA_BRF(T1,2)]^S1[ARIA_BRF(T1,1)]^S2[ARIA_BRF(T1,0)];
T2=X1[ARIA_BRF(T2,3)]^X2[ARIA_BRF(T2,2)]^S1[ARIA_BRF(T2,1)]^S2[ARIA_BRF(T2,0)];
T3=X1[ARIA_BRF(T3,3)]^X2[ARIA_BRF(T3,2)]^S1[ARIA_BRF(T3,1)]^S2[ARIA_BRF(T3,0)];
}
#define ARIA_P(T0,T1,T2,T3) { \
(T1) = (((T1)<< 8)&0xff00ff00) ^ (((T1)>> 8)&0x00ff00ff); \
(T2) = rotrConstant<16>(T2); \
(T3) = ByteReverse((T3)); \
}
inline void ARIA_P(word32& T0, word32& T1, word32& T2, word32& T3) {
CRYPTOPP_UNUSED(T0);
T1 = ((T1<< 8)&0xff00ff00) ^ ((T1>> 8)&0x00ff00ff);
T2 = rotrConstant<16>(T2);
T3 = ByteReverse((T3));
}
#define ARIA_M(X,Y) { \
Y=(X)<<8 ^ (X)>>8 ^ (X)<<16 ^ (X)>>16 ^ (X)<<24 ^ (X)>>24; \
}
inline void ARIA_M(word32& X, word32& Y) {
Y=X<<8 ^ X>>8 ^ X<<16 ^ X>>16 ^ X<<24 ^ X>>24;
}
#define ARIA_MM(T0,T1,T2,T3) { \
(T1)^=(T2); (T2)^=(T3); (T0)^=(T1); \
(T3)^=(T1); (T2)^=(T0); (T1)^=(T2); \
}
#define ARIA_FO {SBL1_M(t[0],t[1],t[2],t[3]) ARIA_MM(t[0],t[1],t[2],t[3]) ARIA_P(t[0],t[1],t[2],t[3]) ARIA_MM(t[0],t[1],t[2],t[3])}
#define ARIA_FE {SBL2_M(t[0],t[1],t[2],t[3]) ARIA_MM(t[0],t[1],t[2],t[3]) ARIA_P(t[2],t[3],t[0],t[1]) ARIA_MM(t[0],t[1],t[2],t[3])}
inline void ARIA_MM(word32& T0, word32& T1, word32& T2, word32& T3) {
T1^=T2; T2^=T3; T0^=T1;
T3^=T1; T2^=T0; T1^=T2;
}
inline void ARIA_FO(word32 t[4]) {
SBL1_M(t[0],t[1],t[2],t[3]);
ARIA_MM(t[0],t[1],t[2],t[3]);
ARIA_P(t[0],t[1],t[2],t[3]);
ARIA_MM(t[0],t[1],t[2],t[3]);
}
inline void ARIA_FE(word32 t[4]) {
SBL2_M(t[0],t[1],t[2],t[3]);
ARIA_MM(t[0],t[1],t[2],t[3]);
ARIA_P(t[2],t[3],t[0],t[1]);
ARIA_MM(t[0],t[1],t[2],t[3]);
}
#if (CRYPTOPP_ARM_NEON_AVAILABLE)
extern void ARIA_UncheckedSetKey_Schedule_NEON(byte* rk, word32* ws, unsigned int keylen);
extern void ARIA_ProcessAndXorBlock_Xor_NEON(const byte* xorBlock, byte* outblock);
extern void ARIA_ProcessAndXorBlock_NEON(const byte* xorBlock, byte* outblock, const byte *rk, word32 *t);
#endif
#if (CRYPTOPP_SSSE3_AVAILABLE)
extern void ARIA_ProcessAndXorBlock_Xor_SSSE3(const byte* xorBlock, byte* outBlock, const byte *rk, word32 *t);
extern void ARIA_ProcessAndXorBlock_SSSE3(const byte* xorBlock, byte* outBlock, const byte *rk, word32 *t);
#endif
// n-bit right shift of Y XORed to X
@ -109,10 +123,9 @@ void ARIA::Base::UncheckedSetKey(const byte *key, unsigned int keylen, const Nam
{
CRYPTOPP_UNUSED(params);
m_rk.New(16*17); // round keys
m_w.New(4*7); // w0, w1, w2, w3, t and u
m_rk.New(16*17); // round keys
m_w.New(4*7+4); // w0, w1, w2, w3, t and u
const byte *mk = key;
byte *rk = m_rk.data();
int Q, q, R, r;
@ -144,16 +157,14 @@ void ARIA::Base::UncheckedSetKey(const byte *key, unsigned int keylen, const Nam
t[0]=w0[0]^KRK[q][0]; t[1]=w0[1]^KRK[q][1];
t[2]=w0[2]^KRK[q][2]; t[3]=w0[3]^KRK[q][3];
ARIA_FO;
ARIA_FO(t);
if (keylen == 32)
{
GetBlock<word32, BigEndian, false>block(mk+16);
block(w1[0])(w1[1])(w1[2])(w1[3]);
}
else if (keylen == 24)
{
GetBlock<word32, BigEndian, false>block(mk+16);
block(w1[0])(w1[1]); w1[2] = w1[3] = 0;
}
else
@ -162,20 +173,20 @@ void ARIA::Base::UncheckedSetKey(const byte *key, unsigned int keylen, const Nam
}
w1[0]^=t[0]; w1[1]^=t[1]; w1[2]^=t[2]; w1[3]^=t[3];
::memcpy(t, w1, 16);
std::memcpy(t, w1, 16);
q = (q==2) ? 0 : (q+1);
t[0]^=KRK[q][0]; t[1]^=KRK[q][1]; t[2]^=KRK[q][2]; t[3]^=KRK[q][3];
ARIA_FE;
ARIA_FE(t);
t[0]^=w0[0]; t[1]^=w0[1]; t[2]^=w0[2]; t[3]^=w0[3];
::memcpy(w2, t, 16);
std::memcpy(w2, t, 16);
q = (q==2) ? 0 : (q+1);
t[0]^=KRK[q][0]; t[1]^=KRK[q][1]; t[2]^=KRK[q][2]; t[3]^=KRK[q][3];
ARIA_FO;
ARIA_FO(t);
w3[0]=t[0]^w1[0]; w3[1]=t[1]^w1[1]; w3[2]=t[2]^w1[2]; w3[3]=t[3]^w1[3];
@ -222,23 +233,23 @@ void ARIA::Base::UncheckedSetKey(const byte *key, unsigned int keylen, const Nam
r = R; q = Q;
a=UINT32_CAST(rk); s=m_w.data()+24; z=a+r*4;
::memcpy(t, a, 16); ::memcpy(a, z, 16); ::memcpy(z, t, 16);
std::memcpy(t, a, 16); std::memcpy(a, z, 16); std::memcpy(z, t, 16);
a+=4; z-=4;
for (; a<z; a+=4, z-=4)
{
ARIA_M(a[0],t[0]); ARIA_M(a[1],t[1]); ARIA_M(a[2],t[2]); ARIA_M(a[3],t[3]);
ARIA_MM(t[0],t[1],t[2],t[3]); ARIA_P(t[0],t[1],t[2],t[3]); ARIA_MM(t[0],t[1],t[2],t[3]);
::memcpy(s, t, 16);
std::memcpy(s, t, 16);
ARIA_M(z[0],t[0]); ARIA_M(z[1],t[1]); ARIA_M(z[2],t[2]); ARIA_M(z[3],t[3]);
ARIA_MM(t[0],t[1],t[2],t[3]); ARIA_P(t[0],t[1],t[2],t[3]); ARIA_MM(t[0],t[1],t[2],t[3]);
::memcpy(a, t, 16); ::memcpy(z, s, 16);
std::memcpy(a, t, 16); std::memcpy(z, s, 16);
}
ARIA_M(a[0],t[0]); ARIA_M(a[1],t[1]); ARIA_M(a[2],t[2]); ARIA_M(a[3],t[3]);
ARIA_MM(t[0],t[1],t[2],t[3]); ARIA_P(t[0],t[1],t[2],t[3]); ARIA_MM(t[0],t[1],t[2],t[3]);
::memcpy(z, t, 16);
std::memcpy(z, t, 16);
}
// Silence warnings
@ -266,32 +277,39 @@ void ARIA::Base::ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, b
block(t[0])(t[1])(t[2])(t[3]);
if (m_rounds > 12) {
ARIA_KXL; rk+= 16; ARIA_FO;
ARIA_KXL; rk+= 16; ARIA_FE;
rk = ARIA_KXL(rk, t); ARIA_FO(t);
rk = ARIA_KXL(rk, t); ARIA_FE(t);
}
if (m_rounds > 14) {
ARIA_KXL; rk+= 16; ARIA_FO;
ARIA_KXL; rk+= 16; ARIA_FE;
rk = ARIA_KXL(rk, t); ARIA_FO(t);
rk = ARIA_KXL(rk, t); ARIA_FE(t);
}
ARIA_KXL; rk+= 16; ARIA_FO; ARIA_KXL; rk+= 16; ARIA_FE;
ARIA_KXL; rk+= 16; ARIA_FO; ARIA_KXL; rk+= 16; ARIA_FE;
ARIA_KXL; rk+= 16; ARIA_FO; ARIA_KXL; rk+= 16; ARIA_FE;
ARIA_KXL; rk+= 16; ARIA_FO; ARIA_KXL; rk+= 16; ARIA_FE;
ARIA_KXL; rk+= 16; ARIA_FO; ARIA_KXL; rk+= 16; ARIA_FE;
ARIA_KXL; rk+= 16; ARIA_FO; ARIA_KXL; rk+= 16;
rk = ARIA_KXL(rk, t); ARIA_FO(t); rk = ARIA_KXL(rk, t); ARIA_FE(t);
rk = ARIA_KXL(rk, t); ARIA_FO(t); rk = ARIA_KXL(rk, t); ARIA_FE(t);
rk = ARIA_KXL(rk, t); ARIA_FO(t); rk = ARIA_KXL(rk, t); ARIA_FE(t);
rk = ARIA_KXL(rk, t); ARIA_FO(t); rk = ARIA_KXL(rk, t); ARIA_FE(t);
rk = ARIA_KXL(rk, t); ARIA_FO(t); rk = ARIA_KXL(rk, t); ARIA_FE(t);
rk = ARIA_KXL(rk, t); ARIA_FO(t); rk = ARIA_KXL(rk, t);
#if CRYPTOPP_ENABLE_ARIA_SSSE3_INTRINSICS
if (HasSSSE3())
{
ARIA_ProcessAndXorBlock_Xor_SSSE3(xorBlock, outBlock, rk, t);
ARIA_ProcessAndXorBlock_SSSE3(xorBlock, outBlock, rk, t);
return;
}
else
#endif // CRYPTOPP_ENABLE_ARIA_SSSE3_INTRINSICS
#ifdef CRYPTOPP_LITTLE_ENDIAN
#if (CRYPTOPP_ARM_NEON_AVAILABLE)
if (HasNEON())
{
ARIA_ProcessAndXorBlock_NEON(xorBlock, outBlock, rk, t);
return;
}
else
#endif // CRYPTOPP_ARM_NEON_AVAILABLE
#if (CRYPTOPP_LITTLE_ENDIAN)
{
outBlock[ 0] = (byte)(X1[ARIA_BRF(t[0],3)] ) ^ rk[ 3];
outBlock[ 1] = (byte)(X2[ARIA_BRF(t[0],2)]>>8) ^ rk[ 2];
@ -331,19 +349,9 @@ void ARIA::Base::ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, b
}
#endif // CRYPTOPP_LITTLE_ENDIAN
#if CRYPTOPP_ARM_NEON_AVAILABLE
if (HasNEON())
{
if (xorBlock != NULLPTR)
ARIA_ProcessAndXorBlock_Xor_NEON(xorBlock, outBlock);
}
else
#endif // CRYPTOPP_ARM_NEON_AVAILABLE
{
if (xorBlock != NULLPTR)
for (unsigned int n=0; n<ARIA::BLOCKSIZE; ++n)
outBlock[n] ^= xorBlock[n];
}
if (xorBlock != NULLPTR)
for (unsigned int n=0; n<ARIA::BLOCKSIZE; ++n)
outBlock[n] ^= xorBlock[n];
}
NAMESPACE_END

View File

@ -0,0 +1,194 @@
// aria_simd.cpp - written and placed in the public domain by
// Jeffrey Walton, Uri Blumenthal and Marcel Raad.
//
// This source file uses intrinsics to gain access to ARMv7a and
// ARMv8a NEON instructions. A separate source file is needed
// because additional CXXFLAGS are required to enable the
// appropriate instructions sets in some build configurations.
#include "pch.h"
#include "config.h"
#include "misc.h"
#if (CRYPTOPP_SSSE3_AVAILABLE)
# include <tmmintrin.h>
#endif
#if (CRYPTOPP_ARM_NEON_HEADER)
# include <arm_neon.h>
#endif
#if (CRYPTOPP_ARM_ACLE_HEADER)
# include <stdint.h>
# include <arm_acle.h>
#endif
// Squash MS LNK4221 and libtool warnings
extern const char ARIA_SIMD_FNAME[] = __FILE__;
NAMESPACE_BEGIN(CryptoPP)
NAMESPACE_BEGIN(ARIATab)
extern const word32 S1[256];
extern const word32 S2[256];
extern const word32 X1[256];
extern const word32 X2[256];
extern const word32 KRK[3][4];
NAMESPACE_END
NAMESPACE_END
ANONYMOUS_NAMESPACE_BEGIN
using CryptoPP::byte;
using CryptoPP::word32;
inline byte ARIA_BRF(const word32 x, const int y) {
return static_cast<byte>(GETBYTE(x, y));
}
ANONYMOUS_NAMESPACE_END
NAMESPACE_BEGIN(CryptoPP)
using CryptoPP::ARIATab::S1;
using CryptoPP::ARIATab::S2;
using CryptoPP::ARIATab::X1;
using CryptoPP::ARIATab::X2;
using CryptoPP::ARIATab::KRK;
#if (CRYPTOPP_ARM_NEON_AVAILABLE)
template <unsigned int N>
inline void ARIA_GSRK_NEON(const uint32x4_t X, const uint32x4_t Y, byte RK[16])
{
enum { Q1 = (4-(N/32)) % 4,
Q2 = (3-(N/32)) % 4,
R = N % 32
};
vst1q_u8(RK, vreinterpretq_u8_u32(
veorq_u32(X, veorq_u32(
vshrq_n_u32(vextq_u32(Y, Y, Q1), R),
vshlq_n_u32(vextq_u32(Y, Y, Q2), 32-R)))));
}
void ARIA_UncheckedSetKey_Schedule_NEON(byte* rk, word32* ws, unsigned int keylen)
{
const uint32x4_t w0 = vld1q_u32(ws+ 0);
const uint32x4_t w1 = vld1q_u32(ws+ 8);
const uint32x4_t w2 = vld1q_u32(ws+12);
const uint32x4_t w3 = vld1q_u32(ws+16);
ARIA_GSRK_NEON<19>(w0, w1, rk + 0);
ARIA_GSRK_NEON<19>(w1, w2, rk + 16);
ARIA_GSRK_NEON<19>(w2, w3, rk + 32);
ARIA_GSRK_NEON<19>(w3, w0, rk + 48);
ARIA_GSRK_NEON<31>(w0, w1, rk + 64);
ARIA_GSRK_NEON<31>(w1, w2, rk + 80);
ARIA_GSRK_NEON<31>(w2, w3, rk + 96);
ARIA_GSRK_NEON<31>(w3, w0, rk + 112);
ARIA_GSRK_NEON<67>(w0, w1, rk + 128);
ARIA_GSRK_NEON<67>(w1, w2, rk + 144);
ARIA_GSRK_NEON<67>(w2, w3, rk + 160);
ARIA_GSRK_NEON<67>(w3, w0, rk + 176);
ARIA_GSRK_NEON<97>(w0, w1, rk + 192);
if (keylen > 16)
{
ARIA_GSRK_NEON<97>(w1, w2, rk + 208);
ARIA_GSRK_NEON<97>(w2, w3, rk + 224);
if (keylen > 24)
{
ARIA_GSRK_NEON< 97>(w3, w0, rk + 240);
ARIA_GSRK_NEON<109>(w0, w1, rk + 256);
}
}
}
void ARIA_ProcessAndXorBlock_NEON(const byte* xorBlock, byte* outBlock, const byte *rk, word32 *t)
{
outBlock[ 0] = (byte)(X1[ARIA_BRF(t[0],3)] );
outBlock[ 1] = (byte)(X2[ARIA_BRF(t[0],2)]>>8);
outBlock[ 2] = (byte)(S1[ARIA_BRF(t[0],1)] );
outBlock[ 3] = (byte)(S2[ARIA_BRF(t[0],0)] );
outBlock[ 4] = (byte)(X1[ARIA_BRF(t[1],3)] );
outBlock[ 5] = (byte)(X2[ARIA_BRF(t[1],2)]>>8);
outBlock[ 6] = (byte)(S1[ARIA_BRF(t[1],1)] );
outBlock[ 7] = (byte)(S2[ARIA_BRF(t[1],0)] );
outBlock[ 8] = (byte)(X1[ARIA_BRF(t[2],3)] );
outBlock[ 9] = (byte)(X2[ARIA_BRF(t[2],2)]>>8);
outBlock[10] = (byte)(S1[ARIA_BRF(t[2],1)] );
outBlock[11] = (byte)(S2[ARIA_BRF(t[2],0)] );
outBlock[12] = (byte)(X1[ARIA_BRF(t[3],3)] );
outBlock[13] = (byte)(X2[ARIA_BRF(t[3],2)]>>8);
outBlock[14] = (byte)(S1[ARIA_BRF(t[3],1)] );
outBlock[15] = (byte)(S2[ARIA_BRF(t[3],0)] );
// 'outBlock' and 'xorBlock' may be unaligned.
if (xorBlock != NULLPTR)
{
vst1q_u8(outBlock,
veorq_u8(
vld1q_u8(xorBlock),
veorq_u8(
vld1q_u8(outBlock),
vrev32q_u8(vld1q_u8((rk))))));
}
else
{
vst1q_u8(outBlock,
veorq_u8(
vld1q_u8(outBlock),
vrev32q_u8(vld1q_u8(rk))));
}
}
#endif // CRYPTOPP_ARM_NEON_AVAILABLE
#if (CRYPTOPP_SSSE3_AVAILABLE)
void ARIA_ProcessAndXorBlock_SSSE3(const byte* xorBlock, byte* outBlock, const byte *rk, word32 *t)
{
const __m128i MASK = _mm_set_epi8(12,13,14,15, 8,9,10,11, 4,5,6,7, 0,1,2,3);
outBlock[ 0] = (byte)(X1[ARIA_BRF(t[0],3)] );
outBlock[ 1] = (byte)(X2[ARIA_BRF(t[0],2)]>>8);
outBlock[ 2] = (byte)(S1[ARIA_BRF(t[0],1)] );
outBlock[ 3] = (byte)(S2[ARIA_BRF(t[0],0)] );
outBlock[ 4] = (byte)(X1[ARIA_BRF(t[1],3)] );
outBlock[ 5] = (byte)(X2[ARIA_BRF(t[1],2)]>>8);
outBlock[ 6] = (byte)(S1[ARIA_BRF(t[1],1)] );
outBlock[ 7] = (byte)(S2[ARIA_BRF(t[1],0)] );
outBlock[ 8] = (byte)(X1[ARIA_BRF(t[2],3)] );
outBlock[ 9] = (byte)(X2[ARIA_BRF(t[2],2)]>>8);
outBlock[10] = (byte)(S1[ARIA_BRF(t[2],1)] );
outBlock[11] = (byte)(S2[ARIA_BRF(t[2],0)] );
outBlock[12] = (byte)(X1[ARIA_BRF(t[3],3)] );
outBlock[13] = (byte)(X2[ARIA_BRF(t[3],2)]>>8);
outBlock[14] = (byte)(S1[ARIA_BRF(t[3],1)] );
outBlock[15] = (byte)(S2[ARIA_BRF(t[3],0)] );
// 'outBlock' and 'xorBlock' may be unaligned.
if (xorBlock != NULLPTR)
{
_mm_storeu_si128(M128_CAST(outBlock),
_mm_xor_si128(
_mm_loadu_si128(CONST_M128_CAST(xorBlock)),
_mm_xor_si128(
_mm_loadu_si128(CONST_M128_CAST(outBlock)),
_mm_shuffle_epi8(_mm_load_si128(CONST_M128_CAST(rk)), MASK)))
);
}
else
{
_mm_storeu_si128(M128_CAST(outBlock),
_mm_xor_si128(_mm_loadu_si128(CONST_M128_CAST(outBlock)),
_mm_shuffle_epi8(_mm_load_si128(CONST_M128_CAST(rk)), MASK)));
}
}
#endif // CRYPTOPP_SSSE3_AVAILABLE
NAMESPACE_END

View File

@ -0,0 +1,427 @@
// arm_simd.h - written and placed in public domain by Jeffrey Walton
/// \file arm_simd.h
/// \brief Support functions for ARM and vector operations
#ifndef CRYPTOPP_ARM_SIMD_H
#define CRYPTOPP_ARM_SIMD_H
#include "config.h"
#if (CRYPTOPP_ARM_NEON_HEADER)
# include <stdint.h>
# include <arm_neon.h>
#endif
#if (CRYPTOPP_ARM_ACLE_HEADER)
# include <stdint.h>
# include <arm_acle.h>
#endif
#if (CRYPTOPP_ARM_CRC32_AVAILABLE) || defined(CRYPTOPP_DOXYGEN_PROCESSING)
/// \name CRC32 checksum
//@{
/// \brief CRC32 checksum
/// \param crc the starting crc value
/// \param val the value to checksum
/// \return CRC32 value
/// \since Crypto++ 8.6
inline uint32_t CRC32B (uint32_t crc, uint8_t val)
{
#if defined(_MSC_VER)
return __crc32b(crc, val);
#else
__asm__ ("crc32b %w0, %w0, %w1 \n\t"
:"+r" (crc) : "r" (val) );
return crc;
#endif
}
/// \brief CRC32 checksum
/// \param crc the starting crc value
/// \param val the value to checksum
/// \return CRC32 value
/// \since Crypto++ 8.6
inline uint32_t CRC32W (uint32_t crc, uint32_t val)
{
#if defined(_MSC_VER)
return __crc32w(crc, val);
#else
__asm__ ("crc32w %w0, %w0, %w1 \n\t"
:"+r" (crc) : "r" (val) );
return crc;
#endif
}
/// \brief CRC32 checksum
/// \param crc the starting crc value
/// \param vals the values to checksum
/// \return CRC32 value
/// \since Crypto++ 8.6
inline uint32_t CRC32Wx4 (uint32_t crc, const uint32_t vals[4])
{
#if defined(_MSC_VER)
return __crc32w(__crc32w(__crc32w(__crc32w(
crc, vals[0]), vals[1]), vals[2]), vals[3]);
#else
__asm__ ("crc32w %w0, %w0, %w1 \n\t"
"crc32w %w0, %w0, %w2 \n\t"
"crc32w %w0, %w0, %w3 \n\t"
"crc32w %w0, %w0, %w4 \n\t"
:"+r" (crc) : "r" (vals[0]), "r" (vals[1]),
"r" (vals[2]), "r" (vals[3]));
return crc;
#endif
}
//@}
/// \name CRC32-C checksum
/// \brief CRC32-C checksum
/// \param crc the starting crc value
/// \param val the value to checksum
/// \return CRC32-C value
/// \since Crypto++ 8.6
inline uint32_t CRC32CB (uint32_t crc, uint8_t val)
{
#if defined(_MSC_VER)
return __crc32cb(crc, val);
#else
__asm__ ("crc32cb %w0, %w0, %w1 \n\t"
:"+r" (crc) : "r" (val) );
return crc;
#endif
}
/// \brief CRC32-C checksum
/// \param crc the starting crc value
/// \param val the value to checksum
/// \return CRC32-C value
/// \since Crypto++ 8.6
inline uint32_t CRC32CW (uint32_t crc, uint32_t val)
{
#if defined(_MSC_VER)
return __crc32cw(crc, val);
#else
__asm__ ("crc32cw %w0, %w0, %w1 \n\t"
:"+r" (crc) : "r" (val) );
return crc;
#endif
}
/// \brief CRC32-C checksum
/// \param crc the starting crc value
/// \param vals the values to checksum
/// \return CRC32-C value
/// \since Crypto++ 8.6
inline uint32_t CRC32CWx4 (uint32_t crc, const uint32_t vals[4])
{
#if defined(_MSC_VER)
return __crc32cw(__crc32cw(__crc32cw(__crc32cw(
crc, vals[0]), vals[1]), vals[2]), vals[3]);
#else
__asm__ ("crc32cw %w0, %w0, %w1 \n\t"
"crc32cw %w0, %w0, %w2 \n\t"
"crc32cw %w0, %w0, %w3 \n\t"
"crc32cw %w0, %w0, %w4 \n\t"
:"+r" (crc) : "r" (vals[0]), "r" (vals[1]),
"r" (vals[2]), "r" (vals[3]));
return crc;
#endif
}
//@}
#endif // CRYPTOPP_ARM_CRC32_AVAILABLE
#if (CRYPTOPP_ARM_PMULL_AVAILABLE) || defined(CRYPTOPP_DOXYGEN_PROCESSING)
/// \name Polynomial multiplication
//@{
/// \brief Polynomial multiplication
/// \param a the first value
/// \param b the second value
/// \return vector product
/// \details PMULL_00() performs polynomial multiplication and presents
/// the result like Intel's <tt>c = _mm_clmulepi64_si128(a, b, 0x00)</tt>.
/// The <tt>0x00</tt> indicates the low 64-bits of <tt>a</tt> and <tt>b</tt>
/// are multiplied.
/// \note An Intel XMM register is composed of 128-bits. The leftmost bit
/// is MSB and numbered 127, while the rightmost bit is LSB and
/// numbered 0.
/// \since Crypto++ 8.0
inline uint64x2_t PMULL_00(const uint64x2_t a, const uint64x2_t b)
{
#if defined(_MSC_VER)
const __n64 x = { vgetq_lane_u64(a, 0) };
const __n64 y = { vgetq_lane_u64(b, 0) };
return vmull_p64(x, y);
#elif defined(__GNUC__)
uint64x2_t r;
__asm__ ("pmull %0.1q, %1.1d, %2.1d \n\t"
:"=w" (r) : "w" (a), "w" (b) );
return r;
#else
return (uint64x2_t)(vmull_p64(
vgetq_lane_u64(vreinterpretq_u64_u8(a),0),
vgetq_lane_u64(vreinterpretq_u64_u8(b),0)));
#endif
}
/// \brief Polynomial multiplication
/// \param a the first value
/// \param b the second value
/// \return vector product
/// \details PMULL_01 performs() polynomial multiplication and presents
/// the result like Intel's <tt>c = _mm_clmulepi64_si128(a, b, 0x01)</tt>.
/// The <tt>0x01</tt> indicates the low 64-bits of <tt>a</tt> and high
/// 64-bits of <tt>b</tt> are multiplied.
/// \note An Intel XMM register is composed of 128-bits. The leftmost bit
/// is MSB and numbered 127, while the rightmost bit is LSB and
/// numbered 0.
/// \since Crypto++ 8.0
inline uint64x2_t PMULL_01(const uint64x2_t a, const uint64x2_t b)
{
#if defined(_MSC_VER)
const __n64 x = { vgetq_lane_u64(a, 0) };
const __n64 y = { vgetq_lane_u64(b, 1) };
return vmull_p64(x, y);
#elif defined(__GNUC__)
uint64x2_t r;
__asm__ ("pmull %0.1q, %1.1d, %2.1d \n\t"
:"=w" (r) : "w" (a), "w" (vget_high_u64(b)) );
return r;
#else
return (uint64x2_t)(vmull_p64(
vgetq_lane_u64(vreinterpretq_u64_u8(a),0),
vgetq_lane_u64(vreinterpretq_u64_u8(b),1)));
#endif
}
/// \brief Polynomial multiplication
/// \param a the first value
/// \param b the second value
/// \return vector product
/// \details PMULL_10() performs polynomial multiplication and presents
/// the result like Intel's <tt>c = _mm_clmulepi64_si128(a, b, 0x10)</tt>.
/// The <tt>0x10</tt> indicates the high 64-bits of <tt>a</tt> and low
/// 64-bits of <tt>b</tt> are multiplied.
/// \note An Intel XMM register is composed of 128-bits. The leftmost bit
/// is MSB and numbered 127, while the rightmost bit is LSB and
/// numbered 0.
/// \since Crypto++ 8.0
inline uint64x2_t PMULL_10(const uint64x2_t a, const uint64x2_t b)
{
#if defined(_MSC_VER)
const __n64 x = { vgetq_lane_u64(a, 1) };
const __n64 y = { vgetq_lane_u64(b, 0) };
return vmull_p64(x, y);
#elif defined(__GNUC__)
uint64x2_t r;
__asm__ ("pmull %0.1q, %1.1d, %2.1d \n\t"
:"=w" (r) : "w" (vget_high_u64(a)), "w" (b) );
return r;
#else
return (uint64x2_t)(vmull_p64(
vgetq_lane_u64(vreinterpretq_u64_u8(a),1),
vgetq_lane_u64(vreinterpretq_u64_u8(b),0)));
#endif
}
/// \brief Polynomial multiplication
/// \param a the first value
/// \param b the second value
/// \return vector product
/// \details PMULL_11() performs polynomial multiplication and presents
/// the result like Intel's <tt>c = _mm_clmulepi64_si128(a, b, 0x11)</tt>.
/// The <tt>0x11</tt> indicates the high 64-bits of <tt>a</tt> and <tt>b</tt>
/// are multiplied.
/// \note An Intel XMM register is composed of 128-bits. The leftmost bit
/// is MSB and numbered 127, while the rightmost bit is LSB and
/// numbered 0.
/// \since Crypto++ 8.0
inline uint64x2_t PMULL_11(const uint64x2_t a, const uint64x2_t b)
{
#if defined(_MSC_VER)
const __n64 x = { vgetq_lane_u64(a, 1) };
const __n64 y = { vgetq_lane_u64(b, 1) };
return vmull_p64(x, y);
#elif defined(__GNUC__)
uint64x2_t r;
__asm__ ("pmull2 %0.1q, %1.2d, %2.2d \n\t"
:"=w" (r) : "w" (a), "w" (b) );
return r;
#else
return (uint64x2_t)(vmull_p64(
vgetq_lane_u64(vreinterpretq_u64_u8(a),1),
vgetq_lane_u64(vreinterpretq_u64_u8(b),1)));
#endif
}
/// \brief Polynomial multiplication
/// \param a the first value
/// \param b the second value
/// \return vector product
/// \details PMULL() performs vmull_p64(). PMULL is provided as
/// GCC inline assembly due to Clang and lack of support for the intrinsic.
/// \since Crypto++ 8.0
inline uint64x2_t PMULL(const uint64x2_t a, const uint64x2_t b)
{
#if defined(_MSC_VER)
const __n64 x = { vgetq_lane_u64(a, 0) };
const __n64 y = { vgetq_lane_u64(b, 0) };
return vmull_p64(x, y);
#elif defined(__GNUC__)
uint64x2_t r;
__asm__ ("pmull %0.1q, %1.1d, %2.1d \n\t"
:"=w" (r) : "w" (a), "w" (b) );
return r;
#else
return (uint64x2_t)(vmull_p64(
vgetq_lane_u64(vreinterpretq_u64_u8(a),0),
vgetq_lane_u64(vreinterpretq_u64_u8(b),0)));
#endif
}
/// \brief Polynomial multiplication
/// \param a the first value
/// \param b the second value
/// \return vector product
/// \details PMULL_HIGH() performs vmull_high_p64(). PMULL_HIGH is provided as
/// GCC inline assembly due to Clang and lack of support for the intrinsic.
/// \since Crypto++ 8.0
inline uint64x2_t PMULL_HIGH(const uint64x2_t a, const uint64x2_t b)
{
#if defined(_MSC_VER)
const __n64 x = { vgetq_lane_u64(a, 1) };
const __n64 y = { vgetq_lane_u64(b, 1) };
return vmull_p64(x, y);
#elif defined(__GNUC__)
uint64x2_t r;
__asm__ ("pmull2 %0.1q, %1.2d, %2.2d \n\t"
:"=w" (r) : "w" (a), "w" (b) );
return r;
#else
return (uint64x2_t)(vmull_p64(
vgetq_lane_u64(vreinterpretq_u64_u8(a),1),
vgetq_lane_u64(vreinterpretq_u64_u8(b),1))));
#endif
}
/// \brief Vector extraction
/// \tparam C the byte count
/// \param a the first value
/// \param b the second value
/// \return vector
/// \details VEXT_U8() extracts the first <tt>C</tt> bytes of vector
/// <tt>a</tt> and the remaining bytes in <tt>b</tt>. VEXT_U8 is provided
/// as GCC inline assembly due to Clang and lack of support for the intrinsic.
/// \since Crypto++ 8.0
template <unsigned int C>
inline uint64x2_t VEXT_U8(uint64x2_t a, uint64x2_t b)
{
// https://github.com/weidai11/cryptopp/issues/366
#if defined(_MSC_VER)
return vreinterpretq_u64_u8(vextq_u8(
vreinterpretq_u8_u64(a), vreinterpretq_u8_u64(b), C));
#else
uint64x2_t r;
__asm__ ("ext %0.16b, %1.16b, %2.16b, %3 \n\t"
:"=w" (r) : "w" (a), "w" (b), "I" (C) );
return r;
#endif
}
//@}
#endif // CRYPTOPP_ARM_PMULL_AVAILABLE
#if CRYPTOPP_ARM_SHA3_AVAILABLE || defined(CRYPTOPP_DOXYGEN_PROCESSING)
/// \name ARMv8.2 operations
//@{
/// \brief Three-way XOR
/// \param a the first value
/// \param b the second value
/// \param c the third value
/// \return three-way exclusive OR of the values
/// \details VEOR3() performs veor3q_u64(). VEOR3 is provided as GCC inline assembly due
/// to Clang and lack of support for the intrinsic.
/// \details VEOR3 requires ARMv8.2.
/// \since Crypto++ 8.6
inline uint64x2_t VEOR3(uint64x2_t a, uint64x2_t b, uint64x2_t c)
{
#if defined(_MSC_VER)
return veor3q_u64(a, b, c);
#else
uint64x2_t r;
__asm__ ("eor3 %0.16b, %1.16b, %2.16b, %3.16b \n\t"
:"=w" (r) : "w" (a), "w" (b), "w" (c));
return r;
#endif
}
/// \brief XOR and rotate
/// \param a the first value
/// \param b the second value
/// \param c the third value
/// \return two-way exclusive OR of the values, then rotated by c
/// \details VXARQ() performs vxarq_u64(). VXARQ is provided as GCC inline assembly due
/// to Clang and lack of support for the intrinsic.
/// \details VXARQ requires ARMv8.2.
/// \since Crypto++ 8.6
inline uint64x2_t VXAR(uint64x2_t a, uint64x2_t b, const int c)
{
#if defined(_MSC_VER)
return vxarq_u64(a, b, c);
#else
uint64x2_t r;
__asm__ ("xar %0.2d, %1.2d, %2.2d, %3 \n\t"
:"=w" (r) : "w" (a), "w" (b), "I" (c));
return r;
#endif
}
/// \brief XOR and rotate
/// \tparam C the rotate amount
/// \param a the first value
/// \param b the second value
/// \return two-way exclusive OR of the values, then rotated by C
/// \details VXARQ() performs vxarq_u64(). VXARQ is provided as GCC inline assembly due
/// to Clang and lack of support for the intrinsic.
/// \details VXARQ requires ARMv8.2.
/// \since Crypto++ 8.6
template <unsigned int C>
inline uint64x2_t VXAR(uint64x2_t a, uint64x2_t b)
{
#if defined(_MSC_VER)
return vxarq_u64(a, b, C);
#else
uint64x2_t r;
__asm__ ("xar %0.2d, %1.2d, %2.2d, %3 \n\t"
:"=w" (r) : "w" (a), "w" (b), "I" (C));
return r;
#endif
}
/// \brief XOR and rotate
/// \param a the first value
/// \param b the second value
/// \return two-way exclusive OR of the values, then rotated 1-bit
/// \details VRAX1() performs vrax1q_u64(). VRAX1 is provided as GCC inline assembly due
/// to Clang and lack of support for the intrinsic.
/// \details VRAX1 requires ARMv8.2.
/// \since Crypto++ 8.6
inline uint64x2_t VRAX1(uint64x2_t a, uint64x2_t b)
{
#if defined(_MSC_VER)
return vrax1q_u64(a, b);
#else
uint64x2_t r;
__asm__ ("rax1 %0.2d, %1.2d, %2.2d \n\t"
:"=w" (r) : "w" (a), "w" (b));
return r;
#endif
}
//@}
#endif // CRYPTOPP_ARM_SHA3_AVAILABLE
#endif // CRYPTOPP_ARM_SIMD_H

View File

@ -6,14 +6,17 @@
#ifndef CRYPTOPP_IMPORTS
#include "cryptlib.h"
#include "asn.h"
#include "misc.h"
#include <iostream>
#include <iomanip>
#include <sstream>
#include <time.h>
NAMESPACE_BEGIN(CryptoPP)
/// DER Length
size_t DERLengthEncode(BufferedTransformation &bt, lword length)
{
size_t i=0;
@ -111,7 +114,7 @@ size_t DEREncodeOctetString(BufferedTransformation &bt, const byte *str, size_t
size_t DEREncodeOctetString(BufferedTransformation &bt, const SecByteBlock &str)
{
return DEREncodeOctetString(bt, str.begin(), str.size());
return DEREncodeOctetString(bt, ConstBytePtr(str), BytePtrSize(str));
}
size_t BERDecodeOctetString(BufferedTransformation &bt, SecByteBlock &str)
@ -127,7 +130,7 @@ size_t BERDecodeOctetString(BufferedTransformation &bt, SecByteBlock &str)
BERDecodeError();
str.New(bc);
if (bc != bt.Get(str, bc))
if (bc != bt.Get(BytePtr(str), bc))
BERDecodeError();
return bc;
}
@ -148,12 +151,41 @@ size_t BERDecodeOctetString(BufferedTransformation &bt, BufferedTransformation &
return bc;
}
size_t DEREncodeTextString(BufferedTransformation &bt, const std::string &str, byte asnTag)
size_t DEREncodeTextString(BufferedTransformation &bt, const byte* str, size_t strLen, byte asnTag)
{
bt.Put(asnTag);
size_t lengthBytes = DERLengthEncode(bt, str.size());
bt.Put((const byte *)str.data(), str.size());
return 1+lengthBytes+str.size();
size_t lengthBytes = DERLengthEncode(bt, strLen);
bt.Put(str, strLen);
return 1+lengthBytes+strLen;
}
size_t DEREncodeTextString(BufferedTransformation &bt, const SecByteBlock &str, byte asnTag)
{
return DEREncodeTextString(bt, ConstBytePtr(str), BytePtrSize(str), asnTag);
}
size_t DEREncodeTextString(BufferedTransformation &bt, const std::string &str, byte asnTag)
{
return DEREncodeTextString(bt, ConstBytePtr(str), BytePtrSize(str), asnTag);
}
size_t BERDecodeTextString(BufferedTransformation &bt, SecByteBlock &str, byte asnTag)
{
byte b;
if (!bt.Get(b) || b != asnTag)
BERDecodeError();
size_t bc;
if (!BERLengthDecode(bt, bc))
BERDecodeError();
if (bc > bt.MaxRetrievable()) // Issue 346
BERDecodeError();
str.resize(bc);
if (bc != bt.Get(BytePtr(str), BytePtrSize(str)))
BERDecodeError();
return bc;
}
size_t BERDecodeTextString(BufferedTransformation &bt, std::string &str, byte asnTag)
@ -168,17 +200,40 @@ size_t BERDecodeTextString(BufferedTransformation &bt, std::string &str, byte as
if (bc > bt.MaxRetrievable()) // Issue 346
BERDecodeError();
SecByteBlock temp(bc);
if (bc != bt.Get(temp, bc))
str.resize(bc);
if (bc != bt.Get(BytePtr(str), BytePtrSize(str)))
BERDecodeError();
if (bc)
str.assign((char *)temp.begin(), bc);
else
str.clear();
return bc;
}
size_t DEREncodeDate(BufferedTransformation &bt, const SecByteBlock &str, byte asnTag)
{
bt.Put(asnTag);
size_t lengthBytes = DERLengthEncode(bt, str.size());
bt.Put(ConstBytePtr(str), BytePtrSize(str));
return 1+lengthBytes+str.size();
}
size_t BERDecodeDate(BufferedTransformation &bt, SecByteBlock &str, byte asnTag)
{
byte b;
if (!bt.Get(b) || b != asnTag)
BERDecodeError();
size_t bc;
if (!BERLengthDecode(bt, bc))
BERDecodeError();
if (bc > bt.MaxRetrievable()) // Issue 346
BERDecodeError();
str.resize(bc);
if (bc != bt.Get(BytePtr(str), BytePtrSize(str)))
BERDecodeError();
return bc;
}
/// ASN BitString
size_t DEREncodeBitString(BufferedTransformation &bt, const byte *str, size_t strLen, unsigned int unusedBits)
{
bt.Put(BIT_STRING);
@ -208,7 +263,7 @@ size_t BERDecodeBitString(BufferedTransformation &bt, SecByteBlock &str, unsigne
BERDecodeError();
unusedBits = unused;
str.resize(bc-1);
if ((bc-1) != bt.Get(str, bc-1))
if ((bc-1) != bt.Get(BytePtr(str), bc-1))
BERDecodeError();
return bc-1;
}
@ -230,6 +285,25 @@ void DERReencode(BufferedTransformation &source, BufferedTransformation &dest)
encoder.MessageEnd();
}
size_t BERDecodePeekLength(const BufferedTransformation &bt)
{
lword count = (std::min)(bt.MaxRetrievable(), static_cast<lword>(16));
if (count == 0) return 0;
ByteQueue tagAndLength;
bt.CopyTo(tagAndLength, count);
// Skip tag
tagAndLength.Skip(1);
// BERLengthDecode fails for indefinite length.
size_t length;
if (!BERLengthDecode(tagAndLength, length))
return 0;
return length;
}
void OID::EncodeValue(BufferedTransformation &bt, word32 v)
{
for (unsigned int i=RoundUpToMultipleOf(STDMAX(7U,BitPrecision(v)), 7U)-7; i != 0; i-=7)
@ -304,6 +378,18 @@ void OID::BERDecodeAndCheck(BufferedTransformation &bt) const
BERDecodeError();
}
std::ostream& OID::Print(std::ostream& out) const
{
std::ostringstream oss;
for (size_t i = 0; i < m_values.size(); ++i)
{
oss << m_values[i];
if (i+1 < m_values.size())
oss << ".";
}
return out << oss.str();
}
inline BufferedTransformation & EncodedObjectFilter::CurrentTarget()
{
if (m_flags & PUT_OBJECTS)
@ -368,7 +454,7 @@ void EncodedObjectFilter::Put(const byte *inString, size_t length)
// fall through
case TAIL:
case ALL_DONE:
default: ;;
default: ;
}
if (m_state == IDENTIFIER && m_level == 0)
@ -394,14 +480,20 @@ void EncodedObjectFilter::Put(const byte *inString, size_t length)
}
}
BERGeneralDecoder::BERGeneralDecoder(BufferedTransformation &inQueue)
: m_inQueue(inQueue), m_length(0), m_finished(false)
{
Init(DefaultTag);
}
BERGeneralDecoder::BERGeneralDecoder(BufferedTransformation &inQueue, byte asnTag)
: m_inQueue(inQueue), m_finished(false)
: m_inQueue(inQueue), m_length(0), m_finished(false)
{
Init(asnTag);
}
BERGeneralDecoder::BERGeneralDecoder(BERGeneralDecoder &inQueue, byte asnTag)
: m_inQueue(inQueue), m_finished(false)
: m_inQueue(inQueue), m_length(0), m_finished(false)
{
Init(asnTag);
}
@ -501,13 +593,18 @@ lword BERGeneralDecoder::ReduceLength(lword delta)
return delta;
}
DERGeneralEncoder::DERGeneralEncoder(BufferedTransformation &outQueue)
: m_outQueue(outQueue), m_asnTag(DefaultTag), m_finished(false)
{
}
DERGeneralEncoder::DERGeneralEncoder(BufferedTransformation &outQueue, byte asnTag)
: ByteQueue(), m_outQueue(outQueue), m_asnTag(asnTag), m_finished(false)
: m_outQueue(outQueue), m_asnTag(asnTag), m_finished(false)
{
}
DERGeneralEncoder::DERGeneralEncoder(DERGeneralEncoder &outQueue, byte asnTag)
: ByteQueue(), m_outQueue(outQueue), m_asnTag(asnTag), m_finished(false)
: m_outQueue(outQueue), m_asnTag(asnTag), m_finished(false)
{
}

View File

@ -13,6 +13,8 @@
#include "queue.h"
#include "misc.h"
#include <iosfwd>
// Issue 340
#if CRYPTOPP_GCC_DIAGNOSTIC_AVAILABLE
# pragma GCC diagnostic push
@ -23,45 +25,78 @@
NAMESPACE_BEGIN(CryptoPP)
/// \brief ASN.1 types
/// \note These tags and flags are not complete
/// \note These tags are not complete
enum ASNTag
{
/// \brief ASN.1 Boolean
BOOLEAN = 0x01,
/// \brief ASN.1 Integer
INTEGER = 0x02,
/// \brief ASN.1 Bit string
BIT_STRING = 0x03,
/// \brief ASN.1 Octet string
OCTET_STRING = 0x04,
/// \brief ASN.1 Null
TAG_NULL = 0x05,
/// \brief ASN.1 Object identifier
OBJECT_IDENTIFIER = 0x06,
/// \brief ASN.1 Object descriptor
OBJECT_DESCRIPTOR = 0x07,
/// \brief ASN.1 External reference
EXTERNAL = 0x08,
/// \brief ASN.1 Real integer
REAL = 0x09,
/// \brief ASN.1 Enumerated value
ENUMERATED = 0x0a,
/// \brief ASN.1 UTF-8 string
UTF8_STRING = 0x0c,
/// \brief ASN.1 Sequence
SEQUENCE = 0x10,
/// \brief ASN.1 Set
SET = 0x11,
/// \brief ASN.1 Numeric string
NUMERIC_STRING = 0x12,
/// \brief ASN.1 Printable string
PRINTABLE_STRING = 0x13,
/// \brief ASN.1 T61 string
T61_STRING = 0x14,
/// \brief ASN.1 Videotext string
VIDEOTEXT_STRING = 0x15,
/// \brief ASN.1 IA5 string
IA5_STRING = 0x16,
/// \brief ASN.1 UTC time
UTC_TIME = 0x17,
/// \brief ASN.1 Generalized time
GENERALIZED_TIME = 0x18,
/// \brief ASN.1 Graphic string
GRAPHIC_STRING = 0x19,
/// \brief ASN.1 Visible string
VISIBLE_STRING = 0x1a,
GENERAL_STRING = 0x1b
/// \brief ASN.1 General string
GENERAL_STRING = 0x1b,
/// \brief ASN.1 Universal string
UNIVERSAL_STRING = 0x1c,
/// \brief ASN.1 BMP string
BMP_STRING = 0x1e
};
/// \brief ASN.1 flags
/// \note These tags and flags are not complete
/// \note These flags are not complete
enum ASNIdFlag
{
/// \brief ASN.1 Universal class
UNIVERSAL = 0x00,
// DATA = 0x01,
// HEADER = 0x02,
// DATA = 0x01,
// HEADER = 0x02,
/// \brief ASN.1 Primitive flag
PRIMITIVE = 0x00,
/// \brief ASN.1 Constructed flag
CONSTRUCTED = 0x20,
/// \brief ASN.1 Application class
APPLICATION = 0x40,
/// \brief ASN.1 Context specific class
CONTEXT_SPECIFIC = 0x80,
/// \brief ASN.1 Private class
PRIVATE = 0xc0
};
@ -75,23 +110,21 @@ public:
/// \brief Construct an UnknownOID
UnknownOID() : BERDecodeErr("BER decode error: unknown object identifier") {}
/// \brief Construct an UnknownOID
/// \param err error message to use for the execption
/// \param err error message to use for the exception
UnknownOID(const char *err) : BERDecodeErr(err) {}
};
// unsigned int DERLengthEncode(unsigned int length, byte *output=0);
/// \brief DER encode a length
/// \param bt BufferedTransformation object for writing
/// \param length the size to encode
/// \returns the number of octets used for the encoding
/// \return the number of octets used for the encoding
CRYPTOPP_DLL size_t CRYPTOPP_API DERLengthEncode(BufferedTransformation &bt, lword length);
/// \brief BER decode a length
/// \param bt BufferedTransformation object for reading
/// \param length the decoded size
/// \returns true if the value was decoded
/// \throws BERDecodeError if the value fails to decode or is too large for size_t
/// \return true if the value was decoded
/// \throw BERDecodeError if the value fails to decode or is too large for size_t
/// \details BERLengthDecode() returns false if the encoding is indefinite length.
CRYPTOPP_DLL bool CRYPTOPP_API BERLengthDecode(BufferedTransformation &bt, size_t &length);
@ -107,54 +140,110 @@ CRYPTOPP_DLL void CRYPTOPP_API BERDecodeNull(BufferedTransformation &bt);
/// \param bt BufferedTransformation object for writing
/// \param str the string to encode
/// \param strLen the length of the string
/// \returns the number of octets used for the encoding
/// \return the number of octets used for the encoding
CRYPTOPP_DLL size_t CRYPTOPP_API DEREncodeOctetString(BufferedTransformation &bt, const byte *str, size_t strLen);
/// \brief DER encode octet string
/// \param bt BufferedTransformation object for reading
/// \param str the string to encode
/// \returns the number of octets used for the encoding
/// \return the number of octets used for the encoding
CRYPTOPP_DLL size_t CRYPTOPP_API DEREncodeOctetString(BufferedTransformation &bt, const SecByteBlock &str);
/// \brief BER decode octet string
/// \param bt BufferedTransformation object for reading
/// \param str the decoded string
/// \returns the number of octets used for the encoding
/// \return the number of octets used for the encoding
CRYPTOPP_DLL size_t CRYPTOPP_API BERDecodeOctetString(BufferedTransformation &bt, SecByteBlock &str);
/// \brief BER decode octet string
/// \param bt BufferedTransformation object for reading
/// \param str the decoded string
/// \returns the number of octets used for the encoding
/// \return the number of octets used for the encoding
CRYPTOPP_DLL size_t CRYPTOPP_API BERDecodeOctetString(BufferedTransformation &bt, BufferedTransformation &str);
/// \brief DER encode text string
/// \param bt BufferedTransformation object for writing
/// \param str the string to encode
/// \param asnTag the ASN.1 type
/// \returns the number of octets used for the encoding
/// \param strLen the length of the string, in bytes
/// \param asnTag the ASN.1 identifier
/// \return the number of octets used for the encoding
/// \details DEREncodeTextString() can be used for UTF8_STRING, PRINTABLE_STRING, and IA5_STRING
/// \since Crypto++ 8.3
CRYPTOPP_DLL size_t CRYPTOPP_API DEREncodeTextString(BufferedTransformation &bt, const byte* str, size_t strLen, byte asnTag);
/// \brief DER encode text string
/// \param bt BufferedTransformation object for writing
/// \param str the string to encode
/// \param asnTag the ASN.1 identifier
/// \return the number of octets used for the encoding
/// \details DEREncodeTextString() can be used for UTF8_STRING, PRINTABLE_STRING, and IA5_STRING
/// \since Crypto++ 8.3
CRYPTOPP_DLL size_t CRYPTOPP_API DEREncodeTextString(BufferedTransformation &bt, const SecByteBlock &str, byte asnTag);
/// \brief DER encode text string
/// \param bt BufferedTransformation object for writing
/// \param str the string to encode
/// \param asnTag the ASN.1 identifier
/// \return the number of octets used for the encoding
/// \details DEREncodeTextString() can be used for UTF8_STRING, PRINTABLE_STRING, and IA5_STRING
/// \since Crypto++ 6.0
CRYPTOPP_DLL size_t CRYPTOPP_API DEREncodeTextString(BufferedTransformation &bt, const std::string &str, byte asnTag);
/// \brief BER decode text string
/// \param bt BufferedTransformation object for reading
/// \param str the string to encode
/// \param asnTag the ASN.1 type
/// \details DEREncodeTextString() can be used for UTF8_STRING, PRINTABLE_STRING, and IA5_STRING
/// \param str the string to decode
/// \param asnTag the ASN.1 identifier
/// \details BERDecodeTextString() can be used for UTF8_STRING, PRINTABLE_STRING, and IA5_STRING
/// \since Crypto++ 8.3
CRYPTOPP_DLL size_t CRYPTOPP_API BERDecodeTextString(BufferedTransformation &bt, SecByteBlock &str, byte asnTag);
/// \brief BER decode text string
/// \param bt BufferedTransformation object for reading
/// \param str the string to decode
/// \param asnTag the ASN.1 identifier
/// \details BERDecodeTextString() can be used for UTF8_STRING, PRINTABLE_STRING, and IA5_STRING
/// \since Crypto++ 6.0
CRYPTOPP_DLL size_t CRYPTOPP_API BERDecodeTextString(BufferedTransformation &bt, std::string &str, byte asnTag);
/// \brief DER encode date
/// \param bt BufferedTransformation object for writing
/// \param str the date to encode
/// \param asnTag the ASN.1 identifier
/// \return the number of octets used for the encoding
/// \details BERDecodeDate() can be used for UTC_TIME and GENERALIZED_TIME
/// \since Crypto++ 8.3
CRYPTOPP_DLL size_t CRYPTOPP_API DEREncodeDate(BufferedTransformation &bt, const SecByteBlock &str, byte asnTag);
/// \brief BER decode date
/// \param bt BufferedTransformation object for reading
/// \param str the date to decode
/// \param asnTag the ASN.1 identifier
/// \details BERDecodeDate() can be used for UTC_TIME and GENERALIZED_TIME
/// \since Crypto++ 8.3
CRYPTOPP_DLL size_t CRYPTOPP_API BERDecodeDate(BufferedTransformation &bt, SecByteBlock &str, byte asnTag);
/// \brief DER encode bit string
/// \param bt BufferedTransformation object for writing
/// \param str the string to encode
/// \param strLen the length of the string
/// \param unusedBits the number of unused bits
/// \returns the number of octets used for the encoding
/// \return the number of octets used for the encoding
/// \details The caller is responsible for shifting octets if unusedBits is
/// not 0. For example, to DER encode a web server X.509 key usage, the 101b
/// bit mask is often used (digitalSignature and keyEncipherment). In this
/// case <tt>str</tt> is one octet with a value=0xa0 and unusedBits=5. The
/// value 0xa0 is <tt>101b << 5</tt>.
CRYPTOPP_DLL size_t CRYPTOPP_API DEREncodeBitString(BufferedTransformation &bt, const byte *str, size_t strLen, unsigned int unusedBits=0);
/// \brief DER decode bit string
/// \param bt BufferedTransformation object for reading
/// \param str the decoded string
/// \param unusedBits the number of unused bits
/// \details The caller is responsible for shifting octets if unusedBits is
/// not 0. For example, to DER encode a web server X.509 key usage, the 101b
/// bit mask is often used (digitalSignature and keyEncipherment). In this
/// case <tt>str</tt> is one octet with a value=0xa0 and unusedBits=5. The
/// value 0xa0 is <tt>101b << 5</tt>.
CRYPTOPP_DLL size_t CRYPTOPP_API BERDecodeBitString(BufferedTransformation &bt, SecByteBlock &str, unsigned int &unusedBits);
/// \brief BER decode and DER re-encode
@ -162,6 +251,15 @@ CRYPTOPP_DLL size_t CRYPTOPP_API BERDecodeBitString(BufferedTransformation &bt,
/// \param dest BufferedTransformation object
CRYPTOPP_DLL void CRYPTOPP_API DERReencode(BufferedTransformation &bt, BufferedTransformation &dest);
/// \brief BER decode size
/// \param bt BufferedTransformation object for reading
/// \return the length of the ASN.1 value, in bytes
/// \details BERDecodePeekLength() determines the length of a value without
/// consuming octets in the stream. The stream must use definite length encoding.
/// If indefinite length encoding is used or an error occurs, then 0 is returned.
/// \since Crypto++ 8.3
CRYPTOPP_DLL size_t CRYPTOPP_API BERDecodePeekLength(const BufferedTransformation &bt);
/// \brief Object Identifier
class CRYPTOPP_DLL OID
{
@ -170,16 +268,22 @@ public:
/// \brief Construct an OID
OID() {}
/// \brief Construct an OID
/// \param v value to initialize the OID
OID(word32 v) : m_values(1, v) {}
/// \brief Construct an OID
/// \param bt BufferedTransformation object
OID(BufferedTransformation &bt) {BERDecode(bt);}
OID(BufferedTransformation &bt) {
BERDecode(bt);
}
/// \brief Append a value to an OID
/// \param rhs the value to append
inline OID & operator+=(word32 rhs) {m_values.push_back(rhs); return *this;}
inline OID & operator+=(word32 rhs) {
m_values.push_back(rhs); return *this;
}
/// \brief DER encode this OID
/// \param bt BufferedTransformation object
@ -191,7 +295,7 @@ public:
/// \brief BER decode an OID
/// \param bt BufferedTransformation object
/// \throws BERDecodeErr() if decoded value doesn't match an expected OID
/// \throw BERDecodeErr() if decoded value doesn't match an expected OID
/// \details BERDecodeAndCheck() can be used to parse an OID and verify it matches an expected.
/// <pre>
/// BERSequenceDecoder key(bt);
@ -201,14 +305,35 @@ public:
/// </pre>
void BERDecodeAndCheck(BufferedTransformation &bt) const;
/// \brief Determine if OID is empty
/// \return true if OID has 0 elements, false otherwise
/// \since Crypto++ 8.0
bool Empty() const {
return m_values.empty();
}
/// \brief Retrieve OID value array
/// \return OID value vector
/// \since Crypto++ 8.0
const std::vector<word32>& GetValues() const {
return m_values;
}
/// \brief Print an OID
/// \param out ostream object
/// \return ostream reference
/// \details Print() writes the OID in a customary format, like
/// 1.2.840.113549.1.1.11. The caller is reposnsible to convert the
/// OID to a friendly name, like sha256WithRSAEncryption.
/// \since Crypto++ 8.3
std::ostream& Print(std::ostream& out) const;
protected:
friend bool operator==(const OID &lhs, const OID &rhs);
friend bool operator!=(const OID &lhs, const OID &rhs);
friend bool operator<(const OID &lhs, const OID &rhs);
friend bool operator<=(const OID &lhs, const OID &rhs);
friend bool operator>=(const OID &lhs, const OID &rhs);
std::vector<word32> m_values;
@ -254,21 +379,99 @@ private:
class CRYPTOPP_DLL BERGeneralDecoder : public Store
{
public:
/// \brief Default ASN.1 tag
enum {DefaultTag = SEQUENCE | EnumToInt(CONSTRUCTED)};
virtual ~BERGeneralDecoder();
/// \brief Construct an ASN.1 decoder
/// \param inQueue input byte queue
/// \details BERGeneralDecoder uses DefaultTag
explicit BERGeneralDecoder(BufferedTransformation &inQueue);
/// \brief Construct an ASN.1 decoder
/// \param inQueue input byte queue
/// \param asnTag ASN.1 tag
explicit BERGeneralDecoder(BufferedTransformation &inQueue, byte asnTag);
/// \brief Construct an ASN.1 decoder
/// \param inQueue input byte queue
/// \param asnTag ASN.1 tag
explicit BERGeneralDecoder(BERGeneralDecoder &inQueue, byte asnTag);
bool IsDefiniteLength() const {return m_definiteLength;}
lword RemainingLength() const {CRYPTOPP_ASSERT(m_definiteLength); return m_length;}
/// \brief Determine length encoding
/// \return true if the ASN.1 object is definite length encoded, false otherwise
bool IsDefiniteLength() const {
return m_definiteLength;
}
/// \brief Determine remaining length
/// \return number of octets that remain to be consumed
/// \details RemainingLength() is only valid if IsDefiniteLength()
/// returns true.
lword RemainingLength() const {
CRYPTOPP_ASSERT(m_definiteLength);
return IsDefiniteLength() ? m_length : 0;
}
/// \brief Determine end of stream
/// \return true if all octets have been consumed, false otherwise
bool EndReached() const;
/// \brief Determine next octet
/// \return next octet in the stream
/// \details PeekByte does not consume the octet.
/// \throw BERDecodeError if there are no octets remaining
byte PeekByte() const;
/// \brief Determine next octet
/// \details CheckByte reads the next byte in the stream and verifies
/// the octet matches b.
/// \throw BERDecodeError if the next octet is not b
void CheckByte(byte b);
/// \brief Transfer bytes to another BufferedTransformation
/// \param target the destination BufferedTransformation
/// \param transferBytes the number of bytes to transfer
/// \param channel the channel on which the transfer should occur
/// \param blocking specifies whether the object should block when
/// processing input
/// \return the number of bytes that remain in the transfer block
/// (i.e., bytes not transferred)
/// \details TransferTo2() removes bytes and moves
/// them to the destination. Transfer begins at the index position
/// in the current stream, and not from an absolute position in the
/// stream.
/// \details transferBytes is an \a IN and \a OUT parameter. When
/// the call is made, transferBytes is the requested size of the
/// transfer. When the call returns, transferBytes is the number
/// of bytes that were transferred.
size_t TransferTo2(BufferedTransformation &target, lword &transferBytes, const std::string &channel=DEFAULT_CHANNEL, bool blocking=true);
/// \brief Copy bytes to another BufferedTransformation
/// \param target the destination BufferedTransformation
/// \param begin the 0-based index of the first byte to copy in
/// the stream
/// \param end the 0-based index of the last byte to copy in
/// the stream
/// \param channel the channel on which the transfer should occur
/// \param blocking specifies whether the object should block when
/// processing input
/// \return the number of bytes that remain in the copy block
/// (i.e., bytes not copied)
/// \details CopyRangeTo2 copies bytes to the
/// destination. The bytes are not removed from this object. Copying
/// begins at the index position in the current stream, and not from
/// an absolute position in the stream.
/// \details begin is an \a IN and \a OUT parameter. When the call is
/// made, begin is the starting position of the copy. When the call
/// returns, begin is the position of the first byte that was \a not
/// copied (which may be different than end). begin can be used for
/// subsequent calls to CopyRangeTo2().
size_t CopyRangeTo2(BufferedTransformation &target, lword &begin, lword end=LWORD_MAX, const std::string &channel=DEFAULT_CHANNEL, bool blocking=true) const;
// call this to denote end of sequence
/// \brief Signals the end of messages to the object
/// \details Call this to denote end of sequence
void MessageEnd();
protected:
@ -287,12 +490,28 @@ private:
class CRYPTOPP_DLL DERGeneralEncoder : public ByteQueue
{
public:
/// \brief Default ASN.1 tag
enum {DefaultTag = SEQUENCE | EnumToInt(CONSTRUCTED)};
virtual ~DERGeneralEncoder();
explicit DERGeneralEncoder(BufferedTransformation &outQueue, byte asnTag = SEQUENCE | CONSTRUCTED);
explicit DERGeneralEncoder(DERGeneralEncoder &outQueue, byte asnTag = SEQUENCE | CONSTRUCTED);
/// \brief Construct an ASN.1 encoder
/// \param outQueue output byte queue
/// \details DERGeneralEncoder uses DefaultTag
explicit DERGeneralEncoder(BufferedTransformation &outQueue);
// call this to denote end of sequence
/// \brief Construct an ASN.1 encoder
/// \param outQueue output byte queue
/// \param asnTag ASN.1 tag
explicit DERGeneralEncoder(BufferedTransformation &outQueue, byte asnTag);
/// \brief Construct an ASN.1 encoder
/// \param outQueue output byte queue
/// \param asnTag ASN.1 tag
explicit DERGeneralEncoder(DERGeneralEncoder &outQueue, byte asnTag);
/// \brief Signals the end of messages to the object
/// \details Call this to denote end of sequence
void MessageEnd();
private:
@ -305,9 +524,31 @@ private:
class CRYPTOPP_DLL BERSequenceDecoder : public BERGeneralDecoder
{
public:
explicit BERSequenceDecoder(BufferedTransformation &inQueue, byte asnTag = SEQUENCE | CONSTRUCTED)
/// \brief Default ASN.1 tag
enum {DefaultTag = SEQUENCE | EnumToInt(CONSTRUCTED)};
/// \brief Construct an ASN.1 decoder
/// \param inQueue input byte queue
/// \details BERSequenceDecoder uses DefaultTag
explicit BERSequenceDecoder(BufferedTransformation &inQueue)
: BERGeneralDecoder(inQueue, DefaultTag) {}
/// \brief Construct an ASN.1 decoder
/// \param inQueue input byte queue
/// \param asnTag ASN.1 tag
explicit BERSequenceDecoder(BufferedTransformation &inQueue, byte asnTag)
: BERGeneralDecoder(inQueue, asnTag) {}
explicit BERSequenceDecoder(BERSequenceDecoder &inQueue, byte asnTag = SEQUENCE | CONSTRUCTED)
/// \brief Construct an ASN.1 decoder
/// \param inQueue input byte queue
/// \details BERSequenceDecoder uses DefaultTag
explicit BERSequenceDecoder(BERSequenceDecoder &inQueue)
: BERGeneralDecoder(inQueue, DefaultTag) {}
/// \brief Construct an ASN.1 decoder
/// \param inQueue input byte queue
/// \param asnTag ASN.1 tag
explicit BERSequenceDecoder(BERSequenceDecoder &inQueue, byte asnTag)
: BERGeneralDecoder(inQueue, asnTag) {}
};
@ -315,9 +556,31 @@ public:
class CRYPTOPP_DLL DERSequenceEncoder : public DERGeneralEncoder
{
public:
explicit DERSequenceEncoder(BufferedTransformation &outQueue, byte asnTag = SEQUENCE | CONSTRUCTED)
/// \brief Default ASN.1 tag
enum {DefaultTag = SEQUENCE | EnumToInt(CONSTRUCTED)};
/// \brief Construct an ASN.1 encoder
/// \param outQueue output byte queue
/// \details DERSequenceEncoder uses DefaultTag
explicit DERSequenceEncoder(BufferedTransformation &outQueue)
: DERGeneralEncoder(outQueue, DefaultTag) {}
/// \brief Construct an ASN.1 encoder
/// \param outQueue output byte queue
/// \param asnTag ASN.1 tag
explicit DERSequenceEncoder(BufferedTransformation &outQueue, byte asnTag)
: DERGeneralEncoder(outQueue, asnTag) {}
explicit DERSequenceEncoder(DERSequenceEncoder &outQueue, byte asnTag = SEQUENCE | CONSTRUCTED)
/// \brief Construct an ASN.1 encoder
/// \param outQueue output byte queue
/// \details DERSequenceEncoder uses DefaultTag
explicit DERSequenceEncoder(DERSequenceEncoder &outQueue)
: DERGeneralEncoder(outQueue, DefaultTag) {}
/// \brief Construct an ASN.1 encoder
/// \param outQueue output byte queue
/// \param asnTag ASN.1 tag
explicit DERSequenceEncoder(DERSequenceEncoder &outQueue, byte asnTag)
: DERGeneralEncoder(outQueue, asnTag) {}
};
@ -325,9 +588,31 @@ public:
class CRYPTOPP_DLL BERSetDecoder : public BERGeneralDecoder
{
public:
explicit BERSetDecoder(BufferedTransformation &inQueue, byte asnTag = SET | CONSTRUCTED)
/// \brief Default ASN.1 tag
enum {DefaultTag = SET | EnumToInt(CONSTRUCTED)};
/// \brief Construct an ASN.1 decoder
/// \param inQueue input byte queue
/// \details BERSetDecoder uses DefaultTag
explicit BERSetDecoder(BufferedTransformation &inQueue)
: BERGeneralDecoder(inQueue, DefaultTag) {}
/// \brief Construct an ASN.1 decoder
/// \param inQueue input byte queue
/// \param asnTag ASN.1 tag
explicit BERSetDecoder(BufferedTransformation &inQueue, byte asnTag)
: BERGeneralDecoder(inQueue, asnTag) {}
explicit BERSetDecoder(BERSetDecoder &inQueue, byte asnTag = SET | CONSTRUCTED)
/// \brief Construct an ASN.1 decoder
/// \param inQueue input byte queue
/// \details BERSetDecoder uses DefaultTag
explicit BERSetDecoder(BERSetDecoder &inQueue)
: BERGeneralDecoder(inQueue, DefaultTag) {}
/// \brief Construct an ASN.1 decoder
/// \param inQueue input byte queue
/// \param asnTag ASN.1 tag
explicit BERSetDecoder(BERSetDecoder &inQueue, byte asnTag)
: BERGeneralDecoder(inQueue, asnTag) {}
};
@ -335,9 +620,31 @@ public:
class CRYPTOPP_DLL DERSetEncoder : public DERGeneralEncoder
{
public:
explicit DERSetEncoder(BufferedTransformation &outQueue, byte asnTag = SET | CONSTRUCTED)
/// \brief Default ASN.1 tag
enum {DefaultTag = SET | EnumToInt(CONSTRUCTED)};
/// \brief Construct an ASN.1 encoder
/// \param outQueue output byte queue
/// \details DERSetEncoder uses DefaultTag
explicit DERSetEncoder(BufferedTransformation &outQueue)
: DERGeneralEncoder(outQueue, DefaultTag) {}
/// \brief Construct an ASN.1 encoder
/// \param outQueue output byte queue
/// \param asnTag ASN.1 tag
explicit DERSetEncoder(BufferedTransformation &outQueue, byte asnTag)
: DERGeneralEncoder(outQueue, asnTag) {}
explicit DERSetEncoder(DERSetEncoder &outQueue, byte asnTag = SET | CONSTRUCTED)
/// \brief Construct an ASN.1 encoder
/// \param outQueue output byte queue
/// \details DERSetEncoder uses DefaultTag
explicit DERSetEncoder(DERSetEncoder &outQueue)
: DERGeneralEncoder(outQueue, DefaultTag) {}
/// \brief Construct an ASN.1 encoder
/// \param outQueue output byte queue
/// \param asnTag ASN.1 tag
explicit DERSetEncoder(DERSetEncoder &outQueue, byte asnTag)
: DERGeneralEncoder(outQueue, asnTag) {}
};
@ -380,7 +687,7 @@ public:
/// \param bt BufferedTransformation object
/// \details Save() will write the OID associated with algorithm or scheme.
/// In the case of public and private keys, this function writes the
/// subjectPubicKeyInfo and privateKeyInfo parts.
/// subjectPublicKeyInfo and privateKeyInfo parts.
void Save(BufferedTransformation &bt) const
{BEREncode(bt);}
@ -400,20 +707,43 @@ public:
void DEREncode(BufferedTransformation &bt) const;
/// \brief Retrieves the OID of the algorithm
/// \returns OID of the algorithm
/// \return OID of the algorithm
virtual OID GetAlgorithmID() const =0;
/// \brief Decode algorithm parameters
/// \param bt BufferedTransformation object
/// \sa BERDecodePublicKey, <A HREF="http://www.ietf.org/rfc/rfc2459.txt">RFC
/// 2459, section 7.3.1</A>
virtual bool BERDecodeAlgorithmParameters(BufferedTransformation &bt)
{BERDecodeNull(bt); return false;}
virtual bool DEREncodeAlgorithmParameters(BufferedTransformation &bt) const
{DEREncodeNull(bt); return false;} // see RFC 2459, section 7.3.1
/// decode subjectPublicKey part of subjectPublicKeyInfo, without the BIT STRING header
/// \brief Encode algorithm parameters
/// \param bt BufferedTransformation object
/// \sa DEREncodePublicKey, <A HREF="http://www.ietf.org/rfc/rfc2459.txt">RFC
/// 2459, section 7.3.1</A>
virtual bool DEREncodeAlgorithmParameters(BufferedTransformation &bt) const
{DEREncodeNull(bt); return false;}
/// \brief Decode subjectPublicKey part of subjectPublicKeyInfo
/// \param bt BufferedTransformation object
/// \param parametersPresent flag indicating if algorithm parameters are present
/// \param size number of octets to read for the parameters, in bytes
/// \details BERDecodePublicKey() the decodes subjectPublicKey part of
/// subjectPublicKeyInfo, without the BIT STRING header.
/// \details When <tt>parametersPresent = true</tt> then BERDecodePublicKey() calls
/// BERDecodeAlgorithmParameters() to parse algorithm parameters.
/// \sa BERDecodeAlgorithmParameters
virtual void BERDecodePublicKey(BufferedTransformation &bt, bool parametersPresent, size_t size) =0;
/// encode subjectPublicKey part of subjectPublicKeyInfo, without the BIT STRING header
/// \brief Encode subjectPublicKey part of subjectPublicKeyInfo
/// \param bt BufferedTransformation object
/// \details DEREncodePublicKey() encodes the subjectPublicKey part of
/// subjectPublicKeyInfo, without the BIT STRING header.
/// \sa DEREncodeAlgorithmParameters
virtual void DEREncodePublicKey(BufferedTransformation &bt) const =0;
};
/// \brief Encodes and decodesprivateKeyInfo
/// \brief Encodes and Decodes privateKeyInfo
class CRYPTOPP_DLL PKCS8PrivateKey : public ASN1CryptoMaterial<PrivateKey>
{
public:
@ -423,22 +753,55 @@ public:
void DEREncode(BufferedTransformation &bt) const;
/// \brief Retrieves the OID of the algorithm
/// \returns OID of the algorithm
/// \return OID of the algorithm
virtual OID GetAlgorithmID() const =0;
/// \brief Decode optional parameters
/// \param bt BufferedTransformation object
/// \sa BERDecodePrivateKey, <A HREF="http://www.ietf.org/rfc/rfc2459.txt">RFC
/// 2459, section 7.3.1</A>
virtual bool BERDecodeAlgorithmParameters(BufferedTransformation &bt)
{BERDecodeNull(bt); return false;}
virtual bool DEREncodeAlgorithmParameters(BufferedTransformation &bt) const
{DEREncodeNull(bt); return false;} // see RFC 2459, section 7.3.1
/// decode privateKey part of privateKeyInfo, without the OCTET STRING header
/// \brief Encode optional parameters
/// \param bt BufferedTransformation object
/// \sa DEREncodePrivateKey, <A HREF="http://www.ietf.org/rfc/rfc2459.txt">RFC
/// 2459, section 7.3.1</A>
virtual bool DEREncodeAlgorithmParameters(BufferedTransformation &bt) const
{DEREncodeNull(bt); return false;}
/// \brief Decode privateKey part of privateKeyInfo
/// \param bt BufferedTransformation object
/// \param parametersPresent flag indicating if algorithm parameters are present
/// \param size number of octets to read for the parameters, in bytes
/// \details BERDecodePrivateKey() the decodes privateKey part of privateKeyInfo,
/// without the OCTET STRING header.
/// \details When <tt>parametersPresent = true</tt> then BERDecodePrivateKey() calls
/// BERDecodeAlgorithmParameters() to parse algorithm parameters.
/// \sa BERDecodeAlgorithmParameters
virtual void BERDecodePrivateKey(BufferedTransformation &bt, bool parametersPresent, size_t size) =0;
/// encode privateKey part of privateKeyInfo, without the OCTET STRING header
/// \brief Encode privateKey part of privateKeyInfo
/// \param bt BufferedTransformation object
/// \details DEREncodePrivateKey() encodes the privateKey part of privateKeyInfo,
/// without the OCTET STRING header.
/// \sa DEREncodeAlgorithmParameters
virtual void DEREncodePrivateKey(BufferedTransformation &bt) const =0;
/// decode optional attributes including context-specific tag
/*! /note default implementation stores attributes to be output in DEREncodeOptionalAttributes */
/// \brief Decode optional attributes
/// \param bt BufferedTransformation object
/// \details BERDecodeOptionalAttributes() decodes optional attributes including
/// context-specific tag.
/// \sa BERDecodeAlgorithmParameters, DEREncodeOptionalAttributes
/// \note default implementation stores attributes to be output using
/// DEREncodeOptionalAttributes
virtual void BERDecodeOptionalAttributes(BufferedTransformation &bt);
/// encode optional attributes including context-specific tag
/// \brief Encode optional attributes
/// \param bt BufferedTransformation object
/// \details DEREncodeOptionalAttributes() encodes optional attributes including
/// context-specific tag.
/// \sa BERDecodeAlgorithmParameters
virtual void DEREncodeOptionalAttributes(BufferedTransformation &bt) const;
protected:
@ -451,7 +814,7 @@ protected:
/// \tparam T class or type
/// \param out BufferedTransformation object
/// \param w unsigned value to encode
/// \param asnTag the ASN.1 type
/// \param asnTag the ASN.1 identifier
/// \details DEREncodeUnsigned() can be used with INTEGER, BOOLEAN, and ENUM
template <class T>
size_t DEREncodeUnsigned(BufferedTransformation &out, T w, byte asnTag = INTEGER)
@ -484,10 +847,10 @@ size_t DEREncodeUnsigned(BufferedTransformation &out, T w, byte asnTag = INTEGER
/// \tparam T fundamental C++ type
/// \param in BufferedTransformation object
/// \param w the decoded value
/// \param asnTag the ASN.1 type
/// \param asnTag the ASN.1 identifier
/// \param minValue the minimum expected value
/// \param maxValue the maximum expected value
/// \throws BERDecodeErr() if the value cannot be parsed or the decoded value is not within range.
/// \throw BERDecodeErr() if the value cannot be parsed or the decoded value is not within range.
/// \details DEREncodeUnsigned() can be used with INTEGER, BOOLEAN, and ENUM
template <class T>
void BERDecodeUnsigned(BufferedTransformation &in, T &w, byte asnTag = INTEGER,
@ -539,23 +902,42 @@ void BERDecodeUnsigned(BufferedTransformation &in, T &w, byte asnTag = INTEGER,
/// \brief Compare two OIDs for equality
/// \param lhs the first OID
/// \param rhs the second OID
/// \returns true if the OIDs are equal, false otherwise
/// \return true if the OIDs are equal, false otherwise
inline bool operator==(const OID &lhs, const OID &rhs);
/// \brief Compare two OIDs for inequality
/// \param lhs the first OID
/// \param rhs the second OID
/// \returns true if the OIDs are not equal, false otherwise
/// \return true if the OIDs are not equal, false otherwise
inline bool operator!=(const OID &lhs, const OID &rhs);
/// \brief Compare two OIDs for ordering
/// \param lhs the first OID
/// \param rhs the second OID
/// \returns true if the first OID is less than the second OID, false otherwise
/// \return true if the first OID is less than the second OID, false otherwise
/// \details operator<() calls std::lexicographical_compare() on each element in the array of values.
inline bool operator<(const OID &lhs, const OID &rhs);
/// \brief Compare two OIDs for ordering
/// \param lhs the first OID
/// \param rhs the second OID
/// \return true if the first OID is less than or equal to the second OID, false otherwise
/// \details operator<=() is implemented in terms of operator==() and operator<().
/// \since Crypto++ 8.3
inline bool operator<=(const OID &lhs, const OID &rhs);
/// \brief Compare two OIDs for ordering
/// \param lhs the first OID
/// \param rhs the second OID
/// \return true if the first OID is greater than or equal to the second OID, false otherwise
/// \details operator>=() is implemented in terms of operator<().
/// \since Crypto++ 8.3
inline bool operator>=(const OID &lhs, const OID &rhs);
/// \brief Append a value to an OID
/// \param lhs the OID
/// \param rhs the value to append
inline OID operator+(const OID &lhs, unsigned long rhs);
/// \brief Print a OID value
/// \param out the output stream
/// \param oid the OID
inline std::ostream& operator<<(std::ostream& out, const OID &oid)
{ return oid.Print(out); }
#else
inline bool operator==(const ::CryptoPP::OID &lhs, const ::CryptoPP::OID &rhs)
{return lhs.m_values == rhs.m_values;}
@ -563,8 +945,14 @@ inline bool operator!=(const ::CryptoPP::OID &lhs, const ::CryptoPP::OID &rhs)
{return lhs.m_values != rhs.m_values;}
inline bool operator<(const ::CryptoPP::OID &lhs, const ::CryptoPP::OID &rhs)
{return std::lexicographical_compare(lhs.m_values.begin(), lhs.m_values.end(), rhs.m_values.begin(), rhs.m_values.end());}
inline bool operator<=(const ::CryptoPP::OID &lhs, const ::CryptoPP::OID &rhs)
{return lhs<rhs || lhs==rhs;}
inline bool operator>=(const ::CryptoPP::OID &lhs, const ::CryptoPP::OID &rhs)
{return ! (lhs<rhs);}
inline ::CryptoPP::OID operator+(const ::CryptoPP::OID &lhs, unsigned long rhs)
{return ::CryptoPP::OID(lhs)+=rhs;}
inline std::ostream& operator<<(std::ostream& out, const OID &oid)
{ return oid.Print(out); }
#endif
NAMESPACE_END

View File

@ -10,11 +10,15 @@ NAMESPACE_BEGIN(CryptoPP)
void AuthenticatedSymmetricCipherBase::AuthenticateData(const byte *input, size_t len)
{
// UBsan finding with -std=c++03 using memcpy
CRYPTOPP_ASSERT(input && len);
if(!input || !len) return;
unsigned int blockSize = AuthenticationBlockSize();
unsigned int &num = m_bufferedDataLength;
byte* data = m_buffer.begin();
if (num != 0) // process left over data
if (data && num) // process left over data
{
if (num+len >= blockSize)
{
@ -41,7 +45,8 @@ void AuthenticatedSymmetricCipherBase::AuthenticateData(const byte *input, size_
len = leftOver;
}
memcpy(data, input, len);
if (data && len)
memcpy(data, input, len);
num = (unsigned int)len;
}
@ -74,6 +79,7 @@ void AuthenticatedSymmetricCipherBase::Resynchronize(const byte *iv, int length)
void AuthenticatedSymmetricCipherBase::Update(const byte *input, size_t length)
{
// Part of original authenc.cpp code. Don't remove it.
if (length == 0) {return;}
switch (m_state)
@ -102,9 +108,9 @@ void AuthenticatedSymmetricCipherBase::Update(const byte *input, size_t length)
void AuthenticatedSymmetricCipherBase::ProcessData(byte *outString, const byte *inString, size_t length)
{
m_totalMessageLength += length;
if (m_state >= State_IVSet && m_totalMessageLength > MaxMessageLength())
if (m_state >= State_IVSet && length > MaxMessageLength()-m_totalMessageLength)
throw InvalidArgument(AlgorithmName() + ": message length exceeds maximum");
m_totalMessageLength += length;
reswitch:
switch (m_state)
@ -134,6 +140,9 @@ reswitch:
void AuthenticatedSymmetricCipherBase::TruncatedFinal(byte *mac, size_t macSize)
{
// https://github.com/weidai11/cryptopp/issues/954
this->ThrowIfInvalidTruncatedSize(macSize);
if (m_totalHeaderLength > MaxHeaderLength())
throw InvalidArgument(AlgorithmName() + ": header length of " + IntToString(m_totalHeaderLength) + " exceeds the maximum of " + IntToString(MaxHeaderLength()));

View File

@ -60,7 +60,7 @@ protected:
void AuthenticateData(const byte *data, size_t len);
const SymmetricCipher & GetSymmetricCipher() const
{return const_cast<AuthenticatedSymmetricCipherBase *>(this)->AccessSymmetricCipher();};
{return const_cast<AuthenticatedSymmetricCipherBase *>(this)->AccessSymmetricCipher();}
virtual SymmetricCipher & AccessSymmetricCipher() =0;
virtual bool AuthenticationIsOnPlaintext() const =0;

View File

@ -182,7 +182,7 @@ void BaseN_Decoder::InitializeDecodingLookupArray(int *lookup, const byte *alpha
for (unsigned int i=0; i<base; i++)
{
// Debug asserts for 'lookup[alphabet[i]] == -1' removed because the self tests
// have unusal tests that try to break the encoders and decoders. Tests include
// have unusual tests that try to break the encoders and decoders. Tests include
// a string of the same characters. I.,e., a string of stars like '********...'.
if (caseInsensitive && isalpha(alphabet[i]))
{

View File

@ -30,16 +30,18 @@ public:
/// \param attachment a BufferedTransformation to attach to this object
/// \param padding the character to use as padding
/// \pre log2base must be between 1 and 7 inclusive
/// \throws InvalidArgument if log2base is not between 1 and 7
/// \throw InvalidArgument if log2base is not between 1 and 7
BaseN_Encoder(const byte *alphabet, int log2base, BufferedTransformation *attachment=NULLPTR, int padding=-1)
: m_alphabet(NULLPTR), m_padding(0), m_bitsPerChar(0)
, m_outputBlockSize(0), m_bytePos(0), m_bitPos(0)
{
Detach(attachment);
IsolatedInitialize(MakeParameters(Name::EncodingLookupArray(), alphabet)
(Name::Log2Base(), log2base)
(Name::Pad(), padding != -1)
(Name::PaddingByte(), byte(padding)));
BaseN_Encoder::IsolatedInitialize(
MakeParameters
(Name::EncodingLookupArray(), alphabet)
(Name::Log2Base(), log2base)
(Name::Pad(), padding != -1)
(Name::PaddingByte(), byte(padding)));
}
void IsolatedInitialize(const NameValuePairs &parameters);
@ -61,7 +63,7 @@ public:
/// \details padding is set to -1, which means use default padding. If not
/// required, then the value must be set via IsolatedInitialize().
BaseN_Decoder(BufferedTransformation *attachment=NULLPTR)
: m_lookup(NULLPTR), m_padding(0), m_bitsPerChar(0)
: m_lookup(NULLPTR), m_bitsPerChar(0)
, m_outputBlockSize(0), m_bytePos(0), m_bitPos(0)
{Detach(attachment);}
@ -74,11 +76,14 @@ public:
/// \details padding is set to -1, which means use default padding. If not
/// required, then the value must be set via IsolatedInitialize().
BaseN_Decoder(const int *lookup, int log2base, BufferedTransformation *attachment=NULLPTR)
: m_lookup(NULLPTR), m_padding(0), m_bitsPerChar(0)
: m_lookup(NULLPTR), m_bitsPerChar(0)
, m_outputBlockSize(0), m_bytePos(0), m_bitPos(0)
{
Detach(attachment);
IsolatedInitialize(MakeParameters(Name::DecodingLookupArray(), lookup)(Name::Log2Base(), log2base));
BaseN_Decoder::IsolatedInitialize(
MakeParameters
(Name::DecodingLookupArray(), lookup)
(Name::Log2Base(), log2base));
}
void IsolatedInitialize(const NameValuePairs &parameters);
@ -98,7 +103,7 @@ public:
private:
const int *m_lookup;
int m_padding, m_bitsPerChar, m_outputBlockSize;
int m_bitsPerChar, m_outputBlockSize;
int m_bytePos, m_bitPos;
SecByteBlock m_outBuf;
};
@ -121,9 +126,11 @@ public:
: m_groupSize(0), m_counter(0)
{
Detach(attachment);
IsolatedInitialize(MakeParameters(Name::GroupSize(), groupSize)
(Name::Separator(), ConstByteArrayParameter(separator))
(Name::Terminator(), ConstByteArrayParameter(terminator)));
Grouper::IsolatedInitialize(
MakeParameters
(Name::GroupSize(), groupSize)
(Name::Separator(), ConstByteArrayParameter(separator))
(Name::Terminator(), ConstByteArrayParameter(terminator)));
}
void IsolatedInitialize(const NameValuePairs &parameters);

View File

@ -16,14 +16,48 @@ NAMESPACE_BEGIN(Test)
// More granular control over benchmarks
enum TestClass {
UnkeyedRNG=(1<<0),UnkeyedHash=(1<<1),UnkeyedOther=(1<<2),
SharedKeyMAC=(1<<3),SharedKeyStream=(1<<4),SharedKeyBlock=(1<<5),SharedKeyOther=(1<<6),
PublicKeyAgreement=(1<<7),PublicKeyEncryption=(1<<8),PublicKeySignature=(1<<9),PublicKeyOther=(1<<10),
/// \brief Random number generators
UnkeyedRNG=(1<<0),
/// \brief Message digests
UnkeyedHash=(1<<1),
/// \brief Other unkeyed algorithms
UnkeyedOther=(1<<2),
/// \brief Message authentication codes
SharedKeyMAC=(1<<3),
/// \brief Stream ciphers
SharedKeyStream=(1<<4),
/// \brief Block ciphers ciphers
SharedKeyBlock=(1<<5),
/// \brief Other shared key algorithms
SharedKeyOther=(1<<6),
/// \brief Key agreement algorithms over integers
PublicKeyAgreement=(1<<7),
/// \brief Encryption algorithms over integers
PublicKeyEncryption=(1<<8),
/// \brief Signature algorithms over integers
PublicKeySignature=(1<<9),
/// \brief Other public key algorithms over integers
PublicKeyOther=(1<<10),
/// \brief Key agreement algorithms over EC
PublicKeyAgreementEC=(1<<11),
/// \brief Encryption algorithms over EC
PublicKeyEncryptionEC=(1<<12),
/// \brief Signature algorithms over EC
PublicKeySignatureEC=(1<<13),
/// \brief Other public key algorithms over EC
PublicKeyOtherEC=(1<<14),
Unkeyed=UnkeyedRNG|UnkeyedHash|UnkeyedOther,
SharedKey=SharedKeyMAC|SharedKeyStream|SharedKeyBlock|SharedKeyOther,
PublicKey=PublicKeyAgreement|PublicKeyEncryption|PublicKeySignature|PublicKeyOther,
All=Unkeyed|SharedKey|PublicKey,
TestFirst=(0), TestLast=(1<<11)
PublicKeyEC=PublicKeyAgreementEC|PublicKeyEncryptionEC|PublicKeySignatureEC|PublicKeyOtherEC,
All=Unkeyed|SharedKey|PublicKey|PublicKeyEC,
TestFirst=(0), TestLast=(1<<15)
};
extern const double CLOCK_TICKS_PER_SECOND;
@ -37,19 +71,33 @@ extern const byte defaultKey[];
extern time_t g_testBegin;
extern time_t g_testEnd;
// Command handler
// Benchmark command handler
void BenchmarkWithCommand(int argc, const char* const argv[]);
// Top level, prints preamble and postamble
void Benchmark(Test::TestClass suites, double t, double hertz);
// Unkeyed systems
void Benchmark1(double t, double hertz);
void BenchmarkUnkeyedAlgorithms(double t, double hertz);
// Shared key systems
void Benchmark2(double t, double hertz);
// Public key systems
void Benchmark3(double t, double hertz);
void BenchmarkSharedKeyedAlgorithms(double t, double hertz);
// Public key systems over integers
void BenchmarkPublicKeyAlgorithms(double t, double hertz);
// Public key systems over elliptic curves
void BenchmarkEllipticCurveAlgorithms(double t, double hertz);
void OutputResultBytes(const char *name, double length, double timeTaken);
void OutputResultOperations(const char *name, const char *operation, bool pc, unsigned long iterations, double timeTaken);
// These are defined in bench1.cpp
extern void OutputResultKeying(double iterations, double timeTaken);
extern void OutputResultBytes(const char *name, const char *provider, double length, double timeTaken);
extern void OutputResultOperations(const char *name, const char *provider, const char *operation, bool pc, unsigned long iterations, double timeTaken);
// These are defined in bench1.cpp
extern void BenchMark(const char *name, BufferedTransformation &bt, double timeTotal);
extern void BenchMark(const char *name, StreamTransformation &cipher, double timeTotal);
extern void BenchMark(const char *name, HashTransformation &ht, double timeTotal);
extern void BenchMark(const char *name, RandomNumberGenerator &rng, double timeTotal);
// These are defined in bench2.cpp
extern void BenchMarkKeying(SimpleKeyingInterface &c, size_t keyLength, const NameValuePairs &params);
extern void BenchMark(const char *name, AuthenticatedSymmetricCipher &cipher, double timeTotal);
NAMESPACE_END // Test
NAMESPACE_END // CryptoPP

View File

@ -5,21 +5,23 @@
#include "bench.h"
#include "validate.h"
#include "aes.h"
#include "kalyna.h"
#include "threefish.h"
#include "blumshub.h"
#include "files.h"
#include "filters.h"
#include "hex.h"
#include "modes.h"
#include "factory.h"
#include "smartptr.h"
#include "cpu.h"
#include "factory.h"
#include "algparam.h"
#include "argnames.h"
#include "smartptr.h"
#include "stdcpp.h"
#include "osrng.h"
#include "drbg.h"
#include "darn.h"
#include "mersenne.h"
#include "rdrand.h"
#include "padlkrng.h"
#include "stdcpp.h"
#include <iostream>
#include <iomanip>
#include <sstream>
#if CRYPTOPP_MSC_VERSION
# pragma warning(disable: 4355)
@ -40,7 +42,7 @@ const double CLOCK_TICKS_PER_SECOND = (double)CLK_TCK;
const double CLOCK_TICKS_PER_SECOND = 1000000.0;
#endif
const byte defaultKey[] = "0123456789" // 168 + NULL
extern const byte defaultKey[] = "0123456789" // 168 + NULL
"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
"00000000000000000000000000000000000000000000000000000"
"00000000000000000000000000000000000000000000000000000";
@ -49,68 +51,90 @@ double g_allocatedTime = 0.0, g_hertz = 0.0, g_logTotal = 0.0;
unsigned int g_logCount = 0;
time_t g_testBegin, g_testEnd;
void OutputResultBytes(const char *name, double length, double timeTaken)
inline std::string HertzToString(double hertz)
{
// Coverity finding, also see http://stackoverflow.com/a/34509163/608639.
StreamState ss(std::cout);
std::ostringstream oss;
oss.precision(3);
if (hertz >= 0.999e+9)
oss << hertz / 1e+9 << " GHz";
else if (hertz >= 0.999e+6)
oss << hertz / 1e+6 << " MHz";
else if (hertz >= 0.999e+3)
oss << hertz / 1e+3 << " KHz";
else
oss << hertz << " Hz";
return oss.str();
}
void OutputResultBytes(const char *name, const char *provider, double length, double timeTaken)
{
std::ostringstream oss;
// Coverity finding
if (length < 0.000001f) length = 0.000001f;
if (timeTaken < 0.000001f) timeTaken = 0.000001f;
double mbs = length / timeTaken / (1024*1024);
std::cout << "\n<TR><TD>" << name;
std::cout << std::setiosflags(std::ios::fixed);
std::cout << "<TD>" << std::setprecision(0) << std::setiosflags(std::ios::fixed) << mbs;
oss << "\n<TR><TD>" << name << "<TD>" << provider;
oss << std::setiosflags(std::ios::fixed);
oss << "<TD>" << std::setprecision(0) << std::setiosflags(std::ios::fixed) << mbs;
if (g_hertz > 1.0f)
{
const double cpb = timeTaken * g_hertz / length;
if (cpb < 24.0f)
std::cout << "<TD>" << std::setprecision(2) << std::setiosflags(std::ios::fixed) << cpb;
oss << "<TD>" << std::setprecision(2) << std::setiosflags(std::ios::fixed) << cpb;
else
std::cout << "<TD>" << std::setprecision(1) << std::setiosflags(std::ios::fixed) << cpb;
oss << "<TD>" << std::setprecision(1) << std::setiosflags(std::ios::fixed) << cpb;
}
g_logTotal += log(mbs);
g_logCount++;
std::cout << oss.str();
}
void OutputResultKeying(double iterations, double timeTaken)
{
// Coverity finding, also see http://stackoverflow.com/a/34509163/608639.
StreamState ss(std::cout);
std::ostringstream oss;
// Coverity finding
if (iterations < 0.000001f) iterations = 0.000001f;
if (timeTaken < 0.000001f) timeTaken = 0.000001f;
std::cout << "<TD>" << std::setprecision(3) << std::setiosflags(std::ios::fixed) << (1000*1000*timeTaken/iterations);
oss << "<TD>" << std::setprecision(3) << std::setiosflags(std::ios::fixed) << (1000*1000*timeTaken/iterations);
// Coverity finding
if (g_hertz > 1.0f)
std::cout << "<TD>" << std::setprecision(0) << std::setiosflags(std::ios::fixed) << timeTaken * g_hertz / iterations;
oss << "<TD>" << std::setprecision(0) << std::setiosflags(std::ios::fixed) << timeTaken * g_hertz / iterations;
std::cout << oss.str();
}
void OutputResultOperations(const char *name, const char *operation, bool pc, unsigned long iterations, double timeTaken)
void OutputResultOperations(const char *name, const char *provider, const char *operation, bool pc, unsigned long iterations, double timeTaken)
{
// Coverity finding, also see http://stackoverflow.com/a/34509163/608639.
StreamState ss(std::cout);
CRYPTOPP_UNUSED(provider);
std::ostringstream oss;
// Coverity finding
if (!iterations) iterations++;
if (timeTaken < 0.000001f) timeTaken = 0.000001f;
std::cout << "\n<TR><TD>" << name << " " << operation << (pc ? " with precomputation" : "");
std::cout << "<TD>" << std::setprecision(2) << std::setiosflags(std::ios::fixed) << (1000*timeTaken/iterations);
oss << "\n<TR><TD>" << name << " " << operation << (pc ? " with precomputation" : "");
//oss << "<TD>" << provider;
oss << "<TD>" << std::setprecision(3) << std::setiosflags(std::ios::fixed) << (1000*timeTaken/iterations);
// Coverity finding
if (g_hertz > 1.0f)
{
const double t = timeTaken * g_hertz / iterations / 1000000;
std::cout << "<TD>" << std::setprecision(2) << std::setiosflags(std::ios::fixed) << t;
oss << "<TD>" << std::setprecision(3) << std::setiosflags(std::ios::fixed) << t;
}
g_logTotal += log(iterations/timeTaken);
g_logCount++;
std::cout << oss.str();
}
/*
@ -158,15 +182,8 @@ void BenchMark(const char *name, StreamTransformation &cipher, double timeTotal)
}
while (timeTaken < 2.0/3*timeTotal);
OutputResultBytes(name, double(blocks) * BUF_SIZE, timeTaken);
}
void BenchMark(const char *name, AuthenticatedSymmetricCipher &cipher, double timeTotal)
{
if (cipher.NeedsPrespecifiedDataLengths())
cipher.SpecifyDataLengths(0, cipher.MaxMessageLength(), 0);
BenchMark(name, static_cast<StreamTransformation &>(cipher), timeTotal);
std::string provider = cipher.AlgorithmProvider();
OutputResultBytes(name, provider.c_str(), double(blocks) * BUF_SIZE, timeTaken);
}
void BenchMark(const char *name, HashTransformation &ht, double timeTotal)
@ -189,7 +206,8 @@ void BenchMark(const char *name, HashTransformation &ht, double timeTotal)
}
while (timeTaken < 2.0/3*timeTotal);
OutputResultBytes(name, double(blocks) * BUF_SIZE, timeTaken);
std::string provider = ht.AlgorithmProvider();
OutputResultBytes(name, provider.c_str(), double(blocks) * BUF_SIZE, timeTaken);
}
void BenchMark(const char *name, BufferedTransformation &bt, double timeTotal)
@ -212,7 +230,8 @@ void BenchMark(const char *name, BufferedTransformation &bt, double timeTotal)
}
while (timeTaken < 2.0/3*timeTotal);
OutputResultBytes(name, double(blocks) * BUF_SIZE, timeTaken);
std::string provider = bt.AlgorithmProvider();
OutputResultBytes(name, provider.c_str(), double(blocks) * BUF_SIZE, timeTaken);
}
void BenchMark(const char *name, RandomNumberGenerator &rng, double timeTotal)
@ -243,7 +262,8 @@ void BenchMark(const char *name, RandomNumberGenerator &rng, double timeTotal)
timeTaken = double(::clock() - start) / CLOCK_TICKS_PER_SECOND;
} while (timeTaken < timeTotal);
OutputResultBytes(name, double(blocks) * BUF_SIZE, timeTaken);
std::string provider = rng.AlgorithmProvider();
OutputResultBytes(name, provider.c_str(), double(blocks) * BUF_SIZE, timeTaken);
}
// Hack, but we probably need a KeyedRandomNumberGenerator interface
@ -269,56 +289,12 @@ void BenchMark(const char *name, NIST_DRBG &rng, double timeTotal)
timeTaken = double(::clock() - start) / CLOCK_TICKS_PER_SECOND;
} while (timeTaken < timeTotal);
OutputResultBytes(name, double(blocks) * BUF_SIZE, timeTaken);
}
void BenchMarkKeying(SimpleKeyingInterface &c, size_t keyLength, const NameValuePairs &params)
{
unsigned long iterations = 0;
double timeTaken;
clock_t start = ::clock();
do
{
for (unsigned int i=0; i<1024; i++)
c.SetKey(defaultKey, keyLength, params);
timeTaken = double(::clock() - start) / CLOCK_TICKS_PER_SECOND;
iterations += 1024;
}
while (timeTaken < g_allocatedTime);
OutputResultKeying(iterations, timeTaken);
}
template <class T_FactoryOutput, class T_Interface>
void BenchMarkByName2(const char *factoryName, size_t keyLength = 0, const char *displayName=NULLPTR, const NameValuePairs &params = g_nullNameValuePairs)
{
std::string name(factoryName ? factoryName : "");
member_ptr<T_FactoryOutput> obj(ObjectFactoryRegistry<T_FactoryOutput>::Registry().CreateObject(name.c_str()));
if (!keyLength)
keyLength = obj->DefaultKeyLength();
if (displayName)
name = displayName;
else if (keyLength)
name += " (" + IntToString(keyLength * 8) + "-bit key)";
const int blockSize = params.GetIntValueWithDefault(Name::BlockSize(), 0);
obj->SetKey(defaultKey, keyLength, CombinedNameValuePairs(params, MakeParameters(Name::IV(), ConstByteArrayParameter(defaultKey, blockSize ? blockSize : obj->IVSize()), false)));
BenchMark(name.c_str(), *static_cast<T_Interface *>(obj.get()), g_allocatedTime);
BenchMarkKeying(*obj, keyLength, CombinedNameValuePairs(params, MakeParameters(Name::IV(), ConstByteArrayParameter(defaultKey, blockSize ? blockSize : obj->IVSize()), false)));
}
template <class T_FactoryOutput>
void BenchMarkByName(const char *factoryName, size_t keyLength = 0, const char *displayName=NULLPTR, const NameValuePairs &params = g_nullNameValuePairs)
{
CRYPTOPP_UNUSED(params);
BenchMarkByName2<T_FactoryOutput, T_FactoryOutput>(factoryName, keyLength, displayName, params);
std::string provider = rng.AlgorithmProvider();
OutputResultBytes(name, provider.c_str(), double(blocks) * BUF_SIZE, timeTaken);
}
template <class T>
void BenchMarkByNameKeyLess(const char *factoryName, const char *displayName=NULLPTR, const NameValuePairs &params = g_nullNameValuePairs)
void BenchMarkByNameKeyLess(const char *factoryName, const char *displayName = NULLPTR, const NameValuePairs &params = g_nullNameValuePairs)
{
CRYPTOPP_UNUSED(params);
std::string name = factoryName;
@ -331,34 +307,39 @@ void BenchMarkByNameKeyLess(const char *factoryName, const char *displayName=NUL
void AddHtmlHeader()
{
std::ostringstream oss;
// HTML5
std::cout << "<!DOCTYPE HTML>";
std::cout << "\n<HTML lang=\"en\">";
oss << "<!DOCTYPE HTML>";
oss << "\n<HTML lang=\"en\">";
std::cout << "\n<HEAD>";
std::cout << "\n<META charset=\"UTF-8\">";
std::cout << "\n<TITLE>Speed Comparison of Popular Crypto Algorithms</TITLE>";
std::cout << "\n<STYLE>\n table {border-collapse: collapse;}";
std::cout << "\n table, th, td, tr {border: 1px solid black;}\n</STYLE>";
std::cout << "\n</HEAD>";
oss << "\n<HEAD>";
oss << "\n<META charset=\"UTF-8\">";
oss << "\n<TITLE>Speed Comparison of Popular Crypto Algorithms</TITLE>";
oss << "\n<STYLE>\n table {border-collapse: collapse;}";
oss << "\n table, th, td, tr {border: 1px solid black;}\n</STYLE>";
oss << "\n</HEAD>";
std::cout << "\n<BODY>";
oss << "\n<BODY>";
std::cout << "\n<H1><A href=\"http://www.cryptopp.com\">Crypto++</A> " << CRYPTOPP_VERSION / 100;
std::cout << '.' << (CRYPTOPP_VERSION % 100) / 10 << '.' << CRYPTOPP_VERSION % 10 << " Benchmarks</H1>";
oss << "\n<H1><A href=\"http://www.cryptopp.com\">Crypto++ " << CRYPTOPP_VERSION / 100;
oss << '.' << (CRYPTOPP_VERSION % 100) / 10 << '.' << CRYPTOPP_VERSION % 10 << "</A> Benchmarks</H1>";
std::cout << "\n<P>Here are speed benchmarks for some commonly used cryptographic algorithms.</P>";
oss << "\n<P>Here are speed benchmarks for some commonly used cryptographic algorithms.</P>";
if (g_hertz > 1.0f)
std::cout << "\n<P>CPU frequency of the test platform is " << g_hertz << " Hz.</P>";
oss << "\n<P>CPU frequency of the test platform is " << HertzToString(g_hertz) << ".</P>";
else
std::cout << "\n<P>CPU frequency of the test platform was not provided.</P>" << std::endl;
oss << "\n<P>CPU frequency of the test platform was not provided.</P>" << std::endl;
std::cout << oss.str();
}
void AddHtmlFooter()
{
std::cout << "\n</BODY>";
std::cout << "\n</HTML>" << std::endl;
std::ostringstream oss;
oss << "\n</BODY>\n</HTML>\n";
std::cout << oss.str();
}
void BenchmarkWithCommand(int argc, const char* const argv[])
@ -368,8 +349,14 @@ void BenchmarkWithCommand(int argc, const char* const argv[])
float cpuFreq(argc >= 4 ? Test::StringToValue<float, true>(argv[3])*float(1e9) : 0.0f);
std::string algoName(argc >= 5 ? argv[4] : "");
// https://github.com/weidai11/cryptopp/issues/983
if (runningTime > 10.0f)
runningTime = 10.0f;
if (command == "b") // All benchmarks
Benchmark(Test::All, runningTime, cpuFreq);
else if (command == "b4") // Public key algorithms over EC
Test::Benchmark(Test::PublicKeyEC, runningTime, cpuFreq);
else if (command == "b3") // Public key algorithms
Test::Benchmark(Test::PublicKey, runningTime, cpuFreq);
else if (command == "b2") // Shared key algorithms
@ -383,6 +370,9 @@ void Benchmark(Test::TestClass suites, double t, double hertz)
g_allocatedTime = t;
g_hertz = hertz;
// Add <br> in between tables
size_t count_breaks = 0;
AddHtmlHeader();
g_testBegin = ::time(NULLPTR);
@ -393,47 +383,65 @@ void Benchmark(Test::TestClass suites, double t, double hertz)
// Unkeyed algorithms
if (suites & Test::Unkeyed)
{
std::cout << "\n<BR>";
Benchmark1(t, hertz);
if (count_breaks)
std::cout << "\n<BR>";
count_breaks++;
BenchmarkUnkeyedAlgorithms(t, hertz);
}
// Shared key algorithms
if (suites & Test::SharedKey)
{
std::cout << "\n<BR>";
Benchmark2(t, hertz);
if (count_breaks)
std::cout << "\n<BR>";
count_breaks++;
BenchmarkSharedKeyedAlgorithms(t, hertz);
}
// Public key algorithms
if (suites & Test::PublicKey)
{
std::cout << "\n<BR>";
Benchmark3(t, hertz);
if (count_breaks)
std::cout << "\n<BR>";
count_breaks++;
BenchmarkPublicKeyAlgorithms(t, hertz);
}
// Public key algorithms over EC
if (suites & Test::PublicKeyEC)
{
if (count_breaks)
std::cout << "\n<BR>";
count_breaks++;
BenchmarkEllipticCurveAlgorithms(t, hertz);
}
g_testEnd = ::time(NULLPTR);
{
StreamState state(std::cout);
std::cout << "\n<P>Throughput Geometric Average: " << std::setiosflags(std::ios::fixed);
std::cout << std::exp(g_logTotal/(g_logCount > 0.0f ? g_logCount : 1.0f)) << std::endl;
}
std::ostringstream oss;
oss << "\n<P>Throughput Geometric Average: " << std::setiosflags(std::ios::fixed);
oss << std::exp(g_logTotal/(g_logCount > 0.0f ? g_logCount : 1.0f)) << std::endl;
std::cout << "\n<P>Test started at " << TimeToString(g_testBegin);
std::cout << "\n<BR>Test ended at " << TimeToString(g_testEnd);
std::cout << std::endl;
oss << "\n<P>Test started at " << TimeToString(g_testBegin);
oss << "\n<BR>Test ended at " << TimeToString(g_testEnd);
oss << "\n";
std::cout << oss.str();
AddHtmlFooter();
}
void Benchmark1(double t, double hertz)
void BenchmarkUnkeyedAlgorithms(double t, double hertz)
{
g_allocatedTime = t;
g_hertz = hertz;
const char *cpb;
if (g_hertz > 1.0f)
cpb = "<TH>Cycles Per Byte";
cpb = "<TH>Cycles/Byte";
else
cpb = "";
@ -442,7 +450,7 @@ void Benchmark1(double t, double hertz)
std::cout << "\n<COLGROUP><COL style=\"text-align: left;\"><COL style=\"text-align: right;\">";
std::cout << "<COL style=\"text-align: right;\">";
std::cout << "\n<THEAD style=\"background: #F0F0F0\">";
std::cout << "\n<TR><TH>Algorithm<TH>MiB/Second" << cpb;
std::cout << "\n<TR><TH>Algorithm<TH>Provider<TH>MiB/Second" << cpb;
std::cout << "\n<TBODY style=\"background: white;\">";
{
@ -454,15 +462,19 @@ void Benchmark1(double t, double hertz)
BenchMarkByNameKeyLess<RandomNumberGenerator>("AutoSeededX917RNG(AES)");
#endif
BenchMarkByNameKeyLess<RandomNumberGenerator>("MT19937");
#if (CRYPTOPP_BOOL_X86)
#if (CRYPTOPP_BOOL_X86) && !defined(CRYPTOPP_DISABLE_ASM)
if (HasPadlockRNG())
BenchMarkByNameKeyLess<RandomNumberGenerator>("PadlockRNG");
#endif
#if (CRYPTOPP_BOOL_X86 || CRYPTOPP_BOOL_X32 || CRYPTOPP_BOOL_X64)
#if (CRYPTOPP_BOOL_X86 || CRYPTOPP_BOOL_X32 || CRYPTOPP_BOOL_X64) && !defined(CRYPTOPP_DISABLE_ASM)
if (HasRDRAND())
BenchMarkByNameKeyLess<RandomNumberGenerator>("RDRAND");
if (HasRDSEED())
BenchMarkByNameKeyLess<RandomNumberGenerator>("RDSEED");
#endif
#if (CRYPTOPP_BOOL_PPC32 || CRYPTOPP_BOOL_PPC64) && !defined(CRYPTOPP_DISABLE_ASM)
if (HasDARN())
BenchMarkByNameKeyLess<RandomNumberGenerator>("DARN");
#endif
BenchMarkByNameKeyLess<RandomNumberGenerator>("AES/OFB RNG");
BenchMarkByNameKeyLess<NIST_DRBG>("Hash_DRBG(SHA1)");
@ -497,154 +509,8 @@ void Benchmark1(double t, double hertz)
BenchMarkByNameKeyLess<HashTransformation>("SM3");
BenchMarkByNameKeyLess<HashTransformation>("BLAKE2s");
BenchMarkByNameKeyLess<HashTransformation>("BLAKE2b");
}
std::cout << "\n</TABLE>" << std::endl;
}
void Benchmark2(double t, double hertz)
{
g_allocatedTime = t;
g_hertz = hertz;
const char *cpb, *cpk;
if (g_hertz > 1.0f)
{
cpb = "<TH>Cycles Per Byte";
cpk = "<TH>Cycles to<BR>Setup Key and IV";
}
else
{
cpb = cpk = "";
}
std::cout << "\n<TABLE>";
std::cout << "\n<COLGROUP><COL style=\"text-align: left;\"><COL style=\"text-align: right;\"><COL style=";
std::cout << "\"text-align: right;\"><COL style=\"text-align: right;\"><COL style=\"text-align: right;\">";
std::cout << "\n<THEAD style=\"background: #F0F0F0\">";
std::cout << "\n<TR><TH>Algorithm<TH>MiB/Second" << cpb;
std::cout << "<TH>Microseconds to<BR>Setup Key and IV" << cpk;
std::cout << "\n<TBODY style=\"background: white;\">";
{
#if CRYPTOPP_AESNI_AVAILABLE
if (HasCLMUL())
BenchMarkByName2<AuthenticatedSymmetricCipher, MessageAuthenticationCode>("AES/GCM", 0, "GMAC(AES)");
else
#elif CRYPTOPP_ARM_PMULL_AVAILABLE
if (HasPMULL())
BenchMarkByName2<AuthenticatedSymmetricCipher, MessageAuthenticationCode>("AES/GCM", 0, "GMAC(AES)");
else
#endif
{
BenchMarkByName2<AuthenticatedSymmetricCipher, MessageAuthenticationCode>("AES/GCM", 0, "GMAC(AES) (2K tables)", MakeParameters(Name::TableSize(), 2048));
BenchMarkByName2<AuthenticatedSymmetricCipher, MessageAuthenticationCode>("AES/GCM", 0, "GMAC(AES) (64K tables)", MakeParameters(Name::TableSize(), 64 * 1024));
}
BenchMarkByName<MessageAuthenticationCode>("VMAC(AES)-64");
BenchMarkByName<MessageAuthenticationCode>("VMAC(AES)-128");
BenchMarkByName<MessageAuthenticationCode>("HMAC(SHA-1)");
BenchMarkByName<MessageAuthenticationCode>("HMAC(SHA-256)");
BenchMarkByName<MessageAuthenticationCode>("Two-Track-MAC");
BenchMarkByName<MessageAuthenticationCode>("CMAC(AES)");
BenchMarkByName<MessageAuthenticationCode>("DMAC(AES)");
BenchMarkByName<MessageAuthenticationCode>("Poly1305(AES)");
BenchMarkByName<MessageAuthenticationCode>("BLAKE2s");
BenchMarkByName<MessageAuthenticationCode>("BLAKE2b");
BenchMarkByName<MessageAuthenticationCode>("SipHash-2-4");
BenchMarkByName<MessageAuthenticationCode>("SipHash-4-8");
}
std::cout << "\n<TBODY style=\"background: yellow;\">";
{
BenchMarkByName<SymmetricCipher>("Panama-LE");
BenchMarkByName<SymmetricCipher>("Panama-BE");
BenchMarkByName<SymmetricCipher>("Salsa20");
BenchMarkByName<SymmetricCipher>("Salsa20", 0, "Salsa20/12", MakeParameters(Name::Rounds(), 12));
BenchMarkByName<SymmetricCipher>("Salsa20", 0, "Salsa20/8", MakeParameters(Name::Rounds(), 8));
BenchMarkByName<SymmetricCipher>("ChaCha20");
BenchMarkByName<SymmetricCipher>("ChaCha12");
BenchMarkByName<SymmetricCipher>("ChaCha8");
BenchMarkByName<SymmetricCipher>("Sosemanuk");
BenchMarkByName<SymmetricCipher>("MARC4");
BenchMarkByName<SymmetricCipher>("SEAL-3.0-LE");
BenchMarkByName<SymmetricCipher>("WAKE-OFB-LE");
}
std::cout << "\n<TBODY style=\"background: white;\">";
{
BenchMarkByName<SymmetricCipher>("AES/CTR", 16);
BenchMarkByName<SymmetricCipher>("AES/CTR", 24);
BenchMarkByName<SymmetricCipher>("AES/CTR", 32);
BenchMarkByName<SymmetricCipher>("AES/CBC", 16);
BenchMarkByName<SymmetricCipher>("AES/CBC", 24);
BenchMarkByName<SymmetricCipher>("AES/CBC", 32);
BenchMarkByName<SymmetricCipher>("AES/OFB", 16);
BenchMarkByName<SymmetricCipher>("AES/CFB", 16);
BenchMarkByName<SymmetricCipher>("AES/ECB", 16);
BenchMarkByName<SymmetricCipher>("ARIA/CTR", 16);
BenchMarkByName<SymmetricCipher>("ARIA/CTR", 32);
BenchMarkByName<SymmetricCipher>("Camellia/CTR", 16);
BenchMarkByName<SymmetricCipher>("Camellia/CTR", 32);
BenchMarkByName<SymmetricCipher>("Twofish/CTR");
BenchMarkByName<SymmetricCipher>("Threefish-256(256)/CTR", 32);
BenchMarkByName<SymmetricCipher>("Threefish-512(512)/CTR", 64);
BenchMarkByName<SymmetricCipher>("Threefish-1024(1024)/CTR", 128);
BenchMarkByName<SymmetricCipher>("Serpent/CTR");
BenchMarkByName<SymmetricCipher>("CAST-128/CTR");
BenchMarkByName<SymmetricCipher>("CAST-256/CTR");
BenchMarkByName<SymmetricCipher>("RC6/CTR");
BenchMarkByName<SymmetricCipher>("MARS/CTR");
BenchMarkByName<SymmetricCipher>("SHACAL-2/CTR", 16);
BenchMarkByName<SymmetricCipher>("SHACAL-2/CTR", 64);
BenchMarkByName<SymmetricCipher>("DES/CTR");
BenchMarkByName<SymmetricCipher>("DES-XEX3/CTR");
BenchMarkByName<SymmetricCipher>("DES-EDE3/CTR");
BenchMarkByName<SymmetricCipher>("IDEA/CTR");
BenchMarkByName<SymmetricCipher>("RC5/CTR", 0, "RC5 (r=16)");
BenchMarkByName<SymmetricCipher>("Blowfish/CTR");
BenchMarkByName<SymmetricCipher>("TEA/CTR");
BenchMarkByName<SymmetricCipher>("XTEA/CTR");
BenchMarkByName<SymmetricCipher>("SKIPJACK/CTR");
BenchMarkByName<SymmetricCipher>("SEED/CTR", 0, "SEED/CTR (1/2 K table)");
BenchMarkByName<SymmetricCipher>("SM4/CTR");
BenchMarkByName<SymmetricCipher>("Kalyna-128/CTR", 16, "Kalyna-128(128)/CTR (128-bit key)");
BenchMarkByName<SymmetricCipher>("Kalyna-128/CTR", 32, "Kalyna-128(256)/CTR (256-bit key)");
BenchMarkByName<SymmetricCipher>("Kalyna-256/CTR", 32, "Kalyna-256(256)/CTR (256-bit key)");
BenchMarkByName<SymmetricCipher>("Kalyna-256/CTR", 64, "Kalyna-256(512)/CTR (512-bit key)");
BenchMarkByName<SymmetricCipher>("Kalyna-512/CTR", 64, "Kalyna-512(512)/CTR (512-bit key)");
BenchMarkByName<SymmetricCipher>("SIMON-64/CTR", 12, "SIMON-64(96)/CTR (96-bit key)");
BenchMarkByName<SymmetricCipher>("SIMON-64/CTR", 16, "SIMON-64(128)/CTR (128-bit key)");
BenchMarkByName<SymmetricCipher>("SIMON-128/CTR", 16, "SIMON-128(128)/CTR (128-bit key)");
BenchMarkByName<SymmetricCipher>("SIMON-128/CTR", 24, "SIMON-128(192)/CTR (192-bit key)");
BenchMarkByName<SymmetricCipher>("SIMON-128/CTR", 32, "SIMON-128(256)/CTR (256-bit key)");
BenchMarkByName<SymmetricCipher>("SPECK-64/CTR", 12, "SPECK-64(96)/CTR (96-bit key)");
BenchMarkByName<SymmetricCipher>("SPECK-64/CTR", 16, "SPECK-64(128)/CTR (128-bit key)");
BenchMarkByName<SymmetricCipher>("SPECK-128/CTR", 16, "SPECK-128(128)/CTR (128-bit key)");
BenchMarkByName<SymmetricCipher>("SPECK-128/CTR", 24, "SPECK-128(192)/CTR (192-bit key)");
BenchMarkByName<SymmetricCipher>("SPECK-128/CTR", 32, "SPECK-128(256)/CTR (256-bit key)");
}
std::cout << "\n<TBODY style=\"background: yellow;\">";
{
#if CRYPTOPP_AESNI_AVAILABLE
if (HasCLMUL())
BenchMarkByName2<AuthenticatedSymmetricCipher, AuthenticatedSymmetricCipher>("AES/GCM", 0, "AES/GCM");
else
#elif CRYPTOPP_ARM_PMULL_AVAILABLE
if (HasPMULL())
BenchMarkByName2<AuthenticatedSymmetricCipher, AuthenticatedSymmetricCipher>("AES/GCM", 0, "AES/GCM");
else
#endif
{
BenchMarkByName2<AuthenticatedSymmetricCipher, AuthenticatedSymmetricCipher>("AES/GCM", 0, "AES/GCM (2K tables)", MakeParameters(Name::TableSize(), 2048));
BenchMarkByName2<AuthenticatedSymmetricCipher, AuthenticatedSymmetricCipher>("AES/GCM", 0, "AES/GCM (64K tables)", MakeParameters(Name::TableSize(), 64 * 1024));
}
BenchMarkByName2<AuthenticatedSymmetricCipher, AuthenticatedSymmetricCipher>("AES/CCM");
BenchMarkByName2<AuthenticatedSymmetricCipher, AuthenticatedSymmetricCipher>("AES/EAX");
BenchMarkByNameKeyLess<HashTransformation>("LSH-256");
BenchMarkByNameKeyLess<HashTransformation>("LSH-512");
}
std::cout << "\n</TABLE>" << std::endl;

View File

@ -5,33 +5,22 @@
#include "bench.h"
#include "validate.h"
#include "pubkey.h"
#include "gfpcrypt.h"
#include "eccrypto.h"
#include "pkcspad.h"
#include "files.h"
#include "filters.h"
#include "hex.h"
#include "rsa.h"
#include "nr.h"
#include "dsa.h"
#include "luc.h"
#include "rw.h"
#include "ecp.h"
#include "ec2n.h"
#include "asn.h"
#include "dh.h"
#include "mqv.h"
#include "hmqv.h"
#include "fhmqv.h"
#include "xtrcrypt.h"
#include "esign.h"
#include "pssr.h"
#include "oids.h"
#include "randpool.h"
#include "cpu.h"
#include "factory.h"
#include "algparam.h"
#include "argnames.h"
#include "smartptr.h"
#include "stdcpp.h"
#include "hrtimer.h"
#include "vmac.h"
#include "hmac.h"
#include "ttmac.h"
#include "cmac.h"
#include "dmac.h"
#if CRYPTOPP_MSC_VERSION
# pragma warning(disable: 4355)
#endif
#if CRYPTOPP_MSC_VERSION
# pragma warning(disable: 4505 4355)
@ -40,381 +29,235 @@
NAMESPACE_BEGIN(CryptoPP)
NAMESPACE_BEGIN(Test)
void BenchMarkEncryption(const char *name, PK_Encryptor &key, double timeTotal, bool pc=false)
void BenchMarkKeying(SimpleKeyingInterface &c, size_t keyLength, const NameValuePairs &params)
{
unsigned int len = 16;
SecByteBlock plaintext(len), ciphertext(key.CiphertextLength(len));
Test::GlobalRNG().GenerateBlock(plaintext, len);
unsigned int i = 0;
unsigned long iterations = 0;
double timeTaken;
ThreadUserTimer timer;
timer.StartTimer();
clock_t start = ::clock();
do
{
key.Encrypt(Test::GlobalRNG(), plaintext, len, ciphertext);
++i; timeTaken = timer.ElapsedTimeAsDouble();
for (unsigned int i=0; i<1024; i++)
c.SetKey(defaultKey, keyLength, params);
timeTaken = double(::clock() - start) / CLOCK_TICKS_PER_SECOND;
iterations += 1024;
}
while (timeTaken < timeTotal);
while (timeTaken < g_allocatedTime);
OutputResultOperations(name, "Encryption", pc, i, timeTaken);
if (!pc && key.GetMaterial().SupportsPrecomputation())
{
key.AccessMaterial().Precompute(16);
BenchMarkEncryption(name, key, timeTotal, true);
}
OutputResultKeying(iterations, timeTaken);
}
void BenchMarkDecryption(const char *name, PK_Decryptor &priv, PK_Encryptor &pub, double timeTotal)
void BenchMark(const char *name, AuthenticatedSymmetricCipher &cipher, double timeTotal)
{
unsigned int len = 16;
SecByteBlock ciphertext(pub.CiphertextLength(len));
SecByteBlock plaintext(pub.MaxPlaintextLength(ciphertext.size()));
Test::GlobalRNG().GenerateBlock(plaintext, len);
pub.Encrypt(Test::GlobalRNG(), plaintext, len, ciphertext);
if (cipher.NeedsPrespecifiedDataLengths())
cipher.SpecifyDataLengths(0, cipher.MaxMessageLength(), 0);
unsigned int i = 0;
double timeTaken;
ThreadUserTimer timer;
timer.StartTimer();
do
{
priv.Decrypt(Test::GlobalRNG(), ciphertext, ciphertext.size(), plaintext);
++i; timeTaken = timer.ElapsedTimeAsDouble();
}
while (timeTaken < timeTotal);
OutputResultOperations(name, "Decryption", false, i, timeTaken);
BenchMark(name, static_cast<StreamTransformation &>(cipher), timeTotal);
}
void BenchMarkSigning(const char *name, PK_Signer &key, double timeTotal, bool pc=false)
template <class T_FactoryOutput, class T_Interface>
void BenchMarkByName2(const char *factoryName, size_t keyLength=0, const char *displayName=NULLPTR, const NameValuePairs &params = g_nullNameValuePairs)
{
unsigned int len = 16;
AlignedSecByteBlock message(len), signature(key.SignatureLength());
Test::GlobalRNG().GenerateBlock(message, len);
std::string name(factoryName ? factoryName : "");
member_ptr<T_FactoryOutput> obj(ObjectFactoryRegistry<T_FactoryOutput>::Registry().CreateObject(name.c_str()));
unsigned int i = 0;
double timeTaken;
if (keyLength == 0)
keyLength = obj->DefaultKeyLength();
ThreadUserTimer timer;
timer.StartTimer();
if (displayName != NULLPTR)
name = displayName;
else if (keyLength != 0)
name += " (" + IntToString(keyLength * 8) + "-bit key)";
do
{
(void)key.SignMessage(Test::GlobalRNG(), message, len, signature);
++i; timeTaken = timer.ElapsedTimeAsDouble();
}
while (timeTaken < timeTotal);
OutputResultOperations(name, "Signature", pc, i, timeTaken);
if (!pc && key.GetMaterial().SupportsPrecomputation())
{
key.AccessMaterial().Precompute(16);
BenchMarkSigning(name, key, timeTotal, true);
}
obj->SetKey(defaultKey, keyLength, CombinedNameValuePairs(params, MakeParameters(Name::IV(), ConstByteArrayParameter(defaultKey, obj->IVSize()), false)));
BenchMark(name.c_str(), *static_cast<T_Interface *>(obj.get()), g_allocatedTime);
BenchMarkKeying(*obj, keyLength, CombinedNameValuePairs(params, MakeParameters(Name::IV(), ConstByteArrayParameter(defaultKey, obj->IVSize()), false)));
}
void BenchMarkVerification(const char *name, const PK_Signer &priv, PK_Verifier &pub, double timeTotal, bool pc=false)
template <class T_FactoryOutput>
void BenchMarkByName(const char *factoryName, size_t keyLength=0, const char *displayName=NULLPTR, const NameValuePairs &params = g_nullNameValuePairs)
{
unsigned int len = 16;
AlignedSecByteBlock message(len), signature(pub.SignatureLength());
Test::GlobalRNG().GenerateBlock(message, len);
priv.SignMessage(Test::GlobalRNG(), message, len, signature);
unsigned int i = 0;
double timeTaken;
ThreadUserTimer timer;
timer.StartTimer();
do
{
(void)pub.VerifyMessage(message, len, signature, signature.size());
++i; timeTaken = timer.ElapsedTimeAsDouble();
}
while (timeTaken < timeTotal);
OutputResultOperations(name, "Verification", pc, i, timeTaken);
if (!pc && pub.GetMaterial().SupportsPrecomputation())
{
pub.AccessMaterial().Precompute(16);
BenchMarkVerification(name, priv, pub, timeTotal, true);
}
BenchMarkByName2<T_FactoryOutput,T_FactoryOutput>(factoryName, keyLength, displayName, params);
}
void BenchMarkKeyGen(const char *name, SimpleKeyAgreementDomain &d, double timeTotal, bool pc=false)
{
SecByteBlock priv(d.PrivateKeyLength()), pub(d.PublicKeyLength());
unsigned int i = 0;
double timeTaken;
ThreadUserTimer timer;
timer.StartTimer();
do
{
d.GenerateKeyPair(Test::GlobalRNG(), priv, pub);
++i; timeTaken = timer.ElapsedTimeAsDouble();
}
while (timeTaken < timeTotal);
OutputResultOperations(name, "Key-Pair Generation", pc, i, timeTaken);
if (!pc && d.GetMaterial().SupportsPrecomputation())
{
d.AccessMaterial().Precompute(16);
BenchMarkKeyGen(name, d, timeTotal, true);
}
}
void BenchMarkKeyGen(const char *name, AuthenticatedKeyAgreementDomain &d, double timeTotal, bool pc=false)
{
SecByteBlock priv(d.EphemeralPrivateKeyLength()), pub(d.EphemeralPublicKeyLength());
unsigned int i = 0;
double timeTaken;
ThreadUserTimer timer;
timer.StartTimer();
do
{
d.GenerateEphemeralKeyPair(Test::GlobalRNG(), priv, pub);
++i; timeTaken = timer.ElapsedTimeAsDouble();
}
while (timeTaken < timeTotal);
OutputResultOperations(name, "Key-Pair Generation", pc, i, timeTaken);
if (!pc && d.GetMaterial().SupportsPrecomputation())
{
d.AccessMaterial().Precompute(16);
BenchMarkKeyGen(name, d, timeTotal, true);
}
}
void BenchMarkAgreement(const char *name, SimpleKeyAgreementDomain &d, double timeTotal, bool pc=false)
{
SecByteBlock priv1(d.PrivateKeyLength()), priv2(d.PrivateKeyLength());
SecByteBlock pub1(d.PublicKeyLength()), pub2(d.PublicKeyLength());
d.GenerateKeyPair(Test::GlobalRNG(), priv1, pub1);
d.GenerateKeyPair(Test::GlobalRNG(), priv2, pub2);
SecByteBlock val(d.AgreedValueLength());
unsigned int i = 0;
double timeTaken;
ThreadUserTimer timer;
timer.StartTimer();
do
{
d.Agree(val, priv1, pub2);
d.Agree(val, priv2, pub1);
i+=2; timeTaken = timer.ElapsedTimeAsDouble();
}
while (timeTaken < timeTotal);
OutputResultOperations(name, "Key Agreement", pc, i, timeTaken);
}
void BenchMarkAgreement(const char *name, AuthenticatedKeyAgreementDomain &d, double timeTotal, bool pc=false)
{
SecByteBlock spriv1(d.StaticPrivateKeyLength()), spriv2(d.StaticPrivateKeyLength());
SecByteBlock epriv1(d.EphemeralPrivateKeyLength()), epriv2(d.EphemeralPrivateKeyLength());
SecByteBlock spub1(d.StaticPublicKeyLength()), spub2(d.StaticPublicKeyLength());
SecByteBlock epub1(d.EphemeralPublicKeyLength()), epub2(d.EphemeralPublicKeyLength());
d.GenerateStaticKeyPair(Test::GlobalRNG(), spriv1, spub1);
d.GenerateStaticKeyPair(Test::GlobalRNG(), spriv2, spub2);
d.GenerateEphemeralKeyPair(Test::GlobalRNG(), epriv1, epub1);
d.GenerateEphemeralKeyPair(Test::GlobalRNG(), epriv2, epub2);
SecByteBlock val(d.AgreedValueLength());
unsigned int i = 0;
double timeTaken;
ThreadUserTimer timer;
timer.StartTimer();
do
{
d.Agree(val, spriv1, epriv1, spub2, epub2);
d.Agree(val, spriv2, epriv2, spub1, epub1);
i+=2; timeTaken = timer.ElapsedTimeAsDouble();
}
while (timeTaken < timeTotal);
OutputResultOperations(name, "Key Agreement", pc, i, timeTaken);
}
template <class SCHEME>
void BenchMarkCrypto(const char *filename, const char *name, double timeTotal)
{
FileSource f(filename, true, new HexDecoder);
typename SCHEME::Decryptor priv(f);
typename SCHEME::Encryptor pub(priv);
BenchMarkEncryption(name, pub, timeTotal);
BenchMarkDecryption(name, priv, pub, timeTotal);
}
template <class SCHEME>
void BenchMarkSignature(const char *filename, const char *name, double timeTotal)
{
FileSource f(filename, true, new HexDecoder);
typename SCHEME::Signer priv(f);
typename SCHEME::Verifier pub(priv);
BenchMarkSigning(name, priv, timeTotal);
BenchMarkVerification(name, priv, pub, timeTotal);
}
template <class D>
void BenchMarkKeyAgreement(const char *filename, const char *name, double timeTotal)
{
FileSource f(filename, true, new HexDecoder);
D d(f);
BenchMarkKeyGen(name, d, timeTotal);
BenchMarkAgreement(name, d, timeTotal);
}
void Benchmark3(double t, double hertz)
void BenchmarkSharedKeyedAlgorithms(double t, double hertz)
{
g_allocatedTime = t;
g_hertz = hertz;
const char *mco;
const char *cpb, *cpk;
if (g_hertz > 1.0f)
mco = "<TH>Megacycles/Operation";
{
cpb = "<TH>Cycles/Byte";
cpk = "<TH>Cycles to<BR>Setup Key and IV";
}
else
mco = "";
{
cpb = cpk = "";
}
std::cout << "\n<TABLE>";
std::cout << "\n<COLGROUP><COL style=\"text-align: left;\"><COL style=";
std::cout << "\"text-align: right;\"><COL style=\"text-align: right;\">";
std::cout << "\n<COLGROUP><COL style=\"text-align: left;\"><COL style=\"text-align: right;\"><COL style=";
std::cout << "\"text-align: right;\"><COL style=\"text-align: right;\"><COL style=\"text-align: right;\">";
std::cout << "\n<THEAD style=\"background: #F0F0F0\">";
std::cout << "\n<TR><TH>Operation<TH>Milliseconds/Operation" << mco;
std::cout << "\n<TR><TH>Algorithm<TH>Provider<TH>MiB/Second" << cpb;
std::cout << "<TH>Microseconds to<BR>Setup Key and IV" << cpk;
std::cout << "\n<TBODY style=\"background: white;\">";
{
BenchMarkCrypto<RSAES<OAEP<SHA1> > >(CRYPTOPP_DATA_DIR "TestData/rsa1024.dat", "RSA 1024", t);
BenchMarkCrypto<LUCES<OAEP<SHA1> > >(CRYPTOPP_DATA_DIR "TestData/luc1024.dat", "LUC 1024", t);
BenchMarkCrypto<DLIES<> >(CRYPTOPP_DATA_DIR "TestData/dlie1024.dat", "DLIES 1024", t);
BenchMarkCrypto<LUC_IES<> >(CRYPTOPP_DATA_DIR "TestData/lucc512.dat", "LUCELG 512", t);
}
std::cout << "\n<TBODY style=\"background: yellow;\">";
{
BenchMarkCrypto<RSAES<OAEP<SHA1> > >(CRYPTOPP_DATA_DIR "TestData/rsa2048.dat", "RSA 2048", t);
BenchMarkCrypto<LUCES<OAEP<SHA1> > >(CRYPTOPP_DATA_DIR "TestData/luc2048.dat", "LUC 2048", t);
BenchMarkCrypto<DLIES<> >(CRYPTOPP_DATA_DIR "TestData/dlie2048.dat", "DLIES 2048", t);
BenchMarkCrypto<LUC_IES<> >(CRYPTOPP_DATA_DIR "TestData/lucc1024.dat", "LUCELG 1024", t);
}
std::cout << "\n<TBODY style=\"background: white;\">";
{
BenchMarkSignature<RSASS<PSSR, SHA1> >(CRYPTOPP_DATA_DIR "TestData/rsa1024.dat", "RSA 1024", t);
BenchMarkSignature<RWSS<PSSR, SHA1> >(CRYPTOPP_DATA_DIR "TestData/rw1024.dat", "RW 1024", t);
BenchMarkSignature<LUCSS<PSSR, SHA1> >(CRYPTOPP_DATA_DIR "TestData/luc1024.dat", "LUC 1024", t);
BenchMarkSignature<NR<SHA1> >(CRYPTOPP_DATA_DIR "TestData/nr1024.dat", "NR 1024", t);
BenchMarkSignature<DSA>(CRYPTOPP_DATA_DIR "TestData/dsa1024.dat", "DSA 1024", t);
BenchMarkSignature<LUC_HMP<SHA1> >(CRYPTOPP_DATA_DIR "TestData/lucs512.dat", "LUC-HMP 512", t);
BenchMarkSignature<ESIGN<SHA1> >(CRYPTOPP_DATA_DIR "TestData/esig1023.dat", "ESIGN 1023", t);
BenchMarkSignature<ESIGN<SHA1> >(CRYPTOPP_DATA_DIR "TestData/esig1536.dat", "ESIGN 1536", t);
}
std::cout << "\n<TBODY style=\"background: yellow;\">";
{
BenchMarkSignature<RSASS<PSSR, SHA1> >(CRYPTOPP_DATA_DIR "TestData/rsa2048.dat", "RSA 2048", t);
BenchMarkSignature<RWSS<PSSR, SHA1> >(CRYPTOPP_DATA_DIR "TestData/rw2048.dat", "RW 2048", t);
BenchMarkSignature<LUCSS<PSSR, SHA1> >(CRYPTOPP_DATA_DIR "TestData/luc2048.dat", "LUC 2048", t);
BenchMarkSignature<NR<SHA1> >(CRYPTOPP_DATA_DIR "TestData/nr2048.dat", "NR 2048", t);
BenchMarkSignature<LUC_HMP<SHA1> >(CRYPTOPP_DATA_DIR "TestData/lucs1024.dat", "LUC-HMP 1024", t);
BenchMarkSignature<ESIGN<SHA1> >(CRYPTOPP_DATA_DIR "TestData/esig2046.dat", "ESIGN 2046", t);
}
std::cout << "\n<TBODY style=\"background: white;\">";
{
BenchMarkKeyAgreement<XTR_DH>(CRYPTOPP_DATA_DIR "TestData/xtrdh171.dat", "XTR-DH 171", t);
BenchMarkKeyAgreement<XTR_DH>(CRYPTOPP_DATA_DIR "TestData/xtrdh342.dat", "XTR-DH 342", t);
BenchMarkKeyAgreement<DH>(CRYPTOPP_DATA_DIR "TestData/dh1024.dat", "DH 1024", t);
BenchMarkKeyAgreement<DH>(CRYPTOPP_DATA_DIR "TestData/dh2048.dat", "DH 2048", t);
BenchMarkKeyAgreement<LUC_DH>(CRYPTOPP_DATA_DIR "TestData/lucd512.dat", "LUCDIF 512", t);
BenchMarkKeyAgreement<LUC_DH>(CRYPTOPP_DATA_DIR "TestData/lucd1024.dat", "LUCDIF 1024", t);
BenchMarkKeyAgreement<MQV>(CRYPTOPP_DATA_DIR "TestData/mqv1024.dat", "MQV 1024", t);
BenchMarkKeyAgreement<MQV>(CRYPTOPP_DATA_DIR "TestData/mqv2048.dat", "MQV 2048", t);
#if 0
BenchMarkKeyAgreement<ECHMQV160>(CRYPTOPP_DATA_DIR "TestData/hmqv160.dat", "HMQV P-160", t);
BenchMarkKeyAgreement<ECHMQV256>(CRYPTOPP_DATA_DIR "TestData/hmqv256.dat", "HMQV P-256", t);
BenchMarkKeyAgreement<ECHMQV384>(CRYPTOPP_DATA_DIR "TestData/hmqv384.dat", "HMQV P-384", t);
BenchMarkKeyAgreement<ECHMQV512>(CRYPTOPP_DATA_DIR "TestData/hmqv512.dat", "HMQV P-512", t);
BenchMarkKeyAgreement<ECFHMQV160>(CRYPTOPP_DATA_DIR "TestData/fhmqv160.dat", "FHMQV P-160", t);
BenchMarkKeyAgreement<ECFHMQV256>(CRYPTOPP_DATA_DIR "TestData/fhmqv256.dat", "FHMQV P-256", t);
BenchMarkKeyAgreement<ECFHMQV384>(CRYPTOPP_DATA_DIR "TestData/fhmqv384.dat", "FHMQV P-384", t);
BenchMarkKeyAgreement<ECFHMQV512>(CRYPTOPP_DATA_DIR "TestData/fhmqv512.dat", "FHMQV P-512", t);
#if CRYPTOPP_AESNI_AVAILABLE
if (HasCLMUL())
BenchMarkByName2<AuthenticatedSymmetricCipher, MessageAuthenticationCode>("AES/GCM", 0, "GMAC(AES)");
else
#elif CRYPTOPP_ARM_PMULL_AVAILABLE
if (HasPMULL())
BenchMarkByName2<AuthenticatedSymmetricCipher, MessageAuthenticationCode>("AES/GCM", 0, "GMAC(AES)");
else
#elif CRYPTOPP_POWER8_VMULL_AVAILABLE
if (HasPMULL())
BenchMarkByName2<AuthenticatedSymmetricCipher, MessageAuthenticationCode>("AES/GCM", 0, "GMAC(AES)");
else
#endif
{
BenchMarkByName2<AuthenticatedSymmetricCipher, MessageAuthenticationCode>("AES/GCM", 0, "GMAC(AES) (2K tables)", MakeParameters(Name::TableSize(), 2048));
BenchMarkByName2<AuthenticatedSymmetricCipher, MessageAuthenticationCode>("AES/GCM", 0, "GMAC(AES) (64K tables)", MakeParameters(Name::TableSize(), 64 * 1024));
}
BenchMarkByName<MessageAuthenticationCode>("VMAC(AES)-64");
BenchMarkByName<MessageAuthenticationCode>("VMAC(AES)-128");
BenchMarkByName<MessageAuthenticationCode>("HMAC(SHA-1)");
BenchMarkByName<MessageAuthenticationCode>("HMAC(SHA-256)");
BenchMarkByName<MessageAuthenticationCode>("Two-Track-MAC");
BenchMarkByName<MessageAuthenticationCode>("CMAC(AES)");
BenchMarkByName<MessageAuthenticationCode>("DMAC(AES)");
BenchMarkByName<MessageAuthenticationCode>("Poly1305(AES)");
BenchMarkByName<MessageAuthenticationCode>("Poly1305TLS");
BenchMarkByName<MessageAuthenticationCode>("BLAKE2s");
BenchMarkByName<MessageAuthenticationCode>("BLAKE2b");
BenchMarkByName<MessageAuthenticationCode>("SipHash-2-4");
BenchMarkByName<MessageAuthenticationCode>("SipHash-4-8");
}
std::cout << "\n<TBODY style=\"background: yellow;\">";
{
ECIES<ECP>::Decryptor cpriv(Test::GlobalRNG(), ASN1::secp256k1());
ECIES<ECP>::Encryptor cpub(cpriv);
ECDSA<ECP, SHA1>::Signer spriv(cpriv);
ECDSA<ECP, SHA1>::Verifier spub(spriv);
ECDSA_RFC6979<ECP, SHA1>::Signer spriv2(cpriv);
ECDSA_RFC6979<ECP, SHA1>::Verifier spub2(spriv);
ECGDSA<ECP, SHA1>::Signer spriv3(Test::GlobalRNG(), ASN1::secp256k1());
ECGDSA<ECP, SHA1>::Verifier spub3(spriv3);
ECDH<ECP>::Domain ecdhc(ASN1::secp256k1());
ECMQV<ECP>::Domain ecmqvc(ASN1::secp256k1());
BenchMarkEncryption("ECIES over GF(p) 256", cpub, t);
BenchMarkDecryption("ECIES over GF(p) 256", cpriv, cpub, t);
BenchMarkSigning("ECDSA over GF(p) 256", spriv, t);
BenchMarkVerification("ECDSA over GF(p) 256", spriv, spub, t);
BenchMarkSigning("ECDSA-RFC6979 over GF(p) 256", spriv2, t);
BenchMarkVerification("ECDSA-RFC6979 over GF(p) 256", spriv2, spub2, t);
BenchMarkSigning("ECGDSA over GF(p) 256", spriv3, t);
BenchMarkVerification("ECGDSA over GF(p) 256", spriv3, spub3, t);
BenchMarkKeyGen("ECDHC over GF(p) 256", ecdhc, t);
BenchMarkAgreement("ECDHC over GF(p) 256", ecdhc, t);
BenchMarkKeyGen("ECMQVC over GF(p) 256", ecmqvc, t);
BenchMarkAgreement("ECMQVC over GF(p) 256", ecmqvc, t);
BenchMarkByName<SymmetricCipher>("Panama-LE");
BenchMarkByName<SymmetricCipher>("Panama-BE");
BenchMarkByName<SymmetricCipher>("Salsa20", 0, "Salsa20");
BenchMarkByName<SymmetricCipher>("Salsa20", 0, "Salsa20/12", MakeParameters(Name::Rounds(), 12));
BenchMarkByName<SymmetricCipher>("Salsa20", 0, "Salsa20/8", MakeParameters(Name::Rounds(), 8));
BenchMarkByName<SymmetricCipher>("ChaCha", 0, "ChaCha20");
BenchMarkByName<SymmetricCipher>("ChaCha", 0, "ChaCha12", MakeParameters(Name::Rounds(), 12));
BenchMarkByName<SymmetricCipher>("ChaCha", 0, "ChaCha8", MakeParameters(Name::Rounds(), 8));
BenchMarkByName<SymmetricCipher>("ChaChaTLS");
BenchMarkByName<SymmetricCipher>("Sosemanuk");
BenchMarkByName<SymmetricCipher>("Rabbit");
BenchMarkByName<SymmetricCipher>("RabbitWithIV");
BenchMarkByName<SymmetricCipher>("HC-128");
BenchMarkByName<SymmetricCipher>("HC-256");
BenchMarkByName<SymmetricCipher>("MARC4");
BenchMarkByName<SymmetricCipher>("SEAL-3.0-LE");
BenchMarkByName<SymmetricCipher>("WAKE-OFB-LE");
}
std::cout << "\n<TBODY style=\"background: white;\">";
{
ECIES<EC2N>::Decryptor cpriv(Test::GlobalRNG(), ASN1::sect233r1());
ECIES<EC2N>::Encryptor cpub(cpriv);
ECDSA<EC2N, SHA1>::Signer spriv(cpriv);
ECDSA<EC2N, SHA1>::Verifier spub(spriv);
ECDSA_RFC6979<EC2N, SHA1>::Signer spriv2(cpriv);
ECDSA_RFC6979<EC2N, SHA1>::Verifier spub2(spriv);
ECGDSA<EC2N, SHA1>::Signer spriv3(Test::GlobalRNG(), ASN1::sect233r1());
ECGDSA<EC2N, SHA1>::Verifier spub3(spriv3);
ECDH<EC2N>::Domain ecdhc(ASN1::sect233r1());
ECMQV<EC2N>::Domain ecmqvc(ASN1::sect233r1());
BenchMarkByName<SymmetricCipher>("AES/CTR", 16);
BenchMarkByName<SymmetricCipher>("AES/CTR", 24);
BenchMarkByName<SymmetricCipher>("AES/CTR", 32);
BenchMarkByName<SymmetricCipher>("AES/CBC", 16);
BenchMarkByName<SymmetricCipher>("AES/CBC", 24);
BenchMarkByName<SymmetricCipher>("AES/CBC", 32);
BenchMarkByName<SymmetricCipher>("AES/XTS", 32);
BenchMarkByName<SymmetricCipher>("AES/XTS", 48);
BenchMarkByName<SymmetricCipher>("AES/XTS", 64);
BenchMarkByName<SymmetricCipher>("AES/OFB", 16);
BenchMarkByName<SymmetricCipher>("AES/CFB", 16);
BenchMarkByName<SymmetricCipher>("AES/ECB", 16);
BenchMarkByName<SymmetricCipher>("ARIA/CTR", 16);
BenchMarkByName<SymmetricCipher>("ARIA/CTR", 32);
BenchMarkByName<SymmetricCipher>("HIGHT/CTR");
BenchMarkByName<SymmetricCipher>("Camellia/CTR", 16);
BenchMarkByName<SymmetricCipher>("Camellia/CTR", 32);
BenchMarkByName<SymmetricCipher>("Twofish/CTR");
BenchMarkByName<SymmetricCipher>("Threefish-256(256)/CTR", 32);
BenchMarkByName<SymmetricCipher>("Threefish-512(512)/CTR", 64);
BenchMarkByName<SymmetricCipher>("Threefish-1024(1024)/CTR", 128);
BenchMarkByName<SymmetricCipher>("Serpent/CTR");
BenchMarkByName<SymmetricCipher>("CAST-128/CTR");
BenchMarkByName<SymmetricCipher>("CAST-256/CTR", 32);
BenchMarkByName<SymmetricCipher>("RC6/CTR");
BenchMarkByName<SymmetricCipher>("MARS/CTR");
BenchMarkByName<SymmetricCipher>("SHACAL-2/CTR", 16);
BenchMarkByName<SymmetricCipher>("SHACAL-2/CTR", 64);
BenchMarkByName<SymmetricCipher>("DES/CTR");
BenchMarkByName<SymmetricCipher>("DES-XEX3/CTR");
BenchMarkByName<SymmetricCipher>("DES-EDE3/CTR");
BenchMarkByName<SymmetricCipher>("IDEA/CTR");
BenchMarkByName<SymmetricCipher>("RC5/CTR", 0, "RC5 (r=16)");
BenchMarkByName<SymmetricCipher>("Blowfish/CTR");
BenchMarkByName<SymmetricCipher>("SKIPJACK/CTR");
BenchMarkByName<SymmetricCipher>("SEED/CTR", 0, "SEED/CTR (1/2 K table)");
BenchMarkByName<SymmetricCipher>("SM4/CTR");
BenchMarkEncryption("ECIES over GF(2^n) 233", cpub, t);
BenchMarkDecryption("ECIES over GF(2^n) 233", cpriv, cpub, t);
BenchMarkSigning("ECDSA over GF(2^n) 233", spriv, t);
BenchMarkVerification("ECDSA over GF(2^n) 233", spriv, spub, t);
BenchMarkSigning("ECDSA-RFC6979 over GF(2^n) 233", spriv2, t);
BenchMarkVerification("ECDSA-RFC6979 over GF(2^n) 233", spriv2, spub2, t);
BenchMarkSigning("ECGDSA over GF(2^n) 233", spriv3, t);
BenchMarkVerification("ECGDSA over GF(2^n) 233", spriv3, spub3, t);
BenchMarkKeyGen("ECDHC over GF(2^n) 233", ecdhc, t);
BenchMarkAgreement("ECDHC over GF(2^n) 233", ecdhc, t);
BenchMarkKeyGen("ECMQVC over GF(2^n) 233", ecmqvc, t);
BenchMarkAgreement("ECMQVC over GF(2^n) 233", ecmqvc, t);
BenchMarkByName<SymmetricCipher>("Kalyna-128/CTR", 16, "Kalyna-128(128)/CTR (128-bit key)");
BenchMarkByName<SymmetricCipher>("Kalyna-128/CTR", 32, "Kalyna-128(256)/CTR (256-bit key)");
BenchMarkByName<SymmetricCipher>("Kalyna-256/CTR", 32, "Kalyna-256(256)/CTR (256-bit key)");
BenchMarkByName<SymmetricCipher>("Kalyna-256/CTR", 64, "Kalyna-256(512)/CTR (512-bit key)");
BenchMarkByName<SymmetricCipher>("Kalyna-512/CTR", 64, "Kalyna-512(512)/CTR (512-bit key)");
}
std::cout << "\n<TBODY style=\"background: yellow;\">";
{
BenchMarkByName<SymmetricCipher>("CHAM-64/CTR", 16, "CHAM-64(128)/CTR (128-bit key)");
BenchMarkByName<SymmetricCipher>("CHAM-128/CTR", 16, "CHAM-128(128)/CTR (128-bit key)");
BenchMarkByName<SymmetricCipher>("CHAM-128/CTR", 32, "CHAM-128(256)/CTR (256-bit key)");
BenchMarkByName<SymmetricCipher>("LEA-128/CTR", 16, "LEA-128(128)/CTR (128-bit key)");
BenchMarkByName<SymmetricCipher>("LEA-128/CTR", 24, "LEA-128(192)/CTR (192-bit key)");
BenchMarkByName<SymmetricCipher>("LEA-128/CTR", 32, "LEA-128(256)/CTR (256-bit key)");
BenchMarkByName<SymmetricCipher>("SIMECK-32/CTR", 8, "SIMECK-32(64)/CTR (64-bit key)");
BenchMarkByName<SymmetricCipher>("SIMECK-64/CTR", 16, "SIMECK-64(128)/CTR (128-bit key)");
BenchMarkByName<SymmetricCipher>("SIMON-64/CTR", 12, "SIMON-64(96)/CTR (96-bit key)");
BenchMarkByName<SymmetricCipher>("SIMON-64/CTR", 16, "SIMON-64(128)/CTR (128-bit key)");
BenchMarkByName<SymmetricCipher>("SIMON-128/CTR", 16, "SIMON-128(128)/CTR (128-bit key)");
BenchMarkByName<SymmetricCipher>("SIMON-128/CTR", 24, "SIMON-128(192)/CTR (192-bit key)");
BenchMarkByName<SymmetricCipher>("SIMON-128/CTR", 32, "SIMON-128(256)/CTR (256-bit key)");
BenchMarkByName<SymmetricCipher>("SPECK-64/CTR", 12, "SPECK-64(96)/CTR (96-bit key)");
BenchMarkByName<SymmetricCipher>("SPECK-64/CTR", 16, "SPECK-64(128)/CTR (128-bit key)");
BenchMarkByName<SymmetricCipher>("SPECK-128/CTR", 16, "SPECK-128(128)/CTR (128-bit key)");
BenchMarkByName<SymmetricCipher>("SPECK-128/CTR", 24, "SPECK-128(192)/CTR (192-bit key)");
BenchMarkByName<SymmetricCipher>("SPECK-128/CTR", 32, "SPECK-128(256)/CTR (256-bit key)");
BenchMarkByName<SymmetricCipher>("TEA/CTR");
BenchMarkByName<SymmetricCipher>("XTEA/CTR");
}
std::cout << "\n<TBODY style=\"background: white;\">";
{
#if CRYPTOPP_AESNI_AVAILABLE
if (HasCLMUL())
BenchMarkByName2<AuthenticatedSymmetricCipher, AuthenticatedSymmetricCipher>("AES/GCM", 0, "AES/GCM");
else
#elif CRYPTOPP_ARM_PMULL_AVAILABLE
if (HasPMULL())
BenchMarkByName2<AuthenticatedSymmetricCipher, AuthenticatedSymmetricCipher>("AES/GCM", 0, "AES/GCM");
else
#elif CRYPTOPP_POWER8_VMULL_AVAILABLE
if (HasPMULL())
BenchMarkByName2<AuthenticatedSymmetricCipher, AuthenticatedSymmetricCipher>("AES/GCM", 0, "AES/GCM");
else
#endif
{
BenchMarkByName2<AuthenticatedSymmetricCipher, AuthenticatedSymmetricCipher>("AES/GCM", 0, "AES/GCM (2K tables)", MakeParameters(Name::TableSize(), 2048));
BenchMarkByName2<AuthenticatedSymmetricCipher, AuthenticatedSymmetricCipher>("AES/GCM", 0, "AES/GCM (64K tables)", MakeParameters(Name::TableSize(), 64 * 1024));
}
BenchMarkByName2<AuthenticatedSymmetricCipher, AuthenticatedSymmetricCipher>("AES/CCM");
BenchMarkByName2<AuthenticatedSymmetricCipher, AuthenticatedSymmetricCipher>("AES/EAX");
BenchMarkByName2<AuthenticatedSymmetricCipher, AuthenticatedSymmetricCipher>("ChaCha20/Poly1305");
BenchMarkByName2<AuthenticatedSymmetricCipher, AuthenticatedSymmetricCipher>("XChaCha20/Poly1305");
}
std::cout << "\n</TABLE>" << std::endl;

View File

@ -0,0 +1,480 @@
// bench3.cpp - originally written and placed in the public domain by Wei Dai
// CryptoPP::Test namespace added by JW in February 2017
#include "cryptlib.h"
#include "bench.h"
#include "validate.h"
#include "cpu.h"
#include "factory.h"
#include "algparam.h"
#include "argnames.h"
#include "smartptr.h"
#include "stdcpp.h"
#include "pubkey.h"
#include "gfpcrypt.h"
#include "eccrypto.h"
#include "pkcspad.h"
#include "files.h"
#include "filters.h"
#include "hex.h"
#include "rsa.h"
#include "nr.h"
#include "dsa.h"
#include "luc.h"
#include "rw.h"
#include "ecp.h"
#include "ec2n.h"
#include "asn.h"
#include "dh.h"
#include "mqv.h"
#include "hmqv.h"
#include "fhmqv.h"
#include "xed25519.h"
#include "xtrcrypt.h"
#include "esign.h"
#include "pssr.h"
#include "oids.h"
#include "randpool.h"
#include "stdcpp.h"
#include "hrtimer.h"
#if CRYPTOPP_MSC_VERSION
# pragma warning(disable: 4505 4355)
#endif
NAMESPACE_BEGIN(CryptoPP)
NAMESPACE_BEGIN(Test)
void BenchMarkEncryption(const char *name, PK_Encryptor &key, double timeTotal, bool pc = false)
{
unsigned int len = 16;
SecByteBlock plaintext(len), ciphertext(key.CiphertextLength(len));
Test::GlobalRNG().GenerateBlock(plaintext, len);
unsigned int i = 0;
double timeTaken;
ThreadUserTimer timer;
timer.StartTimer();
do
{
key.Encrypt(Test::GlobalRNG(), plaintext, len, ciphertext);
++i; timeTaken = timer.ElapsedTimeAsDouble();
}
while (timeTaken < timeTotal);
std::string provider = key.AlgorithmProvider();
OutputResultOperations(name, provider.c_str(), "Encryption", pc, i, timeTaken);
if (!pc && key.GetMaterial().SupportsPrecomputation())
{
key.AccessMaterial().Precompute(16);
BenchMarkEncryption(name, key, timeTotal, true);
}
}
void BenchMarkDecryption(const char *name, PK_Decryptor &priv, PK_Encryptor &pub, double timeTotal)
{
unsigned int len = 16;
SecByteBlock ciphertext(pub.CiphertextLength(len));
SecByteBlock plaintext(pub.MaxPlaintextLength(ciphertext.size()));
Test::GlobalRNG().GenerateBlock(plaintext, len);
pub.Encrypt(Test::GlobalRNG(), plaintext, len, ciphertext);
unsigned int i = 0;
double timeTaken;
ThreadUserTimer timer;
timer.StartTimer();
do
{
priv.Decrypt(Test::GlobalRNG(), ciphertext, ciphertext.size(), plaintext);
++i; timeTaken = timer.ElapsedTimeAsDouble();
}
while (timeTaken < timeTotal);
std::string provider = priv.AlgorithmProvider();
OutputResultOperations(name, provider.c_str(), "Decryption", false, i, timeTaken);
}
void BenchMarkSigning(const char *name, PK_Signer &key, double timeTotal, bool pc=false)
{
unsigned int len = 16;
AlignedSecByteBlock message(len), signature(key.SignatureLength());
Test::GlobalRNG().GenerateBlock(message, len);
unsigned int i = 0;
double timeTaken;
ThreadUserTimer timer;
timer.StartTimer();
do
{
(void)key.SignMessage(Test::GlobalRNG(), message, len, signature);
++i; timeTaken = timer.ElapsedTimeAsDouble();
}
while (timeTaken < timeTotal);
std::string provider = key.AlgorithmProvider();
OutputResultOperations(name, provider.c_str(), "Signature", pc, i, timeTaken);
if (!pc && key.GetMaterial().SupportsPrecomputation())
{
key.AccessMaterial().Precompute(16);
BenchMarkSigning(name, key, timeTotal, true);
}
}
void BenchMarkVerification(const char *name, const PK_Signer &priv, PK_Verifier &pub, double timeTotal, bool pc=false)
{
unsigned int len = 16;
AlignedSecByteBlock message(len), signature(pub.SignatureLength());
Test::GlobalRNG().GenerateBlock(message, len);
priv.SignMessage(Test::GlobalRNG(), message, len, signature);
unsigned int i = 0;
double timeTaken;
ThreadUserTimer timer;
timer.StartTimer();
do
{
(void)pub.VerifyMessage(message, len, signature, signature.size());
++i; timeTaken = timer.ElapsedTimeAsDouble();
}
while (timeTaken < timeTotal);
std::string provider = pub.AlgorithmProvider();
OutputResultOperations(name, provider.c_str(), "Verification", pc, i, timeTaken);
if (!pc && pub.GetMaterial().SupportsPrecomputation())
{
pub.AccessMaterial().Precompute(16);
BenchMarkVerification(name, priv, pub, timeTotal, true);
}
}
void BenchMarkKeyGen(const char *name, SimpleKeyAgreementDomain &d, double timeTotal, bool pc=false)
{
SecByteBlock priv(d.PrivateKeyLength()), pub(d.PublicKeyLength());
unsigned int i = 0;
double timeTaken;
ThreadUserTimer timer;
timer.StartTimer();
do
{
d.GenerateKeyPair(Test::GlobalRNG(), priv, pub);
++i; timeTaken = timer.ElapsedTimeAsDouble();
}
while (timeTaken < timeTotal);
std::string provider = d.AlgorithmProvider();
OutputResultOperations(name, provider.c_str(), "Key-Pair Generation", pc, i, timeTaken);
if (!pc && d.GetMaterial().SupportsPrecomputation())
{
d.AccessMaterial().Precompute(16);
BenchMarkKeyGen(name, d, timeTotal, true);
}
}
void BenchMarkKeyGen(const char *name, AuthenticatedKeyAgreementDomain &d, double timeTotal, bool pc=false)
{
SecByteBlock priv(d.EphemeralPrivateKeyLength()), pub(d.EphemeralPublicKeyLength());
unsigned int i = 0;
double timeTaken;
ThreadUserTimer timer;
timer.StartTimer();
do
{
d.GenerateEphemeralKeyPair(Test::GlobalRNG(), priv, pub);
++i; timeTaken = timer.ElapsedTimeAsDouble();
}
while (timeTaken < timeTotal);
std::string provider = d.AlgorithmProvider();
OutputResultOperations(name, provider.c_str(), "Key-Pair Generation", pc, i, timeTaken);
if (!pc && d.GetMaterial().SupportsPrecomputation())
{
d.AccessMaterial().Precompute(16);
BenchMarkKeyGen(name, d, timeTotal, true);
}
}
void BenchMarkAgreement(const char *name, SimpleKeyAgreementDomain &d, double timeTotal, bool pc=false)
{
SecByteBlock priv1(d.PrivateKeyLength()), priv2(d.PrivateKeyLength());
SecByteBlock pub1(d.PublicKeyLength()), pub2(d.PublicKeyLength());
d.GenerateKeyPair(Test::GlobalRNG(), priv1, pub1);
d.GenerateKeyPair(Test::GlobalRNG(), priv2, pub2);
SecByteBlock val(d.AgreedValueLength());
unsigned int i = 0;
double timeTaken;
ThreadUserTimer timer;
timer.StartTimer();
do
{
d.Agree(val, priv1, pub2);
d.Agree(val, priv2, pub1);
i+=2; timeTaken = timer.ElapsedTimeAsDouble();
}
while (timeTaken < timeTotal);
std::string provider = d.AlgorithmProvider();
OutputResultOperations(name, provider.c_str(), "Key Agreement", pc, i, timeTaken);
}
void BenchMarkAgreement(const char *name, AuthenticatedKeyAgreementDomain &d, double timeTotal, bool pc=false)
{
SecByteBlock spriv1(d.StaticPrivateKeyLength()), spriv2(d.StaticPrivateKeyLength());
SecByteBlock epriv1(d.EphemeralPrivateKeyLength()), epriv2(d.EphemeralPrivateKeyLength());
SecByteBlock spub1(d.StaticPublicKeyLength()), spub2(d.StaticPublicKeyLength());
SecByteBlock epub1(d.EphemeralPublicKeyLength()), epub2(d.EphemeralPublicKeyLength());
d.GenerateStaticKeyPair(Test::GlobalRNG(), spriv1, spub1);
d.GenerateStaticKeyPair(Test::GlobalRNG(), spriv2, spub2);
d.GenerateEphemeralKeyPair(Test::GlobalRNG(), epriv1, epub1);
d.GenerateEphemeralKeyPair(Test::GlobalRNG(), epriv2, epub2);
SecByteBlock val(d.AgreedValueLength());
unsigned int i = 0;
double timeTaken;
ThreadUserTimer timer;
timer.StartTimer();
do
{
d.Agree(val, spriv1, epriv1, spub2, epub2);
d.Agree(val, spriv2, epriv2, spub1, epub1);
i+=2; timeTaken = timer.ElapsedTimeAsDouble();
}
while (timeTaken < timeTotal);
std::string provider = d.AlgorithmProvider();
OutputResultOperations(name, provider.c_str(), "Key Agreement", pc, i, timeTaken);
}
template <class SCHEME>
void BenchMarkCrypto(const char *filename, const char *name, double timeTotal)
{
FileSource f(DataDir(filename).c_str(), true, new HexDecoder);
typename SCHEME::Decryptor priv(f);
typename SCHEME::Encryptor pub(priv);
BenchMarkEncryption(name, pub, timeTotal);
BenchMarkDecryption(name, priv, pub, timeTotal);
}
template <class SCHEME>
void BenchMarkSignature(const char *filename, const char *name, double timeTotal)
{
FileSource f(DataDir(filename).c_str(), true, new HexDecoder);
typename SCHEME::Signer priv(f);
typename SCHEME::Verifier pub(priv);
BenchMarkSigning(name, priv, timeTotal);
BenchMarkVerification(name, priv, pub, timeTotal);
}
template <class D>
void BenchMarkKeyAgreement(const char *filename, const char *name, double timeTotal)
{
FileSource f(DataDir(filename).c_str(), true, new HexDecoder);
D d(f);
BenchMarkKeyGen(name, d, timeTotal);
BenchMarkAgreement(name, d, timeTotal);
}
void BenchmarkPublicKeyAlgorithms(double t, double hertz)
{
g_allocatedTime = t;
g_hertz = hertz;
const char *mco;
if (g_hertz > 1.0f)
mco = "<TH>Megacycles/Operation";
else
mco = "";
std::cout << "\n<TABLE>";
std::cout << "\n<COLGROUP><COL style=\"text-align: left;\"><COL style=";
std::cout << "\"text-align: right;\"><COL style=\"text-align: right;\">";
std::cout << "\n<THEAD style=\"background: #F0F0F0\">";
std::cout << "\n<TR><TH>Operation<TH>Milliseconds/Operation" << mco;
std::cout << "\n<TBODY style=\"background: white;\">";
{
BenchMarkCrypto<RSAES<OAEP<SHA1> > >("TestData/rsa1024.dat", "RSA 1024", t);
BenchMarkCrypto<LUCES<OAEP<SHA1> > >("TestData/luc1024.dat", "LUC 1024", t);
BenchMarkCrypto<DLIES<> >("TestData/dlie1024.dat", "DLIES 1024", t);
BenchMarkCrypto<LUC_IES<> >("TestData/lucc512.dat", "LUCELG 512", t);
}
std::cout << "\n<TBODY style=\"background: yellow;\">";
{
BenchMarkCrypto<RSAES<OAEP<SHA1> > >("TestData/rsa2048.dat", "RSA 2048", t);
BenchMarkCrypto<LUCES<OAEP<SHA1> > >("TestData/luc2048.dat", "LUC 2048", t);
BenchMarkCrypto<DLIES<> >("TestData/dlie2048.dat", "DLIES 2048", t);
BenchMarkCrypto<LUC_IES<> >("TestData/lucc1024.dat", "LUCELG 1024", t);
}
std::cout << "\n<TBODY style=\"background: white;\">";
{
BenchMarkSignature<RSASS<PSSR, SHA1> >("TestData/rsa1024.dat", "RSA 1024", t);
BenchMarkSignature<RWSS<PSSR, SHA1> >("TestData/rw1024.dat", "RW 1024", t);
BenchMarkSignature<LUCSS<PSSR, SHA1> >("TestData/luc1024.dat", "LUC 1024", t);
BenchMarkSignature<NR<SHA1> >("TestData/nr1024.dat", "NR 1024", t);
BenchMarkSignature<DSA>("TestData/dsa1024.dat", "DSA 1024", t);
BenchMarkSignature<LUC_HMP<SHA1> >("TestData/lucs512.dat", "LUC-HMP 512", t);
BenchMarkSignature<ESIGN<SHA1> >("TestData/esig1023.dat", "ESIGN 1023", t);
BenchMarkSignature<ESIGN<SHA1> >("TestData/esig1536.dat", "ESIGN 1536", t);
}
std::cout << "\n<TBODY style=\"background: yellow;\">";
{
BenchMarkSignature<RSASS<PSSR, SHA1> >("TestData/rsa2048.dat", "RSA 2048", t);
BenchMarkSignature<RWSS<PSSR, SHA1> >("TestData/rw2048.dat", "RW 2048", t);
BenchMarkSignature<LUCSS<PSSR, SHA1> >("TestData/luc2048.dat", "LUC 2048", t);
BenchMarkSignature<NR<SHA1> >("TestData/nr2048.dat", "NR 2048", t);
BenchMarkSignature<LUC_HMP<SHA1> >("TestData/lucs1024.dat", "LUC-HMP 1024", t);
BenchMarkSignature<ESIGN<SHA1> >("TestData/esig2046.dat", "ESIGN 2046", t);
}
std::cout << "\n<TBODY style=\"background: white;\">";
{
BenchMarkKeyAgreement<XTR_DH>("TestData/xtrdh171.dat", "XTR-DH 171", t);
BenchMarkKeyAgreement<XTR_DH>("TestData/xtrdh342.dat", "XTR-DH 342", t);
BenchMarkKeyAgreement<DH>("TestData/dh1024.dat", "DH 1024", t);
BenchMarkKeyAgreement<DH>("TestData/dh2048.dat", "DH 2048", t);
BenchMarkKeyAgreement<LUC_DH>("TestData/lucd512.dat", "LUCDIF 512", t);
BenchMarkKeyAgreement<LUC_DH>("TestData/lucd1024.dat", "LUCDIF 1024", t);
BenchMarkKeyAgreement<MQV>("TestData/mqv1024.dat", "MQV 1024", t);
BenchMarkKeyAgreement<MQV>("TestData/mqv2048.dat", "MQV 2048", t);
}
std::cout << "\n</TABLE>" << std::endl;
}
void BenchmarkEllipticCurveAlgorithms(double t, double hertz)
{
g_allocatedTime = t;
g_hertz = hertz;
const char *mco;
if (g_hertz > 1.0f)
mco = "<TH>Megacycles/Operation";
else
mco = "";
std::cout << "\n<TABLE>";
std::cout << "\n<COLGROUP><COL style=\"text-align: left;\"><COL style=";
std::cout << "\"text-align: right;\"><COL style=\"text-align: right;\">";
std::cout << "\n<THEAD style=\"background: #F0F0F0\">";
std::cout << "\n<TR><TH>Operation<TH>Milliseconds/Operation" << mco;
std::cout << "\n<TBODY style=\"background: white;\">";
{
ed25519::Signer sign(Test::GlobalRNG());
ed25519::Verifier verify(sign);
x25519 agree(Test::GlobalRNG());
BenchMarkSigning("ed25519", sign, t);
BenchMarkVerification("ed25519", sign, verify, t);
BenchMarkKeyGen("x25519", agree, t);
BenchMarkAgreement("x25519", agree, t);
}
#if 0
std::cout << "\n<TBODY style=\"background: yellow;\">";
{
BenchMarkKeyAgreement<ECMQV160>("TestData/mqv160.dat", "MQV P-160", t);
BenchMarkKeyAgreement<ECMQV256>("TestData/mqv256.dat", "MQV P-256", t);
BenchMarkKeyAgreement<ECMQV384>("TestData/mqv384.dat", "MQV P-384", t);
BenchMarkKeyAgreement<ECMQV512>("TestData/mqv512.dat", "MQV P-521", t);
BenchMarkKeyAgreement<ECHMQV160>("TestData/hmqv160.dat", "HMQV P-160", t);
BenchMarkKeyAgreement<ECHMQV256>("TestData/hmqv256.dat", "HMQV P-256", t);
BenchMarkKeyAgreement<ECHMQV384>("TestData/hmqv384.dat", "HMQV P-384", t);
BenchMarkKeyAgreement<ECHMQV512>("TestData/hmqv512.dat", "HMQV P-521", t);
BenchMarkKeyAgreement<ECFHMQV160>("TestData/fhmqv160.dat", "FHMQV P-160", t);
BenchMarkKeyAgreement<ECFHMQV256>("TestData/fhmqv256.dat", "FHMQV P-256", t);
BenchMarkKeyAgreement<ECFHMQV384>("TestData/fhmqv384.dat", "FHMQV P-384", t);
BenchMarkKeyAgreement<ECFHMQV512>("TestData/fhmqv512.dat", "FHMQV P-521", t);
}
#endif
std::cout << "\n<TBODY style=\"background: yellow;\">";
{
ECIES<ECP>::Decryptor cpriv(Test::GlobalRNG(), ASN1::secp256k1());
ECIES<ECP>::Encryptor cpub(cpriv);
ECDSA<ECP, SHA1>::Signer spriv(cpriv);
ECDSA<ECP, SHA1>::Verifier spub(spriv);
ECDSA_RFC6979<ECP, SHA1>::Signer spriv2(cpriv);
ECDSA_RFC6979<ECP, SHA1>::Verifier spub2(spriv2);
ECGDSA<ECP, SHA1>::Signer spriv3(Test::GlobalRNG(), ASN1::secp256k1());
ECGDSA<ECP, SHA1>::Verifier spub3(spriv3);
ECDH<ECP>::Domain ecdhc(ASN1::secp256k1());
ECMQV<ECP>::Domain ecmqvc(ASN1::secp256k1());
BenchMarkEncryption("ECIES over GF(p) 256", cpub, t);
BenchMarkDecryption("ECIES over GF(p) 256", cpriv, cpub, t);
BenchMarkSigning("ECDSA over GF(p) 256", spriv, t);
BenchMarkVerification("ECDSA over GF(p) 256", spriv, spub, t);
BenchMarkSigning("ECDSA-RFC6979 over GF(p) 256", spriv2, t);
BenchMarkVerification("ECDSA-RFC6979 over GF(p) 256", spriv2, spub2, t);
BenchMarkSigning("ECGDSA over GF(p) 256", spriv3, t);
BenchMarkVerification("ECGDSA over GF(p) 256", spriv3, spub3, t);
BenchMarkKeyGen("ECDHC over GF(p) 256", ecdhc, t);
BenchMarkAgreement("ECDHC over GF(p) 256", ecdhc, t);
BenchMarkKeyGen("ECMQVC over GF(p) 256", ecmqvc, t);
BenchMarkAgreement("ECMQVC over GF(p) 256", ecmqvc, t);
}
std::cout << "\n<TBODY style=\"background: white;\">";
{
ECIES<EC2N>::Decryptor cpriv(Test::GlobalRNG(), ASN1::sect233r1());
ECIES<EC2N>::Encryptor cpub(cpriv);
ECDSA<EC2N, SHA1>::Signer spriv(cpriv);
ECDSA<EC2N, SHA1>::Verifier spub(spriv);
ECDSA_RFC6979<EC2N, SHA1>::Signer spriv2(cpriv);
ECDSA_RFC6979<EC2N, SHA1>::Verifier spub2(spriv2);
ECGDSA<EC2N, SHA1>::Signer spriv3(Test::GlobalRNG(), ASN1::sect233r1());
ECGDSA<EC2N, SHA1>::Verifier spub3(spriv3);
ECDH<EC2N>::Domain ecdhc(ASN1::sect233r1());
ECMQV<EC2N>::Domain ecmqvc(ASN1::sect233r1());
BenchMarkEncryption("ECIES over GF(2^n) 233", cpub, t);
BenchMarkDecryption("ECIES over GF(2^n) 233", cpriv, cpub, t);
BenchMarkSigning("ECDSA over GF(2^n) 233", spriv, t);
BenchMarkVerification("ECDSA over GF(2^n) 233", spriv, spub, t);
BenchMarkSigning("ECDSA-RFC6979 over GF(2^n) 233", spriv2, t);
BenchMarkVerification("ECDSA-RFC6979 over GF(2^n) 233", spriv2, spub2, t);
BenchMarkSigning("ECGDSA over GF(2^n) 233", spriv3, t);
BenchMarkVerification("ECGDSA over GF(2^n) 233", spriv3, spub3, t);
BenchMarkKeyGen("ECDHC over GF(2^n) 233", ecdhc, t);
BenchMarkAgreement("ECDHC over GF(2^n) 233", ecdhc, t);
BenchMarkKeyGen("ECMQVC over GF(2^n) 233", ecmqvc, t);
BenchMarkAgreement("ECMQVC over GF(2^n) 233", ecmqvc, t);
}
std::cout << "\n</TABLE>" << std::endl;
}
NAMESPACE_END // Test
NAMESPACE_END // CryptoPP

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,17 @@
// blake2.cpp - written and placed in the public domain by Jeffrey Walton and Zooko
// Wilcox-O'Hearn. Based on Aumasson, Neves, Wilcox-O'Hearn and Winnerlein's
// reference BLAKE2 implementation at http://github.com/BLAKE2/BLAKE2.
// blake2.cpp - written and placed in the public domain by Jeffrey Walton
// and Zooko Wilcox-O'Hearn. Based on Aumasson, Neves,
// Wilcox-O'Hearn and Winnerlein's reference BLAKE2
// implementation at http://github.com/BLAKE2/BLAKE2.
//
// The BLAKE2b and BLAKE2s numbers are consistent with the BLAKE2 team's
// numbers. However, we have an Altivec implementation of BLAKE2s,
// and a POWER8 implementation of BLAKE2b (BLAKE2 team is missing them).
// Altivec code is about 2x faster than C++ when using GCC 5.0 or
// above. The POWER8 code is about 2.5x faster than C++ when using GCC 5.0
// or above. If you use GCC 4.0 (PowerMac) or GCC 4.8 (GCC Compile Farm)
// then the PowerPC code will be slower than C++. Be sure to use GCC 5.0
// or above for PowerPC builds or disable Altivec for BLAKE2b and BLAKE2s
// if using the old compilers.
#include "pch.h"
#include "config.h"
@ -11,9 +22,11 @@
#include "cpu.h"
// Uncomment for benchmarking C++ against SSE2 or NEON.
// Do so in both blake2.cpp and blake2-simd.cpp.
// Do so in both blake2.cpp and blake2_simd.cpp.
// #undef CRYPTOPP_SSE41_AVAILABLE
// #undef CRYPTOPP_ARM_NEON_AVAILABLE
// #undef CRYPTOPP_ALTIVEC_AVAILABLE
// #undef CRYPTOPP_POWER8_AVAILABLE
// Disable NEON/ASIMD for Cortex-A53 and A57. The shifts are too slow and C/C++ is about
// 3 cpb faster than NEON/ASIMD. Also see http://github.com/weidai11/cryptopp/issues/367.
@ -21,6 +34,47 @@
# undef CRYPTOPP_ARM_NEON_AVAILABLE
#endif
// BLAKE2s bug on AIX 7.1 (POWER7) with XLC 12.01
// https://github.com/weidai11/cryptopp/issues/743
#if defined(__xlC__) && (__xlC__ < 0x0d01)
# define CRYPTOPP_DISABLE_ALTIVEC 1
# undef CRYPTOPP_POWER7_AVAILABLE
# undef CRYPTOPP_POWER8_AVAILABLE
# undef CRYPTOPP_ALTIVEC_AVAILABLE
#endif
// Can't use GetAlignmentOf<word64>() because of C++11 and constexpr
// Can use 'const unsigned int' because of MSVC 2013
#if (CRYPTOPP_BOOL_X86 || CRYPTOPP_BOOL_X32 || CRYPTOPP_BOOL_X64)
# define ALIGN_SPEC32 16
# define ALIGN_SPEC64 16
#else
# define ALIGN_SPEC32 4
# define ALIGN_SPEC64 8
#endif
NAMESPACE_BEGIN(CryptoPP)
// Export the tables to the SIMD files
extern const word32 BLAKE2S_IV[8];
extern const word64 BLAKE2B_IV[8];
CRYPTOPP_ALIGN_DATA(ALIGN_SPEC32)
const word32 BLAKE2S_IV[8] = {
0x6A09E667UL, 0xBB67AE85UL, 0x3C6EF372UL, 0xA54FF53AUL,
0x510E527FUL, 0x9B05688CUL, 0x1F83D9ABUL, 0x5BE0CD19UL
};
CRYPTOPP_ALIGN_DATA(ALIGN_SPEC64)
const word64 BLAKE2B_IV[8] = {
W64LIT(0x6a09e667f3bcc908), W64LIT(0xbb67ae8584caa73b),
W64LIT(0x3c6ef372fe94f82b), W64LIT(0xa54ff53a5f1d36f1),
W64LIT(0x510e527fade682d1), W64LIT(0x9b05688c2b3e6c1f),
W64LIT(0x1f83d9abfb41bd6b), W64LIT(0x5be0cd19137e2179)
};
NAMESPACE_END
ANONYMOUS_NAMESPACE_BEGIN
using CryptoPP::byte;
@ -28,28 +82,7 @@ using CryptoPP::word32;
using CryptoPP::word64;
using CryptoPP::rotrConstant;
template <class W, bool T_64bit>
struct BLAKE2_IV
{
CRYPTOPP_ALIGN_DATA(16)
static const W iv[8];
};
template <>
const word32 BLAKE2_IV<word32, false>::iv[8] = {
0x6A09E667UL, 0xBB67AE85UL, 0x3C6EF372UL, 0xA54FF53AUL,
0x510E527FUL, 0x9B05688CUL, 0x1F83D9ABUL, 0x5BE0CD19UL
};
template <>
const word64 BLAKE2_IV<word64, true>::iv[8] = {
W64LIT(0x6a09e667f3bcc908), W64LIT(0xbb67ae8584caa73b),
W64LIT(0x3c6ef372fe94f82b), W64LIT(0xa54ff53a5f1d36f1),
W64LIT(0x510e527fade682d1), W64LIT(0x9b05688c2b3e6c1f),
W64LIT(0x1f83d9abfb41bd6b), W64LIT(0x5be0cd19137e2179)
};
CRYPTOPP_ALIGN_DATA(16)
CRYPTOPP_ALIGN_DATA(ALIGN_SPEC32)
const byte BLAKE2S_SIGMA[10][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 },
@ -63,7 +96,7 @@ const byte BLAKE2S_SIGMA[10][16] = {
{ 10, 2, 8, 4, 7, 6, 1, 5, 15, 11, 9, 14, 3, 12, 13 , 0 },
};
CRYPTOPP_ALIGN_DATA(16)
CRYPTOPP_ALIGN_DATA(ALIGN_SPEC32)
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 },
@ -135,346 +168,576 @@ ANONYMOUS_NAMESPACE_END
NAMESPACE_BEGIN(CryptoPP)
void BLAKE2_Compress32_CXX(const byte* input, BLAKE2_State<word32, false>& state);
void BLAKE2_Compress64_CXX(const byte* input, BLAKE2_State<word64, true>& state);
void BLAKE2_Compress32_CXX(const byte* input, BLAKE2s_State& state);
void BLAKE2_Compress64_CXX(const byte* input, BLAKE2b_State& state);
#if CRYPTOPP_SSE41_AVAILABLE
extern void BLAKE2_Compress32_SSE4(const byte* input, BLAKE2_State<word32, false>& state);
extern void BLAKE2_Compress64_SSE4(const byte* input, BLAKE2_State<word64, true>& state);
extern void BLAKE2_Compress32_SSE4(const byte* input, BLAKE2s_State& state);
extern void BLAKE2_Compress64_SSE4(const byte* input, BLAKE2b_State& state);
#endif
#if CRYPTOPP_ARM_NEON_AVAILABLE
extern void BLAKE2_Compress32_NEON(const byte* input, BLAKE2_State<word32, false>& state);
extern void BLAKE2_Compress64_NEON(const byte* input, BLAKE2_State<word64, true>& state);
extern void BLAKE2_Compress32_NEON(const byte* input, BLAKE2s_State& state);
extern void BLAKE2_Compress64_NEON(const byte* input, BLAKE2b_State& state);
#endif
BLAKE2_ParameterBlock<false>::BLAKE2_ParameterBlock(size_t digestLen, size_t keyLen,
#if CRYPTOPP_ALTIVEC_AVAILABLE
extern void BLAKE2_Compress32_ALTIVEC(const byte* input, BLAKE2s_State& state);
#endif
#if CRYPTOPP_POWER8_AVAILABLE
extern void BLAKE2_Compress64_POWER8(const byte* input, BLAKE2b_State& state);
#endif
unsigned int BLAKE2b::OptimalDataAlignment() const
{
#if defined(CRYPTOPP_SSE41_AVAILABLE)
if (HasSSE41())
return 16; // load __m128i
else
#endif
#if (CRYPTOPP_ARM_NEON_AVAILABLE)
if (HasNEON())
return 8; // load uint64x2_t
else
#endif
#if (CRYPTOPP_POWER8_AVAILABLE)
if (HasPower8())
return 16; // load vector long long
else
#endif
return GetAlignmentOf<word64>();
}
std::string BLAKE2b::AlgorithmProvider() const
{
#if defined(CRYPTOPP_SSE41_AVAILABLE)
if (HasSSE41())
return "SSE4.1";
else
#endif
#if (CRYPTOPP_ARM_NEON_AVAILABLE)
if (HasNEON())
return "NEON";
else
#endif
#if (CRYPTOPP_POWER8_AVAILABLE)
if (HasPower8())
return "Power8";
else
#endif
return "C++";
}
unsigned int BLAKE2s::OptimalDataAlignment() const
{
#if defined(CRYPTOPP_SSE41_AVAILABLE)
if (HasSSE41())
return 16; // load __m128i
else
#endif
#if (CRYPTOPP_ARM_NEON_AVAILABLE)
if (HasNEON())
return 4; // load uint32x4_t
else
#endif
#if (CRYPTOPP_ALTIVEC_AVAILABLE)
if (HasAltivec())
return 16; // load vector unsigned int
else
#endif
return GetAlignmentOf<word32>();
}
std::string BLAKE2s::AlgorithmProvider() const
{
#if defined(CRYPTOPP_SSE41_AVAILABLE)
if (HasSSE41())
return "SSE4.1";
else
#endif
#if (CRYPTOPP_ARM_NEON_AVAILABLE)
if (HasNEON())
return "NEON";
else
#endif
#if (CRYPTOPP_ALTIVEC_AVAILABLE)
if (HasAltivec())
return "Altivec";
else
#endif
return "C++";
}
void BLAKE2s_State::Reset()
{
std::memset(m_hft, 0x00, m_hft.SizeInBytes());
m_len = 0;
}
void BLAKE2b_State::Reset()
{
std::memset(m_hft, 0x00, m_hft.SizeInBytes());
m_len = 0;
}
BLAKE2s_ParameterBlock::BLAKE2s_ParameterBlock(size_t digestLen, size_t keyLen,
const byte* saltStr, size_t saltLen,
const byte* personalizationStr, size_t personalizationLen)
{
// Avoid Coverity finding SIZEOF_MISMATCH/suspicious_sizeof
digestLength = (byte)digestLen;
keyLength = (byte)keyLen;
fanout = depth = 1;
nodeDepth = innerLength = 0;
memset(leafLength, 0x00, COUNTOF(leafLength));
memset(nodeOffset, 0x00, COUNTOF(nodeOffset));
Reset(digestLen, keyLen);
if (saltStr && saltLen)
{
memcpy_s(salt, COUNTOF(salt), saltStr, saltLen);
const size_t rem = COUNTOF(salt) - saltLen;
const size_t off = COUNTOF(salt) - rem;
if (rem)
memset(salt+off, 0x00, rem);
}
else
{
memset(salt, 0x00, COUNTOF(salt));
}
memcpy_s(salt(), SALTSIZE, saltStr, saltLen);
if (personalizationStr && personalizationLen)
{
memcpy_s(personalization, COUNTOF(personalization), personalizationStr, personalizationLen);
const size_t rem = COUNTOF(personalization) - personalizationLen;
const size_t off = COUNTOF(personalization) - rem;
if (rem)
memset(personalization+off, 0x00, rem);
}
else
{
memset(personalization, 0x00, COUNTOF(personalization));
}
memcpy_s(personalization(), PERSONALIZATIONSIZE, personalizationStr, personalizationLen);
}
BLAKE2_ParameterBlock<true>::BLAKE2_ParameterBlock(size_t digestLen, size_t keyLen,
BLAKE2b_ParameterBlock::BLAKE2b_ParameterBlock(size_t digestLen, size_t keyLen,
const byte* saltStr, size_t saltLen,
const byte* personalizationStr, size_t personalizationLen)
{
// Avoid Coverity finding SIZEOF_MISMATCH/suspicious_sizeof
digestLength = (byte)digestLen;
keyLength = (byte)keyLen;
fanout = depth = 1;
nodeDepth = innerLength = 0;
memset(rfu, 0x00, COUNTOF(rfu));
memset(leafLength, 0x00, COUNTOF(leafLength));
memset(nodeOffset, 0x00, COUNTOF(nodeOffset));
Reset(digestLen, keyLen);
if (saltStr && saltLen)
{
memcpy_s(salt, COUNTOF(salt), saltStr, saltLen);
const size_t rem = COUNTOF(salt) - saltLen;
const size_t off = COUNTOF(salt) - rem;
if (rem)
memset(salt+off, 0x00, rem);
}
else
{
memset(salt, 0x00, COUNTOF(salt));
}
memcpy_s(salt(), SALTSIZE, saltStr, saltLen);
if (personalizationStr && personalizationLen)
{
memcpy_s(personalization, COUNTOF(personalization), personalizationStr, personalizationLen);
const size_t rem = COUNTOF(personalization) - personalizationLen;
const size_t off = COUNTOF(personalization) - rem;
if (rem)
memset(personalization+off, 0x00, rem);
}
else
{
memset(personalization, 0x00, COUNTOF(personalization));
}
memcpy_s(personalization(), PERSONALIZATIONSIZE, personalizationStr, personalizationLen);
}
template <class W, bool T_64bit>
void BLAKE2_Base<W, T_64bit>::UncheckedSetKey(const byte *key, unsigned int length, const CryptoPP::NameValuePairs& params)
void BLAKE2s_ParameterBlock::Reset(size_t digestLen, size_t keyLen)
{
if (key && length)
{
AlignedSecByteBlock temp(BLOCKSIZE);
memcpy_s(temp, BLOCKSIZE, key, length);
const size_t rem = BLOCKSIZE - length;
if (rem)
memset(temp+length, 0x00, rem);
m_key.swap(temp);
}
else
{
m_key.resize(0);
}
// Avoid Coverity finding SIZEOF_MISMATCH/suspicious_sizeof
ParameterBlock& block = *m_block.data();
memset(m_block.data(), 0x00, sizeof(ParameterBlock));
block.keyLength = (byte)length;
block.digestLength = (byte)params.GetIntValueWithDefault(Name::DigestSize(), DIGESTSIZE);
block.fanout = block.depth = 1;
ConstByteArrayParameter t;
if (params.GetValue(Name::Salt(), t) && t.begin() && t.size())
{
memcpy_s(block.salt, COUNTOF(block.salt), t.begin(), t.size());
const size_t rem = COUNTOF(block.salt) - t.size();
const size_t off = COUNTOF(block.salt) - rem;
if (rem)
memset(block.salt+off, 0x00, rem);
}
else
{
memset(block.salt, 0x00, COUNTOF(block.salt));
}
if (params.GetValue(Name::Personalization(), t) && t.begin() && t.size())
{
memcpy_s(block.personalization, COUNTOF(block.personalization), t.begin(), t.size());
const size_t rem = COUNTOF(block.personalization) - t.size();
const size_t off = COUNTOF(block.personalization) - rem;
if (rem)
memset(block.personalization+off, 0x00, rem);
}
else
{
memset(block.personalization, 0x00, COUNTOF(block.personalization));
}
std::memset(m_data, 0x00, m_data.size());
m_data[DigestOff] = static_cast<byte>(digestLen);
m_data[KeyOff] = static_cast<byte>(keyLen);
m_data[FanoutOff] = m_data[DepthOff] = 1;
}
template <class W, bool T_64bit>
BLAKE2_Base<W, T_64bit>::BLAKE2_Base() : m_state(1), m_block(1), m_digestSize(DIGESTSIZE), m_treeMode(false)
void BLAKE2b_ParameterBlock::Reset(size_t digestLen, size_t keyLen)
{
UncheckedSetKey(NULLPTR, 0, g_nullNameValuePairs);
Restart();
std::memset(m_data, 0x00, m_data.size());
m_data[DigestOff] = static_cast<byte>(digestLen);
m_data[KeyOff] = static_cast<byte>(keyLen);
m_data[FanoutOff] = m_data[DepthOff] = 1;
}
template <class W, bool T_64bit>
BLAKE2_Base<W, T_64bit>::BLAKE2_Base(bool treeMode, unsigned int digestSize) : m_state(1), m_block(1), m_digestSize(digestSize), m_treeMode(treeMode)
BLAKE2s::BLAKE2s(bool treeMode, unsigned int digestSize)
: m_digestSize(digestSize), m_keyLength(0), m_treeMode(treeMode)
{
CRYPTOPP_ASSERT(digestSize <= DIGESTSIZE);
UncheckedSetKey(NULLPTR, 0, MakeParameters(Name::DigestSize(), (int)digestSize)(Name::TreeMode(), treeMode, false));
Restart();
UncheckedSetKey(NULLPTR, 0, MakeParameters
(Name::DigestSize(), (int)digestSize)
(Name::TreeMode(), treeMode));
}
template <class W, bool T_64bit>
BLAKE2_Base<W, T_64bit>::BLAKE2_Base(const byte *key, size_t keyLength, const byte* salt, size_t saltLength,
BLAKE2b::BLAKE2b(bool treeMode, unsigned int digestSize)
: m_digestSize(digestSize), m_keyLength(0), m_treeMode(treeMode)
{
CRYPTOPP_ASSERT(digestSize <= DIGESTSIZE);
UncheckedSetKey(NULLPTR, 0, MakeParameters
(Name::DigestSize(), (int)digestSize)
(Name::TreeMode(), treeMode));
}
BLAKE2s::BLAKE2s(unsigned int digestSize)
: m_digestSize(digestSize), m_keyLength(0), m_treeMode(false)
{
CRYPTOPP_ASSERT(digestSize <= DIGESTSIZE);
UncheckedSetKey(NULLPTR, 0, MakeParameters
(Name::DigestSize(), (int)digestSize)
(Name::TreeMode(), false));
}
BLAKE2b::BLAKE2b(unsigned int digestSize)
: m_digestSize(digestSize), m_keyLength(0), m_treeMode(false)
{
CRYPTOPP_ASSERT(digestSize <= DIGESTSIZE);
UncheckedSetKey(NULLPTR, 0, MakeParameters
(Name::DigestSize(), (int)digestSize)
(Name::TreeMode(), false));
}
BLAKE2s::BLAKE2s(const byte *key, size_t keyLength, const byte* salt, size_t saltLength,
const byte* personalization, size_t personalizationLength, bool treeMode, unsigned int digestSize)
: m_state(1), m_block(1), m_digestSize(digestSize), m_treeMode(treeMode)
: m_digestSize(digestSize), m_keyLength(static_cast<unsigned int>(keyLength)), m_treeMode(treeMode)
{
CRYPTOPP_ASSERT(keyLength <= MAX_KEYLENGTH);
CRYPTOPP_ASSERT(digestSize <= DIGESTSIZE);
CRYPTOPP_ASSERT(saltLength <= SALTSIZE);
CRYPTOPP_ASSERT(personalizationLength <= PERSONALIZATIONSIZE);
UncheckedSetKey(key, static_cast<unsigned int>(keyLength), MakeParameters(Name::DigestSize(),(int)digestSize)(Name::TreeMode(),treeMode, false)
(Name::Salt(), ConstByteArrayParameter(salt, saltLength))(Name::Personalization(), ConstByteArrayParameter(personalization, personalizationLength)));
UncheckedSetKey(key, static_cast<unsigned int>(keyLength), MakeParameters
(Name::DigestSize(),(int)digestSize)
(Name::TreeMode(),treeMode)
(Name::Salt(), ConstByteArrayParameter(salt, saltLength))
(Name::Personalization(), ConstByteArrayParameter(personalization, personalizationLength)));
}
BLAKE2b::BLAKE2b(const byte *key, size_t keyLength, const byte* salt, size_t saltLength,
const byte* personalization, size_t personalizationLength, bool treeMode, unsigned int digestSize)
: m_digestSize(digestSize), m_keyLength(static_cast<unsigned int>(keyLength)), m_treeMode(treeMode)
{
CRYPTOPP_ASSERT(keyLength <= MAX_KEYLENGTH);
CRYPTOPP_ASSERT(digestSize <= DIGESTSIZE);
CRYPTOPP_ASSERT(saltLength <= SALTSIZE);
CRYPTOPP_ASSERT(personalizationLength <= PERSONALIZATIONSIZE);
UncheckedSetKey(key, static_cast<unsigned int>(keyLength), MakeParameters
(Name::DigestSize(),(int)digestSize)
(Name::TreeMode(),treeMode)
(Name::Salt(), ConstByteArrayParameter(salt, saltLength))
(Name::Personalization(), ConstByteArrayParameter(personalization, personalizationLength)));
}
void BLAKE2s::UncheckedSetKey(const byte *key, unsigned int length, const CryptoPP::NameValuePairs& params)
{
if (key && length)
{
m_key.New(BLOCKSIZE);
std::memcpy(m_key, key, length);
std::memset(m_key + length, 0x00, BLOCKSIZE - length);
m_keyLength = length;
}
else
{
m_key.resize(0);
m_keyLength = 0;
}
m_digestSize = static_cast<unsigned int>(params.GetIntValueWithDefault(
Name::DigestSize(), static_cast<int>(m_digestSize)));
m_state.Reset();
m_block.Reset(m_digestSize, m_keyLength);
(void)params.GetValue(Name::TreeMode(), m_treeMode);
ConstByteArrayParameter t;
if (params.GetValue(Name::Salt(), t) && t.begin() && t.size())
memcpy_s(m_block.salt(), SALTSIZE, t.begin(), t.size());
if (params.GetValue(Name::Personalization(), t) && t.begin() && t.size())
memcpy_s(m_block.personalization(), PERSONALIZATIONSIZE, t.begin(), t.size());
Restart();
}
template <class W, bool T_64bit>
void BLAKE2_Base<W, T_64bit>::Restart()
void BLAKE2b::UncheckedSetKey(const byte *key, unsigned int length, const CryptoPP::NameValuePairs& params)
{
static const W zero[2] = {0,0};
Restart(*m_block.data(), zero);
}
template <class W, bool T_64bit>
void BLAKE2_Base<W, T_64bit>::Restart(const BLAKE2_ParameterBlock<T_64bit>& block, const W counter[2])
{
// We take a parameter block as a parameter to allow customized state.
// Avoid the copy of the parameter block when we are passing our own block.
if (&block != m_block.data())
if (key && length)
{
memcpy_s(m_block.data(), sizeof(ParameterBlock), &block, sizeof(ParameterBlock));
m_block.data()->digestLength = (byte)m_digestSize;
m_block.data()->keyLength = (byte)m_key.size();
m_key.New(BLOCKSIZE);
std::memcpy(m_key, key, length);
std::memset(m_key + length, 0x00, BLOCKSIZE - length);
m_keyLength = length;
}
else
{
m_key.resize(0);
m_keyLength = 0;
}
State& state = *m_state.data();
state.t[0] = state.t[1] = 0, state.f[0] = state.f[1] = 0, state.length = 0;
m_digestSize = static_cast<unsigned int>(params.GetIntValueWithDefault(
Name::DigestSize(), static_cast<int>(m_digestSize)));
m_state.Reset();
m_block.Reset(m_digestSize, m_keyLength);
(void)params.GetValue(Name::TreeMode(), m_treeMode);
ConstByteArrayParameter t;
if (params.GetValue(Name::Salt(), t) && t.begin() && t.size())
memcpy_s(m_block.salt(), SALTSIZE, t.begin(), t.size());
if (params.GetValue(Name::Personalization(), t) && t.begin() && t.size())
memcpy_s(m_block.personalization(), PERSONALIZATIONSIZE, t.begin(), t.size());
Restart();
}
void BLAKE2s::Restart()
{
static const word32 zero[2] = {0,0};
Restart(m_block, zero);
}
void BLAKE2b::Restart()
{
static const word64 zero[2] = {0,0};
Restart(m_block, zero);
}
void BLAKE2s::Restart(const BLAKE2s_ParameterBlock& block, const word32 counter[2])
{
// We take a counter as a parameter to allow customized state.
m_state.Reset();
if (counter != NULLPTR)
{
state.t[0] = counter[0];
state.t[1] = counter[1];
word32* t = m_state.t();
t[0] = counter[0];
t[1] = counter[1];
}
const W* iv = BLAKE2_IV<W, T_64bit>::iv;
PutBlock<W, LittleEndian, true> put(m_block.data(), &state.h[0]);
// We take a parameter block as a parameter to allow customized state.
// Avoid the copy of the parameter block when we are passing our own block.
if (block.data() != m_block.data()) {
std::memcpy(m_block.data(), block.data(), m_block.size());
}
m_block.m_data[BLAKE2s_ParameterBlock::DigestOff] = (byte)m_digestSize;
m_block.m_data[BLAKE2s_ParameterBlock::KeyOff] = (byte)m_keyLength;
const word32* iv = BLAKE2S_IV;
PutBlock<word32, LittleEndian, true> put(m_block.data(), m_state.h());
put(iv[0])(iv[1])(iv[2])(iv[3])(iv[4])(iv[5])(iv[6])(iv[7]);
// When BLAKE2 is keyed, the input stream is simply {key||message}. Key it
// during Restart to avoid FirstPut and friends. Key size == 0 means no key.
if (m_key.size())
Update(m_key, m_key.size());
// When BLAKE2 is keyed, the input stream is simply {key || 0 || message}.
// The key is padded to a full Blocksize with 0. Key it during Restart to
// avoid FirstPut and friends. Key size == 0 means no key.
if (m_keyLength)
Update(m_key, BLOCKSIZE);
}
template <class W, bool T_64bit>
void BLAKE2_Base<W, T_64bit>::Update(const byte *input, size_t length)
void BLAKE2b::Restart(const BLAKE2b_ParameterBlock& block, const word64 counter[2])
{
State& state = *m_state.data();
if (state.length + length > BLOCKSIZE)
// We take a counter as a parameter to allow customized state.
m_state.Reset();
if (counter != NULLPTR)
{
// Complete current block
const size_t fill = BLOCKSIZE - state.length;
memcpy_s(&state.buffer[state.length], fill, input, fill);
word64* t = m_state.t();
t[0] = counter[0];
t[1] = counter[1];
}
IncrementCounter();
Compress(state.buffer);
state.length = 0;
// We take a parameter block as a parameter to allow customized state.
// Avoid the copy of the parameter block when we are passing our own block.
if (block.data() != m_block.data()) {
std::memcpy(m_block.data(), block.data(), m_block.size());
}
length -= fill, input += fill;
m_block.m_data[BLAKE2b_ParameterBlock::DigestOff] = (byte)m_digestSize;
m_block.m_data[BLAKE2b_ParameterBlock::KeyOff] = (byte)m_keyLength;
const word64* iv = BLAKE2B_IV;
PutBlock<word64, LittleEndian, true> put(m_block.data(), m_state.h());
put(iv[0])(iv[1])(iv[2])(iv[3])(iv[4])(iv[5])(iv[6])(iv[7]);
// When BLAKE2 is keyed, the input stream is simply {key || 0 || message}.
// The key is padded to a full Blocksize with 0. Key it during Restart to
// avoid FirstPut and friends. Key size == 0 means no key.
if (m_keyLength)
Update(m_key, BLOCKSIZE);
}
void BLAKE2s::Update(const byte *input, size_t length)
{
CRYPTOPP_ASSERT(input != NULLPTR || length == 0);
if (length > BLOCKSIZE - m_state.m_len)
{
if (m_state.m_len != 0)
{
// Complete current block
const size_t fill = BLOCKSIZE - m_state.m_len;
std::memcpy(m_state.m_buf+m_state.m_len, input, fill);
IncrementCounter(BLOCKSIZE);
Compress(m_state.m_buf);
m_state.m_len = 0;
length -= fill, input += fill;
}
// Compress in-place to avoid copies
while (length > BLOCKSIZE)
{
IncrementCounter();
IncrementCounter(BLOCKSIZE);
Compress(input);
length -= BLOCKSIZE, input += BLOCKSIZE;
}
}
// Copy tail bytes
if (input && length)
if (length)
{
CRYPTOPP_ASSERT(length <= BLOCKSIZE - state.length);
memcpy_s(&state.buffer[state.length], length, input, length);
state.length += static_cast<unsigned int>(length);
CRYPTOPP_ASSERT(length <= BLOCKSIZE - m_state.m_len);
std::memcpy(m_state.m_buf+m_state.m_len, input, length);
m_state.m_len += static_cast<unsigned int>(length);
}
}
template <class W, bool T_64bit>
void BLAKE2_Base<W, T_64bit>::TruncatedFinal(byte *hash, size_t size)
void BLAKE2b::Update(const byte *input, size_t length)
{
CRYPTOPP_ASSERT(input != NULLPTR || length == 0);
if (length > BLOCKSIZE - m_state.m_len)
{
if (m_state.m_len != 0)
{
// Complete current block
const size_t fill = BLOCKSIZE - m_state.m_len;
std::memcpy(m_state.m_buf+m_state.m_len, input, fill);
IncrementCounter(BLOCKSIZE);
Compress(m_state.m_buf);
m_state.m_len = 0;
length -= fill, input += fill;
}
// Compress in-place to avoid copies
while (length > BLOCKSIZE)
{
CRYPTOPP_ASSERT(m_state.m_len == 0);
IncrementCounter(BLOCKSIZE);
Compress(input);
length -= BLOCKSIZE, input += BLOCKSIZE;
}
}
// Copy tail bytes
if (length)
{
CRYPTOPP_ASSERT(length <= BLOCKSIZE - m_state.m_len);
std::memcpy(m_state.m_buf + m_state.m_len, input, length);
m_state.m_len += static_cast<unsigned int>(length);
}
}
void BLAKE2s::TruncatedFinal(byte *hash, size_t size)
{
CRYPTOPP_ASSERT(hash != NULLPTR);
this->ThrowIfInvalidTruncatedSize(size);
word32* f = m_state.f();
// Set last block unconditionally
State& state = *m_state.data();
state.f[0] = static_cast<W>(-1);
f[0] = ~static_cast<word32>(0);
// Set last node if tree mode
if (m_treeMode)
state.f[1] = static_cast<W>(-1);
f[1] = ~static_cast<word32>(0);
// Increment counter for tail bytes only
IncrementCounter(state.length);
IncrementCounter(m_state.m_len);
memset(state.buffer + state.length, 0x00, BLOCKSIZE - state.length);
Compress(state.buffer);
std::memset(m_state.m_buf + m_state.m_len, 0x00, BLOCKSIZE - m_state.m_len);
Compress(m_state.m_buf);
// Copy to caller buffer
memcpy_s(hash, size, &state.h[0], size);
std::memcpy(hash, m_state.h(), size);
Restart();
}
template <class W, bool T_64bit>
void BLAKE2_Base<W, T_64bit>::IncrementCounter(size_t count)
void BLAKE2b::TruncatedFinal(byte *hash, size_t size)
{
State& state = *m_state.data();
state.t[0] += static_cast<W>(count);
state.t[1] += !!(state.t[0] < count);
CRYPTOPP_ASSERT(hash != NULLPTR);
this->ThrowIfInvalidTruncatedSize(size);
word64* f = m_state.f();
// Set last block unconditionally
f[0] = ~static_cast<word64>(0);
// Set last node if tree mode
if (m_treeMode)
f[1] = ~static_cast<word64>(0);
// Increment counter for tail bytes only
IncrementCounter(m_state.m_len);
std::memset(m_state.m_buf + m_state.m_len, 0x00, BLOCKSIZE - m_state.m_len);
Compress(m_state.m_buf);
// Copy to caller buffer
std::memcpy(hash, m_state.h(), size);
Restart();
}
template <>
void BLAKE2_Base<word64, true>::Compress(const byte *input)
void BLAKE2s::IncrementCounter(size_t count)
{
word32* t = m_state.t();
t[0] += static_cast<word32>(count);
t[1] += !!(t[0] < count);
}
void BLAKE2b::IncrementCounter(size_t count)
{
word64* t = m_state.t();
t[0] += static_cast<word64>(count);
t[1] += !!(t[0] < count);
}
void BLAKE2s::Compress(const byte *input)
{
#if CRYPTOPP_SSE41_AVAILABLE
if(HasSSE41())
{
return BLAKE2_Compress64_SSE4(input, *m_state.data());
return BLAKE2_Compress32_SSE4(input, m_state);
}
#endif
#if CRYPTOPP_ARM_NEON_AVAILABLE
if(HasNEON())
{
return BLAKE2_Compress64_NEON(input, *m_state.data());
return BLAKE2_Compress32_NEON(input, m_state);
}
#endif
return BLAKE2_Compress64_CXX(input, *m_state.data());
#if CRYPTOPP_ALTIVEC_AVAILABLE
if(HasAltivec())
{
return BLAKE2_Compress32_ALTIVEC(input, m_state);
}
#endif
return BLAKE2_Compress32_CXX(input, m_state);
}
template <>
void BLAKE2_Base<word32, false>::Compress(const byte *input)
void BLAKE2b::Compress(const byte *input)
{
#if CRYPTOPP_SSE41_AVAILABLE
if(HasSSE41())
{
return BLAKE2_Compress32_SSE4(input, *m_state.data());
return BLAKE2_Compress64_SSE4(input, m_state);
}
#endif
#if CRYPTOPP_ARM_NEON_AVAILABLE
if(HasNEON())
{
return BLAKE2_Compress32_NEON(input, *m_state.data());
return BLAKE2_Compress64_NEON(input, m_state);
}
#endif
return BLAKE2_Compress32_CXX(input, *m_state.data());
#if CRYPTOPP_POWER8_AVAILABLE
if(HasPower8())
{
return BLAKE2_Compress64_POWER8(input, m_state);
}
#endif
return BLAKE2_Compress64_CXX(input, m_state);
}
void BLAKE2_Compress64_CXX(const byte* input, BLAKE2_State<word64, true>& state)
void BLAKE2_Compress64_CXX(const byte* input, BLAKE2b_State& state)
{
word64 m[16], v[16];
GetBlock<word64, LittleEndian, true> get1(input);
get1(m[0])(m[1])(m[2])(m[3])(m[4])(m[5])(m[6])(m[7])(m[8])(m[9])(m[10])(m[11])(m[12])(m[13])(m[14])(m[15]);
GetBlock<word64, LittleEndian, true> get2(&state.h[0]);
GetBlock<word64, LittleEndian, true> get2(state.h());
get2(v[0])(v[1])(v[2])(v[3])(v[4])(v[5])(v[6])(v[7]);
const word64* iv = BLAKE2_IV<word64, true>::iv;
const word64* iv = BLAKE2B_IV;
const word64* tf = state.t();
v[ 8] = iv[0];
v[ 9] = iv[1];
v[10] = iv[2];
v[11] = iv[3];
v[12] = state.t[0] ^ iv[4];
v[13] = state.t[1] ^ iv[5];
v[14] = state.f[0] ^ iv[6];
v[15] = state.f[1] ^ iv[7];
v[12] = tf[0] ^ iv[4];
v[13] = tf[1] ^ iv[5];
v[14] = tf[2] ^ iv[6];
v[15] = tf[3] ^ iv[7];
BLAKE2B_ROUND<0>(m, v);
BLAKE2B_ROUND<1>(m, v);
@ -489,29 +752,31 @@ void BLAKE2_Compress64_CXX(const byte* input, BLAKE2_State<word64, true>& state)
BLAKE2B_ROUND<10>(m, v);
BLAKE2B_ROUND<11>(m, v);
for(unsigned int i = 0; i < 8; ++i)
state.h[i] = state.h[i] ^ ConditionalByteReverse(LittleEndian::ToEnum(), v[i] ^ v[i + 8]);
word64* h = state.h();
for (unsigned int i = 0; i < 8; ++i)
h[i] = h[i] ^ ConditionalByteReverse(LITTLE_ENDIAN_ORDER, v[i] ^ v[i + 8]);
}
void BLAKE2_Compress32_CXX(const byte* input, BLAKE2_State<word32, false>& state)
void BLAKE2_Compress32_CXX(const byte* input, BLAKE2s_State& state)
{
word32 m[16], v[16];
GetBlock<word32, LittleEndian, true> get1(input);
get1(m[0])(m[1])(m[2])(m[3])(m[4])(m[5])(m[6])(m[7])(m[8])(m[9])(m[10])(m[11])(m[12])(m[13])(m[14])(m[15]);
GetBlock<word32, LittleEndian, true> get2(&state.h[0]);
GetBlock<word32, LittleEndian, true> get2(state.h());
get2(v[0])(v[1])(v[2])(v[3])(v[4])(v[5])(v[6])(v[7]);
const word32* iv = BLAKE2_IV<word32, false>::iv;
const word32* iv = BLAKE2S_IV;
const word32* tf = state.t();
v[ 8] = iv[0];
v[ 9] = iv[1];
v[10] = iv[2];
v[11] = iv[3];
v[12] = state.t[0] ^ iv[4];
v[13] = state.t[1] ^ iv[5];
v[14] = state.f[0] ^ iv[6];
v[15] = state.f[1] ^ iv[7];
v[12] = tf[0] ^ iv[4];
v[13] = tf[1] ^ iv[5];
v[14] = tf[2] ^ iv[6];
v[15] = tf[3] ^ iv[7];
BLAKE2S_ROUND<0>(m, v);
BLAKE2S_ROUND<1>(m, v);
@ -524,11 +789,9 @@ void BLAKE2_Compress32_CXX(const byte* input, BLAKE2_State<word32, false>& state
BLAKE2S_ROUND<8>(m, v);
BLAKE2S_ROUND<9>(m, v);
for(unsigned int i = 0; i < 8; ++i)
state.h[i] = state.h[i] ^ ConditionalByteReverse(LittleEndian::ToEnum(), v[i] ^ v[i + 8]);
word32* h = state.h();
for (unsigned int i = 0; i < 8; ++i)
h[i] = h[i] ^ ConditionalByteReverse(LITTLE_ENDIAN_ORDER, v[i] ^ v[i + 8]);
}
template class BLAKE2_Base<word32, false>;
template class BLAKE2_Base<word64, true>;
NAMESPACE_END

View File

@ -1,6 +1,7 @@
// blake2.h - written and placed in the public domain by Jeffrey Walton and Zooko
// Wilcox-O'Hearn. Based on Aumasson, Neves, Wilcox-O'Hearn and Winnerlein's
// reference BLAKE2 implementation at http://github.com/BLAKE2/BLAKE2.
// blake2.h - written and placed in the public domain by Jeffrey Walton
// and Zooko Wilcox-O'Hearn. Based on Aumasson, Neves,
// Wilcox-O'Hearn and Winnerlein's reference BLAKE2
// implementation at http://github.com/BLAKE2/BLAKE2.
/// \file blake2.h
/// \brief Classes for BLAKE2b and BLAKE2s message digests and keyed message digests
@ -9,10 +10,8 @@
/// Static algorithm name return either "BLAKE2b" or "BLAKE2s". An object algorithm name follows
/// the naming described in <A HREF="http://tools.ietf.org/html/rfc7693#section-4">RFC 7693, The
/// BLAKE2 Cryptographic Hash and Message Authentication Code (MAC)</A>.
/// \details The library provides specialized SSE2, SSE4 and NEON version of the BLAKE2 compression
/// function. For best results under ARM NEON, specify both an architecture and cpu. For example:
/// <pre>CXXFLAGS="-DNDEBUG -march=armv8-a+crc -mcpu=cortex-a53 ..."</pre>
/// \since Crypto++ 5.6.4
/// \since C++ since Crypto++ 5.6.4, SSE since Crypto++ 5.6.4, NEON since Crypto++ 6.0,
/// Power8 since Crypto++ 8.0
#ifndef CRYPTOPP_BLAKE2_H
#define CRYPTOPP_BLAKE2_H
@ -23,249 +22,206 @@
NAMESPACE_BEGIN(CryptoPP)
/// \brief BLAKE2 hash information
/// \tparam T_64bit flag indicating 64-bit
/// \brief BLAKE2s hash information
/// \since Crypto++ 5.6.4
template <bool T_64bit>
struct BLAKE2_Info : public VariableKeyLength<(T_64bit ? 64 : 32),0,(T_64bit ? 64 : 32),1,SimpleKeyingInterface::NOT_RESYNCHRONIZABLE>
struct BLAKE2s_Info : public VariableKeyLength<32,0,32,1,SimpleKeyingInterface::NOT_RESYNCHRONIZABLE>
{
typedef VariableKeyLength<(T_64bit ? 64 : 32),0,(T_64bit ? 64 : 32),1,SimpleKeyingInterface::NOT_RESYNCHRONIZABLE> KeyBase;
CRYPTOPP_CONSTANT(MIN_KEYLENGTH = KeyBase::MIN_KEYLENGTH)
CRYPTOPP_CONSTANT(MAX_KEYLENGTH = KeyBase::MAX_KEYLENGTH)
CRYPTOPP_CONSTANT(DEFAULT_KEYLENGTH = KeyBase::DEFAULT_KEYLENGTH)
typedef VariableKeyLength<32,0,32,1,SimpleKeyingInterface::NOT_RESYNCHRONIZABLE> KeyBase;
CRYPTOPP_CONSTANT(MIN_KEYLENGTH = KeyBase::MIN_KEYLENGTH);
CRYPTOPP_CONSTANT(MAX_KEYLENGTH = KeyBase::MAX_KEYLENGTH);
CRYPTOPP_CONSTANT(DEFAULT_KEYLENGTH = KeyBase::DEFAULT_KEYLENGTH);
CRYPTOPP_CONSTANT(BLOCKSIZE = (T_64bit ? 128 : 64))
CRYPTOPP_CONSTANT(DIGESTSIZE = (T_64bit ? 64 : 32))
CRYPTOPP_CONSTANT(SALTSIZE = (T_64bit ? 16 : 8))
CRYPTOPP_CONSTANT(PERSONALIZATIONSIZE = (T_64bit ? 16 : 8))
CRYPTOPP_CONSTANT(BLOCKSIZE = 64);
CRYPTOPP_CONSTANT(DIGESTSIZE = 32);
CRYPTOPP_CONSTANT(SALTSIZE = 8);
CRYPTOPP_CONSTANT(PERSONALIZATIONSIZE = 8);
CRYPTOPP_STATIC_CONSTEXPR const char* StaticAlgorithmName() {return (T_64bit ? "BLAKE2b" : "BLAKE2s");}
CRYPTOPP_STATIC_CONSTEXPR const char* StaticAlgorithmName() {return "BLAKE2s";}
};
/// \brief BLAKE2 parameter block
/// \tparam T_64bit flag indicating 64-bit
/// \details BLAKE2b uses BLAKE2_ParameterBlock<true>, while BLAKE2s
/// uses BLAKE2_ParameterBlock<false>.
/// \brief BLAKE2b hash information
/// \since Crypto++ 5.6.4
template <bool T_64bit>
struct CRYPTOPP_NO_VTABLE BLAKE2_ParameterBlock
struct BLAKE2b_Info : public VariableKeyLength<64,0,64,1,SimpleKeyingInterface::NOT_RESYNCHRONIZABLE>
{
typedef VariableKeyLength<64,0,64,1,SimpleKeyingInterface::NOT_RESYNCHRONIZABLE> KeyBase;
CRYPTOPP_CONSTANT(MIN_KEYLENGTH = KeyBase::MIN_KEYLENGTH);
CRYPTOPP_CONSTANT(MAX_KEYLENGTH = KeyBase::MAX_KEYLENGTH);
CRYPTOPP_CONSTANT(DEFAULT_KEYLENGTH = KeyBase::DEFAULT_KEYLENGTH);
CRYPTOPP_CONSTANT(BLOCKSIZE = 128);
CRYPTOPP_CONSTANT(DIGESTSIZE = 64);
CRYPTOPP_CONSTANT(SALTSIZE = 16);
CRYPTOPP_CONSTANT(PERSONALIZATIONSIZE = 16);
CRYPTOPP_STATIC_CONSTEXPR const char* StaticAlgorithmName() {return "BLAKE2b";}
};
/// \brief BLAKE2b parameter block specialization
template<>
struct CRYPTOPP_NO_VTABLE BLAKE2_ParameterBlock<true>
/// \brief BLAKE2s parameter block
struct CRYPTOPP_NO_VTABLE BLAKE2s_ParameterBlock
{
CRYPTOPP_CONSTANT(SALTSIZE = BLAKE2_Info<true>::SALTSIZE)
CRYPTOPP_CONSTANT(DIGESTSIZE = BLAKE2_Info<true>::DIGESTSIZE)
CRYPTOPP_CONSTANT(PERSONALIZATIONSIZE = BLAKE2_Info<true>::PERSONALIZATIONSIZE)
CRYPTOPP_CONSTANT(SALTSIZE = BLAKE2s_Info::SALTSIZE);
CRYPTOPP_CONSTANT(DIGESTSIZE = BLAKE2s_Info::DIGESTSIZE);
CRYPTOPP_CONSTANT(PERSONALIZATIONSIZE = BLAKE2s_Info::PERSONALIZATIONSIZE);
BLAKE2_ParameterBlock()
{
memset(this, 0x00, sizeof(*this));
digestLength = DIGESTSIZE;
fanout = depth = 1;
}
BLAKE2s_ParameterBlock()
{
Reset();
}
BLAKE2_ParameterBlock(size_t digestSize)
{
CRYPTOPP_ASSERT(digestSize <= DIGESTSIZE);
memset(this, 0x00, sizeof(*this));
digestLength = (byte)digestSize;
fanout = depth = 1;
}
BLAKE2s_ParameterBlock(size_t digestSize)
{
Reset(digestSize);
}
BLAKE2_ParameterBlock(size_t digestSize, size_t keyLength, const byte* salt, size_t saltLength,
const byte* personalization, size_t personalizationLength);
BLAKE2s_ParameterBlock(size_t digestSize, size_t keyLength, const byte* salt, size_t saltLength,
const byte* personalization, size_t personalizationLength);
byte digestLength;
byte keyLength, fanout, depth;
byte leafLength[4];
byte nodeOffset[8];
byte nodeDepth, innerLength, rfu[14];
byte salt[SALTSIZE];
byte personalization[PERSONALIZATIONSIZE];
void Reset(size_t digestLength=DIGESTSIZE, size_t keyLength=0);
byte* data() {
return m_data.data();
}
const byte* data() const {
return m_data.data();
}
size_t size() const {
return m_data.size();
}
byte* salt() {
return m_data + SaltOff;
}
byte* personalization() {
return m_data + PersonalizationOff;
}
// Offsets into the byte array
enum {
DigestOff = 0, KeyOff = 1, FanoutOff = 2, DepthOff = 3, LeafOff = 4, NodeOff = 8,
NodeDepthOff = 14, InnerOff = 15, SaltOff = 16, PersonalizationOff = 24
};
FixedSizeAlignedSecBlock<byte, 32, true> m_data;
};
/// \brief BLAKE2s parameter block specialization
template<>
struct CRYPTOPP_NO_VTABLE BLAKE2_ParameterBlock<false>
/// \brief BLAKE2b parameter block
struct CRYPTOPP_NO_VTABLE BLAKE2b_ParameterBlock
{
CRYPTOPP_CONSTANT(SALTSIZE = BLAKE2_Info<false>::SALTSIZE)
CRYPTOPP_CONSTANT(DIGESTSIZE = BLAKE2_Info<false>::DIGESTSIZE)
CRYPTOPP_CONSTANT(PERSONALIZATIONSIZE = BLAKE2_Info<false>::PERSONALIZATIONSIZE)
CRYPTOPP_CONSTANT(SALTSIZE = BLAKE2b_Info::SALTSIZE);
CRYPTOPP_CONSTANT(DIGESTSIZE = BLAKE2b_Info::DIGESTSIZE);
CRYPTOPP_CONSTANT(PERSONALIZATIONSIZE = BLAKE2b_Info::PERSONALIZATIONSIZE);
BLAKE2_ParameterBlock()
{
memset(this, 0x00, sizeof(*this));
digestLength = DIGESTSIZE;
fanout = depth = 1;
}
BLAKE2b_ParameterBlock()
{
Reset();
}
BLAKE2_ParameterBlock(size_t digestSize)
{
CRYPTOPP_ASSERT(digestSize <= DIGESTSIZE);
memset(this, 0x00, sizeof(*this));
digestLength = (byte)digestSize;
fanout = depth = 1;
}
BLAKE2b_ParameterBlock(size_t digestSize)
{
Reset(digestSize);
}
BLAKE2_ParameterBlock(size_t digestSize, size_t keyLength, const byte* salt, size_t saltLength,
const byte* personalization, size_t personalizationLength);
BLAKE2b_ParameterBlock(size_t digestSize, size_t keyLength, const byte* salt, size_t saltLength,
const byte* personalization, size_t personalizationLength);
byte digestLength;
byte keyLength, fanout, depth;
byte leafLength[4];
byte nodeOffset[6];
byte nodeDepth, innerLength;
byte salt[SALTSIZE];
byte personalization[PERSONALIZATIONSIZE];
void Reset(size_t digestLength=DIGESTSIZE, size_t keyLength=0);
byte* data() {
return m_data.data();
}
const byte* data() const {
return m_data.data();
}
size_t size() const {
return m_data.size();
}
byte* salt() {
return m_data + SaltOff;
}
byte* personalization() {
return m_data + PersonalizationOff;
}
// Offsets into the byte array
enum {
DigestOff = 0, KeyOff = 1, FanoutOff = 2, DepthOff = 3, LeafOff = 4, NodeOff = 8,
NodeDepthOff = 16, InnerOff = 17, RfuOff = 18, SaltOff = 32, PersonalizationOff = 48
};
FixedSizeAlignedSecBlock<byte, 64, true> m_data;
};
/// \brief BLAKE2 state information
/// \tparam W word type
/// \tparam T_64bit flag indicating 64-bit
/// \details BLAKE2b uses BLAKE2_State<word64, true>, while BLAKE2s
/// uses BLAKE2_State<word32, false>.
/// \brief BLAKE2s state information
/// \since Crypto++ 5.6.4
template <class W, bool T_64bit>
struct CRYPTOPP_NO_VTABLE BLAKE2_State
struct CRYPTOPP_NO_VTABLE BLAKE2s_State
{
CRYPTOPP_CONSTANT(BLOCKSIZE = BLAKE2_Info<T_64bit>::BLOCKSIZE)
BLAKE2s_State() {
Reset();
}
BLAKE2_State()
{
// Set all members except scratch buffer[]
h[0]=h[1]=h[2]=h[3]=h[4]=h[5]=h[6]=h[7] = 0;
t[0]=t[1]=f[0]=f[1] = 0;
length = 0;
}
void Reset();
// SSE2, SSE4 and NEON depend upon t[] and f[] being side-by-side
W h[8], t[2], f[2];
byte buffer[BLOCKSIZE];
size_t length;
inline word32* h() {
return m_hft.data();
}
inline word32* t() {
return m_hft.data() + 8;
}
inline word32* f() {
return m_hft.data() + 10;
}
inline byte* data() {
return m_buf.data();
}
// SSE4, Power7 and NEON depend upon t[] and f[] being side-by-side
CRYPTOPP_CONSTANT(BLOCKSIZE = BLAKE2s_Info::BLOCKSIZE);
FixedSizeAlignedSecBlock<word32, 8+2+2, true> m_hft;
FixedSizeAlignedSecBlock<byte, BLOCKSIZE, true> m_buf;
size_t m_len;
};
/// \brief BLAKE2 hash implementation
/// \tparam W word type
/// \tparam T_64bit flag indicating 64-bit
/// \details BLAKE2b uses BLAKE2_Base<word64, true>, while BLAKE2s
/// uses BLAKE2_Base<word32, false>.
/// \brief BLAKE2b state information
/// \since Crypto++ 5.6.4
template <class W, bool T_64bit>
class BLAKE2_Base : public SimpleKeyingInterfaceImpl<MessageAuthenticationCode, BLAKE2_Info<T_64bit> >
struct CRYPTOPP_NO_VTABLE BLAKE2b_State
{
public:
CRYPTOPP_CONSTANT(DEFAULT_KEYLENGTH = BLAKE2_Info<T_64bit>::DEFAULT_KEYLENGTH)
CRYPTOPP_CONSTANT(MIN_KEYLENGTH = BLAKE2_Info<T_64bit>::MIN_KEYLENGTH)
CRYPTOPP_CONSTANT(MAX_KEYLENGTH = BLAKE2_Info<T_64bit>::MAX_KEYLENGTH)
BLAKE2b_State() {
Reset();
}
CRYPTOPP_CONSTANT(DIGESTSIZE = BLAKE2_Info<T_64bit>::DIGESTSIZE)
CRYPTOPP_CONSTANT(BLOCKSIZE = BLAKE2_Info<T_64bit>::BLOCKSIZE)
CRYPTOPP_CONSTANT(SALTSIZE = BLAKE2_Info<T_64bit>::SALTSIZE)
CRYPTOPP_CONSTANT(PERSONALIZATIONSIZE = BLAKE2_Info<T_64bit>::PERSONALIZATIONSIZE)
void Reset();
typedef BLAKE2_State<W, T_64bit> State;
typedef BLAKE2_ParameterBlock<T_64bit> ParameterBlock;
typedef SecBlock<State, AllocatorWithCleanup<State, true> > AlignedState;
typedef SecBlock<ParameterBlock, AllocatorWithCleanup<ParameterBlock, true> > AlignedParameterBlock;
inline word64* h() {
return m_hft.data();
}
virtual ~BLAKE2_Base() {}
inline word64* t() {
return m_hft.data() + 8;
}
/// \brief Retrieve the static algorithm name
/// \returns the algorithm name (BLAKE2s or BLAKE2b)
CRYPTOPP_STATIC_CONSTEXPR const char* StaticAlgorithmName() {return BLAKE2_Info<T_64bit>::StaticAlgorithmName();}
inline word64* f() {
return m_hft.data() + 10;
}
/// \brief Retrieve the object's name
/// \returns the object's algorithm name following RFC 7693
/// \details Object algorithm name follows the naming described in
/// <A HREF="http://tools.ietf.org/html/rfc7693#section-4">RFC 7693, The BLAKE2 Cryptographic Hash and
/// Message Authentication Code (MAC)</A>. For example, "BLAKE2b-512" and "BLAKE2s-256".
std::string AlgorithmName() const {return std::string(StaticAlgorithmName()) + "-" + IntToString(this->DigestSize()*8);}
inline byte* data() {
return m_buf.data();
}
unsigned int DigestSize() const {return m_digestSize;}
unsigned int OptimalDataAlignment() const {return (CRYPTOPP_BOOL_ALIGN16 ? 16 : GetAlignmentOf<W>());}
void Update(const byte *input, size_t length);
void Restart();
/// \brief Restart a hash with parameter block and counter
/// \param block parameter block
/// \param counter counter array
/// \details Parameter block is persisted across calls to Restart().
void Restart(const BLAKE2_ParameterBlock<T_64bit>& block, const W counter[2]);
/// \brief Set tree mode
/// \param mode the new tree mode
/// \details BLAKE2 has two finalization flags, called State::f[0] and State::f[1].
/// If <tt>treeMode=false</tt> (default), then State::f[1] is never set. If
/// <tt>treeMode=true</tt>, then State::f[1] is set when State::f[0] is set.
/// Tree mode is persisted across calls to Restart().
void SetTreeMode(bool mode) {m_treeMode=mode;}
/// \brief Get tree mode
/// \returns the current tree mode
/// \details Tree mode is persisted across calls to Restart().
bool GetTreeMode() const {return m_treeMode;}
void TruncatedFinal(byte *hash, size_t size);
protected:
BLAKE2_Base();
BLAKE2_Base(bool treeMode, unsigned int digestSize);
BLAKE2_Base(const byte *key, size_t keyLength, const byte* salt, size_t saltLength,
const byte* personalization, size_t personalizationLength,
bool treeMode, unsigned int digestSize);
// Operates on state buffer and/or input. Must be BLOCKSIZE, final block will pad with 0's.
void Compress(const byte *input);
inline void IncrementCounter(size_t count=BLOCKSIZE);
void UncheckedSetKey(const byte* key, unsigned int length, const CryptoPP::NameValuePairs& params);
private:
AlignedState m_state;
AlignedParameterBlock m_block;
AlignedSecByteBlock m_key;
word32 m_digestSize;
bool m_treeMode;
};
/// \brief The BLAKE2b cryptographic hash function
/// \details BLAKE2b can function as both a hash and keyed hash. If you want only the hash,
/// then use the BLAKE2b constructor that accepts no parameters or digest size. If you
/// want a keyed hash, then use the constructor that accpts the key as a parameter.
/// Once a key and digest size are selected, its effectively immutable. The Restart()
/// method that accepts a ParameterBlock does not allow you to change it.
/// \sa Aumasson, Neves, Wilcox-O'Hearn and Winnerlein's
/// <A HREF="http://blake2.net/blake2.pdf">BLAKE2: simpler, smaller, fast as MD5</A> (2013.01.29).
/// \since Crypto++ 5.6.4
class BLAKE2b : public BLAKE2_Base<word64, true>
{
public:
typedef BLAKE2_Base<word64, true> ThisBase; // Early Visual Studio workaround
typedef BLAKE2_ParameterBlock<true> ParameterBlock;
CRYPTOPP_COMPILE_ASSERT(sizeof(ParameterBlock) == 64);
/// \brief Construct a BLAKE2b hash
/// \param digestSize the digest size, in bytes
/// \param treeMode flag indicating tree mode
BLAKE2b(bool treeMode=false, unsigned int digestSize = DIGESTSIZE) : ThisBase(treeMode, digestSize) {}
/// \brief Construct a BLAKE2b hash
/// \param key a byte array used to key the cipher
/// \param keyLength the size of the byte array
/// \param salt a byte array used as salt
/// \param saltLength the size of the byte array
/// \param personalization a byte array used as prsonalization string
/// \param personalizationLength the size of the byte array
/// \param treeMode flag indicating tree mode
/// \param digestSize the digest size, in bytes
BLAKE2b(const byte *key, size_t keyLength, const byte* salt = NULLPTR, size_t saltLength = 0,
const byte* personalization = NULLPTR, size_t personalizationLength = 0,
bool treeMode=false, unsigned int digestSize = DIGESTSIZE)
: ThisBase(key, keyLength, salt, saltLength, personalization, personalizationLength, treeMode, digestSize) {}
// SSE4, Power8 and NEON depend upon t[] and f[] being side-by-side
CRYPTOPP_CONSTANT(BLOCKSIZE = BLAKE2b_Info::BLOCKSIZE);
FixedSizeAlignedSecBlock<word64, 8+2+2, true> m_hft;
FixedSizeAlignedSecBlock<byte, BLOCKSIZE, true> m_buf;
size_t m_len;
};
/// \brief The BLAKE2s cryptographic hash function
@ -276,32 +232,211 @@ public:
/// method that accepts a ParameterBlock does not allow you to change it.
/// \sa Aumasson, Neves, Wilcox-O'Hearn and Winnerlein's
/// <A HREF="http://blake2.net/blake2.pdf">BLAKE2: simpler, smaller, fast as MD5</A> (2013.01.29).
/// \since Crypto++ 5.6.4
class BLAKE2s : public BLAKE2_Base<word32, false>
/// \since C++ since Crypto++ 5.6.4, SSE since Crypto++ 5.6.4, NEON since Crypto++ 6.0,
/// Power8 since Crypto++ 8.0
class BLAKE2s : public SimpleKeyingInterfaceImpl<MessageAuthenticationCode, BLAKE2s_Info>
{
public:
typedef BLAKE2_Base<word32, false> ThisBase; // Early Visual Studio workaround
typedef BLAKE2_ParameterBlock<false> ParameterBlock;
CRYPTOPP_COMPILE_ASSERT(sizeof(ParameterBlock) == 32);
CRYPTOPP_CONSTANT(DEFAULT_KEYLENGTH = BLAKE2s_Info::DEFAULT_KEYLENGTH);
CRYPTOPP_CONSTANT(MIN_KEYLENGTH = BLAKE2s_Info::MIN_KEYLENGTH);
CRYPTOPP_CONSTANT(MAX_KEYLENGTH = BLAKE2s_Info::MAX_KEYLENGTH);
/// \brief Construct a BLAKE2s hash
/// \param digestSize the digest size, in bytes
/// \param treeMode flag indicating tree mode
BLAKE2s(bool treeMode=false, unsigned int digestSize = DIGESTSIZE) : ThisBase(treeMode, digestSize) {}
CRYPTOPP_CONSTANT(DIGESTSIZE = BLAKE2s_Info::DIGESTSIZE);
CRYPTOPP_CONSTANT(BLOCKSIZE = BLAKE2s_Info::BLOCKSIZE);
CRYPTOPP_CONSTANT(SALTSIZE = BLAKE2s_Info::SALTSIZE);
CRYPTOPP_CONSTANT(PERSONALIZATIONSIZE = BLAKE2s_Info::PERSONALIZATIONSIZE);
/// \brief Construct a BLAKE2s hash
/// \param key a byte array used to key the cipher
/// \param keyLength the size of the byte array
/// \param salt a byte array used as salt
/// \param saltLength the size of the byte array
/// \param personalization a byte array used as prsonalization string
/// \param personalizationLength the size of the byte array
/// \param treeMode flag indicating tree mode
/// \param digestSize the digest size, in bytes
BLAKE2s(const byte *key, size_t keyLength, const byte* salt = NULLPTR, size_t saltLength = 0,
const byte* personalization = NULLPTR, size_t personalizationLength = 0,
bool treeMode=false, unsigned int digestSize = DIGESTSIZE)
: ThisBase(key, keyLength, salt, saltLength, personalization, personalizationLength, treeMode, digestSize) {}
typedef BLAKE2s_State State;
typedef BLAKE2s_ParameterBlock ParameterBlock;
CRYPTOPP_STATIC_CONSTEXPR const char* StaticAlgorithmName() {return "BLAKE2s";}
virtual ~BLAKE2s() {}
/// \brief Construct a BLAKE2s hash
/// \param digestSize the digest size, in bytes
/// \param treeMode flag indicating tree mode
/// \since Crypto++ 5.6.4
BLAKE2s(bool treeMode=false, unsigned int digestSize = DIGESTSIZE);
/// \brief Construct a BLAKE2s hash
/// \param digestSize the digest size, in bytes
/// \details treeMode flag is set to false
/// \since Crypto++ 8.2
BLAKE2s(unsigned int digestSize);
/// \brief Construct a BLAKE2s hash
/// \param key a byte array used to key the cipher
/// \param keyLength the size of the byte array
/// \param salt a byte array used as salt
/// \param saltLength the size of the byte array
/// \param personalization a byte array used as personalization string
/// \param personalizationLength the size of the byte array
/// \param treeMode flag indicating tree mode
/// \param digestSize the digest size, in bytes
/// \since Crypto++ 5.6.4
BLAKE2s(const byte *key, size_t keyLength, const byte* salt = NULLPTR, size_t saltLength = 0,
const byte* personalization = NULLPTR, size_t personalizationLength = 0,
bool treeMode=false, unsigned int digestSize = DIGESTSIZE);
/// \brief Retrieve the object's name
/// \return the object's algorithm name following RFC 7693
/// \details Object algorithm name follows the naming described in
/// <A HREF="http://tools.ietf.org/html/rfc7693#section-4">RFC 7693, The BLAKE2 Cryptographic Hash and
/// Message Authentication Code (MAC)</A>. For example, "BLAKE2b-512" and "BLAKE2s-256".
std::string AlgorithmName() const {return std::string(BLAKE2s_Info::StaticAlgorithmName()) + "-" + IntToString(DigestSize()*8);}
unsigned int BlockSize() const {return BLOCKSIZE;}
unsigned int DigestSize() const {return m_digestSize;}
unsigned int OptimalDataAlignment() const;
void Update(const byte *input, size_t length);
void Restart();
/// \brief Restart a hash with parameter block and counter
/// \param block parameter block
/// \param counter counter array
/// \details Parameter block is persisted across calls to Restart().
void Restart(const BLAKE2s_ParameterBlock& block, const word32 counter[2]);
/// \brief Set tree mode
/// \param mode the new tree mode
/// \details BLAKE2 has two finalization flags, called State::f[0] and State::f[1].
/// If <tt>treeMode=false</tt> (default), then State::f[1] is never set. If
/// <tt>treeMode=true</tt>, then State::f[1] is set when State::f[0] is set.
/// Tree mode is persisted across calls to Restart().
void SetTreeMode(bool mode) {m_treeMode=mode;}
/// \brief Get tree mode
/// \return the current tree mode
/// \details Tree mode is persisted across calls to Restart().
bool GetTreeMode() const {return m_treeMode;}
void TruncatedFinal(byte *hash, size_t size);
std::string AlgorithmProvider() const;
protected:
// Operates on state buffer and/or input. Must be BLOCKSIZE, final block will pad with 0's.
void Compress(const byte *input);
inline void IncrementCounter(size_t count=BLOCKSIZE);
void UncheckedSetKey(const byte* key, unsigned int length, const CryptoPP::NameValuePairs& params);
private:
State m_state;
ParameterBlock m_block;
AlignedSecByteBlock m_key;
word32 m_digestSize, m_keyLength;
bool m_treeMode;
};
/// \brief The BLAKE2b cryptographic hash function
/// \details BLAKE2b can function as both a hash and keyed hash. If you want only the hash,
/// then use the BLAKE2b constructor that accepts no parameters or digest size. If you
/// want a keyed hash, then use the constructor that accpts the key as a parameter.
/// Once a key and digest size are selected, its effectively immutable. The Restart()
/// method that accepts a ParameterBlock does not allow you to change it.
/// \sa Aumasson, Neves, Wilcox-O'Hearn and Winnerlein's
/// <A HREF="http://blake2.net/blake2.pdf">BLAKE2: simpler, smaller, fast as MD5</A> (2013.01.29).
/// \since C++ since Crypto++ 5.6.4, SSE since Crypto++ 5.6.4, NEON since Crypto++ 6.0,
/// Power8 since Crypto++ 8.0
class BLAKE2b : public SimpleKeyingInterfaceImpl<MessageAuthenticationCode, BLAKE2b_Info>
{
public:
CRYPTOPP_CONSTANT(DEFAULT_KEYLENGTH = BLAKE2b_Info::DEFAULT_KEYLENGTH);
CRYPTOPP_CONSTANT(MIN_KEYLENGTH = BLAKE2b_Info::MIN_KEYLENGTH);
CRYPTOPP_CONSTANT(MAX_KEYLENGTH = BLAKE2b_Info::MAX_KEYLENGTH);
CRYPTOPP_CONSTANT(DIGESTSIZE = BLAKE2b_Info::DIGESTSIZE);
CRYPTOPP_CONSTANT(BLOCKSIZE = BLAKE2b_Info::BLOCKSIZE);
CRYPTOPP_CONSTANT(SALTSIZE = BLAKE2b_Info::SALTSIZE);
CRYPTOPP_CONSTANT(PERSONALIZATIONSIZE = BLAKE2b_Info::PERSONALIZATIONSIZE);
typedef BLAKE2b_State State;
typedef BLAKE2b_ParameterBlock ParameterBlock;
CRYPTOPP_STATIC_CONSTEXPR const char* StaticAlgorithmName() {return "BLAKE2b";}
virtual ~BLAKE2b() {}
/// \brief Construct a BLAKE2b hash
/// \param digestSize the digest size, in bytes
/// \param treeMode flag indicating tree mode
/// \since Crypto++ 5.6.4
BLAKE2b(bool treeMode=false, unsigned int digestSize = DIGESTSIZE);
/// \brief Construct a BLAKE2s hash
/// \param digestSize the digest size, in bytes
/// \details treeMode flag is set to false
/// \since Crypto++ 8.2
BLAKE2b(unsigned int digestSize);
/// \brief Construct a BLAKE2b hash
/// \param key a byte array used to key the cipher
/// \param keyLength the size of the byte array
/// \param salt a byte array used as salt
/// \param saltLength the size of the byte array
/// \param personalization a byte array used as personalization string
/// \param personalizationLength the size of the byte array
/// \param treeMode flag indicating tree mode
/// \param digestSize the digest size, in bytes
/// \since Crypto++ 5.6.4
BLAKE2b(const byte *key, size_t keyLength, const byte* salt = NULLPTR, size_t saltLength = 0,
const byte* personalization = NULLPTR, size_t personalizationLength = 0,
bool treeMode=false, unsigned int digestSize = DIGESTSIZE);
/// \brief Retrieve the object's name
/// \return the object's algorithm name following RFC 7693
/// \details Object algorithm name follows the naming described in
/// <A HREF="http://tools.ietf.org/html/rfc7693#section-4">RFC 7693, The BLAKE2 Cryptographic Hash and
/// Message Authentication Code (MAC)</A>. For example, "BLAKE2b-512" and "BLAKE2s-256".
std::string AlgorithmName() const {return std::string(BLAKE2b_Info::StaticAlgorithmName()) + "-" + IntToString(DigestSize()*8);}
unsigned int BlockSize() const {return BLOCKSIZE;}
unsigned int DigestSize() const {return m_digestSize;}
unsigned int OptimalDataAlignment() const;
void Update(const byte *input, size_t length);
void Restart();
/// \brief Restart a hash with parameter block and counter
/// \param block parameter block
/// \param counter counter array
/// \details Parameter block is persisted across calls to Restart().
void Restart(const BLAKE2b_ParameterBlock& block, const word64 counter[2]);
/// \brief Set tree mode
/// \param mode the new tree mode
/// \details BLAKE2 has two finalization flags, called State::f[0] and State::f[1].
/// If <tt>treeMode=false</tt> (default), then State::f[1] is never set. If
/// <tt>treeMode=true</tt>, then State::f[1] is set when State::f[0] is set.
/// Tree mode is persisted across calls to Restart().
void SetTreeMode(bool mode) {m_treeMode=mode;}
/// \brief Get tree mode
/// \return the current tree mode
/// \details Tree mode is persisted across calls to Restart().
bool GetTreeMode() const {return m_treeMode;}
void TruncatedFinal(byte *hash, size_t size);
std::string AlgorithmProvider() const;
protected:
// Operates on state buffer and/or input. Must be BLOCKSIZE, final block will pad with 0's.
void Compress(const byte *input);
inline void IncrementCounter(size_t count=BLOCKSIZE);
void UncheckedSetKey(const byte* key, unsigned int length, const CryptoPP::NameValuePairs& params);
private:
State m_state;
ParameterBlock m_block;
AlignedSecByteBlock m_key;
word32 m_digestSize, m_keyLength;
bool m_treeMode;
};
NAMESPACE_END

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -12,13 +12,19 @@
NAMESPACE_BEGIN(CryptoPP)
/// BlumBlumShub without factorization of the modulus
/// \brief BlumBlumShub without factorization of the modulus
/// \details You should reseed the generator after a fork() to avoid multiple generators
/// with the same internal state.
class PublicBlumBlumShub : public RandomNumberGenerator,
public StreamTransformation
{
public:
virtual ~PublicBlumBlumShub() {}
/// \brief Construct a PublicBlumBlumShub
/// \param n the modulus
/// \param seed the seed for the generator
/// \details seed is the secret key and should be about as large as n.
PublicBlumBlumShub(const Integer &n, const Integer &seed);
unsigned int GenerateBit();
@ -35,14 +41,20 @@ protected:
word maxBits, bitsLeft;
};
/// BlumBlumShub with factorization of the modulus
/// \brief BlumBlumShub with factorization of the modulus
/// \details You should reseed the generator after a fork() to avoid multiple generators
/// with the same internal state.
class BlumBlumShub : public PublicBlumBlumShub
{
public:
virtual ~BlumBlumShub() {}
// Make sure p and q are both primes congruent to 3 mod 4 and at least 512 bits long,
// seed is the secret key and should be about as big as p*q
/// \brief Construct a BlumBlumShub
/// \param p the first prime factor
/// \param q the second prime factor
/// \param seed the seed for the generator
/// \details Esure p and q are both primes congruent to 3 mod 4 and at least 512 bits long.
/// seed is the secret key and should be about as large as p*q.
BlumBlumShub(const Integer &p, const Integer &q, const Integer &seed);
bool IsRandomAccess() const {return true;}

View File

@ -60,7 +60,7 @@ NAMESPACE_BEGIN(CryptoPP)
ROUND(lh, ll, rh, rl, k0, k1) \
ROUND(rh, rl, lh, ll, k2, k3)
#ifdef CRYPTOPP_LITTLE_ENDIAN
#if (CRYPTOPP_LITTLE_ENDIAN)
#define EFI(i) (1-(i))
#else
#define EFI(i) (i)

View File

@ -43,7 +43,11 @@ template <class T>
class CBC_MAC : public MessageAuthenticationCodeImpl<CBC_MAC_Base, CBC_MAC<T> >, public SameKeyLengthAs<T>
{
public:
/// \brief Construct a CBC_MAC
CBC_MAC() {}
/// \brief Construct a CBC_MAC
/// \param key a byte buffer used to key the cipher
/// \param length the length of the byte buffer
CBC_MAC(const byte *key, size_t length=SameKeyLengthAs<T>::DEFAULT_KEYLENGTH)
{this->SetKey(key, length);}

View File

@ -24,6 +24,8 @@ public:
// AuthenticatedSymmetricCipher
std::string AlgorithmName() const
{return GetBlockCipher().AlgorithmName() + std::string("/CCM");}
std::string AlgorithmProvider() const
{return GetBlockCipher().AlgorithmProvider();}
size_t MinKeyLength() const
{return GetBlockCipher().MinKeyLength();}
size_t MaxKeyLength() const
@ -71,7 +73,7 @@ protected:
virtual BlockCipher & AccessBlockCipher() =0;
virtual int DefaultDigestSize() const =0;
const BlockCipher & GetBlockCipher() const {return const_cast<CCM_Base *>(this)->AccessBlockCipher();};
const BlockCipher & GetBlockCipher() const {return const_cast<CCM_Base *>(this)->AccessBlockCipher();}
byte *CBC_Buffer() {return m_buffer+REQUIRED_BLOCKSIZE;}
enum {REQUIRED_BLOCKSIZE = 16};

View File

@ -1,6 +1,7 @@
// chacha.cpp - written and placed in the public domain by Jeffrey Walton.
// Based on Wei Dai's Salsa20 and Bernstein's reference ChaCha
// family implementation at http://cr.yp.to/chacha.html.
// Based on Wei Dai's Salsa20, Botan's SSE2 implementation,
// and Bernstein's reference ChaCha family implementation at
// http://cr.yp.to/chacha.html.
#include "pch.h"
#include "config.h"
@ -9,144 +10,559 @@
#include "misc.h"
#include "cpu.h"
// Internal compiler error in GCC 3.3 and below
#if defined(__GNUC__) && (__GNUC__ < 4)
# undef CRYPTOPP_SSE2_INTRIN_AVAILABLE
#endif
NAMESPACE_BEGIN(CryptoPP)
#if (CRYPTOPP_ARM_NEON_AVAILABLE)
extern void ChaCha_OperateKeystream_NEON(const word32 *state, const byte* input, byte *output, unsigned int rounds);
#endif
#if (CRYPTOPP_AVX2_AVAILABLE)
extern void ChaCha_OperateKeystream_AVX2(const word32 *state, const byte* input, byte *output, unsigned int rounds);
#endif
#if (CRYPTOPP_SSE2_INTRIN_AVAILABLE)
extern void ChaCha_OperateKeystream_SSE2(const word32 *state, const byte* input, byte *output, unsigned int rounds);
#endif
#if (CRYPTOPP_ALTIVEC_AVAILABLE)
extern void ChaCha_OperateKeystream_ALTIVEC(const word32 *state, const byte* input, byte *output, unsigned int rounds);
#endif
#if defined(CRYPTOPP_DEBUG) && !defined(CRYPTOPP_DOXYGEN_PROCESSING)
void ChaCha_TestInstantiations()
{
ChaCha::Encryption x;
ChaChaTLS::Encryption y;
XChaCha20::Encryption z;
}
#endif
NAMESPACE_END // CryptoPP
////////////////////////////// ChaCha Core //////////////////////////////
#define CHACHA_QUARTER_ROUND(a,b,c,d) \
a += b; d ^= a; d = rotlConstant<16,word32>(d); \
c += d; b ^= c; b = rotlConstant<12,word32>(b); \
a += b; d ^= a; d = rotlConstant<8,word32>(d); \
c += d; b ^= c; b = rotlConstant<7,word32>(b);
#if defined(CRYPTOPP_DEBUG) && !defined(CRYPTOPP_DOXYGEN_PROCESSING)
void ChaCha_TestInstantiations()
#define CHACHA_OUTPUT(x){\
CRYPTOPP_KEYSTREAM_OUTPUT_WORD(x, LITTLE_ENDIAN_ORDER, 0, x0 + state[0]);\
CRYPTOPP_KEYSTREAM_OUTPUT_WORD(x, LITTLE_ENDIAN_ORDER, 1, x1 + state[1]);\
CRYPTOPP_KEYSTREAM_OUTPUT_WORD(x, LITTLE_ENDIAN_ORDER, 2, x2 + state[2]);\
CRYPTOPP_KEYSTREAM_OUTPUT_WORD(x, LITTLE_ENDIAN_ORDER, 3, x3 + state[3]);\
CRYPTOPP_KEYSTREAM_OUTPUT_WORD(x, LITTLE_ENDIAN_ORDER, 4, x4 + state[4]);\
CRYPTOPP_KEYSTREAM_OUTPUT_WORD(x, LITTLE_ENDIAN_ORDER, 5, x5 + state[5]);\
CRYPTOPP_KEYSTREAM_OUTPUT_WORD(x, LITTLE_ENDIAN_ORDER, 6, x6 + state[6]);\
CRYPTOPP_KEYSTREAM_OUTPUT_WORD(x, LITTLE_ENDIAN_ORDER, 7, x7 + state[7]);\
CRYPTOPP_KEYSTREAM_OUTPUT_WORD(x, LITTLE_ENDIAN_ORDER, 8, x8 + state[8]);\
CRYPTOPP_KEYSTREAM_OUTPUT_WORD(x, LITTLE_ENDIAN_ORDER, 9, x9 + state[9]);\
CRYPTOPP_KEYSTREAM_OUTPUT_WORD(x, LITTLE_ENDIAN_ORDER, 10, x10 + state[10]);\
CRYPTOPP_KEYSTREAM_OUTPUT_WORD(x, LITTLE_ENDIAN_ORDER, 11, x11 + state[11]);\
CRYPTOPP_KEYSTREAM_OUTPUT_WORD(x, LITTLE_ENDIAN_ORDER, 12, x12 + state[12]);\
CRYPTOPP_KEYSTREAM_OUTPUT_WORD(x, LITTLE_ENDIAN_ORDER, 13, x13 + state[13]);\
CRYPTOPP_KEYSTREAM_OUTPUT_WORD(x, LITTLE_ENDIAN_ORDER, 14, x14 + state[14]);\
CRYPTOPP_KEYSTREAM_OUTPUT_WORD(x, LITTLE_ENDIAN_ORDER, 15, x15 + state[15]);}
ANONYMOUS_NAMESPACE_BEGIN
// Hacks... Bring in all symbols, and supply
// the stuff the templates normally provide.
using namespace CryptoPP;
typedef word32 WordType;
enum {BYTES_PER_ITERATION=64};
// MultiBlockSafe detects a condition that can arise in the SIMD
// implementations where we overflow one of the 32-bit state words during
// addition in an intermediate result. Preconditions for the issue include
// a user seeks to around 2^32 blocks (256 GB of data) for ChaCha; or a
// user specifies an arbitrarily large initial counter block for ChaChaTLS.
// Also see https://github.com/weidai11/cryptopp/issues/732.
inline bool MultiBlockSafe(unsigned int ctrLow, unsigned int blocks)
{
ChaCha8::Encryption x1;
ChaCha12::Encryption x2;
ChaCha20::Encryption x3;
return 0xffffffff - ctrLow > blocks;
}
// OperateKeystream always produces a key stream. The key stream is written
// to output. Optionally a message may be supplied to xor with the key stream.
// The message is input, and output = output ^ input.
void ChaCha_OperateKeystream(KeystreamOperation operation,
word32 state[16], word32& ctrLow, word32& ctrHigh, word32 rounds,
byte *output, const byte *input, size_t iterationCount)
{
do
{
#if (CRYPTOPP_AVX2_AVAILABLE)
if (HasAVX2())
{
while (iterationCount >= 8 && MultiBlockSafe(state[12], 8))
{
const bool xorInput = (operation & EnumToInt(INPUT_NULL)) != EnumToInt(INPUT_NULL);
ChaCha_OperateKeystream_AVX2(state, xorInput ? input : NULLPTR, output, rounds);
// MultiBlockSafe avoids overflow on the counter words
state[12] += 8;
input += (!!xorInput) * 8 * BYTES_PER_ITERATION;
output += 8 * BYTES_PER_ITERATION;
iterationCount -= 8;
}
}
#endif
template <unsigned int R>
void ChaCha_Policy<R>::CipherSetKey(const NameValuePairs &params, const byte *key, size_t length)
{
CRYPTOPP_UNUSED(params);
CRYPTOPP_ASSERT(length == 16 || length == 32);
#if (CRYPTOPP_SSE2_INTRIN_AVAILABLE)
if (HasSSE2())
{
while (iterationCount >= 4 && MultiBlockSafe(state[12], 4))
{
const bool xorInput = (operation & EnumToInt(INPUT_NULL)) != EnumToInt(INPUT_NULL);
ChaCha_OperateKeystream_SSE2(state, xorInput ? input : NULLPTR, output, rounds);
// "expand 16-byte k" or "expand 32-byte k"
m_state[0] = 0x61707865;
m_state[1] = (length == 16) ? 0x3120646e : 0x3320646e;
m_state[2] = (length == 16) ? 0x79622d36 : 0x79622d32;
m_state[3] = 0x6b206574;
// MultiBlockSafe avoids overflow on the counter words
state[12] += 4;
GetBlock<word32, LittleEndian> get1(key);
get1(m_state[4])(m_state[5])(m_state[6])(m_state[7]);
GetBlock<word32, LittleEndian> get2(key + ((length == 32) ? 16 : 0));
get2(m_state[8])(m_state[9])(m_state[10])(m_state[11]);
}
template <unsigned int R>
void ChaCha_Policy<R>::CipherResynchronize(byte *keystreamBuffer, const byte *IV, size_t length)
{
CRYPTOPP_UNUSED(keystreamBuffer), CRYPTOPP_UNUSED(length);
CRYPTOPP_ASSERT(length==8);
GetBlock<word32, LittleEndian> get(IV);
m_state[12] = m_state[13] = 0;
get(m_state[14])(m_state[15]);
}
template<unsigned int R>
void ChaCha_Policy<R>::SeekToIteration(lword iterationCount)
{
CRYPTOPP_UNUSED(iterationCount);
throw NotImplemented(std::string(ChaCha_Info<R>::StaticAlgorithmName()) + ": SeekToIteration is not yet implemented");
// TODO: these were Salsa20, and Wei re-arranged the state array for SSE2 operations.
// If we can generate some out-of-band test vectors, then test and implement. Also
// see the test vectors in salsa.txt and the use of Seek test argument.
// m_state[8] = (word32)iterationCount;
// m_state[5] = (word32)SafeRightShift<32>(iterationCount);
}
template<unsigned int R>
unsigned int ChaCha_Policy<R>::GetAlignment() const
{
#if CRYPTOPP_SSE2_ASM_AVAILABLE && 0
if (HasSSE2())
return 16;
else
#endif
return GetAlignmentOf<word32>();
}
template<unsigned int R>
unsigned int ChaCha_Policy<R>::GetOptimalBlockSize() const
{
#if CRYPTOPP_SSE2_ASM_AVAILABLE && 0
if (HasSSE2())
return 4*BYTES_PER_ITERATION;
else
#endif
return BYTES_PER_ITERATION;
}
template<unsigned int R>
void ChaCha_Policy<R>::OperateKeystream(KeystreamOperation operation, byte *output, const byte *input, size_t iterationCount)
{
word32 x0, x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15;
while (iterationCount--)
{
x0 = m_state[0]; x1 = m_state[1]; x2 = m_state[2]; x3 = m_state[3];
x4 = m_state[4]; x5 = m_state[5]; x6 = m_state[6]; x7 = m_state[7];
x8 = m_state[8]; x9 = m_state[9]; x10 = m_state[10]; x11 = m_state[11];
x12 = m_state[12]; x13 = m_state[13]; x14 = m_state[14]; x15 = m_state[15];
for (int i = static_cast<int>(ROUNDS); i > 0; i -= 2)
{
CHACHA_QUARTER_ROUND(x0, x4, x8, x12);
CHACHA_QUARTER_ROUND(x1, x5, x9, x13);
CHACHA_QUARTER_ROUND(x2, x6, x10, x14);
CHACHA_QUARTER_ROUND(x3, x7, x11, x15);
CHACHA_QUARTER_ROUND(x0, x5, x10, x15);
CHACHA_QUARTER_ROUND(x1, x6, x11, x12);
CHACHA_QUARTER_ROUND(x2, x7, x8, x13);
CHACHA_QUARTER_ROUND(x3, x4, x9, x14);
}
#undef CHACHA_OUTPUT
#define CHACHA_OUTPUT(x){\
CRYPTOPP_KEYSTREAM_OUTPUT_WORD(x, LITTLE_ENDIAN_ORDER, 0, x0 + m_state[0]);\
CRYPTOPP_KEYSTREAM_OUTPUT_WORD(x, LITTLE_ENDIAN_ORDER, 1, x1 + m_state[1]);\
CRYPTOPP_KEYSTREAM_OUTPUT_WORD(x, LITTLE_ENDIAN_ORDER, 2, x2 + m_state[2]);\
CRYPTOPP_KEYSTREAM_OUTPUT_WORD(x, LITTLE_ENDIAN_ORDER, 3, x3 + m_state[3]);\
CRYPTOPP_KEYSTREAM_OUTPUT_WORD(x, LITTLE_ENDIAN_ORDER, 4, x4 + m_state[4]);\
CRYPTOPP_KEYSTREAM_OUTPUT_WORD(x, LITTLE_ENDIAN_ORDER, 5, x5 + m_state[5]);\
CRYPTOPP_KEYSTREAM_OUTPUT_WORD(x, LITTLE_ENDIAN_ORDER, 6, x6 + m_state[6]);\
CRYPTOPP_KEYSTREAM_OUTPUT_WORD(x, LITTLE_ENDIAN_ORDER, 7, x7 + m_state[7]);\
CRYPTOPP_KEYSTREAM_OUTPUT_WORD(x, LITTLE_ENDIAN_ORDER, 8, x8 + m_state[8]);\
CRYPTOPP_KEYSTREAM_OUTPUT_WORD(x, LITTLE_ENDIAN_ORDER, 9, x9 + m_state[9]);\
CRYPTOPP_KEYSTREAM_OUTPUT_WORD(x, LITTLE_ENDIAN_ORDER, 10, x10 + m_state[10]);\
CRYPTOPP_KEYSTREAM_OUTPUT_WORD(x, LITTLE_ENDIAN_ORDER, 11, x11 + m_state[11]);\
CRYPTOPP_KEYSTREAM_OUTPUT_WORD(x, LITTLE_ENDIAN_ORDER, 12, x12 + m_state[12]);\
CRYPTOPP_KEYSTREAM_OUTPUT_WORD(x, LITTLE_ENDIAN_ORDER, 13, x13 + m_state[13]);\
CRYPTOPP_KEYSTREAM_OUTPUT_WORD(x, LITTLE_ENDIAN_ORDER, 14, x14 + m_state[14]);\
CRYPTOPP_KEYSTREAM_OUTPUT_WORD(x, LITTLE_ENDIAN_ORDER, 15, x15 + m_state[15]);}
#ifndef CRYPTOPP_DOXYGEN_PROCESSING
CRYPTOPP_KEYSTREAM_OUTPUT_SWITCH(CHACHA_OUTPUT, BYTES_PER_ITERATION);
input += (!!xorInput)*4*BYTES_PER_ITERATION;
output += 4*BYTES_PER_ITERATION;
iterationCount -= 4;
}
}
#endif
++m_state[12];
m_state[13] += static_cast<word32>(m_state[12] == 0);
}
#if (CRYPTOPP_ARM_NEON_AVAILABLE)
if (HasNEON())
{
while (iterationCount >= 4 && MultiBlockSafe(state[12], 4))
{
const bool xorInput = (operation & EnumToInt(INPUT_NULL)) != EnumToInt(INPUT_NULL);
ChaCha_OperateKeystream_NEON(state, xorInput ? input : NULLPTR, output, rounds);
// MultiBlockSafe avoids overflow on the counter words
state[12] += 4;
input += (!!xorInput)*4*BYTES_PER_ITERATION;
output += 4*BYTES_PER_ITERATION;
iterationCount -= 4;
}
}
#endif
#if (CRYPTOPP_ALTIVEC_AVAILABLE)
if (HasAltivec())
{
while (iterationCount >= 4 && MultiBlockSafe(state[12], 4))
{
const bool xorInput = (operation & EnumToInt(INPUT_NULL)) != EnumToInt(INPUT_NULL);
ChaCha_OperateKeystream_ALTIVEC(state, xorInput ? input : NULLPTR, output, rounds);
// MultiBlockSafe avoids overflow on the counter words
state[12] += 4;
input += (!!xorInput)*4*BYTES_PER_ITERATION;
output += 4*BYTES_PER_ITERATION;
iterationCount -= 4;
}
}
#endif
if (iterationCount)
{
word32 x0, x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15;
x0 = state[0]; x1 = state[1]; x2 = state[2]; x3 = state[3];
x4 = state[4]; x5 = state[5]; x6 = state[6]; x7 = state[7];
x8 = state[8]; x9 = state[9]; x10 = state[10]; x11 = state[11];
x12 = state[12]; x13 = state[13]; x14 = state[14]; x15 = state[15];
for (int i = static_cast<int>(rounds); i > 0; i -= 2)
{
CHACHA_QUARTER_ROUND(x0, x4, x8, x12);
CHACHA_QUARTER_ROUND(x1, x5, x9, x13);
CHACHA_QUARTER_ROUND(x2, x6, x10, x14);
CHACHA_QUARTER_ROUND(x3, x7, x11, x15);
CHACHA_QUARTER_ROUND(x0, x5, x10, x15);
CHACHA_QUARTER_ROUND(x1, x6, x11, x12);
CHACHA_QUARTER_ROUND(x2, x7, x8, x13);
CHACHA_QUARTER_ROUND(x3, x4, x9, x14);
}
CRYPTOPP_KEYSTREAM_OUTPUT_SWITCH(CHACHA_OUTPUT, BYTES_PER_ITERATION);
// This is state[12] and state[13] from ChaCha. In the case of
// ChaChaTLS ctrHigh is a reference to a discard value.
if (++ctrLow == 0)
ctrHigh++;
}
// We may re-enter a SIMD keystream operation from here.
} while (iterationCount--);
}
template class ChaCha_Policy<8>;
template class ChaCha_Policy<12>;
template class ChaCha_Policy<20>;
// XChaCha key derivation
void HChaCha_OperateKeystream(const word32 state[16], word32 output[8])
{
word32 x0, x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15;
x0 = state[0]; x1 = state[1]; x2 = state[2]; x3 = state[3];
x4 = state[4]; x5 = state[5]; x6 = state[6]; x7 = state[7];
x8 = state[8]; x9 = state[9]; x10 = state[10]; x11 = state[11];
x12 = state[12]; x13 = state[13]; x14 = state[14]; x15 = state[15];
for (int i = 20; i > 0; i -= 2)
{
CHACHA_QUARTER_ROUND(x0, x4, x8, x12);
CHACHA_QUARTER_ROUND(x1, x5, x9, x13);
CHACHA_QUARTER_ROUND(x2, x6, x10, x14);
CHACHA_QUARTER_ROUND(x3, x7, x11, x15);
CHACHA_QUARTER_ROUND(x0, x5, x10, x15);
CHACHA_QUARTER_ROUND(x1, x6, x11, x12);
CHACHA_QUARTER_ROUND(x2, x7, x8, x13);
CHACHA_QUARTER_ROUND(x3, x4, x9, x14);
}
output[0] = x0; output[1] = x1;
output[2] = x2; output[3] = x3;
output[4] = x12; output[5] = x13;
output[6] = x14; output[7] = x15;
}
std::string ChaCha_AlgorithmProvider()
{
#if (CRYPTOPP_AVX2_AVAILABLE)
if (HasAVX2())
return "AVX2";
else
#endif
#if (CRYPTOPP_SSE2_INTRIN_AVAILABLE)
if (HasSSE2())
return "SSE2";
else
#endif
#if (CRYPTOPP_ARM_NEON_AVAILABLE)
if (HasNEON())
return "NEON";
else
#endif
#if (CRYPTOPP_ALTIVEC_AVAILABLE)
if (HasAltivec())
return "Altivec";
else
#endif
return "C++";
}
unsigned int ChaCha_GetAlignment()
{
#if (CRYPTOPP_AVX2_AVAILABLE)
if (HasAVX2())
return 16;
else
#endif
#if (CRYPTOPP_SSE2_INTRIN_AVAILABLE)
if (HasSSE2())
return 16;
else
#endif
#if (CRYPTOPP_ALTIVEC_AVAILABLE)
if (HasAltivec())
return 16;
else
#endif
return GetAlignmentOf<word32>();
}
unsigned int ChaCha_GetOptimalBlockSize()
{
#if (CRYPTOPP_AVX2_AVAILABLE)
if (HasAVX2())
return 8 * BYTES_PER_ITERATION;
else
#endif
#if (CRYPTOPP_SSE2_INTRIN_AVAILABLE)
if (HasSSE2())
return 4*BYTES_PER_ITERATION;
else
#endif
#if (CRYPTOPP_ARM_NEON_AVAILABLE)
if (HasNEON())
return 4*BYTES_PER_ITERATION;
else
#endif
#if (CRYPTOPP_ALTIVEC_AVAILABLE)
if (HasAltivec())
return 4*BYTES_PER_ITERATION;
else
#endif
return BYTES_PER_ITERATION;
}
ANONYMOUS_NAMESPACE_END
NAMESPACE_BEGIN(CryptoPP)
////////////////////////////// Bernstein ChaCha //////////////////////////////
std::string ChaCha_Policy::AlgorithmName() const
{
return std::string("ChaCha")+IntToString(m_rounds);
}
std::string ChaCha_Policy::AlgorithmProvider() const
{
return ChaCha_AlgorithmProvider();
}
void ChaCha_Policy::CipherSetKey(const NameValuePairs &params, const byte *key, size_t length)
{
CRYPTOPP_ASSERT(key); CRYPTOPP_ASSERT(length == 16 || length == 32);
CRYPTOPP_UNUSED(key); CRYPTOPP_UNUSED(length);
// Use previous rounds as the default value
int rounds = params.GetIntValueWithDefault(Name::Rounds(), m_rounds);
if (rounds != 20 && rounds != 12 && rounds != 8)
throw InvalidRounds(ChaCha::StaticAlgorithmName(), rounds);
// Latch a good value
m_rounds = rounds;
// "expand 16-byte k" or "expand 32-byte k"
m_state[0] = 0x61707865;
m_state[1] = (length == 16) ? 0x3120646e : 0x3320646e;
m_state[2] = (length == 16) ? 0x79622d36 : 0x79622d32;
m_state[3] = 0x6b206574;
GetBlock<word32, LittleEndian> get1(key);
get1(m_state[4])(m_state[5])(m_state[6])(m_state[7]);
GetBlock<word32, LittleEndian> get2(key + ((length == 32) ? 16 : 0));
get2(m_state[8])(m_state[9])(m_state[10])(m_state[11]);
}
void ChaCha_Policy::CipherResynchronize(byte *keystreamBuffer, const byte *IV, size_t length)
{
CRYPTOPP_UNUSED(keystreamBuffer), CRYPTOPP_UNUSED(length);
CRYPTOPP_ASSERT(length==8); CRYPTOPP_UNUSED(length);
GetBlock<word32, LittleEndian> get(IV);
m_state[12] = m_state[13] = 0;
get(m_state[14])(m_state[15]);
}
void ChaCha_Policy::SeekToIteration(lword iterationCount)
{
m_state[12] = (word32)iterationCount; // low word
m_state[13] = (word32)SafeRightShift<32>(iterationCount);
}
unsigned int ChaCha_Policy::GetAlignment() const
{
return ChaCha_GetAlignment();
}
unsigned int ChaCha_Policy::GetOptimalBlockSize() const
{
return ChaCha_GetOptimalBlockSize();
}
void ChaCha_Policy::OperateKeystream(KeystreamOperation operation,
byte *output, const byte *input, size_t iterationCount)
{
ChaCha_OperateKeystream(operation, m_state, m_state[12], m_state[13],
m_rounds, output, input, iterationCount);
}
////////////////////////////// IETF ChaChaTLS //////////////////////////////
std::string ChaChaTLS_Policy::AlgorithmName() const
{
return std::string("ChaChaTLS");
}
std::string ChaChaTLS_Policy::AlgorithmProvider() const
{
return ChaCha_AlgorithmProvider();
}
void ChaChaTLS_Policy::CipherSetKey(const NameValuePairs &params, const byte *key, size_t length)
{
CRYPTOPP_ASSERT(key); CRYPTOPP_ASSERT(length == 32);
CRYPTOPP_UNUSED(length);
// ChaChaTLS is always 20 rounds. Fetch Rounds() to avoid a spurious failure.
int rounds = params.GetIntValueWithDefault(Name::Rounds(), ROUNDS);
if (rounds != 20)
throw InvalidRounds(ChaChaTLS::StaticAlgorithmName(), rounds);
// RFC 8439 test vectors use an initial block counter. However, the counter
// can be an arbitrary value per RFC 8439 Section 2.4. We stash the counter
// away in state[16] and use it for a Resynchronize() operation. I think
// the initial counter is used more like a Tweak when non-0, and it should
// be provided in Resynchronize() (light-weight re-keying). However,
// Resynchronize() does not have an overload that allows us to pass it into
// the function, so we have to use the heavier-weight SetKey to change it.
word64 block;
if (params.GetValue("InitialBlock", block))
m_counter = static_cast<word32>(block);
else
m_counter = 0;
// State words are defined in RFC 8439, Section 2.3. Key is 32-bytes.
GetBlock<word32, LittleEndian> get(key);
get(m_state[KEY+0])(m_state[KEY+1])(m_state[KEY+2])(m_state[KEY+3])
(m_state[KEY+4])(m_state[KEY+5])(m_state[KEY+6])(m_state[KEY+7]);
}
void ChaChaTLS_Policy::CipherResynchronize(byte *keystreamBuffer, const byte *IV, size_t length)
{
CRYPTOPP_UNUSED(keystreamBuffer), CRYPTOPP_UNUSED(length);
CRYPTOPP_ASSERT(length==12);
// State words are defined in RFC 8439, Section 2.3.
m_state[0] = 0x61707865; m_state[1] = 0x3320646e;
m_state[2] = 0x79622d32; m_state[3] = 0x6b206574;
// Copy saved key into state
std::memcpy(m_state+4, m_state+KEY, 8*sizeof(word32));
// State words are defined in RFC 8439, Section 2.3
GetBlock<word32, LittleEndian> get(IV);
m_state[12] = m_counter;
get(m_state[13])(m_state[14])(m_state[15]);
}
void ChaChaTLS_Policy::SeekToIteration(lword iterationCount)
{
// Should we throw here??? If the initial block counter is
// large then we can wrap and process more data as long as
// data processed in the security context does not exceed
// 2^32 blocks or approximately 256 GB of data.
CRYPTOPP_ASSERT(iterationCount <= std::numeric_limits<word32>::max());
m_state[12] = (word32)iterationCount; // low word
}
unsigned int ChaChaTLS_Policy::GetAlignment() const
{
return ChaCha_GetAlignment();
}
unsigned int ChaChaTLS_Policy::GetOptimalBlockSize() const
{
return ChaCha_GetOptimalBlockSize();
}
void ChaChaTLS_Policy::OperateKeystream(KeystreamOperation operation,
byte *output, const byte *input, size_t iterationCount)
{
word32 discard=0;
ChaCha_OperateKeystream(operation, m_state, m_state[12], discard,
ROUNDS, output, input, iterationCount);
// If this fires it means ChaCha_OperateKeystream generated a counter
// block carry that was discarded. The problem is, the RFC does not
// specify what should happen when the counter block wraps. All we can
// do is inform the user that something bad may happen because we don't
// know what we should do.
// Also see https://github.com/weidai11/cryptopp/issues/790 and
// https://mailarchive.ietf.org/arch/msg/cfrg/gsOnTJzcbgG6OqD8Sc0GO5aR_tU
// CRYPTOPP_ASSERT(discard==0);
}
////////////////////////////// IETF XChaCha20 //////////////////////////////
std::string XChaCha20_Policy::AlgorithmName() const
{
return std::string("XChaCha20");
}
std::string XChaCha20_Policy::AlgorithmProvider() const
{
return ChaCha_AlgorithmProvider();
}
void XChaCha20_Policy::CipherSetKey(const NameValuePairs &params, const byte *key, size_t length)
{
CRYPTOPP_ASSERT(key); CRYPTOPP_ASSERT(length == 32);
CRYPTOPP_UNUSED(length);
// Use previous rounds as the default value
int rounds = params.GetIntValueWithDefault(Name::Rounds(), m_rounds);
if (rounds != 20 && rounds != 12)
throw InvalidRounds(ChaCha::StaticAlgorithmName(), rounds);
// Latch a good value
m_rounds = rounds;
word64 block;
if (params.GetValue("InitialBlock", block))
m_counter = static_cast<word32>(block);
else
m_counter = 1;
// Stash key away for use in CipherResynchronize
GetBlock<word32, LittleEndian> get(key);
get(m_state[KEY+0])(m_state[KEY+1])(m_state[KEY+2])(m_state[KEY+3])
(m_state[KEY+4])(m_state[KEY+5])(m_state[KEY+6])(m_state[KEY+7]);
}
void XChaCha20_Policy::CipherResynchronize(byte *keystreamBuffer, const byte *iv, size_t length)
{
CRYPTOPP_UNUSED(keystreamBuffer), CRYPTOPP_UNUSED(length);
CRYPTOPP_ASSERT(length==24);
// HChaCha derivation
m_state[0] = 0x61707865; m_state[1] = 0x3320646e;
m_state[2] = 0x79622d32; m_state[3] = 0x6b206574;
// Copy saved key into state
std::memcpy(m_state+4, m_state+KEY, 8*sizeof(word32));
GetBlock<word32, LittleEndian> get(iv);
get(m_state[12])(m_state[13])(m_state[14])(m_state[15]);
// Operate the keystream without adding state back in.
// This function also gathers the key words into a
// contiguous 8-word block.
HChaCha_OperateKeystream(m_state, m_state+4);
// XChaCha state
m_state[0] = 0x61707865; m_state[1] = 0x3320646e;
m_state[2] = 0x79622d32; m_state[3] = 0x6b206574;
// Setup new IV
m_state[12] = m_counter;
m_state[13] = 0;
m_state[14] = GetWord<word32>(false, LITTLE_ENDIAN_ORDER, iv+16);
m_state[15] = GetWord<word32>(false, LITTLE_ENDIAN_ORDER, iv+20);
}
void XChaCha20_Policy::SeekToIteration(lword iterationCount)
{
// Should we throw here??? XChaCha does not have a block
// counter, so I'm not sure how to seek on it.
CRYPTOPP_ASSERT(0); CRYPTOPP_UNUSED(iterationCount);
}
unsigned int XChaCha20_Policy::GetAlignment() const
{
return ChaCha_GetAlignment();
}
unsigned int XChaCha20_Policy::GetOptimalBlockSize() const
{
return ChaCha_GetOptimalBlockSize();
}
void XChaCha20_Policy::OperateKeystream(KeystreamOperation operation,
byte *output, const byte *input, size_t iterationCount)
{
ChaCha_OperateKeystream(operation, m_state, m_state[12], m_state[13],
m_rounds, output, input, iterationCount);
}
NAMESPACE_END

View File

@ -1,14 +1,30 @@
// chacha.h - written and placed in the public domain by Jeffrey Walton.
// Based on Wei Dai's Salsa20 and Bernstein's reference ChaCha
// family implementation at http://cr.yp.to/chacha.html.
// Based on Wei Dai's Salsa20, Botan's SSE2 implementation,
// and Bernstein's reference ChaCha family implementation at
// http://cr.yp.to/chacha.html.
// The library added Bernstein's ChaCha classes at Crypto++ 5.6.4. The IETF
// uses a slightly different implementation than Bernstein, and the IETF
// ChaCha and XChaCha classes were added at Crypto++ 8.1. We wanted to maintain
// ABI compatibility at the 8.1 release so the original ChaCha classes were not
// disturbed. Instead new classes were added for IETF ChaCha. The back-end
// implementation shares code as expected, however.
/// \file chacha.h
/// \brief Classes for ChaCha8, ChaCha12 and ChaCha20 stream ciphers
/// \details Crypto++ provides Bernstein and ECRYPT's ChaCha from <a href="http://cr.yp.to/chacha/chacha-20080128.pdf">ChaCha,
/// a variant of Salsa20</a> (2008.01.28). Bernstein's implementation is _slightly_ different from the TLS working group's
/// implementation for cipher suites <tt>TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256</tt>,
/// <tt>TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256</tt>, and <tt>TLS_DHE_RSA_WITH_CHACHA20_POLY1305_SHA256</tt>.
/// \since Crypto++ 5.6.4
/// \details Crypto++ provides Bernstein and ECRYPT's ChaCha from <a
/// href="http://cr.yp.to/chacha/chacha-20080128.pdf">ChaCha, a
/// variant of Salsa20</a> (2008.01.28). Crypto++ also provides the
/// IETF implementation of ChaCha using the ChaChaTLS name. Bernstein's
/// implementation is _slightly_ different from the TLS working group's
/// implementation for cipher suites
/// <tt>TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256</tt>,
/// <tt>TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256</tt>,
/// and <tt>TLS_DHE_RSA_WITH_CHACHA20_POLY1305_SHA256</tt>. Finally,
/// the library provides <a
/// href="https://tools.ietf.org/html/draft-arciszewski-xchacha">XChaCha:
/// eXtended-nonce ChaCha and AEAD_XChaCha20_Poly1305 (rev. 03)</a>.
/// \since ChaCha since Crypto++ 5.6.4, ChaChaTLS and XChaCha20 since Crypto++ 8.1
#ifndef CRYPTOPP_CHACHA_H
#define CRYPTOPP_CHACHA_H
@ -18,66 +34,188 @@
NAMESPACE_BEGIN(CryptoPP)
////////////////////////////// Bernstein ChaCha //////////////////////////////
/// \brief ChaCha stream cipher information
/// \since Crypto++ 5.6.4
template <unsigned int R>
struct ChaCha_Info : public VariableKeyLength<32, 16, 32, 16, SimpleKeyingInterface::UNIQUE_IV, 8>, public FixedRounds<R>
struct ChaCha_Info : public VariableKeyLength<32, 16, 32, 16, SimpleKeyingInterface::UNIQUE_IV, 8>
{
CRYPTOPP_STATIC_CONSTEXPR const char* StaticAlgorithmName() {
return (R==8?"ChaCha8":(R==12?"ChaCha12":(R==20?"ChaCha20":"ChaCha")));
}
/// \brief The algorithm name
/// \return the algorithm name
/// \details StaticAlgorithmName returns the algorithm's name as a static
/// member function.
/// \details Bernstein named the cipher variants ChaCha8, ChaCha12 and
/// ChaCha20. More generally, Bernstein called the family ChaCha{r}.
/// AlgorithmName() provides the exact name once rounds are set.
static const char* StaticAlgorithmName() {
return "ChaCha";
}
};
/// \brief ChaCha stream cipher implementation
/// \since Crypto++ 5.6.4
template <unsigned int R>
class CRYPTOPP_NO_VTABLE ChaCha_Policy : public AdditiveCipherConcretePolicy<word32, 16>
{
public:
virtual ~ChaCha_Policy() {}
ChaCha_Policy() : m_rounds(ROUNDS) {}
protected:
CRYPTOPP_CONSTANT(ROUNDS=FixedRounds<R>::ROUNDS)
void CipherSetKey(const NameValuePairs &params, const byte *key, size_t length);
void OperateKeystream(KeystreamOperation operation, byte *output, const byte *input, size_t iterationCount);
void CipherResynchronize(byte *keystreamBuffer, const byte *IV, size_t length);
bool CipherIsRandomAccess() const {return true;}
void SeekToIteration(lword iterationCount);
unsigned int GetAlignment() const;
unsigned int GetOptimalBlockSize() const;
void CipherSetKey(const NameValuePairs &params, const byte *key, size_t length);
void OperateKeystream(KeystreamOperation operation, byte *output, const byte *input, size_t iterationCount);
void CipherResynchronize(byte *keystreamBuffer, const byte *IV, size_t length);
bool CipherIsRandomAccess() const {return false;} // TODO
void SeekToIteration(lword iterationCount);
unsigned int GetAlignment() const;
unsigned int GetOptimalBlockSize() const;
std::string AlgorithmName() const;
std::string AlgorithmProvider() const;
FixedSizeAlignedSecBlock<word32, 16> m_state;
CRYPTOPP_CONSTANT(ROUNDS = 20); // Default rounds
FixedSizeAlignedSecBlock<word32, 16> m_state;
unsigned int m_rounds;
};
/// \brief ChaCha8 stream cipher
/// \sa <a href="http://cr.yp.to/chacha/chacha-20080128.pdf">ChaCha, a variant of Salsa20</a> (2008.01.28).
/// \brief ChaCha stream cipher
/// \details This is Bernstein and ECRYPT's ChaCha. It is _slightly_ different
/// from the IETF's version of ChaCha called ChaChaTLS.
/// \sa <a href="http://cr.yp.to/chacha/chacha-20080208.pdf">ChaCha, a variant
/// of Salsa20</a> (2008.01.28).
/// \since Crypto++ 5.6.4
struct ChaCha8 : public ChaCha_Info<8>, public SymmetricCipherDocumentation
struct ChaCha : public ChaCha_Info, public SymmetricCipherDocumentation
{
typedef SymmetricCipherFinal<ConcretePolicyHolder<ChaCha_Policy<8>, AdditiveCipherTemplate<> >, ChaCha_Info<8> > Encryption;
typedef Encryption Decryption;
/// \brief ChaCha Encryption
typedef SymmetricCipherFinal<ConcretePolicyHolder<ChaCha_Policy, AdditiveCipherTemplate<> >, ChaCha_Info > Encryption;
/// \brief ChaCha Decryption
typedef Encryption Decryption;
};
/// \brief ChaCha12 stream cipher
/// \details Bernstein and ECRYPT's ChaCha is _slightly_ different from the TLS working group's implementation for
/// cipher suites <tt>TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256</tt>,
/// <tt>TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256</tt>, and <tt>TLS_DHE_RSA_WITH_CHACHA20_POLY1305_SHA256</tt>.
/// \sa <a href="http://cr.yp.to/chacha/chacha-20080128.pdf">ChaCha, a variant of Salsa20</a> (2008.01.28).
/// \since Crypto++ 5.6.4
struct ChaCha12 : public ChaCha_Info<12>, public SymmetricCipherDocumentation
////////////////////////////// IETF ChaChaTLS //////////////////////////////
/// \brief IETF ChaCha20 stream cipher information
/// \since Crypto++ 8.1
struct ChaChaTLS_Info : public FixedKeyLength<32, SimpleKeyingInterface::UNIQUE_IV, 12>, FixedRounds<20>
{
typedef SymmetricCipherFinal<ConcretePolicyHolder<ChaCha_Policy<12>, AdditiveCipherTemplate<> >, ChaCha_Info<12> > Encryption;
typedef Encryption Decryption;
/// \brief The algorithm name
/// \return the algorithm name
/// \details StaticAlgorithmName returns the algorithm's name as a static
/// member function.
/// \details This is the IETF's variant of Bernstein's ChaCha from RFC
/// 8439. IETF ChaCha is called ChaChaTLS in the Crypto++ library. It
/// is _slightly_ different from Bernstein's implementation.
static const char* StaticAlgorithmName() {
return "ChaChaTLS";
}
};
/// \brief ChaCha20 stream cipher
/// \sa <a href="http://cr.yp.to/chacha/chacha-20080128.pdf">ChaCha, a variant of Salsa20</a> (2008.01.28).
/// \details Bernstein and ECRYPT's ChaCha is _slightly_ different from the TLS working group's implementation for
/// cipher suites <tt>TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256</tt>,
/// <tt>TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256</tt>, and <tt>TLS_DHE_RSA_WITH_CHACHA20_POLY1305_SHA256</tt>.
/// \since Crypto++ 5.6.4
struct ChaCha20 : public ChaCha_Info<20>, public SymmetricCipherDocumentation
/// \brief IETF ChaCha20 stream cipher implementation
/// \since Crypto++ 8.1
class CRYPTOPP_NO_VTABLE ChaChaTLS_Policy : public AdditiveCipherConcretePolicy<word32, 16>
{
typedef SymmetricCipherFinal<ConcretePolicyHolder<ChaCha_Policy<20>, AdditiveCipherTemplate<> >, ChaCha_Info<20> > Encryption;
typedef Encryption Decryption;
public:
virtual ~ChaChaTLS_Policy() {}
ChaChaTLS_Policy() : m_counter(0) {}
protected:
void CipherSetKey(const NameValuePairs &params, const byte *key, size_t length);
void OperateKeystream(KeystreamOperation operation, byte *output, const byte *input, size_t iterationCount);
void CipherResynchronize(byte *keystreamBuffer, const byte *IV, size_t length);
bool CipherIsRandomAccess() const {return true;}
void SeekToIteration(lword iterationCount);
unsigned int GetAlignment() const;
unsigned int GetOptimalBlockSize() const;
std::string AlgorithmName() const;
std::string AlgorithmProvider() const;
FixedSizeAlignedSecBlock<word32, 16+8> m_state;
unsigned int m_counter;
CRYPTOPP_CONSTANT(ROUNDS = ChaChaTLS_Info::ROUNDS);
CRYPTOPP_CONSTANT(KEY = 16); // Index into m_state
CRYPTOPP_CONSTANT(CTR = 24); // Index into m_state
};
/// \brief IETF ChaCha20 stream cipher
/// \details This is the IETF's variant of Bernstein's ChaCha from RFC 8439.
/// IETF ChaCha is called ChaChaTLS in the Crypto++ library. It is
/// _slightly_ different from the Bernstein implementation. ChaCha-TLS
/// can be used for cipher suites
/// <tt>TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256</tt>,
/// <tt>TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256</tt>, and
/// <tt>TLS_DHE_RSA_WITH_CHACHA20_POLY1305_SHA256</tt>.
/// \sa <a href="https://tools.ietf.org/html/rfc8439">RFC 8439, ChaCha20 and
/// Poly1305 for IETF Protocols</a>, <A
/// HREF="https://mailarchive.ietf.org/arch/msg/cfrg/gsOnTJzcbgG6OqD8Sc0GO5aR_tU">How
/// to handle block counter wrap in IETF's ChaCha algorithm?</A> and
/// <A HREF="https://github.com/weidai11/cryptopp/issues/790">Issue
/// 790, ChaChaTLS results when counter block wraps</A>.
/// \since Crypto++ 8.1
struct ChaChaTLS : public ChaChaTLS_Info, public SymmetricCipherDocumentation
{
/// \brief ChaCha-TLS Encryption
typedef SymmetricCipherFinal<ConcretePolicyHolder<ChaChaTLS_Policy, AdditiveCipherTemplate<> >, ChaChaTLS_Info > Encryption;
/// \brief ChaCha-TLS Decryption
typedef Encryption Decryption;
};
////////////////////////////// IETF XChaCha20 draft //////////////////////////////
/// \brief IETF XChaCha20 stream cipher information
/// \since Crypto++ 8.1
struct XChaCha20_Info : public FixedKeyLength<32, SimpleKeyingInterface::UNIQUE_IV, 24>
{
/// \brief The algorithm name
/// \return the algorithm name
/// \details StaticAlgorithmName returns the algorithm's name as a static
/// member function.
/// \details This is the IETF's XChaCha from draft-arciszewski-xchacha.
static const char* StaticAlgorithmName() {
return "XChaCha20";
}
};
/// \brief IETF XChaCha20 stream cipher implementation
/// \since Crypto++ 8.1
class CRYPTOPP_NO_VTABLE XChaCha20_Policy : public AdditiveCipherConcretePolicy<word32, 16>
{
public:
virtual ~XChaCha20_Policy() {}
XChaCha20_Policy() : m_counter(0), m_rounds(ROUNDS) {}
protected:
void CipherSetKey(const NameValuePairs &params, const byte *key, size_t length);
void OperateKeystream(KeystreamOperation operation, byte *output, const byte *input, size_t iterationCount);
void CipherResynchronize(byte *keystreamBuffer, const byte *IV, size_t length);
bool CipherIsRandomAccess() const {return false;}
void SeekToIteration(lword iterationCount);
unsigned int GetAlignment() const;
unsigned int GetOptimalBlockSize() const;
std::string AlgorithmName() const;
std::string AlgorithmProvider() const;
FixedSizeAlignedSecBlock<word32, 16+8> m_state;
unsigned int m_counter, m_rounds;
CRYPTOPP_CONSTANT(ROUNDS = 20); // Default rounds
CRYPTOPP_CONSTANT(KEY = 16); // Index into m_state
};
/// \brief IETF XChaCha20 stream cipher
/// \details This is the IETF's XChaCha from draft-arciszewski-xchacha.
/// \sa <a href="https://tools.ietf.org/html/draft-arciszewski-xchacha">XChaCha:
/// eXtended-nonce ChaCha and AEAD_XChaCha20_Poly1305 (rev. 03)</a>, <A
/// HREF="https://mailarchive.ietf.org/arch/msg/cfrg/gsOnTJzcbgG6OqD8Sc0GO5aR_tU">How
/// to handle block counter wrap in IETF's ChaCha algorithm?</A> and
/// <A HREF="https://github.com/weidai11/cryptopp/issues/790">Issue
/// 790, ChaCha20 results when counter block wraps</A>.
/// \since Crypto++ 8.1
struct XChaCha20 : public XChaCha20_Info, public SymmetricCipherDocumentation
{
/// \brief XChaCha Encryption
typedef SymmetricCipherFinal<ConcretePolicyHolder<XChaCha20_Policy, AdditiveCipherTemplate<> >, XChaCha20_Info > Encryption;
/// \brief XChaCha Decryption
typedef Encryption Decryption;
};
NAMESPACE_END

View File

@ -0,0 +1,421 @@
// chacha_avx.cpp - written and placed in the public domain by
// Jack Lloyd and Jeffrey Walton
//
// This source file uses intrinsics and built-ins to gain access to
// AVX2 instructions. A separate source file is needed because
// additional CXXFLAGS are required to enable the appropriate
// instructions sets in some build configurations.
//
// AVX2 implementation based on Botan's chacha_avx.cpp. Many thanks
// to Jack Lloyd and the Botan team for allowing us to use it.
//
// Here are some relative numbers for ChaCha8:
// * Intel Skylake, 3.0 GHz: AVX2 at 4411 MB/s; 0.57 cpb.
// * Intel Broadwell, 2.3 GHz: AVX2 at 3828 MB/s; 0.58 cpb.
// * AMD Bulldozer, 3.3 GHz: AVX2 at 1680 MB/s; 1.47 cpb.
#include "pch.h"
#include "config.h"
#include "chacha.h"
#include "misc.h"
#if defined(CRYPTOPP_AVX2_AVAILABLE)
# include <xmmintrin.h>
# include <emmintrin.h>
# include <immintrin.h>
#endif
// Squash MS LNK4221 and libtool warnings
extern const char CHACHA_AVX_FNAME[] = __FILE__;
// Sun Studio 12.4 OK, 12.5 and 12.6 compile error.
#if (__SUNPRO_CC >= 0x5140) && (__SUNPRO_CC <= 0x5150)
# define MAYBE_CONST
#else
# define MAYBE_CONST const
#endif
// VS2017 and global optimization bug. Also see
// https://github.com/weidai11/cryptopp/issues/649 and
// https://github.com/weidai11/cryptopp/issues/735. The
// 649 issue affects AES but it is the same here. The 735
// issue is ChaCha AVX2 cut-in where it surfaced again.
#if (_MSC_VER >= 1910) && (_MSC_VER <= 1916)
# ifndef CRYPTOPP_DEBUG
# pragma optimize("", off)
# pragma optimize("ts", on)
# endif
#endif
// The data is aligned, but Clang issues warning based on type
// and not the actual alignment of the variable and data.
#if CRYPTOPP_GCC_DIAGNOSTIC_AVAILABLE
# pragma GCC diagnostic ignored "-Wcast-align"
#endif
ANONYMOUS_NAMESPACE_BEGIN
#if (CRYPTOPP_AVX2_AVAILABLE)
template <unsigned int R>
inline __m256i RotateLeft(const __m256i val)
{
return _mm256_or_si256(_mm256_slli_epi32(val, R), _mm256_srli_epi32(val, 32-R));
}
template <>
inline __m256i RotateLeft<8>(const __m256i val)
{
const __m256i mask = _mm256_set_epi8(14,13,12,15, 10,9,8,11, 6,5,4,7, 2,1,0,3,
14,13,12,15, 10,9,8,11, 6,5,4,7, 2,1,0,3);
return _mm256_shuffle_epi8(val, mask);
}
template <>
inline __m256i RotateLeft<16>(const __m256i val)
{
const __m256i mask = _mm256_set_epi8(13,12,15,14, 9,8,11,10, 5,4,7,6, 1,0,3,2,
13,12,15,14, 9,8,11,10, 5,4,7,6, 1,0,3,2);
return _mm256_shuffle_epi8(val, mask);
}
#endif // CRYPTOPP_AVX2_AVAILABLE
ANONYMOUS_NAMESPACE_END
NAMESPACE_BEGIN(CryptoPP)
#if (CRYPTOPP_AVX2_AVAILABLE)
void ChaCha_OperateKeystream_AVX2(const word32 *state, const byte* input, byte *output, unsigned int rounds)
{
const __m256i state0 = _mm256_broadcastsi128_si256(
_mm_loadu_si128(reinterpret_cast<const __m128i*>(state+0*4)));
const __m256i state1 = _mm256_broadcastsi128_si256(
_mm_loadu_si128(reinterpret_cast<const __m128i*>(state+1*4)));
const __m256i state2 = _mm256_broadcastsi128_si256(
_mm_loadu_si128(reinterpret_cast<const __m128i*>(state+2*4)));
const __m256i state3 = _mm256_broadcastsi128_si256(
_mm_loadu_si128(reinterpret_cast<const __m128i*>(state+3*4)));
const word32 C = 0xFFFFFFFFu - state[12];
const __m256i CTR0 = _mm256_set_epi32(0, 0, 0, 0, 0, 0, C < 4, 4);
const __m256i CTR1 = _mm256_set_epi32(0, 0, C < 1, 1, 0, 0, C < 5, 5);
const __m256i CTR2 = _mm256_set_epi32(0, 0, C < 2, 2, 0, 0, C < 6, 6);
const __m256i CTR3 = _mm256_set_epi32(0, 0, C < 3, 3, 0, 0, C < 7, 7);
__m256i X0_0 = state0;
__m256i X0_1 = state1;
__m256i X0_2 = state2;
__m256i X0_3 = _mm256_add_epi32(state3, CTR0);
__m256i X1_0 = state0;
__m256i X1_1 = state1;
__m256i X1_2 = state2;
__m256i X1_3 = _mm256_add_epi32(state3, CTR1);
__m256i X2_0 = state0;
__m256i X2_1 = state1;
__m256i X2_2 = state2;
__m256i X2_3 = _mm256_add_epi32(state3, CTR2);
__m256i X3_0 = state0;
__m256i X3_1 = state1;
__m256i X3_2 = state2;
__m256i X3_3 = _mm256_add_epi32(state3, CTR3);
for (int i = static_cast<int>(rounds); i > 0; i -= 2)
{
X0_0 = _mm256_add_epi32(X0_0, X0_1);
X1_0 = _mm256_add_epi32(X1_0, X1_1);
X2_0 = _mm256_add_epi32(X2_0, X2_1);
X3_0 = _mm256_add_epi32(X3_0, X3_1);
X0_3 = _mm256_xor_si256(X0_3, X0_0);
X1_3 = _mm256_xor_si256(X1_3, X1_0);
X2_3 = _mm256_xor_si256(X2_3, X2_0);
X3_3 = _mm256_xor_si256(X3_3, X3_0);
X0_3 = RotateLeft<16>(X0_3);
X1_3 = RotateLeft<16>(X1_3);
X2_3 = RotateLeft<16>(X2_3);
X3_3 = RotateLeft<16>(X3_3);
X0_2 = _mm256_add_epi32(X0_2, X0_3);
X1_2 = _mm256_add_epi32(X1_2, X1_3);
X2_2 = _mm256_add_epi32(X2_2, X2_3);
X3_2 = _mm256_add_epi32(X3_2, X3_3);
X0_1 = _mm256_xor_si256(X0_1, X0_2);
X1_1 = _mm256_xor_si256(X1_1, X1_2);
X2_1 = _mm256_xor_si256(X2_1, X2_2);
X3_1 = _mm256_xor_si256(X3_1, X3_2);
X0_1 = RotateLeft<12>(X0_1);
X1_1 = RotateLeft<12>(X1_1);
X2_1 = RotateLeft<12>(X2_1);
X3_1 = RotateLeft<12>(X3_1);
X0_0 = _mm256_add_epi32(X0_0, X0_1);
X1_0 = _mm256_add_epi32(X1_0, X1_1);
X2_0 = _mm256_add_epi32(X2_0, X2_1);
X3_0 = _mm256_add_epi32(X3_0, X3_1);
X0_3 = _mm256_xor_si256(X0_3, X0_0);
X1_3 = _mm256_xor_si256(X1_3, X1_0);
X2_3 = _mm256_xor_si256(X2_3, X2_0);
X3_3 = _mm256_xor_si256(X3_3, X3_0);
X0_3 = RotateLeft<8>(X0_3);
X1_3 = RotateLeft<8>(X1_3);
X2_3 = RotateLeft<8>(X2_3);
X3_3 = RotateLeft<8>(X3_3);
X0_2 = _mm256_add_epi32(X0_2, X0_3);
X1_2 = _mm256_add_epi32(X1_2, X1_3);
X2_2 = _mm256_add_epi32(X2_2, X2_3);
X3_2 = _mm256_add_epi32(X3_2, X3_3);
X0_1 = _mm256_xor_si256(X0_1, X0_2);
X1_1 = _mm256_xor_si256(X1_1, X1_2);
X2_1 = _mm256_xor_si256(X2_1, X2_2);
X3_1 = _mm256_xor_si256(X3_1, X3_2);
X0_1 = RotateLeft<7>(X0_1);
X1_1 = RotateLeft<7>(X1_1);
X2_1 = RotateLeft<7>(X2_1);
X3_1 = RotateLeft<7>(X3_1);
X0_1 = _mm256_shuffle_epi32(X0_1, _MM_SHUFFLE(0, 3, 2, 1));
X0_2 = _mm256_shuffle_epi32(X0_2, _MM_SHUFFLE(1, 0, 3, 2));
X0_3 = _mm256_shuffle_epi32(X0_3, _MM_SHUFFLE(2, 1, 0, 3));
X1_1 = _mm256_shuffle_epi32(X1_1, _MM_SHUFFLE(0, 3, 2, 1));
X1_2 = _mm256_shuffle_epi32(X1_2, _MM_SHUFFLE(1, 0, 3, 2));
X1_3 = _mm256_shuffle_epi32(X1_3, _MM_SHUFFLE(2, 1, 0, 3));
X2_1 = _mm256_shuffle_epi32(X2_1, _MM_SHUFFLE(0, 3, 2, 1));
X2_2 = _mm256_shuffle_epi32(X2_2, _MM_SHUFFLE(1, 0, 3, 2));
X2_3 = _mm256_shuffle_epi32(X2_3, _MM_SHUFFLE(2, 1, 0, 3));
X3_1 = _mm256_shuffle_epi32(X3_1, _MM_SHUFFLE(0, 3, 2, 1));
X3_2 = _mm256_shuffle_epi32(X3_2, _MM_SHUFFLE(1, 0, 3, 2));
X3_3 = _mm256_shuffle_epi32(X3_3, _MM_SHUFFLE(2, 1, 0, 3));
X0_0 = _mm256_add_epi32(X0_0, X0_1);
X1_0 = _mm256_add_epi32(X1_0, X1_1);
X2_0 = _mm256_add_epi32(X2_0, X2_1);
X3_0 = _mm256_add_epi32(X3_0, X3_1);
X0_3 = _mm256_xor_si256(X0_3, X0_0);
X1_3 = _mm256_xor_si256(X1_3, X1_0);
X2_3 = _mm256_xor_si256(X2_3, X2_0);
X3_3 = _mm256_xor_si256(X3_3, X3_0);
X0_3 = RotateLeft<16>(X0_3);
X1_3 = RotateLeft<16>(X1_3);
X2_3 = RotateLeft<16>(X2_3);
X3_3 = RotateLeft<16>(X3_3);
X0_2 = _mm256_add_epi32(X0_2, X0_3);
X1_2 = _mm256_add_epi32(X1_2, X1_3);
X2_2 = _mm256_add_epi32(X2_2, X2_3);
X3_2 = _mm256_add_epi32(X3_2, X3_3);
X0_1 = _mm256_xor_si256(X0_1, X0_2);
X1_1 = _mm256_xor_si256(X1_1, X1_2);
X2_1 = _mm256_xor_si256(X2_1, X2_2);
X3_1 = _mm256_xor_si256(X3_1, X3_2);
X0_1 = RotateLeft<12>(X0_1);
X1_1 = RotateLeft<12>(X1_1);
X2_1 = RotateLeft<12>(X2_1);
X3_1 = RotateLeft<12>(X3_1);
X0_0 = _mm256_add_epi32(X0_0, X0_1);
X1_0 = _mm256_add_epi32(X1_0, X1_1);
X2_0 = _mm256_add_epi32(X2_0, X2_1);
X3_0 = _mm256_add_epi32(X3_0, X3_1);
X0_3 = _mm256_xor_si256(X0_3, X0_0);
X1_3 = _mm256_xor_si256(X1_3, X1_0);
X2_3 = _mm256_xor_si256(X2_3, X2_0);
X3_3 = _mm256_xor_si256(X3_3, X3_0);
X0_3 = RotateLeft<8>(X0_3);
X1_3 = RotateLeft<8>(X1_3);
X2_3 = RotateLeft<8>(X2_3);
X3_3 = RotateLeft<8>(X3_3);
X0_2 = _mm256_add_epi32(X0_2, X0_3);
X1_2 = _mm256_add_epi32(X1_2, X1_3);
X2_2 = _mm256_add_epi32(X2_2, X2_3);
X3_2 = _mm256_add_epi32(X3_2, X3_3);
X0_1 = _mm256_xor_si256(X0_1, X0_2);
X1_1 = _mm256_xor_si256(X1_1, X1_2);
X2_1 = _mm256_xor_si256(X2_1, X2_2);
X3_1 = _mm256_xor_si256(X3_1, X3_2);
X0_1 = RotateLeft<7>(X0_1);
X1_1 = RotateLeft<7>(X1_1);
X2_1 = RotateLeft<7>(X2_1);
X3_1 = RotateLeft<7>(X3_1);
X0_1 = _mm256_shuffle_epi32(X0_1, _MM_SHUFFLE(2, 1, 0, 3));
X0_2 = _mm256_shuffle_epi32(X0_2, _MM_SHUFFLE(1, 0, 3, 2));
X0_3 = _mm256_shuffle_epi32(X0_3, _MM_SHUFFLE(0, 3, 2, 1));
X1_1 = _mm256_shuffle_epi32(X1_1, _MM_SHUFFLE(2, 1, 0, 3));
X1_2 = _mm256_shuffle_epi32(X1_2, _MM_SHUFFLE(1, 0, 3, 2));
X1_3 = _mm256_shuffle_epi32(X1_3, _MM_SHUFFLE(0, 3, 2, 1));
X2_1 = _mm256_shuffle_epi32(X2_1, _MM_SHUFFLE(2, 1, 0, 3));
X2_2 = _mm256_shuffle_epi32(X2_2, _MM_SHUFFLE(1, 0, 3, 2));
X2_3 = _mm256_shuffle_epi32(X2_3, _MM_SHUFFLE(0, 3, 2, 1));
X3_1 = _mm256_shuffle_epi32(X3_1, _MM_SHUFFLE(2, 1, 0, 3));
X3_2 = _mm256_shuffle_epi32(X3_2, _MM_SHUFFLE(1, 0, 3, 2));
X3_3 = _mm256_shuffle_epi32(X3_3, _MM_SHUFFLE(0, 3, 2, 1));
}
X0_0 = _mm256_add_epi32(X0_0, state0);
X0_1 = _mm256_add_epi32(X0_1, state1);
X0_2 = _mm256_add_epi32(X0_2, state2);
X0_3 = _mm256_add_epi32(X0_3, state3);
X0_3 = _mm256_add_epi32(X0_3, CTR0);
X1_0 = _mm256_add_epi32(X1_0, state0);
X1_1 = _mm256_add_epi32(X1_1, state1);
X1_2 = _mm256_add_epi32(X1_2, state2);
X1_3 = _mm256_add_epi32(X1_3, state3);
X1_3 = _mm256_add_epi32(X1_3, CTR1);
X2_0 = _mm256_add_epi32(X2_0, state0);
X2_1 = _mm256_add_epi32(X2_1, state1);
X2_2 = _mm256_add_epi32(X2_2, state2);
X2_3 = _mm256_add_epi32(X2_3, state3);
X2_3 = _mm256_add_epi32(X2_3, CTR2);
X3_0 = _mm256_add_epi32(X3_0, state0);
X3_1 = _mm256_add_epi32(X3_1, state1);
X3_2 = _mm256_add_epi32(X3_2, state2);
X3_3 = _mm256_add_epi32(X3_3, state3);
X3_3 = _mm256_add_epi32(X3_3, CTR3);
if (input)
{
_mm256_storeu_si256(reinterpret_cast<__m256i*>(output+0*32),
_mm256_xor_si256(_mm256_permute2x128_si256(X0_0, X0_1, 1 + (3 << 4)),
_mm256_loadu_si256(const_cast<MAYBE_CONST __m256i*>(reinterpret_cast<const __m256i*>(input+0*32)))));
_mm256_storeu_si256(reinterpret_cast<__m256i*>(output+1*32),
_mm256_xor_si256(_mm256_permute2x128_si256(X0_2, X0_3, 1 + (3 << 4)),
_mm256_loadu_si256(const_cast<MAYBE_CONST __m256i*>(reinterpret_cast<const __m256i*>(input+1*32)))));
_mm256_storeu_si256(reinterpret_cast<__m256i*>(output+2*32),
_mm256_xor_si256(_mm256_permute2x128_si256(X1_0, X1_1, 1 + (3 << 4)),
_mm256_loadu_si256(const_cast<MAYBE_CONST __m256i*>(reinterpret_cast<const __m256i*>(input+2*32)))));
_mm256_storeu_si256(reinterpret_cast<__m256i*>(output+3*32),
_mm256_xor_si256(_mm256_permute2x128_si256(X1_2, X1_3, 1 + (3 << 4)),
_mm256_loadu_si256(const_cast<MAYBE_CONST __m256i*>(reinterpret_cast<const __m256i*>(input+3*32)))));
}
else
{
_mm256_storeu_si256(reinterpret_cast<__m256i*>(output+0*32),
_mm256_permute2x128_si256(X0_0, X0_1, 1 + (3 << 4)));
_mm256_storeu_si256(reinterpret_cast<__m256i*>(output+1*32),
_mm256_permute2x128_si256(X0_2, X0_3, 1 + (3 << 4)));
_mm256_storeu_si256(reinterpret_cast<__m256i*>(output+2*32),
_mm256_permute2x128_si256(X1_0, X1_1, 1 + (3 << 4)));
_mm256_storeu_si256(reinterpret_cast<__m256i*>(output+3*32),
_mm256_permute2x128_si256(X1_2, X1_3, 1 + (3 << 4)));
}
if (input)
{
_mm256_storeu_si256(reinterpret_cast<__m256i*>(output+4*32),
_mm256_xor_si256(_mm256_permute2x128_si256(X2_0, X2_1, 1 + (3 << 4)),
_mm256_loadu_si256(const_cast<MAYBE_CONST __m256i*>(reinterpret_cast<const __m256i*>(input+4*32)))));
_mm256_storeu_si256(reinterpret_cast<__m256i*>(output+5*32),
_mm256_xor_si256(_mm256_permute2x128_si256(X2_2, X2_3, 1 + (3 << 4)),
_mm256_loadu_si256(const_cast<MAYBE_CONST __m256i*>(reinterpret_cast<const __m256i*>(input+5*32)))));
_mm256_storeu_si256(reinterpret_cast<__m256i*>(output+6*32),
_mm256_xor_si256(_mm256_permute2x128_si256(X3_0, X3_1, 1 + (3 << 4)),
_mm256_loadu_si256(const_cast<MAYBE_CONST __m256i*>(reinterpret_cast<const __m256i*>(input+6*32)))));
_mm256_storeu_si256(reinterpret_cast<__m256i*>(output+7*32),
_mm256_xor_si256(_mm256_permute2x128_si256(X3_2, X3_3, 1 + (3 << 4)),
_mm256_loadu_si256(const_cast<MAYBE_CONST __m256i*>(reinterpret_cast<const __m256i*>(input+7*32)))));
}
else
{
_mm256_storeu_si256(reinterpret_cast<__m256i*>(output+4*32),
_mm256_permute2x128_si256(X2_0, X2_1, 1 + (3 << 4)));
_mm256_storeu_si256(reinterpret_cast<__m256i*>(output+5*32),
_mm256_permute2x128_si256(X2_2, X2_3, 1 + (3 << 4)));
_mm256_storeu_si256(reinterpret_cast<__m256i*>(output+6*32),
_mm256_permute2x128_si256(X3_0, X3_1, 1 + (3 << 4)));
_mm256_storeu_si256(reinterpret_cast<__m256i*>(output+7*32),
_mm256_permute2x128_si256(X3_2, X3_3, 1 + (3 << 4)));
}
if (input)
{
_mm256_storeu_si256(reinterpret_cast<__m256i*>(output+ 8*32),
_mm256_xor_si256(_mm256_permute2x128_si256(X0_0, X0_1, 0 + (2 << 4)),
_mm256_loadu_si256(const_cast<MAYBE_CONST __m256i*>(reinterpret_cast<const __m256i*>(input+8*32)))));
_mm256_storeu_si256(reinterpret_cast<__m256i*>(output+ 9*32),
_mm256_xor_si256(_mm256_permute2x128_si256(X0_2, X0_3, 0 + (2 << 4)),
_mm256_loadu_si256(const_cast<MAYBE_CONST __m256i*>(reinterpret_cast<const __m256i*>(input+9*32)))));
_mm256_storeu_si256(reinterpret_cast<__m256i*>(output+10*32),
_mm256_xor_si256(_mm256_permute2x128_si256(X1_0, X1_1, 0 + (2 << 4)),
_mm256_loadu_si256(const_cast<MAYBE_CONST __m256i*>(reinterpret_cast<const __m256i*>(input+10*32)))));
_mm256_storeu_si256(reinterpret_cast<__m256i*>(output+11*32),
_mm256_xor_si256(_mm256_permute2x128_si256(X1_2, X1_3, 0 + (2 << 4)),
_mm256_loadu_si256(const_cast<MAYBE_CONST __m256i*>(reinterpret_cast<const __m256i*>(input+11*32)))));
}
else
{
_mm256_storeu_si256(reinterpret_cast<__m256i*>(output+ 8*32),
_mm256_permute2x128_si256(X0_0, X0_1, 0 + (2 << 4)));
_mm256_storeu_si256(reinterpret_cast<__m256i*>(output+ 9*32),
_mm256_permute2x128_si256(X0_2, X0_3, 0 + (2 << 4)));
_mm256_storeu_si256(reinterpret_cast<__m256i*>(output+10*32),
_mm256_permute2x128_si256(X1_0, X1_1, 0 + (2 << 4)));
_mm256_storeu_si256(reinterpret_cast<__m256i*>(output+11*32),
_mm256_permute2x128_si256(X1_2, X1_3, 0 + (2 << 4)));
}
if (input)
{
_mm256_storeu_si256(reinterpret_cast<__m256i*>(output+12*32),
_mm256_xor_si256(_mm256_permute2x128_si256(X2_0, X2_1, 0 + (2 << 4)),
_mm256_loadu_si256(const_cast<MAYBE_CONST __m256i*>(reinterpret_cast<const __m256i*>(input+12*32)))));
_mm256_storeu_si256(reinterpret_cast<__m256i*>(output+13*32),
_mm256_xor_si256(_mm256_permute2x128_si256(X2_2, X2_3, 0 + (2 << 4)),
_mm256_loadu_si256(const_cast<MAYBE_CONST __m256i*>(reinterpret_cast<const __m256i*>(input+13*32)))));
_mm256_storeu_si256(reinterpret_cast<__m256i*>(output+14*32),
_mm256_xor_si256(_mm256_permute2x128_si256(X3_0, X3_1, 0 + (2 << 4)),
_mm256_loadu_si256(const_cast<MAYBE_CONST __m256i*>(reinterpret_cast<const __m256i*>(input+14*32)))));
_mm256_storeu_si256(reinterpret_cast<__m256i*>(output+15*32),
_mm256_xor_si256(_mm256_permute2x128_si256(X3_2, X3_3, 0 + (2 << 4)),
_mm256_loadu_si256(const_cast<MAYBE_CONST __m256i*>(reinterpret_cast<const __m256i*>(input+15*32)))));
}
else
{
_mm256_storeu_si256(reinterpret_cast<__m256i*>(output+12*32),
_mm256_permute2x128_si256(X2_0, X2_1, 0 + (2 << 4)));
_mm256_storeu_si256(reinterpret_cast<__m256i*>(output+13*32),
_mm256_permute2x128_si256(X2_2, X2_3, 0 + (2 << 4)));
_mm256_storeu_si256(reinterpret_cast<__m256i*>(output+14*32),
_mm256_permute2x128_si256(X3_0, X3_1, 0 + (2 << 4)));
_mm256_storeu_si256(reinterpret_cast<__m256i*>(output+15*32),
_mm256_permute2x128_si256(X3_2, X3_3, 0 + (2 << 4)));
}
// https://software.intel.com/en-us/articles/avoiding-avx-sse-transition-penalties
_mm256_zeroupper();
}
#endif // CRYPTOPP_AVX2_AVAILABLE
NAMESPACE_END

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,211 @@
// chachapoly.cpp - written and placed in the public domain by Jeffrey Walton
// RFC 8439, Section 2.8, AEAD Construction, http://tools.ietf.org/html/rfc8439
#include "pch.h"
#include "chachapoly.h"
#include "algparam.h"
#include "misc.h"
#if CRYPTOPP_MSC_VERSION
# pragma warning(disable: 4244)
#endif
NAMESPACE_BEGIN(CryptoPP)
////////////////////////////// IETF ChaChaTLS //////////////////////////////
// RekeyCipherAndMac is heavier-weight than we like. The Authenc framework was
// predicated on BlockCiphers, where the key and key schedule could be
// calculated independent of the IV being used. However, the ChaCha and
// ChaCha20Poly1305 construction combines key setup and IV. That is, both are
// needed to key or rekey the cipher. Even a simple Resync() requires us to
// regenerate the initial state for both ChaCha20 and Poly1305.
void ChaCha20Poly1305_Base::RekeyCipherAndMac(const byte *userKey, size_t keylength, const NameValuePairs &params)
{
// Derive MAC key
AlgorithmParameters block0 = MakeParameters("InitialBlock", (word64)0, true);
AccessSymmetricCipher().SetKey(userKey, keylength, CombinedNameValuePairs(params, block0));
// Only the first 256-bits are used to key the MAC
SecByteBlock derived(NULLPTR, 32);
AccessSymmetricCipher().ProcessString(derived, derived.size());
// Key the Poly1305 MAC
AccessMAC().SetKey(derived, derived.size(), params);
// Key the ChaCha20 cipher
AlgorithmParameters block1 = MakeParameters("InitialBlock", (word64)1, true);
AccessSymmetricCipher().SetKey(userKey, keylength, CombinedNameValuePairs(params, block1));
}
void ChaCha20Poly1305_Base::SetKeyWithoutResync(const byte *userKey, size_t userKeyLength, const NameValuePairs &params)
{
CRYPTOPP_ASSERT(userKey && userKeyLength == 32);
m_userKey.Assign(userKey, userKeyLength);
// ChaCha/Poly1305 initial state depends on both the key and IV. The
// IV may or may not be present during the call to SetKeyWithoutResync.
// If the IV is present, the framework will call SetKeyWithoutResync
// followed by Resynchronize which calls Resync. In this case we defer
// calculating the initial state until the call to Resynchronize.
// If the IV is not present, it avoids calling ChaCha's SetKey without
// an IV, which results in an exception. In this case the user will need
// to call Resynchronize to key ChaCha and Poly1305.
// RekeyCipherAndMac(userKey, userKeyLength, params);
CRYPTOPP_UNUSED(params);
}
void ChaCha20Poly1305_Base::Resync(const byte *iv, size_t len)
{
CRYPTOPP_ASSERT(iv && len == 12);
RekeyCipherAndMac(m_userKey, m_userKey.SizeInBytes(),
MakeParameters(Name::IV(), ConstByteArrayParameter(iv,len)));
}
size_t ChaCha20Poly1305_Base::AuthenticateBlocks(const byte *data, size_t len)
{
AccessMAC().Update(data, len);
return 0;
}
void ChaCha20Poly1305_Base::AuthenticateLastHeaderBlock()
{
// Pad to a multiple of 16 or 0
const byte zero[16] = {0};
size_t pad = (16U - (m_totalHeaderLength % 16)) % 16;
AccessMAC().Update(zero, pad);
}
void ChaCha20Poly1305_Base::AuthenticateLastConfidentialBlock()
{
// Pad to a multiple of 16 or 0
const byte zero[16] = {0};
size_t pad = (16U - (m_totalMessageLength % 16)) % 16;
AccessMAC().Update(zero, pad);
}
void ChaCha20Poly1305_Base::AuthenticateLastFooterBlock(byte *mac, size_t macSize)
{
CRYPTOPP_ALIGN_DATA(8) byte length[2*sizeof(word64)];
PutWord(true, LITTLE_ENDIAN_ORDER, length+0, m_totalHeaderLength);
PutWord(true, LITTLE_ENDIAN_ORDER, length+8, m_totalMessageLength);
AccessMAC().Update(length, sizeof(length));
AccessMAC().TruncatedFinal(mac, macSize);
m_state = State_KeySet;
}
void ChaCha20Poly1305_Base::EncryptAndAuthenticate(byte *ciphertext, byte *mac, size_t macSize, const byte *iv, int ivLength, const byte *aad, size_t aadLength, const byte *message, size_t messageLength)
{
Resynchronize(iv, ivLength);
Update(aad, aadLength);
ProcessString(ciphertext, message, messageLength);
TruncatedFinal(mac, macSize);
}
bool ChaCha20Poly1305_Base::DecryptAndVerify(byte *message, const byte *mac, size_t macLength, const byte *iv, int ivLength, const byte *aad, size_t aadLength, const byte *ciphertext, size_t ciphertextLength)
{
Resynchronize(iv, ivLength);
Update(aad, aadLength);
ProcessString(message, ciphertext, ciphertextLength);
return TruncatedVerify(mac, macLength);
}
////////////////////////////// IETF XChaCha20 draft //////////////////////////////
// RekeyCipherAndMac is heavier-weight than we like. The Authenc framework was
// predicated on BlockCiphers, where the key and key schedule could be
// calculated independent of the IV being used. However, the ChaCha and
// ChaCha20Poly1305 construction combines key setup and IV. That is, both are
// needed to key or rekey the cipher. Even a simple Resync() requires us to
// regenerate the initial state for both ChaCha20 and Poly1305.
void XChaCha20Poly1305_Base::RekeyCipherAndMac(const byte *userKey, size_t keylength, const NameValuePairs &params)
{
// Derive MAC key
AlgorithmParameters block0 = MakeParameters("InitialBlock", (word64)0, true);
AccessSymmetricCipher().SetKey(userKey, keylength, CombinedNameValuePairs(params, block0));
// Only the first 256-bits are used to key the MAC
SecByteBlock derived(NULLPTR, 32);
AccessSymmetricCipher().ProcessString(derived, derived.size());
// Key the Poly1305 MAC
AccessMAC().SetKey(derived, derived.size(), params);
// Key the ChaCha20 cipher
AlgorithmParameters block1 = MakeParameters("InitialBlock", (word64)1, true);
AccessSymmetricCipher().SetKey(userKey, keylength, CombinedNameValuePairs(params, block1));
}
void XChaCha20Poly1305_Base::SetKeyWithoutResync(const byte *userKey, size_t userKeyLength, const NameValuePairs &params)
{
CRYPTOPP_ASSERT(userKey && userKeyLength == 32);
m_userKey.Assign(userKey, userKeyLength);
// XChaCha20/Poly1305 initial state depends on both the key and IV. The
// IV may or may not be present during the call to SetKeyWithoutResync.
// If the IV is present, the framework will call SetKeyWithoutResync
// followed by Resynchronize which calls Resync. In this case we defer
// calculating the initial state until the call to Resynchronize.
// If the IV is not present, it avoids calling ChaCha's SetKey without
// an IV, which results in an exception. In this case the user will need
// to call Resynchronize to key ChaCha and Poly1305.
// RekeyCipherAndMac(userKey, userKeyLength, params);
CRYPTOPP_UNUSED(params);
}
void XChaCha20Poly1305_Base::Resync(const byte *iv, size_t len)
{
CRYPTOPP_ASSERT(iv && len == 24);
RekeyCipherAndMac(m_userKey, m_userKey.SizeInBytes(),
MakeParameters(Name::IV(), ConstByteArrayParameter(iv,len)));
}
size_t XChaCha20Poly1305_Base::AuthenticateBlocks(const byte *data, size_t len)
{
AccessMAC().Update(data, len);
return 0;
}
void XChaCha20Poly1305_Base::AuthenticateLastHeaderBlock()
{
// Pad to a multiple of 16 or 0
const byte zero[16] = {0};
size_t pad = (16 - (m_totalHeaderLength % 16)) % 16;
AccessMAC().Update(zero, pad);
}
void XChaCha20Poly1305_Base::AuthenticateLastConfidentialBlock()
{
// Pad to a multiple of 16 or 0
const byte zero[16] = {0};
size_t pad = (16 - (m_totalMessageLength % 16)) % 16;
AccessMAC().Update(zero, pad);
}
void XChaCha20Poly1305_Base::AuthenticateLastFooterBlock(byte *mac, size_t macSize)
{
CRYPTOPP_ALIGN_DATA(8) byte length[2*sizeof(word64)];
PutWord(true, LITTLE_ENDIAN_ORDER, length+0, m_totalHeaderLength);
PutWord(true, LITTLE_ENDIAN_ORDER, length+8, m_totalMessageLength);
AccessMAC().Update(length, sizeof(length));
AccessMAC().TruncatedFinal(mac, macSize);
m_state = State_KeySet;
}
void XChaCha20Poly1305_Base::EncryptAndAuthenticate(byte *ciphertext, byte *mac, size_t macSize, const byte *iv, int ivLength, const byte *aad, size_t aadLength, const byte *message, size_t messageLength)
{
Resynchronize(iv, ivLength);
Update(aad, aadLength);
ProcessString(ciphertext, message, messageLength);
TruncatedFinal(mac, macSize);
}
bool XChaCha20Poly1305_Base::DecryptAndVerify(byte *message, const byte *mac, size_t macLength, const byte *iv, int ivLength, const byte *aad, size_t aadLength, const byte *ciphertext, size_t ciphertextLength)
{
Resynchronize(iv, ivLength);
Update(aad, aadLength);
ProcessString(message, ciphertext, ciphertextLength);
return TruncatedVerify(mac, macLength);
}
NAMESPACE_END

View File

@ -0,0 +1,322 @@
// chachapoly.h - written and placed in the public domain by Jeffrey Walton
// RFC 8439, Section 2.8, AEAD Construction, http://tools.ietf.org/html/rfc8439
/// \file chachapoly.h
/// \brief IETF ChaCha20/Poly1305 AEAD scheme
/// \details ChaCha20Poly1305 is an authenticated encryption scheme that combines
/// ChaCha20TLS and Poly1305TLS. The scheme is defined in RFC 8439, section 2.8,
/// AEAD_CHACHA20_POLY1305 construction, and uses the IETF versions of ChaCha20
/// and Poly1305.
/// \sa <A HREF="http://tools.ietf.org/html/rfc8439">RFC 8439, ChaCha20 and Poly1305
/// for IETF Protocols</A>.
/// \since Crypto++ 8.1
#ifndef CRYPTOPP_CHACHA_POLY1305_H
#define CRYPTOPP_CHACHA_POLY1305_H
#include "cryptlib.h"
#include "authenc.h"
#include "chacha.h"
#include "poly1305.h"
NAMESPACE_BEGIN(CryptoPP)
////////////////////////////// IETF ChaChaTLS //////////////////////////////
/// \brief IETF ChaCha20Poly1305 cipher base implementation
/// \details Base implementation of the AuthenticatedSymmetricCipher interface
/// \since Crypto++ 8.1
class ChaCha20Poly1305_Base : public AuthenticatedSymmetricCipherBase
{
public:
CRYPTOPP_STATIC_CONSTEXPR const char* StaticAlgorithmName()
{return "ChaCha20/Poly1305";}
virtual ~ChaCha20Poly1305_Base() {}
// AuthenticatedSymmetricCipher
std::string AlgorithmName() const
{return std::string("ChaCha20/Poly1305");}
std::string AlgorithmProvider() const
{return GetSymmetricCipher().AlgorithmProvider();}
size_t MinKeyLength() const
{return 32;}
size_t MaxKeyLength() const
{return 32;}
size_t DefaultKeyLength() const
{return 32;}
size_t GetValidKeyLength(size_t n) const
{CRYPTOPP_UNUSED(n); return 32;}
bool IsValidKeyLength(size_t n) const
{return n==32;}
unsigned int OptimalDataAlignment() const
{return GetSymmetricCipher().OptimalDataAlignment();}
IV_Requirement IVRequirement() const
{return UNIQUE_IV;}
unsigned int IVSize() const
{return 12;}
unsigned int MinIVLength() const
{return 12;}
unsigned int MaxIVLength() const
{return 12;}
unsigned int DigestSize() const
{return 16;}
lword MaxHeaderLength() const
{return LWORD_MAX;} // 2^64-1 bytes
lword MaxMessageLength() const
{return W64LIT(274877906880);} // 2^38-1 blocks
lword MaxFooterLength() const
{return 0;}
/// \brief Encrypts and calculates a MAC in one call
/// \param ciphertext the encryption buffer
/// \param mac the mac buffer
/// \param macSize the size of the MAC buffer, in bytes
/// \param iv the iv buffer
/// \param ivLength the size of the IV buffer, in bytes
/// \param aad the AAD buffer
/// \param aadLength the size of the AAD buffer, in bytes
/// \param message the message buffer
/// \param messageLength the size of the messagetext buffer, in bytes
/// \details EncryptAndAuthenticate() encrypts and generates the MAC in one call. The function
/// truncates the MAC if <tt>macSize < TagSize()</tt>.
virtual void EncryptAndAuthenticate(byte *ciphertext, byte *mac, size_t macSize, const byte *iv, int ivLength, const byte *aad, size_t aadLength, const byte *message, size_t messageLength);
/// \brief Decrypts and verifies a MAC in one call
/// \param message the decryption buffer
/// \param mac the mac buffer
/// \param macSize the size of the MAC buffer, in bytes
/// \param iv the iv buffer
/// \param ivLength the size of the IV buffer, in bytes
/// \param aad the AAD buffer
/// \param aadLength the size of the AAD buffer, in bytes
/// \param ciphertext the cipher buffer
/// \param ciphertextLength the size of the ciphertext buffer, in bytes
/// \return true if the MAC is valid and the decoding succeeded, false otherwise
/// \details DecryptAndVerify() decrypts and verifies the MAC in one call.
/// <tt>message</tt> is a decryption buffer and should be at least as large as the ciphertext buffer.
/// \details The function returns true iff MAC is valid. DecryptAndVerify() assumes the MAC
/// is truncated if <tt>macLength < TagSize()</tt>.
virtual bool DecryptAndVerify(byte *message, const byte *mac, size_t macSize, const byte *iv, int ivLength, const byte *aad, size_t aadLength, const byte *ciphertext, size_t ciphertextLength);
protected:
// AuthenticatedSymmetricCipherBase
bool AuthenticationIsOnPlaintext() const {return false;}
unsigned int AuthenticationBlockSize() const {return 1;}
void SetKeyWithoutResync(const byte *userKey, size_t keylength, const NameValuePairs &params);
void Resync(const byte *iv, size_t len);
size_t AuthenticateBlocks(const byte *data, size_t len);
void AuthenticateLastHeaderBlock();
void AuthenticateLastConfidentialBlock();
void AuthenticateLastFooterBlock(byte *mac, size_t macSize);
// See comments in chachapoly.cpp
void RekeyCipherAndMac(const byte *userKey, size_t userKeyLength, const NameValuePairs &params);
virtual const MessageAuthenticationCode & GetMAC() const = 0;
virtual MessageAuthenticationCode & AccessMAC() = 0;
private:
SecByteBlock m_userKey;
};
/// \brief IETF ChaCha20Poly1305 cipher final implementation
/// \tparam T_IsEncryption flag indicating cipher direction
/// \details ChaCha20Poly1305 is an authenticated encryption scheme that combines
/// ChaCha20TLS and Poly1305TLS. The scheme is defined in RFC 8439, section 2.8,
/// AEAD_CHACHA20_POLY1305 construction, and uses the IETF versions of ChaCha20
/// and Poly1305.
/// \sa <A HREF="http://tools.ietf.org/html/rfc8439">RFC 8439, ChaCha20 and Poly1305
/// for IETF Protocols</A>.
/// \since Crypto++ 8.1
template <bool T_IsEncryption>
class ChaCha20Poly1305_Final : public ChaCha20Poly1305_Base
{
public:
virtual ~ChaCha20Poly1305_Final() {}
protected:
const SymmetricCipher & GetSymmetricCipher()
{return const_cast<ChaCha20Poly1305_Final *>(this)->AccessSymmetricCipher();}
SymmetricCipher & AccessSymmetricCipher()
{return m_cipher;}
bool IsForwardTransformation() const
{return T_IsEncryption;}
const MessageAuthenticationCode & GetMAC() const
{return const_cast<ChaCha20Poly1305_Final *>(this)->AccessMAC();}
MessageAuthenticationCode & AccessMAC()
{return m_mac;}
private:
ChaChaTLS::Encryption m_cipher;
Poly1305TLS m_mac;
};
/// \brief IETF ChaCha20/Poly1305 AEAD scheme
/// \details ChaCha20Poly1305 is an authenticated encryption scheme that combines
/// ChaCha20TLS and Poly1305TLS. The scheme is defined in RFC 8439, section 2.8,
/// AEAD_CHACHA20_POLY1305 construction, and uses the IETF versions of ChaCha20
/// and Poly1305.
/// \sa <A HREF="http://tools.ietf.org/html/rfc8439">RFC 8439, ChaCha20 and Poly1305
/// for IETF Protocols</A>.
/// \since Crypto++ 8.1
struct ChaCha20Poly1305 : public AuthenticatedSymmetricCipherDocumentation
{
/// \brief ChaCha20Poly1305 encryption
typedef ChaCha20Poly1305_Final<true> Encryption;
/// \brief ChaCha20Poly1305 decryption
typedef ChaCha20Poly1305_Final<false> Decryption;
};
////////////////////////////// IETF XChaCha20 draft //////////////////////////////
/// \brief IETF XChaCha20Poly1305 cipher base implementation
/// \details Base implementation of the AuthenticatedSymmetricCipher interface
/// \since Crypto++ 8.1
class XChaCha20Poly1305_Base : public AuthenticatedSymmetricCipherBase
{
public:
CRYPTOPP_STATIC_CONSTEXPR const char* StaticAlgorithmName()
{return "XChaCha20/Poly1305";}
virtual ~XChaCha20Poly1305_Base() {}
// AuthenticatedSymmetricCipher
std::string AlgorithmName() const
{return std::string("XChaCha20/Poly1305");}
std::string AlgorithmProvider() const
{return GetSymmetricCipher().AlgorithmProvider();}
size_t MinKeyLength() const
{return 32;}
size_t MaxKeyLength() const
{return 32;}
size_t DefaultKeyLength() const
{return 32;}
size_t GetValidKeyLength(size_t n) const
{CRYPTOPP_UNUSED(n); return 32;}
bool IsValidKeyLength(size_t n) const
{return n==32;}
unsigned int OptimalDataAlignment() const
{return GetSymmetricCipher().OptimalDataAlignment();}
IV_Requirement IVRequirement() const
{return UNIQUE_IV;}
unsigned int IVSize() const
{return 24;}
unsigned int MinIVLength() const
{return 24;}
unsigned int MaxIVLength() const
{return 24;}
unsigned int DigestSize() const
{return 16;}
lword MaxHeaderLength() const
{return LWORD_MAX;} // 2^64-1 bytes
lword MaxMessageLength() const
{return W64LIT(274877906880);} // 2^38-1 blocks
lword MaxFooterLength() const
{return 0;}
/// \brief Encrypts and calculates a MAC in one call
/// \param ciphertext the encryption buffer
/// \param mac the mac buffer
/// \param macSize the size of the MAC buffer, in bytes
/// \param iv the iv buffer
/// \param ivLength the size of the IV buffer, in bytes
/// \param aad the AAD buffer
/// \param aadLength the size of the AAD buffer, in bytes
/// \param message the message buffer
/// \param messageLength the size of the messagetext buffer, in bytes
/// \details EncryptAndAuthenticate() encrypts and generates the MAC in one call. The function
/// truncates the MAC if <tt>macSize < TagSize()</tt>.
virtual void EncryptAndAuthenticate(byte *ciphertext, byte *mac, size_t macSize, const byte *iv, int ivLength, const byte *aad, size_t aadLength, const byte *message, size_t messageLength);
/// \brief Decrypts and verifies a MAC in one call
/// \param message the decryption buffer
/// \param mac the mac buffer
/// \param macSize the size of the MAC buffer, in bytes
/// \param iv the iv buffer
/// \param ivLength the size of the IV buffer, in bytes
/// \param aad the AAD buffer
/// \param aadLength the size of the AAD buffer, in bytes
/// \param ciphertext the cipher buffer
/// \param ciphertextLength the size of the ciphertext buffer, in bytes
/// \return true if the MAC is valid and the decoding succeeded, false otherwise
/// \details DecryptAndVerify() decrypts and verifies the MAC in one call.
/// <tt>message</tt> is a decryption buffer and should be at least as large as the ciphertext buffer.
/// \details The function returns true iff MAC is valid. DecryptAndVerify() assumes the MAC
/// is truncated if <tt>macLength < TagSize()</tt>.
virtual bool DecryptAndVerify(byte *message, const byte *mac, size_t macSize, const byte *iv, int ivLength, const byte *aad, size_t aadLength, const byte *ciphertext, size_t ciphertextLength);
protected:
// AuthenticatedSymmetricCipherBase
bool AuthenticationIsOnPlaintext() const {return false;}
unsigned int AuthenticationBlockSize() const {return 1;}
void SetKeyWithoutResync(const byte *userKey, size_t keylength, const NameValuePairs &params);
void Resync(const byte *iv, size_t len);
size_t AuthenticateBlocks(const byte *data, size_t len);
void AuthenticateLastHeaderBlock();
void AuthenticateLastConfidentialBlock();
void AuthenticateLastFooterBlock(byte *mac, size_t macSize);
// See comments in chachapoly.cpp
void RekeyCipherAndMac(const byte *userKey, size_t userKeyLength, const NameValuePairs &params);
virtual const MessageAuthenticationCode & GetMAC() const = 0;
virtual MessageAuthenticationCode & AccessMAC() = 0;
private:
SecByteBlock m_userKey;
};
/// \brief IETF XChaCha20Poly1305 cipher final implementation
/// \tparam T_IsEncryption flag indicating cipher direction
/// \details XChaCha20Poly1305 is an authenticated encryption scheme that combines
/// XChaCha20 and Poly1305-TLS. The scheme is defined in RFC 8439, section 2.8,
/// AEAD_CHACHA20_POLY1305 construction, and uses the IETF versions of ChaCha20
/// and Poly1305.
/// \sa <A HREF="http://tools.ietf.org/html/rfc8439">RFC 8439, ChaCha20 and Poly1305
/// for IETF Protocols</A>.
/// \since Crypto++ 8.1
template <bool T_IsEncryption>
class XChaCha20Poly1305_Final : public XChaCha20Poly1305_Base
{
public:
virtual ~XChaCha20Poly1305_Final() {}
protected:
const SymmetricCipher & GetSymmetricCipher()
{return const_cast<XChaCha20Poly1305_Final *>(this)->AccessSymmetricCipher();}
SymmetricCipher & AccessSymmetricCipher()
{return m_cipher;}
bool IsForwardTransformation() const
{return T_IsEncryption;}
const MessageAuthenticationCode & GetMAC() const
{return const_cast<XChaCha20Poly1305_Final *>(this)->AccessMAC();}
MessageAuthenticationCode & AccessMAC()
{return m_mac;}
private:
XChaCha20::Encryption m_cipher;
Poly1305TLS m_mac;
};
/// \brief IETF XChaCha20/Poly1305 AEAD scheme
/// \details XChaCha20Poly1305 is an authenticated encryption scheme that combines
/// XChaCha20 and Poly1305-TLS. The scheme is defined in RFC 8439, section 2.8,
/// AEAD_XCHACHA20_POLY1305 construction, and uses the IETF versions of ChaCha20
/// and Poly1305.
/// \sa <A HREF="http://tools.ietf.org/html/rfc8439">RFC 8439, ChaCha20 and Poly1305
/// for IETF Protocols</A>.
/// \since Crypto++ 8.1
struct XChaCha20Poly1305 : public AuthenticatedSymmetricCipherDocumentation
{
/// \brief XChaCha20Poly1305 encryption
typedef XChaCha20Poly1305_Final<true> Encryption;
/// \brief XChaCha20Poly1305 decryption
typedef XChaCha20Poly1305_Final<false> Decryption;
};
NAMESPACE_END
#endif // CRYPTOPP_CHACHA_POLY1305_H

View File

@ -0,0 +1,365 @@
// cham.cpp - written and placed in the public domain by Kim Sung Hee and Jeffrey Walton
// Based on "CHAM: A Family of Lightweight Block Ciphers for
// Resource-Constrained Devices" by Bonwook Koo, Dongyoung Roh,
// Hyeonjin Kim, Younghoon Jung, Dong-Geon Lee, and Daesung Kwon
#include "pch.h"
#include "config.h"
#include "cham.h"
#include "misc.h"
#include "cpu.h"
// CHAM table of parameters
// +-------------------------------------------------
// +cipher n k r w k/w
// +-------------------------------------------------
// +CHAM-64/128 64 128 80 16 8
// +CHAM-128/128 128 128 80 32 4
// +CHAM-128/256 128 256 96 32 8
// +-------------------------------------------------
ANONYMOUS_NAMESPACE_BEGIN
using CryptoPP::rotlConstant;
using CryptoPP::rotrConstant;
/// \brief CHAM encryption round
/// \tparam RR the round number residue
/// \tparam KW the number of key words
/// \tparam T words type
/// \param x the state array
/// \param k the subkey table
/// \param i the round number
/// \details CHAM_EncRound applies the encryption round to the plain text.
/// RR is the "round residue" and it is used modulo 4. ProcessAndXorBlock
/// may provide a fully unrolled encryption transformation, or provide
/// a transformation that loops using multiples of 4 encryption rounds.
/// \details CHAM_EncRound calculates indexes into the x[] array based
/// on the round number residue. There is no need for the assignments
/// that shift values in preparations for the next round.
/// \details CHAM_EncRound depends on the round number. The actual round
/// being executed is passed through the parameter <tt>i</tt>. If
/// ProcessAndXorBlock fully unrolled the loop then the parameter
/// <tt>i</tt> would be unnecessary.
template <unsigned int RR, unsigned int KW, class T>
inline void CHAM_EncRound(T x[4], const T k[KW], unsigned int i)
{
CRYPTOPP_CONSTANT(IDX0 = (RR+0) % 4);
CRYPTOPP_CONSTANT(IDX1 = (RR+1) % 4);
CRYPTOPP_CONSTANT(IDX3 = (RR+3+1) % 4);
CRYPTOPP_CONSTANT(R1 = (RR % 2 == 0) ? 1 : 8);
CRYPTOPP_CONSTANT(R2 = (RR % 2 == 0) ? 8 : 1);
// Follows conventions in the ref impl
const T kk = k[i % KW];
const T aa = x[IDX0] ^ static_cast<T>(i);
const T bb = rotlConstant<R1>(x[IDX1]) ^ kk;
x[IDX3] = rotlConstant<R2>(static_cast<T>(aa + bb));
}
/// \brief CHAM decryption round
/// \tparam RR the round number residue
/// \tparam KW the number of key words
/// \tparam T words type
/// \param x the state array
/// \param k the subkey table
/// \param i the round number
/// \details CHAM_DecRound applies the decryption round to the cipher text.
/// RR is the "round residue" and it is used modulo 4. ProcessAndXorBlock
/// may provide a fully unrolled decryption transformation, or provide
/// a transformation that loops using multiples of 4 decryption rounds.
/// \details CHAM_DecRound calculates indexes into the x[] array based
/// on the round number residue. There is no need for the assignments
/// that shift values in preparations for the next round.
/// \details CHAM_DecRound depends on the round number. The actual round
/// being executed is passed through the parameter <tt>i</tt>. If
/// ProcessAndXorBlock fully unrolled the loop then the parameter
/// <tt>i</tt> would be unnecessary.
template <unsigned int RR, unsigned int KW, class T>
inline void CHAM_DecRound(T x[4], const T k[KW], unsigned int i)
{
CRYPTOPP_CONSTANT(IDX0 = (RR+0) % 4);
CRYPTOPP_CONSTANT(IDX1 = (RR+1) % 4);
CRYPTOPP_CONSTANT(IDX3 = (RR+3+1) % 4);
CRYPTOPP_CONSTANT(R1 = (RR % 2 == 0) ? 8 : 1);
CRYPTOPP_CONSTANT(R2 = (RR % 2 == 0) ? 1 : 8);
// Follows conventions in the ref impl
const T kk = k[i % KW];
const T aa = rotrConstant<R1>(x[IDX3]);
const T bb = rotlConstant<R2>(x[IDX1]) ^ kk;
x[IDX0] = static_cast<T>(aa - bb) ^ static_cast<T>(i);
}
ANONYMOUS_NAMESPACE_END
NAMESPACE_BEGIN(CryptoPP)
#if CRYPTOPP_CHAM128_ADVANCED_PROCESS_BLOCKS
# if (CRYPTOPP_SSSE3_AVAILABLE)
extern size_t CHAM64_Enc_AdvancedProcessBlocks_SSSE3(const word16* subKeys, size_t rounds,
const byte *inBlocks, const byte *xorBlocks, byte *outBlocks, size_t length, word32 flags);
extern size_t CHAM64_Dec_AdvancedProcessBlocks_SSSE3(const word16* subKeys, size_t rounds,
const byte *inBlocks, const byte *xorBlocks, byte *outBlocks, size_t length, word32 flags);
extern size_t CHAM128_Enc_AdvancedProcessBlocks_SSSE3(const word32* subKeys, size_t rounds,
const byte *inBlocks, const byte *xorBlocks, byte *outBlocks, size_t length, word32 flags);
extern size_t CHAM128_Dec_AdvancedProcessBlocks_SSSE3(const word32* subKeys, size_t rounds,
const byte *inBlocks, const byte *xorBlocks, byte *outBlocks, size_t length, word32 flags);
# endif // CRYPTOPP_SSSE3_AVAILABLE
#endif // CRYPTOPP_CHAM128_ADVANCED_PROCESS_BLOCKS
void CHAM64::Base::UncheckedSetKey(const byte *userKey, unsigned int keyLength, const NameValuePairs &params)
{
CRYPTOPP_UNUSED(params);
m_kw = keyLength/sizeof(word16);
m_rk.New(2*m_kw);
for (size_t i = 0; i < m_kw; userKey += sizeof(word32))
{
// Do not cast the buffer. It will SIGBUS on some ARM and SPARC.
const word32 rk = GetWord<word32>(false, BIG_ENDIAN_ORDER, userKey);
const word16 rk1 = static_cast<word16>(rk >> 16);
m_rk[i] = rk1 ^ rotlConstant<1>(rk1) ^ rotlConstant<8>(rk1);
m_rk[(i + m_kw) ^ 1] = rk1 ^ rotlConstant<1>(rk1) ^ rotlConstant<11>(rk1);
i++;
const word16 rk2 = static_cast<word16>(rk & 0xffff);
m_rk[i] = rk2 ^ rotlConstant<1>(rk2) ^ rotlConstant<8>(rk2);
m_rk[(i + m_kw) ^ 1] = rk2 ^ rotlConstant<1>(rk2) ^ rotlConstant<11>(rk2);
i++;
}
}
void CHAM64::Enc::ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const
{
// Do not cast the buffer. It will SIGBUS on some ARM and SPARC.
GetBlock<word16, BigEndian> iblock(inBlock);
iblock(m_x[0])(m_x[1])(m_x[2])(m_x[3]);
const int R = 80;
for (int i = 0; i < R; i+=16)
{
CHAM_EncRound< 0, 16>(m_x.begin(), m_rk.begin(), i+0);
CHAM_EncRound< 1, 16>(m_x.begin(), m_rk.begin(), i+1);
CHAM_EncRound< 2, 16>(m_x.begin(), m_rk.begin(), i+2);
CHAM_EncRound< 3, 16>(m_x.begin(), m_rk.begin(), i+3);
CHAM_EncRound< 4, 16>(m_x.begin(), m_rk.begin(), i+4);
CHAM_EncRound< 5, 16>(m_x.begin(), m_rk.begin(), i+5);
CHAM_EncRound< 6, 16>(m_x.begin(), m_rk.begin(), i+6);
CHAM_EncRound< 7, 16>(m_x.begin(), m_rk.begin(), i+7);
CHAM_EncRound< 8, 16>(m_x.begin(), m_rk.begin(), i+8);
CHAM_EncRound< 9, 16>(m_x.begin(), m_rk.begin(), i+9);
CHAM_EncRound<10, 16>(m_x.begin(), m_rk.begin(), i+10);
CHAM_EncRound<11, 16>(m_x.begin(), m_rk.begin(), i+11);
CHAM_EncRound<12, 16>(m_x.begin(), m_rk.begin(), i+12);
CHAM_EncRound<13, 16>(m_x.begin(), m_rk.begin(), i+13);
CHAM_EncRound<14, 16>(m_x.begin(), m_rk.begin(), i+14);
CHAM_EncRound<15, 16>(m_x.begin(), m_rk.begin(), i+15);
}
PutBlock<word16, BigEndian> oblock(xorBlock, outBlock);
oblock(m_x[0])(m_x[1])(m_x[2])(m_x[3]);
}
void CHAM64::Dec::ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const
{
// Do not cast the buffer. It will SIGBUS on some ARM and SPARC.
GetBlock<word16, BigEndian> iblock(inBlock);
iblock(m_x[0])(m_x[1])(m_x[2])(m_x[3]);
const int R = 80;
for (int i = R-1; i >=0 ; i-=16)
{
CHAM_DecRound<15, 16>(m_x.begin(), m_rk.begin(), i-0);
CHAM_DecRound<14, 16>(m_x.begin(), m_rk.begin(), i-1);
CHAM_DecRound<13, 16>(m_x.begin(), m_rk.begin(), i-2);
CHAM_DecRound<12, 16>(m_x.begin(), m_rk.begin(), i-3);
CHAM_DecRound<11, 16>(m_x.begin(), m_rk.begin(), i-4);
CHAM_DecRound<10, 16>(m_x.begin(), m_rk.begin(), i-5);
CHAM_DecRound< 9, 16>(m_x.begin(), m_rk.begin(), i-6);
CHAM_DecRound< 8, 16>(m_x.begin(), m_rk.begin(), i-7);
CHAM_DecRound< 7, 16>(m_x.begin(), m_rk.begin(), i-8);
CHAM_DecRound< 6, 16>(m_x.begin(), m_rk.begin(), i-9);
CHAM_DecRound< 5, 16>(m_x.begin(), m_rk.begin(), i-10);
CHAM_DecRound< 4, 16>(m_x.begin(), m_rk.begin(), i-11);
CHAM_DecRound< 3, 16>(m_x.begin(), m_rk.begin(), i-12);
CHAM_DecRound< 2, 16>(m_x.begin(), m_rk.begin(), i-13);
CHAM_DecRound< 1, 16>(m_x.begin(), m_rk.begin(), i-14);
CHAM_DecRound< 0, 16>(m_x.begin(), m_rk.begin(), i-15);
}
PutBlock<word16, BigEndian> oblock(xorBlock, outBlock);
oblock(m_x[0])(m_x[1])(m_x[2])(m_x[3]);
}
std::string CHAM128::Base::AlgorithmProvider() const
{
#if defined(CRYPTOPP_SSSE3_AVAILABLE)
if (HasSSSE3())
return "SSSE3";
#endif
return "C++";
}
void CHAM128::Base::UncheckedSetKey(const byte *userKey, unsigned int keyLength, const NameValuePairs &params)
{
CRYPTOPP_UNUSED(params);
m_kw = keyLength/sizeof(word32);
m_rk.New(2*m_kw);
for (size_t i = 0; i < m_kw; userKey += sizeof(word32))
{
// Do not cast the buffer. It will SIGBUS on some ARM and SPARC.
const word32 rk = GetWord<word32>(false, BIG_ENDIAN_ORDER, userKey);
m_rk[i] = rk ^ rotlConstant<1>(rk) ^ rotlConstant<8>(rk);
m_rk[(i + m_kw) ^ 1] = rk ^ rotlConstant<1>(rk) ^ rotlConstant<11>(rk);
i++;
}
}
void CHAM128::Enc::ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const
{
// Do not cast the buffer. It will SIGBUS on some ARM and SPARC.
GetBlock<word32, BigEndian> iblock(inBlock);
iblock(m_x[0])(m_x[1])(m_x[2])(m_x[3]);
switch (m_kw)
{
case 4: // 128-bit key
{
const int R = 80;
for (int i = 0; i < R; i+=8)
{
CHAM_EncRound<0, 8>(m_x.begin(), m_rk.begin(), i+0);
CHAM_EncRound<1, 8>(m_x.begin(), m_rk.begin(), i+1);
CHAM_EncRound<2, 8>(m_x.begin(), m_rk.begin(), i+2);
CHAM_EncRound<3, 8>(m_x.begin(), m_rk.begin(), i+3);
CHAM_EncRound<4, 8>(m_x.begin(), m_rk.begin(), i+4);
CHAM_EncRound<5, 8>(m_x.begin(), m_rk.begin(), i+5);
CHAM_EncRound<6, 8>(m_x.begin(), m_rk.begin(), i+6);
CHAM_EncRound<7, 8>(m_x.begin(), m_rk.begin(), i+7);
}
break;
}
case 8: // 256-bit key
{
const int R = 96;
for (int i = 0; i < R; i+=16)
{
CHAM_EncRound< 0, 16>(m_x.begin(), m_rk.begin(), i+0);
CHAM_EncRound< 1, 16>(m_x.begin(), m_rk.begin(), i+1);
CHAM_EncRound< 2, 16>(m_x.begin(), m_rk.begin(), i+2);
CHAM_EncRound< 3, 16>(m_x.begin(), m_rk.begin(), i+3);
CHAM_EncRound< 4, 16>(m_x.begin(), m_rk.begin(), i+4);
CHAM_EncRound< 5, 16>(m_x.begin(), m_rk.begin(), i+5);
CHAM_EncRound< 6, 16>(m_x.begin(), m_rk.begin(), i+6);
CHAM_EncRound< 7, 16>(m_x.begin(), m_rk.begin(), i+7);
CHAM_EncRound< 8, 16>(m_x.begin(), m_rk.begin(), i+8);
CHAM_EncRound< 9, 16>(m_x.begin(), m_rk.begin(), i+9);
CHAM_EncRound<10, 16>(m_x.begin(), m_rk.begin(), i+10);
CHAM_EncRound<11, 16>(m_x.begin(), m_rk.begin(), i+11);
CHAM_EncRound<12, 16>(m_x.begin(), m_rk.begin(), i+12);
CHAM_EncRound<13, 16>(m_x.begin(), m_rk.begin(), i+13);
CHAM_EncRound<14, 16>(m_x.begin(), m_rk.begin(), i+14);
CHAM_EncRound<15, 16>(m_x.begin(), m_rk.begin(), i+15);
}
break;
}
default:
CRYPTOPP_ASSERT(0);
}
PutBlock<word32, BigEndian> oblock(xorBlock, outBlock);
oblock(m_x[0])(m_x[1])(m_x[2])(m_x[3]);
}
void CHAM128::Dec::ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const
{
// Do not cast the buffer. It will SIGBUS on some ARM and SPARC.
GetBlock<word32, BigEndian> iblock(inBlock);
iblock(m_x[0])(m_x[1])(m_x[2])(m_x[3]);
switch (m_kw)
{
case 4: // 128-bit key
{
const int R = 80;
for (int i = R-1; i >= 0; i-=8)
{
CHAM_DecRound<7, 8>(m_x.begin(), m_rk.begin(), i-0);
CHAM_DecRound<6, 8>(m_x.begin(), m_rk.begin(), i-1);
CHAM_DecRound<5, 8>(m_x.begin(), m_rk.begin(), i-2);
CHAM_DecRound<4, 8>(m_x.begin(), m_rk.begin(), i-3);
CHAM_DecRound<3, 8>(m_x.begin(), m_rk.begin(), i-4);
CHAM_DecRound<2, 8>(m_x.begin(), m_rk.begin(), i-5);
CHAM_DecRound<1, 8>(m_x.begin(), m_rk.begin(), i-6);
CHAM_DecRound<0, 8>(m_x.begin(), m_rk.begin(), i-7);
}
break;
}
case 8: // 256-bit key
{
const int R = 96;
for (int i = R-1; i >= 0; i-=16)
{
CHAM_DecRound<15, 16>(m_x.begin(), m_rk.begin(), i-0);
CHAM_DecRound<14, 16>(m_x.begin(), m_rk.begin(), i-1);
CHAM_DecRound<13, 16>(m_x.begin(), m_rk.begin(), i-2);
CHAM_DecRound<12, 16>(m_x.begin(), m_rk.begin(), i-3);
CHAM_DecRound<11, 16>(m_x.begin(), m_rk.begin(), i-4);
CHAM_DecRound<10, 16>(m_x.begin(), m_rk.begin(), i-5);
CHAM_DecRound< 9, 16>(m_x.begin(), m_rk.begin(), i-6);
CHAM_DecRound< 8, 16>(m_x.begin(), m_rk.begin(), i-7);
CHAM_DecRound< 7, 16>(m_x.begin(), m_rk.begin(), i-8);
CHAM_DecRound< 6, 16>(m_x.begin(), m_rk.begin(), i-9);
CHAM_DecRound< 5, 16>(m_x.begin(), m_rk.begin(), i-10);
CHAM_DecRound< 4, 16>(m_x.begin(), m_rk.begin(), i-11);
CHAM_DecRound< 3, 16>(m_x.begin(), m_rk.begin(), i-12);
CHAM_DecRound< 2, 16>(m_x.begin(), m_rk.begin(), i-13);
CHAM_DecRound< 1, 16>(m_x.begin(), m_rk.begin(), i-14);
CHAM_DecRound< 0, 16>(m_x.begin(), m_rk.begin(), i-15);
}
break;
}
default:
CRYPTOPP_ASSERT(0);
}
PutBlock<word32, BigEndian> oblock(xorBlock, outBlock);
oblock(m_x[0])(m_x[1])(m_x[2])(m_x[3]);
}
#if CRYPTOPP_CHAM128_ADVANCED_PROCESS_BLOCKS
size_t CHAM128::Enc::AdvancedProcessBlocks(const byte *inBlocks, const byte *xorBlocks,
byte *outBlocks, size_t length, word32 flags) const
{
# if (CRYPTOPP_SSSE3_AVAILABLE)
if (HasSSSE3()) {
const size_t rounds = (m_kw == 4 ? 80 : 96);
return CHAM128_Enc_AdvancedProcessBlocks_SSSE3(m_rk, rounds,
inBlocks, xorBlocks, outBlocks, length, flags);
}
# endif // CRYPTOPP_SSSE3_AVAILABLE
return BlockTransformation::AdvancedProcessBlocks(inBlocks, xorBlocks, outBlocks, length, flags);
}
size_t CHAM128::Dec::AdvancedProcessBlocks(const byte *inBlocks, const byte *xorBlocks,
byte *outBlocks, size_t length, word32 flags) const
{
# if (CRYPTOPP_SSSE3_AVAILABLE)
if (HasSSSE3()) {
const size_t rounds = (m_kw == 4 ? 80 : 96);
return CHAM128_Dec_AdvancedProcessBlocks_SSSE3(m_rk, rounds,
inBlocks, xorBlocks, outBlocks, length, flags);
}
# endif // CRYPTOPP_SSSE3_AVAILABLE
return BlockTransformation::AdvancedProcessBlocks(inBlocks, xorBlocks, outBlocks, length, flags);
}
#endif // CRYPTOPP_CHAM128_ADVANCED_PROCESS_BLOCKS
NAMESPACE_END

View File

@ -0,0 +1,179 @@
// cham.h - written and placed in the public domain by Kim Sung Hee and Jeffrey Walton
// Based on "CHAM: A Family of Lightweight Block Ciphers for
// Resource-Constrained Devices" by Bonwook Koo, Dongyoung Roh,
// Hyeonjin Kim, Younghoon Jung, Dong-Geon Lee, and Daesung Kwon
/// \file cham.h
/// \brief Classes for the CHAM block cipher
/// \since Crypto++ 8.0
#ifndef CRYPTOPP_CHAM_H
#define CRYPTOPP_CHAM_H
#include "config.h"
#include "seckey.h"
#include "secblock.h"
#include "algparam.h"
#if (CRYPTOPP_BOOL_X64 || CRYPTOPP_BOOL_X32 || CRYPTOPP_BOOL_X86)
# define CRYPTOPP_CHAM128_ADVANCED_PROCESS_BLOCKS 1
#endif
// Yet another SunStudio/SunCC workaround. Failed self tests
// in SSE code paths on i386 for SunStudio 12.3 and below.
#if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x5120)
# undef CRYPTOPP_CHAM128_ADVANCED_PROCESS_BLOCKS
#endif
NAMESPACE_BEGIN(CryptoPP)
/// \brief CHAM block cipher information
/// \since Crypto++ 8.0
struct CHAM64_Info : public FixedBlockSize<8>, public FixedKeyLength<16>
{
/// \brief The algorithm name
/// \return the algorithm name
/// \details StaticAlgorithmName returns the algorithm's name as a static
/// member function.
static const std::string StaticAlgorithmName()
{
// Format is Cipher-Blocksize
return "CHAM-64";
}
};
/// \brief CHAM block cipher information
/// \since Crypto++ 8.0
struct CHAM128_Info : public FixedBlockSize<16>, public VariableKeyLength<16,16,32,16>
{
/// \brief The algorithm name
/// \return the algorithm name
/// \details StaticAlgorithmName returns the algorithm's name as a static
/// member function.
static const std::string StaticAlgorithmName()
{
// Format is Cipher-Blocksize
return "CHAM-128";
}
};
/// \brief CHAM 64-bit block cipher
/// \details CHAM64 provides 64-bit block size. The valid key size is 128-bit.
/// \note Crypto++ provides a byte oriented implementation
/// \sa CHAM128, <a href="http://www.cryptopp.com/wiki/CHAM">CHAM</a>,
/// <a href="https://pdfs.semanticscholar.org/2f57/61b5c2614cffd58a09cc83c375a2b32a2ed3.pdf">
/// CHAM: A Family of Lightweight Block Ciphers for Resource-Constrained Devices</a>
/// \since Crypto++ 8.0
class CRYPTOPP_NO_VTABLE CHAM64 : public CHAM64_Info, public BlockCipherDocumentation
{
public:
/// \brief CHAM block cipher transformation functions
/// \details Provides implementation common to encryption and decryption
/// \since Crypto++ 8.0
class CRYPTOPP_NO_VTABLE Base : public BlockCipherImpl<CHAM64_Info>
{
protected:
void UncheckedSetKey(const byte *userKey, unsigned int keyLength, const NameValuePairs &params);
SecBlock<word16> m_rk;
mutable FixedSizeSecBlock<word16, 4> m_x;
unsigned int m_kw;
};
/// \brief Encryption transformation
/// \details Enc provides implementation for encryption transformation. All key and block
/// sizes are supported.
/// \since Crypto++ 8.0
class CRYPTOPP_NO_VTABLE Enc : public Base
{
public:
void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const;
};
/// \brief Decryption transformation
/// \details Dec provides implementation for decryption transformation. All key and block
/// sizes are supported.
/// \since Crypto++ 8.0
class CRYPTOPP_NO_VTABLE Dec : public Base
{
public:
void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const;
};
/// \brief CHAM64 encryption
typedef BlockCipherFinal<ENCRYPTION, Enc> Encryption;
/// \brief CHAM64 decryption
typedef BlockCipherFinal<DECRYPTION, Dec> Decryption;
};
/// \brief CHAM64 encryption
typedef CHAM64::Encryption CHAM64Encryption;
/// \brief CHAM64 decryption
typedef CHAM64::Decryption CHAM64Decryption;
/// \brief CHAM 128-bit block cipher
/// \details CHAM128 provides 128-bit block size. The valid key size is 128-bit and 256-bit.
/// \note Crypto++ provides a byte oriented implementation
/// \sa CHAM64, <a href="http://www.cryptopp.com/wiki/CHAM">CHAM</a>,
/// <a href="https://pdfs.semanticscholar.org/2f57/61b5c2614cffd58a09cc83c375a2b32a2ed3.pdf">
/// CHAM: A Family of Lightweight Block Ciphers for Resource-Constrained Devices</a>
/// \since Crypto++ 8.0
class CRYPTOPP_NO_VTABLE CHAM128 : public CHAM128_Info, public BlockCipherDocumentation
{
public:
/// \brief CHAM block cipher transformation functions
/// \details Provides implementation common to encryption and decryption
/// \since Crypto++ 8.0
class CRYPTOPP_NO_VTABLE Base : public BlockCipherImpl<CHAM128_Info>
{
protected:
void UncheckedSetKey(const byte *userKey, unsigned int keyLength, const NameValuePairs &params);
std::string AlgorithmProvider() const;
SecBlock<word32> m_rk;
mutable FixedSizeSecBlock<word32, 4> m_x;
unsigned int m_kw;
};
/// \brief Encryption transformation
/// \details Enc provides implementation for encryption transformation. All key and block
/// sizes are supported.
/// \since Crypto++ 8.0
class CRYPTOPP_NO_VTABLE Enc : public Base
{
public:
void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const;
#if CRYPTOPP_CHAM128_ADVANCED_PROCESS_BLOCKS
size_t AdvancedProcessBlocks(const byte *inBlocks, const byte *xorBlocks, byte *outBlocks, size_t length, word32 flags) const;
#endif
};
/// \brief Decryption transformation
/// \details Dec provides implementation for decryption transformation. All key and block
/// sizes are supported.
/// \since Crypto++ 8.0
class CRYPTOPP_NO_VTABLE Dec : public Base
{
public:
void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const;
#if CRYPTOPP_CHAM128_ADVANCED_PROCESS_BLOCKS
size_t AdvancedProcessBlocks(const byte *inBlocks, const byte *xorBlocks, byte *outBlocks, size_t length, word32 flags) const;
#endif
};
/// \brief CHAM128 encryption
typedef BlockCipherFinal<ENCRYPTION, Enc> Encryption;
/// \brief CHAM128 decryption
typedef BlockCipherFinal<DECRYPTION, Dec> Decryption;
};
/// \brief CHAM128 encryption
typedef CHAM128::Encryption CHAM128Encryption;
/// \brief CHAM128 decryption
typedef CHAM128::Decryption CHAM128Decryption;
NAMESPACE_END
#endif // CRYPTOPP_CHAM_H

View File

@ -0,0 +1,478 @@
// cham_simd.cpp - written and placed in the public domain by Jeffrey Walton
//
// This source file uses intrinsics and built-ins to gain access to
// SSSE3, ARM NEON and ARMv8a, and Power7 Altivec instructions. A separate
// source file is needed because additional CXXFLAGS are required to enable
// the appropriate instructions sets in some build configurations.
#include "pch.h"
#include "config.h"
#include "cham.h"
#include "misc.h"
// Uncomment for benchmarking C++ against SSE or NEON.
// Do so in both simon.cpp and simon_simd.cpp.
// #undef CRYPTOPP_SSSE3_AVAILABLE
// #undef CRYPTOPP_ARM_NEON_AVAILABLE
#if (CRYPTOPP_SSSE3_AVAILABLE)
#include "adv_simd.h"
# include <pmmintrin.h>
# include <tmmintrin.h>
#endif
#if defined(__XOP__)
# include <ammintrin.h>
# if defined(__GNUC__)
# include <x86intrin.h>
# endif
#endif
// Clang intrinsic casts, http://bugs.llvm.org/show_bug.cgi?id=20670
#define DOUBLE_CAST(x) ((double*)(void*)(x))
#define CONST_DOUBLE_CAST(x) ((const double*)(const void*)(x))
// Squash MS LNK4221 and libtool warnings
extern const char CHAM_SIMD_FNAME[] = __FILE__;
ANONYMOUS_NAMESPACE_BEGIN
using CryptoPP::word16;
using CryptoPP::word32;
#if (CRYPTOPP_SSSE3_AVAILABLE)
//////////////////////////////////////////////////////////////////////////
NAMESPACE_BEGIN(W32) // CHAM128, 32-bit word size
template <unsigned int R>
inline __m128i RotateLeft32(const __m128i& val)
{
#if defined(__XOP__)
return _mm_roti_epi32(val, R);
#else
return _mm_or_si128(
_mm_slli_epi32(val, R), _mm_srli_epi32(val, 32-R));
#endif
}
template <unsigned int R>
inline __m128i RotateRight32(const __m128i& val)
{
#if defined(__XOP__)
return _mm_roti_epi32(val, 32-R);
#else
return _mm_or_si128(
_mm_slli_epi32(val, 32-R), _mm_srli_epi32(val, R));
#endif
}
// Faster than two Shifts and an Or. Thanks to Louis Wingers and Bryan Weeks.
template <>
inline __m128i RotateLeft32<8>(const __m128i& val)
{
#if defined(__XOP__)
return _mm_roti_epi32(val, 8);
#else
const __m128i mask = _mm_set_epi8(14,13,12,15, 10,9,8,11, 6,5,4,7, 2,1,0,3);
return _mm_shuffle_epi8(val, mask);
#endif
}
// Faster than two Shifts and an Or. Thanks to Louis Wingers and Bryan Weeks.
template <>
inline __m128i RotateRight32<8>(const __m128i& val)
{
#if defined(__XOP__)
return _mm_roti_epi32(val, 32-8);
#else
const __m128i mask = _mm_set_epi8(12,15,14,13, 8,11,10,9, 4,7,6,5, 0,3,2,1);
return _mm_shuffle_epi8(val, mask);
#endif
}
template <unsigned int IDX>
inline __m128i UnpackXMM(const __m128i& a, const __m128i& b, const __m128i& c, const __m128i& d)
{
// Should not be instantiated
CRYPTOPP_UNUSED(a); CRYPTOPP_UNUSED(b);
CRYPTOPP_UNUSED(c); CRYPTOPP_UNUSED(d);
CRYPTOPP_ASSERT(0);
return _mm_setzero_si128();
}
template <>
inline __m128i UnpackXMM<0>(const __m128i& a, const __m128i& b, const __m128i& c, const __m128i& d)
{
// The shuffle converts to and from little-endian for SSE. A specialized
// CHAM implementation can avoid the shuffle by framing the data for
// encryption, decryption and benchmarks. The library cannot take the
// speed-up because of the byte oriented API.
const __m128i r1 = _mm_unpacklo_epi32(a, b);
const __m128i r2 = _mm_unpacklo_epi32(c, d);
return _mm_shuffle_epi8(_mm_unpacklo_epi64(r1, r2),
_mm_set_epi8(12,13,14,15, 8,9,10,11, 4,5,6,7, 0,1,2,3));
}
template <>
inline __m128i UnpackXMM<1>(const __m128i& a, const __m128i& b, const __m128i& c, const __m128i& d)
{
// The shuffle converts to and from little-endian for SSE. A specialized
// CHAM implementation can avoid the shuffle by framing the data for
// encryption, decryption and benchmarks. The library cannot take the
// speed-up because of the byte oriented API.
const __m128i r1 = _mm_unpacklo_epi32(a, b);
const __m128i r2 = _mm_unpacklo_epi32(c, d);
return _mm_shuffle_epi8(_mm_unpackhi_epi64(r1, r2),
_mm_set_epi8(12,13,14,15, 8,9,10,11, 4,5,6,7, 0,1,2,3));
}
template <>
inline __m128i UnpackXMM<2>(const __m128i& a, const __m128i& b, const __m128i& c, const __m128i& d)
{
// The shuffle converts to and from little-endian for SSE. A specialized
// CHAM implementation can avoid the shuffle by framing the data for
// encryption, decryption and benchmarks. The library cannot take the
// speed-up because of the byte oriented API.
const __m128i r1 = _mm_unpackhi_epi32(a, b);
const __m128i r2 = _mm_unpackhi_epi32(c, d);
return _mm_shuffle_epi8(_mm_unpacklo_epi64(r1, r2),
_mm_set_epi8(12,13,14,15, 8,9,10,11, 4,5,6,7, 0,1,2,3));
}
template <>
inline __m128i UnpackXMM<3>(const __m128i& a, const __m128i& b, const __m128i& c, const __m128i& d)
{
// The shuffle converts to and from little-endian for SSE. A specialized
// CHAM implementation can avoid the shuffle by framing the data for
// encryption, decryption and benchmarks. The library cannot take the
// speed-up because of the byte oriented API.
const __m128i r1 = _mm_unpackhi_epi32(a, b);
const __m128i r2 = _mm_unpackhi_epi32(c, d);
return _mm_shuffle_epi8(_mm_unpackhi_epi64(r1, r2),
_mm_set_epi8(12,13,14,15, 8,9,10,11, 4,5,6,7, 0,1,2,3));
}
template <unsigned int IDX>
inline __m128i UnpackXMM(const __m128i& v)
{
// Should not be instantiated
CRYPTOPP_UNUSED(v); CRYPTOPP_ASSERT(0);
return _mm_setzero_si128();
}
template <>
inline __m128i UnpackXMM<0>(const __m128i& v)
{
return _mm_shuffle_epi8(v, _mm_set_epi8(0,1,2,3, 0,1,2,3, 0,1,2,3, 0,1,2,3));
}
template <>
inline __m128i UnpackXMM<1>(const __m128i& v)
{
return _mm_shuffle_epi8(v, _mm_set_epi8(4,5,6,7, 4,5,6,7, 4,5,6,7, 4,5,6,7));
}
template <>
inline __m128i UnpackXMM<2>(const __m128i& v)
{
return _mm_shuffle_epi8(v, _mm_set_epi8(8,9,10,11, 8,9,10,11, 8,9,10,11, 8,9,10,11));
}
template <>
inline __m128i UnpackXMM<3>(const __m128i& v)
{
return _mm_shuffle_epi8(v, _mm_set_epi8(12,13,14,15, 12,13,14,15, 12,13,14,15, 12,13,14,15));
}
template <unsigned int IDX>
inline __m128i RepackXMM(const __m128i& a, const __m128i& b, const __m128i& c, const __m128i& d)
{
return UnpackXMM<IDX>(a, b, c, d);
}
template <unsigned int IDX>
inline __m128i RepackXMM(const __m128i& v)
{
return UnpackXMM<IDX>(v);
}
inline void CHAM128_Enc_Block(__m128i &block0,
const word32 *subkeys, unsigned int rounds)
{
// Rearrange the data for vectorization. UnpackXMM includes a
// little-endian swap for SSE. Thanks to Peter Cordes for help
// with packing and unpacking.
// [A1 A2 A3 A4][B1 B2 B3 B4] ... => [A1 B1 C1 D1][A2 B2 C2 D2] ...
__m128i a = UnpackXMM<0>(block0);
__m128i b = UnpackXMM<1>(block0);
__m128i c = UnpackXMM<2>(block0);
__m128i d = UnpackXMM<3>(block0);
__m128i counter = _mm_set_epi32(0,0,0,0);
__m128i increment = _mm_set_epi32(1,1,1,1);
const unsigned int MASK = (rounds == 80 ? 7 : 15);
for (int i=0; i<static_cast<int>(rounds); i+=4)
{
__m128i k, k1, k2, t1, t2;
k = _mm_castpd_si128(_mm_load_sd(CONST_DOUBLE_CAST(&subkeys[(i+0) & MASK])));
// Shuffle out two subkeys
k1 = _mm_shuffle_epi8(k, _mm_set_epi8(3,2,1,0, 3,2,1,0, 3,2,1,0, 3,2,1,0));
k2 = _mm_shuffle_epi8(k, _mm_set_epi8(7,6,5,4, 7,6,5,4, 7,6,5,4, 7,6,5,4));
t1 = _mm_xor_si128(a, counter);
t2 = _mm_xor_si128(RotateLeft32<1>(b), k1);
a = RotateLeft32<8>(_mm_add_epi32(t1, t2));
counter = _mm_add_epi32(counter, increment);
t1 = _mm_xor_si128(b, counter);
t2 = _mm_xor_si128(RotateLeft32<8>(c), k2);
b = RotateLeft32<1>(_mm_add_epi32(t1, t2));
counter = _mm_add_epi32(counter, increment);
k = _mm_castpd_si128(_mm_load_sd(CONST_DOUBLE_CAST(&subkeys[(i+2) & MASK])));
// Shuffle out two subkeys
k1 = _mm_shuffle_epi8(k, _mm_set_epi8(3,2,1,0, 3,2,1,0, 3,2,1,0, 3,2,1,0));
k2 = _mm_shuffle_epi8(k, _mm_set_epi8(7,6,5,4, 7,6,5,4, 7,6,5,4, 7,6,5,4));
t1 = _mm_xor_si128(c, counter);
t2 = _mm_xor_si128(RotateLeft32<1>(d), k1);
c = RotateLeft32<8>(_mm_add_epi32(t1, t2));
counter = _mm_add_epi32(counter, increment);
t1 = _mm_xor_si128(d, counter);
t2 = _mm_xor_si128(RotateLeft32<8>(a), k2);
d = RotateLeft32<1>(_mm_add_epi32(t1, t2));
counter = _mm_add_epi32(counter, increment);
}
// [A1 B1 C1 D1][A2 B2 C2 D2] ... => [A1 A2 A3 A4][B1 B2 B3 B4] ...
block0 = RepackXMM<0>(a,b,c,d);
}
inline void CHAM128_Dec_Block(__m128i &block0,
const word32 *subkeys, unsigned int rounds)
{
// Rearrange the data for vectorization. UnpackXMM includes a
// little-endian swap for SSE. Thanks to Peter Cordes for help
// with packing and unpacking.
// [A1 A2 A3 A4][B1 B2 B3 B4] ... => [A1 B1 C1 D1][A2 B2 C2 D2] ...
__m128i a = UnpackXMM<0>(block0);
__m128i b = UnpackXMM<1>(block0);
__m128i c = UnpackXMM<2>(block0);
__m128i d = UnpackXMM<3>(block0);
__m128i counter = _mm_set_epi32(rounds-1,rounds-1,rounds-1,rounds-1);
__m128i decrement = _mm_set_epi32(1,1,1,1);
const unsigned int MASK = (rounds == 80 ? 7 : 15);
for (int i = static_cast<int>(rounds)-1; i >= 0; i-=4)
{
__m128i k, k1, k2, t1, t2;
k = _mm_castpd_si128(_mm_load_sd(CONST_DOUBLE_CAST(&subkeys[(i-1) & MASK])));
// Shuffle out two subkeys
k1 = _mm_shuffle_epi8(k, _mm_set_epi8(7,6,5,4, 7,6,5,4, 7,6,5,4, 7,6,5,4));
k2 = _mm_shuffle_epi8(k, _mm_set_epi8(3,2,1,0, 3,2,1,0, 3,2,1,0, 3,2,1,0));
// Odd round
t1 = RotateRight32<1>(d);
t2 = _mm_xor_si128(RotateLeft32<8>(a), k1);
d = _mm_xor_si128(_mm_sub_epi32(t1, t2), counter);
counter = _mm_sub_epi32(counter, decrement);
// Even round
t1 = RotateRight32<8>(c);
t2 = _mm_xor_si128(RotateLeft32<1>(d), k2);
c = _mm_xor_si128(_mm_sub_epi32(t1, t2), counter);
counter = _mm_sub_epi32(counter, decrement);
k = _mm_castpd_si128(_mm_load_sd(CONST_DOUBLE_CAST(&subkeys[(i-3) & MASK])));
// Shuffle out two subkeys
k1 = _mm_shuffle_epi8(k, _mm_set_epi8(7,6,5,4, 7,6,5,4, 7,6,5,4, 7,6,5,4));
k2 = _mm_shuffle_epi8(k, _mm_set_epi8(3,2,1,0, 3,2,1,0, 3,2,1,0, 3,2,1,0));
// Odd round
t1 = RotateRight32<1>(b);
t2 = _mm_xor_si128(RotateLeft32<8>(c), k1);
b = _mm_xor_si128(_mm_sub_epi32(t1, t2), counter);
counter = _mm_sub_epi32(counter, decrement);
// Even round
t1 = RotateRight32<8>(a);
t2 = _mm_xor_si128(RotateLeft32<1>(b), k2);
a = _mm_xor_si128(_mm_sub_epi32(t1, t2), counter);
counter = _mm_sub_epi32(counter, decrement);
}
// [A1 B1 C1 D1][A2 B2 C2 D2] ... => [A1 A2 A3 A4][B1 B2 B3 B4] ...
block0 = RepackXMM<0>(a,b,c,d);
}
inline void CHAM128_Enc_4_Blocks(__m128i &block0, __m128i &block1,
__m128i &block2, __m128i &block3, const word32 *subkeys, unsigned int rounds)
{
// Rearrange the data for vectorization. UnpackXMM includes a
// little-endian swap for SSE. Thanks to Peter Cordes for help
// with packing and unpacking.
// [A1 A2 A3 A4][B1 B2 B3 B4] ... => [A1 B1 C1 D1][A2 B2 C2 D2] ...
__m128i a = UnpackXMM<0>(block0, block1, block2, block3);
__m128i b = UnpackXMM<1>(block0, block1, block2, block3);
__m128i c = UnpackXMM<2>(block0, block1, block2, block3);
__m128i d = UnpackXMM<3>(block0, block1, block2, block3);
__m128i counter = _mm_set_epi32(0,0,0,0);
__m128i increment = _mm_set_epi32(1,1,1,1);
const unsigned int MASK = (rounds == 80 ? 7 : 15);
for (int i=0; i<static_cast<int>(rounds); i+=4)
{
__m128i k, k1, k2, t1, t2;
k = _mm_castpd_si128(_mm_load_sd(CONST_DOUBLE_CAST(&subkeys[(i+0) & MASK])));
// Shuffle out two subkeys
k1 = _mm_shuffle_epi8(k, _mm_set_epi8(3,2,1,0, 3,2,1,0, 3,2,1,0, 3,2,1,0));
k2 = _mm_shuffle_epi8(k, _mm_set_epi8(7,6,5,4, 7,6,5,4, 7,6,5,4, 7,6,5,4));
t1 = _mm_xor_si128(a, counter);
t2 = _mm_xor_si128(RotateLeft32<1>(b), k1);
a = RotateLeft32<8>(_mm_add_epi32(t1, t2));
counter = _mm_add_epi32(counter, increment);
t1 = _mm_xor_si128(b, counter);
t2 = _mm_xor_si128(RotateLeft32<8>(c), k2);
b = RotateLeft32<1>(_mm_add_epi32(t1, t2));
counter = _mm_add_epi32(counter, increment);
k = _mm_castpd_si128(_mm_load_sd(CONST_DOUBLE_CAST(&subkeys[(i+2) & MASK])));
// Shuffle out two subkeys
k1 = _mm_shuffle_epi8(k, _mm_set_epi8(3,2,1,0, 3,2,1,0, 3,2,1,0, 3,2,1,0));
k2 = _mm_shuffle_epi8(k, _mm_set_epi8(7,6,5,4, 7,6,5,4, 7,6,5,4, 7,6,5,4));
t1 = _mm_xor_si128(c, counter);
t2 = _mm_xor_si128(RotateLeft32<1>(d), k1);
c = RotateLeft32<8>(_mm_add_epi32(t1, t2));
counter = _mm_add_epi32(counter, increment);
t1 = _mm_xor_si128(d, counter);
t2 = _mm_xor_si128(RotateLeft32<8>(a), k2);
d = RotateLeft32<1>(_mm_add_epi32(t1, t2));
counter = _mm_add_epi32(counter, increment);
}
// [A1 B1 C1 D1][A2 B2 C2 D2] ... => [A1 A2 A3 A4][B1 B2 B3 B4] ...
block0 = RepackXMM<0>(a,b,c,d);
block1 = RepackXMM<1>(a,b,c,d);
block2 = RepackXMM<2>(a,b,c,d);
block3 = RepackXMM<3>(a,b,c,d);
}
inline void CHAM128_Dec_4_Blocks(__m128i &block0, __m128i &block1,
__m128i &block2, __m128i &block3, const word32 *subkeys, unsigned int rounds)
{
// Rearrange the data for vectorization. UnpackXMM includes a
// little-endian swap for SSE. Thanks to Peter Cordes for help
// with packing and unpacking.
// [A1 A2 A3 A4][B1 B2 B3 B4] ... => [A1 B1 C1 D1][A2 B2 C2 D2] ...
__m128i a = UnpackXMM<0>(block0, block1, block2, block3);
__m128i b = UnpackXMM<1>(block0, block1, block2, block3);
__m128i c = UnpackXMM<2>(block0, block1, block2, block3);
__m128i d = UnpackXMM<3>(block0, block1, block2, block3);
__m128i counter = _mm_set_epi32(rounds-1,rounds-1,rounds-1,rounds-1);
__m128i decrement = _mm_set_epi32(1,1,1,1);
const unsigned int MASK = (rounds == 80 ? 7 : 15);
for (int i = static_cast<int>(rounds)-1; i >= 0; i-=4)
{
__m128i k, k1, k2, t1, t2;
k = _mm_castpd_si128(_mm_load_sd(CONST_DOUBLE_CAST(&subkeys[(i-1) & MASK])));
// Shuffle out two subkeys
k1 = _mm_shuffle_epi8(k, _mm_set_epi8(7,6,5,4, 7,6,5,4, 7,6,5,4, 7,6,5,4));
k2 = _mm_shuffle_epi8(k, _mm_set_epi8(3,2,1,0, 3,2,1,0, 3,2,1,0, 3,2,1,0));
// Odd round
t1 = RotateRight32<1>(d);
t2 = _mm_xor_si128(RotateLeft32<8>(a), k1);
d = _mm_xor_si128(_mm_sub_epi32(t1, t2), counter);
counter = _mm_sub_epi32(counter, decrement);
// Even round
t1 = RotateRight32<8>(c);
t2 = _mm_xor_si128(RotateLeft32<1>(d), k2);
c = _mm_xor_si128(_mm_sub_epi32(t1, t2), counter);
counter = _mm_sub_epi32(counter, decrement);
k = _mm_castpd_si128(_mm_load_sd(CONST_DOUBLE_CAST(&subkeys[(i-3) & MASK])));
// Shuffle out two subkeys
k1 = _mm_shuffle_epi8(k, _mm_set_epi8(7,6,5,4, 7,6,5,4, 7,6,5,4, 7,6,5,4));
k2 = _mm_shuffle_epi8(k, _mm_set_epi8(3,2,1,0, 3,2,1,0, 3,2,1,0, 3,2,1,0));
// Odd round
t1 = RotateRight32<1>(b);
t2 = _mm_xor_si128(RotateLeft32<8>(c), k1);
b = _mm_xor_si128(_mm_sub_epi32(t1, t2), counter);
counter = _mm_sub_epi32(counter, decrement);
// Even round
t1 = RotateRight32<8>(a);
t2 = _mm_xor_si128(RotateLeft32<1>(b), k2);
a = _mm_xor_si128(_mm_sub_epi32(t1, t2), counter);
counter = _mm_sub_epi32(counter, decrement);
}
// [A1 B1 C1 D1][A2 B2 C2 D2] ... => [A1 A2 A3 A4][B1 B2 B3 B4] ...
block0 = RepackXMM<0>(a,b,c,d);
block1 = RepackXMM<1>(a,b,c,d);
block2 = RepackXMM<2>(a,b,c,d);
block3 = RepackXMM<3>(a,b,c,d);
}
//////////////////////////////////////////////////////////////////////////
NAMESPACE_END // W32
#endif // CRYPTOPP_SSSE3_AVAILABLE
ANONYMOUS_NAMESPACE_END
NAMESPACE_BEGIN(CryptoPP)
#if defined(CRYPTOPP_SSSE3_AVAILABLE)
size_t CHAM128_Enc_AdvancedProcessBlocks_SSSE3(const word32* subKeys, size_t rounds,
const byte *inBlocks, const byte *xorBlocks, byte *outBlocks, size_t length, word32 flags)
{
return AdvancedProcessBlocks128_4x1_SSE(W32::CHAM128_Enc_Block, W32::CHAM128_Enc_4_Blocks,
subKeys, rounds, inBlocks, xorBlocks, outBlocks, length, flags);
}
size_t CHAM128_Dec_AdvancedProcessBlocks_SSSE3(const word32* subKeys, size_t rounds,
const byte *inBlocks, const byte *xorBlocks, byte *outBlocks, size_t length, word32 flags)
{
return AdvancedProcessBlocks128_4x1_SSE(W32::CHAM128_Dec_Block, W32::CHAM128_Dec_4_Blocks,
subKeys, rounds, inBlocks, xorBlocks, outBlocks, length, flags);
}
#endif // CRYPTOPP_SSSE3_AVAILABLE
NAMESPACE_END

View File

@ -5,14 +5,17 @@
#ifndef CRYPTOPP_IMPORTS
#include "cmac.h"
#include "misc.h"
NAMESPACE_BEGIN(CryptoPP)
ANONYMOUS_NAMESPACE_BEGIN
static void MulU(byte *k, unsigned int length)
using CryptoPP::byte;
using CryptoPP::IsPowerOf2;
void MulU(byte *k, unsigned int len)
{
byte carry = 0;
for (int i=length-1; i>=1; i-=2)
for (int i=len-1; i>=1; i-=2)
{
byte carry2 = k[i] >> 7;
k[i] += k[i] + carry;
@ -20,9 +23,22 @@ static void MulU(byte *k, unsigned int length)
k[i-1] += k[i-1] + carry2;
}
#ifndef CRYPTOPP_CMAC_WIDE_BLOCK_CIPHERS
CRYPTOPP_ASSERT(len == 16);
if (carry)
{
switch (length)
k[15] ^= 0x87;
return;
}
#else
CRYPTOPP_ASSERT(IsPowerOf2(len));
CRYPTOPP_ASSERT(len >= 8);
CRYPTOPP_ASSERT(len <= 128);
if (carry)
{
switch (len)
{
case 8:
k[7] ^= 0x1b;
@ -50,11 +66,16 @@ static void MulU(byte *k, unsigned int length)
k[127] ^= 0x43;
break;
default:
throw InvalidArgument("CMAC: " + IntToString(length) + " is not a supported cipher block size");
CRYPTOPP_ASSERT(0);
}
}
#endif // CRYPTOPP_CMAC_WIDE_BLOCK_CIPHERS
}
ANONYMOUS_NAMESPACE_END
NAMESPACE_BEGIN(CryptoPP)
void CMAC_Base::UncheckedSetKey(const byte *key, unsigned int length, const NameValuePairs &params)
{
BlockCipher &cipher = AccessCipher();
@ -130,7 +151,9 @@ void CMAC_Base::TruncatedFinal(byte *mac, size_t size)
else
cipher.AdvancedProcessBlocks(m_reg, m_reg+blockSize, m_reg, blockSize, BlockTransformation::BT_DontIncrementInOutPointers|BlockTransformation::BT_XorInput);
memcpy(mac, m_reg, size);
// UBsan finding
if (mac)
memcpy(mac, m_reg, size);
m_counter = 0;
memset(m_reg, 0, blockSize);

View File

@ -10,6 +10,13 @@
#include "seckey.h"
#include "secblock.h"
/// \brief Enable CMAC and wide block ciphers
/// \details CMAC is only defined for AES. The library can support wide
/// block ciphers like Kaylna and Threefish since we know the polynomials.
#ifndef CRYPTOPP_CMAC_WIDE_BLOCK_CIPHERS
# define CRYPTOPP_CMAC_WIDE_BLOCK_CIPHERS 1
#endif // CRYPTOPP_CMAC_WIDE_BLOCK_CIPHERS
NAMESPACE_BEGIN(CryptoPP)
/// \brief CMAC base implementation
@ -17,6 +24,8 @@ NAMESPACE_BEGIN(CryptoPP)
class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE CMAC_Base : public MessageAuthenticationCode
{
public:
virtual ~CMAC_Base() {}
CMAC_Base() : m_counter(0) {}
void UncheckedSetKey(const byte *key, unsigned int length, const NameValuePairs &params);
@ -25,6 +34,7 @@ public:
unsigned int DigestSize() const {return GetCipher().BlockSize();}
unsigned int OptimalBlockSize() const {return GetCipher().BlockSize();}
unsigned int OptimalDataAlignment() const {return GetCipher().OptimalDataAlignment();}
std::string AlgorithmProvider() const {return GetCipher().AlgorithmProvider();}
protected:
friend class EAX_Base;

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,72 @@
// config_align.h - written and placed in public domain by Jeffrey Walton
// the bits that make up this source file are from the
// library's monolithic config.h.
/// \file config_align.h
/// \brief Library configuration file
/// \details <tt>config_align.h</tt> provides defines for aligned memory
/// allocations.
/// \details <tt>config.h</tt> was split into components in May 2019 to better
/// integrate with Autoconf and its feature tests. The splitting occurred so
/// users could continue to include <tt>config.h</tt> while allowing Autoconf
/// to write new <tt>config_asm.h</tt> and new <tt>config_cxx.h</tt> using
/// its feature tests.
/// \note You should include <tt>config.h</tt> rather than <tt>config_align.h</tt>
/// directly.
/// \sa <A HREF="https://github.com/weidai11/cryptopp/issues/835">Issue 835,
/// Make config.h more autoconf friendly</A>,
/// <A HREF="https://www.cryptopp.com/wiki/Configure.sh">Configure.sh script</A>
/// on the Crypto++ wiki
/// \since Crypto++ 8.3
#ifndef CRYPTOPP_CONFIG_ALIGN_H
#define CRYPTOPP_CONFIG_ALIGN_H
#include "config_asm.h" // CRYPTOPP_DISABLE_ASM
#include "config_cpu.h" // X86, X32, X64, ARM32, ARM64, etc
#include "config_cxx.h" // CRYPTOPP_CXX11_ALIGNAS
#include "config_ver.h" // Compiler versions
// Nearly all Intel's and AMD's have SSE. Enable it independent of SSE ASM and intrinsics.
// ARM NEON and ARMv8 ASIMD only need natural alignment of an element in the vector.
// Altivec through POWER7 need vector alignment. POWER8 and POWER9 relax the requirement.
#if defined(CRYPTOPP_DISABLE_ASM)
#define CRYPTOPP_BOOL_ALIGN16 0
#elif (CRYPTOPP_BOOL_X86 || CRYPTOPP_BOOL_X32 || CRYPTOPP_BOOL_X64 || \
CRYPTOPP_BOOL_PPC32 || CRYPTOPP_BOOL_PPC64)
#define CRYPTOPP_BOOL_ALIGN16 1
#else
#define CRYPTOPP_BOOL_ALIGN16 0
#endif
// How to allocate 16-byte aligned memory (for SSE2)
// posix_memalign see https://forum.kde.org/viewtopic.php?p=66274
#if defined(_MSC_VER)
#define CRYPTOPP_MM_MALLOC_AVAILABLE
#elif defined(__linux__) || defined(__sun__) || defined(__CYGWIN__)
#define CRYPTOPP_MEMALIGN_AVAILABLE
#elif defined(__APPLE__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__)
#define CRYPTOPP_MALLOC_ALIGNMENT_IS_16
#elif (defined(_GNU_SOURCE) || ((_XOPEN_SOURCE + 0) >= 600)) && (_POSIX_ADVISORY_INFO > 0)
#define CRYPTOPP_POSIX_MEMALIGN_AVAILABLE
#else
#define CRYPTOPP_NO_ALIGNED_ALLOC
#endif
// Sun Studio Express 3 (December 2006) provides GCC-style attributes.
// IBM XL C/C++ alignment modifier per Optimization Guide, pp. 19-20.
// __IBM_ATTRIBUTES per XLC 12.1 AIX Compiler Manual, p. 473.
// CRYPTOPP_ALIGN_DATA may not be reliable on AIX.
#if defined(CRYPTOPP_CXX11_ALIGNAS)
#define CRYPTOPP_ALIGN_DATA(x) alignas(x)
#elif defined(_MSC_VER)
#define CRYPTOPP_ALIGN_DATA(x) __declspec(align(x))
#elif defined(__GNUC__) || defined(__clang__) || (__SUNPRO_CC >= 0x5100)
#define CRYPTOPP_ALIGN_DATA(x) __attribute__((aligned(x)))
#elif defined(__xlc__) || defined(__xlC__)
#define CRYPTOPP_ALIGN_DATA(x) __attribute__((aligned(x)))
#else
#define CRYPTOPP_ALIGN_DATA(x)
#endif
#endif // CRYPTOPP_CONFIG_ALIGN_H

View File

@ -0,0 +1,488 @@
// config_asm.h - written and placed in public domain by Jeffrey Walton
// the bits that make up this source file are from the
// library's monolithic config.h.
/// \file config_asm.h
/// \brief Library configuration file
/// \details <tt>config_asm.h</tt> provides defines for instruction set
/// architectures
/// and inline assembly.
/// \details <tt>config.h</tt> was split into components in May 2019 to better
/// integrate with Autoconf and its feature tests. The splitting occurred so
/// users could continue to include <tt>config.h</tt> while allowing Autoconf
/// to write new <tt>config_asm.h</tt> and new <tt>config_cxx.h</tt> using
/// its feature tests.
/// \note You should include <tt>config.h</tt> rather than <tt>config_asm.h</tt>
/// directly.
/// \sa <A HREF="https://github.com/weidai11/cryptopp/issues/835">Issue 835,
/// Make config.h more autoconf friendly</A>,
/// <A HREF="https://www.cryptopp.com/wiki/Configure.sh">Configure.sh script</A>
/// on the Crypto++ wiki
/// \since Crypto++ 8.3
#ifndef CRYPTOPP_CONFIG_ASM_H
#define CRYPTOPP_CONFIG_ASM_H
#include "config_os.h"
#include "config_cpu.h"
#include "config_ver.h"
// Define this to disable ASM, intrinsics and built-ins. The library will be
// compiled using C++ only. The library code will not include SSE2 (and
// above), NEON, Aarch32, Aarch64, or Altivec (and above). Note the compiler
// may use higher ISAs depending on compiler options, but the library will not
// explicitly use the ISAs. When disabling ASM, it is best to do it from
// config.h to ensure the library and all programs share the setting.
// #define CRYPTOPP_DISABLE_ASM 1
// https://github.com/weidai11/cryptopp/issues/719
#if defined(__native_client__)
# undef CRYPTOPP_DISABLE_ASM
# define CRYPTOPP_DISABLE_ASM 1
#endif
// Some Clang and SunCC cannot handle mixed asm with positional arguments,
// where the body is Intel style with no prefix and the templates are
// AT&T style. Define this if the Makefile misdetects the configuration.
// Also see https://bugs.llvm.org/show_bug.cgi?id=39895 .
// #define CRYPTOPP_DISABLE_MIXED_ASM 1
#if defined(__clang__) || (defined(__APPLE__) && defined(__GNUC__)) || defined(__SUNPRO_CC)
# undef CRYPTOPP_DISABLE_MIXED_ASM
# define CRYPTOPP_DISABLE_MIXED_ASM 1
#endif
// Define this if you need to disable Android advanced ISAs.
// The problem is, Android-mk does not allow us to specify an
// ISA option, like -maes or -march=armv8-a+crypto for AES.
// Lack of an option results in a compile failure. To avoid
// the compile failure, set this define. Also see
// https://github.com/weidai11/cryptopp/issues/1015
// CRYPTOPP_DISABLE_ANDROID_ADVANCED_ISA 1
// ***************** IA32 CPU features ********************
#if (CRYPTOPP_BOOL_X86 || CRYPTOPP_BOOL_X32 || CRYPTOPP_BOOL_X64)
// Apple Clang prior to 5.0 cannot handle SSE2
#if defined(CRYPTOPP_APPLE_CLANG_VERSION) && (CRYPTOPP_APPLE_CLANG_VERSION < 50000)
# define CRYPTOPP_DISABLE_ASM 1
#endif
// Sun Studio 12.1 provides GCC inline assembly
// http://blogs.oracle.com/x86be/entry/gcc_style_asm_inlining_support
#if defined(__SUNPRO_CC) && (__SUNPRO_CC < 0x5100)
# define CRYPTOPP_DISABLE_ASM 1
#endif
// Guard everything in CRYPTOPP_DISABLE_ASM
#if !defined(CRYPTOPP_DISABLE_ASM)
#if (defined(_MSC_VER) && defined(_M_IX86)) || ((defined(__GNUC__) && (defined(__i386__)) || defined(__x86_64__)))
// C++Builder 2010 does not allow "call label" where label is defined within inline assembly
#define CRYPTOPP_X86_ASM_AVAILABLE 1
#if !defined(CRYPTOPP_DISABLE_SSE2) && (defined(_MSC_VER) || CRYPTOPP_GCC_VERSION >= 30300 || defined(__SSE2__))
#define CRYPTOPP_SSE2_ASM_AVAILABLE 1
#endif
#if !defined(CRYPTOPP_DISABLE_SSSE3) && (_MSC_VER >= 1500 || CRYPTOPP_GCC_VERSION >= 40300 || defined(__SSSE3__))
#define CRYPTOPP_SSSE3_ASM_AVAILABLE 1
#endif
#endif
#if defined(_MSC_VER) && defined(_M_X64)
#define CRYPTOPP_X64_MASM_AVAILABLE 1
#endif
#if defined(__GNUC__) && defined(__x86_64__)
#define CRYPTOPP_X64_ASM_AVAILABLE 1
#endif
// 32-bit SunCC does not enable SSE2 by default.
#if !defined(CRYPTOPP_DISABLE_SSE2) && (defined(_MSC_VER) || CRYPTOPP_GCC_VERSION >= 30300 || defined(__SSE2__) || (__SUNPRO_CC >= 0x5100))
#define CRYPTOPP_SSE2_INTRIN_AVAILABLE 1
#endif
#if !defined(CRYPTOPP_DISABLE_SSSE3)
# if defined(__SSSE3__) || (_MSC_VER >= 1500) || \
(CRYPTOPP_GCC_VERSION >= 40300) || (__INTEL_COMPILER >= 1000) || (__SUNPRO_CC >= 0x5110) || \
(CRYPTOPP_LLVM_CLANG_VERSION >= 20300) || (CRYPTOPP_APPLE_CLANG_VERSION >= 40000)
#define CRYPTOPP_SSSE3_AVAILABLE 1
# endif
#endif
// Intrinsics available in GCC 4.3 (http://gcc.gnu.org/gcc-4.3/changes.html) and
// MSVC 2008 (http://msdn.microsoft.com/en-us/library/bb892950%28v=vs.90%29.aspx)
// SunCC could generate SSE4 at 12.1, but the intrinsics are missing until 12.4.
#if !defined(CRYPTOPP_DISABLE_SSE4) && defined(CRYPTOPP_SSSE3_AVAILABLE) && \
(defined(__SSE4_1__) || (CRYPTOPP_MSC_VERSION >= 1500) || \
(CRYPTOPP_GCC_VERSION >= 40300) || (__INTEL_COMPILER >= 1000) || (__SUNPRO_CC >= 0x5110) || \
(CRYPTOPP_LLVM_CLANG_VERSION >= 20300) || (CRYPTOPP_APPLE_CLANG_VERSION >= 40000))
#define CRYPTOPP_SSE41_AVAILABLE 1
#endif
#if !defined(CRYPTOPP_DISABLE_SSE4) && defined(CRYPTOPP_SSSE3_AVAILABLE) && \
(defined(__SSE4_2__) || (CRYPTOPP_MSC_VERSION >= 1500) || (__SUNPRO_CC >= 0x5110) || \
(CRYPTOPP_GCC_VERSION >= 40300) || (__INTEL_COMPILER >= 1000) || \
(CRYPTOPP_LLVM_CLANG_VERSION >= 20300) || (CRYPTOPP_APPLE_CLANG_VERSION >= 40000))
#define CRYPTOPP_SSE42_AVAILABLE 1
#endif
// Couple to CRYPTOPP_DISABLE_AESNI, but use CRYPTOPP_CLMUL_AVAILABLE so we can selectively
// disable for misbehaving platforms and compilers, like Solaris or some Clang.
#if defined(CRYPTOPP_DISABLE_AESNI)
#define CRYPTOPP_DISABLE_CLMUL 1
#endif
// Requires Sun Studio 12.3 (SunCC 0x5120) in theory.
#if !defined(CRYPTOPP_DISABLE_CLMUL) && defined(CRYPTOPP_SSE42_AVAILABLE) && \
(defined(__PCLMUL__) || (_MSC_FULL_VER >= 150030729) || (__SUNPRO_CC >= 0x5120) || \
(CRYPTOPP_GCC_VERSION >= 40300) || (__INTEL_COMPILER >= 1110) || \
(CRYPTOPP_LLVM_CLANG_VERSION >= 30200) || (CRYPTOPP_APPLE_CLANG_VERSION >= 40300))
#define CRYPTOPP_CLMUL_AVAILABLE 1
#endif
// Requires Sun Studio 12.3 (SunCC 0x5120)
#if !defined(CRYPTOPP_DISABLE_AESNI) && defined(CRYPTOPP_SSE42_AVAILABLE) && \
(defined(__AES__) || (_MSC_FULL_VER >= 150030729) || (__SUNPRO_CC >= 0x5120) || \
(CRYPTOPP_GCC_VERSION >= 40300) || (__INTEL_COMPILER >= 1110) || \
(CRYPTOPP_LLVM_CLANG_VERSION >= 30200) || (CRYPTOPP_APPLE_CLANG_VERSION >= 40300))
#define CRYPTOPP_AESNI_AVAILABLE 1
#endif
// Requires Binutils 2.24
#if !defined(CRYPTOPP_DISABLE_AVX) && defined(CRYPTOPP_SSE42_AVAILABLE) && \
(defined(__AVX2__) || (CRYPTOPP_MSC_VERSION >= 1800) || (__SUNPRO_CC >= 0x5130) || \
(CRYPTOPP_GCC_VERSION >= 40700) || (__INTEL_COMPILER >= 1400) || \
(CRYPTOPP_LLVM_CLANG_VERSION >= 30100) || (CRYPTOPP_APPLE_CLANG_VERSION >= 40600))
#define CRYPTOPP_AVX_AVAILABLE 1
#endif
// Requires Binutils 2.24
#if !defined(CRYPTOPP_DISABLE_AVX2) && defined(CRYPTOPP_AVX_AVAILABLE) && \
(defined(__AVX2__) || (CRYPTOPP_MSC_VERSION >= 1800) || (__SUNPRO_CC >= 0x5130) || \
(CRYPTOPP_GCC_VERSION >= 40900) || (__INTEL_COMPILER >= 1400) || \
(CRYPTOPP_LLVM_CLANG_VERSION >= 30100) || (CRYPTOPP_APPLE_CLANG_VERSION >= 40600))
#define CRYPTOPP_AVX2_AVAILABLE 1
#endif
// Guessing at SHA for SunCC. Its not in Sun Studio 12.6. Also see
// http://stackoverflow.com/questions/45872180/which-xarch-for-sha-extensions-on-solaris
// Guessing for Intel ICPC. A slide deck says SHA support is in version 16.0-beta
// https://www.alcf.anl.gov/files/ken_intel_compiler_optimization.pdf
#if !defined(CRYPTOPP_DISABLE_SHANI) && defined(CRYPTOPP_SSE42_AVAILABLE) && \
(defined(__SHA__) || (CRYPTOPP_MSC_VERSION >= 1900) || (__SUNPRO_CC >= 0x5160) || \
(CRYPTOPP_GCC_VERSION >= 40900) || (__INTEL_COMPILER >= 1600) || \
(CRYPTOPP_LLVM_CLANG_VERSION >= 30400) || (CRYPTOPP_APPLE_CLANG_VERSION >= 50100))
#define CRYPTOPP_SHANI_AVAILABLE 1
#endif
// RDRAND uses byte codes. All we need is x86 ASM for it.
// However tie it to AES-NI since SecureKey was available with it.
#if !defined(CRYPTOPP_DISABLE_RDRAND) && defined(CRYPTOPP_AESNI_AVAILABLE)
#define CRYPTOPP_RDRAND_AVAILABLE 1
#endif
// RDSEED uses byte codes. All we need is x86 ASM for it.
// However tie it to AES-NI since SecureKey was available with it.
#if !defined(CRYPTOPP_DISABLE_RDSEED) && defined(CRYPTOPP_AESNI_AVAILABLE)
#define CRYPTOPP_RDSEED_AVAILABLE 1
#endif
// PadlockRNG uses byte codes. All we need is x86 ASM for it.
#if !defined(CRYPTOPP_DISABLE_PADLOCK) && \
!(defined(__ANDROID__) || defined(ANDROID) || defined(__APPLE__)) && \
defined(CRYPTOPP_X86_ASM_AVAILABLE)
#define CRYPTOPP_PADLOCK_AVAILABLE 1
#define CRYPTOPP_PADLOCK_RNG_AVAILABLE 1
#define CRYPTOPP_PADLOCK_ACE_AVAILABLE 1
#define CRYPTOPP_PADLOCK_ACE2_AVAILABLE 1
#define CRYPTOPP_PADLOCK_PHE_AVAILABLE 1
#define CRYPTOPP_PADLOCK_PMM_AVAILABLE 1
#endif
// Fixup for SunCC 12.1-12.4. Bad code generation in AES_Encrypt and friends.
#if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x5130)
# undef CRYPTOPP_AESNI_AVAILABLE
#endif
// Fixup for SunCC 12.1-12.6. Compiler crash on GCM_Reduce_CLMUL.
// http://github.com/weidai11/cryptopp/issues/226
#if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x5150)
# undef CRYPTOPP_CLMUL_AVAILABLE
#endif
// Clang intrinsic casts, http://bugs.llvm.org/show_bug.cgi?id=20670
#define M128_CAST(x) ((__m128i *)(void *)(x))
#define CONST_M128_CAST(x) ((const __m128i *)(const void *)(x))
#define M256_CAST(x) ((__m256i *)(void *)(x))
#define CONST_M256_CAST(x) ((const __m256i *)(const void *)(x))
#endif // CRYPTOPP_DISABLE_ASM
#endif // X86, X32, X64
// ***************** ARM CPU features ********************
#if (CRYPTOPP_BOOL_ARM32 || CRYPTOPP_BOOL_ARMV8)
// We don't have an ARM big endian test rig. Disable
// ARM-BE ASM and instrinsics until we can test it.
#if (CRYPTOPP_BIG_ENDIAN)
# define CRYPTOPP_DISABLE_ASM 1
#endif
// Guard everything in CRYPTOPP_DISABLE_ASM
#if !defined(CRYPTOPP_DISABLE_ASM)
// Requires ACLE 1.0. -mfpu=neon or above must be present
// Requires GCC 4.3, Clang 2.8 or Visual Studio 2012
// Do not use APPLE_CLANG_VERSION; use __ARM_FEATURE_XXX instead.
#if !defined(CRYPTOPP_ARM_NEON_AVAILABLE) && !defined(CRYPTOPP_DISABLE_ARM_NEON)
# if defined(__arm__) || defined(__ARM_NEON) || defined(__ARM_FEATURE_NEON) || defined(_M_ARM)
# if (CRYPTOPP_GCC_VERSION >= 40300) || (CRYPTOPP_LLVM_CLANG_VERSION >= 20800) || \
(CRYPTOPP_APPLE_CLANG_VERSION >= 30200) || (CRYPTOPP_MSC_VERSION >= 1700)
# define CRYPTOPP_ARM_NEON_AVAILABLE 1
# endif // Compilers
# endif // Platforms
#endif
// ARMv8 and ASIMD. -march=armv8-a or above must be present
// Requires GCC 4.8, Clang 3.3 or Visual Studio 2017
// Do not use APPLE_CLANG_VERSION; use __ARM_FEATURE_XXX instead.
#if !defined(CRYPTOPP_ARM_ASIMD_AVAILABLE) && !defined(CRYPTOPP_DISABLE_ARM_ASIMD)
# if defined(__aarch32__) || defined(__aarch64__) || defined(__arm64__) || defined(_M_ARM64)
# if defined(__ARM_NEON) || defined(__ARM_ASIMD) || defined(__ARM_FEATURE_NEON) || defined(__ARM_FEATURE_ASIMD) || \
(CRYPTOPP_GCC_VERSION >= 40800) || (CRYPTOPP_LLVM_CLANG_VERSION >= 30300) || \
(CRYPTOPP_APPLE_CLANG_VERSION >= 40000) || (CRYPTOPP_MSC_VERSION >= 1916)
# define CRYPTOPP_ARM_NEON_AVAILABLE 1
# define CRYPTOPP_ARM_ASIMD_AVAILABLE 1
# endif // Compilers
# endif // Platforms
#endif
// ARMv8 and ASIMD. -march=armv8-a+crc or above must be present
// Requires GCC 4.8, Clang 3.3 or Visual Studio 2017
#if !defined(CRYPTOPP_ARM_CRC32_AVAILABLE) && !defined(CRYPTOPP_DISABLE_ARM_CRC32)
# if defined(__aarch32__) || defined(__aarch64__) || defined(_M_ARM64)
# if defined(__ARM_FEATURE_CRC32) || (CRYPTOPP_GCC_VERSION >= 40800) || \
(CRYPTOPP_LLVM_CLANG_VERSION >= 30300) || (CRYPTOPP_APPLE_CLANG_VERSION >= 40300) || \
(CRYPTOPP_MSC_VERSION >= 1916)
# define CRYPTOPP_ARM_CRC32_AVAILABLE 1
# endif // Compilers
# endif // Platforms
#endif
// ARMv8 and AES. -march=armv8-a+crypto or above must be present
// Requires GCC 4.8, Clang 3.3 or Visual Studio 2017
#if !defined(CRYPTOPP_ARM_AES_AVAILABLE) && !defined(CRYPTOPP_DISABLE_ARM_AES)
# if defined(__aarch32__) || defined(__aarch64__) || defined(_M_ARM64)
# if defined(__ARM_FEATURE_CRYPTO) || (CRYPTOPP_GCC_VERSION >= 40800) || \
(CRYPTOPP_LLVM_CLANG_VERSION >= 30300) || (CRYPTOPP_APPLE_CLANG_VERSION >= 40300) || \
(CRYPTOPP_MSC_VERSION >= 1916)
# define CRYPTOPP_ARM_AES_AVAILABLE 1
# endif // Compilers
# endif // Platforms
#endif
// ARMv8 and PMULL. -march=armv8-a+crypto or above must be present
// Requires GCC 4.8, Clang 3.3 or Visual Studio 2017
#if !defined(CRYPTOPP_ARM_PMULL_AVAILABLE) && !defined(CRYPTOPP_DISABLE_ARM_PMULL)
# if defined(__aarch32__) || defined(__aarch64__) || defined(_M_ARM64)
# if defined(__ARM_FEATURE_CRYPTO) || (CRYPTOPP_GCC_VERSION >= 40800) || \
(CRYPTOPP_LLVM_CLANG_VERSION >= 30300) || (CRYPTOPP_APPLE_CLANG_VERSION >= 40300) || \
(CRYPTOPP_MSC_VERSION >= 1916)
# define CRYPTOPP_ARM_PMULL_AVAILABLE 1
# endif // Compilers
# endif // Platforms
#endif
// ARMv8 and SHA-1, SHA-256. -march=armv8-a+crypto or above must be present
// Requires GCC 4.8, Clang 3.3 or Visual Studio 2017
#if !defined(CRYPTOPP_ARM_SHA_AVAILABLE) && !defined(CRYPTOPP_DISABLE_ARM_SHA)
# if defined(__aarch32__) || defined(__aarch64__) || defined(_M_ARM64)
# if defined(__ARM_FEATURE_CRYPTO) || (CRYPTOPP_GCC_VERSION >= 40800) || \
(CRYPTOPP_LLVM_CLANG_VERSION >= 30300) || (CRYPTOPP_APPLE_CLANG_VERSION >= 40300) || \
(CRYPTOPP_MSC_VERSION >= 1916)
# define CRYPTOPP_ARM_SHA1_AVAILABLE 1
# define CRYPTOPP_ARM_SHA2_AVAILABLE 1
# endif // Compilers
# endif // Platforms
#endif
// Buggy Microsoft compiler, https://github.com/weidai11/cryptopp/issues/1096
#if defined(_MSC_VER)
# undef CRYPTOPP_ARM_SHA1_AVAILABLE
# undef CRYPTOPP_ARM_SHA2_AVAILABLE
#endif
// ARMv8 and SHA-512, SHA-3. -march=armv8.2-a+crypto or above must be present
// Requires GCC 8.0, Clang 11.0, Apple Clang 12.0 or Visual Studio 20??
#if !defined(CRYPTOPP_ARM_SHA3_AVAILABLE) && !defined(CRYPTOPP_DISABLE_ARM_SHA)
# if defined(__aarch32__) || defined(__aarch64__) || defined(_M_ARM64)
# if defined(__ARM_FEATURE_SHA3) || (CRYPTOPP_GCC_VERSION >= 80000) || \
(CRYPTOPP_APPLE_CLANG_VERSION >= 120000) || (CRYPTOPP_LLVM_CLANG_VERSION >= 110000)
# define CRYPTOPP_ARM_SHA512_AVAILABLE 1
# define CRYPTOPP_ARM_SHA3_AVAILABLE 1
# endif // Compilers
# endif // Platforms
#endif
// ARMv8 and SM3, SM4. -march=armv8.2-a+crypto or above must be present
// Requires GCC 8.0, Clang ??? or Visual Studio 20??
// Do not use APPLE_CLANG_VERSION; use __ARM_FEATURE_XXX instead.
#if !defined(CRYPTOPP_ARM_SM3_AVAILABLE) && !defined(CRYPTOPP_DISABLE_ARM_SM3)
# if defined(__aarch32__) || defined(__aarch64__) || defined(_M_ARM64)
# if defined(__ARM_FEATURE_SM3) || (CRYPTOPP_GCC_VERSION >= 80000)
# define CRYPTOPP_ARM_SM3_AVAILABLE 1
# define CRYPTOPP_ARM_SM4_AVAILABLE 1
# endif // Compilers
# endif // Platforms
#endif
// Limit the <arm_neon.h> include.
#if !defined(CRYPTOPP_ARM_NEON_HEADER)
# if defined(CRYPTOPP_ARM_NEON_AVAILABLE) || defined (CRYPTOPP_ARM_ASIMD_AVAILABLE)
# if !defined(_M_ARM64)
# define CRYPTOPP_ARM_NEON_HEADER 1
# endif
# endif
#endif
// Limit the <arm_acle.h> include.
#if !defined(CRYPTOPP_ARM_ACLE_HEADER)
# if defined(__aarch32__) || defined(__aarch64__) || (__ARM_ARCH >= 8) || defined(__ARM_ACLE)
# define CRYPTOPP_ARM_ACLE_HEADER 1
# endif
#endif
// Apple M1 hack. Xcode cross-compiles for iOS lack
// arm_acle.h. Apple M1 needs arm_acle.h. The problem
// in practice is, we can't get CRYPTOPP_ARM_ACLE_HEADER
// quite right based on ARM preprocessor macros.
#if defined(__APPLE__) && !defined(__ARM_FEATURE_CRC32)
# undef CRYPTOPP_ARM_ACLE_HEADER
#endif
// Cryptogams offers an ARM asm implementations for AES and SHA. Crypto++ does
// not provide an asm implementation. The Cryptogams AES implementation is
// about 50% faster than C/C++, and SHA implementation is about 30% faster
// than C/C++. Define this to use the Cryptogams AES and SHA implementations
// on GNU Linux systems. When defined, Crypto++ will use aes_armv4.S,
// sha1_armv4.S and sha256_armv4.S. https://www.cryptopp.com/wiki/Cryptogams.
#if !defined(CRYPTOPP_DISABLE_ARM_NEON)
# if defined(__arm__) && defined(__linux__)
# if defined(__GNUC__) || defined(__clang__)
# define CRYPTOGAMS_ARM_AES 1
# define CRYPTOGAMS_ARM_SHA1 1
# define CRYPTOGAMS_ARM_SHA256 1
# define CRYPTOGAMS_ARM_SHA512 1
# endif
# endif
#endif
// Clang intrinsic casts, http://bugs.llvm.org/show_bug.cgi?id=20670
#define UINT64_CAST(x) ((uint64_t *)(void *)(x))
#define CONST_UINT64_CAST(x) ((const uint64_t *)(const void *)(x))
#endif // CRYPTOPP_DISABLE_ASM
#endif // ARM32, ARM64
// ***************** AltiVec and Power8 ********************
#if (CRYPTOPP_BOOL_PPC32 || CRYPTOPP_BOOL_PPC64)
// Guard everything in CRYPTOPP_DISABLE_ASM
#if !defined(CRYPTOPP_DISABLE_ASM) && !defined(CRYPTOPP_DISABLE_ALTIVEC)
// An old Apple G5 with GCC 4.01 has AltiVec, but its only Power4 or so.
#if !defined(CRYPTOPP_ALTIVEC_AVAILABLE)
# if defined(_ARCH_PWR4) || defined(__ALTIVEC__) || \
(CRYPTOPP_XLC_VERSION >= 100000) || (CRYPTOPP_GCC_VERSION >= 40001) || \
(CRYPTOPP_LLVM_CLANG_VERSION >= 20900)
# define CRYPTOPP_ALTIVEC_AVAILABLE 1
# endif
#endif
#if defined(CRYPTOPP_ALTIVEC_AVAILABLE)
// We need Power7 for unaligned loads and stores
#if !defined(CRYPTOPP_POWER7_AVAILABLE) && !defined(CRYPTOPP_DISABLE_POWER7)
# if defined(_ARCH_PWR7) || (CRYPTOPP_XLC_VERSION >= 100000) || \
(CRYPTOPP_GCC_VERSION >= 40100) || (CRYPTOPP_LLVM_CLANG_VERSION >= 30100)
# define CRYPTOPP_POWER7_AVAILABLE 1
# endif
#endif
#if defined(CRYPTOPP_POWER7_AVAILABLE)
// We need Power8 for in-core crypto and 64-bit vector types
#if !defined(CRYPTOPP_POWER8_AVAILABLE) && !defined(CRYPTOPP_DISABLE_POWER8)
# if defined(_ARCH_PWR8) || (CRYPTOPP_XLC_VERSION >= 130000) || \
(CRYPTOPP_GCC_VERSION >= 40800) || (CRYPTOPP_LLVM_CLANG_VERSION >= 70000)
# define CRYPTOPP_POWER8_AVAILABLE 1
# endif
#endif
#if !defined(CRYPTOPP_POWER8_AES_AVAILABLE) && !defined(CRYPTOPP_DISABLE_POWER8_AES) && defined(CRYPTOPP_POWER8_AVAILABLE)
# if defined(__CRYPTO__) || defined(_ARCH_PWR8) || (CRYPTOPP_XLC_VERSION >= 130000) || \
(CRYPTOPP_GCC_VERSION >= 40800) || (CRYPTOPP_LLVM_CLANG_VERSION >= 70000)
//# define CRYPTOPP_POWER8_CRC_AVAILABLE 1
# define CRYPTOPP_POWER8_AES_AVAILABLE 1
# define CRYPTOPP_POWER8_VMULL_AVAILABLE 1
# define CRYPTOPP_POWER8_SHA_AVAILABLE 1
# endif
#endif
#if defined(CRYPTOPP_POWER8_AVAILABLE)
// Power9 for random numbers
#if !defined(CRYPTOPP_POWER9_AVAILABLE) && !defined(CRYPTOPP_DISABLE_POWER9)
# if defined(_ARCH_PWR9) || (CRYPTOPP_XLC_VERSION >= 130200) || \
(CRYPTOPP_GCC_VERSION >= 70000) || (CRYPTOPP_LLVM_CLANG_VERSION >= 80000)
# define CRYPTOPP_POWER9_AVAILABLE 1
# endif
#endif
#endif // CRYPTOPP_POWER8_AVAILABLE
#endif // CRYPTOPP_POWER7_AVAILABLE
#endif // CRYPTOPP_ALTIVEC_AVAILABLE
#endif // CRYPTOPP_DISABLE_ASM
#endif // PPC32, PPC64
// https://github.com/weidai11/cryptopp/issues/1015
#if defined(CRYPTOPP_DISABLE_ANDROID_ADVANCED_ISA)
# if defined(__ANDROID__) || defined(ANDROID)
# if (CRYPTOPP_BOOL_X86)
# undef CRYPTOPP_SSE41_AVAILABLE
# undef CRYPTOPP_SSE42_AVAILABLE
# undef CRYPTOPP_CLMUL_AVAILABLE
# undef CRYPTOPP_AESNI_AVAILABLE
# undef CRYPTOPP_SHANI_AVAILABLE
# undef CRYPTOPP_RDRAND_AVAILABLE
# undef CRYPTOPP_RDSEED_AVAILABLE
# undef CRYPTOPP_AVX_AVAILABLE
# undef CRYPTOPP_AVX2_AVAILABLE
# endif
# if (CRYPTOPP_BOOL_X64)
# undef CRYPTOPP_CLMUL_AVAILABLE
# undef CRYPTOPP_AESNI_AVAILABLE
# undef CRYPTOPP_SHANI_AVAILABLE
# undef CRYPTOPP_RDRAND_AVAILABLE
# undef CRYPTOPP_RDSEED_AVAILABLE
# undef CRYPTOPP_AVX_AVAILABLE
# undef CRYPTOPP_AVX2_AVAILABLE
# endif
# if (CRYPTOPP_BOOL_ARMV8)
# undef CRYPTOPP_ARM_CRC32_AVAILABLE
# undef CRYPTOPP_ARM_PMULL_AVAILABLE
# undef CRYPTOPP_ARM_AES_AVAILABLE
# undef CRYPTOPP_ARM_SHA1_AVAILABLE
# undef CRYPTOPP_ARM_SHA2_AVAILABLE
# endif
# endif // ANDROID
#endif // CRYPTOPP_DISABLE_ANDROID_ADVANCED_ISA
#endif // CRYPTOPP_CONFIG_ASM_H

View File

@ -0,0 +1,211 @@
// config_cpu.h - written and placed in public domain by Jeffrey Walton
// the bits that make up this source file are from the
// library's monolithic config.h.
/// \file config_cpu.h
/// \brief Library configuration file
/// \details <tt>config_cpu.h</tt> provides defines for the cpu and machine
/// architecture.
/// \details <tt>config.h</tt> was split into components in May 2019 to better
/// integrate with Autoconf and its feature tests. The splitting occurred so
/// users could continue to include <tt>config.h</tt> while allowing Autoconf
/// to write new <tt>config_asm.h</tt> and new <tt>config_cxx.h</tt> using
/// its feature tests.
/// \note You should include <tt>config.h</tt> rather than <tt>config_cpu.h</tt>
/// directly.
/// \sa <A HREF="https://github.com/weidai11/cryptopp/issues/835">Issue 835,
/// Make config.h more autoconf friendly</A>,
/// <A HREF="https://www.cryptopp.com/wiki/Configure.sh">Configure.sh script</A>
/// on the Crypto++ wiki,
/// <A HREF="https://sourceforge.net/p/predef/wiki/Architectures/">Sourceforge
/// Pre-defined Compiler Macros</A>
/// \since Crypto++ 8.3
#ifndef CRYPTOPP_CONFIG_CPU_H
#define CRYPTOPP_CONFIG_CPU_H
#include "config_ver.h"
#if defined(CRYPTOPP_DOXYGEN_PROCESSING)
/// \brief 32-bit x32 platform
/// \details CRYPTOPP_BOOL_X32 is defined to 1 when building the library
/// for a 32-bit x32 platform. Otherwise, the macro is not defined.
/// \details x32 is sometimes referred to as x86_32. x32 is the ILP32 data
/// model on a 64-bit cpu. Integers, longs and pointers are 32-bit but the
/// program runs on a 64-bit cpu.
/// \details The significance of x32 is, inline assembly must operate on
/// 64-bit registers, not 32-bit registers. That means, for example,
/// function prologues and epilogues must push and pop RSP, not ESP.
/// \note: Clang defines __ILP32__ on any 32-bit platform. Therefore,
/// CRYPTOPP_BOOL_X32 depends upon both __ILP32__ and __x86_64__.
/// \sa <A HREF="https://wiki.debian.org/X32Port">Debian X32 Port</A>,
/// <A HREF="https://wiki.gentoo.org/wiki/Project:Multilib/Concepts">Gentoo
/// Multilib Concepts</A>
#define CRYPTOPP_BOOL_X32 ...
/// \brief 32-bit x86 platform
/// \details CRYPTOPP_BOOL_X64 is defined to 1 when building the library
/// for a 64-bit x64 platform. Otherwise, the macro is not defined.
#define CRYPTOPP_BOOL_X64 ...
/// \brief 32-bit x86 platform
/// \details CRYPTOPP_BOOL_X86 is defined to 1 when building the library
/// for a 32-bit x86 platform. Otherwise, the macro is not defined.
#define CRYPTOPP_BOOL_X86 ...
#elif (defined(__ILP32__) || defined(_ILP32)) && defined(__x86_64__)
#define CRYPTOPP_BOOL_X32 1
#elif (defined(_M_X64) || defined(__x86_64__))
#define CRYPTOPP_BOOL_X64 1
#elif (defined(_M_IX86) || defined(__i386__) || defined(__i386) || defined(_X86_) || defined(__I86__) || defined(__INTEL__))
#define CRYPTOPP_BOOL_X86 1
#endif
#if defined(CRYPTOPP_DOXYGEN_PROCESSING)
/// \brief ARMv8 platform
/// \details CRYPTOPP_BOOL_ARMV8 is defined to 1 when building the library
/// for an ARMv8 platform. Otherwise, the macro is not defined.
/// \details ARMv8 includes both Aarch32 and Aarch64. Aarch32 is a 32-bit
/// execution environment on Aarch64.
#define CRYPTOPP_BOOL_ARMV8 ...
/// \brief 64-bit ARM platform
/// \details CRYPTOPP_BOOL_ARM64 is defined to 1 when building the library
/// for a 64-bit x64 platform. Otherwise, the macro is not defined.
/// \details Currently the macro indicates an ARM 64-bit architecture.
#define CRYPTOPP_BOOL_ARM64 ...
/// \brief 32-bit ARM platform
/// \details CRYPTOPP_BOOL_ARM32 is defined to 1 when building the library
/// for a 32-bit ARM platform. Otherwise, the macro is not defined.
/// \details Currently the macro indicates an ARM A-32 architecture.
#define CRYPTOPP_BOOL_ARM32 ...
#elif defined(__arm64__) || defined(__aarch32__) || defined(__aarch64__) || defined(_M_ARM64)
// Microsoft added ARM64 define December 2017.
#define CRYPTOPP_BOOL_ARMV8 1
#endif
#if defined(__arm64__) || defined(__aarch64__) || defined(_M_ARM64)
#define CRYPTOPP_BOOL_ARM64 1
#elif defined(__arm__) || defined(_M_ARM)
#define CRYPTOPP_BOOL_ARM32 1
#endif
#if defined(CRYPTOPP_DOXYGEN_PROCESSING)
/// \brief 64-bit PowerPC platform
/// \details CRYPTOPP_BOOL_PPC64 is defined to 1 when building the library
/// for a 64-bit PowerPC platform. Otherwise, the macro is not defined.
#define CRYPTOPP_BOOL_PPC64 ...
/// \brief 32-bit PowerPC platform
/// \details CRYPTOPP_BOOL_PPC32 is defined to 1 when building the library
/// for a 32-bit PowerPC platform. Otherwise, the macro is not defined.
#define CRYPTOPP_BOOL_PPC32 ...
#elif defined(__ppc64__) || defined(__powerpc64__) || defined(__PPC64__) || defined(_ARCH_PPC64)
#define CRYPTOPP_BOOL_PPC64 1
#elif defined(__powerpc__) || defined(__ppc__) || defined(__PPC__) || defined(_ARCH_PPC)
#define CRYPTOPP_BOOL_PPC32 1
#endif
#if defined(CRYPTOPP_DOXYGEN_PROCESSING)
/// \brief 64-bit MIPS platform
/// \details CRYPTOPP_BOOL_MIPS64 is defined to 1 when building the library
/// for a 64-bit MIPS platform. Otherwise, the macro is not defined.
#define CRYPTOPP_BOOL_MIPS64 ...
/// \brief 64-bit MIPS platform
/// \details CRYPTOPP_BOOL_MIPS32 is defined to 1 when building the library
/// for a 32-bit MIPS platform. Otherwise, the macro is not defined.
#define CRYPTOPP_BOOL_MIPS32 ...
#elif defined(__mips64__)
#define CRYPTOPP_BOOL_MIPS64 1
#elif defined(__mips__)
#define CRYPTOPP_BOOL_MIPS32 1
#endif
#if defined(CRYPTOPP_DOXYGEN_PROCESSING)
/// \brief 64-bit SPARC platform
/// \details CRYPTOPP_BOOL_SPARC64 is defined to 1 when building the library
/// for a 64-bit SPARC platform. Otherwise, the macro is not defined.
#define CRYPTOPP_BOOL_SPARC64 ...
/// \brief 32-bit SPARC platform
/// \details CRYPTOPP_BOOL_SPARC32 is defined to 1 when building the library
/// for a 32-bit SPARC platform. Otherwise, the macro is not defined.
#define CRYPTOPP_BOOL_SPARC32 ...
#elif defined(__sparc64__) || defined(__sparc64) || defined(__sparcv9) || defined(__sparc_v9__)
#define CRYPTOPP_BOOL_SPARC64 1
#elif defined(__sparc__) || defined(__sparc) || defined(__sparcv8) || defined(__sparc_v8__)
#define CRYPTOPP_BOOL_SPARC32 1
#endif
#if defined(CRYPTOPP_DOXYGEN_PROCESSING)
/// \brief L1 data cache line size
/// \details CRYPTOPP_L1_CACHE_LINE_SIZE should be a lower bound on the L1
/// data cache line size. It is used for defense against some timing attacks.
/// \details CRYPTOPP_L1_CACHE_LINE_SIZE default value on 32-bit platforms
/// is 32, and the default value on 64-bit platforms is 64. On PowerPC the
/// default value is 128 since all PowerPC cpu's starting at PPC 970 provide
/// it.
/// \note The runtime library on some PowerPC platforms misreport the size
/// of the cache line size. The runtime library reports 64, while the cpu
/// has a cache line size of 128.
/// \sa <A HREF="https://bugs.centos.org/view.php?id=14599">CentOS Issue
/// 14599: sysconf(_SC_LEVEL1_DCACHE_LINESIZE) returns 0 instead of 128</A>
/// \since Crypto++ 5.3
#define CRYPTOPP_L1_CACHE_LINE_SIZE ...
#else
#ifndef CRYPTOPP_L1_CACHE_LINE_SIZE
#if defined(CRYPTOPP_BOOL_X32) || defined(CRYPTOPP_BOOL_X64) || defined(CRYPTOPP_BOOL_ARMV8) || \
defined(CRYPTOPP_BOOL_MIPS64) || defined(CRYPTOPP_BOOL_SPARC64)
#define CRYPTOPP_L1_CACHE_LINE_SIZE 64
#elif defined(CRYPTOPP_BOOL_PPC32) || defined(CRYPTOPP_BOOL_PPC64)
// http://lists.llvm.org/pipermail/llvm-dev/2017-March/110982.html
#define CRYPTOPP_L1_CACHE_LINE_SIZE 128
#else
// L1 cache line size is 32 on Pentium III and earlier
#define CRYPTOPP_L1_CACHE_LINE_SIZE 32
#endif
#endif
#endif
#if defined(CRYPTOPP_DOXYGEN_PROCESSING)
/// \brief Initialized data section
/// \details CRYPTOPP_SECTION_INIT is added to variables to place them in the
/// initialized data section (sometimes denoted <tt>.data</tt>). The placement
/// helps avoid "uninitialized variable" warnings from Valgrind and other tools.
#define CRYPTOPP_SECTION_INIT ...
#else
// The section attribute attempts to initialize CPU flags to avoid Valgrind findings above -O1
#if ((defined(__MACH__) && defined(__APPLE__)) && ((CRYPTOPP_LLVM_CLANG_VERSION >= 30600) || \
(CRYPTOPP_APPLE_CLANG_VERSION >= 70100) || (CRYPTOPP_GCC_VERSION >= 40300)))
#define CRYPTOPP_SECTION_INIT __attribute__((section ("__DATA,__data")))
#elif (defined(__ELF__) && (CRYPTOPP_GCC_VERSION >= 40300))
#define CRYPTOPP_SECTION_INIT __attribute__((section ("nocommon")))
#elif defined(__ELF__) && (defined(__xlC__) || defined(__ibmxl__))
#define CRYPTOPP_SECTION_INIT __attribute__((section ("nocommon")))
#else
#define CRYPTOPP_SECTION_INIT
#endif
#endif
// How to disable CPU feature probing. We determine machine
// capabilities by performing an os/platform *query* first,
// like getauxv(). If the *query* fails, we move onto a
// cpu *probe*. The cpu *probe* tries to exeute an instruction
// and then catches a SIGILL on Linux or the exception
// EXCEPTION_ILLEGAL_INSTRUCTION on Windows. Some OSes
// fail to hangle a SIGILL gracefully, like Apple OSes. Apple
// machines corrupt memory and variables around the probe.
#if defined(__APPLE__)
#define CRYPTOPP_NO_CPU_FEATURE_PROBES 1
#endif
// Flavor of inline assembly language
#if defined(CRYPTOPP_DOXYGEN_PROCESSING)
/// \brief Microsoft style inline assembly
/// \details CRYPTOPP_MS_STYLE_INLINE_ASSEMBLY is defined when either
/// <tt>_MSC_VER</tt> or <tt>__BORLANDC__</tt> are defined.
#define CRYPTOPP_MS_STYLE_INLINE_ASSEMBLY ...
/// \brief GNU style inline assembly
/// \details CRYPTOPP_GNU_STYLE_INLINE_ASSEMBLY is defined when neither
/// <tt>_MSC_VER</tt> nor <tt>__BORLANDC__</tt> are defined.
#define CRYPTOPP_GNU_STYLE_INLINE_ASSEMBLY ...
#elif defined(_MSC_VER) || defined(__BORLANDC__)
#define CRYPTOPP_MS_STYLE_INLINE_ASSEMBLY 1
#else
#define CRYPTOPP_GNU_STYLE_INLINE_ASSEMBLY 1
#endif
#endif // CRYPTOPP_CONFIG_CPU_H

View File

@ -0,0 +1,250 @@
// config_cxx.h - written and placed in public domain by Jeffrey Walton
// the bits that make up this source file are from the
// library's monolithic config.h.
/// \file config_cxx.h
/// \brief Library configuration file
/// \details <tt>config_cxx.h</tt> provides defines for C++ language and
/// runtime library
/// features.
/// \details <tt>config.h</tt> was split into components in May 2019 to better
/// integrate with Autoconf and its feature tests. The splitting occurred so
/// users could continue to include <tt>config.h</tt> while allowing Autoconf
/// to write new <tt>config_asm.h</tt> and new <tt>config_cxx.h</tt> using
/// its feature tests.
/// \note You should include <tt>config.h</tt> rather than <tt>config_cxx.h</tt>
/// directly.
/// \sa <A HREF="https://github.com/weidai11/cryptopp/issues/835">Issue 835,
/// Make config.h more autoconf friendly</A>,
/// <A HREF="https://www.cryptopp.com/wiki/Configure.sh">Configure.sh script</A>
/// on the Crypto++ wiki
/// \since Crypto++ 8.3
// Visual Studio began at VS2010, http://msdn.microsoft.com/en-us/library/hh567368%28v=vs.110%29.aspx
// and https://docs.microsoft.com/en-us/cpp/visual-cpp-language-conformance
// Intel, http://software.intel.com/en-us/articles/c0x-features-supported-by-intel-c-compiler
// GCC, http://gcc.gnu.org/projects/cxx0x.html
// Clang, http://clang.llvm.org/cxx_status.html
#ifndef CRYPTOPP_CONFIG_CXX_H
#define CRYPTOPP_CONFIG_CXX_H
#include "config_os.h"
#include "config_cpu.h"
#include "config_ver.h"
// https://github.com/weidai11/cryptopp/issues/960
#include <string>
#include <exception>
// You may need to force include a C++ header on Android when using STLPort
// to ensure _STLPORT_VERSION is defined
#if (defined(_MSC_VER) && _MSC_VER <= 1300) || \
defined(__MWERKS__) || \
(defined(_STLPORT_VERSION) && ((_STLPORT_VERSION < 0x450) || defined(_STLP_NO_UNCAUGHT_EXCEPT_SUPPORT)) || \
(__cplusplus >= 202002L))
#define CRYPTOPP_DISABLE_UNCAUGHT_EXCEPTION
#endif
// Ancient Crypto++ define, dating back to C++98.
#ifndef CRYPTOPP_DISABLE_UNCAUGHT_EXCEPTION
# define CRYPTOPP_UNCAUGHT_EXCEPTION_AVAILABLE 1
# define CRYPTOPP_CXX98_UNCAUGHT_EXCEPTION 1
#endif
// Compatibility with non-clang compilers.
#ifndef __has_feature
# define __has_feature(x) 0
#endif
// C++11 macro version, https://stackoverflow.com/q/7223991/608639
#if ((_MSC_VER >= 1600) || (__cplusplus >= 201103L)) && !defined(_STLPORT_VERSION)
# define CRYPTOPP_CXX11 1
#endif
// Hack ahead. Apple's standard library does not have C++'s unique_ptr in C++11.
// We can't test for unique_ptr directly because some of the non-Apple Clangs
// on OS X fail the same way. However, modern standard libraries have
// <forward_list>, so we test for it instead. Thanks to Jonathan Wakely for
// devising the clever test for modern/ancient versions. TODO: test under
// Xcode 3, where g++ is really g++.
#if defined(__APPLE__) && defined(__clang__)
# if !(defined(__has_include) && __has_include(<forward_list>))
# undef CRYPTOPP_CXX11
# endif
#endif
// C++14 macro version, https://stackoverflow.com/q/26089319/608639
#if defined(CRYPTOPP_CXX11) && !defined(CRYPTOPP_NO_CXX14)
# if ((_MSC_VER >= 1900) || (__cplusplus >= 201402L)) && !defined(_STLPORT_VERSION)
# define CRYPTOPP_CXX14 1
# endif
#endif
// C++17 macro version, https://stackoverflow.com/q/38456127/608639
#if defined(CRYPTOPP_CXX14) && !defined(CRYPTOPP_NO_CXX17)
# if ((_MSC_VER >= 1900) || (__cplusplus >= 201703L)) && !defined(_STLPORT_VERSION)
# define CRYPTOPP_CXX17 1
# endif
#endif
// ***************** C++11 and above ********************
#if defined(CRYPTOPP_CXX11)
// atomics: MS at VS2012 (17.00); GCC at 4.4; Clang at 3.1/3.2; Intel 13.0; SunCC 5.14.
#if (CRYPTOPP_MSC_VERSION >= 1700) || __has_feature(cxx_atomic) || \
(__INTEL_COMPILER >= 1300) || (CRYPTOPP_GCC_VERSION >= 40400) || (__SUNPRO_CC >= 0x5140)
# define CRYPTOPP_CXX11_ATOMIC 1
#endif // atomics
// synchronization: MS at VS2012 (17.00); GCC at 4.4; Clang at 3.3; Xcode 5.0; Intel 12.0; SunCC 5.13.
// TODO: verify Clang and Intel versions; find __has_feature(x) extension for Clang
#if (CRYPTOPP_MSC_VERSION >= 1700) || (CRYPTOPP_LLVM_CLANG_VERSION >= 30300) || \
(CRYPTOPP_APPLE_CLANG_VERSION >= 50000) || (__INTEL_COMPILER >= 1200) || \
(CRYPTOPP_GCC_VERSION >= 40400) || (__SUNPRO_CC >= 0x5130)
// Hack ahead. New GCC compilers like GCC 6 on AIX 7.0 or earlier as well as original MinGW
// don't have the synchronization gear. However, Wakely's test used for Apple does not work
// on the GCC/AIX combination. Another twist is we need other stuff from C++11,
// like no-except destructors. Dumping preprocessors shows the following may
// apply: http://stackoverflow.com/q/14191566/608639.
# include <cstddef>
# if !defined(__GLIBCXX__) || defined(_GLIBCXX_HAS_GTHREADS)
# define CRYPTOPP_CXX11_SYNCHRONIZATION 1
# endif
#endif // synchronization
// Dynamic Initialization and Destruction with Concurrency ("Magic Statics")
// MS at VS2015 with Vista (19.00); GCC at 4.3; LLVM Clang at 2.9; Apple Clang at 4.0; Intel 11.1; SunCC 5.13.
// Microsoft's implementation only works for Vista and above, so its further
// limited. http://connect.microsoft.com/VisualStudio/feedback/details/1789709
// Clang may not support this as early as we indicate. Also see https://bugs.llvm.org/show_bug.cgi?id=47012.
#if (__cpp_threadsafe_static_init >= 200806) || \
(CRYPTOPP_MSC_VERSION >= 1900) && ((WINVER >= 0x0600) || (_WIN32_WINNT >= 0x0600)) || \
(CRYPTOPP_LLVM_CLANG_VERSION >= 20900) || (CRYPTOPP_APPLE_CLANG_VERSION >= 40000) || \
(__INTEL_COMPILER >= 1110) || (CRYPTOPP_GCC_VERSION >= 40300) || (__SUNPRO_CC >= 0x5130)
# define CRYPTOPP_CXX11_STATIC_INIT 1
#endif // Dynamic Initialization compilers
// deleted functions: MS at VS2013 (18.00); GCC at 4.3; Clang at 2.9; Intel 12.1; SunCC 5.13.
#if (CRYPTOPP_MSC_VERSION >= 1800) || (CRYPTOPP_LLVM_CLANG_VERSION >= 20900) || \
(CRYPTOPP_APPLE_CLANG_VERSION >= 40000) || (__INTEL_COMPILER >= 1210) || \
(CRYPTOPP_GCC_VERSION >= 40300) || (__SUNPRO_CC >= 0x5130)
# define CRYPTOPP_CXX11_DELETED_FUNCTIONS 1
#endif // deleted functions
// alignof/alignas: MS at VS2015 (19.00); GCC at 4.8; Clang at 3.0; Intel 15.0; SunCC 5.13.
#if (CRYPTOPP_MSC_VERSION >= 1900) || __has_feature(cxx_alignas) || \
(__INTEL_COMPILER >= 1500) || (CRYPTOPP_GCC_VERSION >= 40800) || (__SUNPRO_CC >= 0x5130)
# define CRYPTOPP_CXX11_ALIGNAS 1
#endif // alignas
// alignof: MS at VS2015 (19.00); GCC at 4.5; Clang at 2.9; Intel 15.0; SunCC 5.13.
#if (CRYPTOPP_MSC_VERSION >= 1900) || __has_feature(cxx_alignof) || \
(__INTEL_COMPILER >= 1500) || (CRYPTOPP_GCC_VERSION >= 40500) || (__SUNPRO_CC >= 0x5130)
# define CRYPTOPP_CXX11_ALIGNOF 1
#endif // alignof
// initializer lists: MS at VS2013 (18.00); GCC at 4.4; Clang at 3.1; Intel 14.0; SunCC 5.13.
#if (CRYPTOPP_MSC_VERSION >= 1800) || (CRYPTOPP_LLVM_CLANG_VERSION >= 30100) || \
(CRYPTOPP_APPLE_CLANG_VERSION >= 40000) || (__INTEL_COMPILER >= 1400) || \
(CRYPTOPP_GCC_VERSION >= 40400) || (__SUNPRO_CC >= 0x5130)
# define CRYPTOPP_CXX11_INITIALIZER_LIST 1
#endif // alignas
// lambdas: MS at VS2012 (17.00); GCC at 4.9; Clang at 3.3; Intel 12.0; SunCC 5.14.
#if (CRYPTOPP_MSC_VERSION >= 1700) || __has_feature(cxx_lambdas) || \
(__INTEL_COMPILER >= 1200) || (CRYPTOPP_GCC_VERSION >= 40900) || (__SUNPRO_CC >= 0x5140)
# define CRYPTOPP_CXX11_LAMBDA 1
#endif // lambdas
// noexcept: MS at VS2015 (19.00); GCC at 4.6; Clang at 3.0; Intel 14.0; SunCC 5.13.
#if (CRYPTOPP_MSC_VERSION >= 1900) || __has_feature(cxx_noexcept) || \
(__INTEL_COMPILER >= 1400) || (CRYPTOPP_GCC_VERSION >= 40600) || (__SUNPRO_CC >= 0x5130)
# define CRYPTOPP_CXX11_NOEXCEPT 1
#endif // noexcept compilers
// variadic templates: MS at VS2013 (18.00); GCC at 4.3; Clang at 2.9; Intel 12.1; SunCC 5.13.
#if (__cpp_variadic_templates >= 200704) || __has_feature(cxx_variadic_templates) || \
(CRYPTOPP_MSC_VERSION >= 1800) || (__INTEL_COMPILER >= 1210) || \
(CRYPTOPP_GCC_VERSION >= 40300) || (__SUNPRO_CC >= 0x5130)
# define CRYPTOPP_CXX11_VARIADIC_TEMPLATES 1
#endif // variadic templates
// constexpr: MS at VS2015 (19.00); GCC at 4.6; Clang at 3.1; Intel 16.0; SunCC 5.13.
// Intel has mis-supported the feature since at least ICPC 13.00
#if (__cpp_constexpr >= 200704) || __has_feature(cxx_constexpr) || \
(CRYPTOPP_MSC_VERSION >= 1900) || (__INTEL_COMPILER >= 1600) || \
(CRYPTOPP_GCC_VERSION >= 40600) || (__SUNPRO_CC >= 0x5130)
# define CRYPTOPP_CXX11_CONSTEXPR 1
#endif // constexpr compilers
// strong typed enums: MS at VS2012 (17.00); GCC at 4.4; Clang at 3.3; Intel 14.0; SunCC 5.12.
// Mircorosft and Intel had partial support earlier, but we require full support.
#if (CRYPTOPP_MSC_VERSION >= 1700) || __has_feature(cxx_strong_enums) || \
(__INTEL_COMPILER >= 1400) || (CRYPTOPP_GCC_VERSION >= 40400) || (__SUNPRO_CC >= 0x5120)
# define CRYPTOPP_CXX11_STRONG_ENUM 1
#endif // constexpr compilers
// nullptr_t: MS at VS2010 (16.00); GCC at 4.6; Clang at 3.3; Intel 10.0; SunCC 5.13.
#if (CRYPTOPP_MSC_VERSION >= 1600) || __has_feature(cxx_nullptr) || \
(__INTEL_COMPILER >= 1000) || (CRYPTOPP_GCC_VERSION >= 40600) || \
(__SUNPRO_CC >= 0x5130) || defined(__IBMCPP_NULLPTR)
# define CRYPTOPP_CXX11_NULLPTR 1
#endif // nullptr_t compilers
#endif // CRYPTOPP_CXX11
// ***************** C++14 and above ********************
#if defined(CRYPTOPP_CXX14)
// Extended static_assert with one argument
// Microsoft cannot handle the single argument static_assert as of VS2019 (cl.exe 19.00)
#if (__cpp_static_assert >= 201411)
# define CRYPTOPP_CXX17_STATIC_ASSERT 1
#endif // static_assert
#endif
// ***************** C++17 and above ********************
// C++17 is available
#if defined(CRYPTOPP_CXX17)
// C++17 uncaught_exceptions: MS at VS2015 (19.00); GCC at 6.0; Clang at 3.5; Intel 18.0.
// Clang and __EXCEPTIONS see http://releases.llvm.org/3.6.0/tools/clang/docs/ReleaseNotes.html
// Also see https://github.com/weidai11/cryptopp/issues/980. I'm not sure what
// to do when the compiler defines __cpp_lib_uncaught_exceptions but the platform
// does not support std::uncaught_exceptions. What was Apple thinking???
#if defined(__clang__)
# if __EXCEPTIONS && __has_feature(cxx_exceptions)
# if __cpp_lib_uncaught_exceptions >= 201411L
# define CRYPTOPP_CXX17_UNCAUGHT_EXCEPTIONS 1
# endif
# endif
#elif (CRYPTOPP_MSC_VERSION >= 1900) || (__INTEL_COMPILER >= 1800) || \
(CRYPTOPP_GCC_VERSION >= 60000) || (__cpp_lib_uncaught_exceptions >= 201411L)
# define CRYPTOPP_CXX17_UNCAUGHT_EXCEPTIONS 1
#endif // uncaught_exceptions compilers
#endif // CRYPTOPP_CXX17
// ***************** C++ fixups ********************
#if defined(CRYPTOPP_CXX11_NOEXCEPT)
# define CRYPTOPP_THROW noexcept(false)
# define CRYPTOPP_NO_THROW noexcept(true)
#else
# define CRYPTOPP_THROW
# define CRYPTOPP_NO_THROW
#endif // CRYPTOPP_CXX11_NOEXCEPT
// Hack... C++11 nullptr_t type safety and analysis
#if defined(CRYPTOPP_CXX11_NULLPTR) && !defined(NULLPTR)
# define NULLPTR nullptr
#elif !defined(NULLPTR)
# define NULLPTR NULL
#endif // CRYPTOPP_CXX11_NULLPTR
#endif // CRYPTOPP_CONFIG_CXX_H

View File

@ -0,0 +1,178 @@
// config_dll.h - written and placed in public domain by Jeffrey Walton
// the bits that make up this source file are from the
// library's monolithic config.h.
/// \file config_dll.h
/// \brief Library configuration file
/// \details <tt>config_dll.h</tt> provides defines for shared objects and
/// dynamic libraries. Generally speaking the macros are used to export
/// classes and template classes from the Win32 dynamic link library.
/// When not building the Win32 dynamic link library they are mostly an extern
/// template declaration.
/// \details In practice they are a furball coughed up by a cat and then peed
/// on by a dog. They are awful to get just right because of inconsistent
/// compiler support for extern templates, manual instantiation and the FIPS DLL.
/// \details <tt>config.h</tt> was split into components in May 2019 to better
/// integrate with Autoconf and its feature tests. The splitting occurred so
/// users could continue to include <tt>config.h</tt> while allowing Autoconf
/// to write new <tt>config_asm.h</tt> and new <tt>config_cxx.h</tt> using
/// its feature tests.
/// \note You should include <tt>config.h</tt> rather than <tt>config_dll.h</tt>
/// directly.
/// \sa <A HREF="https://github.com/weidai11/cryptopp/issues/835">Issue 835,
/// Make config.h more autoconf friendly</A>,
/// <A HREF="https://www.cryptopp.com/wiki/Configure.sh">Configure.sh script</A>,
/// <A HREF="https://www.cryptopp.com/wiki/Visual_Studio">Visual Studio</A>,
/// and <A HREF="https://www.cryptopp.com/wiki/FIPS_DLL">FIPS DLL</A>
/// on the Crypto++ wiki
/// \since Crypto++ 8.3
#ifndef CRYPTOPP_CONFIG_DLL_H
#define CRYPTOPP_CONFIG_DLL_H
#include "config_os.h"
#if defined(CRYPTOPP_DOXYGEN_PROCESSING)
/// \brief Win32 define for dynamic link libraries
/// \details CRYPTOPP_IMPORTS is set in the Visual Studio project files.
/// When the macro is set, <tt>CRYPTOPP_DLL</tt> is defined to
/// <tt>__declspec(dllimport)</tt>.
/// \details This macro has no effect on Unix &amp; Linux.
/// \sa <A HREF="https://www.cryptopp.com/wiki/Visual_Studio">Visual Studio</A>,
/// and <A HREF="https://www.cryptopp.com/wiki/FIPS_DLL">FIPS DLL</A>
/// on the Crypto++ wiki
#define CRYPTOPP_IMPORTS ...
/// \brief Win32 define for dynamic link libraries
/// \details CRYPTOPP_EXPORTS is set in the Visual Studio project files.
/// When the macro is set, <tt>CRYPTOPP_DLL</tt> is defined to
/// <tt>__declspec(dllexport)</tt>.
/// \details This macro has no effect on Unix &amp; Linux.
/// \sa <A HREF="https://www.cryptopp.com/wiki/Visual_Studio">Visual Studio</A>,
/// and <A HREF="https://www.cryptopp.com/wiki/FIPS_DLL">FIPS DLL</A>
/// on the Crypto++ wiki
#define CRYPTOPP_EXPORTS ...
/// \brief Win32 define for dynamic link libraries
/// \details CRYPTOPP_IS_DLL is set in the Visual Studio project files.
/// \sa <A HREF="https://www.cryptopp.com/wiki/Visual_Studio">Visual Studio</A>,
/// and <A HREF="https://www.cryptopp.com/wiki/FIPS_DLL">FIPS DLL</A>
/// on the Crypto++ wiki
#define CRYPTOPP_IS_DLL
/// \brief Instantiate templates in a dynamic library
/// \details CRYPTOPP_DLL_TEMPLATE_CLASS decoration should be used
/// for classes intended to be exported from dynamic link libraries.
/// \details This macro is primarily used on Win32, but sees some
/// action on Unix &amp; Linux due to the source file <tt>dll.cpp</tt>.
/// \sa <A HREF="https://www.cryptopp.com/wiki/Visual_Studio">Visual Studio</A>,
/// and <A HREF="https://www.cryptopp.com/wiki/FIPS_DLL">FIPS DLL</A>
/// on the Crypto++ wiki
#define CRYPTOPP_DLL_TEMPLATE_CLASS ...
/// \brief Instantiate templates in a dynamic library
/// \details CRYPTOPP_EXTERN_DLL_TEMPLATE_CLASS decoration should be used
/// for template classes intended to be exported from dynamic link libraries.
/// \details This macro is primarily used on Win32, but sees some
/// action on Unix &amp; Linux due to the source file <tt>dll.cpp</tt>.
/// \sa <A HREF="https://www.cryptopp.com/wiki/Visual_Studio">Visual Studio</A>,
/// and <A HREF="https://www.cryptopp.com/wiki/FIPS_DLL">FIPS DLL</A>
/// on the Crypto++ wiki
#define CRYPTOPP_EXTERN_DLL_TEMPLATE_CLASS ...
/// \brief Instantiate templates in a dynamic library
/// \details CRYPTOPP_STATIC_TEMPLATE_CLASS decoration should be used
/// for template classes intended to be exported from dynamic link libraries.
/// \details This macro is primarily used on Win32, but sees some
/// action on Unix &amp; Linux due to the source file <tt>dll.cpp</tt>.
/// \sa <A HREF="https://www.cryptopp.com/wiki/Visual_Studio">Visual Studio</A>,
/// and <A HREF="https://www.cryptopp.com/wiki/FIPS_DLL">FIPS DLL</A>
/// on the Crypto++ wiki
#define CRYPTOPP_STATIC_TEMPLATE_CLASS ...
/// \brief Instantiate templates in a dynamic library
/// \details CRYPTOPP_EXTERN_STATIC_TEMPLATE_CLASS decoration should be used
/// for template classes intended to be exported from dynamic link libraries.
/// \details This macro is primarily used on Win32, but sees some
/// action on Unix &amp; Linux due to the source file <tt>dll.cpp</tt>.
/// \sa <A HREF="https://www.cryptopp.com/wiki/Visual_Studio">Visual Studio</A>,
/// and <A HREF="https://www.cryptopp.com/wiki/FIPS_DLL">FIPS DLL</A>
/// on the Crypto++ wiki
#define CRYPTOPP_EXTERN_STATIC_TEMPLATE_CLASS ...
/// \brief Override for internal linkage
/// \details CRYPTOPP_TABLE can be used to override internal linkage
/// on tables with the <tt>const</tt> qualifier. According to C++ rules
/// a declaration with <tt>const</tt> qualifier is internal linkage.
/// \note The name CRYPTOPP_TABLE was chosen because it is often used to
/// export a table, like AES or SHA constants. The name avoids collisions
/// with the DLL gear macros, like CRYPTOPP_EXPORTS and CRYPTOPP_EXTERN.
#define CRYPTOPP_TABLE extern
/// \brief Win32 calling convention
/// \details CRYPTOPP_API sets the calling convention on Win32.
/// On Win32 CRYPTOPP_API is <tt>__cedcl</tt>. On Unix &amp; Linux
/// CRYPTOPP_API is defined to nothing.
/// \sa <A HREF="https://www.cryptopp.com/wiki/Visual_Studio">Visual Studio</A>
/// on the Crypto++ wiki
#define CRYPTOPP_API ...
#else // CRYPTOPP_DOXYGEN_PROCESSING
#if defined(CRYPTOPP_WIN32_AVAILABLE)
#if defined(CRYPTOPP_EXPORTS)
# define CRYPTOPP_IS_DLL
# define CRYPTOPP_DLL __declspec(dllexport)
#elif defined(CRYPTOPP_IMPORTS)
# define CRYPTOPP_IS_DLL
# define CRYPTOPP_DLL __declspec(dllimport)
#else
# define CRYPTOPP_DLL
#endif
// C++ makes const internal linkage
#define CRYPTOPP_TABLE extern
#define CRYPTOPP_API __cdecl
#else // not CRYPTOPP_WIN32_AVAILABLE
// C++ makes const internal linkage
#define CRYPTOPP_TABLE extern
#define CRYPTOPP_DLL
#define CRYPTOPP_API
#endif // CRYPTOPP_WIN32_AVAILABLE
#if defined(__MWERKS__)
# define CRYPTOPP_EXTERN_DLL_TEMPLATE_CLASS extern class CRYPTOPP_DLL
#elif defined(__BORLANDC__) || defined(__SUNPRO_CC)
# define CRYPTOPP_EXTERN_DLL_TEMPLATE_CLASS template class CRYPTOPP_DLL
#else
# define CRYPTOPP_EXTERN_DLL_TEMPLATE_CLASS extern template class CRYPTOPP_DLL
#endif
#if defined(CRYPTOPP_MANUALLY_INSTANTIATE_TEMPLATES) && !defined(CRYPTOPP_IMPORTS)
# define CRYPTOPP_DLL_TEMPLATE_CLASS template class CRYPTOPP_DLL
#else
# define CRYPTOPP_DLL_TEMPLATE_CLASS CRYPTOPP_EXTERN_DLL_TEMPLATE_CLASS
#endif
#if defined(__MWERKS__)
# define CRYPTOPP_EXTERN_STATIC_TEMPLATE_CLASS extern class
#elif defined(__BORLANDC__) || defined(__SUNPRO_CC)
# define CRYPTOPP_EXTERN_STATIC_TEMPLATE_CLASS template class
#else
# define CRYPTOPP_EXTERN_STATIC_TEMPLATE_CLASS extern template class
#endif
#if defined(CRYPTOPP_MANUALLY_INSTANTIATE_TEMPLATES) && !defined(CRYPTOPP_EXPORTS)
# define CRYPTOPP_STATIC_TEMPLATE_CLASS template class
#else
# define CRYPTOPP_STATIC_TEMPLATE_CLASS CRYPTOPP_EXTERN_STATIC_TEMPLATE_CLASS
#endif
#endif // CRYPTOPP_DOXYGEN_PROCESSING
#endif // CRYPTOPP_CONFIG_DLL_H

View File

@ -0,0 +1,268 @@
// config_int.h - written and placed in public domain by Jeffrey Walton
// the bits that make up this source file are from the
// library's monolithic config.h.
/// \file config_int.h
/// \brief Library configuration file
/// \details <tt>config_int.h</tt> provides defines and typedefs for fixed
/// size integers. The library's choices for fixed size integers predates other
/// standard-based integers by about 5 years. After fixed sizes were
/// made standard, the library continued to use its own definitions for
/// compatibility with previous versions of the library.
/// \details <tt>config.h</tt> was split into components in May 2019 to better
/// integrate with Autoconf and its feature tests. The splitting occurred so
/// users could continue to include <tt>config.h</tt> while allowing Autoconf
/// to write new <tt>config_asm.h</tt> and new <tt>config_cxx.h</tt> using
/// its feature tests.
/// \note You should include <tt>config.h</tt> rather than <tt>config_int.h</tt>
/// directly.
/// \sa <A HREF="https://github.com/weidai11/cryptopp/issues/835">Issue 835,
/// Make config.h more autoconf friendly</A>,
/// <A HREF="https://www.cryptopp.com/wiki/Configure.sh">Configure.sh script</A>
/// on the Crypto++ wiki
/// \since Crypto++ 8.3
#ifndef CRYPTOPP_CONFIG_INT_H
#define CRYPTOPP_CONFIG_INT_H
#include "config_ns.h"
#include "config_ver.h"
#include "config_misc.h"
// C5264 new for VS2022/v17.4, MSC v17.3.4
// https://github.com/weidai11/cryptopp/issues/1185
#if (CRYPTOPP_MSC_VERSION)
# pragma warning(push)
# if (CRYPTOPP_MSC_VERSION >= 1933)
# pragma warning(disable: 5264)
# endif
#endif
/// \brief Library byte guard
/// \details CRYPTOPP_NO_GLOBAL_BYTE indicates <tt>byte</tt> is in the Crypto++
/// namespace.
/// \details The Crypto++ <tt>byte</tt> was originally in global namespace to avoid
/// ambiguity with other byte typedefs. <tt>byte</tt> was moved to CryptoPP namespace
/// at Crypto++ 6.0 due to C++17, <tt>std::byte</tt> and potential compile problems.
/// \sa <A HREF="http://github.com/weidai11/cryptopp/issues/442">Issue 442</A>,
/// <A HREF="https://www.cryptopp.com/wiki/Configure.sh">std::byte</A> on the
/// Crypto++ wiki
/// \since Crypto++ 6.0
#define CRYPTOPP_NO_GLOBAL_BYTE 1
NAMESPACE_BEGIN(CryptoPP)
// Signed words added at Issue 609 for early versions of and Visual Studio and
// the NaCl gear. Also see https://github.com/weidai11/cryptopp/issues/609.
/// \brief 8-bit unsigned datatype
/// \details The Crypto++ <tt>byte</tt> was originally in global namespace to avoid
/// ambiguity with other byte typedefs. <tt>byte</tt> was moved to CryptoPP namespace
/// at Crypto++ 6.0 due to C++17, <tt>std::byte</tt> and potential compile problems.
/// \sa CRYPTOPP_NO_GLOBAL_BYTE, <A HREF="http://github.com/weidai11/cryptopp/issues/442">Issue 442</A>,
/// <A HREF="https://www.cryptopp.com/wiki/Configure.sh">std::byte</A> on the
/// Crypto++ wiki
/// \since Crypto++ 1.0, CryptoPP namespace since Crypto++ 6.0
typedef unsigned char byte;
/// \brief 16-bit unsigned datatype
/// \since Crypto++ 1.0
typedef unsigned short word16;
/// \brief 32-bit unsigned datatype
/// \since Crypto++ 1.0
typedef unsigned int word32;
/// \brief 8-bit signed datatype
/// \details The 8-bit signed datatype was added to support constant time
/// implementations for curve25519, X25519 key agreement and ed25519
/// signatures.
/// \since Crypto++ 8.0
typedef signed char sbyte;
/// \brief 16-bit signed datatype
/// \details The 32-bit signed datatype was added to support constant time
/// implementations for curve25519, X25519 key agreement and ed25519
/// signatures.
/// \since Crypto++ 8.0
typedef signed short sword16;
/// \brief 32-bit signed datatype
/// \details The 32-bit signed datatype was added to support constant time
/// implementations for curve25519, X25519 key agreement and ed25519
/// signatures.
/// \since Crypto++ 8.0
typedef signed int sword32;
#if defined(CRYPTOPP_DOXYGEN_PROCESSING)
/// \brief 64-bit unsigned datatype
/// \details The typedef for <tt>word64</tt> varies depending on the platform.
/// On Microsoft platforms it is <tt>unsigned __int64</tt>. On Unix &amp; Linux
/// with LP64 data model it is <tt>unsigned long</tt>. On Unix &amp; Linux with ILP32
/// data model it is <tt>unsigned long long</tt>.
/// \since Crypto++ 1.0
typedef unsigned long long word64;
/// \brief 64-bit signed datatype
/// \details The typedef for <tt>sword64</tt> varies depending on the platform.
/// On Microsoft platforms it is <tt>signed __int64</tt>. On Unix &amp; Linux
/// with LP64 data model it is <tt>signed long</tt>. On Unix &amp; Linux with ILP32
/// data model it is <tt>signed long long</tt>.
/// \since Crypto++ 8.0
typedef signed long long sword64;
/// \brief 128-bit unsigned datatype
/// \details The typedef for <tt>word128</tt> varies depending on the platform.
/// <tt>word128</tt> is only available on 64-bit machines when
/// <tt>CRYPTOPP_WORD128_AVAILABLE</tt> is defined.
/// On Unix &amp; Linux with LP64 data model it is <tt>__uint128_t</tt>.
/// Microsoft platforms do not provide a 128-bit integer type. 32-bit platforms
/// do not provide a 128-bit integer type.
/// \since Crypto++ 5.6
typedef __uint128_t word128;
/// \brief Declare an unsigned word64
/// \details W64LIT is used to portability declare or assign 64-bit literal values.
/// W64LIT will append the proper suffix to ensure the compiler accepts the literal.
/// \details Use the macro like shown below.
/// <pre>
/// word64 x = W64LIT(0xffffffffffffffff);
/// </pre>
/// \since Crypto++ 1.0
#define W64LIT(x) ...
/// \brief Declare a signed word64
/// \details SW64LIT is used to portability declare or assign 64-bit literal values.
/// SW64LIT will append the proper suffix to ensure the compiler accepts the literal.
/// \details Use the macro like shown below.
/// <pre>
/// sword64 x = SW64LIT(0xffffffffffffffff);
/// </pre>
/// \since Crypto++ 8.0
#define SW64LIT(x) ...
/// \brief Declare ops on word64 are slow
/// \details CRYPTOPP_BOOL_SLOW_WORD64 is typically defined to 1 on platforms
/// that have a machine word smaller than 64-bits. That is, the define
/// is present on 32-bit platforms. The define is also present on platforms
/// where the cpu is slow even with a 64-bit cpu.
#define CRYPTOPP_BOOL_SLOW_WORD64 ...
#elif defined(_MSC_VER) || defined(__BORLANDC__)
typedef signed __int64 sword64;
typedef unsigned __int64 word64;
#define SW64LIT(x) x##i64
#define W64LIT(x) x##ui64
#elif (_LP64 || __LP64__)
typedef signed long sword64;
typedef unsigned long word64;
#define SW64LIT(x) x##L
#define W64LIT(x) x##UL
#else
typedef signed long long sword64;
typedef unsigned long long word64;
#define SW64LIT(x) x##LL
#define W64LIT(x) x##ULL
#endif
/// \brief Large word type
/// \details lword is a typedef for large word types. It is used for file
/// offsets and such.
typedef word64 lword;
/// \brief Large word type max value
/// \details LWORD_MAX is the maximum value for large word types.
/// Since an <tt>lword</tt> is an unsigned type, the value is
/// <tt>0xffffffffffffffff</tt>. W64LIT will append the proper suffix.
CRYPTOPP_CONST_OR_CONSTEXPR lword LWORD_MAX = W64LIT(0xffffffffffffffff);
#if defined(CRYPTOPP_DOXYGEN_PROCESSING)
/// \brief Half word used for multiprecision integer arithmetic
/// \details hword is used for multiprecision integer arithmetic.
/// The typedef for <tt>hword</tt> varies depending on the platform.
/// On 32-bit platforms it is usually <tt>word16</tt>. On 64-bit platforms
/// it is usually <tt>word32</tt>.
/// \details Library users typically use byte, word16, word32 and word64.
/// \since Crypto++ 2.0
typedef word32 hword;
/// \brief Full word used for multiprecision integer arithmetic
/// \details word is used for multiprecision integer arithmetic.
/// The typedef for <tt>word</tt> varies depending on the platform.
/// On 32-bit platforms it is usually <tt>word32</tt>. On 64-bit platforms
/// it is usually <tt>word64</tt>.
/// \details Library users typically use byte, word16, word32 and word64.
/// \since Crypto++ 2.0
typedef word64 word;
/// \brief Double word used for multiprecision integer arithmetic
/// \details dword is used for multiprecision integer arithmetic.
/// The typedef for <tt>dword</tt> varies depending on the platform.
/// On 32-bit platforms it is usually <tt>word64</tt>. On 64-bit Unix &amp;
/// Linux platforms it is usually <tt>word128</tt>. <tt>word128</tt> is
/// not available on Microsoft platforms. <tt>word128</tt> is only available
/// when <tt>CRYPTOPP_WORD128_AVAILABLE</tt> is defined.
/// \details Library users typically use byte, word16, word32 and word64.
/// \sa CRYPTOPP_WORD128_AVAILABLE
/// \since Crypto++ 2.0
typedef word128 dword;
/// \brief 128-bit word availability
/// \details CRYPTOPP_WORD128_AVAILABLE indicates a 128-bit word is
/// available from the platform. 128-bit words are usually available on
/// 64-bit platforms, but not available 32-bit platforms.
/// \details If CRYPTOPP_WORD128_AVAILABLE is not defined, then 128-bit
/// words are not available.
/// \details GCC and compatible compilers signal 128-bit word availability
/// with the preporcessor macro <tt>__SIZEOF_INT128__ >= 16</tt>.
/// \since Crypto++ 2.0
#define CRYPTOPP_WORD128_AVAILABLE ...
#else
// define hword, word, and dword. these are used for multiprecision integer arithmetic
// Intel compiler won't have _umul128 until version 10.0. See http://softwarecommunity.intel.com/isn/Community/en-US/forums/thread/30231625.aspx
#if (defined(_MSC_VER) && (!defined(__INTEL_COMPILER) || __INTEL_COMPILER >= 1000) && (defined(_M_X64) || defined(_M_IA64))) || (defined(__DECCXX) && defined(__alpha__)) || (defined(__INTEL_COMPILER) && defined(__x86_64__)) || (defined(__SUNPRO_CC) && defined(__x86_64__))
typedef word32 hword;
typedef word64 word;
#else
#define CRYPTOPP_NATIVE_DWORD_AVAILABLE 1
#if defined(__alpha__) || defined(__ia64__) || defined(_ARCH_PPC64) || defined(__x86_64__) || defined(__mips64) || defined(__sparc64__) || defined(__aarch64__)
#if ((CRYPTOPP_GCC_VERSION >= 30400) || (CRYPTOPP_LLVM_CLANG_VERSION >= 30000) || (CRYPTOPP_APPLE_CLANG_VERSION >= 40300)) && (__SIZEOF_INT128__ >= 16)
// GCC 4.0.1 on MacOS X is missing __umodti3 and __udivti3
// GCC 4.8.3 and bad uint128_t ops on PPC64/POWER7 (Issue 421)
// mode(TI) division broken on amd64 with GCC earlier than GCC 3.4
typedef word32 hword;
typedef word64 word;
typedef __uint128_t dword;
typedef __uint128_t word128;
#define CRYPTOPP_WORD128_AVAILABLE 1
#else
// if we're here, it means we're on a 64-bit CPU but we don't have a way to obtain 128-bit multiplication results
typedef word16 hword;
typedef word32 word;
typedef word64 dword;
#endif
#else
// being here means the native register size is probably 32 bits or less
#define CRYPTOPP_BOOL_SLOW_WORD64 1
typedef word16 hword;
typedef word32 word;
typedef word64 dword;
#endif
#endif
#endif
#ifndef CRYPTOPP_BOOL_SLOW_WORD64
# define CRYPTOPP_BOOL_SLOW_WORD64 0
#endif
/// \brief Size of a platform word in bytes
/// \details The size of a platform word, in bytes
CRYPTOPP_CONST_OR_CONSTEXPR unsigned int WORD_SIZE = sizeof(word);
/// \brief Size of a platform word in bits
/// \details The size of a platform word, in bits
/// \sa https://github.com/weidai11/cryptopp/issues/1185
CRYPTOPP_CONST_OR_CONSTEXPR unsigned int WORD_BITS = WORD_SIZE * 8;
NAMESPACE_END
#if (CRYPTOPP_MSC_VERSION)
# pragma warning(pop)
#endif
#endif // CRYPTOPP_CONFIG_INT_H

View File

@ -0,0 +1,199 @@
// config_misc.h - written and placed in public domain by Jeffrey Walton
// the bits that make up this source file are from the
// library's monolithic config.h.
/// \file config_misc.h
/// \brief Library configuration file
/// \details <tt>config_misc.h</tt> provides miscellaneous defines.
/// \details <tt>config.h</tt> was split into components in May 2019 to better
/// integrate with Autoconf and its feature tests. The splitting occurred so
/// users could continue to include <tt>config.h</tt> while allowing Autoconf
/// to write new <tt>config_asm.h</tt> and new <tt>config_cxx.h</tt> using
/// its feature tests.
/// \note You should include <tt>config.h</tt> rather than <tt>config_misc.h</tt>
/// directly.
/// \sa <A HREF="https://github.com/weidai11/cryptopp/issues/835">Issue 835,
/// Make config.h more autoconf friendly</A>,
/// <A HREF="https://www.cryptopp.com/wiki/Configure.sh">Configure.sh script</A>
/// on the Crypto++ wiki
/// \since Crypto++ 8.3
#ifndef CRYPTOPP_CONFIG_MISC_H
#define CRYPTOPP_CONFIG_MISC_H
#include "config_asm.h"
#include "config_cxx.h"
#include "config_os.h"
#include "config_ver.h"
// Define this if running on a big-endian CPU
// big endian will be assumed if CRYPTOPP_LITTLE_ENDIAN is not non-0
#if !defined(CRYPTOPP_LITTLE_ENDIAN) && !defined(CRYPTOPP_BIG_ENDIAN) && (defined(__BIG_ENDIAN__) || (defined(__s390__) || defined(__s390x__) || defined(__zarch__)) || (defined(__m68k__) || defined(__MC68K__)) || defined(__sparc) || defined(__sparc__) || defined(__hppa__) || defined(__MIPSEB__) || defined(__ARMEB__) || (defined(__MWERKS__) && !defined(__INTEL__)))
# define CRYPTOPP_BIG_ENDIAN 1
#endif
// Define this if running on a little-endian CPU
// big endian will be assumed if CRYPTOPP_LITTLE_ENDIAN is not non-0
#if !defined(CRYPTOPP_BIG_ENDIAN) && !defined(CRYPTOPP_LITTLE_ENDIAN)
# define CRYPTOPP_LITTLE_ENDIAN 1
#endif
// Define this if you want to set a prefix for TestData/ and TestVectors/
// Be sure to add the trailing slash since its simple concatenation.
// After https://github.com/weidai11/cryptopp/issues/760 the library
// should find the test vectors and data without much effort. It
// will search in "./" and "$ORIGIN/../share/cryptopp" automatically.
#ifndef CRYPTOPP_DATA_DIR
# define CRYPTOPP_DATA_DIR ""
#endif
// Define this to disable the test suite from searching for test
// vectors and data in "./" and "$ORIGIN/../share/cryptopp". The
// library will still search in CRYPTOPP_DATA_DIR, regardless.
// Some distros may want to disable this feature. Also see
// https://github.com/weidai11/cryptopp/issues/760
// #ifndef CRYPTOPP_DISABLE_DATA_DIR_SEARCH
// # define CRYPTOPP_DISABLE_DATA_DIR_SEARCH
// #endif
// Define this if you want or need the library's memcpy_s and memmove_s.
// See http://github.com/weidai11/cryptopp/issues/28.
// #if !defined(CRYPTOPP_WANT_SECURE_LIB)
// # define CRYPTOPP_WANT_SECURE_LIB
// #endif
// Define this if ARMv8 shifts are slow. ARM Cortex-A53 and Cortex-A57 shift
// operation perform poorly, so NEON and ASIMD code that relies on shifts
// or rotates often performs worse than C/C++ code. Also see
// http://github.com/weidai11/cryptopp/issues/367.
#define CRYPTOPP_SLOW_ARMV8_SHIFT 1
// CRYPTOPP_DEBUG enables the library's CRYPTOPP_ASSERT. CRYPTOPP_ASSERT
// raises a SIGTRAP (Unix) or calls DebugBreak() (Windows). CRYPTOPP_ASSERT
// is only in effect when CRYPTOPP_DEBUG, DEBUG or _DEBUG is defined. Unlike
// Posix assert, CRYPTOPP_ASSERT is not affected by NDEBUG (or failure to
// define it). According to the ndk-build docs, Android use NDK_DEBUG=1 to
// signal a DEBUG build (and NDK_DEBUG=0 to signal non-DEBUG build).
// Also see http://github.com/weidai11/cryptopp/issues/277, CVE-2016-7420 and
// https://developer.android.com/ndk/guides/ndk-build
#if (defined(DEBUG) || defined(_DEBUG)) || (defined(NDK_DEBUG) && (NDK_DEBUG > 0))
# undef CRYPTOPP_DEBUG
# define CRYPTOPP_DEBUG 1
#endif
// File system code to use when creating GZIP archive.
// http://www.gzip.org/format.txt
#if !defined(GZIP_OS_CODE)
# if defined(__macintosh__)
# define GZIP_OS_CODE 7
# elif defined(__unix__) || defined(__linux__)
# define GZIP_OS_CODE 3
# else
# define GZIP_OS_CODE 0
# endif
#endif
// Try this if your CPU has 256K internal cache or a slow multiply instruction
// and you want a (possibly) faster IDEA implementation using log tables
// #define IDEA_LARGECACHE
// Define this if, for the linear congruential RNG, you want to use
// the original constants as specified in S.K. Park and K.W. Miller's
// CACM paper.
// #define LCRNG_ORIGINAL_NUMBERS
// Define this if you want Integer's operator<< to honor std::showbase (and
// std::noshowbase). If defined, Integer will use a suffix of 'b', 'o', 'h'
// or '.' (the last for decimal) when std::showbase is in effect. If
// std::noshowbase is set, then the suffix is not added to the Integer. If
// not defined, existing behavior is preserved and Integer will use a suffix
// of 'b', 'o', 'h' or '.' (the last for decimal).
// #define CRYPTOPP_USE_STD_SHOWBASE
// Define this if you want to decouple AlgorithmParameters and Integer
// The decoupling should make it easier for the linker to remove Integer
// related code for those who do not need Integer, and avoid a potential
// race during AssignIntToInteger pointer initialization. Also
// see http://github.com/weidai11/cryptopp/issues/389.
// #define CRYPTOPP_NO_ASSIGN_TO_INTEGER
// Need GCC 4.6/Clang 1.7/Apple Clang 2.0 or above due to "GCC diagnostic {push|pop}"
#if (CRYPTOPP_GCC_VERSION >= 40600) || (CRYPTOPP_LLVM_CLANG_VERSION >= 10700) || \
(CRYPTOPP_APPLE_CLANG_VERSION >= 20000)
#define CRYPTOPP_GCC_DIAGNOSTIC_AVAILABLE 1
#endif
// Portable way to suppress warnings.
// Moved from misc.h due to circular depenedencies.
#ifndef CRYPTOPP_UNUSED
#define CRYPTOPP_UNUSED(x) ((void)(x))
#endif
// how to disable inlining
#if defined(_MSC_VER)
# define CRYPTOPP_NOINLINE_DOTDOTDOT
# define CRYPTOPP_NOINLINE __declspec(noinline)
#elif defined(__xlc__) || defined(__xlC__) || defined(__ibmxl__)
# define CRYPTOPP_NOINLINE_DOTDOTDOT ...
# define CRYPTOPP_NOINLINE __attribute__((noinline))
#elif defined(__GNUC__)
# define CRYPTOPP_NOINLINE_DOTDOTDOT
# define CRYPTOPP_NOINLINE __attribute__((noinline))
#else
# define CRYPTOPP_NOINLINE_DOTDOTDOT ...
# define CRYPTOPP_NOINLINE
#endif
// http://stackoverflow.com/a/13867690/608639
// CRYPTOPP_CONST_OR_CONSTEXPR due to https://github.com/weidai11/cryptopp/issues/1185
#if defined(CRYPTOPP_CXX11_CONSTEXPR)
# define CRYPTOPP_STATIC_CONSTEXPR static constexpr
# define CRYPTOPP_STATIC_CONST_OR_CONSTEXPR static constexpr
# define CRYPTOPP_CONST_OR_CONSTEXPR constexpr
# define CRYPTOPP_CONSTEXPR constexpr
#else
# define CRYPTOPP_STATIC_CONSTEXPR static
# define CRYPTOPP_STATIC_CONST_OR_CONSTEXPR static const
# define CRYPTOPP_CONST_OR_CONSTEXPR const
# define CRYPTOPP_CONSTEXPR
#endif // CRYPTOPP_CXX11_CONSTEXPR
#if defined(CRYPTOPP_DOXYGEN_PROCESSING)
# define CRYPTOPP_CONSTANT(x) static const int x
#elif defined(CRYPTOPP_CXX11_STRONG_ENUM)
# define CRYPTOPP_CONSTANT(x) enum : int { x }
#elif defined(CRYPTOPP_CXX11_CONSTEXPR)
# define CRYPTOPP_CONSTANT(x) constexpr static int x
#else
# define CRYPTOPP_CONSTANT(x) static const int x
#endif
// Warnings
#ifdef _MSC_VER
// 4127: conditional expression is constant
// 4512: assignment operator not generated
// 4661: no suitable definition provided for explicit template instantiation request
// 4910: '__declspec(dllexport)' and 'extern' are incompatible on an explicit instantiation
# pragma warning(disable: 4127 4512 4661 4910)
// _MSC_VER 1920 is VS2019
# if _MSC_VER >= 1920
// 5054: operator '|': deprecated between enumerations of different types
# pragma warning(disable: 5054)
# endif
// Security related, possible defects
// http://blogs.msdn.com/b/vcblog/archive/2010/12/14/off-by-default-compiler-warnings-in-visual-c.aspx
# pragma warning(once: 4191 4242 4263 4264 4266 4302 4826 4905 4906 4928)
#endif
#ifdef __BORLANDC__
// 8037: non-const function called for const object. needed to work around BCB2006 bug
# pragma warn -8037
#endif
// [GCC Bug 53431] "C++ preprocessor ignores #pragma GCC diagnostic". Clang honors it.
#if CRYPTOPP_GCC_DIAGNOSTIC_AVAILABLE
# pragma GCC diagnostic ignored "-Wunknown-pragmas"
# pragma GCC diagnostic ignored "-Wunused-function"
#endif
#endif // CRYPTOPP_CONFIG_MISC_H

View File

@ -0,0 +1,76 @@
// config_ns.h - written and placed in public domain by Jeffrey Walton
// the bits that make up this source file are from the
// library's monolithic config.h.
/// \file config_ns.h
/// \brief Library configuration file
/// \details <tt>config_ns.h</tt> provides defines for C++ and library
/// namespaces.
/// \details <tt>config.h</tt> was split into components in May 2019 to better
/// integrate with Autoconf and its feature tests. The splitting occurred so
/// users could continue to include <tt>config.h</tt> while allowing Autoconf
/// to write new <tt>config_asm.h</tt> and new <tt>config_cxx.h</tt> using
/// its feature tests.
/// \note You should include <tt>config.h</tt> rather than <tt>config_ns.h</tt>
/// directly.
/// \sa <A HREF="https://github.com/weidai11/cryptopp/issues/835">Issue 835,
/// Make config.h more autoconf friendly</A>,
/// <A HREF="https://www.cryptopp.com/wiki/Configure.sh">Configure.sh script</A>
/// on the Crypto++ wiki
/// \since Crypto++ 8.3
#ifndef CRYPTOPP_CONFIG_NAMESPACE_H
#define CRYPTOPP_CONFIG_NAMESPACE_H
// namespace support is now required
#ifdef NO_NAMESPACE
# error namespace support is now required
#endif
#ifdef CRYPTOPP_DOXYGEN_PROCESSING
/// \namespace CryptoPP
/// \brief Crypto++ library namespace
/// \details Nearly all classes are located in the CryptoPP namespace. Within
/// the namespace, there are four additional namespaces.
/// <ul>
/// <li>Name - namespace for names used with NameValuePairs and documented
/// in argnames.h
/// <li>NaCl - namespace for NaCl test functions like crypto_box,
/// crypto_box_open, crypto_sign, and crypto_sign_open
/// <li>Donna - namespace for curve25519 library operations. The name was
/// selected due to use of Langley and Moon's curve25519-donna.
/// <li>Test - namespace for testing and benchmarks classes
/// <li>Weak - namespace for weak and wounded algorithms, like ARC4, MD5
/// and Pananma
/// </ul>
/// \since Crypto++ 3.0
namespace CryptoPP { }
// Bring in the symbols found in the weak namespace; and fold Weak1 into Weak
#define CRYPTOPP_ENABLE_NAMESPACE_WEAK 1
#define Weak1 Weak
// Avoid putting "CryptoPP::" in front of everything in Doxygen output
#define CryptoPP
#define NAMESPACE_BEGIN(x)
#define NAMESPACE_END
// Get Doxygen to generate better documentation for these typedefs
#define DOCUMENTED_TYPEDEF(x, y) class y : public x {}
// Make "protected" "private" so the functions and members are not documented
#define protected private
#else
// Not Doxygen
#define NAMESPACE_BEGIN(x) namespace x {
#define NAMESPACE_END }
#define DOCUMENTED_TYPEDEF(x, y) typedef x y
#endif // CRYPTOPP_DOXYGEN_PROCESSING
#define ANONYMOUS_NAMESPACE_BEGIN namespace {
#define ANONYMOUS_NAMESPACE_END }
#define USING_NAMESPACE(x) using namespace x;
#define DOCUMENTED_NAMESPACE_BEGIN(x) namespace x {
#define DOCUMENTED_NAMESPACE_END }
#endif // CRYPTOPP_CONFIG_NAMESPACE_H

View File

@ -0,0 +1,169 @@
// config_os.h - written and placed in public domain by Jeffrey Walton
// the bits that make up this source file are from the
// library's monolithic config.h.
/// \file config_os.h
/// \brief Library configuration file
/// \details <tt>config_os.h</tt> provides defines for platforms and operating
/// systems.
/// \details <tt>config.h</tt> was split into components in May 2019 to better
/// integrate with Autoconf and its feature tests. The splitting occurred so
/// users could continue to include <tt>config.h</tt> while allowing Autoconf
/// to write new <tt>config_asm.h</tt> and new <tt>config_cxx.h</tt> using
/// its feature tests.
/// \note You should include <tt>config.h</tt> rather than <tt>config_os.h</tt>
/// directly.
/// \sa <A HREF="https://github.com/weidai11/cryptopp/issues/835">Issue 835,
/// Make config.h more autoconf friendly</A>,
/// <A HREF="https://www.cryptopp.com/wiki/Configure.sh">Configure.sh script</A>
/// on the Crypto++ wiki
/// \since Crypto++ 8.3
#ifndef CRYPTOPP_CONFIG_OS_H
#define CRYPTOPP_CONFIG_OS_H
#include "config_ver.h"
// It is OK to remove the hard stop below, but you are on your own.
// After building the library be sure to run self tests described
// https://www.cryptopp.com/wiki/Release_Process#Self_Tests
// The problems with Clang pretending to be other compilers is
// discussed at http://github.com/weidai11/cryptopp/issues/147.
#if (defined(_MSC_VER) && defined(__clang__) && \
!(defined( __clang_analyzer__)) && !defined(__INTEL_LLVM_COMPILER))
# error: "Unsupported configuration"
#endif
// Windows platform
#if defined(_WIN32) || defined(_WIN64) || defined(__CYGWIN__)
#define CRYPTOPP_WIN32_AVAILABLE
#endif
// Unix and Linux platforms
#if defined(__unix__) || defined(__MACH__) || defined(__NetBSD__) || defined(__sun)
#define CRYPTOPP_UNIX_AVAILABLE
#endif
// BSD platforms
#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__)
#define CRYPTOPP_BSD_AVAILABLE
#endif
// Microsoft compilers
#if defined(_MSC_VER) || defined(__fastcall)
#define CRYPTOPP_FASTCALL __fastcall
#else
#define CRYPTOPP_FASTCALL
#endif
// Microsoft compilers
#if defined(_MSC_VER)
#define CRYPTOPP_NO_VTABLE __declspec(novtable)
#else
#define CRYPTOPP_NO_VTABLE
#endif
// Define this if you want to disable all OS-dependent features,
// such as sockets and OS-provided random number generators
// #define NO_OS_DEPENDENCE
// Define this to use features provided by Microsoft's CryptoAPI.
// Currently the only feature used is Windows random number generation.
// This macro will be ignored if NO_OS_DEPENDENCE is defined.
// #define USE_MS_CRYPTOAPI
// Define this to use features provided by Microsoft's CryptoNG API.
// CryptoNG API is available in Vista and above and its cross platform,
// including desktop apps and store apps. Currently the only feature
// used is Windows random number generation.
// This macro will be ignored if NO_OS_DEPENDENCE is defined.
// #define USE_MS_CNGAPI
// If the user did not make a choice, then select CryptoNG if
// targeting Windows 8 or above.
#if !defined(USE_MS_CRYPTOAPI) && !defined(USE_MS_CNGAPI)
# if !defined(_USING_V110_SDK71_) && ((WINVER >= 0x0602 /*_WIN32_WINNT_WIN8*/) || \
(_WIN32_WINNT >= 0x0602 /*_WIN32_WINNT_WIN8*/))
# define USE_MS_CNGAPI
# else
# define USE_MS_CRYPTOAPI
# endif
#endif
// Begin OS features, like init priorities and random numbers
#ifndef NO_OS_DEPENDENCE
// CRYPTOPP_INIT_PRIORITY attempts to manage initialization of C++ static objects.
// Under GCC, the library uses init_priority attribute in the range
// [CRYPTOPP_INIT_PRIORITY, CRYPTOPP_INIT_PRIORITY+100]. Under Windows,
// CRYPTOPP_INIT_PRIORITY enlists "#pragma init_seg(lib)". The platforms
// with gaps are Apple and Sun because they require linker scripts. Apple and
// Sun will use the library's Singletons to initialize and acquire resources.
// Also see http://cryptopp.com/wiki/Static_Initialization_Order_Fiasco
#ifndef CRYPTOPP_INIT_PRIORITY
# define CRYPTOPP_INIT_PRIORITY 250
#endif
// CRYPTOPP_USER_PRIORITY is for other libraries and user code that is using Crypto++
// and managing C++ static object creation. It is guaranteed not to conflict with
// values used by (or would be used by) the Crypto++ library.
#ifndef CRYPTOPP_USER_PRIORITY
# define CRYPTOPP_USER_PRIORITY (CRYPTOPP_INIT_PRIORITY+101)
#endif
// Most platforms allow us to specify when to create C++ objects. Apple and Sun do not.
#if (CRYPTOPP_INIT_PRIORITY > 0) && !(defined(NO_OS_DEPENDENCE) || defined(__APPLE__) || defined(__sun__))
# if (CRYPTOPP_GCC_VERSION >= 30000) || (CRYPTOPP_LLVM_CLANG_VERSION >= 20900) || (_INTEL_COMPILER >= 800)
# define HAVE_GCC_INIT_PRIORITY 1
# elif (CRYPTOPP_MSC_VERSION >= 1310)
# define HAVE_MSC_INIT_PRIORITY 1
# elif defined(__xlc__) || defined(__xlC__) || defined(__ibmxl__)
# define HAVE_XLC_INIT_PRIORITY 1
# endif
#endif // CRYPTOPP_INIT_PRIORITY, NO_OS_DEPENDENCE, Apple, Sun
#if defined(CRYPTOPP_WIN32_AVAILABLE) || defined(CRYPTOPP_UNIX_AVAILABLE)
# define HIGHRES_TIMER_AVAILABLE
#endif
#ifdef CRYPTOPP_WIN32_AVAILABLE
# if !defined(WINAPI_FAMILY)
# define THREAD_TIMER_AVAILABLE
# elif defined(WINAPI_FAMILY)
# if (WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP))
# define THREAD_TIMER_AVAILABLE
# endif
# endif
#endif
#if defined(CRYPTOPP_UNIX_AVAILABLE) || defined(CRYPTOPP_DOXYGEN_PROCESSING)
# define NONBLOCKING_RNG_AVAILABLE
# define BLOCKING_RNG_AVAILABLE
# define OS_RNG_AVAILABLE
#endif
// Cygwin/Newlib requires _XOPEN_SOURCE=600
#if defined(CRYPTOPP_UNIX_AVAILABLE)
# define UNIX_SIGNALS_AVAILABLE 1
#endif
#ifdef CRYPTOPP_WIN32_AVAILABLE
# if !defined(WINAPI_FAMILY)
# define NONBLOCKING_RNG_AVAILABLE
# define OS_RNG_AVAILABLE
# elif defined(WINAPI_FAMILY)
# if (WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP))
# define NONBLOCKING_RNG_AVAILABLE
# define OS_RNG_AVAILABLE
# elif !(WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP))
# if ((WINVER >= 0x0A00 /*_WIN32_WINNT_WIN10*/) || (_WIN32_WINNT >= 0x0A00 /*_WIN32_WINNT_WIN10*/))
# define NONBLOCKING_RNG_AVAILABLE
# define OS_RNG_AVAILABLE
# endif
# endif
# endif
#endif
#endif // NO_OS_DEPENDENCE
#endif // CRYPTOPP_CONFIG_OS_H

View File

@ -0,0 +1,90 @@
// config_ver.h - written and placed in public domain by Jeffrey Walton
// the bits that make up this source file are from the
// library's monolithic config.h.
/// \file config_ver.h
/// \brief Library configuration file
/// \details <tt>config_ver.h</tt> provides defines for library and compiler
/// versions.
/// \details <tt>config.h</tt> was split into components in May 2019 to better
/// integrate with Autoconf and its feature tests. The splitting occurred so
/// users could continue to include <tt>config.h</tt> while allowing Autoconf
/// to write new <tt>config_asm.h</tt> and new <tt>config_cxx.h</tt> using
/// its feature tests.
/// \note You should include <tt>config.h</tt> rather than <tt>config_ver.h</tt>
/// directly.
/// \sa <A HREF="https://github.com/weidai11/cryptopp/issues/835">Issue 835,
/// Make config.h more autoconf friendly</A>,
/// <A HREF="https://www.cryptopp.com/wiki/Configure.sh">Configure.sh script</A>
/// on the Crypto++ wiki
/// \since Crypto++ 8.3
#ifndef CRYPTOPP_CONFIG_VERSION_H
#define CRYPTOPP_CONFIG_VERSION_H
/// \brief Library major version
/// \details CRYPTOPP_MAJOR reflects the major version of the library the
/// headers came from. It is not necessarily the version of the library built
/// as a shared object if versions are inadvertently mixed and matched.
/// \sa CRYPTOPP_VERSION, LibraryVersion(), HeaderVersion()
/// \since Crypto++ 8.2
#define CRYPTOPP_MAJOR 8
/// \brief Library minor version
/// \details CRYPTOPP_MINOR reflects the minor version of the library the
/// headers came from. It is not necessarily the version of the library built
/// as a shared object if versions are inadvertently mixed and matched.
/// \sa CRYPTOPP_VERSION, LibraryVersion(), HeaderVersion()
/// \since Crypto++ 8.2
#define CRYPTOPP_MINOR 7
/// \brief Library revision number
/// \details CRYPTOPP_REVISION reflects the revision number of the library the
/// headers came from. It is not necessarily the revision of the library built
/// as a shared object if versions are inadvertently mixed and matched.
/// \sa CRYPTOPP_VERSION, LibraryVersion(), HeaderVersion()
/// \since Crypto++ 8.2
#define CRYPTOPP_REVISION 0
/// \brief Full library version
/// \details CRYPTOPP_VERSION reflects the version of the library the headers
/// came from. It is not necessarily the version of the library built as a
/// shared object if versions are inadvertently mixed and matched.
/// \sa CRYPTOPP_MAJOR, CRYPTOPP_MINOR, CRYPTOPP_REVISION, LibraryVersion(), HeaderVersion()
/// \since Crypto++ 5.6
#define CRYPTOPP_VERSION 870
// Compiler version macros
#if defined(__GNUC__)
# define CRYPTOPP_GCC_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__)
#endif
// Apple and LLVM Clang versions. Apple Clang version 7.0 roughly equals
// LLVM Clang version 3.7. Also see https://gist.github.com/yamaya/2924292
#if defined(__clang__) && defined(__apple_build_version__)
# undef CRYPTOPP_GCC_VERSION
# define CRYPTOPP_APPLE_CLANG_VERSION (__clang_major__ * 10000 + __clang_minor__ * 100 + __clang_patchlevel__)
#elif defined(__clang__)
# undef CRYPTOPP_GCC_VERSION
# define CRYPTOPP_LLVM_CLANG_VERSION (__clang_major__ * 10000 + __clang_minor__ * 100 + __clang_patchlevel__)
#endif
// Clang pretends to be other compilers. The compiler gets into
// code paths that it cannot compile. Unset Clang to save the grief.
// Also see http://github.com/weidai11/cryptopp/issues/147.
#if defined(__xlc__) || defined(__xlC__)
# undef CRYPTOPP_LLVM_CLANG_VERSION
# define CRYPTOPP_XLC_VERSION ((__xlC__ / 256) * 10000 + (__xlC__ % 256) * 100)
#endif
#ifdef __INTEL_COMPILER
# undef CRYPTOPP_LLVM_CLANG_VERSION
# define CRYPTOPP_INTEL_VERSION (__INTEL_COMPILER)
#endif
#ifdef _MSC_VER
# undef CRYPTOPP_LLVM_CLANG_VERSION
# define CRYPTOPP_MSC_VERSION (_MSC_VER)
#endif
#endif // CRYPTOPP_CONFIG_VERSION_H

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,158 +0,0 @@
// crc-simd.cpp - written and placed in the public domain by
// Jeffrey Walton, Uri Blumenthal and Marcel Raad.
//
// This source file uses intrinsics to gain access to SSE4.2 and
// ARMv8a CRC-32 and CRC-32C instructions. A separate source file
// is needed because additional CXXFLAGS are required to enable
// the appropriate instructions sets in some build configurations.
#include "pch.h"
#include "config.h"
#include "misc.h"
#if (CRYPTOPP_SSE42_AVAILABLE)
# include <nmmintrin.h>
#endif
// Use ARMv8 rather than NEON due to compiler inconsistencies
#if (CRYPTOPP_ARM_CRC32_AVAILABLE)
# include <arm_neon.h>
#endif
// Can't use CRYPTOPP_ARM_XXX_AVAILABLE because too many
// compilers don't follow ACLE conventions for the include.
#if defined(CRYPTOPP_ARM_ACLE_AVAILABLE)
# include <stdint.h>
# include <arm_acle.h>
#endif
#ifdef CRYPTOPP_GNU_STYLE_INLINE_ASSEMBLY
# include <signal.h>
# include <setjmp.h>
#endif
#ifndef EXCEPTION_EXECUTE_HANDLER
# define EXCEPTION_EXECUTE_HANDLER 1
#endif
NAMESPACE_BEGIN(CryptoPP)
#ifdef CRYPTOPP_GNU_STYLE_INLINE_ASSEMBLY
extern "C" {
typedef void (*SigHandler)(int);
static jmp_buf s_jmpSIGILL;
static void SigIllHandler(int)
{
longjmp(s_jmpSIGILL, 1);
}
}
#endif // Not CRYPTOPP_MS_STYLE_INLINE_ASSEMBLY
#if (CRYPTOPP_BOOL_ARM32 || CRYPTOPP_BOOL_ARM64)
bool CPU_ProbeCRC32()
{
#if defined(CRYPTOPP_NO_CPU_FEATURE_PROBES)
return false;
#elif (CRYPTOPP_ARM_CRC32_AVAILABLE)
# if defined(CRYPTOPP_MS_STYLE_INLINE_ASSEMBLY)
volatile bool result = true;
__try
{
word32 w=0, x=1; word16 y=2; byte z=3;
w = __crc32w(w,x);
w = __crc32h(w,y);
w = __crc32b(w,z);
w = __crc32cw(w,x);
w = __crc32ch(w,y);
w = __crc32cb(w,z);
result = !!w;
}
__except (EXCEPTION_EXECUTE_HANDLER)
{
return false;
}
return result;
#else
// longjmp and clobber warnings. Volatile is required.
// http://github.com/weidai11/cryptopp/issues/24 and http://stackoverflow.com/q/7721854
volatile bool result = true;
volatile SigHandler oldHandler = signal(SIGILL, SigIllHandler);
if (oldHandler == SIG_ERR)
return false;
volatile sigset_t oldMask;
if (sigprocmask(0, NULLPTR, (sigset_t*)&oldMask))
return false;
if (setjmp(s_jmpSIGILL))
result = false;
else
{
word32 w=0, x=1; word16 y=2; byte z=3;
w = __crc32w(w,x);
w = __crc32h(w,y);
w = __crc32b(w,z);
w = __crc32cw(w,x);
w = __crc32ch(w,y);
w = __crc32cb(w,z);
// Hack... GCC optimizes away the code and returns true
result = !!w;
}
sigprocmask(SIG_SETMASK, (sigset_t*)&oldMask, NULLPTR);
signal(SIGILL, oldHandler);
return result;
# endif
#else
return false;
#endif // CRYPTOPP_ARM_CRC32_AVAILABLE
}
#endif // ARM32 or ARM64
#if (CRYPTOPP_ARM_CRC32_AVAILABLE)
void CRC32_Update_ARMV8(const byte *s, size_t n, word32& c)
{
for(; !IsAligned<word32>(s) && n > 0; s++, n--)
c = __crc32b(c, *s);
for(; n > 4; s+=4, n-=4)
c = __crc32w(c, *(const word32 *)(void*)s);
for(; n > 0; s++, n--)
c = __crc32b(c, *s);
}
void CRC32C_Update_ARMV8(const byte *s, size_t n, word32& c)
{
for(; !IsAligned<word32>(s) && n > 0; s++, n--)
c = __crc32cb(c, *s);
for(; n > 4; s+=4, n-=4)
c = __crc32cw(c, *(const word32 *)(void*)s);
for(; n > 0; s++, n--)
c = __crc32cb(c, *s);
}
#endif
#if (CRYPTOPP_SSE42_AVAILABLE)
void CRC32C_Update_SSE42(const byte *s, size_t n, word32& c)
{
for(; !IsAligned<word32>(s) && n > 0; s++, n--)
c = _mm_crc32_u8(c, *s);
for(; n > 4; s+=4, n-=4)
c = _mm_crc32_u32(c, *(const word32 *)(void*)s);
for(; n > 0; s++, n--)
c = _mm_crc32_u8(c, *s);
}
#endif
NAMESPACE_END

View File

@ -8,20 +8,20 @@
NAMESPACE_BEGIN(CryptoPP)
// crc-simd.cpp
// crc_simd.cpp
#if (CRYPTOPP_ARM_CRC32_AVAILABLE)
extern void CRC32_Update_ARMV8(const byte *s, size_t n, word32& c);
extern void CRC32C_Update_ARMV8(const byte *s, size_t n, word32& c);
#endif
// crc-simd.cpp
// crc_simd.cpp
#if (CRYPTOPP_SSE42_AVAILABLE)
extern void CRC32C_Update_SSE42(const byte *s, size_t n, word32& c);
#endif
/* Table of CRC-32's of all single byte values (made by makecrc.c) */
const word32 CRC32::m_tab[] = {
#ifdef CRYPTOPP_LITTLE_ENDIAN
#if (CRYPTOPP_LITTLE_ENDIAN)
0x00000000L, 0x77073096L, 0xee0e612cL, 0x990951baL, 0x076dc419L,
0x706af48fL, 0xe963a535L, 0x9e6495a3L, 0x0edb8832L, 0x79dcb8a4L,
0xe0d5e91eL, 0x97d2d988L, 0x09b64c2bL, 0x7eb17cbdL, 0xe7b82d07L,
@ -130,6 +130,15 @@ const word32 CRC32::m_tab[] = {
#endif
};
std::string CRC32::AlgorithmProvider() const
{
#if (CRYPTOPP_ARM_CRC32_AVAILABLE)
if (HasCRC32())
return "ARMv8";
#endif
return "C++";
}
CRC32::CRC32()
{
Reset();
@ -180,7 +189,7 @@ void CRC32::TruncatedFinal(byte *hash, size_t size)
// Castagnoli CRC32C (iSCSI)
const word32 CRC32C::m_tab[] = {
#ifdef CRYPTOPP_LITTLE_ENDIAN
#if (CRYPTOPP_LITTLE_ENDIAN)
0x00000000L, 0xf26b8303L, 0xe13b70f7L, 0x1350f3f4L, 0xc79a971fL,
0x35f1141cL, 0x26a1e7e8L, 0xd4ca64ebL, 0x8ad958cfL, 0x78b2dbccL,
0x6be22838L, 0x9989ab3bL, 0x4d43cfd0L, 0xbf284cd3L, 0xac78bf27L,
@ -289,6 +298,19 @@ const word32 CRC32C::m_tab[] = {
#endif
};
std::string CRC32C::AlgorithmProvider() const
{
#if (CRYPTOPP_ARM_CRC32_AVAILABLE)
if (HasCRC32())
return "ARMv8";
#endif
#if (CRYPTOPP_SSE42_AVAILABLE)
if (HasSSE42())
return "SSE4.2";
#endif
return "C++";
}
CRC32C::CRC32C()
{
Reset();

View File

@ -12,7 +12,7 @@ NAMESPACE_BEGIN(CryptoPP)
const word32 CRC32_NEGL = 0xffffffffL;
#ifdef CRYPTOPP_LITTLE_ENDIAN
#if (CRYPTOPP_LITTLE_ENDIAN)
#define CRC32_INDEX(c) (c & 0xff)
#define CRC32_SHIFTED(c) (c >> 8)
#else
@ -25,16 +25,24 @@ const word32 CRC32_NEGL = 0xffffffffL;
class CRC32 : public HashTransformation
{
public:
CRYPTOPP_CONSTANT(DIGESTSIZE = 4)
CRYPTOPP_CONSTANT(DIGESTSIZE = 4);
CRC32();
void Update(const byte *input, size_t length);
void TruncatedFinal(byte *hash, size_t size);
unsigned int DigestSize() const {return DIGESTSIZE;}
CRYPTOPP_STATIC_CONSTEXPR const char* StaticAlgorithmName() {return "CRC32";}
std::string AlgorithmName() const {return StaticAlgorithmName();}
CRYPTOPP_STATIC_CONSTEXPR const char* StaticAlgorithmName() {return "CRC32";}
std::string AlgorithmName() const {return StaticAlgorithmName();}
/// \brief Updates a CRC with additional input
/// \param b the additional input as a byte
void UpdateByte(byte b) {m_crc = m_tab[CRC32_INDEX(m_crc) ^ b] ^ CRC32_SHIFTED(m_crc);}
byte GetCrcByte(size_t i) const {return ((byte *)&(m_crc))[i];}
/// \brief Retrieves the i-th byte of the CRC
/// \param i the additional input as a byte
/// \return the byte at the i-th position
byte GetCrcByte(size_t i) const {return reinterpret_cast<const byte *>(&m_crc)[i];}
std::string AlgorithmProvider() const;
protected:
void Reset() {m_crc = CRC32_NEGL;}
@ -50,16 +58,24 @@ private:
class CRC32C : public HashTransformation
{
public:
CRYPTOPP_CONSTANT(DIGESTSIZE = 4)
CRYPTOPP_CONSTANT(DIGESTSIZE = 4);
CRC32C();
void Update(const byte *input, size_t length);
void TruncatedFinal(byte *hash, size_t size);
unsigned int DigestSize() const {return DIGESTSIZE;}
CRYPTOPP_STATIC_CONSTEXPR const char* StaticAlgorithmName() {return "CRC32C";}
std::string AlgorithmName() const {return StaticAlgorithmName();}
CRYPTOPP_STATIC_CONSTEXPR const char* StaticAlgorithmName() {return "CRC32C";}
std::string AlgorithmName() const {return StaticAlgorithmName();}
/// \brief Updates a CRC with additional input
/// \param b the additional input as a byte
void UpdateByte(byte b) {m_crc = m_tab[CRC32_INDEX(m_crc) ^ b] ^ CRC32_SHIFTED(m_crc);}
byte GetCrcByte(size_t i) const {return ((byte *)&(m_crc))[i];}
/// \brief Retrieves the i-th byte of the CRC
/// \param i the additional input as a byte
/// \return the byte at the i-th position
byte GetCrcByte(size_t i) const {return reinterpret_cast<const byte *>(&m_crc)[i];}
std::string AlgorithmProvider() const;
protected:
void Reset() {m_crc = CRC32_NEGL;}

View File

@ -0,0 +1,172 @@
// crc_simd.cpp - written and placed in the public domain by
// Jeffrey Walton, Uri Blumenthal and Marcel Raad.
//
// This source file uses intrinsics to gain access to SSE4.2 and
// ARMv8a CRC-32 and CRC-32C instructions. A separate source file
// is needed because additional CXXFLAGS are required to enable
// the appropriate instructions sets in some build configurations.
#include "pch.h"
#include "config.h"
#include "misc.h"
#if (CRYPTOPP_SSE42_AVAILABLE)
# include <nmmintrin.h>
#endif
#if (CRYPTOPP_ARM_ACLE_HEADER)
# include <stdint.h>
# include <arm_acle.h>
#endif
#if (CRYPTOPP_ARM_CRC32_AVAILABLE)
# include "arm_simd.h"
#endif
#ifdef CRYPTOPP_GNU_STYLE_INLINE_ASSEMBLY
# include <signal.h>
# include <setjmp.h>
#endif
#ifndef EXCEPTION_EXECUTE_HANDLER
# define EXCEPTION_EXECUTE_HANDLER 1
#endif
#define CONST_WORD32_CAST(x) ((const word32 *)(void*)(x))
// Squash MS LNK4221 and libtool warnings
extern const char CRC_SIMD_FNAME[] = __FILE__;
NAMESPACE_BEGIN(CryptoPP)
#ifdef CRYPTOPP_GNU_STYLE_INLINE_ASSEMBLY
extern "C" {
typedef void (*SigHandler)(int);
static jmp_buf s_jmpSIGILL;
static void SigIllHandler(int)
{
longjmp(s_jmpSIGILL, 1);
}
}
#endif // Not CRYPTOPP_MS_STYLE_INLINE_ASSEMBLY
#if (CRYPTOPP_BOOL_ARM32 || CRYPTOPP_BOOL_ARMV8)
bool CPU_ProbeCRC32()
{
#if defined(CRYPTOPP_NO_CPU_FEATURE_PROBES)
return false;
#elif (CRYPTOPP_ARM_CRC32_AVAILABLE)
# if defined(CRYPTOPP_MS_STYLE_INLINE_ASSEMBLY)
volatile bool result = true;
__try
{
word32 w=0, x=1; byte z=3;
w = CRC32W(w,x);
w = CRC32B(w,z);
w = CRC32CW(w,x);
w = CRC32CB(w,z);
result = !!w;
}
__except (EXCEPTION_EXECUTE_HANDLER)
{
return false;
}
return result;
#else
// longjmp and clobber warnings. Volatile is required.
// http://github.com/weidai11/cryptopp/issues/24 and http://stackoverflow.com/q/7721854
volatile bool result = true;
volatile SigHandler oldHandler = signal(SIGILL, SigIllHandler);
if (oldHandler == SIG_ERR)
return false;
volatile sigset_t oldMask;
if (sigprocmask(0, NULLPTR, (sigset_t*)&oldMask))
{
signal(SIGILL, oldHandler);
return false;
}
if (setjmp(s_jmpSIGILL))
result = false;
else
{
word32 w=0, x=1; byte z=3;
w = CRC32W(w,x);
w = CRC32B(w,z);
w = CRC32CW(w,x);
w = CRC32CB(w,z);
// Hack... GCC optimizes away the code and returns true
result = !!w;
}
sigprocmask(SIG_SETMASK, (sigset_t*)&oldMask, NULLPTR);
signal(SIGILL, oldHandler);
return result;
# endif
#else
return false;
#endif // CRYPTOPP_ARM_CRC32_AVAILABLE
}
#endif // ARM32 or ARM64
#if (CRYPTOPP_ARM_CRC32_AVAILABLE)
void CRC32_Update_ARMV8(const byte *s, size_t n, word32& c)
{
for(; !IsAligned<word32>(s) && n > 0; s++, n--)
c = CRC32B(c, *s);
for(; n >= 16; s+=16, n-=16)
c = CRC32Wx4(c, CONST_WORD32_CAST(s));
for(; n >= 4; s+=4, n-=4)
c = CRC32W(c, *CONST_WORD32_CAST(s));
for(; n > 0; s++, n--)
c = CRC32B(c, *s);
}
void CRC32C_Update_ARMV8(const byte *s, size_t n, word32& c)
{
for(; !IsAligned<word32>(s) && n > 0; s++, n--)
c = CRC32CB(c, *s);
for(; n >= 16; s+=16, n-=16)
c = CRC32CWx4(c, CONST_WORD32_CAST(s));
for(; n >= 4; s+=4, n-=4)
c = CRC32CW(c, *CONST_WORD32_CAST(s));
for(; n > 0; s++, n--)
c = CRC32CB(c, *s);
}
#endif
#if (CRYPTOPP_SSE42_AVAILABLE)
void CRC32C_Update_SSE42(const byte *s, size_t n, word32& c)
{
for(; !IsAligned<word32>(s) && n > 0; s++, n--)
c = _mm_crc32_u8(c, *s);
for(; n >= 16; s+=16, n-=16)
{
c = _mm_crc32_u32(_mm_crc32_u32(_mm_crc32_u32(_mm_crc32_u32(c,
*CONST_WORD32_CAST(s+ 0)), *CONST_WORD32_CAST(s+ 4)),
*CONST_WORD32_CAST(s+ 8)), *CONST_WORD32_CAST(s+12));
}
for(; n >= 4; s+=4, n-=4)
c = _mm_crc32_u32(c, *CONST_WORD32_CAST(s));
for(; n > 0; s++, n--)
c = _mm_crc32_u8(c, *s);
}
#endif
NAMESPACE_END

View File

@ -1,322 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<!-- Microsoft documentation for VCXPROJ file format is located at -->
<!-- the following URL. The documentation leaves a lot to be desired. -->
<!-- https://msdn.microsoft.com/en-us/library/2208a1f2.aspx -->
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<!-- Microsoft documentation clearly shows the Global property group -->
<!-- preceeds the import of Cpp.Default.props and Cpp.props -->
<!-- https://msdn.microsoft.com/en-us/library/2208a1f2.aspx -->
<PropertyGroup Label="Globals">
<ProjectGuid>{94a428a1-9ba8-4db2-b76e-bd2e3c08f257}</ProjectGuid>
<RootNamespace>cryptdll</RootNamespace>
<ConfigurationType>DynamicLibrary</ConfigurationType>
</PropertyGroup>
<!-- Use DefaultPlatformToolset after Microsoft.Cpp.Default.props -->
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<!-- Set DefaultPlatformToolset to v100 (VS2010) if not defined -->
<PropertyGroup Label="EmptyDefaultPlatformToolset">
<DefaultPlatformToolset Condition=" '$(DefaultPlatformToolset)' == '' ">v100</DefaultPlatformToolset>
</PropertyGroup>
<PropertyGroup Label="PlatformToolset">
<PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings" />
<ImportGroup Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<!-- End of Visual Studio boilerplate -->
<!-- All Configurations -->
<PropertyGroup Label="All Configurations">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<TargetName>cryptopp</TargetName>
<TargetExt>.dll</TargetExt>
<UseOfMfc>false</UseOfMfc>
<CharacterSet>MultiByte</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
<OutDir>$(Platform)\DLL_Output\$(Configuration)\</OutDir>
<IntDir>$(Platform)\$(ProjectName)\$(Configuration)\</IntDir>
</PropertyGroup>
<!-- All Configurations -->
<ItemDefinitionGroup Label="All Configurations">
<ClCompile>
<SuppressStartupBanner>true</SuppressStartupBanner>
<ErrorReporting>None</ErrorReporting>
<WarningLevel>Level4</WarningLevel>
<DisableSpecificWarnings>4231; 4251; 4275; 4355; 4505</DisableSpecificWarnings>
<PrecompiledHeader>Use</PrecompiledHeader>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
</ClCompile>
<Link>
<ErrorReporting>NoErrorReport</ErrorReporting>
<GenerateDebugInformation>true</GenerateDebugInformation>
<ProgramDatabaseFile>$(OutDir)\cryptopp.pdb</ProgramDatabaseFile>
<BaseAddress>0x42900000</BaseAddress>
<RandomizedBaseAddress>false</RandomizedBaseAddress>
<PreventDllBinding>true</PreventDllBinding>
<OutputFile>$(OutDir)\cryptopp.dll</OutputFile>
<ImportLibrary>$(TargetDir)\cryptopp.lib</ImportLibrary>
</Link>
</ItemDefinitionGroup>
<!-- Debug Configurations -->
<ItemDefinitionGroup Condition="'$(Configuration)'=='Debug'" Label="Debug Configuration">
<ClCompile>
<PreprocessorDefinitions>CRYPTOPP_EXPORTS;CRYPTOPP_ENABLE_COMPLIANCE_WITH_FIPS_140_2=1;USE_PRECOMPILED_HEADERS</PreprocessorDefinitions>
<Optimization>Disabled</Optimization>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<IntrinsicFunctions>true</IntrinsicFunctions>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>%(PreprocessorDefinitions)</PreprocessorDefinitions>
<Culture>0x0409</Culture>
</ResourceCompile>
</ItemDefinitionGroup>
<!-- Release Configurations -->
<ItemDefinitionGroup Condition="'$(Configuration)'=='Release'" Label="Release Configuration">
<ClCompile>
<PreprocessorDefinitions>NDEBUG;CRYPTOPP_EXPORTS;CRYPTOPP_ENABLE_COMPLIANCE_WITH_FIPS_140_2=1;USE_PRECOMPILED_HEADERS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<OmitFramePointers>true</OmitFramePointers>
<Optimization>MaxSpeed</Optimization>
<IntrinsicFunctions>true</IntrinsicFunctions>
<InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
<FunctionLevelLinking>true</FunctionLevelLinking>
<StringPooling>true</StringPooling>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<Culture>0x0409</Culture>
</ResourceCompile>
<Link>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
</Link>
</ItemDefinitionGroup>
<!-- X86 Configurations -->
<ItemDefinitionGroup Condition="'$(Platform)'=='Win32'" Label="X86 Configuration">
<ClCompile>
<EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>
</ClCompile>
<Link>
<TargetMachine>MachineX86</TargetMachine>
<ImageHasSafeExceptionHandlers>true</ImageHasSafeExceptionHandlers>
</Link>
</ItemDefinitionGroup>
<!-- X64 Configurations -->
<ItemDefinitionGroup Condition="'$(Platform)'=='x64'" Label="X64 Configuration">
<Link>
<TargetMachine>MachineX64</TargetMachine>
</Link>
</ItemDefinitionGroup>
<!-- Win32/Debug cryptest.exe for DLL MAC'ing -->
<!-- Broken at the moment; see http://stackoverflow.com/q/39900437 -->
<!-- and http://stackoverflow.com/q/39929817/608639 -->
<!--
<Target Condition="!Exists('Win32\Output\Debug\cryptest.exe')" Name="MAC tool" Label="MAC tool">
<Message
Text="Creating Win32/Debug cryptest.exe for MAC computation" />
<MSbuild
Projects="cryptlib.vcxproj"
Properties="Configuration=Debug;Platform=Win32;"/>
<MSbuild
Projects="cryptest.vcxproj"
Properties="Configuration=Debug;Platform=Win32;"/>
</Target>
-->
<ItemDefinitionGroup Condition="!Exists('Win32\Output\Debug\cryptest.exe')" Label="MAC tool">
<PreBuildEvent>
<Message>Creating Win32/Debug cryptest.exe for MAC computation</Message>
<Command>
msbuild /t:Build /p:Configuration=Debug;Platform=Win32 cryptlib.vcxproj
msbuild /t:Build /p:Configuration=Debug;Platform=Win32 cryptest.vcxproj
</Command>
</PreBuildEvent>
</ItemDefinitionGroup>
<!-- DLL MAC'ing performed by cryptest.exe -->
<ItemDefinitionGroup Label="DLL MAC">
<PostBuildEvent>
<Message>Adding MAC to DLL</Message>
<Command>
Win32\output\debug\cryptest.exe mac_dll "$(TargetPath)"
IF %ERRORLEVEL% EQU 0 (echo mac done &gt; "$(OutDir)"\cryptopp.mac.done)
</Command>
<Inputs>%(Inputs)</Inputs>
<Outputs>$(OutDir)cryptopp.mac.done;%(Outputs)</Outputs>
</PostBuildEvent>
</ItemDefinitionGroup>
<!-- Original File with special treatment -->
<ItemGroup>
<CustomBuild Condition="'$(Platform)'=='x64' AND ('$(Configuration)'=='Debug' Or '$(Configuration)'=='Release')" Include="x64dll.asm">
<Message>Building and assembling x64dll.asm</Message>
<Command>ml64.exe /c /nologo /D_M_X64 /W3 /Zi /Fo"$(IntDir)x64dll.obj" "%(FullPath)"</Command>
<Outputs>$(IntDir)x64dll.obj;%(Outputs)</Outputs>
</CustomBuild>
</ItemGroup>
<!-- Source Files -->
<ItemGroup>
<ClCompile Include="pch.cpp">
<PrecompiledHeader>Create</PrecompiledHeader>
</ClCompile>
<ClCompile Include="dll.cpp">
<PrecompiledHeader />
</ClCompile>
<ClCompile Include="iterhash.cpp">
<PrecompiledHeader />
</ClCompile>
<ClCompile Include="algebra.cpp" />
<ClCompile Include="algparam.cpp" />
<ClCompile Include="asn.cpp" />
<ClCompile Include="authenc.cpp" />
<ClCompile Include="basecode.cpp" />
<ClCompile Include="cbcmac.cpp" />
<ClCompile Include="ccm.cpp" />
<ClCompile Include="channels.cpp" />
<ClCompile Include="cmac.cpp" />
<ClCompile Include="cpu.cpp" />
<ClCompile Include="cryptlib.cpp" />
<ClCompile Include="des.cpp" />
<ClCompile Include="dessp.cpp" />
<ClCompile Include="dh.cpp" />
<ClCompile Include="dsa.cpp" />
<ClCompile Include="ec2n.cpp" />
<ClCompile Include="eccrypto.cpp" />
<ClCompile Include="ecp.cpp" />
<ClCompile Include="emsa2.cpp" />
<ClCompile Include="eprecomp.cpp" />
<ClCompile Include="files.cpp" />
<ClCompile Include="filters.cpp" />
<ClCompile Include="fips140.cpp" />
<ClCompile Include="fipstest.cpp" />
<ClCompile Include="gcm.cpp" />
<ClCompile Include="gcm-simd.cpp" />
<ClCompile Include="gf2n.cpp" />
<ClCompile Include="gfpcrypt.cpp" />
<ClCompile Include="hex.cpp" />
<ClCompile Include="hmac.cpp" />
<ClCompile Include="hrtimer.cpp" />
<ClCompile Include="integer.cpp" />
<ClCompile Include="misc.cpp" />
<ClCompile Include="modes.cpp" />
<ClCompile Include="mqueue.cpp" />
<ClCompile Include="nbtheory.cpp" />
<ClCompile Include="oaep.cpp" />
<ClCompile Include="osrng.cpp" />
<ClCompile Include="pkcspad.cpp" />
<ClCompile Include="pssr.cpp" />
<ClCompile Include="pubkey.cpp" />
<ClCompile Include="queue.cpp" />
<ClCompile Include="randpool.cpp" />
<ClCompile Include="rdtables.cpp" />
<ClCompile Include="rijndael.cpp" />
<ClCompile Include="rijndael-simd.cpp" />
<ClCompile Include="rng.cpp" />
<ClCompile Include="rsa.cpp" />
<ClCompile Include="rw.cpp" />
<ClCompile Include="sha.cpp" />
<ClCompile Include="sha-simd.cpp" />
<ClCompile Include="simple.cpp" />
<ClCompile Include="skipjack.cpp" />
<ClCompile Include="sse-simd.cpp" />
<ClCompile Include="strciphr.cpp" />
<ClCompile Include="trdlocal.cpp" />
</ItemGroup>
<!-- Header Files -->
<ItemGroup>
<ClInclude Include="aes.h" />
<ClInclude Include="algebra.h" />
<ClInclude Include="algparam.h" />
<ClInclude Include="argnames.h" />
<ClInclude Include="asn.h" />
<ClInclude Include="authenc.h" />
<ClInclude Include="basecode.h" />
<ClInclude Include="cbcmac.h" />
<ClInclude Include="ccm.h" />
<ClInclude Include="channels.h" />
<ClInclude Include="cmac.h" />
<ClInclude Include="config.h" />
<ClInclude Include="cpu.h" />
<ClInclude Include="cryptlib.h" />
<ClInclude Include="des.h" />
<ClInclude Include="dh.h" />
<ClInclude Include="dll.h" />
<ClInclude Include="dsa.h" />
<ClInclude Include="ec2n.h" />
<ClInclude Include="eccrypto.h" />
<ClInclude Include="ecp.h" />
<ClInclude Include="ecpoint.h" />
<ClInclude Include="emsa2.h" />
<ClInclude Include="eprecomp.h" />
<ClInclude Include="files.h" />
<ClInclude Include="filters.h" />
<ClInclude Include="fips140.h" />
<ClInclude Include="fltrimpl.h" />
<ClInclude Include="gcm.h" />
<ClInclude Include="gf2n.h" />
<ClInclude Include="gfpcrypt.h" />
<ClInclude Include="hex.h" />
<ClInclude Include="hmac.h" />
<ClInclude Include="integer.h" />
<ClInclude Include="iterhash.h" />
<ClInclude Include="mdc.h" />
<ClInclude Include="misc.h" />
<ClInclude Include="modarith.h" />
<ClInclude Include="modes.h" />
<ClInclude Include="modexppc.h" />
<ClInclude Include="mqueue.h" />
<ClInclude Include="mqv.h" />
<ClInclude Include="nbtheory.h" />
<ClInclude Include="oaep.h" />
<ClInclude Include="oids.h" />
<ClInclude Include="osrng.h" />
<ClInclude Include="pch.h" />
<ClInclude Include="pkcspad.h" />
<ClInclude Include="pssr.h" />
<ClInclude Include="pubkey.h" />
<ClInclude Include="queue.h" />
<ClInclude Include="randpool.h" />
<ClInclude Include="rijndael.h" />
<ClInclude Include="rng.h" />
<ClInclude Include="rsa.h" />
<ClInclude Include="rw.h" />
<ClInclude Include="secblock.h" />
<ClInclude Include="seckey.h" />
<ClInclude Include="sha.h" />
<ClInclude Include="simple.h" />
<ClInclude Include="skipjack.h" />
<ClInclude Include="smartptr.h" />
<ClInclude Include="stdcpp.h" />
<ClInclude Include="strciphr.h" />
<ClInclude Include="trap.h" />
<ClInclude Include="trdlocal.h" />
<ClInclude Include="words.h" />
</ItemGroup>
<!-- Back to Visual Studio boilerplate -->
<ItemGroup>
<ResourceCompile Include="cryptopp.rc" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
<Import Project="$(VCTargetsPath)\BuildCustomizations\masm.targets" />
</ImportGroup>
</Project>

View File

@ -1,405 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{82666edd-7baf-4a5a-922c-a06edc2198bd}</UniqueIdentifier>
<Extensions>cpp;c;cxx;rc;def;r;odl;idl;hpj;bat</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{2029b271-c489-4b4c-9ce5-261b4cfe2d78}</UniqueIdentifier>
<Extensions>.h</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="algebra.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="algparam.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="asn.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="authenc.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="basecode.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="cbcmac.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="ccm.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="channels.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="cmac.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="cpu.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="cryptlib.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="des.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="dessp.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="dh.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="dll.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="dsa.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="ec2n.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="eccrypto.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="ecp.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="emsa2.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="eprecomp.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="files.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="filters.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="fips140.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="fipstest.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="gcm.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="gcm-simd.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="gf2n.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="gfpcrypt.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="hex.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="hmac.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="hrtimer.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="integer.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="iterhash.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="misc.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="modes.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="mqueue.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="nbtheory.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="oaep.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="osrng.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="pch.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="pkcspad.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="pssr.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="pubkey.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="queue.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="randpool.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="rdtables.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="rijndael.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="rijndael-simd.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="rng.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="rsa.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="rw.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="sha.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="sha-simd.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="simple.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="skipjack.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="sse-simd.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="strciphr.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="trdlocal.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="aes.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="algebra.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="algparam.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="argnames.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="asn.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="authenc.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="basecode.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="cbcmac.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="ccm.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="channels.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="cmac.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="config.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="cpu.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="cryptlib.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="des.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="dh.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="dll.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="dsa.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="ec2n.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="eccrypto.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="ecp.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="ecpoint.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="emsa2.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="eprecomp.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="files.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="filters.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="fips140.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="fltrimpl.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="gcm.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="gf2n.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="gfpcrypt.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="hex.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="hmac.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="integer.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="iterhash.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="mdc.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="misc.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="modarith.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="modes.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="modexppc.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="mqueue.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="mqv.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="nbtheory.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="oaep.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="oids.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="osrng.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="pch.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="pkcspad.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="pssr.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="pubkey.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="queue.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="randpool.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="rijndael.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="rng.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="rsa.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="rw.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="secblock.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="seckey.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="sha.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="simple.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="skipjack.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="smartptr.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="stdcpp.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="strciphr.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="trap.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="trdlocal.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="words.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="cryptopp.rc">
<Filter>Source Files</Filter>
</ResourceCompile>
</ItemGroup>
<ItemGroup>
<CustomBuild Include="x64dll.asm">
<Filter>Source Files</Filter>
</CustomBuild>
</ItemGroup>
</Project>

View File

@ -1,174 +0,0 @@
# cryptest.nmake - written and placed in public domain by Jeffrey Walton.
# Copyright assigned to the Crypto++ project.
# This makefile is used for testing and building cryptlib.lib and cryptest.exe under nmake. Open a
# Visual Studio Developer Prompt and then run "nmake /f cryptest.nmake". The build procedure will
# reveal not-so-readily-apparent problems under Microsoft ARM and Metro UI apps.
# The makefile is not intended for production use, though it may be used as a starting point.
# For example, you can add switches like /MT and /MTd for dynamic runtime linking against
# the Microsoft C++ Runtime libraries. If you are building for Windows Phone or Windows Store, then
# you probably want to remove /D_MBCS. The resulting cryptlib.lib may be suitable as a starting
# point for a DLL project using Crypto++.
# You must also add /DCRYPTOPP_DEBUG or /DDEBUG if you want a debug build with the library's assert.
# The library moved from Posix NDEBUG and assert() to CRYPTOPP_ASSERT at 5.6.5 due to CVE-2016-7420.
# CRYPTOPP_ASSERT has the additional benefit of using DebugBreak(), and the program does not crash
# while you are debugging it like would happen with Posix assert().
# The list of LIB_SRCS and TEST_SRCS was generated under Linux with "make sources". The list of
# LIB_OBJS and TEST_OBJS was generated under Linux with "make sources | sed 's|.cpp|.obj|g'".
# The order of the firt three object files are significant. See C++ Static Initialization Order
# Fisaco on the Crypto++ wiki for details.
# You are free to add and remove files to the list. For example, you can remove rdrand.asm
# build it using NASM, and then include the NASM object file rdrand_x86.obj or rdrand_x64.obj.
###########################################################################################
# To test debug builds, use the following CXXFLAGS:
# - /DDEBUG /D_DEBUG /Oi /Oy- /Od
# To test release builds, use the following CXXFLAGS:
# - /DNDEBUG /D_NDEBUG /Oi /Oy /O2
# To test with static C++ runtime linking, use the following CXXFLAGS (default below):
# - /MT (release) or /MTd (debug)
# To test with dynamic C++ runtime linking, use the following CXXFLAGS:
# - /MD (release) or /MDd (debug)
# To test Desktop app, use the following CXXFLAGS:
# - /DWINAPI_FAMILY=WINAPI_FAMILY_DESKTOP_APP
# To test Windows Store app, use the following CXXFLAGS:
# - /DWINAPI_FAMILY=WINAPI_FAMILY_APP
# To test Windows Phone, use the following CXXFLAGS:
# - /DWINAPI_FAMILY=WINAPI_FAMILY_PHONE_APP
# To test Surface RT (ARM tablet), use the following CXXFLAGS:
# - /D_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE=1 /DWINAPI_FAMILY=WINAPI_FAMILY_DESKTOP_APP
###########################################################################################
# If you use 'make sources' from Linux makefile, then add 'winpipes.cpp' to the list below.
LIB_SRCS = cryptlib.cpp cpu.cpp integer.cpp 3way.cpp adler32.cpp algebra.cpp algparam.cpp arc4.cpp aria-simd.cpp aria.cpp ariatab.cpp asn.cpp authenc.cpp base32.cpp base64.cpp basecode.cpp bfinit.cpp blake2-simd.cpp blake2.cpp blowfish.cpp blumshub.cpp camellia.cpp cast.cpp casts.cpp cbcmac.cpp ccm.cpp chacha.cpp channels.cpp cmac.cpp crc-simd.cpp crc.cpp default.cpp des.cpp dessp.cpp dh.cpp dh2.cpp dll.cpp dsa.cpp eax.cpp ec2n.cpp eccrypto.cpp ecp.cpp elgamal.cpp emsa2.cpp eprecomp.cpp esign.cpp files.cpp filters.cpp fips140.cpp fipstest.cpp gcm-simd.cpp gcm.cpp gf256.cpp gf2_32.cpp gf2n.cpp gfpcrypt.cpp gost.cpp gzip.cpp hex.cpp hmac.cpp hrtimer.cpp ida.cpp idea.cpp iterhash.cpp kalyna.cpp kalynatab.cpp keccak.cpp luc.cpp mars.cpp marss.cpp md2.cpp md4.cpp md5.cpp misc.cpp modes.cpp mqueue.cpp mqv.cpp nbtheory.cpp neon-simd.cpp network.cpp oaep.cpp osrng.cpp padlkrng.cpp panama.cpp pkcspad.cpp poly1305.cpp polynomi.cpp pssr.cpp pubkey.cpp queue.cpp rabin.cpp randpool.cpp rc2.cpp rc5.cpp rc6.cpp rdrand.cpp rdtables.cpp rijndael-simd.cpp rijndael.cpp ripemd.cpp rng.cpp rsa.cpp rw.cpp safer.cpp salsa.cpp scrypt.cpp seal.cpp seed.cpp serpent.cpp sha-simd.cpp sha.cpp sha3.cpp shacal2-simd.cpp shacal2.cpp shark.cpp sharkbox.cpp simon.cpp simon-simd.cpp skipjack.cpp sm3.cpp sm4.cpp socketft.cpp sosemanuk.cpp speck.cpp speck-simd.cpp square.cpp squaretb.cpp sse-simd.cpp strciphr.cpp tea.cpp tftables.cpp threefish.cpp tiger.cpp tigertab.cpp trdlocal.cpp ttmac.cpp tweetnacl.cpp twofish.cpp vmac.cpp wait.cpp wake.cpp whrlpool.cpp winpipes.cpp xtr.cpp xtrcrypt.cpp zdeflate.cpp zinflate.cpp zlib.cpp
LIB_OBJS = cryptlib.obj cpu.obj integer.obj 3way.obj adler32.obj algebra.obj algparam.obj arc4.obj aria-simd.obj aria.obj ariatab.obj asn.obj authenc.obj base32.obj base64.obj basecode.obj bfinit.obj blake2-simd.obj blake2.obj blowfish.obj blumshub.obj camellia.obj cast.obj casts.obj cbcmac.obj ccm.obj chacha.obj channels.obj cmac.obj crc-simd.obj crc.obj default.obj des.obj dessp.obj dh.obj dh2.obj dll.obj dsa.obj eax.obj ec2n.obj eccrypto.obj ecp.obj elgamal.obj emsa2.obj eprecomp.obj esign.obj files.obj filters.obj fips140.obj fipstest.obj gcm-simd.obj gcm.obj gf256.obj gf2_32.obj gf2n.obj gfpcrypt.obj gost.obj gzip.obj hex.obj hmac.obj hrtimer.obj ida.obj idea.obj iterhash.obj kalyna.obj kalynatab.obj keccak.obj luc.obj mars.obj marss.obj md2.obj md4.obj md5.obj misc.obj modes.obj mqueue.obj mqv.obj nbtheory.obj neon-simd.obj network.obj oaep.obj osrng.obj padlkrng.obj panama.obj pkcspad.obj poly1305.obj polynomi.obj pssr.obj pubkey.obj queue.obj rabin.obj randpool.obj rc2.obj rc5.obj rc6.obj rdrand.obj rdtables.obj rijndael-simd.obj rijndael.obj ripemd.obj rng.obj rsa.obj rw.obj safer.obj salsa.obj scrypt.obj seal.obj seed.obj serpent.obj sha-simd.obj sha.obj sha3.obj shacal2-simd.obj shacal2.obj shark.obj sharkbox.obj simon.obj simon-simd.obj skipjack.obj sm3.obj sm4.obj socketft.obj sosemanuk.obj speck.obj speck-simd.obj square.obj squaretb.obj sse-simd.obj strciphr.obj tea.obj tftables.obj threefish.obj tiger.obj tigertab.obj trdlocal.obj ttmac.obj tweetnacl.obj twofish.obj vmac.obj wait.obj wake.obj whrlpool.obj winpipes.obj xtr.obj xtrcrypt.obj zdeflate.obj zinflate.obj zlib.obj
TEST_SRCS = bench1.cpp bench2.cpp test.cpp validat0.cpp validat1.cpp validat2.cpp validat3.cpp validat4.cpp datatest.cpp regtest1.cpp regtest2.cpp regtest3.cpp fipsalgt.cpp dlltest.cpp fipstest.cpp
TEST_OBJS = bench1.obj bench2.obj test.obj validat0.obj validat1.obj validat2.obj validat3.obj validat4.obj datatest.obj regtest1.obj regtest2.obj regtest3.obj fipsalgt.obj dlltest.obj fipstest.obj
CXX = cl.exe
LD = link.exe
AR = lib.exe
RM = del.exe
# C4231 is needed for VS2008 and below. Lots of noise...
CXXFLAGS = /nologo /W4 /wd4231 /wd4511 /wd4156 /D_MBCS /Zi /TP /GR /EHsc
LDFLAGS = /nologo /SUBSYSTEM:CONSOLE
ARFLAGS = /nologo
LDLIBS =
# Debug build
# CXXFLAGS = $(CXXFLAGS) /DDEBUG /D_DEBUG /Oi /Oy- /Od /MTd
# Release build
CXXFLAGS = $(CXXFLAGS) /DNDEBUG /D_NDEBUG /Oi /Oy /O2 /MT
# Attempt to detect when <sdkddkver.h> and <winapifamily.h> are available
# http://stackoverflow.com/q/40577415 ?
!IF "$(WINDOWSSDKDIR)" != "" || "$(WINDOWSSDKLIBVERSION)" != ""
CXXFLAGS = $(CXXFLAGS) /FI sdkddkver.h
!ENDIF
!IF "$(WINDOWSPHONEKITDIR)" != "" || "$(UNIVERSALCRTSDKDIR)" != "" || "$(UCRTVERSION)" != ""
CXXFLAGS = $(CXXFLAGS) /FI winapifamily.h
!ELSEIF "$(PLATFORM)" == "ARM" || "$(PLATFORM)" == "arm" || "$(PLATFORM)" == "ARM64" || "$(PLATFORM)" == "arm64"
CXXFLAGS = $(CXXFLAGS) /FI winapifamily.h
!ENDIF
# Check for empty Platform and Processor
!IF "$(PLATFORM)" == ""
!IF "$(PROCESSOR_ARCHITECTURE)" == "x86"
PLATFORM = x86
!ELSEIF "$(PROCESSOR_ARCHITECTURE)" == "x64" || "$(PROCESSOR_ARCHITECTURE)" == "AMD64"
PLATFORM = x64
!ELSE
!ERROR "Unknown platform"
!ENDIF
!ENDIF
!MESSAGE
!MESSAGE ******************************
!MESSAGE Platform is $(PLATFORM)
!MESSAGE ******************************
!MESSAGE
!IF "$(PLATFORM)" == "x86" || "$(PLATFORM)" == "X86"
# CXXFLAGS = $(CXXFLAGS) /arch:SSE2
# CXXFLAGS = $(CXXFLAGS) /DWINAPI_FAMILY=WINAPI_FAMILY_DESKTOP_APP
# CXXFLAGS = $(CXXFLAGS) /DWINAPI_FAMILY=WINAPI_FAMILY_APP
AS = ml.exe
ASFLAGS = /nologo /D_M_X86 /W3 /Cx /Zi /safeseh
LIB_SRCS = $(LIB_SRCS) rdrand.cpp rdrand.asm
LIB_OBJS = $(LIB_OBJS) rdrand.obj rdrand-x86.obj
LDFLAGS = $(LDFLAGS) /MACHINE:X86
LDLIBS = $(LDLIBS) ws2_32.lib kernel32.lib
!ENDIF
# May need $(VCINSTALLDIR)\bin\amd64\ml64.exe
!IF "$(PLATFORM)" == "x64" || "$(PLATFORM)" == "X64" || "$(PLATFORM)" == "amd64"
# CXXFLAGS = $(CXXFLAGS) /arch:AVX2
# CXXFLAGS = $(CXXFLAGS) /DWINAPI_FAMILY=WINAPI_FAMILY_DESKTOP_APP
# CXXFLAGS = $(CXXFLAGS) /DWINAPI_FAMILY=WINAPI_FAMILY_APP
AS = ml64.exe
ASFLAGS = /nologo /D_M_X64 /W3 /Cx /Zi
LIB_SRCS = $(LIB_SRCS) rdrand.cpp rdrand.asm
LIB_OBJS = $(LIB_OBJS) rdrand.obj rdrand-x64.obj x64masm.obj x64dll.obj
LDFLAGS = $(LDFLAGS) /MACHINE:X64
LDLIBS = $(LDLIBS) ws2_32.lib kernel32.lib
!ENDIF
# We still don't know what we need for ARM64 on Windows. ARM64 and arm64 may be incorrect
!IF "$(PLATFORM)" == "ARM" || "$(PLATFORM)" == "arm" || "$(PLATFORM)" == "ARM64" || "$(PLATFORM)" == "arm64"
# CXXFLAGS = $(CXXFLAGS) /D_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE=1 /DWINAPI_FAMILY=WINAPI_FAMILY_DESKTOP_APP
CXXFLAGS = $(CXXFLAGS) /DWINAPI_FAMILY=WINAPI_FAMILY_PHONE_APP
LIB_SRCS = $(LIB_SRCS) neon-simd.cpp
LIB_OBJS = $(LIB_OBJS) neon-simd.obj
# CXXFLAGS = $(CXXFLAGS) /DWINAPI_FAMILY=WINAPI_FAMILY_APP
# LDLIBS = $(LDLIBS) ws2_32.lib
!ENDIF
all: cryptest.exe
cryptest.exe: pch.pch cryptlib.lib $(TEST_OBJS)
$(LD) $(LDFLAGS) $(TEST_OBJS) cryptlib.lib $(LDLIBS) /out:$@
cryptlib.lib: $(LIB_OBJS)
$(AR) $(ARFLAGS) $(LIB_OBJS) /out:$@
clean:
$(RM) /F /Q pch.pch $(LIB_OBJS) pch.obj rdrand-x86.obj rdrand-x64.obj x64masm.obj x64dll.obj cryptlib.lib $(TEST_OBJS) cryptest.exe *.pdb
# Precompiled header
pch.pch: pch.h pch.cpp
$(CXX) $(CXXFLAGS) /Yc"pch.h" /Fp"pch.pch" /c pch.cpp
# No precompiled headers
iterhash.obj:
$(CXX) $(CXXFLAGS) /Y- /c iterhash.cpp
dll.obj:
$(CXX) $(CXXFLAGS) /Y- /c dll.cpp
rdrand.obj:
$(CXX) $(CXXFLAGS) /c rdrand.cpp
# Built for x86/x64
rdrand-x86.obj:
$(AS) $(ASFLAGS) /Fo rdrand-x86.obj /c rdrand.asm
rdrand-x64.obj:
$(AS) $(ASFLAGS) /Fo rdrand-x64.obj /c rdrand.asm
x64masm.obj:
$(AS) $(ASFLAGS) /Fo x64masm.obj /c x64masm.asm
x64dll.obj:
$(AS) $(ASFLAGS) /Fo x64dll.obj /c x64dll.asm
.cpp.obj:
$(CXX) $(CXXFLAGS) /c $<
.asm.obj:
$(AS) $(ASFLAGS) /c $<

File diff suppressed because it is too large Load Diff

View File

@ -1,89 +0,0 @@
Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cryptest", "cryptest.vcxproj", "{09CDAC08-E6AE-48A9-8DE7-0FBC779EEBDE}"
ProjectSection(ProjectDependencies) = postProject
{C39F4B46-6E89-4074-902E-CA57073044D2} = {C39F4B46-6E89-4074-902E-CA57073044D2}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cryptlib", "cryptlib.vcxproj", "{C39F4B46-6E89-4074-902E-CA57073044D2}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "dlltest", "dlltest.vcxproj", "{1974A53A-9863-41C9-886D-B2B8C2FC3C8B}"
ProjectSection(ProjectDependencies) = postProject
{94A428A1-9BA8-4DB2-B76E-BD2E3C08F257} = {94A428A1-9BA8-4DB2-B76E-BD2E3C08F257}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cryptdll", "cryptdll.vcxproj", "{94A428A1-9BA8-4DB2-B76E-BD2E3C08F257}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
Debug|x64 = Debug|x64
DLL-Import Debug|Win32 = DLL-Import Debug|Win32
DLL-Import Debug|x64 = DLL-Import Debug|x64
DLL-Import Release|Win32 = DLL-Import Release|Win32
DLL-Import Release|x64 = DLL-Import Release|x64
Release|Win32 = Release|Win32
Release|x64 = Release|x64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{09CDAC08-E6AE-48A9-8DE7-0FBC779EEBDE}.Debug|Win32.ActiveCfg = Debug|Win32
{09CDAC08-E6AE-48A9-8DE7-0FBC779EEBDE}.Debug|Win32.Build.0 = Debug|Win32
{09CDAC08-E6AE-48A9-8DE7-0FBC779EEBDE}.Debug|x64.ActiveCfg = Debug|x64
{09CDAC08-E6AE-48A9-8DE7-0FBC779EEBDE}.Debug|x64.Build.0 = Debug|x64
{09CDAC08-E6AE-48A9-8DE7-0FBC779EEBDE}.DLL-Import Debug|Win32.ActiveCfg = DLL-Import Debug|Win32
{09CDAC08-E6AE-48A9-8DE7-0FBC779EEBDE}.DLL-Import Debug|Win32.Build.0 = DLL-Import Debug|Win32
{09CDAC08-E6AE-48A9-8DE7-0FBC779EEBDE}.DLL-Import Debug|x64.ActiveCfg = DLL-Import Debug|x64
{09CDAC08-E6AE-48A9-8DE7-0FBC779EEBDE}.DLL-Import Debug|x64.Build.0 = DLL-Import Debug|x64
{09CDAC08-E6AE-48A9-8DE7-0FBC779EEBDE}.DLL-Import Release|Win32.ActiveCfg = DLL-Import Release|Win32
{09CDAC08-E6AE-48A9-8DE7-0FBC779EEBDE}.DLL-Import Release|Win32.Build.0 = DLL-Import Release|Win32
{09CDAC08-E6AE-48A9-8DE7-0FBC779EEBDE}.DLL-Import Release|x64.ActiveCfg = DLL-Import Release|x64
{09CDAC08-E6AE-48A9-8DE7-0FBC779EEBDE}.DLL-Import Release|x64.Build.0 = DLL-Import Release|x64
{09CDAC08-E6AE-48A9-8DE7-0FBC779EEBDE}.Release|Win32.ActiveCfg = Release|Win32
{09CDAC08-E6AE-48A9-8DE7-0FBC779EEBDE}.Release|Win32.Build.0 = Release|Win32
{09CDAC08-E6AE-48A9-8DE7-0FBC779EEBDE}.Release|x64.ActiveCfg = Release|x64
{09CDAC08-E6AE-48A9-8DE7-0FBC779EEBDE}.Release|x64.Build.0 = Release|x64
{C39F4B46-6E89-4074-902E-CA57073044D2}.Debug|Win32.ActiveCfg = Debug|Win32
{C39F4B46-6E89-4074-902E-CA57073044D2}.Debug|Win32.Build.0 = Debug|Win32
{C39F4B46-6E89-4074-902E-CA57073044D2}.Debug|x64.ActiveCfg = Debug|x64
{C39F4B46-6E89-4074-902E-CA57073044D2}.Debug|x64.Build.0 = Debug|x64
{C39F4B46-6E89-4074-902E-CA57073044D2}.DLL-Import Debug|Win32.ActiveCfg = DLL-Import Debug|Win32
{C39F4B46-6E89-4074-902E-CA57073044D2}.DLL-Import Debug|Win32.Build.0 = DLL-Import Debug|Win32
{C39F4B46-6E89-4074-902E-CA57073044D2}.DLL-Import Debug|x64.ActiveCfg = DLL-Import Debug|x64
{C39F4B46-6E89-4074-902E-CA57073044D2}.DLL-Import Debug|x64.Build.0 = DLL-Import Debug|x64
{C39F4B46-6E89-4074-902E-CA57073044D2}.DLL-Import Release|Win32.ActiveCfg = DLL-Import Release|Win32
{C39F4B46-6E89-4074-902E-CA57073044D2}.DLL-Import Release|Win32.Build.0 = DLL-Import Release|Win32
{C39F4B46-6E89-4074-902E-CA57073044D2}.DLL-Import Release|x64.ActiveCfg = DLL-Import Release|x64
{C39F4B46-6E89-4074-902E-CA57073044D2}.DLL-Import Release|x64.Build.0 = DLL-Import Release|x64
{C39F4B46-6E89-4074-902E-CA57073044D2}.Release|Win32.ActiveCfg = Release|Win32
{C39F4B46-6E89-4074-902E-CA57073044D2}.Release|Win32.Build.0 = Release|Win32
{C39F4B46-6E89-4074-902E-CA57073044D2}.Release|x64.ActiveCfg = Release|x64
{C39F4B46-6E89-4074-902E-CA57073044D2}.Release|x64.Build.0 = Release|x64
{1974A53A-9863-41C9-886D-B2B8C2FC3C8B}.Debug|Win32.ActiveCfg = Debug|Win32
{1974A53A-9863-41C9-886D-B2B8C2FC3C8B}.Debug|x64.ActiveCfg = Debug|x64
{1974A53A-9863-41C9-886D-B2B8C2FC3C8B}.DLL-Import Debug|Win32.ActiveCfg = Debug|Win32
{1974A53A-9863-41C9-886D-B2B8C2FC3C8B}.DLL-Import Debug|Win32.Build.0 = Debug|Win32
{1974A53A-9863-41C9-886D-B2B8C2FC3C8B}.DLL-Import Debug|x64.ActiveCfg = Debug|x64
{1974A53A-9863-41C9-886D-B2B8C2FC3C8B}.DLL-Import Debug|x64.Build.0 = Debug|x64
{1974A53A-9863-41C9-886D-B2B8C2FC3C8B}.DLL-Import Release|Win32.ActiveCfg = Release|Win32
{1974A53A-9863-41C9-886D-B2B8C2FC3C8B}.DLL-Import Release|Win32.Build.0 = Release|Win32
{1974A53A-9863-41C9-886D-B2B8C2FC3C8B}.DLL-Import Release|x64.ActiveCfg = Release|x64
{1974A53A-9863-41C9-886D-B2B8C2FC3C8B}.DLL-Import Release|x64.Build.0 = Release|x64
{1974A53A-9863-41C9-886D-B2B8C2FC3C8B}.Release|Win32.ActiveCfg = Release|Win32
{1974A53A-9863-41C9-886D-B2B8C2FC3C8B}.Release|x64.ActiveCfg = Release|x64
{94A428A1-9BA8-4DB2-B76E-BD2E3C08F257}.Debug|Win32.ActiveCfg = Debug|Win32
{94A428A1-9BA8-4DB2-B76E-BD2E3C08F257}.Debug|x64.ActiveCfg = Debug|x64
{94A428A1-9BA8-4DB2-B76E-BD2E3C08F257}.DLL-Import Debug|Win32.ActiveCfg = Debug|Win32
{94A428A1-9BA8-4DB2-B76E-BD2E3C08F257}.DLL-Import Debug|Win32.Build.0 = Debug|Win32
{94A428A1-9BA8-4DB2-B76E-BD2E3C08F257}.DLL-Import Debug|x64.ActiveCfg = Debug|x64
{94A428A1-9BA8-4DB2-B76E-BD2E3C08F257}.DLL-Import Debug|x64.Build.0 = Debug|x64
{94A428A1-9BA8-4DB2-B76E-BD2E3C08F257}.DLL-Import Release|Win32.ActiveCfg = Release|Win32
{94A428A1-9BA8-4DB2-B76E-BD2E3C08F257}.DLL-Import Release|Win32.Build.0 = Release|Win32
{94A428A1-9BA8-4DB2-B76E-BD2E3C08F257}.DLL-Import Release|x64.ActiveCfg = Release|x64
{94A428A1-9BA8-4DB2-B76E-BD2E3C08F257}.DLL-Import Release|x64.Build.0 = Release|x64
{94A428A1-9BA8-4DB2-B76E-BD2E3C08F257}.Release|Win32.ActiveCfg = Release|Win32
{94A428A1-9BA8-4DB2-B76E-BD2E3C08F257}.Release|x64.ActiveCfg = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

View File

@ -1,340 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<!-- Microsoft documentation for VCXPROJ file format is located at -->
<!-- the following URL. The documentation leaves a lot to be desired. -->
<!-- https://msdn.microsoft.com/en-us/library/2208a1f2.aspx -->
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="DLL-Import Debug|Win32">
<Configuration>DLL-Import Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="DLL-Import Debug|x64">
<Configuration>DLL-Import Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="DLL-Import Release|Win32">
<Configuration>DLL-Import Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="DLL-Import Release|x64">
<Configuration>DLL-Import Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<!-- Microsoft documentation clearly shows the Global property group -->
<!-- preceeds the import of Cpp.Default.props and Cpp.props -->
<!-- https://msdn.microsoft.com/en-us/library/2208a1f2.aspx -->
<PropertyGroup Label="Globals">
<ProjectGuid>{09cdac08-e6ae-48a9-8de7-0fbc779eebde}</ProjectGuid>
<RootNamespace>cryptest</RootNamespace>
<ConfigurationType>Application</ConfigurationType>
</PropertyGroup>
<!-- Use DefaultPlatformToolset after Microsoft.Cpp.Default.props -->
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<!-- Set DefaultPlatformToolset to v100 (VS2010) if not defined -->
<PropertyGroup Label="EmptyDefaultPlatformToolset">
<DefaultPlatformToolset Condition=" '$(DefaultPlatformToolset)' == '' ">v100</DefaultPlatformToolset>
</PropertyGroup>
<PropertyGroup Label="PlatformToolset">
<PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
<Import Project="$(VCTargetsPath)\BuildCustomizations\masm.props" />
</ImportGroup>
<ImportGroup Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<!-- End of Visual Studio boilerplate -->
<!-- All Configurations -->
<PropertyGroup Label="All Configurations">
<ConfigurationType>Application</ConfigurationType>
<TargetName>cryptest</TargetName>
<TargetExt>.exe</TargetExt>
<UseOfMfc>false</UseOfMfc>
<CharacterSet>MultiByte</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
</PropertyGroup>
<!-- Intermediate and Output directories -->
<!-- Cryptlib and Cryptest need extra care due to Non-DLL/DLL configs -->
<PropertyGroup Condition="'$(Configuration)'=='Debug' Or '$(Configuration)'=='Release'" Label="Non-DLL Directories">
<OutDir>$(Platform)\Output\$(Configuration)\</OutDir>
<IntDir>$(Platform)\$(ProjectName)\$(Configuration)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)'=='DLL-Import Debug'" Label="DLL Directories">
<OutDir>$(Platform)\DLL_Output\Debug\</OutDir>
<IntDir>$(Platform)\$(ProjectName)\$(Configuration)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)'=='DLL-Import Release'" Label="DLL Directories">
<OutDir>$(Platform)\DLL_Output\Release\</OutDir>
<IntDir>$(Platform)\$(ProjectName)\$(Configuration)\</IntDir>
</PropertyGroup>
<!-- All Configurations -->
<ItemDefinitionGroup Label="All Configurations">
<ClCompile>
<SuppressStartupBanner>true</SuppressStartupBanner>
<ErrorReporting>None</ErrorReporting>
<WarningLevel>Level4</WarningLevel>
<DisableSpecificWarnings>4231; 4251; 4275; 4355; 4505</DisableSpecificWarnings>
<PrecompiledHeader />
<PrecompiledHeadeFile />
</ClCompile>
<Link>
<ErrorReporting>NoErrorReport</ErrorReporting>
<AdditionalDependencies>cryptlib.lib;Ws2_32.lib</AdditionalDependencies>
<AdditionalLibraryDirectories>$(Platform)\Output\$(Configuration)</AdditionalLibraryDirectories>
<GenerateDebugInformation>true</GenerateDebugInformation>
<ProgramDatabaseFile>$(OutDir)\cryptlib.pdb</ProgramDatabaseFile>
<OutputFile>$(OutDir)\cryptest.exe</OutputFile>
<SubSystem>Console</SubSystem>
</Link>
</ItemDefinitionGroup>
<!-- Debug Configurations -->
<ItemDefinitionGroup Condition="'$(Configuration)'=='Debug' Or '$(Configuration)'=='DLL-Import Debug'" Label="Debug Configuration">
<ClCompile>
<PreprocessorDefinitions>%(PreprocessorDefinitions)</PreprocessorDefinitions>
<Optimization>Disabled</Optimization>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<IntrinsicFunctions>true</IntrinsicFunctions>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>%(PreprocessorDefinitions)</PreprocessorDefinitions>
<Culture>0x0409</Culture>
</ResourceCompile>
</ItemDefinitionGroup>
<!-- Release Configurations -->
<ItemDefinitionGroup Condition="'$(Configuration)'=='Release' Or '$(Configuration)'=='DLL-Import Release'" Label="Release Configuration">
<ClCompile>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<OmitFramePointers>true</OmitFramePointers>
<Optimization>MaxSpeed</Optimization>
<IntrinsicFunctions>true</IntrinsicFunctions>
<InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
<FunctionLevelLinking>true</FunctionLevelLinking>
<StringPooling>true</StringPooling>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<Culture>0x0409</Culture>
</ResourceCompile>
<Link>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
</Link>
</ItemDefinitionGroup>
<!-- DLL-Import Overrides for Preprocessor and Libraries -->
<ItemDefinitionGroup Condition="'$(Configuration)'=='DLL-Import Debug'" Label="DLL Debug Configuration">
<ClCompile>
<PreprocessorDefinitions>CRYPTOPP_IMPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<AdditionalLibraryDirectories>$(Platform)\DLL_Output\Debug</AdditionalLibraryDirectories>
<AdditionalDependencies>cryptopp.lib;cryptlib.lib;Ws2_32.lib</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)'=='DLL-Import Release'" Label="DLL Debug Configuration">
<ClCompile>
<PreprocessorDefinitions>NDEBUG;CRYPTOPP_IMPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<AdditionalLibraryDirectories>$(Platform)\DLL_Output\Release</AdditionalLibraryDirectories>
<AdditionalDependencies>cryptopp.lib;cryptlib.lib;Ws2_32.lib</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<!-- X86 Configurations -->
<ItemDefinitionGroup Condition="'$(Platform)'=='Win32'" Label="X86 Configuration">
<ClCompile>
<EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>
</ClCompile>
<Link>
<TargetMachine>MachineX86</TargetMachine>
<ImageHasSafeExceptionHandlers>true</ImageHasSafeExceptionHandlers>
</Link>
</ItemDefinitionGroup>
<!-- X64 Configurations -->
<ItemDefinitionGroup Condition="'$(Platform)'=='x64'" Label="X64 Configuration">
<Link>
<TargetMachine>MachineX64</TargetMachine>
</Link>
</ItemDefinitionGroup>
<!-- FIPS Validated Warning -->
<ItemDefinitionGroup Label="FIPS Warning">
<PreBuildEvent Condition="'$(Configuration)'=='DLL-Import Debug' Or '$(Configuration)'=='DLL-Import Release'">
<Command>
echo *************************************************************************
echo This configuration requires cryptopp.dll. You can build it yourself using
echo the cryptdll project, or obtain a pre-built, FIPS 140-2 validated DLL. If
echo you build it yourself the resulting DLL will not be considered FIPS
echo validated unless it undergoes the FIPS validation process.
echo *************************************************************************
</Command>
</PreBuildEvent>
</ItemDefinitionGroup>
<!-- Target for Appvoyer -->
<!-- The rule copies cryptest.exe to the project -->
<!-- root directory so it can be executed in place -->
<Target Name="CopyCryptestToRoot">
<Exec Command="copy $(Platform)\Output\$(Configuration)\cryptest.exe $(SolutionDir)" />
</Target>
<!-- Source Files -->
<ItemGroup>
<ClCompile Include="adhoc.cpp" />
<ClCompile Include="bench1.cpp" />
<ClCompile Include="bench2.cpp" />
<ClCompile Include="datatest.cpp" />
<ClCompile Include="dlltest.cpp" />
<ClCompile Include="fipsalgt.cpp" />
<ClCompile Include="regtest1.cpp" />
<ClCompile Include="regtest2.cpp" />
<ClCompile Include="regtest3.cpp" />
<ClCompile Include="test.cpp" />
<ClCompile Include="validat0.cpp" />
<ClCompile Include="validat1.cpp" />
<ClCompile Include="validat2.cpp" />
<ClCompile Include="validat3.cpp" />
<ClCompile Include="validat4.cpp" />
</ItemGroup>
<!-- Header Files -->
<ItemGroup>
<ClInclude Include="bench.h" />
<ClInclude Include="factory.h" />
<ClInclude Include="validate.h" />
</ItemGroup>
<!-- Test Files -->
<ItemGroup>
<None Include="TestVectors\aes.txt" />
<None Include="TestVectors\all.txt" />
<None Include="TestVectors\blake2.txt" />
<None Include="TestVectors\blake2b.txt" />
<None Include="TestVectors\blake2s.txt" />
<None Include="TestVectors\aria.txt" />
<None Include="TestVectors\camellia.txt" />
<None Include="TestVectors\ccm.txt" />
<None Include="TestVectors\chacha.txt" />
<None Include="TestVectors\cmac.txt" />
<None Include="TestVectors\dlies.txt" />
<None Include="TestVectors\dsa.txt" />
<None Include="TestVectors\dsa_1363.txt" />
<None Include="TestVectors\dsa_rfc6979.txt" />
<None Include="TestVectors\eax.txt" />
<None Include="TestVectors\esign.txt" />
<None Include="TestVectors\gcm.txt" />
<None Include="TestVectors\hkdf.txt" />
<None Include="TestVectors\hmac.txt" />
<None Include="TestVectors\kalyna.txt" />
<None Include="TestVectors\mars.txt" />
<None Include="TestVectors\nr.txt" />
<None Include="TestVectors\panama.txt" />
<None Include="TestVectors\Readme.txt" />
<None Include="TestVectors\rsa_oaep.txt" />
<None Include="TestVectors\rsa_pkcs1_1_5.txt" />
<None Include="TestVectors\rsa_pss.txt" />
<None Include="TestVectors\rw.txt" />
<None Include="TestVectors\salsa.txt" />
<None Include="TestVectors\seal.txt" />
<None Include="TestVectors\seed.txt" />
<None Include="TestVectors\sha.txt" />
<None Include="TestVectors\sha2.txt" />
<None Include="TestVectors\sha3.txt" />
<None Include="TestVectors\shacal2.txt" />
<None Include="TestVectors\simon.txt" />
<None Include="TestVectors\siphash.txt" />
<Text Include="TestVectors\sm3.txt" />
<None Include="TestVectors\sm4.txt" />
<None Include="TestVectors\sosemanuk.txt" />
<None Include="TestVectors\speck.txt" />
<None Include="TestVectors\tea.txt" />
<None Include="TestVectors\threefish.txt" />
<None Include="TestVectors\ttmac.txt" />
<None Include="TestVectors\vmac.txt" />
<None Include="TestVectors\wake.txt" />
<None Include="TestVectors\whrlpool.txt" />
<None Include="TestData\3desval.dat" />
<None Include="TestData\3wayval.dat" />
<None Include="TestData\aria.dat" />
<None Include="TestData\camellia.dat" />
<None Include="TestData\cast128v.dat" />
<None Include="TestData\cast256v.dat" />
<None Include="TestData\descert.dat" />
<None Include="TestData\dh1024.dat" />
<None Include="TestData\dh2048.dat" />
<None Include="TestData\dlie1024.dat" />
<None Include="TestData\dlie2048.dat" />
<None Include="TestData\dsa1024.dat" />
<None Include="TestData\dsa1024b.dat" />
<None Include="TestData\dsa512.dat" />
<None Include="TestData\elgc1024.dat" />
<None Include="TestData\esig1023.dat" />
<None Include="TestData\esig1536.dat" />
<None Include="TestData\esig2046.dat" />
<None Include="TestData\fhmqv160.dat" />
<None Include="TestData\fhmqv256.dat" />
<None Include="TestData\fhmqv384.dat" />
<None Include="TestData\fhmqv512.dat" />
<None Include="TestData\gostval.dat" />
<None Include="TestData\hmqv160.dat" />
<None Include="TestData\hmqv256.dat" />
<None Include="TestData\hmqv384.dat" />
<None Include="TestData\hmqv512.dat" />
<None Include="TestData\ideaval.dat" />
<None Include="TestData\luc1024.dat" />
<None Include="TestData\luc2048.dat" />
<None Include="TestData\lucc1024.dat" />
<None Include="TestData\lucc512.dat" />
<None Include="TestData\lucd1024.dat" />
<None Include="TestData\lucd512.dat" />
<None Include="TestData\lucs1024.dat" />
<None Include="TestData\lucs512.dat" />
<None Include="TestData\marsval.dat" />
<None Include="TestData\mqv1024.dat" />
<None Include="TestData\mqv2048.dat" />
<None Include="TestData\nr1024.dat" />
<None Include="TestData\nr2048.dat" />
<None Include="TestData\rabi1024.dat" />
<None Include="TestData\rabi2048.dat" />
<None Include="TestData\rc2val.dat" />
<None Include="TestData\rc5val.dat" />
<None Include="TestData\rc6val.dat" />
<None Include="TestData\rijndael.dat" />
<None Include="TestData\rsa1024.dat" />
<None Include="TestData\rsa2048.dat" />
<None Include="TestData\rsa400pb.dat" />
<None Include="TestData\rsa400pv.dat" />
<None Include="TestData\rsa512a.dat" />
<None Include="TestData\rw1024.dat" />
<None Include="TestData\rw2048.dat" />
<None Include="TestData\saferval.dat" />
<None Include="TestData\serpentv.dat" />
<None Include="TestData\shacal2v.dat" />
<None Include="TestData\sharkval.dat" />
<None Include="TestData\skipjack.dat" />
<None Include="TestData\squareva.dat" />
<None Include="TestData\twofishv.dat" />
<None Include="TestData\usage.dat" />
<None Include="TestData\xtrdh171.dat" />
<None Include="TestData\xtrdh342.dat" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@ -1,418 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Header Files">
<UniqueIdentifier>{1f4eac20-7b40-40db-a264-4a9256229c5a}</UniqueIdentifier>
<Extensions>.h;.hpp</Extensions>
</Filter>
<Filter Include="Source Code">
<UniqueIdentifier>{4c6077b5-a2d6-498c-bc42-10af523a06cb}</UniqueIdentifier>
<Extensions>.cpp</Extensions>
</Filter>
<Filter Include="TestData">
<UniqueIdentifier>{a634d4f4-ddc0-44b4-9c37-d9ffdddc7b06}</UniqueIdentifier>
<Extensions>.dat</Extensions>
</Filter>
<Filter Include="TestVectors">
<UniqueIdentifier>{2e247f14-f75a-4e15-9804-dccce165306f}</UniqueIdentifier>
<Extensions>.txt</Extensions>
</Filter>
<Filter Include="Miscellaneous">
<UniqueIdentifier>{5e447502-2b0f-49c8-9df5-56ea9e7a8fbd}</UniqueIdentifier>
<Extensions>.proto</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<None Include="TestVectors\aes.txt">
<Filter>TestVectors</Filter>
</None>
<None Include="TestVectors\all.txt">
<Filter>TestVectors</Filter>
</None>
<None Include="TestVectors\blake2.txt">
<Filter>TestVectors</Filter>
</None>
<None Include="TestVectors\blake2b.txt">
<Filter>TestVectors</Filter>
</None>
<None Include="TestVectors\blake2s.txt">
<Filter>TestVectors</Filter>
</None>
<None Include="TestVectors\aria.txt">
<Filter>TestVectors</Filter>
</None>
<None Include="TestVectors\camellia.txt">
<Filter>TestVectors</Filter>
</None>
<None Include="TestVectors\ccm.txt">
<Filter>TestVectors</Filter>
</None>
<None Include="TestVectors\chacha.txt">
<Filter>TestVectors</Filter>
</None>
<None Include="TestVectors\cmac.txt">
<Filter>TestVectors</Filter>
</None>
<None Include="TestVectors\dlies.txt">
<Filter>TestVectors</Filter>
</None>
<None Include="TestVectors\dsa.txt">
<Filter>TestVectors</Filter>
</None>
<None Include="TestVectors\dsa_1363.txt">
<Filter>TestVectors</Filter>
</None>
<None Include="TestVectors\dsa_rfc6979.txt">
<Filter>TestVectors</Filter>
</None>
<None Include="TestVectors\eax.txt">
<Filter>TestVectors</Filter>
</None>
<None Include="TestVectors\esign.txt">
<Filter>TestVectors</Filter>
</None>
<None Include="TestVectors\gcm.txt">
<Filter>TestVectors</Filter>
</None>
<None Include="TestVectors\hkdf.txt">
<Filter>TestVectors</Filter>
</None>
<None Include="TestVectors\hmac.txt">
<Filter>TestVectors</Filter>
</None>
<None Include="TestVectors\kalyna.txt">
<Filter>TestVectors</Filter>
</None>
<None Include="TestVectors\mars.txt">
<Filter>TestVectors</Filter>
</None>
<None Include="TestVectors\nr.txt">
<Filter>TestVectors</Filter>
</None>
<None Include="TestVectors\panama.txt">
<Filter>TestVectors</Filter>
</None>
<None Include="TestVectors\Readme.txt">
<Filter>TestVectors</Filter>
</None>
<None Include="TestVectors\rsa_oaep.txt">
<Filter>TestVectors</Filter>
</None>
<None Include="TestVectors\rsa_pkcs1_1_5.txt">
<Filter>TestVectors</Filter>
</None>
<None Include="TestVectors\rsa_pss.txt">
<Filter>TestVectors</Filter>
</None>
<None Include="TestVectors\rw.txt">
<Filter>TestVectors</Filter>
</None>
<None Include="TestVectors\salsa.txt">
<Filter>TestVectors</Filter>
</None>
<None Include="TestVectors\seal.txt">
<Filter>TestVectors</Filter>
</None>
<None Include="TestVectors\seed.txt">
<Filter>TestVectors</Filter>
</None>
<None Include="TestVectors\sha.txt">
<Filter>TestVectors</Filter>
</None>
<None Include="TestVectors\sha2.txt">
<Filter>TestVectors</Filter>
</None>
<None Include="TestVectors\sha3.txt">
<Filter>TestVectors</Filter>
</None>
<None Include="TestVectors\shacal2.txt">
<Filter>TestVectors</Filter>
</None>
<None Include="TestVectors\siphash.txt">
<Filter>TestVectors</Filter>
</None>
<None Include="TestVectors\simon.txt">
<Filter>TestVectors</Filter>
</None>
<Text Include="TestVectors\sm3.txt">
<Filter>TestVectors</Filter>
</Text>
<None Include="TestVectors\sm4.txt">
<Filter>TestVectors</Filter>
</None>
<None Include="TestVectors\sosemanuk.txt">
<Filter>TestVectors</Filter>
</None>
<None Include="TestVectors\speck.txt">
<Filter>TestVectors</Filter>
</None>
<None Include="TestVectors\tea.txt">
<Filter>TestVectors</Filter>
</None>
<None Include="TestVectors\threefish.txt">
<Filter>TestVectors</Filter>
</None>
<None Include="TestVectors\ttmac.txt">
<Filter>TestVectors</Filter>
</None>
<None Include="TestVectors\vmac.txt">
<Filter>TestVectors</Filter>
</None>
<None Include="TestVectors\wake.txt">
<Filter>TestVectors</Filter>
</None>
<None Include="TestVectors\whrlpool.txt">
<Filter>TestVectors</Filter>
</None>
<None Include="TestData\3desval.dat">
<Filter>TestData</Filter>
</None>
<None Include="TestData\3wayval.dat">
<Filter>TestData</Filter>
</None>
<None Include="TestData\aria.dat">
<Filter>TestData</Filter>
</None>
<None Include="TestData\camellia.dat">
<Filter>TestData</Filter>
</None>
<None Include="TestData\cast128v.dat">
<Filter>TestData</Filter>
</None>
<None Include="TestData\cast256v.dat">
<Filter>TestData</Filter>
</None>
<None Include="TestData\descert.dat">
<Filter>TestData</Filter>
</None>
<None Include="TestData\dh1024.dat">
<Filter>TestData</Filter>
</None>
<None Include="TestData\dh2048.dat">
<Filter>TestData</Filter>
</None>
<None Include="TestData\dlie1024.dat">
<Filter>TestData</Filter>
</None>
<None Include="TestData\dlie2048.dat">
<Filter>TestData</Filter>
</None>
<None Include="TestData\dsa1024.dat">
<Filter>TestData</Filter>
</None>
<None Include="TestData\dsa1024b.dat">
<Filter>TestData</Filter>
</None>
<None Include="TestData\dsa512.dat">
<Filter>TestData</Filter>
</None>
<None Include="TestData\elgc1024.dat">
<Filter>TestData</Filter>
</None>
<None Include="TestData\esig1023.dat">
<Filter>TestData</Filter>
</None>
<None Include="TestData\esig1536.dat">
<Filter>TestData</Filter>
</None>
<None Include="TestData\esig2046.dat">
<Filter>TestData</Filter>
</None>
<None Include="TestData\fhmqv160.dat">
<Filter>TestData</Filter>
</None>
<None Include="TestData\fhmqv256.dat">
<Filter>TestData</Filter>
</None>
<None Include="TestData\fhmqv384.dat">
<Filter>TestData</Filter>
</None>
<None Include="TestData\fhmqv512.dat">
<Filter>TestData</Filter>
</None>
<None Include="TestData\gostval.dat">
<Filter>TestData</Filter>
</None>
<None Include="TestData\hmqv160.dat">
<Filter>TestData</Filter>
</None>
<None Include="TestData\hmqv256.dat">
<Filter>TestData</Filter>
</None>
<None Include="TestData\hmqv384.dat">
<Filter>TestData</Filter>
</None>
<None Include="TestData\hmqv512.dat">
<Filter>TestData</Filter>
</None>
<None Include="TestData\ideaval.dat">
<Filter>TestData</Filter>
</None>
<None Include="TestData\luc1024.dat">
<Filter>TestData</Filter>
</None>
<None Include="TestData\luc2048.dat">
<Filter>TestData</Filter>
</None>
<None Include="TestData\lucc1024.dat">
<Filter>TestData</Filter>
</None>
<None Include="TestData\lucc512.dat">
<Filter>TestData</Filter>
</None>
<None Include="TestData\lucd1024.dat">
<Filter>TestData</Filter>
</None>
<None Include="TestData\lucd512.dat">
<Filter>TestData</Filter>
</None>
<None Include="TestData\lucs1024.dat">
<Filter>TestData</Filter>
</None>
<None Include="TestData\lucs512.dat">
<Filter>TestData</Filter>
</None>
<None Include="TestData\marsval.dat">
<Filter>TestData</Filter>
</None>
<None Include="TestData\mqv1024.dat">
<Filter>TestData</Filter>
</None>
<None Include="TestData\mqv2048.dat">
<Filter>TestData</Filter>
</None>
<None Include="TestData\nr1024.dat">
<Filter>TestData</Filter>
</None>
<None Include="TestData\nr2048.dat">
<Filter>TestData</Filter>
</None>
<None Include="TestData\rabi1024.dat">
<Filter>TestData</Filter>
</None>
<None Include="TestData\rabi2048.dat">
<Filter>TestData</Filter>
</None>
<None Include="TestData\rc2val.dat">
<Filter>TestData</Filter>
</None>
<None Include="TestData\rc5val.dat">
<Filter>TestData</Filter>
</None>
<None Include="TestData\rc6val.dat">
<Filter>TestData</Filter>
</None>
<None Include="TestData\rijndael.dat">
<Filter>TestData</Filter>
</None>
<None Include="TestData\rsa1024.dat">
<Filter>TestData</Filter>
</None>
<None Include="TestData\rsa2048.dat">
<Filter>TestData</Filter>
</None>
<None Include="TestData\rsa400pb.dat">
<Filter>TestData</Filter>
</None>
<None Include="TestData\rsa400pv.dat">
<Filter>TestData</Filter>
</None>
<None Include="TestData\rsa512a.dat">
<Filter>TestData</Filter>
</None>
<None Include="TestData\rw1024.dat">
<Filter>TestData</Filter>
</None>
<None Include="TestData\rw2048.dat">
<Filter>TestData</Filter>
</None>
<None Include="TestData\saferval.dat">
<Filter>TestData</Filter>
</None>
<None Include="TestData\serpentv.dat">
<Filter>TestData</Filter>
</None>
<None Include="TestData\shacal2v.dat">
<Filter>TestData</Filter>
</None>
<None Include="TestData\sharkval.dat">
<Filter>TestData</Filter>
</None>
<None Include="TestData\skipjack.dat">
<Filter>TestData</Filter>
</None>
<None Include="TestData\squareva.dat">
<Filter>TestData</Filter>
</None>
<None Include="TestData\twofishv.dat">
<Filter>TestData</Filter>
</None>
<None Include="TestData\usage.dat">
<Filter>TestData</Filter>
</None>
<None Include="TestData\xtrdh171.dat">
<Filter>TestData</Filter>
</None>
<None Include="TestData\xtrdh342.dat">
<Filter>TestData</Filter>
</None>
</ItemGroup>
<ItemGroup>
<ClCompile Include="adhoc.cpp">
<Filter>Source Code</Filter>
</ClCompile>
<ClCompile Include="bench1.cpp">
<Filter>Source Code</Filter>
</ClCompile>
<ClCompile Include="bench2.cpp">
<Filter>Source Code</Filter>
</ClCompile>
<ClCompile Include="datatest.cpp">
<Filter>Source Code</Filter>
</ClCompile>
<ClCompile Include="dlltest.cpp">
<Filter>Source Code</Filter>
</ClCompile>
<ClCompile Include="regtest1.cpp">
<Filter>Source Code</Filter>
</ClCompile>
<ClCompile Include="regtest2.cpp">
<Filter>Source Code</Filter>
</ClCompile>
<ClCompile Include="regtest3.cpp">
<Filter>Source Code</Filter>
</ClCompile>
<ClCompile Include="test.cpp">
<Filter>Source Code</Filter>
</ClCompile>
<ClCompile Include="validat0.cpp">
<Filter>Source Code</Filter>
</ClCompile>
<ClCompile Include="validat1.cpp">
<Filter>Source Code</Filter>
</ClCompile>
<ClCompile Include="validat2.cpp">
<Filter>Source Code</Filter>
</ClCompile>
<ClCompile Include="validat3.cpp">
<Filter>Source Code</Filter>
</ClCompile>
<ClCompile Include="validat4.cpp">
<Filter>Source Code</Filter>
</ClCompile>
<ClCompile Include="fipsalgt.cpp">
<Filter>Source Code</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="bench.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="factory.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="validate.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
</Project>

View File

@ -16,22 +16,16 @@
#ifndef CRYPTOPP_IMPORTS
#include "cryptlib.h"
#include "misc.h"
#include "filters.h"
#include "algparam.h"
#include "fips140.h"
#include "argnames.h"
#include "fltrimpl.h"
#include "trdlocal.h"
#include "osrng.h"
#include "secblock.h"
#include "smartptr.h"
#include "stdcpp.h"
// http://www.cygwin.com/faq.html#faq.api.winsock
#if (defined(__CYGWIN__) || defined(__CYGWIN32__)) && defined(PREFER_WINDOWS_STYLE_SOCKETS)
# error Cygwin does not support Windows style sockets. See http://www.cygwin.com/faq.html#faq.api.winsock
#endif
#include "misc.h"
NAMESPACE_BEGIN(CryptoPP)
@ -150,16 +144,16 @@ size_t BlockTransformation::AdvancedProcessBlocks(const byte *inBlocks, const by
CRYPTOPP_ASSERT(outBlocks);
CRYPTOPP_ASSERT(length);
const size_t blockSize = BlockSize();
ptrdiff_t inIncrement = (flags & (BT_InBlockIsCounter|BT_DontIncrementInOutPointers)) ? 0 : blockSize;
ptrdiff_t xorIncrement = xorBlocks ? blockSize : 0;
ptrdiff_t outIncrement = (flags & BT_DontIncrementInOutPointers) ? 0 : blockSize;
const unsigned int blockSize = BlockSize();
size_t inIncrement = (flags & (BT_InBlockIsCounter|BT_DontIncrementInOutPointers)) ? 0 : blockSize;
size_t xorIncrement = xorBlocks ? blockSize : 0;
size_t outIncrement = (flags & BT_DontIncrementInOutPointers) ? 0 : blockSize;
if (flags & BT_ReverseDirection)
{
inBlocks += static_cast<ptrdiff_t>(length) - blockSize;
xorBlocks += static_cast<ptrdiff_t>(length) - blockSize;
outBlocks += static_cast<ptrdiff_t>(length) - blockSize;
inBlocks = PtrAdd(inBlocks, length - blockSize);
xorBlocks = PtrAdd(xorBlocks, length - blockSize);
outBlocks = PtrAdd(outBlocks, length - blockSize);
inIncrement = 0-inIncrement;
xorIncrement = 0-xorIncrement;
outIncrement = 0-outIncrement;
@ -184,9 +178,9 @@ size_t BlockTransformation::AdvancedProcessBlocks(const byte *inBlocks, const by
if (flags & BT_InBlockIsCounter)
const_cast<byte *>(inBlocks)[blockSize-1]++;
inBlocks += inIncrement;
outBlocks += outIncrement;
xorBlocks += xorIncrement;
inBlocks = PtrAdd(inBlocks, inIncrement);
outBlocks = PtrAdd(outBlocks, outIncrement);
xorBlocks = PtrAdd(xorBlocks, xorIncrement);
length -= blockSize;
}
@ -339,20 +333,20 @@ void RandomNumberGenerator::GenerateIntoBufferedTransformation(BufferedTransform
}
}
size_t KeyDerivationFunction::MinDerivedLength() const
size_t KeyDerivationFunction::MinDerivedKeyLength() const
{
return 0;
}
size_t KeyDerivationFunction::MaxDerivedLength() const
size_t KeyDerivationFunction::MaxDerivedKeyLength() const
{
return static_cast<size_t>(-1);
}
void KeyDerivationFunction::ThrowIfInvalidDerivedLength(size_t length) const
void KeyDerivationFunction::ThrowIfInvalidDerivedKeyLength(size_t length) const
{
if (!IsValidDerivedLength(length))
throw InvalidDerivedLength(GetAlgorithm().AlgorithmName(), length);
throw InvalidDerivedKeyLength(GetAlgorithm().AlgorithmName(), length);
}
void KeyDerivationFunction::SetParameters(const NameValuePairs& params) {
@ -411,8 +405,9 @@ RandomNumberGenerator & NullRNG()
bool HashTransformation::TruncatedVerify(const byte *digest, size_t digestLength)
{
// Allocate at least 1 for calculated to avoid triggering diagnostics
ThrowIfInvalidTruncatedSize(digestLength);
SecByteBlock calculated(digestLength);
SecByteBlock calculated(digestLength ? digestLength : 1);
TruncatedFinal(calculated, digestLength);
return VerifyBufsEqual(calculated, digest, digestLength);
}
@ -652,7 +647,12 @@ size_t BufferedTransformation::TransferMessagesTo2(BufferedTransformation &targe
while (AnyRetrievable())
{
transferredBytes = LWORD_MAX;
// MaxRetrievable() instead of LWORD_MAX due to GH #962. If
// the target calls CreatePutSpace(), then the allocation
// size will be LWORD_MAX. That happens when target is a
// ByteQueue. Maybe ByteQueue should check the size, and if
// it is LWORD_MAX or -1, then use a default like 4096.
transferredBytes = MaxRetrievable();
blockedBytes = TransferTo2(target, transferredBytes, channel, blocking);
if (blockedBytes > 0)
return blockedBytes;
@ -748,6 +748,12 @@ size_t BufferedTransformation::ChannelPutWord32(const std::string &channel, word
return ChannelPut(channel, m_buf, 4, blocking);
}
size_t BufferedTransformation::ChannelPutWord64(const std::string &channel, word64 value, ByteOrder order, bool blocking)
{
PutWord(false, order, m_buf, value);
return ChannelPut(channel, m_buf, 8, blocking);
}
size_t BufferedTransformation::PutWord16(word16 value, ByteOrder order, bool blocking)
{
return ChannelPutWord16(DEFAULT_CHANNEL, value, order, blocking);
@ -758,22 +764,20 @@ size_t BufferedTransformation::PutWord32(word32 value, ByteOrder order, bool blo
return ChannelPutWord32(DEFAULT_CHANNEL, value, order, blocking);
}
// Issue 340
#if CRYPTOPP_GCC_DIAGNOSTIC_AVAILABLE
# pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Wconversion"
# pragma GCC diagnostic ignored "-Wsign-conversion"
#endif
size_t BufferedTransformation::PutWord64(word64 value, ByteOrder order, bool blocking)
{
return ChannelPutWord64(DEFAULT_CHANNEL, value, order, blocking);
}
size_t BufferedTransformation::PeekWord16(word16 &value, ByteOrder order) const
{
byte buf[2] = {0, 0};
size_t len = Peek(buf, 2);
if (order)
value = (buf[0] << 8) | buf[1];
if (order == BIG_ENDIAN_ORDER)
value = word16((buf[0] << 8) | buf[1]);
else
value = (buf[1] << 8) | buf[0];
value = word16((buf[1] << 8) | buf[0]);
return len;
}
@ -783,18 +787,32 @@ size_t BufferedTransformation::PeekWord32(word32 &value, ByteOrder order) const
byte buf[4] = {0, 0, 0, 0};
size_t len = Peek(buf, 4);
if (order)
value = (buf[0] << 24) | (buf[1] << 16) | (buf[2] << 8) | buf [3];
if (order == BIG_ENDIAN_ORDER)
value = word32((buf[0] << 24) | (buf[1] << 16) |
(buf[2] << 8) | (buf[3] << 0));
else
value = (buf[3] << 24) | (buf[2] << 16) | (buf[1] << 8) | buf [0];
value = word32((buf[3] << 24) | (buf[2] << 16) |
(buf[1] << 8) | (buf[0] << 0));
return len;
}
// Issue 340
#if CRYPTOPP_GCC_DIAGNOSTIC_AVAILABLE
# pragma GCC diagnostic pop
#endif
size_t BufferedTransformation::PeekWord64(word64 &value, ByteOrder order) const
{
byte buf[8] = {0, 0, 0, 0, 0, 0, 0, 0};
size_t len = Peek(buf, 8);
if (order == BIG_ENDIAN_ORDER)
value = ((word64)buf[0] << 56) | ((word64)buf[1] << 48) | ((word64)buf[2] << 40) |
((word64)buf[3] << 32) | ((word64)buf[4] << 24) | ((word64)buf[5] << 16) |
((word64)buf[6] << 8) | (word64)buf[7];
else
value = ((word64)buf[7] << 56) | ((word64)buf[6] << 48) | ((word64)buf[5] << 40) |
((word64)buf[4] << 32) | ((word64)buf[3] << 24) | ((word64)buf[2] << 16) |
((word64)buf[1] << 8) | (word64)buf[0];
return len;
}
size_t BufferedTransformation::GetWord16(word16 &value, ByteOrder order)
{
@ -806,6 +824,11 @@ size_t BufferedTransformation::GetWord32(word32 &value, ByteOrder order)
return (size_t)Skip(PeekWord32(value, order));
}
size_t BufferedTransformation::GetWord64(word64 &value, ByteOrder order)
{
return (size_t)Skip(PeekWord64(value, order));
}
void BufferedTransformation::Attach(BufferedTransformation *newAttachment)
{
if (AttachedTransformation() && AttachedTransformation()->Attachable())
@ -992,6 +1015,40 @@ int LibraryVersion(CRYPTOPP_NOINLINE_DOTDOTDOT)
return CRYPTOPP_BUILD_VERSION;
}
class NullNameValuePairs : public NameValuePairs
{
public:
NullNameValuePairs() {} // Clang complains a default ctor must be available
bool GetVoidValue(const char *name, const std::type_info &valueType, void *pValue) const
{CRYPTOPP_UNUSED(name); CRYPTOPP_UNUSED(valueType); CRYPTOPP_UNUSED(pValue); return false;}
};
#if HAVE_GCC_INIT_PRIORITY
const std::string DEFAULT_CHANNEL __attribute__ ((init_priority (CRYPTOPP_INIT_PRIORITY + 25))) = "";
const std::string AAD_CHANNEL __attribute__ ((init_priority (CRYPTOPP_INIT_PRIORITY + 26))) = "AAD";
const NullNameValuePairs s_nullNameValuePairs __attribute__ ((init_priority (CRYPTOPP_INIT_PRIORITY + 27)));
const NameValuePairs& g_nullNameValuePairs = s_nullNameValuePairs;
#elif HAVE_MSC_INIT_PRIORITY
#pragma warning(disable: 4073)
#pragma init_seg(lib)
const std::string DEFAULT_CHANNEL = "";
const std::string AAD_CHANNEL = "AAD";
const NullNameValuePairs s_nullNameValuePairs;
const NameValuePairs& g_nullNameValuePairs = s_nullNameValuePairs;
#pragma warning(default: 4073)
#elif HAVE_XLC_INIT_PRIORITY
#pragma priority(260)
const std::string DEFAULT_CHANNEL = "";
const std::string AAD_CHANNEL = "AAD";
const NullNameValuePairs s_nullNameValuePairs;
const NameValuePairs& g_nullNameValuePairs = s_nullNameValuePairs;
#else
const std::string DEFAULT_CHANNEL = "";
const std::string AAD_CHANNEL = "AAD";
const simple_ptr<NullNameValuePairs> s_pNullNameValuePairs(new NullNameValuePairs);
const NameValuePairs &g_nullNameValuePairs = *s_pNullNameValuePairs.m_p;
#endif
NAMESPACE_END // CryptoPP
#endif // CRYPTOPP_IMPORTS

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -151,6 +151,8 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<OutDir>$(Platform)\Output\$(Configuration)\</OutDir>
<IntDir>$(Platform)\$(ProjectName)\$(Configuration)\</IntDir>
<IncludePath>$(VC_IncludePath);$(WindowsSDK_IncludePath);..\..\..\Common\3dParty\boost\build\win_64\include;</IncludePath>
<LibraryPath>$(VC_LibraryPath_x64);$(WindowsSDK_LibraryPath_x64);$(NETFXKitsDir)Lib\um\x64;..\..\..\Common\3dParty\boost\build\win_64\lib;</LibraryPath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DLL-Import Debug|Win32'">
<OutDir>$(Platform)\DLL_Output\Debug\</OutDir>
@ -176,7 +178,6 @@
<WarningLevel>Level4</WarningLevel>
<SuppressStartupBanner>true</SuppressStartupBanner>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<EnableParallelCodeGeneration>true</EnableParallelCodeGeneration>
</ClCompile>
<ResourceCompile>
<Culture>0x0409</Culture>
@ -261,7 +262,7 @@
<ClCompile>
<Optimization>Disabled</Optimization>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>_DEBUG;_WINDOWS;USE_PRECOMPILED_HEADERS;WIN32;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>_DEBUG;_WINDOWS;USE_PRECOMPILED_HEADERS;WIN32;CRYPTOPP_DISABLE_ASM;DISABLE_TYPE_MISMATCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MinimalRebuild>true</MinimalRebuild>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
@ -286,7 +287,7 @@
<ClCompile>
<Optimization>Disabled</Optimization>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>_DEBUG;_WINDOWS;USE_PRECOMPILED_HEADERS;WIN32;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>_DEBUG;_WINDOWS;USE_PRECOMPILED_HEADERS;WIN32;CRYPTOPP_DISABLE_ASM;DISABLE_TYPE_MISMATCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<PrecompiledHeader>
</PrecompiledHeader>
@ -295,6 +296,7 @@
<WarningLevel>Level4</WarningLevel>
<SuppressStartupBanner>true</SuppressStartupBanner>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<WholeProgramOptimization>false</WholeProgramOptimization>
</ClCompile>
<ResourceCompile>
<Culture>0x0409</Culture>

View File

@ -1,3 +0,0 @@
# Solaris mapfile to override hardware caps to avoid kills
hwcap_1 = SSE SSE2 OVERRIDE;

View File

@ -27,8 +27,8 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 7,0,0,0
PRODUCTVERSION 7,0,0,0
FILEVERSION 8,7,0,0
PRODUCTVERSION 8,7,0,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
@ -44,15 +44,15 @@ BEGIN
BLOCK "040904b0"
BEGIN
VALUE "Comments", "Free crypto library, more information available at www.cryptopp.com"
VALUE "CompanyName", "Wei Dai"
VALUE "CompanyName", "Crypto++<2B> project"
VALUE "FileDescription", "Crypto++<2B> Library DLL"
VALUE "FileVersion", "7, 0, 0, 0"
VALUE "FileVersion", "8, 7, 0, 0"
VALUE "InternalName", "cryptopp"
VALUE "LegalCopyright", "Copyright<68> 1995-2018 by Wei Dai"
VALUE "LegalCopyright", "Copyright<68> 1995-2021 by Wei Dai"
VALUE "LegalTrademarks", "Crypto++<2B>"
VALUE "OriginalFilename", "cryptopp.dll"
VALUE "ProductName", "Crypto++<2B> Library"
VALUE "ProductVersion", "7, 0, 0, 0"
VALUE "ProductVersion", "8, 7, 0, 0"
END
END
BLOCK "VarFileInfo"
@ -61,7 +61,6 @@ BEGIN
END
END
#ifdef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
@ -90,15 +89,11 @@ END
#endif // English (U.S.) resources
/////////////////////////////////////////////////////////////////////////////
#ifndef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 3 resource.
//
/////////////////////////////////////////////////////////////////////////////
#endif // not APSTUDIO_INVOKED

View File

@ -0,0 +1,236 @@
// darn.cpp - written and placed in public domain by Jeffrey Walton
#include "pch.h"
#include "config.h"
#include "cryptlib.h"
#include "secblock.h"
#include "darn.h"
#include "cpu.h"
// At the moment only GCC 7.0 (and above) seems to support __builtin_darn()
// and __builtin_darn_32(). Clang 7.0 does not provide them, but it does
// support assembly instructions. XLC is unknown, but there are no hits when
// searching IBM's site. To cover more platforms we provide GCC inline
// assembly like we do with RDRAND and RDSEED. Platforms that don't support
// GCC inline assembly or the builtin will fail the compile.
// Inline assembler available in GCC 3.2 or above. For practical
// purposes we check for GCC 4.0 or above. GCC impostors claim
// to be GCC 4.2.1 so it will capture them, too. We exclude the
// Apple machines because they are not Power9 and use a slightly
// different syntax in their assembler.
#if ((__GNUC__ >= 4) || defined(__IBM_GCC_ASM)) && !defined(__APPLE__)
# define GCC_DARN_ASM_AVAILABLE 1
#endif
// warning C4702: unreachable code
#if CRYPTOPP_MSC_VERSION
# pragma warning(disable: 4702)
#endif
/////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////
NAMESPACE_BEGIN(CryptoPP)
#if (CRYPTOPP_BOOL_PPC32 || CRYPTOPP_BOOL_PPC64)
// *************************** 32-bit *************************** //
#if (CRYPTOPP_BOOL_PPC32)
// Fills 4 bytes, buffer must be aligned
inline void DARN32(void* output)
{
CRYPTOPP_ASSERT(IsAlignedOn(output, GetAlignmentOf<word32>()));
word32* ptr = reinterpret_cast<word32*>(output);
#if defined(GCC_DARN_ASM_AVAILABLE)
// This is "darn r3, 0". When L=0 a 32-bit conditioned word
// is returned. On failure 0xffffffffffffffff is returned.
// The Power manual recommends only checking the low 32-bit
// word for this case. See Power ISA 3.0 specification, p. 78.
do
{
__asm__ __volatile__ (
#if (CRYPTOPP_BIG_ENDIAN)
".byte 0x7c, 0x60, 0x05, 0xe6 \n\t" // r3 = darn 3, 0
"mr %0, 3 \n\t" // val = r3
#else
".byte 0xe6, 0x05, 0x60, 0x7c \n\t" // r3 = darn 3, 0
"mr %0, 3 \n\t" // val = r3
#endif
: "=r" (*ptr) : : "r3"
);
} while (*ptr == 0xFFFFFFFFu);
#elif defined(_ARCH_PWR9)
// This is probably going to break some platforms.
// We will deal with them as we encounter them.
*ptr = __builtin_darn_32();
#elif defined(__APPLE__)
// Nop. Apple G4 and G5 machines are too old. They will
// avoid this code path because HasPower9() returns false.
CRYPTOPP_ASSERT(0);
#else
// Catch other compile breaks
int XXX[-1];
#endif
}
#endif // PPC32
// *************************** 64-bit *************************** //
#if (CRYPTOPP_BOOL_PPC64)
// Fills 8 bytes, buffer must be aligned
inline void DARN64(void* output)
{
CRYPTOPP_ASSERT(IsAlignedOn(output, GetAlignmentOf<word64>()));
word64* ptr = reinterpret_cast<word64*>(output);
#if defined(GCC_DARN_ASM_AVAILABLE)
// This is "darn r3, 1". When L=1 a 64-bit conditioned word
// is returned. On failure 0xffffffffffffffff is returned.
// See Power ISA 3.0 specification, p. 78.
do
{
__asm__ __volatile__ (
#if (CRYPTOPP_BIG_ENDIAN)
".byte 0x7c, 0x61, 0x05, 0xe6 \n\t" // r3 = darn 3, 1
"mr %0, 3 \n\t" // val = r3
#else
".byte 0xe6, 0x05, 0x61, 0x7c \n\t" // r3 = darn 3, 1
"mr %0, 3 \n\t" // val = r3
#endif
: "=r" (*ptr) : : "r3"
);
} while (*ptr == 0xFFFFFFFFFFFFFFFFull);
#elif defined(_ARCH_PWR9)
// This is probably going to break some platforms.
// We will deal with them as we encounter them.
*ptr = __builtin_darn();
#elif defined(__APPLE__)
// Nop. Apple G4 and G5 machines are too old. They will
// avoid this code path because HasPower9() returns false.
CRYPTOPP_ASSERT(0);
#else
// Catch other compile breaks
int XXX[-1];
#endif
}
#endif // PPC64
// ************************ Standard C++ ************************ //
DARN::DARN()
{
if (!HasDARN())
throw DARN_Err("HasDARN");
// Scratch buffer in case user buffers are unaligned.
m_temp.New(8);
}
void DARN::GenerateBlock(byte *output, size_t size)
{
CRYPTOPP_ASSERT((output && size) || !(output || size));
if (size == 0) return;
size_t i = 0;
#if (CRYPTOPP_BOOL_PPC64)
// Check alignment
i = reinterpret_cast<uintptr_t>(output) & 0x7;
if (i != 0)
{
DARN64(m_temp);
std::memcpy(output, m_temp, i);
output += i;
size -= i;
}
// Output is aligned
for (i = 0; i < size/8; i++)
DARN64(output+i*8);
output += i*8;
size -= i*8;
if (size)
{
DARN64(m_temp);
std::memcpy(output, m_temp, size);
}
#elif (CRYPTOPP_BOOL_PPC32)
// Check alignment
i = reinterpret_cast<uintptr_t>(output) & 0x3;
if (i != 0)
{
DARN32(m_temp);
std::memcpy(output, m_temp, i);
output += i;
size -= i;
}
// Output is aligned
for (i = 0; i < size/4; i++)
DARN32(output+i*4);
output += i*4;
size -= i*4;
if (size)
{
DARN32(m_temp);
std::memcpy(output, m_temp, size);
}
#else
// No suitable compiler found
CRYPTOPP_UNUSED(output);
throw NotImplemented("DARN: failed to find a suitable implementation");
#endif
}
void DARN::DiscardBytes(size_t n)
{
// RoundUpToMultipleOf is used because a full word is read, and its cheaper
// to discard full words. There's no sense in dealing with tail bytes.
FixedSizeSecBlock<word64, 16> discard;
n = RoundUpToMultipleOf(n, sizeof(word64));
size_t count = STDMIN(n, discard.SizeInBytes());
while (count)
{
GenerateBlock(discard.BytePtr(), count);
n -= count;
count = STDMIN(n, discard.SizeInBytes());
}
}
#else // not PPC32 or PPC64
DARN::DARN()
{
throw DARN_Err("HasDARN");
}
void DARN::GenerateBlock(byte *output, size_t size)
{
// Constructor will throw, should not get here
CRYPTOPP_UNUSED(output); CRYPTOPP_UNUSED(size);
}
void DARN::DiscardBytes(size_t n)
{
// Constructor will throw, should not get here
CRYPTOPP_UNUSED(n);
}
#endif // PPC32 or PPC64
NAMESPACE_END

View File

@ -0,0 +1,95 @@
// darn.h - written and placed in public domain by Jeffrey Walton
// DARN requires POWER9/ISA 3.0.
// At the moment only GCC 7.0 (and above) seems to support __builtin_darn()
// and __builtin_darn_32(). However, GCC generates incorrect code. Clang 7.0
// does not provide them, but it does support assembly instructions. XLC is
// unknown, but there are no hits when searching IBM's site. To cover more
// platforms we provide GCC inline assembly like we do with RDRAND and RDSEED.
// Platforms that don't support GCC inline assembly or the builtin will fail
// to compile. Also see https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91481 and
// https://gcc.gnu.org/onlinedocs/gcc/Basic-PowerPC-Built-in-Functions-Available-on-ISA-3_002e0.html
/// \file darn.h
/// \brief Classes for DARN RNG
/// \sa <A HREF="https://openpowerfoundation.org/?resource_lib=power-isa-version-3-0">Power
/// ISA Version 3.0B</A>
/// \since Crypto++ 8.0
#ifndef CRYPTOPP_DARN_H
#define CRYPTOPP_DARN_H
#include "cryptlib.h"
NAMESPACE_BEGIN(CryptoPP)
/// \brief Exception thrown when a DARN generator encounters
/// a generator related error.
/// \since Crypto++ 8.0
class DARN_Err : public Exception
{
public:
DARN_Err(const std::string &operation)
: Exception(OTHER_ERROR, "DARN: " + operation + " operation failed") {}
};
/// \brief Hardware generated random numbers using DARN instruction
/// \details DARN() provides access to Power9's random number generator. The
/// Crypto++ implementation provides conditioned random numbers from the
/// generator as opposed to raw random numbers. According to Power ISA 3.0B
/// manual, a conditioned random number has been processed by hardware to
/// reduce bias. A raw random number is unconditioned noise source output.
/// \details According to Power ISA 3.0B manual, the random number generator
/// provided by the <tt>darn</tt> instruction is NIST SP800-90B and SP800-90C
/// compliant to the extent possible given the completeness of the standards
/// at the time the hardware is designed. The random number generator provides
/// a minimum of 0.5 bits of entropy per bit.
/// \par Wraps
/// darn instruction
/// \sa <A HREF="https://openpowerfoundation.org/?resource_lib=power-isa-version-3-0">Power
/// ISA Version 3.0B</A>, MaurerRandomnessTest() for random bit generators
/// \since Crypto++ 8.0
class DARN : public RandomNumberGenerator
{
public:
CRYPTOPP_STATIC_CONSTEXPR const char* StaticAlgorithmName() { return "DARN"; }
virtual ~DARN() {}
/// \brief Construct a DARN generator
/// \throw DARN_Err if the random number generator is not available
DARN();
/// \brief Generate random array of bytes
/// \param output the byte buffer
/// \param size the length of the buffer, in bytes
virtual void GenerateBlock(byte *output, size_t size);
/// \brief Generate and discard n bytes
/// \param n the number of bytes to generate and discard
/// \details the RDSEED generator discards words, not bytes. If n is
/// not a multiple of a machine word, then it is rounded up to
/// that size.
virtual void DiscardBytes(size_t n);
/// \brief Update RNG state with additional unpredictable values
/// \param input unused
/// \param length unused
/// \details The operation is a nop for this generator.
virtual void IncorporateEntropy(const byte *input, size_t length)
{
// Override to avoid the base class' throw.
CRYPTOPP_UNUSED(input); CRYPTOPP_UNUSED(length);
}
std::string AlgorithmProvider() const {
return "Power9";
}
private:
SecBlock<byte, AllocatorWithCleanup<byte, true> > m_temp;
};
NAMESPACE_END
#endif // CRYPTOPP_DARN_H

File diff suppressed because it is too large Load Diff

View File

@ -19,7 +19,7 @@
NAMESPACE_BEGIN(CryptoPP)
// The purpose of this function Mash() is to take an arbitrary length input
// string and *deterministicly* produce an arbitrary length output string such
// string and *deterministically* produce an arbitrary length output string such
// that (1) it looks random, (2) no information about the input is
// deducible from it, and (3) it contains as much entropy as it can hold, or
// the amount of entropy in the input string, whichever is smaller.
@ -28,7 +28,7 @@ template <class H>
static void Mash(const byte *in, size_t inLen, byte *out, size_t outLen, int iterations)
{
if (BytePrecision(outLen) > 2)
throw InvalidArgument("Mash: output legnth too large");
throw InvalidArgument("Mash: output length too large");
size_t bufSize = RoundUpToMultipleOf(outLen, (size_t)H::DIGESTSIZE);
byte b[2];
@ -73,8 +73,8 @@ static void GenerateKeyIV(const byte *passphrase, size_t passphraseLength, const
memcpy(temp+passphraseLength, salt, saltLength);
// OK. Derived params, cannot be NULL
SecByteBlock keyIV(Info::KEYLENGTH+Info::BLOCKSIZE);
Mash<H>(temp, passphraseLength + saltLength, keyIV, Info::KEYLENGTH+Info::BLOCKSIZE, iterations);
SecByteBlock keyIV(EnumToInt(Info::KEYLENGTH)+EnumToInt(+Info::BLOCKSIZE));
Mash<H>(temp, passphraseLength + saltLength, keyIV, EnumToInt(Info::KEYLENGTH)+EnumToInt(+Info::BLOCKSIZE), iterations);
memcpy(key, keyIV, Info::KEYLENGTH);
memcpy(IV, keyIV+Info::KEYLENGTH, Info::BLOCKSIZE);
}
@ -140,7 +140,7 @@ void DataEncryptor<BC,H,Info>::LastPut(const byte *inString, size_t length)
template <class BC, class H, class Info>
DataDecryptor<BC,H,Info>::DataDecryptor(const char *p, BufferedTransformation *attachment, bool throwException)
: ProxyFilter(NULLPTR, SALTLENGTH+BLOCKSIZE, 0, attachment)
: ProxyFilter(NULLPTR, EnumToInt(SALTLENGTH)+EnumToInt(BLOCKSIZE), 0, attachment)
, m_state(WAITING_FOR_KEYCHECK)
, m_passphrase((const byte *)p, strlen(p))
, m_throwException(throwException)
@ -151,7 +151,7 @@ DataDecryptor<BC,H,Info>::DataDecryptor(const char *p, BufferedTransformation *a
template <class BC, class H, class Info>
DataDecryptor<BC,H,Info>::DataDecryptor(const byte *passphrase, size_t passphraseLength, BufferedTransformation *attachment, bool throwException)
: ProxyFilter(NULLPTR, SALTLENGTH+BLOCKSIZE, 0, attachment)
: ProxyFilter(NULLPTR, EnumToInt(SALTLENGTH)+EnumToInt(BLOCKSIZE), 0, attachment)
, m_state(WAITING_FOR_KEYCHECK)
, m_passphrase(passphrase, passphraseLength)
, m_throwException(throwException)
@ -202,11 +202,11 @@ void DataDecryptor<BC,H,Info>::CheckKey(const byte *salt, const byte *keyCheck)
decryptor->Put(keyCheck, BLOCKSIZE);
decryptor->ForceNextPut();
decryptor->Get(check+BLOCKSIZE, BLOCKSIZE);
decryptor->Get(check+EnumToInt(BLOCKSIZE), BLOCKSIZE);
SetFilter(decryptor.release());
if (!VerifyBufsEqual(check, check+BLOCKSIZE, BLOCKSIZE))
if (!VerifyBufsEqual(check, check+EnumToInt(BLOCKSIZE), BLOCKSIZE))
{
m_state = KEY_BAD;
if (m_throwException)
@ -299,8 +299,8 @@ template class DataEncryptor<LegacyBlockCipher,LegacyHashModule,LegacyParameters
template class DataDecryptor<LegacyBlockCipher,LegacyHashModule,LegacyParametersInfo>;
template class DataEncryptor<DefaultBlockCipher,DefaultHashModule,DefaultParametersInfo>;
template class DataDecryptor<DefaultBlockCipher,DefaultHashModule,DefaultParametersInfo>;
template class DataEncryptorWithMAC<LegacyBlockCipher,LegacyHashModule,DefaultMAC,LegacyParametersInfo>;
template class DataDecryptorWithMAC<LegacyBlockCipher,LegacyHashModule,DefaultMAC,LegacyParametersInfo>;
template class DataEncryptorWithMAC<LegacyBlockCipher,LegacyHashModule,LegacyMAC,LegacyParametersInfo>;
template class DataDecryptorWithMAC<LegacyBlockCipher,LegacyHashModule,LegacyMAC,LegacyParametersInfo>;
template class DataEncryptorWithMAC<DefaultBlockCipher,DefaultHashModule,DefaultMAC,DefaultParametersInfo>;
template class DataDecryptorWithMAC<DefaultBlockCipher,DefaultHashModule,DefaultMAC,DefaultParametersInfo>;

View File

@ -56,11 +56,11 @@ class MACBadErr : public DataDecryptorErr
template <unsigned int BlockSize, unsigned int KeyLength, unsigned int DigestSize, unsigned int SaltSize, unsigned int Iterations>
struct DataParametersInfo
{
CRYPTOPP_CONSTANT(BLOCKSIZE = BlockSize)
CRYPTOPP_CONSTANT(KEYLENGTH = KeyLength)
CRYPTOPP_CONSTANT(SALTLENGTH = SaltSize)
CRYPTOPP_CONSTANT(DIGESTSIZE = DigestSize)
CRYPTOPP_CONSTANT(ITERATIONS = Iterations)
CRYPTOPP_CONSTANT(BLOCKSIZE = BlockSize);
CRYPTOPP_CONSTANT(KEYLENGTH = KeyLength);
CRYPTOPP_CONSTANT(SALTLENGTH = SaltSize);
CRYPTOPP_CONSTANT(DIGESTSIZE = DigestSize);
CRYPTOPP_CONSTANT(ITERATIONS = Iterations);
};
typedef DataParametersInfo<LegacyBlockCipher::BLOCKSIZE, LegacyBlockCipher::DEFAULT_KEYLENGTH, LegacyHashModule::DIGESTSIZE, 8, 200> LegacyParametersInfo;
@ -78,11 +78,11 @@ template <class BC, class H, class Info>
class DataEncryptor : public ProxyFilter, public Info
{
public:
CRYPTOPP_CONSTANT(BLOCKSIZE = Info::BLOCKSIZE)
CRYPTOPP_CONSTANT(KEYLENGTH = Info::KEYLENGTH)
CRYPTOPP_CONSTANT(SALTLENGTH = Info::SALTLENGTH)
CRYPTOPP_CONSTANT(DIGESTSIZE = Info::DIGESTSIZE)
CRYPTOPP_CONSTANT(ITERATIONS = Info::ITERATIONS)
CRYPTOPP_CONSTANT(BLOCKSIZE = Info::BLOCKSIZE);
CRYPTOPP_CONSTANT(KEYLENGTH = Info::KEYLENGTH);
CRYPTOPP_CONSTANT(SALTLENGTH = Info::SALTLENGTH);
CRYPTOPP_CONSTANT(DIGESTSIZE = Info::DIGESTSIZE);
CRYPTOPP_CONSTANT(ITERATIONS = Info::ITERATIONS);
/// \brief Construct a DataEncryptor
/// \param passphrase a C-String password
@ -116,23 +116,23 @@ template <class BC, class H, class Info>
class DataDecryptor : public ProxyFilter, public Info
{
public:
CRYPTOPP_CONSTANT(BLOCKSIZE = Info::BLOCKSIZE)
CRYPTOPP_CONSTANT(KEYLENGTH = Info::KEYLENGTH)
CRYPTOPP_CONSTANT(SALTLENGTH = Info::SALTLENGTH)
CRYPTOPP_CONSTANT(DIGESTSIZE = Info::DIGESTSIZE)
CRYPTOPP_CONSTANT(ITERATIONS = Info::ITERATIONS)
CRYPTOPP_CONSTANT(BLOCKSIZE = Info::BLOCKSIZE);
CRYPTOPP_CONSTANT(KEYLENGTH = Info::KEYLENGTH);
CRYPTOPP_CONSTANT(SALTLENGTH = Info::SALTLENGTH);
CRYPTOPP_CONSTANT(DIGESTSIZE = Info::DIGESTSIZE);
CRYPTOPP_CONSTANT(ITERATIONS = Info::ITERATIONS);
/// \brief Constructs a DataDecryptor
/// \param passphrase a C-String password
/// \param attachment a BufferedTransformation to attach to this object
/// \param throwException a flag specifiying whether an Exception should be thrown on error
/// \param throwException a flag specifying whether an Exception should be thrown on error
DataDecryptor(const char *passphrase, BufferedTransformation *attachment = NULLPTR, bool throwException=true);
/// \brief Constructs a DataDecryptor
/// \param passphrase a byte string password
/// \param passphraseLength the length of the byte string password
/// \param attachment a BufferedTransformation to attach to this object
/// \param throwException a flag specifiying whether an Exception should be thrown on error
/// \param throwException a flag specifying whether an Exception should be thrown on error
DataDecryptor(const byte *passphrase, size_t passphraseLength, BufferedTransformation *attachment = NULLPTR, bool throwException=true);
enum State {WAITING_FOR_KEYCHECK, KEY_GOOD, KEY_BAD};
@ -173,11 +173,11 @@ template <class BC, class H, class MAC, class Info>
class DataEncryptorWithMAC : public ProxyFilter
{
public:
CRYPTOPP_CONSTANT(BLOCKSIZE = Info::BLOCKSIZE)
CRYPTOPP_CONSTANT(KEYLENGTH = Info::KEYLENGTH)
CRYPTOPP_CONSTANT(SALTLENGTH = Info::SALTLENGTH)
CRYPTOPP_CONSTANT(DIGESTSIZE = Info::DIGESTSIZE)
CRYPTOPP_CONSTANT(ITERATIONS = Info::ITERATIONS)
CRYPTOPP_CONSTANT(BLOCKSIZE = Info::BLOCKSIZE);
CRYPTOPP_CONSTANT(KEYLENGTH = Info::KEYLENGTH);
CRYPTOPP_CONSTANT(SALTLENGTH = Info::SALTLENGTH);
CRYPTOPP_CONSTANT(DIGESTSIZE = Info::DIGESTSIZE);
CRYPTOPP_CONSTANT(ITERATIONS = Info::ITERATIONS);
/// \brief Constructs a DataEncryptorWithMAC
/// \param passphrase a C-String password
@ -218,23 +218,23 @@ template <class BC, class H, class MAC, class Info>
class DataDecryptorWithMAC : public ProxyFilter
{
public:
CRYPTOPP_CONSTANT(BLOCKSIZE = Info::BLOCKSIZE)
CRYPTOPP_CONSTANT(KEYLENGTH = Info::KEYLENGTH)
CRYPTOPP_CONSTANT(SALTLENGTH = Info::SALTLENGTH)
CRYPTOPP_CONSTANT(DIGESTSIZE = Info::DIGESTSIZE)
CRYPTOPP_CONSTANT(ITERATIONS = Info::ITERATIONS)
CRYPTOPP_CONSTANT(BLOCKSIZE = Info::BLOCKSIZE);
CRYPTOPP_CONSTANT(KEYLENGTH = Info::KEYLENGTH);
CRYPTOPP_CONSTANT(SALTLENGTH = Info::SALTLENGTH);
CRYPTOPP_CONSTANT(DIGESTSIZE = Info::DIGESTSIZE);
CRYPTOPP_CONSTANT(ITERATIONS = Info::ITERATIONS);
/// \brief Constructs a DataDecryptor
/// \param passphrase a C-String password
/// \param attachment a BufferedTransformation to attach to this object
/// \param throwException a flag specifiying whether an Exception should be thrown on error
/// \param throwException a flag specifying whether an Exception should be thrown on error
DataDecryptorWithMAC(const char *passphrase, BufferedTransformation *attachment = NULLPTR, bool throwException=true);
/// \brief Constructs a DataDecryptor
/// \param passphrase a byte string password
/// \param passphraseLength the length of the byte string password
/// \param attachment a BufferedTransformation to attach to this object
/// \param throwException a flag specifiying whether an Exception should be thrown on error
/// \param throwException a flag specifying whether an Exception should be thrown on error
DataDecryptorWithMAC(const byte *passphrase, size_t passphraseLength, BufferedTransformation *attachment = NULLPTR, bool throwException=true);
typename DataDecryptor<BC,H,Info>::State CurrentState() const;
@ -275,12 +275,12 @@ struct DefaultDecryptor : public DataDecryptor<DefaultBlockCipher,DefaultHashMod
/// \details Crypto++ 5.6.5 and earlier used the legacy algorithms, including DES_EDE2 and SHA1.
/// Crypto++ 5.7 switched to AES and SHA256. The updated algorithms are available with the
/// <tt>Default*</tt> classes, and the old algorithms are available with the <tt>Legacy*</tt> classes.
struct LegacyEncryptorWithMAC : public DataEncryptorWithMAC<LegacyBlockCipher,LegacyHashModule,DefaultMAC,LegacyParametersInfo> {};
struct LegacyEncryptorWithMAC : public DataEncryptorWithMAC<LegacyBlockCipher,LegacyHashModule,LegacyMAC,LegacyParametersInfo> {};
/// \brief Password-based decryptor with MAC (deprecated)
/// \details Crypto++ 5.6.5 and earlier used the legacy algorithms, including DES_EDE2 and SHA1.
/// Crypto++ 5.7 switched to AES and SHA256. The updated algorithms are available with the
/// <tt>Default*</tt> classes, and the old algorithms are available with the <tt>Legacy*</tt> classes.
struct LegacyDecryptorWithMAC : public DataDecryptorWithMAC<LegacyBlockCipher,LegacyHashModule,DefaultMAC,LegacyParametersInfo> {};
struct LegacyDecryptorWithMAC : public DataDecryptorWithMAC<LegacyBlockCipher,LegacyHashModule,LegacyMAC,LegacyParametersInfo> {};
/// \brief Password-based encryptor with MAC
/// \details Crypto++ 5.6.5 and earlier used the legacy algorithms, including DES_EDE2 and SHA1.
/// Crypto++ 5.7 switched to AES and SHA256. The updated algorithms are available with the
@ -298,8 +298,8 @@ typedef DataDecryptor<LegacyBlockCipher,LegacyHashModule,LegacyParametersInfo> L
typedef DataEncryptor<DefaultBlockCipher,DefaultHashModule,DefaultParametersInfo> DefaultEncryptor;
typedef DataDecryptor<DefaultBlockCipher,DefaultHashModule,DefaultParametersInfo> DefaultDecryptor;
typedef DataEncryptorWithMAC<LegacyBlockCipher,LegacyHashModule,DefaultMAC,LegacyParametersInfo> LegacyEncryptorWithMAC;
typedef DataDecryptorWithMAC<LegacyBlockCipher,LegacyHashModule,DefaultMAC,LegacyParametersInfo> LegacyDecryptorWithMAC;
typedef DataEncryptorWithMAC<LegacyBlockCipher,LegacyHashModule,LegacyMAC,LegacyParametersInfo> LegacyEncryptorWithMAC;
typedef DataDecryptorWithMAC<LegacyBlockCipher,LegacyHashModule,LegacyMAC,LegacyParametersInfo> LegacyDecryptorWithMAC;
typedef DataEncryptorWithMAC<DefaultBlockCipher,DefaultHashModule,DefaultMAC,DefaultParametersInfo> DefaultEncryptorWithMAC;
typedef DataDecryptorWithMAC<DefaultBlockCipher,DefaultHashModule,DefaultMAC,DefaultParametersInfo> DefaultDecryptorWithMAC;

View File

@ -284,14 +284,16 @@ namespace {
void RawDES::RawSetKey(CipherDir dir, const byte *key)
{
#if (_MSC_VER >= 1600) || (__cplusplus >= 201103L)
# define register /* Define to nothing for C++11 and above */
# define REGISTER /* Define to nothing for C++11 and above */
#else
# define REGISTER register
#endif
SecByteBlock buffer(56+56+8);
byte *const pc1m=buffer; /* place to modify pc1 into */
byte *const pcr=pc1m+56; /* place to rotate pc1 into */
byte *const ks=pcr+56;
register int i,j,l;
REGISTER int i,j,l;
int m;
for (j=0; j<56; j++) { /* convert pc1 to bits of key */

Some files were not shown because too many files have changed in this diff Show More