diff options
Diffstat (limited to 'games')
79 files changed, 10937 insertions, 1115 deletions
diff --git a/games/Makefile b/games/Makefile index 6673cb615ead..aba48ab1d7c5 100644 --- a/games/Makefile +++ b/games/Makefile @@ -643,7 +643,6 @@ SUBDIR += moonlight-embedded-devel SUBDIR += moonlight-qt SUBDIR += moria - SUBDIR += motogt SUBDIR += mrboom SUBDIR += mt_dolphin_ia SUBDIR += mt_gtk_client @@ -754,7 +753,6 @@ SUBDIR += pachi SUBDIR += pacmanarena SUBDIR += palapeli - SUBDIR += palomino SUBDIR += pangzero SUBDIR += passage SUBDIR += patapizza-tetris diff --git a/games/ags/Makefile b/games/ags/Makefile index 94b5dc37b8f3..cda3f7ec6e36 100644 --- a/games/ags/Makefile +++ b/games/ags/Makefile @@ -1,9 +1,12 @@ PORTNAME= ags -DISTVERSION= 3.6.2.12 +DISTVERSION= 3.6.2.13 CATEGORIES= games MASTER_SITES= https://github.com/adventuregamestudio/ags/releases/download/v${PORTVERSION}/ DISTNAME= ags_${DISTVERSION}_source +PATCH_SITES= https://github.com/adventuregamestudio/ags/commit/ +PATCHFILES+= 898533ec0ef974155f882c124acaf036b9591805.patch:-p1 #Fix build on 32-bit + MAINTAINER= jhale@FreeBSD.org COMMENT= Adventure Game Studio Engine WWW= https://www.adventuregamestudio.co.uk/ diff --git a/games/ags/distinfo b/games/ags/distinfo index 9c1bd2b22937..858cb7363fcb 100644 --- a/games/ags/distinfo +++ b/games/ags/distinfo @@ -1,3 +1,5 @@ -TIMESTAMP = 1756949576 -SHA256 (ags_3.6.2.12_source.tar.xz) = ef9b0d4c71b3f43dcaf1ebd73433840abdb3af4dd77d1bb3b1f62fe4b150eedc -SIZE (ags_3.6.2.12_source.tar.xz) = 6357360 +TIMESTAMP = 1757750239 +SHA256 (ags_3.6.2.13_source.tar.xz) = cd6ddee584bacf0f3b0409ac325a738610a4d295db3d258878e7665c03dc3079 +SIZE (ags_3.6.2.13_source.tar.xz) = 6373024 +SHA256 (898533ec0ef974155f882c124acaf036b9591805.patch) = 9877257bd2f6c35872049f5ac429e519ed54f0bc7feb01f9f7ac52cdd00cffcd +SIZE (898533ec0ef974155f882c124acaf036b9591805.patch) = 5533 diff --git a/games/blinken/distinfo b/games/blinken/distinfo index 86f99de9ef9e..7e9c9ff36d35 100644 --- a/games/blinken/distinfo +++ b/games/blinken/distinfo @@ -1,3 +1,3 @@ -TIMESTAMP = 1754646248 -SHA256 (KDE/release-service/25.08.0/blinken-25.08.0.tar.xz) = 659bc69e811c7247e801c0696066bfb8cc9f70e223f401a58b08bb6bd83d35a4 -SIZE (KDE/release-service/25.08.0/blinken-25.08.0.tar.xz) = 2715268 +TIMESTAMP = 1757409962 +SHA256 (KDE/release-service/25.08.1/blinken-25.08.1.tar.xz) = df9268b8a3c19e571c49a16d2a0df9af834467861461d33894f0a777533e6c4b +SIZE (KDE/release-service/25.08.1/blinken-25.08.1.tar.xz) = 2715220 diff --git a/games/bomber/distinfo b/games/bomber/distinfo index c9e201716fb2..e2a4f8b39001 100644 --- a/games/bomber/distinfo +++ b/games/bomber/distinfo @@ -1,3 +1,3 @@ -TIMESTAMP = 1754646251 -SHA256 (KDE/release-service/25.08.0/bomber-25.08.0.tar.xz) = 2f202b36ce307bac95cd34204baf465c5989787a081bdb10f029452dc08fb51d -SIZE (KDE/release-service/25.08.0/bomber-25.08.0.tar.xz) = 840952 +TIMESTAMP = 1757409964 +SHA256 (KDE/release-service/25.08.1/bomber-25.08.1.tar.xz) = c03c103050f75ae9acdd4e56b9580fd35c71b714c9a6d90124d7eb3938c5cbec +SIZE (KDE/release-service/25.08.1/bomber-25.08.1.tar.xz) = 841184 diff --git a/games/bovo/distinfo b/games/bovo/distinfo index ec035dc47988..f2c463a43dab 100644 --- a/games/bovo/distinfo +++ b/games/bovo/distinfo @@ -1,3 +1,3 @@ -TIMESTAMP = 1754646253 -SHA256 (KDE/release-service/25.08.0/bovo-25.08.0.tar.xz) = 3d1c143cae6ece288de8ae42899a962c9a3d4c454056f74bc9228351d77acc26 -SIZE (KDE/release-service/25.08.0/bovo-25.08.0.tar.xz) = 221712 +TIMESTAMP = 1757409966 +SHA256 (KDE/release-service/25.08.1/bovo-25.08.1.tar.xz) = bf11ecff6f754a482042ce5f2071c237f3a292f62fd200ceebcf6141f43e66dd +SIZE (KDE/release-service/25.08.1/bovo-25.08.1.tar.xz) = 221580 diff --git a/games/granatier/distinfo b/games/granatier/distinfo index 13117a1e26a8..0c0c52f84d18 100644 --- a/games/granatier/distinfo +++ b/games/granatier/distinfo @@ -1,3 +1,3 @@ -TIMESTAMP = 1754646255 -SHA256 (KDE/release-service/25.08.0/granatier-25.08.0.tar.xz) = b4d63b24e7932b5d0249296abacc6574865e5e05866d8ee8b63dc11d4fc6c0a3 -SIZE (KDE/release-service/25.08.0/granatier-25.08.0.tar.xz) = 2017328 +TIMESTAMP = 1757409969 +SHA256 (KDE/release-service/25.08.1/granatier-25.08.1.tar.xz) = c63b42ef9a3e9ecc2427d0af6e5eb4327943aeeb299f303967b5b1dd09066786 +SIZE (KDE/release-service/25.08.1/granatier-25.08.1.tar.xz) = 2017068 diff --git a/games/kajongg/distinfo b/games/kajongg/distinfo index 804d50590052..7b26b71961d4 100644 --- a/games/kajongg/distinfo +++ b/games/kajongg/distinfo @@ -1,3 +1,3 @@ -TIMESTAMP = 1754646258 -SHA256 (KDE/release-service/25.08.0/kajongg-25.08.0.tar.xz) = 1cb6f955af0b5e8adab29677758838d028b2b702a7cff43dbd4b2275a7bc6cef -SIZE (KDE/release-service/25.08.0/kajongg-25.08.0.tar.xz) = 4637752 +TIMESTAMP = 1757409971 +SHA256 (KDE/release-service/25.08.1/kajongg-25.08.1.tar.xz) = 273020997ee5d4fa97d05b70fcdf31a68a4a3be178fc11ae838fdc044e79f6e9 +SIZE (KDE/release-service/25.08.1/kajongg-25.08.1.tar.xz) = 4637756 diff --git a/games/kanagram/distinfo b/games/kanagram/distinfo index 056aadede3b4..144212850740 100644 --- a/games/kanagram/distinfo +++ b/games/kanagram/distinfo @@ -1,3 +1,3 @@ -TIMESTAMP = 1754646260 -SHA256 (KDE/release-service/25.08.0/kanagram-25.08.0.tar.xz) = a8086e3f8a8a8faf40878d439aa754641444d93c8b0d0c529047530abdf46406 -SIZE (KDE/release-service/25.08.0/kanagram-25.08.0.tar.xz) = 7786668 +TIMESTAMP = 1757409973 +SHA256 (KDE/release-service/25.08.1/kanagram-25.08.1.tar.xz) = 439778c214366ea057fcca6379d070016a3120c7a81f685083fafaebd0fcae07 +SIZE (KDE/release-service/25.08.1/kanagram-25.08.1.tar.xz) = 7786680 diff --git a/games/kapman/distinfo b/games/kapman/distinfo index e1fd1f8e0b65..54a2221736df 100644 --- a/games/kapman/distinfo +++ b/games/kapman/distinfo @@ -1,3 +1,3 @@ -TIMESTAMP = 1754646263 -SHA256 (KDE/release-service/25.08.0/kapman-25.08.0.tar.xz) = 446d572dde99830778fb67eb8d178a54e48966446b30cda4accc8236428db290 -SIZE (KDE/release-service/25.08.0/kapman-25.08.0.tar.xz) = 2150084 +TIMESTAMP = 1757409976 +SHA256 (KDE/release-service/25.08.1/kapman-25.08.1.tar.xz) = 823d13689d9ec3ff5f992ff625d1fc6eb4812314830181a1703ed4591184755f +SIZE (KDE/release-service/25.08.1/kapman-25.08.1.tar.xz) = 2150108 diff --git a/games/katomic/distinfo b/games/katomic/distinfo index 55e11c23bfb4..824aa68d1736 100644 --- a/games/katomic/distinfo +++ b/games/katomic/distinfo @@ -1,3 +1,3 @@ -TIMESTAMP = 1754646265 -SHA256 (KDE/release-service/25.08.0/katomic-25.08.0.tar.xz) = d4894d6397e823551f87efad50a19624496c60e3d3e29becefaa27ac148c09a8 -SIZE (KDE/release-service/25.08.0/katomic-25.08.0.tar.xz) = 1450656 +TIMESTAMP = 1757409978 +SHA256 (KDE/release-service/25.08.1/katomic-25.08.1.tar.xz) = 425231cb5cb9047a7d7ec385b7158844914a37e0c00822bcba6e35784f17928a +SIZE (KDE/release-service/25.08.1/katomic-25.08.1.tar.xz) = 1450080 diff --git a/games/kblackbox/distinfo b/games/kblackbox/distinfo index 2a34765c71a3..0f970f034771 100644 --- a/games/kblackbox/distinfo +++ b/games/kblackbox/distinfo @@ -1,3 +1,3 @@ -TIMESTAMP = 1754646268 -SHA256 (KDE/release-service/25.08.0/kblackbox-25.08.0.tar.xz) = 4bd7698493e6d5b5f0fe2ab5135e9128cab0e93bd13132f90826d46bcc86139c -SIZE (KDE/release-service/25.08.0/kblackbox-25.08.0.tar.xz) = 556080 +TIMESTAMP = 1757409980 +SHA256 (KDE/release-service/25.08.1/kblackbox-25.08.1.tar.xz) = 586647919efc02402fec9ab7746a0a6433edbdc468bff89878d44c4607e69728 +SIZE (KDE/release-service/25.08.1/kblackbox-25.08.1.tar.xz) = 555972 diff --git a/games/kblocks/distinfo b/games/kblocks/distinfo index e53633036351..fdf5dcd4f10c 100644 --- a/games/kblocks/distinfo +++ b/games/kblocks/distinfo @@ -1,3 +1,3 @@ -TIMESTAMP = 1754646270 -SHA256 (KDE/release-service/25.08.0/kblocks-25.08.0.tar.xz) = 1bd3865b6c612fc312a6930c76274541bf4e092bf44023513d214a159fce6c96 -SIZE (KDE/release-service/25.08.0/kblocks-25.08.0.tar.xz) = 2104676 +TIMESTAMP = 1757409983 +SHA256 (KDE/release-service/25.08.1/kblocks-25.08.1.tar.xz) = 91e4d09a3f7af9d91e9974a416790200efc519f8da1347075e1d4a5cce8d4cff +SIZE (KDE/release-service/25.08.1/kblocks-25.08.1.tar.xz) = 2104104 diff --git a/games/kbounce/distinfo b/games/kbounce/distinfo index d208e2244ef5..a00c62a372ae 100644 --- a/games/kbounce/distinfo +++ b/games/kbounce/distinfo @@ -1,3 +1,3 @@ -TIMESTAMP = 1754646273 -SHA256 (KDE/release-service/25.08.0/kbounce-25.08.0.tar.xz) = 05a3c78e59c1cf05cf59721c97f4c3745bfec1c23fa9b5a475113264d608a176 -SIZE (KDE/release-service/25.08.0/kbounce-25.08.0.tar.xz) = 3325080 +TIMESTAMP = 1757409985 +SHA256 (KDE/release-service/25.08.1/kbounce-25.08.1.tar.xz) = c87ce4bae5e4742620e8480c4466da31a18d38fdc9865eb4dc13c28f03d499fa +SIZE (KDE/release-service/25.08.1/kbounce-25.08.1.tar.xz) = 3324056 diff --git a/games/kbreakout/distinfo b/games/kbreakout/distinfo index a75a3c161eb5..b7fc0cfbc102 100644 --- a/games/kbreakout/distinfo +++ b/games/kbreakout/distinfo @@ -1,3 +1,3 @@ -TIMESTAMP = 1754646275 -SHA256 (KDE/release-service/25.08.0/kbreakout-25.08.0.tar.xz) = 23f0cf5d1814bfb8f396a4d02973c1391a0ed4fe7f45bd91bcbdf5718dbb6ca7 -SIZE (KDE/release-service/25.08.0/kbreakout-25.08.0.tar.xz) = 2559404 +TIMESTAMP = 1757409987 +SHA256 (KDE/release-service/25.08.1/kbreakout-25.08.1.tar.xz) = f93f0e0e4fb8d7bc3a5108c193beaf78366be450422c94e5dd427f5f8f9ad2d5 +SIZE (KDE/release-service/25.08.1/kbreakout-25.08.1.tar.xz) = 2558864 diff --git a/games/kdiamond/distinfo b/games/kdiamond/distinfo index 931b2122199a..8d5f1d460048 100644 --- a/games/kdiamond/distinfo +++ b/games/kdiamond/distinfo @@ -1,3 +1,3 @@ -TIMESTAMP = 1754646277 -SHA256 (KDE/release-service/25.08.0/kdiamond-25.08.0.tar.xz) = b74e0e900da60556576133dda9ef80f10a572be21c0ce5da1772a4452044e204 -SIZE (KDE/release-service/25.08.0/kdiamond-25.08.0.tar.xz) = 4674524 +TIMESTAMP = 1757409990 +SHA256 (KDE/release-service/25.08.1/kdiamond-25.08.1.tar.xz) = 27753062d8808e4697a27f4478edb7efe49d16e5fecb32c971ab9f28937485d6 +SIZE (KDE/release-service/25.08.1/kdiamond-25.08.1.tar.xz) = 4674476 diff --git a/games/kfourinline/distinfo b/games/kfourinline/distinfo index b4681b364939..3db59c60eb89 100644 --- a/games/kfourinline/distinfo +++ b/games/kfourinline/distinfo @@ -1,3 +1,3 @@ -TIMESTAMP = 1754646280 -SHA256 (KDE/release-service/25.08.0/kfourinline-25.08.0.tar.xz) = 9c613dc7bb2ed9b33ba996b7e7e18a60c944877ae1dc9472237248735c014521 -SIZE (KDE/release-service/25.08.0/kfourinline-25.08.0.tar.xz) = 749184 +TIMESTAMP = 1757409992 +SHA256 (KDE/release-service/25.08.1/kfourinline-25.08.1.tar.xz) = 1a1d709012533f3eb74b7cd54821c5227d05484b1f0ef8cb6a0a48c257d20241 +SIZE (KDE/release-service/25.08.1/kfourinline-25.08.1.tar.xz) = 749000 diff --git a/games/kgoldrunner/distinfo b/games/kgoldrunner/distinfo index 275fb21dd2c6..43bb059d7876 100644 --- a/games/kgoldrunner/distinfo +++ b/games/kgoldrunner/distinfo @@ -1,3 +1,3 @@ -TIMESTAMP = 1754646282 -SHA256 (KDE/release-service/25.08.0/kgoldrunner-25.08.0.tar.xz) = 95dcd86e97ab768fcecedd5aa2d0c2a86a9d0b079430539878e11e151f9d32a4 -SIZE (KDE/release-service/25.08.0/kgoldrunner-25.08.0.tar.xz) = 4427464 +TIMESTAMP = 1757409994 +SHA256 (KDE/release-service/25.08.1/kgoldrunner-25.08.1.tar.xz) = 6207377fecbe302435c5f9426739e488c256b73a5f7be458be9a85461a43fd93 +SIZE (KDE/release-service/25.08.1/kgoldrunner-25.08.1.tar.xz) = 4465352 diff --git a/games/khangman/distinfo b/games/khangman/distinfo index e7b969a5f49d..9f3dee7912b7 100644 --- a/games/khangman/distinfo +++ b/games/khangman/distinfo @@ -1,3 +1,3 @@ -TIMESTAMP = 1754646285 -SHA256 (KDE/release-service/25.08.0/khangman-25.08.0.tar.xz) = 6e0395602370083082525717485fa1030ae7b4e31ecb97ad2035aa3c4788a890 -SIZE (KDE/release-service/25.08.0/khangman-25.08.0.tar.xz) = 7029828 +TIMESTAMP = 1757409997 +SHA256 (KDE/release-service/25.08.1/khangman-25.08.1.tar.xz) = dc47b788044366f1e7731caeac9b61c310db6ee7f63b737d3dfac6c612d5e543 +SIZE (KDE/release-service/25.08.1/khangman-25.08.1.tar.xz) = 7032236 diff --git a/games/kigo/distinfo b/games/kigo/distinfo index 21a64848315a..6cc4f75f4eac 100644 --- a/games/kigo/distinfo +++ b/games/kigo/distinfo @@ -1,3 +1,3 @@ -TIMESTAMP = 1754646287 -SHA256 (KDE/release-service/25.08.0/kigo-25.08.0.tar.xz) = a249d9108baba48130f9364f7574bc77c60b8c1d5b6d5a4e177e05924f0ee61b -SIZE (KDE/release-service/25.08.0/kigo-25.08.0.tar.xz) = 4837828 +TIMESTAMP = 1757409999 +SHA256 (KDE/release-service/25.08.1/kigo-25.08.1.tar.xz) = 999726b3d79393df6310feed0803f438a02f0faa39a909f5e558e0b8531054fd +SIZE (KDE/release-service/25.08.1/kigo-25.08.1.tar.xz) = 4837940 diff --git a/games/killbots/distinfo b/games/killbots/distinfo index 0fb654808c72..ef8e53dc0af8 100644 --- a/games/killbots/distinfo +++ b/games/killbots/distinfo @@ -1,3 +1,3 @@ -TIMESTAMP = 1754646290 -SHA256 (KDE/release-service/25.08.0/killbots-25.08.0.tar.xz) = 6eb10d09aeca3dd6fff4ddaaebe2c857a2b3b9187e1ad1f7a7b6d817d87c6d40 -SIZE (KDE/release-service/25.08.0/killbots-25.08.0.tar.xz) = 1178476 +TIMESTAMP = 1757410001 +SHA256 (KDE/release-service/25.08.1/killbots-25.08.1.tar.xz) = 68ee3abc0ff71a1cf21c545d6cf1f15c4f56b36d5e3671f956db15e84742379f +SIZE (KDE/release-service/25.08.1/killbots-25.08.1.tar.xz) = 1177444 diff --git a/games/kiriki/distinfo b/games/kiriki/distinfo index df183f333051..2d3679a550f7 100644 --- a/games/kiriki/distinfo +++ b/games/kiriki/distinfo @@ -1,3 +1,3 @@ -TIMESTAMP = 1754646292 -SHA256 (KDE/release-service/25.08.0/kiriki-25.08.0.tar.xz) = 73bd414144aed83981c3cb9be5bc4fab51a5a6e2bf26e1d1e58898bf6a5f38cd -SIZE (KDE/release-service/25.08.0/kiriki-25.08.0.tar.xz) = 376256 +TIMESTAMP = 1757410004 +SHA256 (KDE/release-service/25.08.1/kiriki-25.08.1.tar.xz) = 3aa01c2c1f138c85ef3303853399ac0505c3136ceb5b3deecda1a2a842c49145 +SIZE (KDE/release-service/25.08.1/kiriki-25.08.1.tar.xz) = 376228 diff --git a/games/kjumpingcube/distinfo b/games/kjumpingcube/distinfo index d2cce44b7d03..ad30d59a2823 100644 --- a/games/kjumpingcube/distinfo +++ b/games/kjumpingcube/distinfo @@ -1,3 +1,3 @@ -TIMESTAMP = 1754646294 -SHA256 (KDE/release-service/25.08.0/kjumpingcube-25.08.0.tar.xz) = 64a647d5643230c191152181edfaf71d77626305df5d557f0632dfc1140393db -SIZE (KDE/release-service/25.08.0/kjumpingcube-25.08.0.tar.xz) = 351356 +TIMESTAMP = 1757410006 +SHA256 (KDE/release-service/25.08.1/kjumpingcube-25.08.1.tar.xz) = 27d390a6952f9eb24fbcaae6a23ad9a33cba59e2e64c52f9afecdf2b5f4b238d +SIZE (KDE/release-service/25.08.1/kjumpingcube-25.08.1.tar.xz) = 351296 diff --git a/games/klickety/distinfo b/games/klickety/distinfo index 6bb297a6a97d..b946aedcfee4 100644 --- a/games/klickety/distinfo +++ b/games/klickety/distinfo @@ -1,3 +1,3 @@ -TIMESTAMP = 1754646297 -SHA256 (KDE/release-service/25.08.0/klickety-25.08.0.tar.xz) = 81183fb2f37e47fb68743194839cc2f6f3e4241296cc8dde786dc73a23982566 -SIZE (KDE/release-service/25.08.0/klickety-25.08.0.tar.xz) = 1390048 +TIMESTAMP = 1757410008 +SHA256 (KDE/release-service/25.08.1/klickety-25.08.1.tar.xz) = 80f257ab96fe95847ff463effe10d872a5bd5c96d54a8a0a09e357740ebcca43 +SIZE (KDE/release-service/25.08.1/klickety-25.08.1.tar.xz) = 1390108 diff --git a/games/klines/distinfo b/games/klines/distinfo index cc934a44930a..f7bd8991a37b 100644 --- a/games/klines/distinfo +++ b/games/klines/distinfo @@ -1,3 +1,3 @@ -TIMESTAMP = 1754646299 -SHA256 (KDE/release-service/25.08.0/klines-25.08.0.tar.xz) = b77b2459a5f4646439d0043e7d3b3d7cce41aeeffd567c86b9d8c325ba947420 -SIZE (KDE/release-service/25.08.0/klines-25.08.0.tar.xz) = 1674460 +TIMESTAMP = 1757410011 +SHA256 (KDE/release-service/25.08.1/klines-25.08.1.tar.xz) = 20a1c541f3c32a7b1f8a19ac579146eb3dff30bdf9761ff46a7da04de76d3442 +SIZE (KDE/release-service/25.08.1/klines-25.08.1.tar.xz) = 1675184 diff --git a/games/kmahjongg/distinfo b/games/kmahjongg/distinfo index 3bcc5a362cdb..828aa44294d8 100644 --- a/games/kmahjongg/distinfo +++ b/games/kmahjongg/distinfo @@ -1,3 +1,3 @@ -TIMESTAMP = 1754646302 -SHA256 (KDE/release-service/25.08.0/kmahjongg-25.08.0.tar.xz) = 525e90d62ff8db498131fc7b1ca4cbf8611adfe00a1433f2658bc943a45a2e5a -SIZE (KDE/release-service/25.08.0/kmahjongg-25.08.0.tar.xz) = 3726264 +TIMESTAMP = 1757410013 +SHA256 (KDE/release-service/25.08.1/kmahjongg-25.08.1.tar.xz) = f59a991bca6b0a648fc2b66a7dcb4eec04db317adcd6a3f554f7cff0a08be5fa +SIZE (KDE/release-service/25.08.1/kmahjongg-25.08.1.tar.xz) = 3725540 diff --git a/games/kmines/distinfo b/games/kmines/distinfo index d5ece9a0e4bd..5673fcc31e44 100644 --- a/games/kmines/distinfo +++ b/games/kmines/distinfo @@ -1,3 +1,3 @@ -TIMESTAMP = 1754646304 -SHA256 (KDE/release-service/25.08.0/kmines-25.08.0.tar.xz) = 31968a4773da1004f335347b68f00ebb132dc9bd20f8f95c0d90dd94db7480f9 -SIZE (KDE/release-service/25.08.0/kmines-25.08.0.tar.xz) = 950524 +TIMESTAMP = 1757410015 +SHA256 (KDE/release-service/25.08.1/kmines-25.08.1.tar.xz) = 7ad181690722e5e547bf7930973ea05259fd20472105db219b5e4644c325b6cb +SIZE (KDE/release-service/25.08.1/kmines-25.08.1.tar.xz) = 950172 diff --git a/games/knavalbattle/distinfo b/games/knavalbattle/distinfo index 3f557a219358..af4407433cdd 100644 --- a/games/knavalbattle/distinfo +++ b/games/knavalbattle/distinfo @@ -1,3 +1,3 @@ -TIMESTAMP = 1754646306 -SHA256 (KDE/release-service/25.08.0/knavalbattle-25.08.0.tar.xz) = 1ea82f64368f5f93ca7ccad7986bb3f111096bbb194b72472f3a6a032ac48372 -SIZE (KDE/release-service/25.08.0/knavalbattle-25.08.0.tar.xz) = 1051000 +TIMESTAMP = 1757410018 +SHA256 (KDE/release-service/25.08.1/knavalbattle-25.08.1.tar.xz) = be4dee2346d3f3782e64f7b137a78a3de6b1e8e0ff04aef65f62e323b5f1eee9 +SIZE (KDE/release-service/25.08.1/knavalbattle-25.08.1.tar.xz) = 1050808 diff --git a/games/knetwalk/distinfo b/games/knetwalk/distinfo index 4de7d3e5d482..5d805e70802d 100644 --- a/games/knetwalk/distinfo +++ b/games/knetwalk/distinfo @@ -1,3 +1,3 @@ -TIMESTAMP = 1754646309 -SHA256 (KDE/release-service/25.08.0/knetwalk-25.08.0.tar.xz) = 4cb2a5108ed4aa0689744c790fbf73e3a69a5b31fc364b6d6edd6a390ae1d64e -SIZE (KDE/release-service/25.08.0/knetwalk-25.08.0.tar.xz) = 1012820 +TIMESTAMP = 1757410020 +SHA256 (KDE/release-service/25.08.1/knetwalk-25.08.1.tar.xz) = 718e1f7df2b571f014e8c9c6aa9b7f830171664ee101dc4c7f798ec7ee2e9b13 +SIZE (KDE/release-service/25.08.1/knetwalk-25.08.1.tar.xz) = 1012140 diff --git a/games/knights/distinfo b/games/knights/distinfo index 3a9fe7518eec..e4dfade6abe8 100644 --- a/games/knights/distinfo +++ b/games/knights/distinfo @@ -1,3 +1,3 @@ -TIMESTAMP = 1754646311 -SHA256 (KDE/release-service/25.08.0/knights-25.08.0.tar.xz) = e587ee6e91a4ae803287e2b4c443cd63b04f5912a3c1ab14f4345c543bd7256e -SIZE (KDE/release-service/25.08.0/knights-25.08.0.tar.xz) = 2502164 +TIMESTAMP = 1757410022 +SHA256 (KDE/release-service/25.08.1/knights-25.08.1.tar.xz) = 27f5cefe8a41c7caee484ace3eadf11c8f4fec3bce57092e29beed67668460aa +SIZE (KDE/release-service/25.08.1/knights-25.08.1.tar.xz) = 2500636 diff --git a/games/kolf/distinfo b/games/kolf/distinfo index 076e1ceb12cf..91bcc273e758 100644 --- a/games/kolf/distinfo +++ b/games/kolf/distinfo @@ -1,3 +1,3 @@ -TIMESTAMP = 1754646314 -SHA256 (KDE/release-service/25.08.0/kolf-25.08.0.tar.xz) = 0693209077dbf052f44f0fb2013ce6fad7162b8732462367af34fc85cf41210a -SIZE (KDE/release-service/25.08.0/kolf-25.08.0.tar.xz) = 1085292 +TIMESTAMP = 1757410025 +SHA256 (KDE/release-service/25.08.1/kolf-25.08.1.tar.xz) = a433d3899048df1c14ea807303e16f76616be137139fc859cc92bf3af87fe34a +SIZE (KDE/release-service/25.08.1/kolf-25.08.1.tar.xz) = 1083404 diff --git a/games/kollision/distinfo b/games/kollision/distinfo index 62cbc41441e3..cccb23dfca25 100644 --- a/games/kollision/distinfo +++ b/games/kollision/distinfo @@ -1,3 +1,3 @@ -TIMESTAMP = 1754646316 -SHA256 (KDE/release-service/25.08.0/kollision-25.08.0.tar.xz) = 11d90b551eb6bd03b0b80dc8af615efd8c149672fb7034a589803589d251d2d9 -SIZE (KDE/release-service/25.08.0/kollision-25.08.0.tar.xz) = 313728 +TIMESTAMP = 1757410027 +SHA256 (KDE/release-service/25.08.1/kollision-25.08.1.tar.xz) = 825e2fcfda6d4045697946633f5cdee8f8ce3cd66a47998a3d9f3332880d2c2d +SIZE (KDE/release-service/25.08.1/kollision-25.08.1.tar.xz) = 313640 diff --git a/games/konquest/distinfo b/games/konquest/distinfo index 8f8680d29b0e..6b34058c294e 100644 --- a/games/konquest/distinfo +++ b/games/konquest/distinfo @@ -1,3 +1,3 @@ -TIMESTAMP = 1754646319 -SHA256 (KDE/release-service/25.08.0/konquest-25.08.0.tar.xz) = ac4b57d7e0ffa2b03c2a6794b4f4af7acfd284cbf3a8b38559cf8f48c8687184 -SIZE (KDE/release-service/25.08.0/konquest-25.08.0.tar.xz) = 863576 +TIMESTAMP = 1757410029 +SHA256 (KDE/release-service/25.08.1/konquest-25.08.1.tar.xz) = babcd518a414cd6ec954035a016a7e4172fa19391e4c15f94cb279c74a5e36ec +SIZE (KDE/release-service/25.08.1/konquest-25.08.1.tar.xz) = 863636 diff --git a/games/kpat/distinfo b/games/kpat/distinfo index 3594f67a0188..a46b76169506 100644 --- a/games/kpat/distinfo +++ b/games/kpat/distinfo @@ -1,3 +1,3 @@ -TIMESTAMP = 1754646321 -SHA256 (KDE/release-service/25.08.0/kpat-25.08.0.tar.xz) = 6f47a52f047532b75394e848d09d2f6b11f0706dddde8ec4be876d0e5678ba1a -SIZE (KDE/release-service/25.08.0/kpat-25.08.0.tar.xz) = 3742540 +TIMESTAMP = 1757410032 +SHA256 (KDE/release-service/25.08.1/kpat-25.08.1.tar.xz) = 09656293e06d82b8849aea9fe50b428f03fcc42e15c91bdc05a34ab18ed217fe +SIZE (KDE/release-service/25.08.1/kpat-25.08.1.tar.xz) = 3741972 diff --git a/games/kreversi/distinfo b/games/kreversi/distinfo index 1e4978e5d523..06fdd24af411 100644 --- a/games/kreversi/distinfo +++ b/games/kreversi/distinfo @@ -1,3 +1,3 @@ -TIMESTAMP = 1754646323 -SHA256 (KDE/release-service/25.08.0/kreversi-25.08.0.tar.xz) = f5d03652a984b4c4fef8935330e1b3026f6f8279d94ef9a8c858fbace0a68171 -SIZE (KDE/release-service/25.08.0/kreversi-25.08.0.tar.xz) = 1037588 +TIMESTAMP = 1757410034 +SHA256 (KDE/release-service/25.08.1/kreversi-25.08.1.tar.xz) = 16952b9177206df64093a75037269b7b59a17389d6a5ca60d888520ea5a4da7e +SIZE (KDE/release-service/25.08.1/kreversi-25.08.1.tar.xz) = 1037508 diff --git a/games/kshisen/distinfo b/games/kshisen/distinfo index 55a1e84bf18c..7d8bd082a6d8 100644 --- a/games/kshisen/distinfo +++ b/games/kshisen/distinfo @@ -1,3 +1,3 @@ -TIMESTAMP = 1754646326 -SHA256 (KDE/release-service/25.08.0/kshisen-25.08.0.tar.xz) = ad43776d590af70bcd0103b28e2d94e8e33f1930a44d91324119afde9219e491 -SIZE (KDE/release-service/25.08.0/kshisen-25.08.0.tar.xz) = 975880 +TIMESTAMP = 1757410036 +SHA256 (KDE/release-service/25.08.1/kshisen-25.08.1.tar.xz) = 9e4bd836af5a80880f59f789b37ea1878fe7a13b8b6d435089bc51347951bb60 +SIZE (KDE/release-service/25.08.1/kshisen-25.08.1.tar.xz) = 976584 diff --git a/games/ksirk/distinfo b/games/ksirk/distinfo index 0939548fedfb..3dd40cb3ceeb 100644 --- a/games/ksirk/distinfo +++ b/games/ksirk/distinfo @@ -1,3 +1,3 @@ -TIMESTAMP = 1754646328 -SHA256 (KDE/release-service/25.08.0/ksirk-25.08.0.tar.xz) = 902121d1bc55796e99d02840058dec2a6133ac3f4a46339a4693494536043b4b -SIZE (KDE/release-service/25.08.0/ksirk-25.08.0.tar.xz) = 6716700 +TIMESTAMP = 1757410039 +SHA256 (KDE/release-service/25.08.1/ksirk-25.08.1.tar.xz) = 05329836a6aaf272ef4625d2c2d23f82f565b31b7733dffa5725d406f4f08a2c +SIZE (KDE/release-service/25.08.1/ksirk-25.08.1.tar.xz) = 6722940 diff --git a/games/ksirk/pkg-plist b/games/ksirk/pkg-plist index 314cc433d03d..29c727c7b641 100644 --- a/games/ksirk/pkg-plist +++ b/games/ksirk/pkg-plist @@ -49,9 +49,10 @@ share/knsrcfiles/ksirk.knsrc %%DATADIR%%/skins/default/Sounds/crash.wav %%DATADIR%%/skins/default/Sounds/roll.wav %%DATADIR%%/skins/skinsdir -%%DATADIR%%skineditor/cross.png -%%DATADIR%%skineditor/target.png +share/ksirkskineditor/cross.png +share/ksirkskineditor/target.png share/locale/ar/LC_MESSAGES/ksirk.mo +share/locale/ar/LC_MESSAGES/ksirkskineditor.mo share/locale/ast/LC_MESSAGES/ksirk.mo share/locale/ast/LC_MESSAGES/ksirkskineditor.mo share/locale/be/LC_MESSAGES/ksirk.mo diff --git a/games/ksnakeduel/distinfo b/games/ksnakeduel/distinfo index 6a53ced7b044..2b0fbf14be93 100644 --- a/games/ksnakeduel/distinfo +++ b/games/ksnakeduel/distinfo @@ -1,3 +1,3 @@ -TIMESTAMP = 1754646331 -SHA256 (KDE/release-service/25.08.0/ksnakeduel-25.08.0.tar.xz) = 7aa2409cf69e29004910cf1a36bc6eb646a2b34e3f7a1b406b3f8b0442e41a1b -SIZE (KDE/release-service/25.08.0/ksnakeduel-25.08.0.tar.xz) = 580508 +TIMESTAMP = 1757410041 +SHA256 (KDE/release-service/25.08.1/ksnakeduel-25.08.1.tar.xz) = c2e779f2c93a5f8f8f74be1ed1ddab4c118e51f0195ab60802bf8bb78aa881f2 +SIZE (KDE/release-service/25.08.1/ksnakeduel-25.08.1.tar.xz) = 580520 diff --git a/games/kspaceduel/distinfo b/games/kspaceduel/distinfo index 7f22222682e7..290e70f7c970 100644 --- a/games/kspaceduel/distinfo +++ b/games/kspaceduel/distinfo @@ -1,3 +1,3 @@ -TIMESTAMP = 1754646333 -SHA256 (KDE/release-service/25.08.0/kspaceduel-25.08.0.tar.xz) = bc28dff096caae83e5b1322854da864bdfdd01089fcd5134d632194e4c06eed7 -SIZE (KDE/release-service/25.08.0/kspaceduel-25.08.0.tar.xz) = 636920 +TIMESTAMP = 1757410043 +SHA256 (KDE/release-service/25.08.1/kspaceduel-25.08.1.tar.xz) = c1e0cc149bd841fbb7a843dd70ae20d793498abd1f54ae75c6540152e2cae5c1 +SIZE (KDE/release-service/25.08.1/kspaceduel-25.08.1.tar.xz) = 636764 diff --git a/games/ksquares/distinfo b/games/ksquares/distinfo index f12d7ed77adc..9922de476204 100644 --- a/games/ksquares/distinfo +++ b/games/ksquares/distinfo @@ -1,3 +1,3 @@ -TIMESTAMP = 1754646336 -SHA256 (KDE/release-service/25.08.0/ksquares-25.08.0.tar.xz) = e4d5c9d956c3fcb77e3685b97d7e3766b5b323264b97d5b20fca2aaafd2693de -SIZE (KDE/release-service/25.08.0/ksquares-25.08.0.tar.xz) = 324520 +TIMESTAMP = 1757410046 +SHA256 (KDE/release-service/25.08.1/ksquares-25.08.1.tar.xz) = 95be1f4713efd2aec88960f382b4474837a2b50419e5e467114470d89c08e0e0 +SIZE (KDE/release-service/25.08.1/ksquares-25.08.1.tar.xz) = 324432 diff --git a/games/ksudoku/distinfo b/games/ksudoku/distinfo index 5d2e784013c2..3d9fe60d5bdd 100644 --- a/games/ksudoku/distinfo +++ b/games/ksudoku/distinfo @@ -1,3 +1,3 @@ -TIMESTAMP = 1754646338 -SHA256 (KDE/release-service/25.08.0/ksudoku-25.08.0.tar.xz) = 70cda244397083b54a9ccb2bda26dac929604fd11b4532ec646e63e0ef07a3ac -SIZE (KDE/release-service/25.08.0/ksudoku-25.08.0.tar.xz) = 1746400 +TIMESTAMP = 1757410048 +SHA256 (KDE/release-service/25.08.1/ksudoku-25.08.1.tar.xz) = df3cb15d72c6293df05ce95b67e7c4b29ea88d994d2a0df09b260f1ea482f36d +SIZE (KDE/release-service/25.08.1/ksudoku-25.08.1.tar.xz) = 1746052 diff --git a/games/ktuberling/distinfo b/games/ktuberling/distinfo index 859d65a30619..195f1dec9c5d 100644 --- a/games/ktuberling/distinfo +++ b/games/ktuberling/distinfo @@ -1,3 +1,3 @@ -TIMESTAMP = 1754646341 -SHA256 (KDE/release-service/25.08.0/ktuberling-25.08.0.tar.xz) = fc30d68a9b4168a751085b09252cdbd547c6305dd505d61f1adf6afadb38f996 -SIZE (KDE/release-service/25.08.0/ktuberling-25.08.0.tar.xz) = 71572556 +TIMESTAMP = 1757410051 +SHA256 (KDE/release-service/25.08.1/ktuberling-25.08.1.tar.xz) = 9c9c109144fdfdc36c20e166317e79feab2b12cfbce1955742ca508a519a1d2b +SIZE (KDE/release-service/25.08.1/ktuberling-25.08.1.tar.xz) = 71553592 diff --git a/games/kubrick/distinfo b/games/kubrick/distinfo index 2a5695a146d4..9abe0f0897d6 100644 --- a/games/kubrick/distinfo +++ b/games/kubrick/distinfo @@ -1,3 +1,3 @@ -TIMESTAMP = 1754646343 -SHA256 (KDE/release-service/25.08.0/kubrick-25.08.0.tar.xz) = 28641a46426db3eab4a7c8f1c319c41206a581586e3f6ed544638c4b7fbc7cf9 -SIZE (KDE/release-service/25.08.0/kubrick-25.08.0.tar.xz) = 381272 +TIMESTAMP = 1757410053 +SHA256 (KDE/release-service/25.08.1/kubrick-25.08.1.tar.xz) = dbbd55219b93cf0d0415443746a287bb3ec32b0c45da963b79d0e6b3359d3381 +SIZE (KDE/release-service/25.08.1/kubrick-25.08.1.tar.xz) = 384812 diff --git a/games/libkdegames/distinfo b/games/libkdegames/distinfo index 7e7e5814e9f9..668b7fadbee2 100644 --- a/games/libkdegames/distinfo +++ b/games/libkdegames/distinfo @@ -1,3 +1,3 @@ -TIMESTAMP = 1754646345 -SHA256 (KDE/release-service/25.08.0/libkdegames-25.08.0.tar.xz) = 15579343d5b06608115e8e95473b80bc91de8841b1a79584f5615a91fe57e2f7 -SIZE (KDE/release-service/25.08.0/libkdegames-25.08.0.tar.xz) = 5974808 +TIMESTAMP = 1757410055 +SHA256 (KDE/release-service/25.08.1/libkdegames-25.08.1.tar.xz) = 542b2f951c5091c5157cc0f2f53bae61afc47b21115df7441695b82fa725e83a +SIZE (KDE/release-service/25.08.1/libkdegames-25.08.1.tar.xz) = 5976400 diff --git a/games/libkmahjongg/distinfo b/games/libkmahjongg/distinfo index 6470e9357211..bb26248e60e1 100644 --- a/games/libkmahjongg/distinfo +++ b/games/libkmahjongg/distinfo @@ -1,3 +1,3 @@ -TIMESTAMP = 1754646348 -SHA256 (KDE/release-service/25.08.0/libkmahjongg-25.08.0.tar.xz) = 9c4e7dd2f6ebb1ea3de63c2849fd305a6dbeb2cb9b229692a9ec5aabddf76880 -SIZE (KDE/release-service/25.08.0/libkmahjongg-25.08.0.tar.xz) = 1695208 +TIMESTAMP = 1757410058 +SHA256 (KDE/release-service/25.08.1/libkmahjongg-25.08.1.tar.xz) = 8d731b713fa25e5a44d89f8c328aafe4470f01f74394707f65ca164bfacb9c2a +SIZE (KDE/release-service/25.08.1/libkmahjongg-25.08.1.tar.xz) = 1694472 diff --git a/games/lskat/distinfo b/games/lskat/distinfo index ad930ce71ee3..f0d345c5abc1 100644 --- a/games/lskat/distinfo +++ b/games/lskat/distinfo @@ -1,3 +1,3 @@ -TIMESTAMP = 1754646350 -SHA256 (KDE/release-service/25.08.0/lskat-25.08.0.tar.xz) = 33e003193496e7ab17eb984b9655a14656263ca33f591c9ea3d1bf8f188af2e6 -SIZE (KDE/release-service/25.08.0/lskat-25.08.0.tar.xz) = 1229772 +TIMESTAMP = 1757410060 +SHA256 (KDE/release-service/25.08.1/lskat-25.08.1.tar.xz) = c11dff0edc8cdfc401e69252a206b9c3341bd3e9de3b53efc0f4343c3d394cd8 +SIZE (KDE/release-service/25.08.1/lskat-25.08.1.tar.xz) = 1229372 diff --git a/games/moonlight-embedded-devel/Makefile b/games/moonlight-embedded-devel/Makefile index 2192d1c1d34d..fb2cf9011c6b 100644 --- a/games/moonlight-embedded-devel/Makefile +++ b/games/moonlight-embedded-devel/Makefile @@ -1,6 +1,5 @@ PORTNAME= moonlight-embedded-devel -DISTVERSION= 2.7.4 -PORTREVISION= 3 +DISTVERSION= 2.7.5 CATEGORIES= games MASTER_SITES= https://github.com/armin-25689/moonlight-embedded/releases/download/v${DISTVERSION}/ @@ -27,43 +26,46 @@ LIB_DEPENDS= libavahi-client.so:net/avahi-app \ libwayland-client.so:graphics/wayland USES= cmake gl localbase:ldflags perl5 pkgconfig sdl ssl tar:xz xorg -USE_LDCONFIG= yes USE_GL= egl gbm glesv2 +USE_LDCONFIG= yes USE_PERL5= build USE_SDL= sdl2 USE_XORG= x11 -NO_WRKSUBDIR= yes +CMAKE_ARGS= -DCMAKE_INSTALL_SYSCONFDIR=${PREFIX}/etc/moonlight + CFLAGS+= -DHAS_SOCKLEN_T=1 -I${LOCALBASE}/include/libepoll-shim LDFLAGS+= -lepoll-shim -CMAKE_ARGS= -DCMAKE_INSTALL_SYSCONFDIR=${PREFIX}/etc/moonlight CONFLICTS_INSTALL= moonlight-embedded +NO_WRKSUBDIR= yes + PLIST_FILES= bin/moonlight \ "@sample etc/moonlight/moonlight.conf.sample" \ share/man/man1/moonlight.1.gz \ share/moonlight/gamecontrollerdb.txt OPTIONS_DEFAULT= OSS +OPTIONS_GROUP= OTHERS +OPTIONS_GROUP_OTHERS= CEC +OPTIONS_SINGLE= SOUND +OPTIONS_SINGLE_SOUND= OSS PULSE + CEC_DESC= Enable HDMI-CEC(TV controller) feature by using libcec.so OSS_DESC= Open Sound System support for embedded(not SDL) platform PULSE_DESC= PulseAudio sound server support for embedded(not SDL) platform -OPTIONS_GROUP= OTHERS -OPTIONS_GROUP_OTHERS= CEC -OPTIONS_SINGLE= SOUND -OPTIONS_SINGLE_SOUND= OSS PULSE -CEC_CMAKE_BOOL= ENABLE_CEC + CEC_LIB_DEPENDS= libcec.so:multimedia/libcec \ libp8-platform.so:devel/p8-platform -OSS_CMAKE_ON= -DENABLE_PULSE:BOOL=false -PULSE_CMAKE_BOOL= ENABLE_PULSE +CEC_CMAKE_BOOL= ENABLE_CEC +OSS_CMAKE_ON= -DENABLE_PULSE:BOOL=false PULSE_LIB_DEPENDS= libpulse.so:audio/pulseaudio +PULSE_CMAKE_BOOL= ENABLE_PULSE post-extract: @${REINPLACE_CMD} -e 's@/usr/local@${PREFIX}@' \ - ${WRKSRC}/docs/README.pod - @${REINPLACE_CMD} -e 's@/usr/local@${PREFIX}@' \ + ${WRKSRC}/docs/README.pod \ ${WRKSRC}/src/config.c post-install: diff --git a/games/moonlight-embedded-devel/distinfo b/games/moonlight-embedded-devel/distinfo index ae8d653aa9e7..507a4350d87e 100644 --- a/games/moonlight-embedded-devel/distinfo +++ b/games/moonlight-embedded-devel/distinfo @@ -1,3 +1,3 @@ -TIMESTAMP = 1731162268 -SHA256 (moonlight-embedded-devel-2.7.4.tar.xz) = e74d99666c11d92397517a7c2058ad203b31973af10d496ccfc6b37106a993e6 -SIZE (moonlight-embedded-devel-2.7.4.tar.xz) = 1121376 +TIMESTAMP = 1757506828 +SHA256 (moonlight-embedded-devel-2.7.5.tar.xz) = 486d5527733226706ef70b0534c8206f1872e18b4d331ca04af07f32db349018 +SIZE (moonlight-embedded-devel-2.7.5.tar.xz) = 380456 diff --git a/games/moonlight-embedded-devel/pkg-descr b/games/moonlight-embedded-devel/pkg-descr index 8a3e7e25f25a..cb18590dfa25 100644 --- a/games/moonlight-embedded-devel/pkg-descr +++ b/games/moonlight-embedded-devel/pkg-descr @@ -4,5 +4,7 @@ PC(sunshine or NV shield) to your FreeBSD system. In contrast to moonlight-qt, this port can grab keyboard and mouse and has full worked vaapi decoder, which helps in case of crashes. -Note: This is a fork of moonlight-embedded aimed for more features +Note1: This is a fork of moonlight-embedded aimed for more features and fixes for FreeBSD on amd64, not only on embedded systems. +Note2: If meet crash frequently, try adjust Integrated Graphics +Device(IDG) Aperture size from BIOS. diff --git a/games/motogt/Makefile b/games/motogt/Makefile deleted file mode 100644 index 5bdec9b13474..000000000000 --- a/games/motogt/Makefile +++ /dev/null @@ -1,47 +0,0 @@ -PORTNAME= motogt -PORTVERSION= 20110505 -PORTREVISION= 9 -CATEGORIES= games -MASTER_SITES= SF/motogt/MotoGT1/ -DISTNAME= MotoGT-${PORTVERSION} - -MAINTAINER= amdmi3@FreeBSD.org -COMMENT= 2D top-viewed motorcycle racing game -WWW= https://motogt.sourceforge.net/ - -DEPRECATED= Depends on obsolete devel/sfml1 -EXPIRATION_DATE=2025-09-10 - -LICENSE= GPLv2 CC-BY-SA-3.0 -LICENSE_COMB= multi -LICENSE_FILE_CC-BY-SA-3.0= ${WRKSRC}/doc/cc-by-sa.txt -LICENSE_FILE_GPLv2= ${WRKSRC}/doc/gpl.txt - -LIB_DEPENDS= libsfml1-system.so:devel/sfml1 \ - libpng.so:graphics/png - -USES= gl localbase:ldflags zip -USE_CXXSTD= c++14 -USE_GL= gl - -MAKEFILE= Makefile.lnx -MAKE_JOBS_UNSAFE= yes - -SUB_FILES= motogt - -BUILD_WRKSRC= ${WRKSRC}/src -WRKSRC= ${WRKDIR}/MotoGT - -PLIST_FILES= bin/${PORTNAME} libexec/MotoGT.bin -PORTDATA= * - -post-patch: - @${REINPLACE_CMD} -e '/#include/ s|SFML|&1|' ${WRKSRC}/data/src/editor.cpp ${WRKSRC}/src/*.h - @${REINPLACE_CMD} -e 's|-lsfml|&1|g' ${WRKSRC}/src/Makefile.lnx - -do-install: - ${INSTALL_PROGRAM} ${WRKSRC}/MotoGT.bin ${STAGEDIR}${PREFIX}/libexec/ - ${INSTALL_SCRIPT} ${WRKDIR}/motogt ${STAGEDIR}${PREFIX}/bin/ - cd ${WRKSRC} && ${COPYTREE_SHARE} data ${STAGEDIR}${DATADIR}/ - -.include <bsd.port.mk> diff --git a/games/motogt/distinfo b/games/motogt/distinfo deleted file mode 100644 index 645efcc4ceb3..000000000000 --- a/games/motogt/distinfo +++ /dev/null @@ -1,2 +0,0 @@ -SHA256 (MotoGT-20110505.zip) = a5d780c048a92e0f68b4cc83ccb9c45ee504772e651d4037468925525c2988a2 -SIZE (MotoGT-20110505.zip) = 87736858 diff --git a/games/motogt/files/motogt.in b/games/motogt/files/motogt.in deleted file mode 100644 index c3bf7972a061..000000000000 --- a/games/motogt/files/motogt.in +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh - -cd %%DATADIR%% || exit 1 -exec %%PREFIX%%/libexec/MotoGT.bin "$@" diff --git a/games/motogt/files/patch-Makefile b/games/motogt/files/patch-Makefile deleted file mode 100644 index 86ad265d849c..000000000000 --- a/games/motogt/files/patch-Makefile +++ /dev/null @@ -1,10 +0,0 @@ ---- Makefile.orig 2011-01-10 20:25:23.000000000 +0300 -+++ Makefile 2011-09-27 08:44:25.000000000 +0400 -@@ -1,5 +1,5 @@ - all: -- make -C src -f Makefile.lnx -+ ${MAKE} -C src -f Makefile.lnx - - clean: -- make -C src -f Makefile.lnx clean -+ ${MAKE} -C src -f Makefile.lnx clean diff --git a/games/motogt/files/patch-src-Circuito.cpp b/games/motogt/files/patch-src-Circuito.cpp deleted file mode 100644 index fb5ae7a7398f..000000000000 --- a/games/motogt/files/patch-src-Circuito.cpp +++ /dev/null @@ -1,11 +0,0 @@ ---- src/Circuito.cpp.orig 2011-01-12 20:20:23.000000000 +0300 -+++ src/Circuito.cpp 2011-09-26 23:13:03.000000000 +0400 -@@ -171,7 +171,7 @@ - if (!osd) {image=NULL; sprite=NULL; return; } - image = new Image*[image_c]; - sprite = new Sprite*[image_c]; -- string image_dir=data->tracks[track_index].dir+"t00.png"; -+ string image_dir=home_dir + data->tracks[track_index].dir + "t00.png"; - for (int i=0;i<image_c;i++) { - image[i]=new Image[image_r]; - sprite[i]=new Sprite[image_r]; diff --git a/games/motogt/files/patch-src-Config.cpp b/games/motogt/files/patch-src-Config.cpp deleted file mode 100644 index 148cd380aa43..000000000000 --- a/games/motogt/files/patch-src-Config.cpp +++ /dev/null @@ -1,22 +0,0 @@ ---- src/Config.cpp.orig 2011-01-18 06:52:35.000000000 +0300 -+++ src/Config.cpp 2014-02-02 21:13:04.124154052 +0400 -@@ -139,6 +139,9 @@ - } - - void Config::ChangeResolution(bool up) { -+ if (num_modes == 0) -+ return; -+ - if (cur_mode!=num_modes) cur_mode+=up?1:num_modes-1; - cur_mode=cur_mode%num_modes; - real_w=modes_w[cur_mode]; -@@ -226,7 +229,8 @@ - old_fullscreen=fullscreen; - changed=false; - ofstream fil((home_dir+"settings.lst").c_str(),ios::trunc); -- fil<<"version="<<(config->version=VERSION)<<endl; -+ fil<<"version="<<VERSION<<endl; -+ if (config) config->version = VERSION; - fil<<"fullscreen="<<(fullscreen?1:0)<<endl; - fil<<"low_textures="<<(low_textures?1:0)<<endl; - fil<<"sound="<<(sound_on?1:0)<<endl; diff --git a/games/motogt/files/patch-src-MakeData.cpp b/games/motogt/files/patch-src-MakeData.cpp deleted file mode 100644 index dc130a164795..000000000000 --- a/games/motogt/files/patch-src-MakeData.cpp +++ /dev/null @@ -1,48 +0,0 @@ ---- src/MakeData.cpp.orig 2011-01-10 17:40:30 UTC -+++ src/MakeData.cpp -@@ -5,6 +5,7 @@ - #define PNG_DEBUG 3 - #include <png.h> - #include <fstream> -+#include <sys/stat.h> - #include "global.h" - #include "Config.h" - #include "Confirm.h" -@@ -109,10 +110,10 @@ struct PngFile { - - png_read_info(png_ptr, info_ptr); - -- width = info_ptr->width; -- height = info_ptr->height; -- color_type = info_ptr->color_type; -- bit_depth = info_ptr->bit_depth; -+ width = png_get_image_width(png_ptr, info_ptr); -+ height = png_get_image_height(png_ptr, info_ptr); -+ color_type = png_get_color_type(png_ptr, info_ptr); -+ bit_depth = png_get_bit_depth(png_ptr, info_ptr); - - number_of_passes = png_set_interlace_handling(png_ptr); - png_read_update_info(png_ptr, info_ptr); -@@ -125,7 +126,7 @@ struct PngFile { - - row_pointers = (png_bytep*) malloc(sizeof(png_bytep) * height); - for (int y=0; y<height; y++) -- row_pointers[y] = (png_byte*) malloc(info_ptr->rowbytes); -+ row_pointers[y] = (png_byte*) malloc(png_get_rowbytes(png_ptr,info_ptr)); - - png_read_image(png_ptr, row_pointers); - -@@ -376,7 +377,12 @@ struct PngFile { - } - fname[2]='0'+i; - fname[1]='0'+j; -- if (!f2->Save((dir+fname).c_str())) -+ size_t pos = 0; -+ do { -+ pos = dir.find('/', pos+1); -+ mkdir((home_dir+dir.substr(0, pos)).c_str(), 0755); -+ } while (pos != string::npos); -+ if (!f2->Save((home_dir+dir+fname).c_str())) - return false; - f2->width=ancho2; f2->height=ancho2; - } diff --git a/games/motogt/files/patch-src-Makefile.common b/games/motogt/files/patch-src-Makefile.common deleted file mode 100644 index 7b6fb39a5948..000000000000 --- a/games/motogt/files/patch-src-Makefile.common +++ /dev/null @@ -1,149 +0,0 @@ ---- src/Makefile.common.orig 2011-01-10 20:40:30.000000000 +0300 -+++ src/Makefile.common 2011-09-27 08:39:09.000000000 +0400 -@@ -1,110 +1,110 @@ - OBJS=${TEMP_DIR}/BikeSelection.o ${TEMP_DIR}/Data.o ${TEMP_DIR}/main.o ${TEMP_DIR}/Particulas.o ${TEMP_DIR}/Carrera.o ${TEMP_DIR}/Circuito.o ${TEMP_DIR}/Moto.o ${TEMP_DIR}/global.o ${TEMP_DIR}/OSD.o ${TEMP_DIR}/MyFont.o ${TEMP_DIR}/Menu.o ${TEMP_DIR}/Loading.o ${TEMP_DIR}/Confirm.o ${TEMP_DIR}/Jukebox.o ${TEMP_DIR}/RaceExtras.o ${TEMP_DIR}/SelectionWheel.o ${TEMP_DIR}/TrackSelection.o ${TEMP_DIR}/RaceResults.o ${TEMP_DIR}/Shader.o ${TEMP_DIR}/TextViewer.o ${TEMP_DIR}/text.o ${TEMP_DIR}/RaceMenu.o ${TEMP_DIR}/ChampionshipMenu.o ${TEMP_DIR}/MakeData.o ${TEMP_DIR}/ChampionshipData.o ${TEMP_DIR}/Profile.o ${TEMP_DIR}/Config.o ${TEMP_DIR}/MyRenderWindow.o ${TEMP_DIR}/SlideShow.o ${TEMP_DIR}/Experience.o ${TEMP_DIR}/LangSelection.o ${TEMP_DIR}/Records.o ${TEMP_DIR}/StyleOsd.o ${TEMP_DIR}/Intro.o ${TEMP_DIR}/HiddenDriver.o ${TEMP_DIR}/text_hidden.o - - ${TEMP_DIR}/BikeSelection.o: BikeSelection.cpp global.h MyRenderWindow.h Data.h BikeSelection.h Drawer.h MyFont.h SelectionWheel.h Confirm.h Loading.h Config.h Profile.h Jukebox.h -- ${GPP} ${FLAGS} -c BikeSelection.cpp -o $@ -+ ${CXX} ${CXXFLAGS} -c BikeSelection.cpp -o $@ - - ${TEMP_DIR}/Data.o: Data.cpp Data.h global.h MyRenderWindow.h Jukebox.h Particulas.h Shader.h ChampionshipData.h Profile.h Config.h -- ${GPP} ${FLAGS} -c Data.cpp -o $@ -+ ${CXX} ${CXXFLAGS} -c Data.cpp -o $@ - - ${TEMP_DIR}/main.o: main.cpp global.h MyRenderWindow.h Data.h OSD.h RaceExtras.h Carrera.h Drawer.h Particulas.h Menu.h MyFont.h Loading.h Confirm.h Jukebox.h SelectionWheel.h Shader.h ChampionshipData.h Config.h Profile.h SlideShow.h version.h Circuito.h LangSelection.h StyleOsd.h Intro.h text_hidden.h HiddenDriver.h -- ${GPP} ${FLAGS} -c main.cpp -o $@ -+ ${CXX} ${CXXFLAGS} -c main.cpp -o $@ - - ${TEMP_DIR}/Particulas.o: Particulas.cpp Particulas.h global.h MyRenderWindow.h Data.h Moto.h Circuito.h -- ${GPP} ${FLAGS} -c Particulas.cpp -o $@ -+ ${CXX} ${CXXFLAGS} -c Particulas.cpp -o $@ - - ${TEMP_DIR}/Carrera.o: Carrera.cpp Carrera.h global.h MyRenderWindow.h Data.h Drawer.h Confirm.h RaceExtras.h Circuito.h Particulas.h Moto.h OSD.h Loading.h Shader.h Jukebox.h Profile.h Config.h TextViewer.h text.h StyleOsd.h -- ${GPP} ${FLAGS} -c Carrera.cpp -o $@ -+ ${CXX} ${CXXFLAGS} -c Carrera.cpp -o $@ - - ${TEMP_DIR}/Circuito.o: Circuito.cpp Circuito.h global.h MyRenderWindow.h Data.h Jukebox.h Loading.h Drawer.h Confirm.h MakeData.h Profile.h Config.h OSD.h -- ${GPP} ${FLAGS} -c Circuito.cpp -o $@ -+ ${CXX} ${CXXFLAGS} -c Circuito.cpp -o $@ - - ${TEMP_DIR}/Moto.o: Moto.cpp Moto.h Circuito.h global.h MyRenderWindow.h Data.h Jukebox.h RaceExtras.h Particulas.h Carrera.h Drawer.h Loading.h Profile.h Config.h StyleOsd.h -- ${GPP} ${FLAGS} -c Moto.cpp -o $@ -+ ${CXX} ${CXXFLAGS} -c Moto.cpp -o $@ - - ${TEMP_DIR}/global.o: global.cpp global.h MyRenderWindow.h Data.h -- ${GPP} ${FLAGS} -c global.cpp -o $@ -+ ${CXX} ${CXXFLAGS} -c global.cpp -o $@ - - ${TEMP_DIR}/OSD.o: OSD.cpp OSD.h global.h MyRenderWindow.h Data.h Carrera.h Drawer.h Moto.h Circuito.h MyFont.h Config.h -- ${GPP} ${FLAGS} -c OSD.cpp -o $@ -+ ${CXX} ${CXXFLAGS} -c OSD.cpp -o $@ - - ${TEMP_DIR}/MyFont.o: MyFont.cpp MyFont.h global.h MyRenderWindow.h Data.h -- ${GPP} ${FLAGS} -c MyFont.cpp -o $@ -+ ${CXX} ${CXXFLAGS} -c MyFont.cpp -o $@ - - ${TEMP_DIR}/Menu.o: Menu.cpp Menu.h global.h MyRenderWindow.h Data.h Drawer.h Carrera.h MyFont.h Jukebox.h Confirm.h Loading.h EnterName.h SelectionWheel.h TrackSelection.h RaceResults.h RaceExtras.h Particulas.h TextViewer.h text.h Shader.h Circuito.h RaceMenu.h version.h BikeSelection.h ChampionshipMenu.h Config.h Profile.h OSD.h Records.h HiddenDriver.h text_hidden.h -- ${GPP} ${FLAGS} -c Menu.cpp -o $@ -+ ${CXX} ${CXXFLAGS} -c Menu.cpp -o $@ - - ${TEMP_DIR}/Loading.o: Loading.cpp Loading.h global.h MyRenderWindow.h Data.h Drawer.h -- ${GPP} ${FLAGS} -c Loading.cpp -o $@ -+ ${CXX} ${CXXFLAGS} -c Loading.cpp -o $@ - - ${TEMP_DIR}/Confirm.o: Confirm.cpp Confirm.h global.h MyRenderWindow.h Data.h Drawer.h MyFont.h Config.h Jukebox.h Loading.h -- ${GPP} ${FLAGS} -c Confirm.cpp -o $@ -+ ${CXX} ${CXXFLAGS} -c Confirm.cpp -o $@ - - ${TEMP_DIR}/Jukebox.o: Jukebox.cpp Jukebox.h global.h MyRenderWindow.h Data.h Config.h -- ${GPP} ${FLAGS} -c Jukebox.cpp -o $@ -+ ${CXX} ${CXXFLAGS} -c Jukebox.cpp -o $@ - - ${TEMP_DIR}/RaceExtras.o: RaceExtras.cpp RaceExtras.h global.h MyRenderWindow.h Data.h Carrera.h Drawer.h MyFont.h -- ${GPP} ${FLAGS} -c RaceExtras.cpp -o $@ -+ ${CXX} ${CXXFLAGS} -c RaceExtras.cpp -o $@ - - ${TEMP_DIR}/SelectionWheel.o: SelectionWheel.cpp SelectionWheel.h global.h MyRenderWindow.h Data.h -- ${GPP} ${FLAGS} -c SelectionWheel.cpp -o $@ -+ ${CXX} ${CXXFLAGS} -c SelectionWheel.cpp -o $@ - - ${TEMP_DIR}/TrackSelection.o: TrackSelection.cpp TrackSelection.h global.h MyRenderWindow.h Data.h Drawer.h MyFont.h SelectionWheel.h Loading.h Profile.h Config.h Confirm.h ChampionshipData.h Jukebox.h -- ${GPP} ${FLAGS} -c TrackSelection.cpp -o $@ -+ ${CXX} ${CXXFLAGS} -c TrackSelection.cpp -o $@ - - ${TEMP_DIR}/RaceResults.o: RaceResults.cpp RaceResults.h global.h MyRenderWindow.h Data.h Drawer.h Carrera.h MyFont.h Moto.h Circuito.h SelectionWheel.h Jukebox.h ChampionshipData.h Config.h Profile.h -- ${GPP} ${FLAGS} -c RaceResults.cpp -o $@ -+ ${CXX} ${CXXFLAGS} -c RaceResults.cpp -o $@ - - ${TEMP_DIR}/Shader.o: Shader.cpp Shader.h global.h MyRenderWindow.h Data.h -- ${GPP} ${FLAGS} -c Shader.cpp -o $@ -+ ${CXX} ${CXXFLAGS} -c Shader.cpp -o $@ - - ${TEMP_DIR}/TextViewer.o: TextViewer.cpp TextViewer.h global.h MyRenderWindow.h Data.h text.h MyFont.h Config.h Jukebox.h -- ${GPP} ${FLAGS} -c TextViewer.cpp -o $@ -+ ${CXX} ${CXXFLAGS} -c TextViewer.cpp -o $@ - - ${TEMP_DIR}/text.o: text.cpp -- ${GPP} ${FLAGS} -c text.cpp -o $@ -+ ${CXX} ${CXXFLAGS} -c text.cpp -o $@ - - ${TEMP_DIR}/RaceMenu.o: RaceMenu.cpp RaceMenu.h global.h MyRenderWindow.h Data.h Drawer.h MyFont.h SelectionWheel.h TextViewer.h text.h Loading.h Circuito.h Carrera.h Moto.h Confirm.h RaceResults.h BikeSelection.h Profile.h Config.h ChampionshipData.h Jukebox.h Experience.h HiddenDriver.h text_hidden.h -- ${GPP} ${FLAGS} -c RaceMenu.cpp -o $@ -+ ${CXX} ${CXXFLAGS} -c RaceMenu.cpp -o $@ - - ${TEMP_DIR}/ChampionshipMenu.o: ChampionshipMenu.cpp ChampionshipMenu.h global.h MyRenderWindow.h Data.h Drawer.h Config.h MyFont.h SelectionWheel.h TextViewer.h text.h Loading.h Circuito.h Carrera.h Moto.h Confirm.h RaceResults.h BikeSelection.h ChampionshipData.h Profile.h TrackSelection.h RaceMenu.h Jukebox.h SlideShow.h HiddenDriver.h text_hidden.h -- ${GPP} ${FLAGS} -c ChampionshipMenu.cpp -o $@ -+ ${CXX} ${CXXFLAGS} -c ChampionshipMenu.cpp -o $@ - - ${TEMP_DIR}/MakeData.o: MakeData.cpp global.h MyRenderWindow.h Data.h Config.h Confirm.h Drawer.h -- ${GPP} ${FLAGS} -c MakeData.cpp -o $@ -+ ${CXX} ${CXXFLAGS} -c MakeData.cpp -o $@ - - ${TEMP_DIR}/ChampionshipData.o: ChampionshipData.cpp ChampionshipData.h Data.h global.h MyRenderWindow.h Profile.h Moto.h Circuito.h Experience.h -- ${GPP} ${FLAGS} -c ChampionshipData.cpp -o $@ -+ ${CXX} ${CXXFLAGS} -c ChampionshipData.cpp -o $@ - - ${TEMP_DIR}/Profile.o: Profile.cpp Profile.h global.h MyRenderWindow.h Data.h ChampionshipData.h -- ${GPP} ${FLAGS} -c Profile.cpp -o $@ -+ ${CXX} ${CXXFLAGS} -c Profile.cpp -o $@ - - ${TEMP_DIR}/Config.o: Config.cpp Config.h global.h MyRenderWindow.h Data.h Shader.h Particulas.h Jukebox.h -- ${GPP} ${FLAGS} -c Config.cpp -o $@ -+ ${CXX} ${CXXFLAGS} -c Config.cpp -o $@ - - ${TEMP_DIR}/MyRenderWindow.o: MyRenderWindow.cpp global.h MyRenderWindow.h Data.h Config.h -- ${GPP} ${FLAGS} -c MyRenderWindow.cpp -o $@ -+ ${CXX} ${CXXFLAGS} -c MyRenderWindow.cpp -o $@ - - ${TEMP_DIR}/SlideShow.o: SlideShow.cpp SlideShow.h global.h MyRenderWindow.h Data.h Config.h Jukebox.h Loading.h Drawer.h -- ${GPP} ${FLAGS} -c SlideShow.cpp -o $@ -+ ${CXX} ${CXXFLAGS} -c SlideShow.cpp -o $@ - - ${TEMP_DIR}/Experience.o: Experience.cpp Experience.h global.h MyRenderWindow.h Data.h MyFont.h Config.h SelectionWheel.h Jukebox.h -- ${GPP} ${FLAGS} -c Experience.cpp -o $@ -+ ${CXX} ${CXXFLAGS} -c Experience.cpp -o $@ - - ${TEMP_DIR}/LangSelection.o: LangSelection.cpp LangSelection.h global.h MyRenderWindow.h Data.h Config.h -- ${GPP} ${FLAGS} -c LangSelection.cpp -o $@ -+ ${CXX} ${CXXFLAGS} -c LangSelection.cpp -o $@ - - ${TEMP_DIR}/Records.o: Records.cpp Records.h global.h MyRenderWindow.h Data.h Config.h Jukebox.h SelectionWheel.h MyFont.h -- ${GPP} ${FLAGS} -c Records.cpp -o $@ -+ ${CXX} ${CXXFLAGS} -c Records.cpp -o $@ - - ${TEMP_DIR}/StyleOsd.o: StyleOsd.cpp StyleOsd.h global.h MyRenderWindow.h Data.h -- ${GPP} ${FLAGS} -c StyleOsd.cpp -o $@ -+ ${CXX} ${CXXFLAGS} -c StyleOsd.cpp -o $@ - - ${TEMP_DIR}/Intro.o: Intro.cpp Intro.h global.h MyRenderWindow.h Data.h -- ${GPP} ${FLAGS} -c Intro.cpp -o $@ -+ ${CXX} ${CXXFLAGS} -c Intro.cpp -o $@ - - ${TEMP_DIR}/HiddenDriver.o: HiddenDriver.cpp HiddenDriver.h global.h MyRenderWindow.h Data.h text_hidden.h Config.h Jukebox.h MyFont.h -- ${GPP} ${FLAGS} -c HiddenDriver.cpp -o $@ -+ ${CXX} ${CXXFLAGS} -c HiddenDriver.cpp -o $@ - - ${TEMP_DIR}/text_hidden.o: text_hidden.cpp text_hidden.h -- ${GPP} ${FLAGS} -c text_hidden.cpp -o $@ -+ ${CXX} ${CXXFLAGS} -c text_hidden.cpp -o $@ - diff --git a/games/motogt/files/patch-src-Makefile.lnx b/games/motogt/files/patch-src-Makefile.lnx deleted file mode 100644 index aba2597dfd59..000000000000 --- a/games/motogt/files/patch-src-Makefile.lnx +++ /dev/null @@ -1,25 +0,0 @@ ---- src/Makefile.lnx.orig 2011-01-10 20:54:57.000000000 +0300 -+++ src/Makefile.lnx 2011-09-27 08:41:42.000000000 +0400 -@@ -1,8 +1,8 @@ --GPP=g++ --GCC=gcc --FLAGS= -O2 -ffast-math --LIBS= -s -lpng -lsfml-window -lsfml-graphics -lsfml-system -lsfml-audio --TEMP_DIR=../tmp-lnx -+CXX?= g++ -+CXXFLAGS?= -O2 -ffast-math -+LIBS= -lpng -lsfml-window -lsfml-graphics -lsfml-system -lsfml-audio -lGL -+LDFLAGS?= -s -+TEMP_DIR= ../tmp-lnx - - all: ${TEMP_DIR} ../MotoGT.bin - -@@ -12,7 +12,7 @@ - rm -rf ${OBJS} ../MotoGT.bin - - ../MotoGT.bin: ${OBJS} -- ${GPP} ${OBJS} ${LIBS} -o $@ -+ ${CXX} ${LDFLAGS} ${LIBS} ${OBJS} -o $@ - - ${TEMP_DIR}: - mkdir ${TEMP_DIR} diff --git a/games/motogt/pkg-descr b/games/motogt/pkg-descr deleted file mode 100644 index ed5668d67f8a..000000000000 --- a/games/motogt/pkg-descr +++ /dev/null @@ -1,5 +0,0 @@ -MotoGT is 2D top-viewed game where you drive a MotoGP bike, and you -want to win races. In career mode you start with a regular bike, -but when you win races you get experience, and experience let's you -improve your bike. If you win championships, you can also unlock -hidden features. diff --git a/games/openclonk/Makefile b/games/openclonk/Makefile index e23354bf7ea1..a461147ee165 100644 --- a/games/openclonk/Makefile +++ b/games/openclonk/Makefile @@ -1,7 +1,7 @@ PORTNAME= openclonk DISTVERSION= 8.1 -PORTREVISION= 7 DISTVERSIONSUFFIX= -src +PORTREVISION= 8 CATEGORIES= games MASTER_SITES= http://www.openclonk.org/builds/release/${DISTVERSION}/ @@ -13,7 +13,6 @@ LICENSE= ISCL CC0-1.0 LICENSE_COMB= multi LICENSE_FILE_ISCL= ${WRKSRC}/COPYING -BROKEN_aarch64= fails to compile: mmintrin.h:50:12: invalid conversion between vector type '__m64' (vector of 1 'long long' value) and integer type 'int' of different size BROKEN_powerpc64= fails to compile: C4Texture.cpp:260:13: error: 'stoul' is not a member of 'std' LIB_DEPENDS= libalut.so:audio/freealut \ @@ -24,8 +23,6 @@ LIB_DEPENDS= libalut.so:audio/freealut \ libtinyxml.so:textproc/tinyxml \ libvorbis.so:audio/libvorbis -WRKSRC= ${WRKDIR}/openclonk-release-${PORTVERSION}-src - # make install has parallel issues with ninja USES= cmake:noninja compiler:c++14-lang desktop-file-utils gl gnome jpeg openal \ pkgconfig sdl tar:bzip2 xorg @@ -35,6 +32,7 @@ USE_XORG= x11 xpm CMAKE_ARGS= -DAudio_TK:STRING="OpenAL" CFLAGS_powerpc64le= -DNO_WARN_X86_INTRINSICS LDFLAGS_i386= -Wl,-znotext +WRKSRC= ${WRKDIR}/openclonk-release-${PORTVERSION}-src .include <bsd.port.pre.mk> @@ -42,8 +40,4 @@ LDFLAGS_i386= -Wl,-znotext LDFLAGS_i386+= -Wl,--no-check-dynamic-relocations .endif -post-patch: - @${REINPLACE_CMD} -e 's|DESTINATION games|DESTINATION bin|' \ - -e 's|share/games|share|' ${WRKSRC}/CMakeLists.txt - .include <bsd.port.post.mk> diff --git a/games/openclonk/distinfo b/games/openclonk/distinfo index 5da768b39294..463b137202dc 100644 --- a/games/openclonk/distinfo +++ b/games/openclonk/distinfo @@ -1,3 +1,7 @@ -TIMESTAMP = 1531177508 +TIMESTAMP = 1756900968 SHA256 (openclonk-8.1-src.tar.bz2) = 337677f25457e7137eac7818adb4ad02992d562593386c19b885738aaec4b346 SIZE (openclonk-8.1-src.tar.bz2) = 120149164 +SHA256 (288e9f339b2e0aba9a136e2c91283213d863c7d4.diff) = f5365d3d38d5ffe3708bce4dc79dd3737472f91c5ac75febe0b5895a46e89bca +SIZE (288e9f339b2e0aba9a136e2c91283213d863c7d4.diff) = 5112218 +SHA256 (c1ee1bdac7990605ad0271f2bcb09edea4524c5a.diff) = 2ca0700e27b3de680501837437fee7e6961ef1a43230f743641733e8ded81f24 +SIZE (c1ee1bdac7990605ad0271f2bcb09edea4524c5a.diff) = 139333 diff --git a/games/openclonk/files/patch-CMakeLists.txt b/games/openclonk/files/patch-CMakeLists.txt index 24afcb82ee29..592aebc110e9 100644 --- a/games/openclonk/files/patch-CMakeLists.txt +++ b/games/openclonk/files/patch-CMakeLists.txt @@ -1,6 +1,6 @@ --- CMakeLists.txt.orig 2018-03-16 17:25:33 UTC +++ CMakeLists.txt -@@ -91,7 +91,6 @@ function(add_linker_flags) +@@ -91,7 +91,6 @@ endfunction() endforeach() endfunction() @@ -8,7 +8,16 @@ if(USE_GCC_STYLE_LTCG) set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -flto") set(CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL} -flto") -@@ -337,8 +336,6 @@ if(READLINE_FOUND) +@@ -167,7 +166,7 @@ if(UNIX) + endif() + + if(UNIX) +- add_definitions("-DOC_SYSTEM_DATA_DIR=\"${CMAKE_INSTALL_PREFIX}/share/games/openclonk\"") ++ add_definitions("-DOC_SYSTEM_DATA_DIR=\"${CMAKE_INSTALL_PREFIX}/share/openclonk\"") + endif() + + if(APPLE) +@@ -337,8 +336,6 @@ SET(HAVE_LIBREADLINE ${READLINE_FOUND} CACHE INTERNAL endif() SET(HAVE_LIBREADLINE ${READLINE_FOUND} CACHE INTERNAL "libreadline available") @@ -17,7 +26,7 @@ # Select an audio library find_package("Audio") if(Audio_FOUND) -@@ -356,8 +353,6 @@ set(HAVE_SDL ${SDL2_FOUND}) +@@ -356,8 +353,6 @@ include_directories(SYSTEM ${SDL2_INCLUDE_DIRS}) include_directories(SYSTEM ${SDL2_INCLUDE_DIRS}) # Qt5 for editor @@ -26,3 +35,28 @@ if(Qt5Widgets_FOUND) SET(WITH_QT_EDITOR ${Qt5Widgets_FOUND} "Qt editor dialogues available") set(CMAKE_AUTOMOC ON) +@@ -1537,13 +1532,13 @@ foreach(group ${OC_C4GROUPS}) + DEPENDS "${native_c4group}" + VERBATIM + ) +- install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${group} DESTINATION share/games/openclonk) ++ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${group} DESTINATION share/openclonk) + endif() + endforeach() + + if(NOT APPLE) + if(NOT HEADLESS_ONLY) +- install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/planet/Music.ocg DESTINATION share/games/openclonk) ++ install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/planet/Music.ocg DESTINATION share/openclonk) + endif() + # group files (game data) + add_custom_target(groups DEPENDS ${OC_C4GROUPS}) +@@ -1563,7 +1558,7 @@ if(NOT HEADLESS_ONLY) + install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/openclonk.appdata.xml DESTINATION share/appdata) + + # Install binaries +- install(TARGETS openclonk DESTINATION games) ++ install(TARGETS openclonk DESTINATION bin) + else() + install(TARGETS openclonk + BUNDLE DESTINATION . diff --git a/games/openclonk/files/patch-blake2 b/games/openclonk/files/patch-blake2 new file mode 100644 index 000000000000..f7aa744692dd --- /dev/null +++ b/games/openclonk/files/patch-blake2 @@ -0,0 +1,10621 @@ +This patch set updates blake2 and enables compilation on non-x86. It is +an amalgamation of the following upstream patches, which could not be +taken from upstream directly due to the presence of a merge: + +c1ee1bdac Fix the most horrible merge I've done yet +c29148803 Merge branch 'blake2-no-sse2' into stable-8 +e0850947b BLAKE2: Fall back to plain C implementation on non-amd64 platforms +288e9f339 Merge commit '9493ed1277ef924c3005a9ff51f194d1cda87947' as 'thirdparty/blake2' + +Files not needed for compilation were omitted to save space. + +--- thirdparty/blake2/CMakeLists.txt.orig 2018-03-16 17:25:33 UTC ++++ thirdparty/blake2/CMakeLists.txt +@@ -11,33 +11,64 @@ + # To redistribute this file separately, substitute the full license texts + # for the above references. + +-add_library(blake2 STATIC +- blake2.h +-) ++include(CheckCSourceCompiles) + +-target_sources(blake2 +- PRIVATE +- blake2b.c +- blake2bp.c +- blake2s.c +- blake2sp.c +- blake2xb.c +- blake2xs.c +- blake2b-load-sse2.h +- blake2b-load-sse41.h +- blake2b-round.h +- blake2s-load-sse2.h +- blake2s-load-sse41.h +- blake2s-load-xop.h +- blake2s-round.h +- blake2-config.h +- blake2-impl.h +-) ++CHECK_C_SOURCE_COMPILES(" ++#if __x86_64 || __x86_64__ || __amd64 || __AMD64 || _M_X64 ++// x86-64 target system ++#else ++#error Not building for x86-64 ++#endif ++int main() {} ++" HAVE_X86_64) + +-include(CheckCCompilerFlag) +-CHECK_C_COMPILER_FLAG("-msse2" HAVE_CFLAG_MSSE2) +-target_compile_definitions(blake2 PRIVATE -DHAVE_SSE2) +-if(HAVE_CFLAG_MSSE2) +- target_compile_options(blake2 PUBLIC -msse2) ++option(BLAKE2B_USE_SSE2 "Use SSE2 instructions for BLAKE2b" ${HAVE_X86_64}) ++ ++if (BLAKE2B_USE_SSE2) ++ add_library(blake2 STATIC ++ sse/blake2.h ++ ) ++ ++ target_sources(blake2 ++ PRIVATE ++ sse/blake2b.c ++ sse/blake2bp.c ++ sse/blake2s.c ++ sse/blake2sp.c ++ sse/blake2xb.c ++ sse/blake2xs.c ++ sse/blake2b-load-sse2.h ++ sse/blake2b-load-sse41.h ++ sse/blake2b-round.h ++ sse/blake2s-load-sse2.h ++ sse/blake2s-load-sse41.h ++ sse/blake2s-load-xop.h ++ sse/blake2s-round.h ++ sse/blake2-config.h ++ sse/blake2-impl.h ++ ) ++ ++ include(CheckCCompilerFlag) ++ CHECK_C_COMPILER_FLAG("-msse2" HAVE_CFLAG_MSSE2) ++ target_compile_definitions(blake2 PRIVATE -DHAVE_SSE2) ++ if(HAVE_CFLAG_MSSE2) ++ target_compile_options(blake2 PUBLIC -msse2) ++ endif() ++ target_include_directories(blake2 PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/sse) ++else() ++ add_library(blake2 STATIC ++ ref/blake2.h ++ ) ++ ++ target_sources(blake2 ++ PRIVATE ++ ref/blake2bp-ref.c ++ ref/blake2b-ref.c ++ ref/blake2sp-ref.c ++ ref/blake2s-ref.c ++ ref/blake2xb-ref.c ++ ref/blake2xs-ref.c ++ ref/blake2-impl.h ++ ) ++ target_include_directories(blake2 PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/ref) + endif() +-target_include_directories(blake2 PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) +--- thirdparty/blake2/blake2-config.h.orig 2018-03-16 17:25:33 UTC ++++ thirdparty/blake2/blake2-config.h +@@ -1,72 +0,0 @@ +-/* +- BLAKE2 reference source code package - optimized C implementations +- +- Copyright 2012, Samuel Neves <sneves@dei.uc.pt>. You may use this under the +- terms of the CC0, the OpenSSL Licence, or the Apache Public License 2.0, at +- your option. The terms of these licenses can be found at: +- +- - CC0 1.0 Universal : http://creativecommons.org/publicdomain/zero/1.0 +- - OpenSSL license : https://www.openssl.org/source/license.html +- - Apache 2.0 : http://www.apache.org/licenses/LICENSE-2.0 +- +- More information about the BLAKE2 hash function can be found at +- https://blake2.net. +-*/ +-#ifndef BLAKE2_CONFIG_H +-#define BLAKE2_CONFIG_H +- +-/* These don't work everywhere */ +-#if defined(__SSE2__) || defined(__x86_64__) || defined(__amd64__) +-#define HAVE_SSE2 +-#endif +- +-#if defined(__SSSE3__) +-#define HAVE_SSSE3 +-#endif +- +-#if defined(__SSE4_1__) +-#define HAVE_SSE41 +-#endif +- +-#if defined(__AVX__) +-#define HAVE_AVX +-#endif +- +-#if defined(__XOP__) +-#define HAVE_XOP +-#endif +- +- +-#ifdef HAVE_AVX2 +-#ifndef HAVE_AVX +-#define HAVE_AVX +-#endif +-#endif +- +-#ifdef HAVE_XOP +-#ifndef HAVE_AVX +-#define HAVE_AVX +-#endif +-#endif +- +-#ifdef HAVE_AVX +-#ifndef HAVE_SSE41 +-#define HAVE_SSE41 +-#endif +-#endif +- +-#ifdef HAVE_SSE41 +-#ifndef HAVE_SSSE3 +-#define HAVE_SSSE3 +-#endif +-#endif +- +-#ifdef HAVE_SSSE3 +-#define HAVE_SSE2 +-#endif +- +-#if !defined(HAVE_SSE2) +-#error "This code requires at least SSE2." +-#endif +- +-#endif +--- thirdparty/blake2/blake2-impl.h.orig 2018-03-16 17:25:33 UTC ++++ thirdparty/blake2/blake2-impl.h +@@ -1,160 +0,0 @@ +-/* +- BLAKE2 reference source code package - reference C implementations +- +- Copyright 2012, Samuel Neves <sneves@dei.uc.pt>. You may use this under the +- terms of the CC0, the OpenSSL Licence, or the Apache Public License 2.0, at +- your option. The terms of these licenses can be found at: +- +- - CC0 1.0 Universal : http://creativecommons.org/publicdomain/zero/1.0 +- - OpenSSL license : https://www.openssl.org/source/license.html +- - Apache 2.0 : http://www.apache.org/licenses/LICENSE-2.0 +- +- More information about the BLAKE2 hash function can be found at +- https://blake2.net. +-*/ +-#ifndef BLAKE2_IMPL_H +-#define BLAKE2_IMPL_H +- +-#include <stdint.h> +-#include <string.h> +- +-#if !defined(__cplusplus) && (!defined(__STDC_VERSION__) || __STDC_VERSION__ < 199901L) +- #if defined(_MSC_VER) +- #define BLAKE2_INLINE __inline +- #elif defined(__GNUC__) +- #define BLAKE2_INLINE __inline__ +- #else +- #define BLAKE2_INLINE +- #endif +-#else +- #define BLAKE2_INLINE inline +-#endif +- +-static BLAKE2_INLINE uint32_t load32( const void *src ) +-{ +-#if defined(NATIVE_LITTLE_ENDIAN) +- uint32_t w; +- memcpy(&w, src, sizeof w); +- return w; +-#else +- const uint8_t *p = ( const uint8_t * )src; +- return (( uint32_t )( p[0] ) << 0) | +- (( uint32_t )( p[1] ) << 8) | +- (( uint32_t )( p[2] ) << 16) | +- (( uint32_t )( p[3] ) << 24) ; +-#endif +-} +- +-static BLAKE2_INLINE uint64_t load64( const void *src ) +-{ +-#if defined(NATIVE_LITTLE_ENDIAN) +- uint64_t w; +- memcpy(&w, src, sizeof w); +- return w; +-#else +- const uint8_t *p = ( const uint8_t * )src; +- return (( uint64_t )( p[0] ) << 0) | +- (( uint64_t )( p[1] ) << 8) | +- (( uint64_t )( p[2] ) << 16) | +- (( uint64_t )( p[3] ) << 24) | +- (( uint64_t )( p[4] ) << 32) | +- (( uint64_t )( p[5] ) << 40) | +- (( uint64_t )( p[6] ) << 48) | +- (( uint64_t )( p[7] ) << 56) ; +-#endif +-} +- +-static BLAKE2_INLINE uint16_t load16( const void *src ) +-{ +-#if defined(NATIVE_LITTLE_ENDIAN) +- uint16_t w; +- memcpy(&w, src, sizeof w); +- return w; +-#else +- const uint8_t *p = ( const uint8_t * )src; +- return (( uint16_t )( p[0] ) << 0) | +- (( uint16_t )( p[1] ) << 8) ; +-#endif +-} +- +-static BLAKE2_INLINE void store16( void *dst, uint16_t w ) +-{ +-#if defined(NATIVE_LITTLE_ENDIAN) +- memcpy(dst, &w, sizeof w); +-#else +- uint8_t *p = ( uint8_t * )dst; +- *p++ = ( uint8_t )w; w >>= 8; +- *p++ = ( uint8_t )w; +-#endif +-} +- +-static BLAKE2_INLINE void store32( void *dst, uint32_t w ) +-{ +-#if defined(NATIVE_LITTLE_ENDIAN) +- memcpy(dst, &w, sizeof w); +-#else +- uint8_t *p = ( uint8_t * )dst; +- p[0] = (uint8_t)(w >> 0); +- p[1] = (uint8_t)(w >> 8); +- p[2] = (uint8_t)(w >> 16); +- p[3] = (uint8_t)(w >> 24); +-#endif +-} +- +-static BLAKE2_INLINE void store64( void *dst, uint64_t w ) +-{ +-#if defined(NATIVE_LITTLE_ENDIAN) +- memcpy(dst, &w, sizeof w); +-#else +- uint8_t *p = ( uint8_t * )dst; +- p[0] = (uint8_t)(w >> 0); +- p[1] = (uint8_t)(w >> 8); +- p[2] = (uint8_t)(w >> 16); +- p[3] = (uint8_t)(w >> 24); +- p[4] = (uint8_t)(w >> 32); +- p[5] = (uint8_t)(w >> 40); +- p[6] = (uint8_t)(w >> 48); +- p[7] = (uint8_t)(w >> 56); +-#endif +-} +- +-static BLAKE2_INLINE uint64_t load48( const void *src ) +-{ +- const uint8_t *p = ( const uint8_t * )src; +- return (( uint64_t )( p[0] ) << 0) | +- (( uint64_t )( p[1] ) << 8) | +- (( uint64_t )( p[2] ) << 16) | +- (( uint64_t )( p[3] ) << 24) | +- (( uint64_t )( p[4] ) << 32) | +- (( uint64_t )( p[5] ) << 40) ; +-} +- +-static BLAKE2_INLINE void store48( void *dst, uint64_t w ) +-{ +- uint8_t *p = ( uint8_t * )dst; +- p[0] = (uint8_t)(w >> 0); +- p[1] = (uint8_t)(w >> 8); +- p[2] = (uint8_t)(w >> 16); +- p[3] = (uint8_t)(w >> 24); +- p[4] = (uint8_t)(w >> 32); +- p[5] = (uint8_t)(w >> 40); +-} +- +-static BLAKE2_INLINE uint32_t rotr32( const uint32_t w, const unsigned c ) +-{ +- return ( w >> c ) | ( w << ( 32 - c ) ); +-} +- +-static BLAKE2_INLINE uint64_t rotr64( const uint64_t w, const unsigned c ) +-{ +- return ( w >> c ) | ( w << ( 64 - c ) ); +-} +- +-/* prevents compiler optimizing out memset() */ +-static BLAKE2_INLINE void secure_zero_memory(void *v, size_t n) +-{ +- static void *(*const volatile memset_v)(void *, int, size_t) = &memset; +- memset_v(v, 0, n); +-} +- +-#endif +--- thirdparty/blake2/blake2.h.orig 2018-03-16 17:25:33 UTC ++++ thirdparty/blake2/blake2.h +@@ -1,195 +0,0 @@ +-/* +- BLAKE2 reference source code package - reference C implementations +- +- Copyright 2012, Samuel Neves <sneves@dei.uc.pt>. You may use this under the +- terms of the CC0, the OpenSSL Licence, or the Apache Public License 2.0, at +- your option. The terms of these licenses can be found at: +- +- - CC0 1.0 Universal : http://creativecommons.org/publicdomain/zero/1.0 +- - OpenSSL license : https://www.openssl.org/source/license.html +- - Apache 2.0 : http://www.apache.org/licenses/LICENSE-2.0 +- +- More information about the BLAKE2 hash function can be found at +- https://blake2.net. +-*/ +-#ifndef BLAKE2_H +-#define BLAKE2_H +- +-#include <stddef.h> +-#include <stdint.h> +- +-#if defined(_MSC_VER) +-#define BLAKE2_PACKED(x) __pragma(pack(push, 1)) x __pragma(pack(pop)) +-#else +-#define BLAKE2_PACKED(x) x __attribute__((packed)) +-#endif +- +-#if defined(__cplusplus) +-extern "C" { +-#endif +- +- enum blake2s_constant +- { +- BLAKE2S_BLOCKBYTES = 64, +- BLAKE2S_OUTBYTES = 32, +- BLAKE2S_KEYBYTES = 32, +- BLAKE2S_SALTBYTES = 8, +- BLAKE2S_PERSONALBYTES = 8 +- }; +- +- enum blake2b_constant +- { +- BLAKE2B_BLOCKBYTES = 128, +- BLAKE2B_OUTBYTES = 64, +- BLAKE2B_KEYBYTES = 64, +- BLAKE2B_SALTBYTES = 16, +- BLAKE2B_PERSONALBYTES = 16 +- }; +- +- typedef struct blake2s_state__ +- { +- uint32_t h[8]; +- uint32_t t[2]; +- uint32_t f[2]; +- uint8_t buf[BLAKE2S_BLOCKBYTES]; +- size_t buflen; +- size_t outlen; +- uint8_t last_node; +- } blake2s_state; +- +- typedef struct blake2b_state__ +- { +- uint64_t h[8]; +- uint64_t t[2]; +- uint64_t f[2]; +- uint8_t buf[BLAKE2B_BLOCKBYTES]; +- size_t buflen; +- size_t outlen; +- uint8_t last_node; +- } blake2b_state; +- +- typedef struct blake2sp_state__ +- { +- blake2s_state S[8][1]; +- blake2s_state R[1]; +- uint8_t buf[8 * BLAKE2S_BLOCKBYTES]; +- size_t buflen; +- size_t outlen; +- } blake2sp_state; +- +- typedef struct blake2bp_state__ +- { +- blake2b_state S[4][1]; +- blake2b_state R[1]; +- uint8_t buf[4 * BLAKE2B_BLOCKBYTES]; +- size_t buflen; +- size_t outlen; +- } blake2bp_state; +- +- +- BLAKE2_PACKED(struct blake2s_param__ +- { +- uint8_t digest_length; /* 1 */ +- uint8_t key_length; /* 2 */ +- uint8_t fanout; /* 3 */ +- uint8_t depth; /* 4 */ +- uint32_t leaf_length; /* 8 */ +- uint32_t node_offset; /* 12 */ +- uint16_t xof_length; /* 14 */ +- uint8_t node_depth; /* 15 */ +- uint8_t inner_length; /* 16 */ +- /* uint8_t reserved[0]; */ +- uint8_t salt[BLAKE2S_SALTBYTES]; /* 24 */ +- uint8_t personal[BLAKE2S_PERSONALBYTES]; /* 32 */ +- }); +- +- typedef struct blake2s_param__ blake2s_param; +- +- BLAKE2_PACKED(struct blake2b_param__ +- { +- uint8_t digest_length; /* 1 */ +- uint8_t key_length; /* 2 */ +- uint8_t fanout; /* 3 */ +- uint8_t depth; /* 4 */ +- uint32_t leaf_length; /* 8 */ +- uint32_t node_offset; /* 12 */ +- uint32_t xof_length; /* 16 */ +- uint8_t node_depth; /* 17 */ +- uint8_t inner_length; /* 18 */ +- uint8_t reserved[14]; /* 32 */ +- uint8_t salt[BLAKE2B_SALTBYTES]; /* 48 */ +- uint8_t personal[BLAKE2B_PERSONALBYTES]; /* 64 */ +- }); +- +- typedef struct blake2b_param__ blake2b_param; +- +- typedef struct blake2xs_state__ +- { +- blake2s_state S[1]; +- blake2s_param P[1]; +- } blake2xs_state; +- +- typedef struct blake2xb_state__ +- { +- blake2b_state S[1]; +- blake2b_param P[1]; +- } blake2xb_state; +- +- /* Padded structs result in a compile-time error */ +- enum { +- BLAKE2_DUMMY_1 = 1/(sizeof(blake2s_param) == BLAKE2S_OUTBYTES), +- BLAKE2_DUMMY_2 = 1/(sizeof(blake2b_param) == BLAKE2B_OUTBYTES) +- }; +- +- /* Streaming API */ +- int blake2s_init( blake2s_state *S, size_t outlen ); +- int blake2s_init_key( blake2s_state *S, size_t outlen, const void *key, size_t keylen ); +- int blake2s_init_param( blake2s_state *S, const blake2s_param *P ); +- int blake2s_update( blake2s_state *S, const void *in, size_t inlen ); +- int blake2s_final( blake2s_state *S, void *out, size_t outlen ); +- +- int blake2b_init( blake2b_state *S, size_t outlen ); +- int blake2b_init_key( blake2b_state *S, size_t outlen, const void *key, size_t keylen ); +- int blake2b_init_param( blake2b_state *S, const blake2b_param *P ); +- int blake2b_update( blake2b_state *S, const void *in, size_t inlen ); +- int blake2b_final( blake2b_state *S, void *out, size_t outlen ); +- +- int blake2sp_init( blake2sp_state *S, size_t outlen ); +- int blake2sp_init_key( blake2sp_state *S, size_t outlen, const void *key, size_t keylen ); +- int blake2sp_update( blake2sp_state *S, const void *in, size_t inlen ); +- int blake2sp_final( blake2sp_state *S, void *out, size_t outlen ); +- +- int blake2bp_init( blake2bp_state *S, size_t outlen ); +- int blake2bp_init_key( blake2bp_state *S, size_t outlen, const void *key, size_t keylen ); +- int blake2bp_update( blake2bp_state *S, const void *in, size_t inlen ); +- int blake2bp_final( blake2bp_state *S, void *out, size_t outlen ); +- +- /* Variable output length API */ +- int blake2xs_init( blake2xs_state *S, const size_t outlen ); +- int blake2xs_init_key( blake2xs_state *S, const size_t outlen, const void *key, size_t keylen ); +- int blake2xs_update( blake2xs_state *S, const void *in, size_t inlen ); +- int blake2xs_final(blake2xs_state *S, void *out, size_t outlen); +- +- int blake2xb_init( blake2xb_state *S, const size_t outlen ); +- int blake2xb_init_key( blake2xb_state *S, const size_t outlen, const void *key, size_t keylen ); +- int blake2xb_update( blake2xb_state *S, const void *in, size_t inlen ); +- int blake2xb_final(blake2xb_state *S, void *out, size_t outlen); +- +- /* Simple API */ +- int blake2s( void *out, size_t outlen, const void *in, size_t inlen, const void *key, size_t keylen ); +- int blake2b( void *out, size_t outlen, const void *in, size_t inlen, const void *key, size_t keylen ); +- +- int blake2sp( void *out, size_t outlen, const void *in, size_t inlen, const void *key, size_t keylen ); +- int blake2bp( void *out, size_t outlen, const void *in, size_t inlen, const void *key, size_t keylen ); +- +- int blake2xs( void *out, size_t outlen, const void *in, size_t inlen, const void *key, size_t keylen ); +- int blake2xb( void *out, size_t outlen, const void *in, size_t inlen, const void *key, size_t keylen ); +- +- /* This is simply an alias for blake2b */ +- int blake2( void *out, size_t outlen, const void *in, size_t inlen, const void *key, size_t keylen ); +- +-#if defined(__cplusplus) +-} +-#endif +- +-#endif +--- thirdparty/blake2/blake2b-load-sse2.h.orig 2018-03-16 17:25:33 UTC ++++ thirdparty/blake2/blake2b-load-sse2.h +@@ -1,68 +0,0 @@ +-/* +- BLAKE2 reference source code package - optimized C implementations +- +- Copyright 2012, Samuel Neves <sneves@dei.uc.pt>. You may use this under the +- terms of the CC0, the OpenSSL Licence, or the Apache Public License 2.0, at +- your option. The terms of these licenses can be found at: +- +- - CC0 1.0 Universal : http://creativecommons.org/publicdomain/zero/1.0 +- - OpenSSL license : https://www.openssl.org/source/license.html +- - Apache 2.0 : http://www.apache.org/licenses/LICENSE-2.0 +- +- More information about the BLAKE2 hash function can be found at +- https://blake2.net. +-*/ +-#ifndef BLAKE2B_LOAD_SSE2_H +-#define BLAKE2B_LOAD_SSE2_H +- +-#define LOAD_MSG_0_1(b0, b1) b0 = _mm_set_epi64x(m2, m0); b1 = _mm_set_epi64x(m6, m4) +-#define LOAD_MSG_0_2(b0, b1) b0 = _mm_set_epi64x(m3, m1); b1 = _mm_set_epi64x(m7, m5) +-#define LOAD_MSG_0_3(b0, b1) b0 = _mm_set_epi64x(m10, m8); b1 = _mm_set_epi64x(m14, m12) +-#define LOAD_MSG_0_4(b0, b1) b0 = _mm_set_epi64x(m11, m9); b1 = _mm_set_epi64x(m15, m13) +-#define LOAD_MSG_1_1(b0, b1) b0 = _mm_set_epi64x(m4, m14); b1 = _mm_set_epi64x(m13, m9) +-#define LOAD_MSG_1_2(b0, b1) b0 = _mm_set_epi64x(m8, m10); b1 = _mm_set_epi64x(m6, m15) +-#define LOAD_MSG_1_3(b0, b1) b0 = _mm_set_epi64x(m0, m1); b1 = _mm_set_epi64x(m5, m11) +-#define LOAD_MSG_1_4(b0, b1) b0 = _mm_set_epi64x(m2, m12); b1 = _mm_set_epi64x(m3, m7) +-#define LOAD_MSG_2_1(b0, b1) b0 = _mm_set_epi64x(m12, m11); b1 = _mm_set_epi64x(m15, m5) +-#define LOAD_MSG_2_2(b0, b1) b0 = _mm_set_epi64x(m0, m8); b1 = _mm_set_epi64x(m13, m2) +-#define LOAD_MSG_2_3(b0, b1) b0 = _mm_set_epi64x(m3, m10); b1 = _mm_set_epi64x(m9, m7) +-#define LOAD_MSG_2_4(b0, b1) b0 = _mm_set_epi64x(m6, m14); b1 = _mm_set_epi64x(m4, m1) +-#define LOAD_MSG_3_1(b0, b1) b0 = _mm_set_epi64x(m3, m7); b1 = _mm_set_epi64x(m11, m13) +-#define LOAD_MSG_3_2(b0, b1) b0 = _mm_set_epi64x(m1, m9); b1 = _mm_set_epi64x(m14, m12) +-#define LOAD_MSG_3_3(b0, b1) b0 = _mm_set_epi64x(m5, m2); b1 = _mm_set_epi64x(m15, m4) +-#define LOAD_MSG_3_4(b0, b1) b0 = _mm_set_epi64x(m10, m6); b1 = _mm_set_epi64x(m8, m0) +-#define LOAD_MSG_4_1(b0, b1) b0 = _mm_set_epi64x(m5, m9); b1 = _mm_set_epi64x(m10, m2) +-#define LOAD_MSG_4_2(b0, b1) b0 = _mm_set_epi64x(m7, m0); b1 = _mm_set_epi64x(m15, m4) +-#define LOAD_MSG_4_3(b0, b1) b0 = _mm_set_epi64x(m11, m14); b1 = _mm_set_epi64x(m3, m6) +-#define LOAD_MSG_4_4(b0, b1) b0 = _mm_set_epi64x(m12, m1); b1 = _mm_set_epi64x(m13, m8) +-#define LOAD_MSG_5_1(b0, b1) b0 = _mm_set_epi64x(m6, m2); b1 = _mm_set_epi64x(m8, m0) +-#define LOAD_MSG_5_2(b0, b1) b0 = _mm_set_epi64x(m10, m12); b1 = _mm_set_epi64x(m3, m11) +-#define LOAD_MSG_5_3(b0, b1) b0 = _mm_set_epi64x(m7, m4); b1 = _mm_set_epi64x(m1, m15) +-#define LOAD_MSG_5_4(b0, b1) b0 = _mm_set_epi64x(m5, m13); b1 = _mm_set_epi64x(m9, m14) +-#define LOAD_MSG_6_1(b0, b1) b0 = _mm_set_epi64x(m1, m12); b1 = _mm_set_epi64x(m4, m14) +-#define LOAD_MSG_6_2(b0, b1) b0 = _mm_set_epi64x(m15, m5); b1 = _mm_set_epi64x(m10, m13) +-#define LOAD_MSG_6_3(b0, b1) b0 = _mm_set_epi64x(m6, m0); b1 = _mm_set_epi64x(m8, m9) +-#define LOAD_MSG_6_4(b0, b1) b0 = _mm_set_epi64x(m3, m7); b1 = _mm_set_epi64x(m11, m2) +-#define LOAD_MSG_7_1(b0, b1) b0 = _mm_set_epi64x(m7, m13); b1 = _mm_set_epi64x(m3, m12) +-#define LOAD_MSG_7_2(b0, b1) b0 = _mm_set_epi64x(m14, m11); b1 = _mm_set_epi64x(m9, m1) +-#define LOAD_MSG_7_3(b0, b1) b0 = _mm_set_epi64x(m15, m5); b1 = _mm_set_epi64x(m2, m8) +-#define LOAD_MSG_7_4(b0, b1) b0 = _mm_set_epi64x(m4, m0); b1 = _mm_set_epi64x(m10, m6) +-#define LOAD_MSG_8_1(b0, b1) b0 = _mm_set_epi64x(m14, m6); b1 = _mm_set_epi64x(m0, m11) +-#define LOAD_MSG_8_2(b0, b1) b0 = _mm_set_epi64x(m9, m15); b1 = _mm_set_epi64x(m8, m3) +-#define LOAD_MSG_8_3(b0, b1) b0 = _mm_set_epi64x(m13, m12); b1 = _mm_set_epi64x(m10, m1) +-#define LOAD_MSG_8_4(b0, b1) b0 = _mm_set_epi64x(m7, m2); b1 = _mm_set_epi64x(m5, m4) +-#define LOAD_MSG_9_1(b0, b1) b0 = _mm_set_epi64x(m8, m10); b1 = _mm_set_epi64x(m1, m7) +-#define LOAD_MSG_9_2(b0, b1) b0 = _mm_set_epi64x(m4, m2); b1 = _mm_set_epi64x(m5, m6) +-#define LOAD_MSG_9_3(b0, b1) b0 = _mm_set_epi64x(m9, m15); b1 = _mm_set_epi64x(m13, m3) +-#define LOAD_MSG_9_4(b0, b1) b0 = _mm_set_epi64x(m14, m11); b1 = _mm_set_epi64x(m0, m12) +-#define LOAD_MSG_10_1(b0, b1) b0 = _mm_set_epi64x(m2, m0); b1 = _mm_set_epi64x(m6, m4) +-#define LOAD_MSG_10_2(b0, b1) b0 = _mm_set_epi64x(m3, m1); b1 = _mm_set_epi64x(m7, m5) +-#define LOAD_MSG_10_3(b0, b1) b0 = _mm_set_epi64x(m10, m8); b1 = _mm_set_epi64x(m14, m12) +-#define LOAD_MSG_10_4(b0, b1) b0 = _mm_set_epi64x(m11, m9); b1 = _mm_set_epi64x(m15, m13) +-#define LOAD_MSG_11_1(b0, b1) b0 = _mm_set_epi64x(m4, m14); b1 = _mm_set_epi64x(m13, m9) +-#define LOAD_MSG_11_2(b0, b1) b0 = _mm_set_epi64x(m8, m10); b1 = _mm_set_epi64x(m6, m15) +-#define LOAD_MSG_11_3(b0, b1) b0 = _mm_set_epi64x(m0, m1); b1 = _mm_set_epi64x(m5, m11) +-#define LOAD_MSG_11_4(b0, b1) b0 = _mm_set_epi64x(m2, m12); b1 = _mm_set_epi64x(m3, m7) +- +- +-#endif +--- thirdparty/blake2/blake2b-load-sse41.h.orig 2018-03-16 17:25:33 UTC ++++ thirdparty/blake2/blake2b-load-sse41.h +@@ -1,402 +0,0 @@ +-/* +- BLAKE2 reference source code package - optimized C implementations +- +- Copyright 2012, Samuel Neves <sneves@dei.uc.pt>. You may use this under the +- terms of the CC0, the OpenSSL Licence, or the Apache Public License 2.0, at +- your option. The terms of these licenses can be found at: +- +- - CC0 1.0 Universal : http://creativecommons.org/publicdomain/zero/1.0 +- - OpenSSL license : https://www.openssl.org/source/license.html +- - Apache 2.0 : http://www.apache.org/licenses/LICENSE-2.0 +- +- More information about the BLAKE2 hash function can be found at +- https://blake2.net. +-*/ +-#ifndef BLAKE2B_LOAD_SSE41_H +-#define BLAKE2B_LOAD_SSE41_H +- +-#define LOAD_MSG_0_1(b0, b1) \ +-do \ +-{ \ +-b0 = _mm_unpacklo_epi64(m0, m1); \ +-b1 = _mm_unpacklo_epi64(m2, m3); \ +-} while(0) +- +- +-#define LOAD_MSG_0_2(b0, b1) \ +-do \ +-{ \ +-b0 = _mm_unpackhi_epi64(m0, m1); \ +-b1 = _mm_unpackhi_epi64(m2, m3); \ +-} while(0) +- +- +-#define LOAD_MSG_0_3(b0, b1) \ +-do \ +-{ \ +-b0 = _mm_unpacklo_epi64(m4, m5); \ +-b1 = _mm_unpacklo_epi64(m6, m7); \ +-} while(0) +- +- +-#define LOAD_MSG_0_4(b0, b1) \ +-do \ +-{ \ +-b0 = _mm_unpackhi_epi64(m4, m5); \ +-b1 = _mm_unpackhi_epi64(m6, m7); \ +-} while(0) +- +- +-#define LOAD_MSG_1_1(b0, b1) \ +-do \ +-{ \ +-b0 = _mm_unpacklo_epi64(m7, m2); \ +-b1 = _mm_unpackhi_epi64(m4, m6); \ +-} while(0) +- +- +-#define LOAD_MSG_1_2(b0, b1) \ +-do \ +-{ \ +-b0 = _mm_unpacklo_epi64(m5, m4); \ +-b1 = _mm_alignr_epi8(m3, m7, 8); \ +-} while(0) +- +- +-#define LOAD_MSG_1_3(b0, b1) \ +-do \ +-{ \ +-b0 = _mm_shuffle_epi32(m0, _MM_SHUFFLE(1,0,3,2)); \ +-b1 = _mm_unpackhi_epi64(m5, m2); \ +-} while(0) +- +- +-#define LOAD_MSG_1_4(b0, b1) \ +-do \ +-{ \ +-b0 = _mm_unpacklo_epi64(m6, m1); \ +-b1 = _mm_unpackhi_epi64(m3, m1); \ +-} while(0) +- +- +-#define LOAD_MSG_2_1(b0, b1) \ +-do \ +-{ \ +-b0 = _mm_alignr_epi8(m6, m5, 8); \ +-b1 = _mm_unpackhi_epi64(m2, m7); \ +-} while(0) +- +- +-#define LOAD_MSG_2_2(b0, b1) \ +-do \ +-{ \ +-b0 = _mm_unpacklo_epi64(m4, m0); \ +-b1 = _mm_blend_epi16(m1, m6, 0xF0); \ +-} while(0) +- +- +-#define LOAD_MSG_2_3(b0, b1) \ +-do \ +-{ \ +-b0 = _mm_blend_epi16(m5, m1, 0xF0); \ +-b1 = _mm_unpackhi_epi64(m3, m4); \ +-} while(0) +- +- +-#define LOAD_MSG_2_4(b0, b1) \ +-do \ +-{ \ +-b0 = _mm_unpacklo_epi64(m7, m3); \ +-b1 = _mm_alignr_epi8(m2, m0, 8); \ +-} while(0) +- +- +-#define LOAD_MSG_3_1(b0, b1) \ +-do \ +-{ \ +-b0 = _mm_unpackhi_epi64(m3, m1); \ +-b1 = _mm_unpackhi_epi64(m6, m5); \ +-} while(0) +- +- +-#define LOAD_MSG_3_2(b0, b1) \ +-do \ +-{ \ +-b0 = _mm_unpackhi_epi64(m4, m0); \ +-b1 = _mm_unpacklo_epi64(m6, m7); \ +-} while(0) +- +- +-#define LOAD_MSG_3_3(b0, b1) \ +-do \ +-{ \ +-b0 = _mm_blend_epi16(m1, m2, 0xF0); \ +-b1 = _mm_blend_epi16(m2, m7, 0xF0); \ +-} while(0) +- +- +-#define LOAD_MSG_3_4(b0, b1) \ +-do \ +-{ \ +-b0 = _mm_unpacklo_epi64(m3, m5); \ +-b1 = _mm_unpacklo_epi64(m0, m4); \ +-} while(0) +- +- +-#define LOAD_MSG_4_1(b0, b1) \ +-do \ +-{ \ +-b0 = _mm_unpackhi_epi64(m4, m2); \ +-b1 = _mm_unpacklo_epi64(m1, m5); \ +-} while(0) +- +- +-#define LOAD_MSG_4_2(b0, b1) \ +-do \ +-{ \ +-b0 = _mm_blend_epi16(m0, m3, 0xF0); \ +-b1 = _mm_blend_epi16(m2, m7, 0xF0); \ +-} while(0) +- +- +-#define LOAD_MSG_4_3(b0, b1) \ +-do \ +-{ \ +-b0 = _mm_blend_epi16(m7, m5, 0xF0); \ +-b1 = _mm_blend_epi16(m3, m1, 0xF0); \ +-} while(0) +- +- +-#define LOAD_MSG_4_4(b0, b1) \ +-do \ +-{ \ +-b0 = _mm_alignr_epi8(m6, m0, 8); \ +-b1 = _mm_blend_epi16(m4, m6, 0xF0); \ +-} while(0) +- +- +-#define LOAD_MSG_5_1(b0, b1) \ +-do \ +-{ \ +-b0 = _mm_unpacklo_epi64(m1, m3); \ +-b1 = _mm_unpacklo_epi64(m0, m4); \ +-} while(0) +- +- +-#define LOAD_MSG_5_2(b0, b1) \ +-do \ +-{ \ +-b0 = _mm_unpacklo_epi64(m6, m5); \ +-b1 = _mm_unpackhi_epi64(m5, m1); \ +-} while(0) +- +- +-#define LOAD_MSG_5_3(b0, b1) \ +-do \ +-{ \ +-b0 = _mm_blend_epi16(m2, m3, 0xF0); \ +-b1 = _mm_unpackhi_epi64(m7, m0); \ +-} while(0) +- +- +-#define LOAD_MSG_5_4(b0, b1) \ +-do \ +-{ \ +-b0 = _mm_unpackhi_epi64(m6, m2); \ +-b1 = _mm_blend_epi16(m7, m4, 0xF0); \ +-} while(0) +- +- +-#define LOAD_MSG_6_1(b0, b1) \ +-do \ +-{ \ +-b0 = _mm_blend_epi16(m6, m0, 0xF0); \ +-b1 = _mm_unpacklo_epi64(m7, m2); \ +-} while(0) +- +- +-#define LOAD_MSG_6_2(b0, b1) \ +-do \ +-{ \ +-b0 = _mm_unpackhi_epi64(m2, m7); \ +-b1 = _mm_alignr_epi8(m5, m6, 8); \ +-} while(0) +- +- +-#define LOAD_MSG_6_3(b0, b1) \ +-do \ +-{ \ +-b0 = _mm_unpacklo_epi64(m0, m3); \ +-b1 = _mm_shuffle_epi32(m4, _MM_SHUFFLE(1,0,3,2)); \ +-} while(0) +- +- +-#define LOAD_MSG_6_4(b0, b1) \ +-do \ +-{ \ +-b0 = _mm_unpackhi_epi64(m3, m1); \ +-b1 = _mm_blend_epi16(m1, m5, 0xF0); \ +-} while(0) +- +- +-#define LOAD_MSG_7_1(b0, b1) \ +-do \ +-{ \ +-b0 = _mm_unpackhi_epi64(m6, m3); \ +-b1 = _mm_blend_epi16(m6, m1, 0xF0); \ +-} while(0) +- +- +-#define LOAD_MSG_7_2(b0, b1) \ +-do \ +-{ \ +-b0 = _mm_alignr_epi8(m7, m5, 8); \ +-b1 = _mm_unpackhi_epi64(m0, m4); \ +-} while(0) +- +- +-#define LOAD_MSG_7_3(b0, b1) \ +-do \ +-{ \ +-b0 = _mm_unpackhi_epi64(m2, m7); \ +-b1 = _mm_unpacklo_epi64(m4, m1); \ +-} while(0) +- +- +-#define LOAD_MSG_7_4(b0, b1) \ +-do \ +-{ \ +-b0 = _mm_unpacklo_epi64(m0, m2); \ +-b1 = _mm_unpacklo_epi64(m3, m5); \ +-} while(0) +- +- +-#define LOAD_MSG_8_1(b0, b1) \ +-do \ +-{ \ +-b0 = _mm_unpacklo_epi64(m3, m7); \ +-b1 = _mm_alignr_epi8(m0, m5, 8); \ +-} while(0) +- +- +-#define LOAD_MSG_8_2(b0, b1) \ +-do \ +-{ \ +-b0 = _mm_unpackhi_epi64(m7, m4); \ +-b1 = _mm_alignr_epi8(m4, m1, 8); \ +-} while(0) +- +- +-#define LOAD_MSG_8_3(b0, b1) \ +-do \ +-{ \ +-b0 = m6; \ +-b1 = _mm_alignr_epi8(m5, m0, 8); \ +-} while(0) +- +- +-#define LOAD_MSG_8_4(b0, b1) \ +-do \ +-{ \ +-b0 = _mm_blend_epi16(m1, m3, 0xF0); \ +-b1 = m2; \ +-} while(0) +- +- +-#define LOAD_MSG_9_1(b0, b1) \ +-do \ +-{ \ +-b0 = _mm_unpacklo_epi64(m5, m4); \ +-b1 = _mm_unpackhi_epi64(m3, m0); \ +-} while(0) +- +- +-#define LOAD_MSG_9_2(b0, b1) \ +-do \ +-{ \ +-b0 = _mm_unpacklo_epi64(m1, m2); \ +-b1 = _mm_blend_epi16(m3, m2, 0xF0); \ +-} while(0) +- +- +-#define LOAD_MSG_9_3(b0, b1) \ +-do \ +-{ \ +-b0 = _mm_unpackhi_epi64(m7, m4); \ +-b1 = _mm_unpackhi_epi64(m1, m6); \ +-} while(0) +- +- +-#define LOAD_MSG_9_4(b0, b1) \ +-do \ +-{ \ +-b0 = _mm_alignr_epi8(m7, m5, 8); \ +-b1 = _mm_unpacklo_epi64(m6, m0); \ +-} while(0) +- +- +-#define LOAD_MSG_10_1(b0, b1) \ +-do \ +-{ \ +-b0 = _mm_unpacklo_epi64(m0, m1); \ +-b1 = _mm_unpacklo_epi64(m2, m3); \ +-} while(0) +- +- +-#define LOAD_MSG_10_2(b0, b1) \ +-do \ +-{ \ +-b0 = _mm_unpackhi_epi64(m0, m1); \ +-b1 = _mm_unpackhi_epi64(m2, m3); \ +-} while(0) +- +- +-#define LOAD_MSG_10_3(b0, b1) \ +-do \ +-{ \ +-b0 = _mm_unpacklo_epi64(m4, m5); \ +-b1 = _mm_unpacklo_epi64(m6, m7); \ +-} while(0) +- +- +-#define LOAD_MSG_10_4(b0, b1) \ +-do \ +-{ \ +-b0 = _mm_unpackhi_epi64(m4, m5); \ +-b1 = _mm_unpackhi_epi64(m6, m7); \ +-} while(0) +- +- +-#define LOAD_MSG_11_1(b0, b1) \ +-do \ +-{ \ +-b0 = _mm_unpacklo_epi64(m7, m2); \ +-b1 = _mm_unpackhi_epi64(m4, m6); \ +-} while(0) +- +- +-#define LOAD_MSG_11_2(b0, b1) \ +-do \ +-{ \ +-b0 = _mm_unpacklo_epi64(m5, m4); \ +-b1 = _mm_alignr_epi8(m3, m7, 8); \ +-} while(0) +- +- +-#define LOAD_MSG_11_3(b0, b1) \ +-do \ +-{ \ +-b0 = _mm_shuffle_epi32(m0, _MM_SHUFFLE(1,0,3,2)); \ +-b1 = _mm_unpackhi_epi64(m5, m2); \ +-} while(0) +- +- +-#define LOAD_MSG_11_4(b0, b1) \ +-do \ +-{ \ +-b0 = _mm_unpacklo_epi64(m6, m1); \ +-b1 = _mm_unpackhi_epi64(m3, m1); \ +-} while(0) +- +- +-#endif +--- thirdparty/blake2/blake2b-round.h.orig 2018-03-16 17:25:33 UTC ++++ thirdparty/blake2/blake2b-round.h +@@ -1,157 +0,0 @@ +-/* +- BLAKE2 reference source code package - optimized C implementations +- +- Copyright 2012, Samuel Neves <sneves@dei.uc.pt>. You may use this under the +- terms of the CC0, the OpenSSL Licence, or the Apache Public License 2.0, at +- your option. The terms of these licenses can be found at: +- +- - CC0 1.0 Universal : http://creativecommons.org/publicdomain/zero/1.0 +- - OpenSSL license : https://www.openssl.org/source/license.html +- - Apache 2.0 : http://www.apache.org/licenses/LICENSE-2.0 +- +- More information about the BLAKE2 hash function can be found at +- https://blake2.net. +-*/ +-#ifndef BLAKE2B_ROUND_H +-#define BLAKE2B_ROUND_H +- +-#define LOADU(p) _mm_loadu_si128( (const __m128i *)(p) ) +-#define STOREU(p,r) _mm_storeu_si128((__m128i *)(p), r) +- +-#define TOF(reg) _mm_castsi128_ps((reg)) +-#define TOI(reg) _mm_castps_si128((reg)) +- +-#define LIKELY(x) __builtin_expect((x),1) +- +- +-/* Microarchitecture-specific macros */ +-#ifndef HAVE_XOP +-#ifdef HAVE_SSSE3 +-#define _mm_roti_epi64(x, c) \ +- (-(c) == 32) ? _mm_shuffle_epi32((x), _MM_SHUFFLE(2,3,0,1)) \ +- : (-(c) == 24) ? _mm_shuffle_epi8((x), r24) \ +- : (-(c) == 16) ? _mm_shuffle_epi8((x), r16) \ +- : (-(c) == 63) ? _mm_xor_si128(_mm_srli_epi64((x), -(c)), _mm_add_epi64((x), (x))) \ +- : _mm_xor_si128(_mm_srli_epi64((x), -(c)), _mm_slli_epi64((x), 64-(-(c)))) +-#else +-#define _mm_roti_epi64(r, c) _mm_xor_si128(_mm_srli_epi64( (r), -(c) ),_mm_slli_epi64( (r), 64-(-(c)) )) +-#endif +-#else +-/* ... */ +-#endif +- +- +- +-#define G1(row1l,row2l,row3l,row4l,row1h,row2h,row3h,row4h,b0,b1) \ +- row1l = _mm_add_epi64(_mm_add_epi64(row1l, b0), row2l); \ +- row1h = _mm_add_epi64(_mm_add_epi64(row1h, b1), row2h); \ +- \ +- row4l = _mm_xor_si128(row4l, row1l); \ +- row4h = _mm_xor_si128(row4h, row1h); \ +- \ +- row4l = _mm_roti_epi64(row4l, -32); \ +- row4h = _mm_roti_epi64(row4h, -32); \ +- \ +- row3l = _mm_add_epi64(row3l, row4l); \ +- row3h = _mm_add_epi64(row3h, row4h); \ +- \ +- row2l = _mm_xor_si128(row2l, row3l); \ +- row2h = _mm_xor_si128(row2h, row3h); \ +- \ +- row2l = _mm_roti_epi64(row2l, -24); \ +- row2h = _mm_roti_epi64(row2h, -24); \ +- +-#define G2(row1l,row2l,row3l,row4l,row1h,row2h,row3h,row4h,b0,b1) \ +- row1l = _mm_add_epi64(_mm_add_epi64(row1l, b0), row2l); \ +- row1h = _mm_add_epi64(_mm_add_epi64(row1h, b1), row2h); \ +- \ +- row4l = _mm_xor_si128(row4l, row1l); \ +- row4h = _mm_xor_si128(row4h, row1h); \ +- \ +- row4l = _mm_roti_epi64(row4l, -16); \ +- row4h = _mm_roti_epi64(row4h, -16); \ +- \ +- row3l = _mm_add_epi64(row3l, row4l); \ +- row3h = _mm_add_epi64(row3h, row4h); \ +- \ +- row2l = _mm_xor_si128(row2l, row3l); \ +- row2h = _mm_xor_si128(row2h, row3h); \ +- \ +- row2l = _mm_roti_epi64(row2l, -63); \ +- row2h = _mm_roti_epi64(row2h, -63); \ +- +-#if defined(HAVE_SSSE3) +-#define DIAGONALIZE(row1l,row2l,row3l,row4l,row1h,row2h,row3h,row4h) \ +- t0 = _mm_alignr_epi8(row2h, row2l, 8); \ +- t1 = _mm_alignr_epi8(row2l, row2h, 8); \ +- row2l = t0; \ +- row2h = t1; \ +- \ +- t0 = row3l; \ +- row3l = row3h; \ +- row3h = t0; \ +- \ +- t0 = _mm_alignr_epi8(row4h, row4l, 8); \ +- t1 = _mm_alignr_epi8(row4l, row4h, 8); \ +- row4l = t1; \ +- row4h = t0; +- +-#define UNDIAGONALIZE(row1l,row2l,row3l,row4l,row1h,row2h,row3h,row4h) \ +- t0 = _mm_alignr_epi8(row2l, row2h, 8); \ +- t1 = _mm_alignr_epi8(row2h, row2l, 8); \ +- row2l = t0; \ +- row2h = t1; \ +- \ +- t0 = row3l; \ +- row3l = row3h; \ +- row3h = t0; \ +- \ +- t0 = _mm_alignr_epi8(row4l, row4h, 8); \ +- t1 = _mm_alignr_epi8(row4h, row4l, 8); \ +- row4l = t1; \ +- row4h = t0; +-#else +- +-#define DIAGONALIZE(row1l,row2l,row3l,row4l,row1h,row2h,row3h,row4h) \ +- t0 = row4l;\ +- t1 = row2l;\ +- row4l = row3l;\ +- row3l = row3h;\ +- row3h = row4l;\ +- row4l = _mm_unpackhi_epi64(row4h, _mm_unpacklo_epi64(t0, t0)); \ +- row4h = _mm_unpackhi_epi64(t0, _mm_unpacklo_epi64(row4h, row4h)); \ +- row2l = _mm_unpackhi_epi64(row2l, _mm_unpacklo_epi64(row2h, row2h)); \ +- row2h = _mm_unpackhi_epi64(row2h, _mm_unpacklo_epi64(t1, t1)) +- +-#define UNDIAGONALIZE(row1l,row2l,row3l,row4l,row1h,row2h,row3h,row4h) \ +- t0 = row3l;\ +- row3l = row3h;\ +- row3h = t0;\ +- t0 = row2l;\ +- t1 = row4l;\ +- row2l = _mm_unpackhi_epi64(row2h, _mm_unpacklo_epi64(row2l, row2l)); \ +- row2h = _mm_unpackhi_epi64(t0, _mm_unpacklo_epi64(row2h, row2h)); \ +- row4l = _mm_unpackhi_epi64(row4l, _mm_unpacklo_epi64(row4h, row4h)); \ +- row4h = _mm_unpackhi_epi64(row4h, _mm_unpacklo_epi64(t1, t1)) +- +-#endif +- +-#if defined(HAVE_SSE41) +-#include "blake2b-load-sse41.h" +-#else +-#include "blake2b-load-sse2.h" +-#endif +- +-#define ROUND(r) \ +- LOAD_MSG_ ##r ##_1(b0, b1); \ +- G1(row1l,row2l,row3l,row4l,row1h,row2h,row3h,row4h,b0,b1); \ +- LOAD_MSG_ ##r ##_2(b0, b1); \ +- G2(row1l,row2l,row3l,row4l,row1h,row2h,row3h,row4h,b0,b1); \ +- DIAGONALIZE(row1l,row2l,row3l,row4l,row1h,row2h,row3h,row4h); \ +- LOAD_MSG_ ##r ##_3(b0, b1); \ +- G1(row1l,row2l,row3l,row4l,row1h,row2h,row3h,row4h,b0,b1); \ +- LOAD_MSG_ ##r ##_4(b0, b1); \ +- G2(row1l,row2l,row3l,row4l,row1h,row2h,row3h,row4h,b0,b1); \ +- UNDIAGONALIZE(row1l,row2l,row3l,row4l,row1h,row2h,row3h,row4h); +- +-#endif +--- thirdparty/blake2/blake2b.c.orig 2018-03-16 17:25:33 UTC ++++ thirdparty/blake2/blake2b.c +@@ -1,373 +0,0 @@ +-/* +- BLAKE2 reference source code package - optimized C implementations +- +- Copyright 2012, Samuel Neves <sneves@dei.uc.pt>. You may use this under the +- terms of the CC0, the OpenSSL Licence, or the Apache Public License 2.0, at +- your option. The terms of these licenses can be found at: +- +- - CC0 1.0 Universal : http://creativecommons.org/publicdomain/zero/1.0 +- - OpenSSL license : https://www.openssl.org/source/license.html +- - Apache 2.0 : http://www.apache.org/licenses/LICENSE-2.0 +- +- More information about the BLAKE2 hash function can be found at +- https://blake2.net. +-*/ +- +-#include <stdint.h> +-#include <string.h> +-#include <stdio.h> +- +-#include "blake2.h" +-#include "blake2-impl.h" +- +-#include "blake2-config.h" +- +-#ifdef _MSC_VER +-#include <intrin.h> /* for _mm_set_epi64x */ +-#endif +-#include <emmintrin.h> +-#if defined(HAVE_SSSE3) +-#include <tmmintrin.h> +-#endif +-#if defined(HAVE_SSE41) +-#include <smmintrin.h> +-#endif +-#if defined(HAVE_AVX) +-#include <immintrin.h> +-#endif +-#if defined(HAVE_XOP) +-#include <x86intrin.h> +-#endif +- +-#include "blake2b-round.h" +- +-static const uint64_t blake2b_IV[8] = +-{ +- 0x6a09e667f3bcc908ULL, 0xbb67ae8584caa73bULL, +- 0x3c6ef372fe94f82bULL, 0xa54ff53a5f1d36f1ULL, +- 0x510e527fade682d1ULL, 0x9b05688c2b3e6c1fULL, +- 0x1f83d9abfb41bd6bULL, 0x5be0cd19137e2179ULL +-}; +- +-/* Some helper functions */ +-static void blake2b_set_lastnode( blake2b_state *S ) +-{ +- S->f[1] = (uint64_t)-1; +-} +- +-static int blake2b_is_lastblock( const blake2b_state *S ) +-{ +- return S->f[0] != 0; +-} +- +-static void blake2b_set_lastblock( blake2b_state *S ) +-{ +- if( S->last_node ) blake2b_set_lastnode( S ); +- +- S->f[0] = (uint64_t)-1; +-} +- +-static void blake2b_increment_counter( blake2b_state *S, const uint64_t inc ) +-{ +- S->t[0] += inc; +- S->t[1] += ( S->t[0] < inc ); +-} +- +-/* init xors IV with input parameter block */ +-int blake2b_init_param( blake2b_state *S, const blake2b_param *P ) +-{ +- size_t i; +- /*blake2b_init0( S ); */ +- const unsigned char * v = ( const unsigned char * )( blake2b_IV ); +- const unsigned char * p = ( const unsigned char * )( P ); +- unsigned char * h = ( unsigned char * )( S->h ); +- /* IV XOR ParamBlock */ +- memset( S, 0, sizeof( blake2b_state ) ); +- +- for( i = 0; i < BLAKE2B_OUTBYTES; ++i ) h[i] = v[i] ^ p[i]; +- +- S->outlen = P->digest_length; +- return 0; +-} +- +- +-/* Some sort of default parameter block initialization, for sequential blake2b */ +-int blake2b_init( blake2b_state *S, size_t outlen ) +-{ +- blake2b_param P[1]; +- +- if ( ( !outlen ) || ( outlen > BLAKE2B_OUTBYTES ) ) return -1; +- +- P->digest_length = (uint8_t)outlen; +- P->key_length = 0; +- P->fanout = 1; +- P->depth = 1; +- store32( &P->leaf_length, 0 ); +- store32( &P->node_offset, 0 ); +- store32( &P->xof_length, 0 ); +- P->node_depth = 0; +- P->inner_length = 0; +- memset( P->reserved, 0, sizeof( P->reserved ) ); +- memset( P->salt, 0, sizeof( P->salt ) ); +- memset( P->personal, 0, sizeof( P->personal ) ); +- +- return blake2b_init_param( S, P ); +-} +- +-int blake2b_init_key( blake2b_state *S, size_t outlen, const void *key, size_t keylen ) +-{ +- blake2b_param P[1]; +- +- if ( ( !outlen ) || ( outlen > BLAKE2B_OUTBYTES ) ) return -1; +- +- if ( ( !keylen ) || keylen > BLAKE2B_KEYBYTES ) return -1; +- +- P->digest_length = (uint8_t)outlen; +- P->key_length = (uint8_t)keylen; +- P->fanout = 1; +- P->depth = 1; +- store32( &P->leaf_length, 0 ); +- store32( &P->node_offset, 0 ); +- store32( &P->xof_length, 0 ); +- P->node_depth = 0; +- P->inner_length = 0; +- memset( P->reserved, 0, sizeof( P->reserved ) ); +- memset( P->salt, 0, sizeof( P->salt ) ); +- memset( P->personal, 0, sizeof( P->personal ) ); +- +- if( blake2b_init_param( S, P ) < 0 ) +- return 0; +- +- { +- uint8_t block[BLAKE2B_BLOCKBYTES]; +- memset( block, 0, BLAKE2B_BLOCKBYTES ); +- memcpy( block, key, keylen ); +- blake2b_update( S, block, BLAKE2B_BLOCKBYTES ); +- secure_zero_memory( block, BLAKE2B_BLOCKBYTES ); /* Burn the key from stack */ +- } +- return 0; +-} +- +-static void blake2b_compress( blake2b_state *S, const uint8_t block[BLAKE2B_BLOCKBYTES] ) +-{ +- __m128i row1l, row1h; +- __m128i row2l, row2h; +- __m128i row3l, row3h; +- __m128i row4l, row4h; +- __m128i b0, b1; +- __m128i t0, t1; +-#if defined(HAVE_SSSE3) && !defined(HAVE_XOP) +- const __m128i r16 = _mm_setr_epi8( 2, 3, 4, 5, 6, 7, 0, 1, 10, 11, 12, 13, 14, 15, 8, 9 ); +- const __m128i r24 = _mm_setr_epi8( 3, 4, 5, 6, 7, 0, 1, 2, 11, 12, 13, 14, 15, 8, 9, 10 ); +-#endif +-#if defined(HAVE_SSE41) +- const __m128i m0 = LOADU( block + 00 ); +- const __m128i m1 = LOADU( block + 16 ); +- const __m128i m2 = LOADU( block + 32 ); +- const __m128i m3 = LOADU( block + 48 ); +- const __m128i m4 = LOADU( block + 64 ); +- const __m128i m5 = LOADU( block + 80 ); +- const __m128i m6 = LOADU( block + 96 ); +- const __m128i m7 = LOADU( block + 112 ); +-#else +- const uint64_t m0 = load64(block + 0 * sizeof(uint64_t)); +- const uint64_t m1 = load64(block + 1 * sizeof(uint64_t)); +- const uint64_t m2 = load64(block + 2 * sizeof(uint64_t)); +- const uint64_t m3 = load64(block + 3 * sizeof(uint64_t)); +- const uint64_t m4 = load64(block + 4 * sizeof(uint64_t)); +- const uint64_t m5 = load64(block + 5 * sizeof(uint64_t)); +- const uint64_t m6 = load64(block + 6 * sizeof(uint64_t)); +- const uint64_t m7 = load64(block + 7 * sizeof(uint64_t)); +- const uint64_t m8 = load64(block + 8 * sizeof(uint64_t)); +- const uint64_t m9 = load64(block + 9 * sizeof(uint64_t)); +- const uint64_t m10 = load64(block + 10 * sizeof(uint64_t)); +- const uint64_t m11 = load64(block + 11 * sizeof(uint64_t)); +- const uint64_t m12 = load64(block + 12 * sizeof(uint64_t)); +- const uint64_t m13 = load64(block + 13 * sizeof(uint64_t)); +- const uint64_t m14 = load64(block + 14 * sizeof(uint64_t)); +- const uint64_t m15 = load64(block + 15 * sizeof(uint64_t)); +-#endif +- row1l = LOADU( &S->h[0] ); +- row1h = LOADU( &S->h[2] ); +- row2l = LOADU( &S->h[4] ); +- row2h = LOADU( &S->h[6] ); +- row3l = LOADU( &blake2b_IV[0] ); +- row3h = LOADU( &blake2b_IV[2] ); +- row4l = _mm_xor_si128( LOADU( &blake2b_IV[4] ), LOADU( &S->t[0] ) ); +- row4h = _mm_xor_si128( LOADU( &blake2b_IV[6] ), LOADU( &S->f[0] ) ); +- ROUND( 0 ); +- ROUND( 1 ); +- ROUND( 2 ); +- ROUND( 3 ); +- ROUND( 4 ); +- ROUND( 5 ); +- ROUND( 6 ); +- ROUND( 7 ); +- ROUND( 8 ); +- ROUND( 9 ); +- ROUND( 10 ); +- ROUND( 11 ); +- row1l = _mm_xor_si128( row3l, row1l ); +- row1h = _mm_xor_si128( row3h, row1h ); +- STOREU( &S->h[0], _mm_xor_si128( LOADU( &S->h[0] ), row1l ) ); +- STOREU( &S->h[2], _mm_xor_si128( LOADU( &S->h[2] ), row1h ) ); +- row2l = _mm_xor_si128( row4l, row2l ); +- row2h = _mm_xor_si128( row4h, row2h ); +- STOREU( &S->h[4], _mm_xor_si128( LOADU( &S->h[4] ), row2l ) ); +- STOREU( &S->h[6], _mm_xor_si128( LOADU( &S->h[6] ), row2h ) ); +-} +- +- +-int blake2b_update( blake2b_state *S, const void *pin, size_t inlen ) +-{ +- const unsigned char * in = (const unsigned char *)pin; +- if( inlen > 0 ) +- { +- size_t left = S->buflen; +- size_t fill = BLAKE2B_BLOCKBYTES - left; +- if( inlen > fill ) +- { +- S->buflen = 0; +- memcpy( S->buf + left, in, fill ); /* Fill buffer */ +- blake2b_increment_counter( S, BLAKE2B_BLOCKBYTES ); +- blake2b_compress( S, S->buf ); /* Compress */ +- in += fill; inlen -= fill; +- while(inlen > BLAKE2B_BLOCKBYTES) { +- blake2b_increment_counter(S, BLAKE2B_BLOCKBYTES); +- blake2b_compress( S, in ); +- in += BLAKE2B_BLOCKBYTES; +- inlen -= BLAKE2B_BLOCKBYTES; +- } +- } +- memcpy( S->buf + S->buflen, in, inlen ); +- S->buflen += inlen; +- } +- return 0; +-} +- +- +-int blake2b_final( blake2b_state *S, void *out, size_t outlen ) +-{ +- if( out == NULL || outlen < S->outlen ) +- return -1; +- +- if( blake2b_is_lastblock( S ) ) +- return -1; +- +- blake2b_increment_counter( S, S->buflen ); +- blake2b_set_lastblock( S ); +- memset( S->buf + S->buflen, 0, BLAKE2B_BLOCKBYTES - S->buflen ); /* Padding */ +- blake2b_compress( S, S->buf ); +- +- memcpy( out, &S->h[0], S->outlen ); +- return 0; +-} +- +- +-int blake2b( void *out, size_t outlen, const void *in, size_t inlen, const void *key, size_t keylen ) +-{ +- blake2b_state S[1]; +- +- /* Verify parameters */ +- if ( NULL == in && inlen > 0 ) return -1; +- +- if ( NULL == out ) return -1; +- +- if( NULL == key && keylen > 0 ) return -1; +- +- if( !outlen || outlen > BLAKE2B_OUTBYTES ) return -1; +- +- if( keylen > BLAKE2B_KEYBYTES ) return -1; +- +- if( keylen ) +- { +- if( blake2b_init_key( S, outlen, key, keylen ) < 0 ) return -1; +- } +- else +- { +- if( blake2b_init( S, outlen ) < 0 ) return -1; +- } +- +- blake2b_update( S, ( const uint8_t * )in, inlen ); +- blake2b_final( S, out, outlen ); +- return 0; +-} +- +-int blake2( void *out, size_t outlen, const void *in, size_t inlen, const void *key, size_t keylen ) { +- return blake2b(out, outlen, in, inlen, key, keylen); +-} +- +-#if defined(SUPERCOP) +-int crypto_hash( unsigned char *out, unsigned char *in, unsigned long long inlen ) +-{ +- return blake2b( out, BLAKE2B_OUTBYTES, in, inlen, NULL, 0 ); +-} +-#endif +- +-#if defined(BLAKE2B_SELFTEST) +-#include <string.h> +-#include "blake2-kat.h" +-int main( void ) +-{ +- uint8_t key[BLAKE2B_KEYBYTES]; +- uint8_t buf[BLAKE2_KAT_LENGTH]; +- size_t i, step; +- +- for( i = 0; i < BLAKE2B_KEYBYTES; ++i ) +- key[i] = ( uint8_t )i; +- +- for( i = 0; i < BLAKE2_KAT_LENGTH; ++i ) +- buf[i] = ( uint8_t )i; +- +- /* Test simple API */ +- for( i = 0; i < BLAKE2_KAT_LENGTH; ++i ) +- { +- uint8_t hash[BLAKE2B_OUTBYTES]; +- blake2b( hash, BLAKE2B_OUTBYTES, buf, i, key, BLAKE2B_KEYBYTES ); +- +- if( 0 != memcmp( hash, blake2b_keyed_kat[i], BLAKE2B_OUTBYTES ) ) +- { +- goto fail; +- } +- } +- +- /* Test streaming API */ +- for(step = 1; step < BLAKE2B_BLOCKBYTES; ++step) { +- for (i = 0; i < BLAKE2_KAT_LENGTH; ++i) { +- uint8_t hash[BLAKE2B_OUTBYTES]; +- blake2b_state S; +- uint8_t * p = buf; +- size_t mlen = i; +- int err = 0; +- +- if( (err = blake2b_init_key(&S, BLAKE2B_OUTBYTES, key, BLAKE2B_KEYBYTES)) < 0 ) { +- goto fail; +- } +- +- while (mlen >= step) { +- if ( (err = blake2b_update(&S, p, step)) < 0 ) { +- goto fail; +- } +- mlen -= step; +- p += step; +- } +- if ( (err = blake2b_update(&S, p, mlen)) < 0) { +- goto fail; +- } +- if ( (err = blake2b_final(&S, hash, BLAKE2B_OUTBYTES)) < 0) { +- goto fail; +- } +- +- if (0 != memcmp(hash, blake2b_keyed_kat[i], BLAKE2B_OUTBYTES)) { +- goto fail; +- } +- } +- } +- +- puts( "ok" ); +- return 0; +-fail: +- puts("error"); +- return -1; +-} +-#endif +--- thirdparty/blake2/blake2bp.c.orig 2018-03-16 17:25:33 UTC ++++ thirdparty/blake2/blake2bp.c +@@ -1,361 +0,0 @@ +-/* +- BLAKE2 reference source code package - optimized C implementations +- +- Copyright 2012, Samuel Neves <sneves@dei.uc.pt>. You may use this under the +- terms of the CC0, the OpenSSL Licence, or the Apache Public License 2.0, at +- your option. The terms of these licenses can be found at: +- +- - CC0 1.0 Universal : http://creativecommons.org/publicdomain/zero/1.0 +- - OpenSSL license : https://www.openssl.org/source/license.html +- - Apache 2.0 : http://www.apache.org/licenses/LICENSE-2.0 +- +- More information about the BLAKE2 hash function can be found at +- https://blake2.net. +-*/ +- +-#include <stdio.h> +-#include <stdlib.h> +-#include <string.h> +-#include <stdint.h> +- +-#if defined(_OPENMP) +-#include <omp.h> +-#endif +- +-#include "blake2.h" +-#include "blake2-impl.h" +- +-#define PARALLELISM_DEGREE 4 +- +-/* +- blake2b_init_param defaults to setting the expecting output length +- from the digest_length parameter block field. +- +- In some cases, however, we do not want this, as the output length +- of these instances is given by inner_length instead. +-*/ +-static int blake2bp_init_leaf_param( blake2b_state *S, const blake2b_param *P ) +-{ +- int err = blake2b_init_param(S, P); +- S->outlen = P->inner_length; +- return err; +-} +- +-static int blake2bp_init_leaf( blake2b_state *S, size_t outlen, size_t keylen, uint64_t offset ) +-{ +- blake2b_param P[1]; +- P->digest_length = (uint8_t)outlen; +- P->key_length = (uint8_t)keylen; +- P->fanout = PARALLELISM_DEGREE; +- P->depth = 2; +- P->leaf_length = 0; +- P->node_offset = offset; +- P->xof_length = 0; +- P->node_depth = 0; +- P->inner_length = BLAKE2B_OUTBYTES; +- memset( P->reserved, 0, sizeof( P->reserved ) ); +- memset( P->salt, 0, sizeof( P->salt ) ); +- memset( P->personal, 0, sizeof( P->personal ) ); +- return blake2bp_init_leaf_param( S, P ); +-} +- +-static int blake2bp_init_root( blake2b_state *S, size_t outlen, size_t keylen ) +-{ +- blake2b_param P[1]; +- P->digest_length = (uint8_t)outlen; +- P->key_length = (uint8_t)keylen; +- P->fanout = PARALLELISM_DEGREE; +- P->depth = 2; +- P->leaf_length = 0; +- P->node_offset = 0; +- P->xof_length = 0; +- P->node_depth = 1; +- P->inner_length = BLAKE2B_OUTBYTES; +- memset( P->reserved, 0, sizeof( P->reserved ) ); +- memset( P->salt, 0, sizeof( P->salt ) ); +- memset( P->personal, 0, sizeof( P->personal ) ); +- return blake2b_init_param( S, P ); +-} +- +- +-int blake2bp_init( blake2bp_state *S, size_t outlen ) +-{ +- size_t i; +- if( !outlen || outlen > BLAKE2B_OUTBYTES ) return -1; +- +- memset( S->buf, 0, sizeof( S->buf ) ); +- S->buflen = 0; +- S->outlen = outlen; +- +- if( blake2bp_init_root( S->R, outlen, 0 ) < 0 ) +- return -1; +- +- for( i = 0; i < PARALLELISM_DEGREE; ++i ) +- if( blake2bp_init_leaf( S->S[i], outlen, 0, i ) < 0 ) return -1; +- +- S->R->last_node = 1; +- S->S[PARALLELISM_DEGREE - 1]->last_node = 1; +- return 0; +-} +- +-int blake2bp_init_key( blake2bp_state *S, size_t outlen, const void *key, size_t keylen ) +-{ +- size_t i; +- +- if( !outlen || outlen > BLAKE2B_OUTBYTES ) return -1; +- +- if( !key || !keylen || keylen > BLAKE2B_KEYBYTES ) return -1; +- +- memset( S->buf, 0, sizeof( S->buf ) ); +- S->buflen = 0; +- S->outlen = outlen; +- +- if( blake2bp_init_root( S->R, outlen, keylen ) < 0 ) +- return -1; +- +- for( i = 0; i < PARALLELISM_DEGREE; ++i ) +- if( blake2bp_init_leaf( S->S[i], outlen, keylen, i ) < 0 ) return -1; +- +- S->R->last_node = 1; +- S->S[PARALLELISM_DEGREE - 1]->last_node = 1; +- { +- uint8_t block[BLAKE2B_BLOCKBYTES]; +- memset( block, 0, BLAKE2B_BLOCKBYTES ); +- memcpy( block, key, keylen ); +- +- for( i = 0; i < PARALLELISM_DEGREE; ++i ) +- blake2b_update( S->S[i], block, BLAKE2B_BLOCKBYTES ); +- +- secure_zero_memory( block, BLAKE2B_BLOCKBYTES ); /* Burn the key from stack */ +- } +- return 0; +-} +- +- +-int blake2bp_update( blake2bp_state *S, const void *pin, size_t inlen ) +-{ +- const unsigned char * in = (const unsigned char *)pin; +- size_t left = S->buflen; +- size_t fill = sizeof( S->buf ) - left; +- size_t i; +- +- if( left && inlen >= fill ) +- { +- memcpy( S->buf + left, in, fill ); +- +- for( i = 0; i < PARALLELISM_DEGREE; ++i ) +- blake2b_update( S->S[i], S->buf + i * BLAKE2B_BLOCKBYTES, BLAKE2B_BLOCKBYTES ); +- +- in += fill; +- inlen -= fill; +- left = 0; +- } +- +-#if defined(_OPENMP) +- #pragma omp parallel shared(S), num_threads(PARALLELISM_DEGREE) +-#else +- +- for( i = 0; i < PARALLELISM_DEGREE; ++i ) +-#endif +- { +-#if defined(_OPENMP) +- size_t i = omp_get_thread_num(); +-#endif +- size_t inlen__ = inlen; +- const unsigned char *in__ = ( const unsigned char * )in; +- in__ += i * BLAKE2B_BLOCKBYTES; +- +- while( inlen__ >= PARALLELISM_DEGREE * BLAKE2B_BLOCKBYTES ) +- { +- blake2b_update( S->S[i], in__, BLAKE2B_BLOCKBYTES ); +- in__ += PARALLELISM_DEGREE * BLAKE2B_BLOCKBYTES; +- inlen__ -= PARALLELISM_DEGREE * BLAKE2B_BLOCKBYTES; +- } +- } +- +- in += inlen - inlen % ( PARALLELISM_DEGREE * BLAKE2B_BLOCKBYTES ); +- inlen %= PARALLELISM_DEGREE * BLAKE2B_BLOCKBYTES; +- +- if( inlen > 0 ) +- memcpy( S->buf + left, in, inlen ); +- +- S->buflen = left + inlen; +- return 0; +-} +- +- +- +-int blake2bp_final( blake2bp_state *S, void *out, size_t outlen ) +-{ +- uint8_t hash[PARALLELISM_DEGREE][BLAKE2B_OUTBYTES]; +- size_t i; +- +- if(out == NULL || outlen < S->outlen) { +- return -1; +- } +- +- for( i = 0; i < PARALLELISM_DEGREE; ++i ) +- { +- if( S->buflen > i * BLAKE2B_BLOCKBYTES ) +- { +- size_t left = S->buflen - i * BLAKE2B_BLOCKBYTES; +- +- if( left > BLAKE2B_BLOCKBYTES ) left = BLAKE2B_BLOCKBYTES; +- +- blake2b_update( S->S[i], S->buf + i * BLAKE2B_BLOCKBYTES, left ); +- } +- +- blake2b_final( S->S[i], hash[i], BLAKE2B_OUTBYTES ); +- } +- +- for( i = 0; i < PARALLELISM_DEGREE; ++i ) +- blake2b_update( S->R, hash[i], BLAKE2B_OUTBYTES ); +- +- return blake2b_final( S->R, out, S->outlen ); +-} +- +-int blake2bp( void *out, size_t outlen, const void *in, size_t inlen, const void *key, size_t keylen ) +-{ +- uint8_t hash[PARALLELISM_DEGREE][BLAKE2B_OUTBYTES]; +- blake2b_state S[PARALLELISM_DEGREE][1]; +- blake2b_state FS[1]; +- size_t i; +- +- /* Verify parameters */ +- if ( NULL == in && inlen > 0 ) return -1; +- +- if ( NULL == out ) return -1; +- +- if( NULL == key && keylen > 0 ) return -1; +- +- if( !outlen || outlen > BLAKE2B_OUTBYTES ) return -1; +- +- if( keylen > BLAKE2B_KEYBYTES ) return -1; +- +- for( i = 0; i < PARALLELISM_DEGREE; ++i ) +- if( blake2bp_init_leaf( S[i], outlen, keylen, i ) < 0 ) return -1; +- +- S[PARALLELISM_DEGREE - 1]->last_node = 1; /* mark last node */ +- +- if( keylen > 0 ) +- { +- uint8_t block[BLAKE2B_BLOCKBYTES]; +- memset( block, 0, BLAKE2B_BLOCKBYTES ); +- memcpy( block, key, keylen ); +- +- for( i = 0; i < PARALLELISM_DEGREE; ++i ) +- blake2b_update( S[i], block, BLAKE2B_BLOCKBYTES ); +- +- secure_zero_memory( block, BLAKE2B_BLOCKBYTES ); /* Burn the key from stack */ +- } +- +-#if defined(_OPENMP) +- #pragma omp parallel shared(S,hash), num_threads(PARALLELISM_DEGREE) +-#else +- +- for( i = 0; i < PARALLELISM_DEGREE; ++i ) +-#endif +- { +-#if defined(_OPENMP) +- size_t i = omp_get_thread_num(); +-#endif +- size_t inlen__ = inlen; +- const unsigned char *in__ = ( const unsigned char * )in; +- in__ += i * BLAKE2B_BLOCKBYTES; +- +- while( inlen__ >= PARALLELISM_DEGREE * BLAKE2B_BLOCKBYTES ) +- { +- blake2b_update( S[i], in__, BLAKE2B_BLOCKBYTES ); +- in__ += PARALLELISM_DEGREE * BLAKE2B_BLOCKBYTES; +- inlen__ -= PARALLELISM_DEGREE * BLAKE2B_BLOCKBYTES; +- } +- +- if( inlen__ > i * BLAKE2B_BLOCKBYTES ) +- { +- const size_t left = inlen__ - i * BLAKE2B_BLOCKBYTES; +- const size_t len = left <= BLAKE2B_BLOCKBYTES ? left : BLAKE2B_BLOCKBYTES; +- blake2b_update( S[i], in__, len ); +- } +- +- blake2b_final( S[i], hash[i], BLAKE2B_OUTBYTES ); +- } +- +- if( blake2bp_init_root( FS, outlen, keylen ) < 0 ) +- return -1; +- +- FS->last_node = 1; /* Mark as last node */ +- +- for( i = 0; i < PARALLELISM_DEGREE; ++i ) +- blake2b_update( FS, hash[i], BLAKE2B_OUTBYTES ); +- +- return blake2b_final( FS, out, outlen ); +-} +- +- +-#if defined(BLAKE2BP_SELFTEST) +-#include <string.h> +-#include "blake2-kat.h" +-int main( void ) +-{ +- uint8_t key[BLAKE2B_KEYBYTES]; +- uint8_t buf[BLAKE2_KAT_LENGTH]; +- size_t i, step; +- +- for( i = 0; i < BLAKE2B_KEYBYTES; ++i ) +- key[i] = ( uint8_t )i; +- +- for( i = 0; i < BLAKE2_KAT_LENGTH; ++i ) +- buf[i] = ( uint8_t )i; +- +- /* Test simple API */ +- for( i = 0; i < BLAKE2_KAT_LENGTH; ++i ) +- { +- uint8_t hash[BLAKE2B_OUTBYTES]; +- blake2bp( hash, BLAKE2B_OUTBYTES, buf, i, key, BLAKE2B_KEYBYTES ); +- +- if( 0 != memcmp( hash, blake2bp_keyed_kat[i], BLAKE2B_OUTBYTES ) ) +- { +- goto fail; +- } +- } +- +- /* Test streaming API */ +- for(step = 1; step < BLAKE2B_BLOCKBYTES; ++step) { +- for (i = 0; i < BLAKE2_KAT_LENGTH; ++i) { +- uint8_t hash[BLAKE2B_OUTBYTES]; +- blake2bp_state S; +- uint8_t * p = buf; +- size_t mlen = i; +- int err = 0; +- +- if( (err = blake2bp_init_key(&S, BLAKE2B_OUTBYTES, key, BLAKE2B_KEYBYTES)) < 0 ) { +- goto fail; +- } +- +- while (mlen >= step) { +- if ( (err = blake2bp_update(&S, p, step)) < 0 ) { +- goto fail; +- } +- mlen -= step; +- p += step; +- } +- if ( (err = blake2bp_update(&S, p, mlen)) < 0) { +- goto fail; +- } +- if ( (err = blake2bp_final(&S, hash, BLAKE2B_OUTBYTES)) < 0) { +- goto fail; +- } +- +- if (0 != memcmp(hash, blake2bp_keyed_kat[i], BLAKE2B_OUTBYTES)) { +- goto fail; +- } +- } +- } +- +- puts( "ok" ); +- return 0; +-fail: +- puts("error"); +- return -1; +-} +-#endif +--- thirdparty/blake2/blake2s-load-sse2.h.orig 2018-03-16 17:25:33 UTC ++++ thirdparty/blake2/blake2s-load-sse2.h +@@ -1,60 +0,0 @@ +-/* +- BLAKE2 reference source code package - optimized C implementations +- +- Copyright 2012, Samuel Neves <sneves@dei.uc.pt>. You may use this under the +- terms of the CC0, the OpenSSL Licence, or the Apache Public License 2.0, at +- your option. The terms of these licenses can be found at: +- +- - CC0 1.0 Universal : http://creativecommons.org/publicdomain/zero/1.0 +- - OpenSSL license : https://www.openssl.org/source/license.html +- - Apache 2.0 : http://www.apache.org/licenses/LICENSE-2.0 +- +- More information about the BLAKE2 hash function can be found at +- https://blake2.net. +-*/ +-#ifndef BLAKE2S_LOAD_SSE2_H +-#define BLAKE2S_LOAD_SSE2_H +- +-#define LOAD_MSG_0_1(buf) buf = _mm_set_epi32(m6,m4,m2,m0) +-#define LOAD_MSG_0_2(buf) buf = _mm_set_epi32(m7,m5,m3,m1) +-#define LOAD_MSG_0_3(buf) buf = _mm_set_epi32(m14,m12,m10,m8) +-#define LOAD_MSG_0_4(buf) buf = _mm_set_epi32(m15,m13,m11,m9) +-#define LOAD_MSG_1_1(buf) buf = _mm_set_epi32(m13,m9,m4,m14) +-#define LOAD_MSG_1_2(buf) buf = _mm_set_epi32(m6,m15,m8,m10) +-#define LOAD_MSG_1_3(buf) buf = _mm_set_epi32(m5,m11,m0,m1) +-#define LOAD_MSG_1_4(buf) buf = _mm_set_epi32(m3,m7,m2,m12) +-#define LOAD_MSG_2_1(buf) buf = _mm_set_epi32(m15,m5,m12,m11) +-#define LOAD_MSG_2_2(buf) buf = _mm_set_epi32(m13,m2,m0,m8) +-#define LOAD_MSG_2_3(buf) buf = _mm_set_epi32(m9,m7,m3,m10) +-#define LOAD_MSG_2_4(buf) buf = _mm_set_epi32(m4,m1,m6,m14) +-#define LOAD_MSG_3_1(buf) buf = _mm_set_epi32(m11,m13,m3,m7) +-#define LOAD_MSG_3_2(buf) buf = _mm_set_epi32(m14,m12,m1,m9) +-#define LOAD_MSG_3_3(buf) buf = _mm_set_epi32(m15,m4,m5,m2) +-#define LOAD_MSG_3_4(buf) buf = _mm_set_epi32(m8,m0,m10,m6) +-#define LOAD_MSG_4_1(buf) buf = _mm_set_epi32(m10,m2,m5,m9) +-#define LOAD_MSG_4_2(buf) buf = _mm_set_epi32(m15,m4,m7,m0) +-#define LOAD_MSG_4_3(buf) buf = _mm_set_epi32(m3,m6,m11,m14) +-#define LOAD_MSG_4_4(buf) buf = _mm_set_epi32(m13,m8,m12,m1) +-#define LOAD_MSG_5_1(buf) buf = _mm_set_epi32(m8,m0,m6,m2) +-#define LOAD_MSG_5_2(buf) buf = _mm_set_epi32(m3,m11,m10,m12) +-#define LOAD_MSG_5_3(buf) buf = _mm_set_epi32(m1,m15,m7,m4) +-#define LOAD_MSG_5_4(buf) buf = _mm_set_epi32(m9,m14,m5,m13) +-#define LOAD_MSG_6_1(buf) buf = _mm_set_epi32(m4,m14,m1,m12) +-#define LOAD_MSG_6_2(buf) buf = _mm_set_epi32(m10,m13,m15,m5) +-#define LOAD_MSG_6_3(buf) buf = _mm_set_epi32(m8,m9,m6,m0) +-#define LOAD_MSG_6_4(buf) buf = _mm_set_epi32(m11,m2,m3,m7) +-#define LOAD_MSG_7_1(buf) buf = _mm_set_epi32(m3,m12,m7,m13) +-#define LOAD_MSG_7_2(buf) buf = _mm_set_epi32(m9,m1,m14,m11) +-#define LOAD_MSG_7_3(buf) buf = _mm_set_epi32(m2,m8,m15,m5) +-#define LOAD_MSG_7_4(buf) buf = _mm_set_epi32(m10,m6,m4,m0) +-#define LOAD_MSG_8_1(buf) buf = _mm_set_epi32(m0,m11,m14,m6) +-#define LOAD_MSG_8_2(buf) buf = _mm_set_epi32(m8,m3,m9,m15) +-#define LOAD_MSG_8_3(buf) buf = _mm_set_epi32(m10,m1,m13,m12) +-#define LOAD_MSG_8_4(buf) buf = _mm_set_epi32(m5,m4,m7,m2) +-#define LOAD_MSG_9_1(buf) buf = _mm_set_epi32(m1,m7,m8,m10) +-#define LOAD_MSG_9_2(buf) buf = _mm_set_epi32(m5,m6,m4,m2) +-#define LOAD_MSG_9_3(buf) buf = _mm_set_epi32(m13,m3,m9,m15) +-#define LOAD_MSG_9_4(buf) buf = _mm_set_epi32(m0,m12,m14,m11) +- +- +-#endif +--- thirdparty/blake2/blake2s-load-sse41.h.orig 2018-03-16 17:25:33 UTC ++++ thirdparty/blake2/blake2s-load-sse41.h +@@ -1,229 +0,0 @@ +-/* +- BLAKE2 reference source code package - optimized C implementations +- +- Copyright 2012, Samuel Neves <sneves@dei.uc.pt>. You may use this under the +- terms of the CC0, the OpenSSL Licence, or the Apache Public License 2.0, at +- your option. The terms of these licenses can be found at: +- +- - CC0 1.0 Universal : http://creativecommons.org/publicdomain/zero/1.0 +- - OpenSSL license : https://www.openssl.org/source/license.html +- - Apache 2.0 : http://www.apache.org/licenses/LICENSE-2.0 +- +- More information about the BLAKE2 hash function can be found at +- https://blake2.net. +-*/ +-#ifndef BLAKE2S_LOAD_SSE41_H +-#define BLAKE2S_LOAD_SSE41_H +- +-#define LOAD_MSG_0_1(buf) \ +-buf = TOI(_mm_shuffle_ps(TOF(m0), TOF(m1), _MM_SHUFFLE(2,0,2,0))); +- +-#define LOAD_MSG_0_2(buf) \ +-buf = TOI(_mm_shuffle_ps(TOF(m0), TOF(m1), _MM_SHUFFLE(3,1,3,1))); +- +-#define LOAD_MSG_0_3(buf) \ +-buf = TOI(_mm_shuffle_ps(TOF(m2), TOF(m3), _MM_SHUFFLE(2,0,2,0))); +- +-#define LOAD_MSG_0_4(buf) \ +-buf = TOI(_mm_shuffle_ps(TOF(m2), TOF(m3), _MM_SHUFFLE(3,1,3,1))); +- +-#define LOAD_MSG_1_1(buf) \ +-t0 = _mm_blend_epi16(m1, m2, 0x0C); \ +-t1 = _mm_slli_si128(m3, 4); \ +-t2 = _mm_blend_epi16(t0, t1, 0xF0); \ +-buf = _mm_shuffle_epi32(t2, _MM_SHUFFLE(2,1,0,3)); +- +-#define LOAD_MSG_1_2(buf) \ +-t0 = _mm_shuffle_epi32(m2,_MM_SHUFFLE(0,0,2,0)); \ +-t1 = _mm_blend_epi16(m1,m3,0xC0); \ +-t2 = _mm_blend_epi16(t0, t1, 0xF0); \ +-buf = _mm_shuffle_epi32(t2, _MM_SHUFFLE(2,3,0,1)); +- +-#define LOAD_MSG_1_3(buf) \ +-t0 = _mm_slli_si128(m1, 4); \ +-t1 = _mm_blend_epi16(m2, t0, 0x30); \ +-t2 = _mm_blend_epi16(m0, t1, 0xF0); \ +-buf = _mm_shuffle_epi32(t2, _MM_SHUFFLE(2,3,0,1)); +- +-#define LOAD_MSG_1_4(buf) \ +-t0 = _mm_unpackhi_epi32(m0,m1); \ +-t1 = _mm_slli_si128(m3, 4); \ +-t2 = _mm_blend_epi16(t0, t1, 0x0C); \ +-buf = _mm_shuffle_epi32(t2, _MM_SHUFFLE(2,3,0,1)); +- +-#define LOAD_MSG_2_1(buf) \ +-t0 = _mm_unpackhi_epi32(m2,m3); \ +-t1 = _mm_blend_epi16(m3,m1,0x0C); \ +-t2 = _mm_blend_epi16(t0, t1, 0x0F); \ +-buf = _mm_shuffle_epi32(t2, _MM_SHUFFLE(3,1,0,2)); +- +-#define LOAD_MSG_2_2(buf) \ +-t0 = _mm_unpacklo_epi32(m2,m0); \ +-t1 = _mm_blend_epi16(t0, m0, 0xF0); \ +-t2 = _mm_slli_si128(m3, 8); \ +-buf = _mm_blend_epi16(t1, t2, 0xC0); +- +-#define LOAD_MSG_2_3(buf) \ +-t0 = _mm_blend_epi16(m0, m2, 0x3C); \ +-t1 = _mm_srli_si128(m1, 12); \ +-t2 = _mm_blend_epi16(t0,t1,0x03); \ +-buf = _mm_shuffle_epi32(t2, _MM_SHUFFLE(1,0,3,2)); +- +-#define LOAD_MSG_2_4(buf) \ +-t0 = _mm_slli_si128(m3, 4); \ +-t1 = _mm_blend_epi16(m0, m1, 0x33); \ +-t2 = _mm_blend_epi16(t1, t0, 0xC0); \ +-buf = _mm_shuffle_epi32(t2, _MM_SHUFFLE(0,1,2,3)); +- +-#define LOAD_MSG_3_1(buf) \ +-t0 = _mm_unpackhi_epi32(m0,m1); \ +-t1 = _mm_unpackhi_epi32(t0, m2); \ +-t2 = _mm_blend_epi16(t1, m3, 0x0C); \ +-buf = _mm_shuffle_epi32(t2, _MM_SHUFFLE(3,1,0,2)); +- +-#define LOAD_MSG_3_2(buf) \ +-t0 = _mm_slli_si128(m2, 8); \ +-t1 = _mm_blend_epi16(m3,m0,0x0C); \ +-t2 = _mm_blend_epi16(t1, t0, 0xC0); \ +-buf = _mm_shuffle_epi32(t2, _MM_SHUFFLE(2,0,1,3)); +- +-#define LOAD_MSG_3_3(buf) \ +-t0 = _mm_blend_epi16(m0,m1,0x0F); \ +-t1 = _mm_blend_epi16(t0, m3, 0xC0); \ +-buf = _mm_shuffle_epi32(t1, _MM_SHUFFLE(3,0,1,2)); +- +-#define LOAD_MSG_3_4(buf) \ +-t0 = _mm_unpacklo_epi32(m0,m2); \ +-t1 = _mm_unpackhi_epi32(m1,m2); \ +-buf = _mm_unpacklo_epi64(t1,t0); +- +-#define LOAD_MSG_4_1(buf) \ +-t0 = _mm_unpacklo_epi64(m1,m2); \ +-t1 = _mm_unpackhi_epi64(m0,m2); \ +-t2 = _mm_blend_epi16(t0,t1,0x33); \ +-buf = _mm_shuffle_epi32(t2, _MM_SHUFFLE(2,0,1,3)); +- +-#define LOAD_MSG_4_2(buf) \ +-t0 = _mm_unpackhi_epi64(m1,m3); \ +-t1 = _mm_unpacklo_epi64(m0,m1); \ +-buf = _mm_blend_epi16(t0,t1,0x33); +- +-#define LOAD_MSG_4_3(buf) \ +-t0 = _mm_unpackhi_epi64(m3,m1); \ +-t1 = _mm_unpackhi_epi64(m2,m0); \ +-buf = _mm_blend_epi16(t1,t0,0x33); +- +-#define LOAD_MSG_4_4(buf) \ +-t0 = _mm_blend_epi16(m0,m2,0x03); \ +-t1 = _mm_slli_si128(t0, 8); \ +-t2 = _mm_blend_epi16(t1,m3,0x0F); \ +-buf = _mm_shuffle_epi32(t2, _MM_SHUFFLE(1,2,0,3)); +- +-#define LOAD_MSG_5_1(buf) \ +-t0 = _mm_unpackhi_epi32(m0,m1); \ +-t1 = _mm_unpacklo_epi32(m0,m2); \ +-buf = _mm_unpacklo_epi64(t0,t1); +- +-#define LOAD_MSG_5_2(buf) \ +-t0 = _mm_srli_si128(m2, 4); \ +-t1 = _mm_blend_epi16(m0,m3,0x03); \ +-buf = _mm_blend_epi16(t1,t0,0x3C); +- +-#define LOAD_MSG_5_3(buf) \ +-t0 = _mm_blend_epi16(m1,m0,0x0C); \ +-t1 = _mm_srli_si128(m3, 4); \ +-t2 = _mm_blend_epi16(t0,t1,0x30); \ +-buf = _mm_shuffle_epi32(t2, _MM_SHUFFLE(1,2,3,0)); +- +-#define LOAD_MSG_5_4(buf) \ +-t0 = _mm_unpacklo_epi64(m1,m2); \ +-t1= _mm_shuffle_epi32(m3, _MM_SHUFFLE(0,2,0,1)); \ +-buf = _mm_blend_epi16(t0,t1,0x33); +- +-#define LOAD_MSG_6_1(buf) \ +-t0 = _mm_slli_si128(m1, 12); \ +-t1 = _mm_blend_epi16(m0,m3,0x33); \ +-buf = _mm_blend_epi16(t1,t0,0xC0); +- +-#define LOAD_MSG_6_2(buf) \ +-t0 = _mm_blend_epi16(m3,m2,0x30); \ +-t1 = _mm_srli_si128(m1, 4); \ +-t2 = _mm_blend_epi16(t0,t1,0x03); \ +-buf = _mm_shuffle_epi32(t2, _MM_SHUFFLE(2,1,3,0)); +- +-#define LOAD_MSG_6_3(buf) \ +-t0 = _mm_unpacklo_epi64(m0,m2); \ +-t1 = _mm_srli_si128(m1, 4); \ +-buf = _mm_shuffle_epi32(_mm_blend_epi16(t0,t1,0x0C), _MM_SHUFFLE(2,3,1,0)); +- +-#define LOAD_MSG_6_4(buf) \ +-t0 = _mm_unpackhi_epi32(m1,m2); \ +-t1 = _mm_unpackhi_epi64(m0,t0); \ +-buf = _mm_shuffle_epi32(t1, _MM_SHUFFLE(3,0,1,2)); +- +-#define LOAD_MSG_7_1(buf) \ +-t0 = _mm_unpackhi_epi32(m0,m1); \ +-t1 = _mm_blend_epi16(t0,m3,0x0F); \ +-buf = _mm_shuffle_epi32(t1,_MM_SHUFFLE(2,0,3,1)); +- +-#define LOAD_MSG_7_2(buf) \ +-t0 = _mm_blend_epi16(m2,m3,0x30); \ +-t1 = _mm_srli_si128(m0,4); \ +-t2 = _mm_blend_epi16(t0,t1,0x03); \ +-buf = _mm_shuffle_epi32(t2, _MM_SHUFFLE(1,0,2,3)); +- +-#define LOAD_MSG_7_3(buf) \ +-t0 = _mm_unpackhi_epi64(m0,m3); \ +-t1 = _mm_unpacklo_epi64(m1,m2); \ +-t2 = _mm_blend_epi16(t0,t1,0x3C); \ +-buf = _mm_shuffle_epi32(t2,_MM_SHUFFLE(0,2,3,1)); +- +-#define LOAD_MSG_7_4(buf) \ +-t0 = _mm_unpacklo_epi32(m0,m1); \ +-t1 = _mm_unpackhi_epi32(m1,m2); \ +-buf = _mm_unpacklo_epi64(t0,t1); +- +-#define LOAD_MSG_8_1(buf) \ +-t0 = _mm_unpackhi_epi32(m1,m3); \ +-t1 = _mm_unpacklo_epi64(t0,m0); \ +-t2 = _mm_blend_epi16(t1,m2,0xC0); \ +-buf = _mm_shufflehi_epi16(t2,_MM_SHUFFLE(1,0,3,2)); +- +-#define LOAD_MSG_8_2(buf) \ +-t0 = _mm_unpackhi_epi32(m0,m3); \ +-t1 = _mm_blend_epi16(m2,t0,0xF0); \ +-buf = _mm_shuffle_epi32(t1,_MM_SHUFFLE(0,2,1,3)); +- +-#define LOAD_MSG_8_3(buf) \ +-t0 = _mm_blend_epi16(m2,m0,0x0C); \ +-t1 = _mm_slli_si128(t0,4); \ +-buf = _mm_blend_epi16(t1,m3,0x0F); +- +-#define LOAD_MSG_8_4(buf) \ +-t0 = _mm_blend_epi16(m1,m0,0x30); \ +-buf = _mm_shuffle_epi32(t0,_MM_SHUFFLE(1,0,3,2)); +- +-#define LOAD_MSG_9_1(buf) \ +-t0 = _mm_blend_epi16(m0,m2,0x03); \ +-t1 = _mm_blend_epi16(m1,m2,0x30); \ +-t2 = _mm_blend_epi16(t1,t0,0x0F); \ +-buf = _mm_shuffle_epi32(t2,_MM_SHUFFLE(1,3,0,2)); +- +-#define LOAD_MSG_9_2(buf) \ +-t0 = _mm_slli_si128(m0,4); \ +-t1 = _mm_blend_epi16(m1,t0,0xC0); \ +-buf = _mm_shuffle_epi32(t1,_MM_SHUFFLE(1,2,0,3)); +- +-#define LOAD_MSG_9_3(buf) \ +-t0 = _mm_unpackhi_epi32(m0,m3); \ +-t1 = _mm_unpacklo_epi32(m2,m3); \ +-t2 = _mm_unpackhi_epi64(t0,t1); \ +-buf = _mm_shuffle_epi32(t2,_MM_SHUFFLE(3,0,2,1)); +- +-#define LOAD_MSG_9_4(buf) \ +-t0 = _mm_blend_epi16(m3,m2,0xC0); \ +-t1 = _mm_unpacklo_epi32(m0,m3); \ +-t2 = _mm_blend_epi16(t0,t1,0x0F); \ +-buf = _mm_shuffle_epi32(t2,_MM_SHUFFLE(0,1,2,3)); +- +-#endif +--- thirdparty/blake2/blake2s-load-xop.h.orig 2018-03-16 17:25:33 UTC ++++ thirdparty/blake2/blake2s-load-xop.h +@@ -1,191 +0,0 @@ +-/* +- BLAKE2 reference source code package - optimized C implementations +- +- Copyright 2012, Samuel Neves <sneves@dei.uc.pt>. You may use this under the +- terms of the CC0, the OpenSSL Licence, or the Apache Public License 2.0, at +- your option. The terms of these licenses can be found at: +- +- - CC0 1.0 Universal : http://creativecommons.org/publicdomain/zero/1.0 +- - OpenSSL license : https://www.openssl.org/source/license.html +- - Apache 2.0 : http://www.apache.org/licenses/LICENSE-2.0 +- +- More information about the BLAKE2 hash function can be found at +- https://blake2.net. +-*/ +-#ifndef BLAKE2S_LOAD_XOP_H +-#define BLAKE2S_LOAD_XOP_H +- +-#define TOB(x) ((x)*4*0x01010101 + 0x03020100) /* ..or not TOB */ +- +-#if 0 +-/* Basic VPPERM emulation, for testing purposes */ +-static __m128i _mm_perm_epi8(const __m128i src1, const __m128i src2, const __m128i sel) +-{ +- const __m128i sixteen = _mm_set1_epi8(16); +- const __m128i t0 = _mm_shuffle_epi8(src1, sel); +- const __m128i s1 = _mm_shuffle_epi8(src2, _mm_sub_epi8(sel, sixteen)); +- const __m128i mask = _mm_or_si128(_mm_cmpeq_epi8(sel, sixteen), +- _mm_cmpgt_epi8(sel, sixteen)); /* (>=16) = 0xff : 00 */ +- return _mm_blendv_epi8(t0, s1, mask); +-} +-#endif +- +-#define LOAD_MSG_0_1(buf) \ +-buf = _mm_perm_epi8(m0, m1, _mm_set_epi32(TOB(6),TOB(4),TOB(2),TOB(0)) ); +- +-#define LOAD_MSG_0_2(buf) \ +-buf = _mm_perm_epi8(m0, m1, _mm_set_epi32(TOB(7),TOB(5),TOB(3),TOB(1)) ); +- +-#define LOAD_MSG_0_3(buf) \ +-buf = _mm_perm_epi8(m2, m3, _mm_set_epi32(TOB(6),TOB(4),TOB(2),TOB(0)) ); +- +-#define LOAD_MSG_0_4(buf) \ +-buf = _mm_perm_epi8(m2, m3, _mm_set_epi32(TOB(7),TOB(5),TOB(3),TOB(1)) ); +- +-#define LOAD_MSG_1_1(buf) \ +-t0 = _mm_perm_epi8(m1, m2, _mm_set_epi32(TOB(0),TOB(5),TOB(0),TOB(0)) ); \ +-buf = _mm_perm_epi8(t0, m3, _mm_set_epi32(TOB(5),TOB(2),TOB(1),TOB(6)) ); +- +-#define LOAD_MSG_1_2(buf) \ +-t1 = _mm_perm_epi8(m1, m2, _mm_set_epi32(TOB(2),TOB(0),TOB(4),TOB(6)) ); \ +-buf = _mm_perm_epi8(t1, m3, _mm_set_epi32(TOB(3),TOB(7),TOB(1),TOB(0)) ); +- +-#define LOAD_MSG_1_3(buf) \ +-t0 = _mm_perm_epi8(m0, m1, _mm_set_epi32(TOB(5),TOB(0),TOB(0),TOB(1)) ); \ +-buf = _mm_perm_epi8(t0, m2, _mm_set_epi32(TOB(3),TOB(7),TOB(1),TOB(0)) ); +- +-#define LOAD_MSG_1_4(buf) \ +-t1 = _mm_perm_epi8(m0, m1, _mm_set_epi32(TOB(3),TOB(7),TOB(2),TOB(0)) ); \ +-buf = _mm_perm_epi8(t1, m3, _mm_set_epi32(TOB(3),TOB(2),TOB(1),TOB(4)) ); +- +-#define LOAD_MSG_2_1(buf) \ +-t0 = _mm_perm_epi8(m1, m2, _mm_set_epi32(TOB(0),TOB(1),TOB(0),TOB(7)) ); \ +-buf = _mm_perm_epi8(t0, m3, _mm_set_epi32(TOB(7),TOB(2),TOB(4),TOB(0)) ); +- +-#define LOAD_MSG_2_2(buf) \ +-t1 = _mm_perm_epi8(m0, m2, _mm_set_epi32(TOB(0),TOB(2),TOB(0),TOB(4)) ); \ +-buf = _mm_perm_epi8(t1, m3, _mm_set_epi32(TOB(5),TOB(2),TOB(1),TOB(0)) ); +- +-#define LOAD_MSG_2_3(buf) \ +-t0 = _mm_perm_epi8(m0, m1, _mm_set_epi32(TOB(0),TOB(7),TOB(3),TOB(0)) ); \ +-buf = _mm_perm_epi8(t0, m2, _mm_set_epi32(TOB(5),TOB(2),TOB(1),TOB(6)) ); +- +-#define LOAD_MSG_2_4(buf) \ +-t1 = _mm_perm_epi8(m0, m1, _mm_set_epi32(TOB(4),TOB(1),TOB(6),TOB(0)) ); \ +-buf = _mm_perm_epi8(t1, m3, _mm_set_epi32(TOB(3),TOB(2),TOB(1),TOB(6)) ); +- +-#define LOAD_MSG_3_1(buf) \ +-t0 = _mm_perm_epi8(m0, m1, _mm_set_epi32(TOB(0),TOB(0),TOB(3),TOB(7)) ); \ +-t0 = _mm_perm_epi8(t0, m2, _mm_set_epi32(TOB(7),TOB(2),TOB(1),TOB(0)) ); \ +-buf = _mm_perm_epi8(t0, m3, _mm_set_epi32(TOB(3),TOB(5),TOB(1),TOB(0)) ); +- +-#define LOAD_MSG_3_2(buf) \ +-t1 = _mm_perm_epi8(m0, m2, _mm_set_epi32(TOB(0),TOB(0),TOB(1),TOB(5)) ); \ +-buf = _mm_perm_epi8(t1, m3, _mm_set_epi32(TOB(6),TOB(4),TOB(1),TOB(0)) ); +- +-#define LOAD_MSG_3_3(buf) \ +-t0 = _mm_perm_epi8(m0, m1, _mm_set_epi32(TOB(0),TOB(4),TOB(5),TOB(2)) ); \ +-buf = _mm_perm_epi8(t0, m3, _mm_set_epi32(TOB(7),TOB(2),TOB(1),TOB(0)) ); +- +-#define LOAD_MSG_3_4(buf) \ +-t1 = _mm_perm_epi8(m0, m1, _mm_set_epi32(TOB(0),TOB(0),TOB(0),TOB(6)) ); \ +-buf = _mm_perm_epi8(t1, m2, _mm_set_epi32(TOB(4),TOB(2),TOB(6),TOB(0)) ); +- +-#define LOAD_MSG_4_1(buf) \ +-t0 = _mm_perm_epi8(m0, m1, _mm_set_epi32(TOB(0),TOB(2),TOB(5),TOB(0)) ); \ +-buf = _mm_perm_epi8(t0, m2, _mm_set_epi32(TOB(6),TOB(2),TOB(1),TOB(5)) ); +- +-#define LOAD_MSG_4_2(buf) \ +-t1 = _mm_perm_epi8(m0, m1, _mm_set_epi32(TOB(0),TOB(4),TOB(7),TOB(0)) ); \ +-buf = _mm_perm_epi8(t1, m3, _mm_set_epi32(TOB(7),TOB(2),TOB(1),TOB(0)) ); +- +-#define LOAD_MSG_4_3(buf) \ +-t0 = _mm_perm_epi8(m0, m1, _mm_set_epi32(TOB(3),TOB(6),TOB(0),TOB(0)) ); \ +-t0 = _mm_perm_epi8(t0, m2, _mm_set_epi32(TOB(3),TOB(2),TOB(7),TOB(0)) ); \ +-buf = _mm_perm_epi8(t0, m3, _mm_set_epi32(TOB(3),TOB(2),TOB(1),TOB(6)) ); +- +-#define LOAD_MSG_4_4(buf) \ +-t1 = _mm_perm_epi8(m0, m2, _mm_set_epi32(TOB(0),TOB(4),TOB(0),TOB(1)) ); \ +-buf = _mm_perm_epi8(t1, m3, _mm_set_epi32(TOB(5),TOB(2),TOB(4),TOB(0)) ); +- +-#define LOAD_MSG_5_1(buf) \ +-t0 = _mm_perm_epi8(m0, m1, _mm_set_epi32(TOB(0),TOB(0),TOB(6),TOB(2)) ); \ +-buf = _mm_perm_epi8(t0, m2, _mm_set_epi32(TOB(4),TOB(2),TOB(1),TOB(0)) ); +- +-#define LOAD_MSG_5_2(buf) \ +-t1 = _mm_perm_epi8(m0, m2, _mm_set_epi32(TOB(3),TOB(7),TOB(6),TOB(0)) ); \ +-buf = _mm_perm_epi8(t1, m3, _mm_set_epi32(TOB(3),TOB(2),TOB(1),TOB(4)) ); +- +-#define LOAD_MSG_5_3(buf) \ +-t0 = _mm_perm_epi8(m0, m1, _mm_set_epi32(TOB(1),TOB(0),TOB(7),TOB(4)) ); \ +-buf = _mm_perm_epi8(t0, m3, _mm_set_epi32(TOB(3),TOB(7),TOB(1),TOB(0)) ); +- +-#define LOAD_MSG_5_4(buf) \ +-t1 = _mm_perm_epi8(m1, m2, _mm_set_epi32(TOB(5),TOB(0),TOB(1),TOB(0)) ); \ +-buf = _mm_perm_epi8(t1, m3, _mm_set_epi32(TOB(3),TOB(6),TOB(1),TOB(5)) ); +- +-#define LOAD_MSG_6_1(buf) \ +-t0 = _mm_perm_epi8(m0, m1, _mm_set_epi32(TOB(4),TOB(0),TOB(1),TOB(0)) ); \ +-buf = _mm_perm_epi8(t0, m3, _mm_set_epi32(TOB(3),TOB(6),TOB(1),TOB(4)) ); +- +-#define LOAD_MSG_6_2(buf) \ +-t1 = _mm_perm_epi8(m1, m2, _mm_set_epi32(TOB(6),TOB(0),TOB(0),TOB(1)) ); \ +-buf = _mm_perm_epi8(t1, m3, _mm_set_epi32(TOB(3),TOB(5),TOB(7),TOB(0)) ); +- +-#define LOAD_MSG_6_3(buf) \ +-t0 = _mm_perm_epi8(m0, m1, _mm_set_epi32(TOB(0),TOB(0),TOB(6),TOB(0)) ); \ +-buf = _mm_perm_epi8(t0, m2, _mm_set_epi32(TOB(4),TOB(5),TOB(1),TOB(0)) ); +- +-#define LOAD_MSG_6_4(buf) \ +-t1 = _mm_perm_epi8(m0, m1, _mm_set_epi32(TOB(0),TOB(2),TOB(3),TOB(7)) ); \ +-buf = _mm_perm_epi8(t1, m2, _mm_set_epi32(TOB(7),TOB(2),TOB(1),TOB(0)) ); +- +-#define LOAD_MSG_7_1(buf) \ +-t0 = _mm_perm_epi8(m0, m1, _mm_set_epi32(TOB(3),TOB(0),TOB(7),TOB(0)) ); \ +-buf = _mm_perm_epi8(t0, m3, _mm_set_epi32(TOB(3),TOB(4),TOB(1),TOB(5)) ); +- +-#define LOAD_MSG_7_2(buf) \ +-t1 = _mm_perm_epi8(m0, m2, _mm_set_epi32(TOB(5),TOB(1),TOB(0),TOB(7)) ); \ +-buf = _mm_perm_epi8(t1, m3, _mm_set_epi32(TOB(3),TOB(2),TOB(6),TOB(0)) ); +- +-#define LOAD_MSG_7_3(buf) \ +-t0 = _mm_perm_epi8(m0, m1, _mm_set_epi32(TOB(2),TOB(0),TOB(0),TOB(5)) ); \ +-t0 = _mm_perm_epi8(t0, m2, _mm_set_epi32(TOB(3),TOB(4),TOB(1),TOB(0)) ); \ +-buf = _mm_perm_epi8(t0, m3, _mm_set_epi32(TOB(3),TOB(2),TOB(7),TOB(0)) ); +- +-#define LOAD_MSG_7_4(buf) \ +-t1 = _mm_perm_epi8(m0, m1, _mm_set_epi32(TOB(0),TOB(6),TOB(4),TOB(0)) ); \ +-buf = _mm_perm_epi8(t1, m2, _mm_set_epi32(TOB(6),TOB(2),TOB(1),TOB(0)) ); +- +-#define LOAD_MSG_8_1(buf) \ +-t0 = _mm_perm_epi8(m0, m1, _mm_set_epi32(TOB(0),TOB(0),TOB(0),TOB(6)) ); \ +-t0 = _mm_perm_epi8(t0, m2, _mm_set_epi32(TOB(3),TOB(7),TOB(1),TOB(0)) ); \ +-buf = _mm_perm_epi8(t0, m3, _mm_set_epi32(TOB(3),TOB(2),TOB(6),TOB(0)) ); +- +-#define LOAD_MSG_8_2(buf) \ +-t1 = _mm_perm_epi8(m0, m2, _mm_set_epi32(TOB(4),TOB(3),TOB(5),TOB(0)) ); \ +-buf = _mm_perm_epi8(t1, m3, _mm_set_epi32(TOB(3),TOB(2),TOB(1),TOB(7)) ); +- +-#define LOAD_MSG_8_3(buf) \ +-t0 = _mm_perm_epi8(m0, m2, _mm_set_epi32(TOB(6),TOB(1),TOB(0),TOB(0)) ); \ +-buf = _mm_perm_epi8(t0, m3, _mm_set_epi32(TOB(3),TOB(2),TOB(5),TOB(4)) ); \ +- +-#define LOAD_MSG_8_4(buf) \ +-buf = _mm_perm_epi8(m0, m1, _mm_set_epi32(TOB(5),TOB(4),TOB(7),TOB(2)) ); +- +-#define LOAD_MSG_9_1(buf) \ +-t0 = _mm_perm_epi8(m0, m1, _mm_set_epi32(TOB(1),TOB(7),TOB(0),TOB(0)) ); \ +-buf = _mm_perm_epi8(t0, m2, _mm_set_epi32(TOB(3),TOB(2),TOB(4),TOB(6)) ); +- +-#define LOAD_MSG_9_2(buf) \ +-buf = _mm_perm_epi8(m0, m1, _mm_set_epi32(TOB(5),TOB(6),TOB(4),TOB(2)) ); +- +-#define LOAD_MSG_9_3(buf) \ +-t0 = _mm_perm_epi8(m0, m2, _mm_set_epi32(TOB(0),TOB(3),TOB(5),TOB(0)) ); \ +-buf = _mm_perm_epi8(t0, m3, _mm_set_epi32(TOB(5),TOB(2),TOB(1),TOB(7)) ); +- +-#define LOAD_MSG_9_4(buf) \ +-t1 = _mm_perm_epi8(m0, m2, _mm_set_epi32(TOB(0),TOB(0),TOB(0),TOB(7)) ); \ +-buf = _mm_perm_epi8(t1, m3, _mm_set_epi32(TOB(3),TOB(4),TOB(6),TOB(0)) ); +- +-#endif +--- thirdparty/blake2/blake2s-round.h.orig 2018-03-16 17:25:33 UTC ++++ thirdparty/blake2/blake2s-round.h +@@ -1,88 +0,0 @@ +-/* +- BLAKE2 reference source code package - optimized C implementations +- +- Copyright 2012, Samuel Neves <sneves@dei.uc.pt>. You may use this under the +- terms of the CC0, the OpenSSL Licence, or the Apache Public License 2.0, at +- your option. The terms of these licenses can be found at: +- +- - CC0 1.0 Universal : http://creativecommons.org/publicdomain/zero/1.0 +- - OpenSSL license : https://www.openssl.org/source/license.html +- - Apache 2.0 : http://www.apache.org/licenses/LICENSE-2.0 +- +- More information about the BLAKE2 hash function can be found at +- https://blake2.net. +-*/ +-#ifndef BLAKE2S_ROUND_H +-#define BLAKE2S_ROUND_H +- +-#define LOADU(p) _mm_loadu_si128( (const __m128i *)(p) ) +-#define STOREU(p,r) _mm_storeu_si128((__m128i *)(p), r) +- +-#define TOF(reg) _mm_castsi128_ps((reg)) +-#define TOI(reg) _mm_castps_si128((reg)) +- +-#define LIKELY(x) __builtin_expect((x),1) +- +- +-/* Microarchitecture-specific macros */ +-#ifndef HAVE_XOP +-#ifdef HAVE_SSSE3 +-#define _mm_roti_epi32(r, c) ( \ +- (8==-(c)) ? _mm_shuffle_epi8(r,r8) \ +- : (16==-(c)) ? _mm_shuffle_epi8(r,r16) \ +- : _mm_xor_si128(_mm_srli_epi32( (r), -(c) ),_mm_slli_epi32( (r), 32-(-(c)) )) ) +-#else +-#define _mm_roti_epi32(r, c) _mm_xor_si128(_mm_srli_epi32( (r), -(c) ),_mm_slli_epi32( (r), 32-(-(c)) )) +-#endif +-#else +-/* ... */ +-#endif +- +- +-#define G1(row1,row2,row3,row4,buf) \ +- row1 = _mm_add_epi32( _mm_add_epi32( row1, buf), row2 ); \ +- row4 = _mm_xor_si128( row4, row1 ); \ +- row4 = _mm_roti_epi32(row4, -16); \ +- row3 = _mm_add_epi32( row3, row4 ); \ +- row2 = _mm_xor_si128( row2, row3 ); \ +- row2 = _mm_roti_epi32(row2, -12); +- +-#define G2(row1,row2,row3,row4,buf) \ +- row1 = _mm_add_epi32( _mm_add_epi32( row1, buf), row2 ); \ +- row4 = _mm_xor_si128( row4, row1 ); \ +- row4 = _mm_roti_epi32(row4, -8); \ +- row3 = _mm_add_epi32( row3, row4 ); \ +- row2 = _mm_xor_si128( row2, row3 ); \ +- row2 = _mm_roti_epi32(row2, -7); +- +-#define DIAGONALIZE(row1,row2,row3,row4) \ +- row4 = _mm_shuffle_epi32( row4, _MM_SHUFFLE(2,1,0,3) ); \ +- row3 = _mm_shuffle_epi32( row3, _MM_SHUFFLE(1,0,3,2) ); \ +- row2 = _mm_shuffle_epi32( row2, _MM_SHUFFLE(0,3,2,1) ); +- +-#define UNDIAGONALIZE(row1,row2,row3,row4) \ +- row4 = _mm_shuffle_epi32( row4, _MM_SHUFFLE(0,3,2,1) ); \ +- row3 = _mm_shuffle_epi32( row3, _MM_SHUFFLE(1,0,3,2) ); \ +- row2 = _mm_shuffle_epi32( row2, _MM_SHUFFLE(2,1,0,3) ); +- +-#if defined(HAVE_XOP) +-#include "blake2s-load-xop.h" +-#elif defined(HAVE_SSE41) +-#include "blake2s-load-sse41.h" +-#else +-#include "blake2s-load-sse2.h" +-#endif +- +-#define ROUND(r) \ +- LOAD_MSG_ ##r ##_1(buf1); \ +- G1(row1,row2,row3,row4,buf1); \ +- LOAD_MSG_ ##r ##_2(buf2); \ +- G2(row1,row2,row3,row4,buf2); \ +- DIAGONALIZE(row1,row2,row3,row4); \ +- LOAD_MSG_ ##r ##_3(buf3); \ +- G1(row1,row2,row3,row4,buf3); \ +- LOAD_MSG_ ##r ##_4(buf4); \ +- G2(row1,row2,row3,row4,buf4); \ +- UNDIAGONALIZE(row1,row2,row3,row4); \ +- +-#endif +--- thirdparty/blake2/blake2s.c.orig 2018-03-16 17:25:33 UTC ++++ thirdparty/blake2/blake2s.c +@@ -1,363 +0,0 @@ +-/* +- BLAKE2 reference source code package - optimized C implementations +- +- Copyright 2012, Samuel Neves <sneves@dei.uc.pt>. You may use this under the +- terms of the CC0, the OpenSSL Licence, or the Apache Public License 2.0, at +- your option. The terms of these licenses can be found at: +- +- - CC0 1.0 Universal : http://creativecommons.org/publicdomain/zero/1.0 +- - OpenSSL license : https://www.openssl.org/source/license.html +- - Apache 2.0 : http://www.apache.org/licenses/LICENSE-2.0 +- +- More information about the BLAKE2 hash function can be found at +- https://blake2.net. +-*/ +- +-#include <stdint.h> +-#include <string.h> +-#include <stdio.h> +- +-#include "blake2.h" +-#include "blake2-impl.h" +- +-#include "blake2-config.h" +- +- +-#include <emmintrin.h> +-#if defined(HAVE_SSSE3) +-#include <tmmintrin.h> +-#endif +-#if defined(HAVE_SSE41) +-#include <smmintrin.h> +-#endif +-#if defined(HAVE_AVX) +-#include <immintrin.h> +-#endif +-#if defined(HAVE_XOP) +-#include <x86intrin.h> +-#endif +- +-#include "blake2s-round.h" +- +-static const uint32_t blake2s_IV[8] = +-{ +- 0x6A09E667UL, 0xBB67AE85UL, 0x3C6EF372UL, 0xA54FF53AUL, +- 0x510E527FUL, 0x9B05688CUL, 0x1F83D9ABUL, 0x5BE0CD19UL +-}; +- +-/* Some helper functions */ +-static void blake2s_set_lastnode( blake2s_state *S ) +-{ +- S->f[1] = (uint32_t)-1; +-} +- +-static int blake2s_is_lastblock( const blake2s_state *S ) +-{ +- return S->f[0] != 0; +-} +- +-static void blake2s_set_lastblock( blake2s_state *S ) +-{ +- if( S->last_node ) blake2s_set_lastnode( S ); +- +- S->f[0] = (uint32_t)-1; +-} +- +-static void blake2s_increment_counter( blake2s_state *S, const uint32_t inc ) +-{ +- uint64_t t = ( ( uint64_t )S->t[1] << 32 ) | S->t[0]; +- t += inc; +- S->t[0] = ( uint32_t )( t >> 0 ); +- S->t[1] = ( uint32_t )( t >> 32 ); +-} +- +-/* init2 xors IV with input parameter block */ +-int blake2s_init_param( blake2s_state *S, const blake2s_param *P ) +-{ +- size_t i; +- /*blake2s_init0( S ); */ +- const uint8_t * v = ( const uint8_t * )( blake2s_IV ); +- const uint8_t * p = ( const uint8_t * )( P ); +- uint8_t * h = ( uint8_t * )( S->h ); +- /* IV XOR ParamBlock */ +- memset( S, 0, sizeof( blake2s_state ) ); +- +- for( i = 0; i < BLAKE2S_OUTBYTES; ++i ) h[i] = v[i] ^ p[i]; +- +- S->outlen = P->digest_length; +- return 0; +-} +- +- +-/* Some sort of default parameter block initialization, for sequential blake2s */ +-int blake2s_init( blake2s_state *S, size_t outlen ) +-{ +- blake2s_param P[1]; +- +- /* Move interval verification here? */ +- if ( ( !outlen ) || ( outlen > BLAKE2S_OUTBYTES ) ) return -1; +- +- P->digest_length = (uint8_t)outlen; +- P->key_length = 0; +- P->fanout = 1; +- P->depth = 1; +- store32( &P->leaf_length, 0 ); +- store32( &P->node_offset, 0 ); +- store16( &P->xof_length, 0 ); +- P->node_depth = 0; +- P->inner_length = 0; +- /* memset(P->reserved, 0, sizeof(P->reserved) ); */ +- memset( P->salt, 0, sizeof( P->salt ) ); +- memset( P->personal, 0, sizeof( P->personal ) ); +- +- return blake2s_init_param( S, P ); +-} +- +- +-int blake2s_init_key( blake2s_state *S, size_t outlen, const void *key, size_t keylen ) +-{ +- blake2s_param P[1]; +- +- /* Move interval verification here? */ +- if ( ( !outlen ) || ( outlen > BLAKE2S_OUTBYTES ) ) return -1; +- +- if ( ( !key ) || ( !keylen ) || keylen > BLAKE2S_KEYBYTES ) return -1; +- +- P->digest_length = (uint8_t)outlen; +- P->key_length = (uint8_t)keylen; +- P->fanout = 1; +- P->depth = 1; +- store32( &P->leaf_length, 0 ); +- store32( &P->node_offset, 0 ); +- store16( &P->xof_length, 0 ); +- P->node_depth = 0; +- P->inner_length = 0; +- /* memset(P->reserved, 0, sizeof(P->reserved) ); */ +- memset( P->salt, 0, sizeof( P->salt ) ); +- memset( P->personal, 0, sizeof( P->personal ) ); +- +- if( blake2s_init_param( S, P ) < 0 ) +- return -1; +- +- { +- uint8_t block[BLAKE2S_BLOCKBYTES]; +- memset( block, 0, BLAKE2S_BLOCKBYTES ); +- memcpy( block, key, keylen ); +- blake2s_update( S, block, BLAKE2S_BLOCKBYTES ); +- secure_zero_memory( block, BLAKE2S_BLOCKBYTES ); /* Burn the key from stack */ +- } +- return 0; +-} +- +- +-static void blake2s_compress( blake2s_state *S, const uint8_t block[BLAKE2S_BLOCKBYTES] ) +-{ +- __m128i row1, row2, row3, row4; +- __m128i buf1, buf2, buf3, buf4; +-#if defined(HAVE_SSE41) +- __m128i t0, t1; +-#if !defined(HAVE_XOP) +- __m128i t2; +-#endif +-#endif +- __m128i ff0, ff1; +-#if defined(HAVE_SSSE3) && !defined(HAVE_XOP) +- const __m128i r8 = _mm_set_epi8( 12, 15, 14, 13, 8, 11, 10, 9, 4, 7, 6, 5, 0, 3, 2, 1 ); +- const __m128i r16 = _mm_set_epi8( 13, 12, 15, 14, 9, 8, 11, 10, 5, 4, 7, 6, 1, 0, 3, 2 ); +-#endif +-#if defined(HAVE_SSE41) +- const __m128i m0 = LOADU( block + 00 ); +- const __m128i m1 = LOADU( block + 16 ); +- const __m128i m2 = LOADU( block + 32 ); +- const __m128i m3 = LOADU( block + 48 ); +-#else +- const uint32_t m0 = load32(block + 0 * sizeof(uint32_t)); +- const uint32_t m1 = load32(block + 1 * sizeof(uint32_t)); +- const uint32_t m2 = load32(block + 2 * sizeof(uint32_t)); +- const uint32_t m3 = load32(block + 3 * sizeof(uint32_t)); +- const uint32_t m4 = load32(block + 4 * sizeof(uint32_t)); +- const uint32_t m5 = load32(block + 5 * sizeof(uint32_t)); +- const uint32_t m6 = load32(block + 6 * sizeof(uint32_t)); +- const uint32_t m7 = load32(block + 7 * sizeof(uint32_t)); +- const uint32_t m8 = load32(block + 8 * sizeof(uint32_t)); +- const uint32_t m9 = load32(block + 9 * sizeof(uint32_t)); +- const uint32_t m10 = load32(block + 10 * sizeof(uint32_t)); +- const uint32_t m11 = load32(block + 11 * sizeof(uint32_t)); +- const uint32_t m12 = load32(block + 12 * sizeof(uint32_t)); +- const uint32_t m13 = load32(block + 13 * sizeof(uint32_t)); +- const uint32_t m14 = load32(block + 14 * sizeof(uint32_t)); +- const uint32_t m15 = load32(block + 15 * sizeof(uint32_t)); +-#endif +- row1 = ff0 = LOADU( &S->h[0] ); +- row2 = ff1 = LOADU( &S->h[4] ); +- row3 = _mm_loadu_si128( (__m128i const *)&blake2s_IV[0] ); +- row4 = _mm_xor_si128( _mm_loadu_si128( (__m128i const *)&blake2s_IV[4] ), LOADU( &S->t[0] ) ); +- ROUND( 0 ); +- ROUND( 1 ); +- ROUND( 2 ); +- ROUND( 3 ); +- ROUND( 4 ); +- ROUND( 5 ); +- ROUND( 6 ); +- ROUND( 7 ); +- ROUND( 8 ); +- ROUND( 9 ); +- STOREU( &S->h[0], _mm_xor_si128( ff0, _mm_xor_si128( row1, row3 ) ) ); +- STOREU( &S->h[4], _mm_xor_si128( ff1, _mm_xor_si128( row2, row4 ) ) ); +-} +- +-int blake2s_update( blake2s_state *S, const void *pin, size_t inlen ) +-{ +- const unsigned char * in = (const unsigned char *)pin; +- if( inlen > 0 ) +- { +- size_t left = S->buflen; +- size_t fill = BLAKE2S_BLOCKBYTES - left; +- if( inlen > fill ) +- { +- S->buflen = 0; +- memcpy( S->buf + left, in, fill ); /* Fill buffer */ +- blake2s_increment_counter( S, BLAKE2S_BLOCKBYTES ); +- blake2s_compress( S, S->buf ); /* Compress */ +- in += fill; inlen -= fill; +- while(inlen > BLAKE2S_BLOCKBYTES) { +- blake2s_increment_counter(S, BLAKE2S_BLOCKBYTES); +- blake2s_compress( S, in ); +- in += BLAKE2S_BLOCKBYTES; +- inlen -= BLAKE2S_BLOCKBYTES; +- } +- } +- memcpy( S->buf + S->buflen, in, inlen ); +- S->buflen += inlen; +- } +- return 0; +-} +- +-int blake2s_final( blake2s_state *S, void *out, size_t outlen ) +-{ +- uint8_t buffer[BLAKE2S_OUTBYTES] = {0}; +- size_t i; +- +- if( out == NULL || outlen < S->outlen ) +- return -1; +- +- if( blake2s_is_lastblock( S ) ) +- return -1; +- +- blake2s_increment_counter( S, (uint32_t)S->buflen ); +- blake2s_set_lastblock( S ); +- memset( S->buf + S->buflen, 0, BLAKE2S_BLOCKBYTES - S->buflen ); /* Padding */ +- blake2s_compress( S, S->buf ); +- +- for( i = 0; i < 8; ++i ) /* Output full hash to temp buffer */ +- store32( buffer + sizeof( S->h[i] ) * i, S->h[i] ); +- +- memcpy( out, buffer, S->outlen ); +- secure_zero_memory( buffer, sizeof(buffer) ); +- return 0; +-} +- +-/* inlen, at least, should be uint64_t. Others can be size_t. */ +-int blake2s( void *out, size_t outlen, const void *in, size_t inlen, const void *key, size_t keylen ) +-{ +- blake2s_state S[1]; +- +- /* Verify parameters */ +- if ( NULL == in && inlen > 0 ) return -1; +- +- if ( NULL == out ) return -1; +- +- if ( NULL == key && keylen > 0) return -1; +- +- if( !outlen || outlen > BLAKE2S_OUTBYTES ) return -1; +- +- if( keylen > BLAKE2S_KEYBYTES ) return -1; +- +- if( keylen > 0 ) +- { +- if( blake2s_init_key( S, outlen, key, keylen ) < 0 ) return -1; +- } +- else +- { +- if( blake2s_init( S, outlen ) < 0 ) return -1; +- } +- +- blake2s_update( S, ( const uint8_t * )in, inlen ); +- blake2s_final( S, out, outlen ); +- return 0; +-} +- +-#if defined(SUPERCOP) +-int crypto_hash( unsigned char *out, unsigned char *in, unsigned long long inlen ) +-{ +- return blake2s( out, BLAKE2S_OUTBYTES, in, inlen, NULL, 0 ); +-} +-#endif +- +-#if defined(BLAKE2S_SELFTEST) +-#include <string.h> +-#include "blake2-kat.h" +-int main( void ) +-{ +- uint8_t key[BLAKE2S_KEYBYTES]; +- uint8_t buf[BLAKE2_KAT_LENGTH]; +- size_t i, step; +- +- for( i = 0; i < BLAKE2S_KEYBYTES; ++i ) +- key[i] = ( uint8_t )i; +- +- for( i = 0; i < BLAKE2_KAT_LENGTH; ++i ) +- buf[i] = ( uint8_t )i; +- +- /* Test simple API */ +- for( i = 0; i < BLAKE2_KAT_LENGTH; ++i ) +- { +- uint8_t hash[BLAKE2S_OUTBYTES]; +- blake2s( hash, BLAKE2S_OUTBYTES, buf, i, key, BLAKE2S_KEYBYTES ); +- +- if( 0 != memcmp( hash, blake2s_keyed_kat[i], BLAKE2S_OUTBYTES ) ) +- { +- goto fail; +- } +- } +- +- /* Test streaming API */ +- for(step = 1; step < BLAKE2S_BLOCKBYTES; ++step) { +- for (i = 0; i < BLAKE2_KAT_LENGTH; ++i) { +- uint8_t hash[BLAKE2S_OUTBYTES]; +- blake2s_state S; +- uint8_t * p = buf; +- size_t mlen = i; +- int err = 0; +- +- if( (err = blake2s_init_key(&S, BLAKE2S_OUTBYTES, key, BLAKE2S_KEYBYTES)) < 0 ) { +- goto fail; +- } +- +- while (mlen >= step) { +- if ( (err = blake2s_update(&S, p, step)) < 0 ) { +- goto fail; +- } +- mlen -= step; +- p += step; +- } +- if ( (err = blake2s_update(&S, p, mlen)) < 0) { +- goto fail; +- } +- if ( (err = blake2s_final(&S, hash, BLAKE2S_OUTBYTES)) < 0) { +- goto fail; +- } +- +- if (0 != memcmp(hash, blake2s_keyed_kat[i], BLAKE2S_OUTBYTES)) { +- goto fail; +- } +- } +- } +- +- puts( "ok" ); +- return 0; +-fail: +- puts("error"); +- return -1; +-} +-#endif +--- thirdparty/blake2/blake2sp.c.orig 2018-03-16 17:25:33 UTC ++++ thirdparty/blake2/blake2sp.c +@@ -1,358 +0,0 @@ +-/* +- BLAKE2 reference source code package - optimized C implementations +- +- Copyright 2012, Samuel Neves <sneves@dei.uc.pt>. You may use this under the +- terms of the CC0, the OpenSSL Licence, or the Apache Public License 2.0, at +- your option. The terms of these licenses can be found at: +- +- - CC0 1.0 Universal : http://creativecommons.org/publicdomain/zero/1.0 +- - OpenSSL license : https://www.openssl.org/source/license.html +- - Apache 2.0 : http://www.apache.org/licenses/LICENSE-2.0 +- +- More information about the BLAKE2 hash function can be found at +- https://blake2.net. +-*/ +- +-#include <stdlib.h> +-#include <string.h> +-#include <stdio.h> +- +-#if defined(_OPENMP) +-#include <omp.h> +-#endif +- +-#include "blake2.h" +-#include "blake2-impl.h" +- +-#define PARALLELISM_DEGREE 8 +- +-/* +- blake2sp_init_param defaults to setting the expecting output length +- from the digest_length parameter block field. +- +- In some cases, however, we do not want this, as the output length +- of these instances is given by inner_length instead. +-*/ +-static int blake2sp_init_leaf_param( blake2s_state *S, const blake2s_param *P ) +-{ +- int err = blake2s_init_param(S, P); +- S->outlen = P->inner_length; +- return err; +-} +- +-static int blake2sp_init_leaf( blake2s_state *S, size_t outlen, size_t keylen, uint64_t offset ) +-{ +- blake2s_param P[1]; +- P->digest_length = (uint8_t)outlen; +- P->key_length = (uint8_t)keylen; +- P->fanout = PARALLELISM_DEGREE; +- P->depth = 2; +- P->leaf_length = 0; +- P->node_offset = offset; +- P->xof_length = 0; +- P->node_depth = 0; +- P->inner_length = BLAKE2S_OUTBYTES; +- memset( P->salt, 0, sizeof( P->salt ) ); +- memset( P->personal, 0, sizeof( P->personal ) ); +- return blake2sp_init_leaf_param( S, P ); +-} +- +-static int blake2sp_init_root( blake2s_state *S, size_t outlen, size_t keylen ) +-{ +- blake2s_param P[1]; +- P->digest_length = (uint8_t)outlen; +- P->key_length = (uint8_t)keylen; +- P->fanout = PARALLELISM_DEGREE; +- P->depth = 2; +- P->leaf_length = 0; +- P->node_offset = 0; +- P->xof_length = 0; +- P->node_depth = 1; +- P->inner_length = BLAKE2S_OUTBYTES; +- memset( P->salt, 0, sizeof( P->salt ) ); +- memset( P->personal, 0, sizeof( P->personal ) ); +- return blake2s_init_param( S, P ); +-} +- +- +-int blake2sp_init( blake2sp_state *S, size_t outlen ) +-{ +- size_t i; +- +- if( !outlen || outlen > BLAKE2S_OUTBYTES ) return -1; +- +- memset( S->buf, 0, sizeof( S->buf ) ); +- S->buflen = 0; +- S->outlen = outlen; +- +- if( blake2sp_init_root( S->R, outlen, 0 ) < 0 ) +- return -1; +- +- for( i = 0; i < PARALLELISM_DEGREE; ++i ) +- if( blake2sp_init_leaf( S->S[i], outlen, 0, i ) < 0 ) return -1; +- +- S->R->last_node = 1; +- S->S[PARALLELISM_DEGREE - 1]->last_node = 1; +- return 0; +-} +- +-int blake2sp_init_key( blake2sp_state *S, size_t outlen, const void *key, size_t keylen ) +-{ +- size_t i; +- +- if( !outlen || outlen > BLAKE2S_OUTBYTES ) return -1; +- +- if( !key || !keylen || keylen > BLAKE2S_KEYBYTES ) return -1; +- +- memset( S->buf, 0, sizeof( S->buf ) ); +- S->buflen = 0; +- S->outlen = outlen; +- +- if( blake2sp_init_root( S->R, outlen, keylen ) < 0 ) +- return -1; +- +- for( i = 0; i < PARALLELISM_DEGREE; ++i ) +- if( blake2sp_init_leaf( S->S[i], outlen, keylen, i ) < 0 ) return -1; +- +- S->R->last_node = 1; +- S->S[PARALLELISM_DEGREE - 1]->last_node = 1; +- { +- uint8_t block[BLAKE2S_BLOCKBYTES]; +- memset( block, 0, BLAKE2S_BLOCKBYTES ); +- memcpy( block, key, keylen ); +- +- for( i = 0; i < PARALLELISM_DEGREE; ++i ) +- blake2s_update( S->S[i], block, BLAKE2S_BLOCKBYTES ); +- +- secure_zero_memory( block, BLAKE2S_BLOCKBYTES ); /* Burn the key from stack */ +- } +- return 0; +-} +- +- +-int blake2sp_update( blake2sp_state *S, const void *pin, size_t inlen ) +-{ +- const unsigned char * in = (const unsigned char *)pin; +- size_t left = S->buflen; +- size_t fill = sizeof( S->buf ) - left; +- size_t i; +- +- if( left && inlen >= fill ) +- { +- memcpy( S->buf + left, in, fill ); +- +- for( i = 0; i < PARALLELISM_DEGREE; ++i ) +- blake2s_update( S->S[i], S->buf + i * BLAKE2S_BLOCKBYTES, BLAKE2S_BLOCKBYTES ); +- +- in += fill; +- inlen -= fill; +- left = 0; +- } +- +-#if defined(_OPENMP) +- #pragma omp parallel shared(S), num_threads(PARALLELISM_DEGREE) +-#else +- +- for( i = 0; i < PARALLELISM_DEGREE; ++i ) +-#endif +- { +-#if defined(_OPENMP) +- size_t i = omp_get_thread_num(); +-#endif +- size_t inlen__ = inlen; +- const unsigned char *in__ = ( const unsigned char * )in; +- in__ += i * BLAKE2S_BLOCKBYTES; +- +- while( inlen__ >= PARALLELISM_DEGREE * BLAKE2S_BLOCKBYTES ) +- { +- blake2s_update( S->S[i], in__, BLAKE2S_BLOCKBYTES ); +- in__ += PARALLELISM_DEGREE * BLAKE2S_BLOCKBYTES; +- inlen__ -= PARALLELISM_DEGREE * BLAKE2S_BLOCKBYTES; +- } +- } +- +- in += inlen - inlen % ( PARALLELISM_DEGREE * BLAKE2S_BLOCKBYTES ); +- inlen %= PARALLELISM_DEGREE * BLAKE2S_BLOCKBYTES; +- +- if( inlen > 0 ) +- memcpy( S->buf + left, in, inlen ); +- +- S->buflen = left + inlen; +- return 0; +-} +- +- +-int blake2sp_final( blake2sp_state *S, void *out, size_t outlen ) +-{ +- uint8_t hash[PARALLELISM_DEGREE][BLAKE2S_OUTBYTES]; +- size_t i; +- +- if(out == NULL || outlen < S->outlen) { +- return -1; +- } +- +- for( i = 0; i < PARALLELISM_DEGREE; ++i ) +- { +- if( S->buflen > i * BLAKE2S_BLOCKBYTES ) +- { +- size_t left = S->buflen - i * BLAKE2S_BLOCKBYTES; +- +- if( left > BLAKE2S_BLOCKBYTES ) left = BLAKE2S_BLOCKBYTES; +- +- blake2s_update( S->S[i], S->buf + i * BLAKE2S_BLOCKBYTES, left ); +- } +- +- blake2s_final( S->S[i], hash[i], BLAKE2S_OUTBYTES ); +- } +- +- for( i = 0; i < PARALLELISM_DEGREE; ++i ) +- blake2s_update( S->R, hash[i], BLAKE2S_OUTBYTES ); +- +- return blake2s_final( S->R, out, S->outlen ); +-} +- +- +-int blake2sp( void *out, size_t outlen, const void *in, size_t inlen, const void *key, size_t keylen ) +-{ +- uint8_t hash[PARALLELISM_DEGREE][BLAKE2S_OUTBYTES]; +- blake2s_state S[PARALLELISM_DEGREE][1]; +- blake2s_state FS[1]; +- size_t i; +- +- /* Verify parameters */ +- if ( NULL == in && inlen > 0 ) return -1; +- +- if ( NULL == out ) return -1; +- +- if ( NULL == key && keylen > 0) return -1; +- +- if( !outlen || outlen > BLAKE2S_OUTBYTES ) return -1; +- +- if( keylen > BLAKE2S_KEYBYTES ) return -1; +- +- for( i = 0; i < PARALLELISM_DEGREE; ++i ) +- if( blake2sp_init_leaf( S[i], outlen, keylen, i ) < 0 ) return -1; +- +- S[PARALLELISM_DEGREE - 1]->last_node = 1; /* mark last node */ +- +- if( keylen > 0 ) +- { +- uint8_t block[BLAKE2S_BLOCKBYTES]; +- memset( block, 0, BLAKE2S_BLOCKBYTES ); +- memcpy( block, key, keylen ); +- +- for( i = 0; i < PARALLELISM_DEGREE; ++i ) +- blake2s_update( S[i], block, BLAKE2S_BLOCKBYTES ); +- +- secure_zero_memory( block, BLAKE2S_BLOCKBYTES ); /* Burn the key from stack */ +- } +- +-#if defined(_OPENMP) +- #pragma omp parallel shared(S,hash), num_threads(PARALLELISM_DEGREE) +-#else +- +- for( i = 0; i < PARALLELISM_DEGREE; ++i ) +-#endif +- { +-#if defined(_OPENMP) +- size_t i = omp_get_thread_num(); +-#endif +- size_t inlen__ = inlen; +- const unsigned char *in__ = ( const unsigned char * )in; +- in__ += i * BLAKE2S_BLOCKBYTES; +- +- while( inlen__ >= PARALLELISM_DEGREE * BLAKE2S_BLOCKBYTES ) +- { +- blake2s_update( S[i], in__, BLAKE2S_BLOCKBYTES ); +- in__ += PARALLELISM_DEGREE * BLAKE2S_BLOCKBYTES; +- inlen__ -= PARALLELISM_DEGREE * BLAKE2S_BLOCKBYTES; +- } +- +- if( inlen__ > i * BLAKE2S_BLOCKBYTES ) +- { +- const size_t left = inlen__ - i * BLAKE2S_BLOCKBYTES; +- const size_t len = left <= BLAKE2S_BLOCKBYTES ? left : BLAKE2S_BLOCKBYTES; +- blake2s_update( S[i], in__, len ); +- } +- +- blake2s_final( S[i], hash[i], BLAKE2S_OUTBYTES ); +- } +- +- if( blake2sp_init_root( FS, outlen, keylen ) < 0 ) +- return -1; +- +- FS->last_node = 1; +- +- for( i = 0; i < PARALLELISM_DEGREE; ++i ) +- blake2s_update( FS, hash[i], BLAKE2S_OUTBYTES ); +- +- return blake2s_final( FS, out, outlen ); +-} +- +-#if defined(BLAKE2SP_SELFTEST) +-#include <string.h> +-#include "blake2-kat.h" +-int main( void ) +-{ +- uint8_t key[BLAKE2S_KEYBYTES]; +- uint8_t buf[BLAKE2_KAT_LENGTH]; +- size_t i, step; +- +- for( i = 0; i < BLAKE2S_KEYBYTES; ++i ) +- key[i] = ( uint8_t )i; +- +- for( i = 0; i < BLAKE2_KAT_LENGTH; ++i ) +- buf[i] = ( uint8_t )i; +- +- /* Test simple API */ +- for( i = 0; i < BLAKE2_KAT_LENGTH; ++i ) +- { +- uint8_t hash[BLAKE2S_OUTBYTES]; +- blake2sp( hash, BLAKE2S_OUTBYTES, buf, i, key, BLAKE2S_KEYBYTES ); +- +- if( 0 != memcmp( hash, blake2sp_keyed_kat[i], BLAKE2S_OUTBYTES ) ) +- { +- goto fail; +- } +- } +- +- /* Test streaming API */ +- for(step = 1; step < BLAKE2S_BLOCKBYTES; ++step) { +- for (i = 0; i < BLAKE2_KAT_LENGTH; ++i) { +- uint8_t hash[BLAKE2S_OUTBYTES]; +- blake2sp_state S; +- uint8_t * p = buf; +- size_t mlen = i; +- int err = 0; +- +- if( (err = blake2sp_init_key(&S, BLAKE2S_OUTBYTES, key, BLAKE2S_KEYBYTES)) < 0 ) { +- goto fail; +- } +- +- while (mlen >= step) { +- if ( (err = blake2sp_update(&S, p, step)) < 0 ) { +- goto fail; +- } +- mlen -= step; +- p += step; +- } +- if ( (err = blake2sp_update(&S, p, mlen)) < 0) { +- goto fail; +- } +- if ( (err = blake2sp_final(&S, hash, BLAKE2S_OUTBYTES)) < 0) { +- goto fail; +- } +- +- if (0 != memcmp(hash, blake2sp_keyed_kat[i], BLAKE2S_OUTBYTES)) { +- goto fail; +- } +- } +- } +- +- puts( "ok" ); +- return 0; +-fail: +- puts("error"); +- return -1; +-} +-#endif +--- thirdparty/blake2/blake2xb.c.orig 2018-03-16 17:25:33 UTC ++++ thirdparty/blake2/blake2xb.c +@@ -1,241 +0,0 @@ +-/* +- BLAKE2 reference source code package - reference C implementations +- +- Copyright 2016, JP Aumasson <jeanphilippe.aumasson@gmail.com>. +- Copyright 2016, Samuel Neves <sneves@dei.uc.pt>. +- +- You may use this under the terms of the CC0, the OpenSSL Licence, or +- the Apache Public License 2.0, at your option. The terms of these +- licenses can be found at: +- +- - CC0 1.0 Universal : http://creativecommons.org/publicdomain/zero/1.0 +- - OpenSSL license : https://www.openssl.org/source/license.html +- - Apache 2.0 : http://www.apache.org/licenses/LICENSE-2.0 +- +- More information about the BLAKE2 hash function can be found at +- https://blake2.net. +-*/ +- +-#include <stdint.h> +-#include <string.h> +-#include <stdio.h> +- +-#include "blake2.h" +-#include "blake2-impl.h" +- +-int blake2xb_init( blake2xb_state *S, const size_t outlen ) { +- return blake2xb_init_key(S, outlen, NULL, 0); +-} +- +-int blake2xb_init_key( blake2xb_state *S, const size_t outlen, const void *key, size_t keylen) +-{ +- if ( outlen == 0 || outlen > 0xFFFFFFFFUL ) { +- return -1; +- } +- +- if (NULL != key && keylen > BLAKE2B_KEYBYTES) { +- return -1; +- } +- +- if (NULL == key && keylen > 0) { +- return -1; +- } +- +- /* Initialize parameter block */ +- S->P->digest_length = BLAKE2B_OUTBYTES; +- S->P->key_length = keylen; +- S->P->fanout = 1; +- S->P->depth = 1; +- store32( &S->P->leaf_length, 0 ); +- store32( &S->P->node_offset, 0 ); +- store32( &S->P->xof_length, outlen ); +- S->P->node_depth = 0; +- S->P->inner_length = 0; +- memset( S->P->reserved, 0, sizeof( S->P->reserved ) ); +- memset( S->P->salt, 0, sizeof( S->P->salt ) ); +- memset( S->P->personal, 0, sizeof( S->P->personal ) ); +- +- if( blake2b_init_param( S->S, S->P ) < 0 ) { +- return -1; +- } +- +- if (keylen > 0) { +- uint8_t block[BLAKE2B_BLOCKBYTES]; +- memset(block, 0, BLAKE2B_BLOCKBYTES); +- memcpy(block, key, keylen); +- blake2b_update(S->S, block, BLAKE2B_BLOCKBYTES); +- secure_zero_memory(block, BLAKE2B_BLOCKBYTES); +- } +- return 0; +-} +- +-int blake2xb_update( blake2xb_state *S, const void *in, size_t inlen ) { +- return blake2b_update( S->S, in, inlen ); +-} +- +-int blake2xb_final( blake2xb_state *S, void *out, size_t outlen) { +- +- blake2b_state C[1]; +- blake2b_param P[1]; +- uint32_t xof_length = load32(&S->P->xof_length); +- uint8_t root[BLAKE2B_BLOCKBYTES]; +- size_t i; +- +- if (NULL == out) { +- return -1; +- } +- +- /* outlen must match the output size defined in xof_length, */ +- /* unless it was -1, in which case anything goes except 0. */ +- if(xof_length == 0xFFFFFFFFUL) { +- if(outlen == 0) { +- return -1; +- } +- } else { +- if(outlen != xof_length) { +- return -1; +- } +- } +- +- /* Finalize the root hash */ +- if (blake2b_final(S->S, root, BLAKE2B_OUTBYTES) < 0) { +- return -1; +- } +- +- /* Set common block structure values */ +- /* Copy values from parent instance, and only change the ones below */ +- memcpy(P, S->P, sizeof(blake2b_param)); +- P->key_length = 0; +- P->fanout = 0; +- P->depth = 0; +- store32(&P->leaf_length, BLAKE2B_OUTBYTES); +- P->inner_length = BLAKE2B_OUTBYTES; +- P->node_depth = 0; +- +- for (i = 0; outlen > 0; ++i) { +- const size_t block_size = (outlen < BLAKE2B_OUTBYTES) ? outlen : BLAKE2B_OUTBYTES; +- /* Initialize state */ +- P->digest_length = block_size; +- store32(&P->node_offset, i); +- blake2b_init_param(C, P); +- /* Process key if needed */ +- blake2b_update(C, root, BLAKE2B_OUTBYTES); +- if (blake2b_final(C, (uint8_t *)out + i * BLAKE2B_OUTBYTES, block_size) < 0 ) { +- return -1; +- } +- outlen -= block_size; +- } +- secure_zero_memory(root, sizeof(root)); +- secure_zero_memory(P, sizeof(P)); +- secure_zero_memory(C, sizeof(C)); +- /* Put blake2xb in an invalid state? cf. blake2s_is_lastblock */ +- return 0; +- +-} +- +-int blake2xb(void *out, size_t outlen, const void *in, size_t inlen, const void *key, size_t keylen) +-{ +- blake2xb_state S[1]; +- +- /* Verify parameters */ +- if (NULL == in && inlen > 0) +- return -1; +- +- if (NULL == out) +- return -1; +- +- if (NULL == key && keylen > 0) +- return -1; +- +- if (keylen > BLAKE2B_KEYBYTES) +- return -1; +- +- if (outlen == 0) +- return -1; +- +- /* Initialize the root block structure */ +- if (blake2xb_init_key(S, outlen, key, keylen) < 0) { +- return -1; +- } +- +- /* Absorb the input message */ +- blake2xb_update(S, in, inlen); +- +- /* Compute the root node of the tree and the final hash using the counter construction */ +- return blake2xb_final(S, out, outlen); +-} +- +-#if defined(BLAKE2XB_SELFTEST) +-#include <string.h> +-#include "blake2-kat.h" +-int main( void ) +-{ +- uint8_t key[BLAKE2B_KEYBYTES]; +- uint8_t buf[BLAKE2_KAT_LENGTH]; +- size_t i, step, outlen; +- +- for( i = 0; i < BLAKE2B_KEYBYTES; ++i ) { +- key[i] = ( uint8_t )i; +- } +- +- for( i = 0; i < BLAKE2_KAT_LENGTH; ++i ) { +- buf[i] = ( uint8_t )i; +- } +- +- /* Testing length of ouputs rather than inputs */ +- /* (Test of input lengths mostly covered by blake2s tests) */ +- +- /* Test simple API */ +- for( outlen = 1; outlen <= BLAKE2_KAT_LENGTH; ++outlen ) +- { +- uint8_t hash[BLAKE2_KAT_LENGTH] = {0}; +- if( blake2xb( hash, outlen, buf, BLAKE2_KAT_LENGTH, key, BLAKE2B_KEYBYTES ) < 0 ) { +- goto fail; +- } +- +- if( 0 != memcmp( hash, blake2xb_keyed_kat[outlen-1], outlen ) ) +- { +- goto fail; +- } +- } +- +- /* Test streaming API */ +- for(step = 1; step < BLAKE2B_BLOCKBYTES; ++step) { +- for (outlen = 1; outlen <= BLAKE2_KAT_LENGTH; ++outlen) { +- uint8_t hash[BLAKE2_KAT_LENGTH]; +- blake2xb_state S; +- uint8_t * p = buf; +- size_t mlen = BLAKE2_KAT_LENGTH; +- int err = 0; +- +- if( (err = blake2xb_init_key(&S, outlen, key, BLAKE2B_KEYBYTES)) < 0 ) { +- goto fail; +- } +- +- while (mlen >= step) { +- if ( (err = blake2xb_update(&S, p, step)) < 0 ) { +- goto fail; +- } +- mlen -= step; +- p += step; +- } +- if ( (err = blake2xb_update(&S, p, mlen)) < 0) { +- goto fail; +- } +- if ( (err = blake2xb_final(&S, hash, outlen)) < 0) { +- goto fail; +- } +- +- if (0 != memcmp(hash, blake2xb_keyed_kat[outlen-1], outlen)) { +- goto fail; +- } +- } +- } +- +- puts( "ok" ); +- return 0; +-fail: +- puts("error"); +- return -1; +-} +-#endif +--- thirdparty/blake2/blake2xs.c.orig 2018-03-16 17:25:33 UTC ++++ thirdparty/blake2/blake2xs.c +@@ -1,239 +0,0 @@ +-/* +- BLAKE2 reference source code package - reference C implementations +- +- Copyright 2016, JP Aumasson <jeanphilippe.aumasson@gmail.com>. +- Copyright 2016, Samuel Neves <sneves@dei.uc.pt>. +- +- You may use this under the terms of the CC0, the OpenSSL Licence, or +- the Apache Public License 2.0, at your option. The terms of these +- licenses can be found at: +- +- - CC0 1.0 Universal : http://creativecommons.org/publicdomain/zero/1.0 +- - OpenSSL license : https://www.openssl.org/source/license.html +- - Apache 2.0 : http://www.apache.org/licenses/LICENSE-2.0 +- +- More information about the BLAKE2 hash function can be found at +- https://blake2.net. +-*/ +- +-#include <stdint.h> +-#include <string.h> +-#include <stdio.h> +- +-#include "blake2.h" +-#include "blake2-impl.h" +- +-int blake2xs_init( blake2xs_state *S, const size_t outlen ) { +- return blake2xs_init_key(S, outlen, NULL, 0); +-} +- +-int blake2xs_init_key( blake2xs_state *S, const size_t outlen, const void *key, size_t keylen ) +-{ +- if ( outlen == 0 || outlen > 0xFFFFUL ) { +- return -1; +- } +- +- if (NULL != key && keylen > BLAKE2B_KEYBYTES) { +- return -1; +- } +- +- if (NULL == key && keylen > 0) { +- return -1; +- } +- +- /* Initialize parameter block */ +- S->P->digest_length = BLAKE2S_OUTBYTES; +- S->P->key_length = keylen; +- S->P->fanout = 1; +- S->P->depth = 1; +- store32( &S->P->leaf_length, 0 ); +- store32( &S->P->node_offset, 0 ); +- store16( &S->P->xof_length, outlen ); +- S->P->node_depth = 0; +- S->P->inner_length = 0; +- memset( S->P->salt, 0, sizeof( S->P->salt ) ); +- memset( S->P->personal, 0, sizeof( S->P->personal ) ); +- +- if( blake2s_init_param( S->S, S->P ) < 0 ) { +- return -1; +- } +- +- if (keylen > 0) { +- uint8_t block[BLAKE2S_BLOCKBYTES]; +- memset(block, 0, BLAKE2S_BLOCKBYTES); +- memcpy(block, key, keylen); +- blake2s_update(S->S, block, BLAKE2S_BLOCKBYTES); +- secure_zero_memory(block, BLAKE2S_BLOCKBYTES); +- } +- return 0; +-} +- +-int blake2xs_update( blake2xs_state *S, const void *in, size_t inlen ) { +- return blake2s_update( S->S, in, inlen ); +-} +- +-int blake2xs_final(blake2xs_state *S, void *out, size_t outlen) { +- +- blake2s_state C[1]; +- blake2s_param P[1]; +- uint16_t xof_length = load16(&S->P->xof_length); +- uint8_t root[BLAKE2S_BLOCKBYTES]; +- size_t i; +- +- if (NULL == out) { +- return -1; +- } +- +- /* outlen must match the output size defined in xof_length, */ +- /* unless it was -1, in which case anything goes except 0. */ +- if(xof_length == 0xFFFFUL) { +- if(outlen == 0) { +- return -1; +- } +- } else { +- if(outlen != xof_length) { +- return -1; +- } +- } +- +- /* Finalize the root hash */ +- if (blake2s_final(S->S, root, BLAKE2S_OUTBYTES) < 0) { +- return -1; +- } +- +- /* Set common block structure values */ +- /* Copy values from parent instance, and only change the ones below */ +- memcpy(P, S->P, sizeof(blake2s_param)); +- P->key_length = 0; +- P->fanout = 0; +- P->depth = 0; +- store32(&P->leaf_length, BLAKE2S_OUTBYTES); +- P->inner_length = BLAKE2S_OUTBYTES; +- P->node_depth = 0; +- +- for (i = 0; outlen > 0; ++i) { +- const size_t block_size = (outlen < BLAKE2S_OUTBYTES) ? outlen : BLAKE2S_OUTBYTES; +- /* Initialize state */ +- P->digest_length = block_size; +- store32(&P->node_offset, i); +- blake2s_init_param(C, P); +- /* Process key if needed */ +- blake2s_update(C, root, BLAKE2S_OUTBYTES); +- if (blake2s_final(C, (uint8_t *)out + i * BLAKE2S_OUTBYTES, block_size) < 0) { +- return -1; +- } +- outlen -= block_size; +- } +- secure_zero_memory(root, sizeof(root)); +- secure_zero_memory(P, sizeof(P)); +- secure_zero_memory(C, sizeof(C)); +- /* Put blake2xs in an invalid state? cf. blake2s_is_lastblock */ +- return 0; +-} +- +-int blake2xs(void *out, size_t outlen, const void *in, size_t inlen, const void *key, size_t keylen) +-{ +- blake2xs_state S[1]; +- +- /* Verify parameters */ +- if (NULL == in && inlen > 0) +- return -1; +- +- if (NULL == out) +- return -1; +- +- if (NULL == key && keylen > 0) +- return -1; +- +- if (keylen > BLAKE2S_KEYBYTES) +- return -1; +- +- if (outlen == 0) +- return -1; +- +- /* Initialize the root block structure */ +- if (blake2xs_init_key(S, outlen, key, keylen) < 0) { +- return -1; +- } +- +- /* Absorb the input message */ +- blake2xs_update(S, in, inlen); +- +- /* Compute the root node of the tree and the final hash using the counter construction */ +- return blake2xs_final(S, out, outlen); +-} +- +-#if defined(BLAKE2XS_SELFTEST) +-#include <string.h> +-#include "blake2-kat.h" +-int main( void ) +-{ +- uint8_t key[BLAKE2S_KEYBYTES]; +- uint8_t buf[BLAKE2_KAT_LENGTH]; +- size_t i, step, outlen; +- +- for( i = 0; i < BLAKE2S_KEYBYTES; ++i ) { +- key[i] = ( uint8_t )i; +- } +- +- for( i = 0; i < BLAKE2_KAT_LENGTH; ++i ) { +- buf[i] = ( uint8_t )i; +- } +- +- /* Testing length of ouputs rather than inputs */ +- /* (Test of input lengths mostly covered by blake2s tests) */ +- +- /* Test simple API */ +- for( outlen = 1; outlen <= BLAKE2_KAT_LENGTH; ++outlen ) +- { +- uint8_t hash[BLAKE2_KAT_LENGTH] = {0}; +- if( blake2xs( hash, outlen, buf, BLAKE2_KAT_LENGTH, key, BLAKE2S_KEYBYTES ) < 0 ) { +- goto fail; +- } +- +- if( 0 != memcmp( hash, blake2xs_keyed_kat[outlen-1], outlen ) ) +- { +- goto fail; +- } +- } +- +- /* Test streaming API */ +- for(step = 1; step < BLAKE2S_BLOCKBYTES; ++step) { +- for (outlen = 1; outlen <= BLAKE2_KAT_LENGTH; ++outlen) { +- uint8_t hash[BLAKE2_KAT_LENGTH]; +- blake2xs_state S; +- uint8_t * p = buf; +- size_t mlen = BLAKE2_KAT_LENGTH; +- int err = 0; +- +- if( (err = blake2xs_init_key(&S, outlen, key, BLAKE2S_KEYBYTES)) < 0 ) { +- goto fail; +- } +- +- while (mlen >= step) { +- if ( (err = blake2xs_update(&S, p, step)) < 0 ) { +- goto fail; +- } +- mlen -= step; +- p += step; +- } +- if ( (err = blake2xs_update(&S, p, mlen)) < 0) { +- goto fail; +- } +- if ( (err = blake2xs_final(&S, hash, outlen)) < 0) { +- goto fail; +- } +- +- if (0 != memcmp(hash, blake2xs_keyed_kat[outlen-1], outlen)) { +- goto fail; +- } +- } +- } +- +- puts( "ok" ); +- return 0; +-fail: +- puts("error"); +- return -1; +-} +-#endif +--- thirdparty/blake2/genkat-c.c.orig 2018-03-16 17:25:33 UTC ++++ thirdparty/blake2/genkat-c.c +@@ -1,139 +0,0 @@ +-/* +- BLAKE2 reference source code package - reference C implementations +- +- Copyright 2012, Samuel Neves <sneves@dei.uc.pt>. You may use this under the +- terms of the CC0, the OpenSSL Licence, or the Apache Public License 2.0, at +- your option. The terms of these licenses can be found at: +- +- - CC0 1.0 Universal : http://creativecommons.org/publicdomain/zero/1.0 +- - OpenSSL license : https://www.openssl.org/source/license.html +- - Apache 2.0 : http://www.apache.org/licenses/LICENSE-2.0 +- +- More information about the BLAKE2 hash function can be found at +- https://blake2.net. +-*/ +- +-#include <stdint.h> +-#include <stdio.h> +-#include <stdlib.h> +-#include <string.h> +- +-#include "blake2.h" +- +-#define STR_(x) #x +-#define STR(x) STR_(x) +- +-#define LENGTH 256 +- +-#define MAKE_KAT(name, size_prefix) \ +- do { \ +- printf("static const uint8_t " #name "_kat[BLAKE2_KAT_LENGTH][" #size_prefix \ +- "_OUTBYTES] = \n{\n"); \ +- \ +- for (i = 0; i < LENGTH; ++i) { \ +- name(hash, size_prefix##_OUTBYTES, in, i, NULL, 0); \ +- printf("\t{\n\t\t"); \ +- \ +- for (j = 0; j < size_prefix##_OUTBYTES; ++j) \ +- printf("0x%02X%s", hash[j], \ +- (j + 1) == size_prefix##_OUTBYTES ? "\n" : j && !((j + 1) % 8) ? ",\n\t\t" : ", "); \ +- \ +- printf("\t},\n"); \ +- } \ +- \ +- printf("};\n\n\n\n\n"); \ +- } while (0) +- +-#define MAKE_KEYED_KAT(name, size_prefix) \ +- do { \ +- printf("static const uint8_t " #name "_keyed_kat[BLAKE2_KAT_LENGTH][" #size_prefix \ +- "_OUTBYTES] = \n{\n"); \ +- \ +- for (i = 0; i < LENGTH; ++i) { \ +- name(hash, size_prefix##_OUTBYTES, in, i, key, size_prefix##_KEYBYTES); \ +- printf("\t{\n\t\t"); \ +- \ +- for (j = 0; j < size_prefix##_OUTBYTES; ++j) \ +- printf("0x%02X%s", hash[j], \ +- (j + 1) == size_prefix##_OUTBYTES ? "\n" : j && !((j + 1) % 8) ? ",\n\t\t" : ", "); \ +- \ +- printf("\t},\n"); \ +- } \ +- \ +- printf("};\n\n\n\n\n"); \ +- } while (0) +- +-#define MAKE_XOF_KAT(name) \ +- do { \ +- printf("static const uint8_t " #name "_kat[BLAKE2_KAT_LENGTH][BLAKE2_KAT_LENGTH] = \n{\n"); \ +- \ +- for (i = 1; i <= LENGTH; ++i) { \ +- name(hash, i, in, LENGTH, NULL, 0); \ +- printf("\t{\n\t\t"); \ +- \ +- for (j = 0; j < i; ++j) \ +- printf("0x%02X%s", hash[j], \ +- (j + 1) == LENGTH ? "\n" : j && !((j + 1) % 8) ? ",\n\t\t" : ", "); \ +- \ +- for (j = i; j < LENGTH; ++j) \ +- printf("0x00%s", (j + 1) == LENGTH ? "\n" : j && !((j + 1) % 8) ? ",\n\t\t" : ", "); \ +- \ +- printf("\t},\n"); \ +- } \ +- \ +- printf("};\n\n\n\n\n"); \ +- } while (0) +- +-#define MAKE_XOF_KEYED_KAT(name, size_prefix) \ +- do { \ +- printf("static const uint8_t " #name \ +- "_keyed_kat[BLAKE2_KAT_LENGTH][BLAKE2_KAT_LENGTH] = \n{\n"); \ +- \ +- for (i = 1; i <= LENGTH; ++i) { \ +- name(hash, i, in, LENGTH, key, size_prefix##_KEYBYTES); \ +- printf("\t{\n\t\t"); \ +- \ +- for (j = 0; j < i; ++j) \ +- printf("0x%02X%s", hash[j], \ +- (j + 1) == LENGTH ? "\n" : j && !((j + 1) % 8) ? ",\n\t\t" : ", "); \ +- \ +- for (j = i; j < LENGTH; ++j) \ +- printf("0x00%s", (j + 1) == LENGTH ? "\n" : j && !((j + 1) % 8) ? ",\n\t\t" : ", "); \ +- \ +- printf("\t},\n"); \ +- } \ +- \ +- printf("};\n\n\n\n\n"); \ +- } while (0) +- +-int main() { +- uint8_t key[64] = {0}; +- uint8_t in[LENGTH] = {0}; +- uint8_t hash[LENGTH] = {0}; +- size_t i, j; +- +- for (i = 0; i < sizeof(in); ++i) +- in[i] = i; +- +- for (i = 0; i < sizeof(key); ++i) +- key[i] = i; +- +- puts("#ifndef BLAKE2_KAT_H\n" +- "#define BLAKE2_KAT_H\n\n\n" +- "#include <stdint.h>\n\n" +- "#define BLAKE2_KAT_LENGTH " STR(LENGTH) "\n\n\n"); +- MAKE_KAT(blake2s, BLAKE2S); +- MAKE_KEYED_KAT(blake2s, BLAKE2S); +- MAKE_KAT(blake2b, BLAKE2B); +- MAKE_KEYED_KAT(blake2b, BLAKE2B); +- MAKE_KAT(blake2sp, BLAKE2S); +- MAKE_KEYED_KAT(blake2sp, BLAKE2S); +- MAKE_KAT(blake2bp, BLAKE2B); +- MAKE_KEYED_KAT(blake2bp, BLAKE2B); +- MAKE_XOF_KAT(blake2xs); +- MAKE_XOF_KEYED_KAT(blake2xs, BLAKE2S); +- MAKE_XOF_KAT(blake2xb); +- MAKE_XOF_KEYED_KAT(blake2xb, BLAKE2B); +- puts("#endif"); +- return 0; +-} +--- thirdparty/blake2/genkat-json.c.orig 2018-03-16 17:25:33 UTC ++++ thirdparty/blake2/genkat-json.c +@@ -1,154 +0,0 @@ +-/* +- BLAKE2 reference source code package - reference C implementations +- +- Copyright 2012, Samuel Neves <sneves@dei.uc.pt>. You may use this under the +- terms of the CC0, the OpenSSL Licence, or the Apache Public License 2.0, at +- your option. The terms of these licenses can be found at: +- +- - CC0 1.0 Universal : http://creativecommons.org/publicdomain/zero/1.0 +- - OpenSSL license : https://www.openssl.org/source/license.html +- - Apache 2.0 : http://www.apache.org/licenses/LICENSE-2.0 +- +- More information about the BLAKE2 hash function can be found at +- https://blake2.net. +-*/ +- +-#include <stdint.h> +-#include <stdio.h> +-#include <stdlib.h> +-#include <string.h> +- +-#include "blake2.h" +- +-#define STR_(x) #x +-#define STR(x) STR_(x) +- +-#define LENGTH 256 +- +-#define MAKE_KAT(name, size_prefix, first) \ +- do { \ +- for (i = 0; i < LENGTH; ++i) { \ +- printf("%s\n{\n", i == 0 && first ? "" : ","); \ +- \ +- printf(" \"hash\": \"" #name "\",\n"); \ +- printf(" \"in\": \""); \ +- for (j = 0; j < i; ++j) \ +- printf("%02x", in[j]); \ +- \ +- printf("\",\n"); \ +- printf(" \"key\": \"\",\n"); \ +- printf(" \"out\": \""); \ +- \ +- name(hash, size_prefix##_OUTBYTES, in, i, NULL, 0); \ +- \ +- for (j = 0; j < size_prefix##_OUTBYTES; ++j) \ +- printf("%02x", hash[j]); \ +- printf("\"\n"); \ +- printf("}"); \ +- } \ +- } while (0) +- +-#define MAKE_KEYED_KAT(name, size_prefix, first) \ +- do { \ +- for (i = 0; i < LENGTH; ++i) { \ +- printf("%s\n{\n", i == 0 && first ? "" : ","); \ +- \ +- printf(" \"hash\": \"" #name "\",\n"); \ +- printf(" \"in\": \""); \ +- for (j = 0; j < i; ++j) \ +- printf("%02x", in[j]); \ +- \ +- printf("\",\n"); \ +- printf(" \"key\": \""); \ +- for (j = 0; j < size_prefix##_KEYBYTES; ++j) \ +- printf("%02x", key[j]); \ +- printf("\",\n"); \ +- printf(" \"out\": \""); \ +- \ +- name(hash, size_prefix##_OUTBYTES, in, i, key, size_prefix##_KEYBYTES); \ +- \ +- for (j = 0; j < size_prefix##_OUTBYTES; ++j) \ +- printf("%02x", hash[j]); \ +- printf("\"\n"); \ +- printf("}"); \ +- } \ +- } while (0) +- +-#define MAKE_XOF_KAT(name, first) \ +- do { \ +- for (i = 1; i <= LENGTH; ++i) { \ +- printf("%s\n{\n", i == 1 && first ? "" : ","); \ +- \ +- printf(" \"hash\": \"" #name "\",\n"); \ +- printf(" \"in\": \""); \ +- for (j = 0; j < LENGTH; ++j) \ +- printf("%02x", in[j]); \ +- \ +- printf("\",\n"); \ +- printf(" \"key\": \"\",\n"); \ +- printf(" \"out\": \""); \ +- \ +- name(hash, i, in, LENGTH, NULL, 0); \ +- \ +- for (j = 0; j < i; ++j) \ +- printf("%02x", hash[j]); \ +- printf("\"\n"); \ +- printf("}"); \ +- } \ +- } while (0) +- +-#define MAKE_XOF_KEYED_KAT(name, size_prefix, first) \ +- do { \ +- for (i = 1; i <= LENGTH; ++i) { \ +- printf("%s\n{\n", i == 1 && first ? "" : ","); \ +- \ +- printf(" \"hash\": \"" #name "\",\n"); \ +- printf(" \"in\": \""); \ +- for (j = 0; j < LENGTH; ++j) \ +- printf("%02x", in[j]); \ +- \ +- printf("\",\n"); \ +- printf(" \"key\": \""); \ +- for (j = 0; j < size_prefix##_KEYBYTES; ++j) \ +- printf("%02x", key[j]); \ +- printf("\",\n"); \ +- printf(" \"out\": \""); \ +- \ +- name(hash, i, in, LENGTH, key, size_prefix##_KEYBYTES); \ +- \ +- for (j = 0; j < i; ++j) \ +- printf("%02x", hash[j]); \ +- printf("\"\n"); \ +- printf("}"); \ +- } \ +- } while (0) +- +-int main() { +- uint8_t key[64] = {0}; +- uint8_t in[LENGTH] = {0}; +- uint8_t hash[LENGTH] = {0}; +- size_t i, j; +- +- for (i = 0; i < sizeof(in); ++i) +- in[i] = i; +- +- for (i = 0; i < sizeof(key); ++i) +- key[i] = i; +- +- printf("["); +- MAKE_KAT(blake2s, BLAKE2S, 1); +- MAKE_KEYED_KAT(blake2s, BLAKE2S, 0); +- MAKE_KAT(blake2b, BLAKE2B, 0); +- MAKE_KEYED_KAT(blake2b, BLAKE2B, 0); +- MAKE_KAT(blake2sp, BLAKE2S, 0); +- MAKE_KEYED_KAT(blake2sp, BLAKE2S, 0); +- MAKE_KAT(blake2bp, BLAKE2B, 0); +- MAKE_KEYED_KAT(blake2bp, BLAKE2B, 0); +- MAKE_XOF_KAT(blake2xs, 0); +- MAKE_XOF_KEYED_KAT(blake2xs, BLAKE2S, 0); +- MAKE_XOF_KAT(blake2xb, 0); +- MAKE_XOF_KEYED_KAT(blake2xb, BLAKE2B, 0); +- printf("\n]\n"); +- fflush(stdout); +- return 0; +-} +--- thirdparty/blake2/ref/blake2-impl.h.orig 2025-09-03 12:27:32 UTC ++++ thirdparty/blake2/ref/blake2-impl.h +@@ -0,0 +1,160 @@ ++/* ++ BLAKE2 reference source code package - reference C implementations ++ ++ Copyright 2012, Samuel Neves <sneves@dei.uc.pt>. You may use this under the ++ terms of the CC0, the OpenSSL Licence, or the Apache Public License 2.0, at ++ your option. The terms of these licenses can be found at: ++ ++ - CC0 1.0 Universal : http://creativecommons.org/publicdomain/zero/1.0 ++ - OpenSSL license : https://www.openssl.org/source/license.html ++ - Apache 2.0 : http://www.apache.org/licenses/LICENSE-2.0 ++ ++ More information about the BLAKE2 hash function can be found at ++ https://blake2.net. ++*/ ++#ifndef BLAKE2_IMPL_H ++#define BLAKE2_IMPL_H ++ ++#include <stdint.h> ++#include <string.h> ++ ++#if !defined(__cplusplus) && (!defined(__STDC_VERSION__) || __STDC_VERSION__ < 199901L) ++ #if defined(_MSC_VER) ++ #define BLAKE2_INLINE __inline ++ #elif defined(__GNUC__) ++ #define BLAKE2_INLINE __inline__ ++ #else ++ #define BLAKE2_INLINE ++ #endif ++#else ++ #define BLAKE2_INLINE inline ++#endif ++ ++static BLAKE2_INLINE uint32_t load32( const void *src ) ++{ ++#if defined(NATIVE_LITTLE_ENDIAN) ++ uint32_t w; ++ memcpy(&w, src, sizeof w); ++ return w; ++#else ++ const uint8_t *p = ( const uint8_t * )src; ++ return (( uint32_t )( p[0] ) << 0) | ++ (( uint32_t )( p[1] ) << 8) | ++ (( uint32_t )( p[2] ) << 16) | ++ (( uint32_t )( p[3] ) << 24) ; ++#endif ++} ++ ++static BLAKE2_INLINE uint64_t load64( const void *src ) ++{ ++#if defined(NATIVE_LITTLE_ENDIAN) ++ uint64_t w; ++ memcpy(&w, src, sizeof w); ++ return w; ++#else ++ const uint8_t *p = ( const uint8_t * )src; ++ return (( uint64_t )( p[0] ) << 0) | ++ (( uint64_t )( p[1] ) << 8) | ++ (( uint64_t )( p[2] ) << 16) | ++ (( uint64_t )( p[3] ) << 24) | ++ (( uint64_t )( p[4] ) << 32) | ++ (( uint64_t )( p[5] ) << 40) | ++ (( uint64_t )( p[6] ) << 48) | ++ (( uint64_t )( p[7] ) << 56) ; ++#endif ++} ++ ++static BLAKE2_INLINE uint16_t load16( const void *src ) ++{ ++#if defined(NATIVE_LITTLE_ENDIAN) ++ uint16_t w; ++ memcpy(&w, src, sizeof w); ++ return w; ++#else ++ const uint8_t *p = ( const uint8_t * )src; ++ return (( uint16_t )( p[0] ) << 0) | ++ (( uint16_t )( p[1] ) << 8) ; ++#endif ++} ++ ++static BLAKE2_INLINE void store16( void *dst, uint16_t w ) ++{ ++#if defined(NATIVE_LITTLE_ENDIAN) ++ memcpy(dst, &w, sizeof w); ++#else ++ uint8_t *p = ( uint8_t * )dst; ++ *p++ = ( uint8_t )w; w >>= 8; ++ *p++ = ( uint8_t )w; ++#endif ++} ++ ++static BLAKE2_INLINE void store32( void *dst, uint32_t w ) ++{ ++#if defined(NATIVE_LITTLE_ENDIAN) ++ memcpy(dst, &w, sizeof w); ++#else ++ uint8_t *p = ( uint8_t * )dst; ++ p[0] = (uint8_t)(w >> 0); ++ p[1] = (uint8_t)(w >> 8); ++ p[2] = (uint8_t)(w >> 16); ++ p[3] = (uint8_t)(w >> 24); ++#endif ++} ++ ++static BLAKE2_INLINE void store64( void *dst, uint64_t w ) ++{ ++#if defined(NATIVE_LITTLE_ENDIAN) ++ memcpy(dst, &w, sizeof w); ++#else ++ uint8_t *p = ( uint8_t * )dst; ++ p[0] = (uint8_t)(w >> 0); ++ p[1] = (uint8_t)(w >> 8); ++ p[2] = (uint8_t)(w >> 16); ++ p[3] = (uint8_t)(w >> 24); ++ p[4] = (uint8_t)(w >> 32); ++ p[5] = (uint8_t)(w >> 40); ++ p[6] = (uint8_t)(w >> 48); ++ p[7] = (uint8_t)(w >> 56); ++#endif ++} ++ ++static BLAKE2_INLINE uint64_t load48( const void *src ) ++{ ++ const uint8_t *p = ( const uint8_t * )src; ++ return (( uint64_t )( p[0] ) << 0) | ++ (( uint64_t )( p[1] ) << 8) | ++ (( uint64_t )( p[2] ) << 16) | ++ (( uint64_t )( p[3] ) << 24) | ++ (( uint64_t )( p[4] ) << 32) | ++ (( uint64_t )( p[5] ) << 40) ; ++} ++ ++static BLAKE2_INLINE void store48( void *dst, uint64_t w ) ++{ ++ uint8_t *p = ( uint8_t * )dst; ++ p[0] = (uint8_t)(w >> 0); ++ p[1] = (uint8_t)(w >> 8); ++ p[2] = (uint8_t)(w >> 16); ++ p[3] = (uint8_t)(w >> 24); ++ p[4] = (uint8_t)(w >> 32); ++ p[5] = (uint8_t)(w >> 40); ++} ++ ++static BLAKE2_INLINE uint32_t rotr32( const uint32_t w, const unsigned c ) ++{ ++ return ( w >> c ) | ( w << ( 32 - c ) ); ++} ++ ++static BLAKE2_INLINE uint64_t rotr64( const uint64_t w, const unsigned c ) ++{ ++ return ( w >> c ) | ( w << ( 64 - c ) ); ++} ++ ++/* prevents compiler optimizing out memset() */ ++static BLAKE2_INLINE void secure_zero_memory(void *v, size_t n) ++{ ++ static void *(*const volatile memset_v)(void *, int, size_t) = &memset; ++ memset_v(v, 0, n); ++} ++ ++#endif +--- thirdparty/blake2/ref/blake2.h.orig 2025-09-03 12:27:32 UTC ++++ thirdparty/blake2/ref/blake2.h +@@ -0,0 +1,195 @@ ++/* ++ BLAKE2 reference source code package - reference C implementations ++ ++ Copyright 2012, Samuel Neves <sneves@dei.uc.pt>. You may use this under the ++ terms of the CC0, the OpenSSL Licence, or the Apache Public License 2.0, at ++ your option. The terms of these licenses can be found at: ++ ++ - CC0 1.0 Universal : http://creativecommons.org/publicdomain/zero/1.0 ++ - OpenSSL license : https://www.openssl.org/source/license.html ++ - Apache 2.0 : http://www.apache.org/licenses/LICENSE-2.0 ++ ++ More information about the BLAKE2 hash function can be found at ++ https://blake2.net. ++*/ ++#ifndef BLAKE2_H ++#define BLAKE2_H ++ ++#include <stddef.h> ++#include <stdint.h> ++ ++#if defined(_MSC_VER) ++#define BLAKE2_PACKED(x) __pragma(pack(push, 1)) x __pragma(pack(pop)) ++#else ++#define BLAKE2_PACKED(x) x __attribute__((packed)) ++#endif ++ ++#if defined(__cplusplus) ++extern "C" { ++#endif ++ ++ enum blake2s_constant ++ { ++ BLAKE2S_BLOCKBYTES = 64, ++ BLAKE2S_OUTBYTES = 32, ++ BLAKE2S_KEYBYTES = 32, ++ BLAKE2S_SALTBYTES = 8, ++ BLAKE2S_PERSONALBYTES = 8 ++ }; ++ ++ enum blake2b_constant ++ { ++ BLAKE2B_BLOCKBYTES = 128, ++ BLAKE2B_OUTBYTES = 64, ++ BLAKE2B_KEYBYTES = 64, ++ BLAKE2B_SALTBYTES = 16, ++ BLAKE2B_PERSONALBYTES = 16 ++ }; ++ ++ typedef struct blake2s_state__ ++ { ++ uint32_t h[8]; ++ uint32_t t[2]; ++ uint32_t f[2]; ++ uint8_t buf[BLAKE2S_BLOCKBYTES]; ++ size_t buflen; ++ size_t outlen; ++ uint8_t last_node; ++ } blake2s_state; ++ ++ typedef struct blake2b_state__ ++ { ++ uint64_t h[8]; ++ uint64_t t[2]; ++ uint64_t f[2]; ++ uint8_t buf[BLAKE2B_BLOCKBYTES]; ++ size_t buflen; ++ size_t outlen; ++ uint8_t last_node; ++ } blake2b_state; ++ ++ typedef struct blake2sp_state__ ++ { ++ blake2s_state S[8][1]; ++ blake2s_state R[1]; ++ uint8_t buf[8 * BLAKE2S_BLOCKBYTES]; ++ size_t buflen; ++ size_t outlen; ++ } blake2sp_state; ++ ++ typedef struct blake2bp_state__ ++ { ++ blake2b_state S[4][1]; ++ blake2b_state R[1]; ++ uint8_t buf[4 * BLAKE2B_BLOCKBYTES]; ++ size_t buflen; ++ size_t outlen; ++ } blake2bp_state; ++ ++ ++ BLAKE2_PACKED(struct blake2s_param__ ++ { ++ uint8_t digest_length; /* 1 */ ++ uint8_t key_length; /* 2 */ ++ uint8_t fanout; /* 3 */ ++ uint8_t depth; /* 4 */ ++ uint32_t leaf_length; /* 8 */ ++ uint32_t node_offset; /* 12 */ ++ uint16_t xof_length; /* 14 */ ++ uint8_t node_depth; /* 15 */ ++ uint8_t inner_length; /* 16 */ ++ /* uint8_t reserved[0]; */ ++ uint8_t salt[BLAKE2S_SALTBYTES]; /* 24 */ ++ uint8_t personal[BLAKE2S_PERSONALBYTES]; /* 32 */ ++ }); ++ ++ typedef struct blake2s_param__ blake2s_param; ++ ++ BLAKE2_PACKED(struct blake2b_param__ ++ { ++ uint8_t digest_length; /* 1 */ ++ uint8_t key_length; /* 2 */ ++ uint8_t fanout; /* 3 */ ++ uint8_t depth; /* 4 */ ++ uint32_t leaf_length; /* 8 */ ++ uint32_t node_offset; /* 12 */ ++ uint32_t xof_length; /* 16 */ ++ uint8_t node_depth; /* 17 */ ++ uint8_t inner_length; /* 18 */ ++ uint8_t reserved[14]; /* 32 */ ++ uint8_t salt[BLAKE2B_SALTBYTES]; /* 48 */ ++ uint8_t personal[BLAKE2B_PERSONALBYTES]; /* 64 */ ++ }); ++ ++ typedef struct blake2b_param__ blake2b_param; ++ ++ typedef struct blake2xs_state__ ++ { ++ blake2s_state S[1]; ++ blake2s_param P[1]; ++ } blake2xs_state; ++ ++ typedef struct blake2xb_state__ ++ { ++ blake2b_state S[1]; ++ blake2b_param P[1]; ++ } blake2xb_state; ++ ++ /* Padded structs result in a compile-time error */ ++ enum { ++ BLAKE2_DUMMY_1 = 1/(sizeof(blake2s_param) == BLAKE2S_OUTBYTES), ++ BLAKE2_DUMMY_2 = 1/(sizeof(blake2b_param) == BLAKE2B_OUTBYTES) ++ }; ++ ++ /* Streaming API */ ++ int blake2s_init( blake2s_state *S, size_t outlen ); ++ int blake2s_init_key( blake2s_state *S, size_t outlen, const void *key, size_t keylen ); ++ int blake2s_init_param( blake2s_state *S, const blake2s_param *P ); ++ int blake2s_update( blake2s_state *S, const void *in, size_t inlen ); ++ int blake2s_final( blake2s_state *S, void *out, size_t outlen ); ++ ++ int blake2b_init( blake2b_state *S, size_t outlen ); ++ int blake2b_init_key( blake2b_state *S, size_t outlen, const void *key, size_t keylen ); ++ int blake2b_init_param( blake2b_state *S, const blake2b_param *P ); ++ int blake2b_update( blake2b_state *S, const void *in, size_t inlen ); ++ int blake2b_final( blake2b_state *S, void *out, size_t outlen ); ++ ++ int blake2sp_init( blake2sp_state *S, size_t outlen ); ++ int blake2sp_init_key( blake2sp_state *S, size_t outlen, const void *key, size_t keylen ); ++ int blake2sp_update( blake2sp_state *S, const void *in, size_t inlen ); ++ int blake2sp_final( blake2sp_state *S, void *out, size_t outlen ); ++ ++ int blake2bp_init( blake2bp_state *S, size_t outlen ); ++ int blake2bp_init_key( blake2bp_state *S, size_t outlen, const void *key, size_t keylen ); ++ int blake2bp_update( blake2bp_state *S, const void *in, size_t inlen ); ++ int blake2bp_final( blake2bp_state *S, void *out, size_t outlen ); ++ ++ /* Variable output length API */ ++ int blake2xs_init( blake2xs_state *S, const size_t outlen ); ++ int blake2xs_init_key( blake2xs_state *S, const size_t outlen, const void *key, size_t keylen ); ++ int blake2xs_update( blake2xs_state *S, const void *in, size_t inlen ); ++ int blake2xs_final(blake2xs_state *S, void *out, size_t outlen); ++ ++ int blake2xb_init( blake2xb_state *S, const size_t outlen ); ++ int blake2xb_init_key( blake2xb_state *S, const size_t outlen, const void *key, size_t keylen ); ++ int blake2xb_update( blake2xb_state *S, const void *in, size_t inlen ); ++ int blake2xb_final(blake2xb_state *S, void *out, size_t outlen); ++ ++ /* Simple API */ ++ int blake2s( void *out, size_t outlen, const void *in, size_t inlen, const void *key, size_t keylen ); ++ int blake2b( void *out, size_t outlen, const void *in, size_t inlen, const void *key, size_t keylen ); ++ ++ int blake2sp( void *out, size_t outlen, const void *in, size_t inlen, const void *key, size_t keylen ); ++ int blake2bp( void *out, size_t outlen, const void *in, size_t inlen, const void *key, size_t keylen ); ++ ++ int blake2xs( void *out, size_t outlen, const void *in, size_t inlen, const void *key, size_t keylen ); ++ int blake2xb( void *out, size_t outlen, const void *in, size_t inlen, const void *key, size_t keylen ); ++ ++ /* This is simply an alias for blake2b */ ++ int blake2( void *out, size_t outlen, const void *in, size_t inlen, const void *key, size_t keylen ); ++ ++#if defined(__cplusplus) ++} ++#endif ++ ++#endif +--- thirdparty/blake2/ref/blake2b-ref.c.orig 2025-09-03 12:27:32 UTC ++++ thirdparty/blake2/ref/blake2b-ref.c +@@ -0,0 +1,379 @@ ++/* ++ BLAKE2 reference source code package - reference C implementations ++ ++ Copyright 2012, Samuel Neves <sneves@dei.uc.pt>. You may use this under the ++ terms of the CC0, the OpenSSL Licence, or the Apache Public License 2.0, at ++ your option. The terms of these licenses can be found at: ++ ++ - CC0 1.0 Universal : http://creativecommons.org/publicdomain/zero/1.0 ++ - OpenSSL license : https://www.openssl.org/source/license.html ++ - Apache 2.0 : http://www.apache.org/licenses/LICENSE-2.0 ++ ++ More information about the BLAKE2 hash function can be found at ++ https://blake2.net. ++*/ ++ ++#include <stdint.h> ++#include <string.h> ++#include <stdio.h> ++ ++#include "blake2.h" ++#include "blake2-impl.h" ++ ++static const uint64_t blake2b_IV[8] = ++{ ++ 0x6a09e667f3bcc908ULL, 0xbb67ae8584caa73bULL, ++ 0x3c6ef372fe94f82bULL, 0xa54ff53a5f1d36f1ULL, ++ 0x510e527fade682d1ULL, 0x9b05688c2b3e6c1fULL, ++ 0x1f83d9abfb41bd6bULL, 0x5be0cd19137e2179ULL ++}; ++ ++static const uint8_t blake2b_sigma[12][16] = ++{ ++ { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 } , ++ { 14, 10, 4, 8, 9, 15, 13, 6, 1, 12, 0, 2, 11, 7, 5, 3 } , ++ { 11, 8, 12, 0, 5, 2, 15, 13, 10, 14, 3, 6, 7, 1, 9, 4 } , ++ { 7, 9, 3, 1, 13, 12, 11, 14, 2, 6, 5, 10, 4, 0, 15, 8 } , ++ { 9, 0, 5, 7, 2, 4, 10, 15, 14, 1, 11, 12, 6, 8, 3, 13 } , ++ { 2, 12, 6, 10, 0, 11, 8, 3, 4, 13, 7, 5, 15, 14, 1, 9 } , ++ { 12, 5, 1, 15, 14, 13, 4, 10, 0, 7, 6, 3, 9, 2, 8, 11 } , ++ { 13, 11, 7, 14, 12, 1, 3, 9, 5, 0, 15, 4, 8, 6, 2, 10 } , ++ { 6, 15, 14, 9, 11, 3, 0, 8, 12, 2, 13, 7, 1, 4, 10, 5 } , ++ { 10, 2, 8, 4, 7, 6, 1, 5, 15, 11, 9, 14, 3, 12, 13 , 0 } , ++ { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 } , ++ { 14, 10, 4, 8, 9, 15, 13, 6, 1, 12, 0, 2, 11, 7, 5, 3 } ++}; ++ ++ ++static void blake2b_set_lastnode( blake2b_state *S ) ++{ ++ S->f[1] = (uint64_t)-1; ++} ++ ++/* Some helper functions, not necessarily useful */ ++static int blake2b_is_lastblock( const blake2b_state *S ) ++{ ++ return S->f[0] != 0; ++} ++ ++static void blake2b_set_lastblock( blake2b_state *S ) ++{ ++ if( S->last_node ) blake2b_set_lastnode( S ); ++ ++ S->f[0] = (uint64_t)-1; ++} ++ ++static void blake2b_increment_counter( blake2b_state *S, const uint64_t inc ) ++{ ++ S->t[0] += inc; ++ S->t[1] += ( S->t[0] < inc ); ++} ++ ++static void blake2b_init0( blake2b_state *S ) ++{ ++ size_t i; ++ memset( S, 0, sizeof( blake2b_state ) ); ++ ++ for( i = 0; i < 8; ++i ) S->h[i] = blake2b_IV[i]; ++} ++ ++/* init xors IV with input parameter block */ ++int blake2b_init_param( blake2b_state *S, const blake2b_param *P ) ++{ ++ const uint8_t *p = ( const uint8_t * )( P ); ++ size_t i; ++ ++ blake2b_init0( S ); ++ ++ /* IV XOR ParamBlock */ ++ for( i = 0; i < 8; ++i ) ++ S->h[i] ^= load64( p + sizeof( S->h[i] ) * i ); ++ ++ S->outlen = P->digest_length; ++ return 0; ++} ++ ++ ++ ++int blake2b_init( blake2b_state *S, size_t outlen ) ++{ ++ blake2b_param P[1]; ++ ++ if ( ( !outlen ) || ( outlen > BLAKE2B_OUTBYTES ) ) return -1; ++ ++ P->digest_length = (uint8_t)outlen; ++ P->key_length = 0; ++ P->fanout = 1; ++ P->depth = 1; ++ store32( &P->leaf_length, 0 ); ++ store32( &P->node_offset, 0 ); ++ store32( &P->xof_length, 0 ); ++ P->node_depth = 0; ++ P->inner_length = 0; ++ memset( P->reserved, 0, sizeof( P->reserved ) ); ++ memset( P->salt, 0, sizeof( P->salt ) ); ++ memset( P->personal, 0, sizeof( P->personal ) ); ++ return blake2b_init_param( S, P ); ++} ++ ++ ++int blake2b_init_key( blake2b_state *S, size_t outlen, const void *key, size_t keylen ) ++{ ++ blake2b_param P[1]; ++ ++ if ( ( !outlen ) || ( outlen > BLAKE2B_OUTBYTES ) ) return -1; ++ ++ if ( !key || !keylen || keylen > BLAKE2B_KEYBYTES ) return -1; ++ ++ P->digest_length = (uint8_t)outlen; ++ P->key_length = (uint8_t)keylen; ++ P->fanout = 1; ++ P->depth = 1; ++ store32( &P->leaf_length, 0 ); ++ store32( &P->node_offset, 0 ); ++ store32( &P->xof_length, 0 ); ++ P->node_depth = 0; ++ P->inner_length = 0; ++ memset( P->reserved, 0, sizeof( P->reserved ) ); ++ memset( P->salt, 0, sizeof( P->salt ) ); ++ memset( P->personal, 0, sizeof( P->personal ) ); ++ ++ if( blake2b_init_param( S, P ) < 0 ) return -1; ++ ++ { ++ uint8_t block[BLAKE2B_BLOCKBYTES]; ++ memset( block, 0, BLAKE2B_BLOCKBYTES ); ++ memcpy( block, key, keylen ); ++ blake2b_update( S, block, BLAKE2B_BLOCKBYTES ); ++ secure_zero_memory( block, BLAKE2B_BLOCKBYTES ); /* Burn the key from stack */ ++ } ++ return 0; ++} ++ ++#define G(r,i,a,b,c,d) \ ++ do { \ ++ a = a + b + m[blake2b_sigma[r][2*i+0]]; \ ++ d = rotr64(d ^ a, 32); \ ++ c = c + d; \ ++ b = rotr64(b ^ c, 24); \ ++ a = a + b + m[blake2b_sigma[r][2*i+1]]; \ ++ d = rotr64(d ^ a, 16); \ ++ c = c + d; \ ++ b = rotr64(b ^ c, 63); \ ++ } while(0) ++ ++#define ROUND(r) \ ++ do { \ ++ G(r,0,v[ 0],v[ 4],v[ 8],v[12]); \ ++ G(r,1,v[ 1],v[ 5],v[ 9],v[13]); \ ++ G(r,2,v[ 2],v[ 6],v[10],v[14]); \ ++ G(r,3,v[ 3],v[ 7],v[11],v[15]); \ ++ G(r,4,v[ 0],v[ 5],v[10],v[15]); \ ++ G(r,5,v[ 1],v[ 6],v[11],v[12]); \ ++ G(r,6,v[ 2],v[ 7],v[ 8],v[13]); \ ++ G(r,7,v[ 3],v[ 4],v[ 9],v[14]); \ ++ } while(0) ++ ++static void blake2b_compress( blake2b_state *S, const uint8_t block[BLAKE2B_BLOCKBYTES] ) ++{ ++ uint64_t m[16]; ++ uint64_t v[16]; ++ size_t i; ++ ++ for( i = 0; i < 16; ++i ) { ++ m[i] = load64( block + i * sizeof( m[i] ) ); ++ } ++ ++ for( i = 0; i < 8; ++i ) { ++ v[i] = S->h[i]; ++ } ++ ++ v[ 8] = blake2b_IV[0]; ++ v[ 9] = blake2b_IV[1]; ++ v[10] = blake2b_IV[2]; ++ v[11] = blake2b_IV[3]; ++ v[12] = blake2b_IV[4] ^ S->t[0]; ++ v[13] = blake2b_IV[5] ^ S->t[1]; ++ v[14] = blake2b_IV[6] ^ S->f[0]; ++ v[15] = blake2b_IV[7] ^ S->f[1]; ++ ++ ROUND( 0 ); ++ ROUND( 1 ); ++ ROUND( 2 ); ++ ROUND( 3 ); ++ ROUND( 4 ); ++ ROUND( 5 ); ++ ROUND( 6 ); ++ ROUND( 7 ); ++ ROUND( 8 ); ++ ROUND( 9 ); ++ ROUND( 10 ); ++ ROUND( 11 ); ++ ++ for( i = 0; i < 8; ++i ) { ++ S->h[i] = S->h[i] ^ v[i] ^ v[i + 8]; ++ } ++} ++ ++#undef G ++#undef ROUND ++ ++int blake2b_update( blake2b_state *S, const void *pin, size_t inlen ) ++{ ++ const unsigned char * in = (const unsigned char *)pin; ++ if( inlen > 0 ) ++ { ++ size_t left = S->buflen; ++ size_t fill = BLAKE2B_BLOCKBYTES - left; ++ if( inlen > fill ) ++ { ++ S->buflen = 0; ++ memcpy( S->buf + left, in, fill ); /* Fill buffer */ ++ blake2b_increment_counter( S, BLAKE2B_BLOCKBYTES ); ++ blake2b_compress( S, S->buf ); /* Compress */ ++ in += fill; inlen -= fill; ++ while(inlen > BLAKE2B_BLOCKBYTES) { ++ blake2b_increment_counter(S, BLAKE2B_BLOCKBYTES); ++ blake2b_compress( S, in ); ++ in += BLAKE2B_BLOCKBYTES; ++ inlen -= BLAKE2B_BLOCKBYTES; ++ } ++ } ++ memcpy( S->buf + S->buflen, in, inlen ); ++ S->buflen += inlen; ++ } ++ return 0; ++} ++ ++int blake2b_final( blake2b_state *S, void *out, size_t outlen ) ++{ ++ uint8_t buffer[BLAKE2B_OUTBYTES] = {0}; ++ size_t i; ++ ++ if( out == NULL || outlen < S->outlen ) ++ return -1; ++ ++ if( blake2b_is_lastblock( S ) ) ++ return -1; ++ ++ blake2b_increment_counter( S, S->buflen ); ++ blake2b_set_lastblock( S ); ++ memset( S->buf + S->buflen, 0, BLAKE2B_BLOCKBYTES - S->buflen ); /* Padding */ ++ blake2b_compress( S, S->buf ); ++ ++ for( i = 0; i < 8; ++i ) /* Output full hash to temp buffer */ ++ store64( buffer + sizeof( S->h[i] ) * i, S->h[i] ); ++ ++ memcpy( out, buffer, S->outlen ); ++ secure_zero_memory(buffer, sizeof(buffer)); ++ return 0; ++} ++ ++/* inlen, at least, should be uint64_t. Others can be size_t. */ ++int blake2b( void *out, size_t outlen, const void *in, size_t inlen, const void *key, size_t keylen ) ++{ ++ blake2b_state S[1]; ++ ++ /* Verify parameters */ ++ if ( NULL == in && inlen > 0 ) return -1; ++ ++ if ( NULL == out ) return -1; ++ ++ if( NULL == key && keylen > 0 ) return -1; ++ ++ if( !outlen || outlen > BLAKE2B_OUTBYTES ) return -1; ++ ++ if( keylen > BLAKE2B_KEYBYTES ) return -1; ++ ++ if( keylen > 0 ) ++ { ++ if( blake2b_init_key( S, outlen, key, keylen ) < 0 ) return -1; ++ } ++ else ++ { ++ if( blake2b_init( S, outlen ) < 0 ) return -1; ++ } ++ ++ blake2b_update( S, ( const uint8_t * )in, inlen ); ++ blake2b_final( S, out, outlen ); ++ return 0; ++} ++ ++int blake2( void *out, size_t outlen, const void *in, size_t inlen, const void *key, size_t keylen ) { ++ return blake2b(out, outlen, in, inlen, key, keylen); ++} ++ ++#if defined(SUPERCOP) ++int crypto_hash( unsigned char *out, unsigned char *in, unsigned long long inlen ) ++{ ++ return blake2b( out, BLAKE2B_OUTBYTES, in, inlen, NULL, 0 ); ++} ++#endif ++ ++#if defined(BLAKE2B_SELFTEST) ++#include <string.h> ++#include "blake2-kat.h" ++int main( void ) ++{ ++ uint8_t key[BLAKE2B_KEYBYTES]; ++ uint8_t buf[BLAKE2_KAT_LENGTH]; ++ size_t i, step; ++ ++ for( i = 0; i < BLAKE2B_KEYBYTES; ++i ) ++ key[i] = ( uint8_t )i; ++ ++ for( i = 0; i < BLAKE2_KAT_LENGTH; ++i ) ++ buf[i] = ( uint8_t )i; ++ ++ /* Test simple API */ ++ for( i = 0; i < BLAKE2_KAT_LENGTH; ++i ) ++ { ++ uint8_t hash[BLAKE2B_OUTBYTES]; ++ blake2b( hash, BLAKE2B_OUTBYTES, buf, i, key, BLAKE2B_KEYBYTES ); ++ ++ if( 0 != memcmp( hash, blake2b_keyed_kat[i], BLAKE2B_OUTBYTES ) ) ++ { ++ goto fail; ++ } ++ } ++ ++ /* Test streaming API */ ++ for(step = 1; step < BLAKE2B_BLOCKBYTES; ++step) { ++ for (i = 0; i < BLAKE2_KAT_LENGTH; ++i) { ++ uint8_t hash[BLAKE2B_OUTBYTES]; ++ blake2b_state S; ++ uint8_t * p = buf; ++ size_t mlen = i; ++ int err = 0; ++ ++ if( (err = blake2b_init_key(&S, BLAKE2B_OUTBYTES, key, BLAKE2B_KEYBYTES)) < 0 ) { ++ goto fail; ++ } ++ ++ while (mlen >= step) { ++ if ( (err = blake2b_update(&S, p, step)) < 0 ) { ++ goto fail; ++ } ++ mlen -= step; ++ p += step; ++ } ++ if ( (err = blake2b_update(&S, p, mlen)) < 0) { ++ goto fail; ++ } ++ if ( (err = blake2b_final(&S, hash, BLAKE2B_OUTBYTES)) < 0) { ++ goto fail; ++ } ++ ++ if (0 != memcmp(hash, blake2b_keyed_kat[i], BLAKE2B_OUTBYTES)) { ++ goto fail; ++ } ++ } ++ } ++ ++ puts( "ok" ); ++ return 0; ++fail: ++ puts("error"); ++ return -1; ++} ++#endif +--- thirdparty/blake2/ref/blake2bp-ref.c.orig 2025-09-03 12:27:32 UTC ++++ thirdparty/blake2/ref/blake2bp-ref.c +@@ -0,0 +1,359 @@ ++/* ++ BLAKE2 reference source code package - reference C implementations ++ ++ Copyright 2012, Samuel Neves <sneves@dei.uc.pt>. You may use this under the ++ terms of the CC0, the OpenSSL Licence, or the Apache Public License 2.0, at ++ your option. The terms of these licenses can be found at: ++ ++ - CC0 1.0 Universal : http://creativecommons.org/publicdomain/zero/1.0 ++ - OpenSSL license : https://www.openssl.org/source/license.html ++ - Apache 2.0 : http://www.apache.org/licenses/LICENSE-2.0 ++ ++ More information about the BLAKE2 hash function can be found at ++ https://blake2.net. ++*/ ++ ++#include <stdio.h> ++#include <stdlib.h> ++#include <string.h> ++#include <stdint.h> ++ ++#if defined(_OPENMP) ++#include <omp.h> ++#endif ++ ++#include "blake2.h" ++#include "blake2-impl.h" ++ ++#define PARALLELISM_DEGREE 4 ++ ++/* ++ blake2b_init_param defaults to setting the expecting output length ++ from the digest_length parameter block field. ++ ++ In some cases, however, we do not want this, as the output length ++ of these instances is given by inner_length instead. ++*/ ++static int blake2bp_init_leaf_param( blake2b_state *S, const blake2b_param *P ) ++{ ++ int err = blake2b_init_param(S, P); ++ S->outlen = P->inner_length; ++ return err; ++} ++ ++static int blake2bp_init_leaf( blake2b_state *S, size_t outlen, size_t keylen, uint64_t offset ) ++{ ++ blake2b_param P[1]; ++ P->digest_length = (uint8_t)outlen; ++ P->key_length = (uint8_t)keylen; ++ P->fanout = PARALLELISM_DEGREE; ++ P->depth = 2; ++ store32( &P->leaf_length, 0 ); ++ store32( &P->node_offset, offset ); ++ store32( &P->xof_length, 0 ); ++ P->node_depth = 0; ++ P->inner_length = BLAKE2B_OUTBYTES; ++ memset( P->reserved, 0, sizeof( P->reserved ) ); ++ memset( P->salt, 0, sizeof( P->salt ) ); ++ memset( P->personal, 0, sizeof( P->personal ) ); ++ return blake2bp_init_leaf_param( S, P ); ++} ++ ++static int blake2bp_init_root( blake2b_state *S, size_t outlen, size_t keylen ) ++{ ++ blake2b_param P[1]; ++ P->digest_length = (uint8_t)outlen; ++ P->key_length = (uint8_t)keylen; ++ P->fanout = PARALLELISM_DEGREE; ++ P->depth = 2; ++ store32( &P->leaf_length, 0 ); ++ store32( &P->node_offset, 0 ); ++ store32( &P->xof_length, 0 ); ++ P->node_depth = 1; ++ P->inner_length = BLAKE2B_OUTBYTES; ++ memset( P->reserved, 0, sizeof( P->reserved ) ); ++ memset( P->salt, 0, sizeof( P->salt ) ); ++ memset( P->personal, 0, sizeof( P->personal ) ); ++ return blake2b_init_param( S, P ); ++} ++ ++ ++int blake2bp_init( blake2bp_state *S, size_t outlen ) ++{ ++ size_t i; ++ ++ if( !outlen || outlen > BLAKE2B_OUTBYTES ) return -1; ++ ++ memset( S->buf, 0, sizeof( S->buf ) ); ++ S->buflen = 0; ++ S->outlen = outlen; ++ ++ if( blake2bp_init_root( S->R, outlen, 0 ) < 0 ) ++ return -1; ++ ++ for( i = 0; i < PARALLELISM_DEGREE; ++i ) ++ if( blake2bp_init_leaf( S->S[i], outlen, 0, i ) < 0 ) return -1; ++ ++ S->R->last_node = 1; ++ S->S[PARALLELISM_DEGREE - 1]->last_node = 1; ++ return 0; ++} ++ ++int blake2bp_init_key( blake2bp_state *S, size_t outlen, const void *key, size_t keylen ) ++{ ++ size_t i; ++ ++ if( !outlen || outlen > BLAKE2B_OUTBYTES ) return -1; ++ ++ if( !key || !keylen || keylen > BLAKE2B_KEYBYTES ) return -1; ++ ++ memset( S->buf, 0, sizeof( S->buf ) ); ++ S->buflen = 0; ++ S->outlen = outlen; ++ ++ if( blake2bp_init_root( S->R, outlen, keylen ) < 0 ) ++ return -1; ++ ++ for( i = 0; i < PARALLELISM_DEGREE; ++i ) ++ if( blake2bp_init_leaf( S->S[i], outlen, keylen, i ) < 0 ) return -1; ++ ++ S->R->last_node = 1; ++ S->S[PARALLELISM_DEGREE - 1]->last_node = 1; ++ { ++ uint8_t block[BLAKE2B_BLOCKBYTES]; ++ memset( block, 0, BLAKE2B_BLOCKBYTES ); ++ memcpy( block, key, keylen ); ++ ++ for( i = 0; i < PARALLELISM_DEGREE; ++i ) ++ blake2b_update( S->S[i], block, BLAKE2B_BLOCKBYTES ); ++ ++ secure_zero_memory( block, BLAKE2B_BLOCKBYTES ); /* Burn the key from stack */ ++ } ++ return 0; ++} ++ ++ ++int blake2bp_update( blake2bp_state *S, const void *pin, size_t inlen ) ++{ ++ const unsigned char * in = (const unsigned char *)pin; ++ size_t left = S->buflen; ++ size_t fill = sizeof( S->buf ) - left; ++ size_t i; ++ ++ if( left && inlen >= fill ) ++ { ++ memcpy( S->buf + left, in, fill ); ++ ++ for( i = 0; i < PARALLELISM_DEGREE; ++i ) ++ blake2b_update( S->S[i], S->buf + i * BLAKE2B_BLOCKBYTES, BLAKE2B_BLOCKBYTES ); ++ ++ in += fill; ++ inlen -= fill; ++ left = 0; ++ } ++ ++#if defined(_OPENMP) ++ #pragma omp parallel shared(S), num_threads(PARALLELISM_DEGREE) ++#else ++ ++ for( i = 0; i < PARALLELISM_DEGREE; ++i ) ++#endif ++ { ++#if defined(_OPENMP) ++ size_t i = omp_get_thread_num(); ++#endif ++ size_t inlen__ = inlen; ++ const unsigned char *in__ = ( const unsigned char * )in; ++ in__ += i * BLAKE2B_BLOCKBYTES; ++ ++ while( inlen__ >= PARALLELISM_DEGREE * BLAKE2B_BLOCKBYTES ) ++ { ++ blake2b_update( S->S[i], in__, BLAKE2B_BLOCKBYTES ); ++ in__ += PARALLELISM_DEGREE * BLAKE2B_BLOCKBYTES; ++ inlen__ -= PARALLELISM_DEGREE * BLAKE2B_BLOCKBYTES; ++ } ++ } ++ ++ in += inlen - inlen % ( PARALLELISM_DEGREE * BLAKE2B_BLOCKBYTES ); ++ inlen %= PARALLELISM_DEGREE * BLAKE2B_BLOCKBYTES; ++ ++ if( inlen > 0 ) ++ memcpy( S->buf + left, in, inlen ); ++ ++ S->buflen = left + inlen; ++ return 0; ++} ++ ++int blake2bp_final( blake2bp_state *S, void *out, size_t outlen ) ++{ ++ uint8_t hash[PARALLELISM_DEGREE][BLAKE2B_OUTBYTES]; ++ size_t i; ++ ++ if(out == NULL || outlen < S->outlen) { ++ return -1; ++ } ++ ++ for( i = 0; i < PARALLELISM_DEGREE; ++i ) ++ { ++ if( S->buflen > i * BLAKE2B_BLOCKBYTES ) ++ { ++ size_t left = S->buflen - i * BLAKE2B_BLOCKBYTES; ++ ++ if( left > BLAKE2B_BLOCKBYTES ) left = BLAKE2B_BLOCKBYTES; ++ ++ blake2b_update( S->S[i], S->buf + i * BLAKE2B_BLOCKBYTES, left ); ++ } ++ ++ blake2b_final( S->S[i], hash[i], BLAKE2B_OUTBYTES ); ++ } ++ ++ for( i = 0; i < PARALLELISM_DEGREE; ++i ) ++ blake2b_update( S->R, hash[i], BLAKE2B_OUTBYTES ); ++ ++ return blake2b_final( S->R, out, S->outlen ); ++} ++ ++int blake2bp( void *out, size_t outlen, const void *in, size_t inlen, const void *key, size_t keylen ) ++{ ++ uint8_t hash[PARALLELISM_DEGREE][BLAKE2B_OUTBYTES]; ++ blake2b_state S[PARALLELISM_DEGREE][1]; ++ blake2b_state FS[1]; ++ size_t i; ++ ++ /* Verify parameters */ ++ if ( NULL == in && inlen > 0 ) return -1; ++ ++ if ( NULL == out ) return -1; ++ ++ if( NULL == key && keylen > 0 ) return -1; ++ ++ if( !outlen || outlen > BLAKE2B_OUTBYTES ) return -1; ++ ++ if( keylen > BLAKE2B_KEYBYTES ) return -1; ++ ++ for( i = 0; i < PARALLELISM_DEGREE; ++i ) ++ if( blake2bp_init_leaf( S[i], outlen, keylen, i ) < 0 ) return -1; ++ ++ S[PARALLELISM_DEGREE - 1]->last_node = 1; /* mark last node */ ++ ++ if( keylen > 0 ) ++ { ++ uint8_t block[BLAKE2B_BLOCKBYTES]; ++ memset( block, 0, BLAKE2B_BLOCKBYTES ); ++ memcpy( block, key, keylen ); ++ ++ for( i = 0; i < PARALLELISM_DEGREE; ++i ) ++ blake2b_update( S[i], block, BLAKE2B_BLOCKBYTES ); ++ ++ secure_zero_memory( block, BLAKE2B_BLOCKBYTES ); /* Burn the key from stack */ ++ } ++ ++#if defined(_OPENMP) ++ #pragma omp parallel shared(S,hash), num_threads(PARALLELISM_DEGREE) ++#else ++ ++ for( i = 0; i < PARALLELISM_DEGREE; ++i ) ++#endif ++ { ++#if defined(_OPENMP) ++ size_t i = omp_get_thread_num(); ++#endif ++ size_t inlen__ = inlen; ++ const unsigned char *in__ = ( const unsigned char * )in; ++ in__ += i * BLAKE2B_BLOCKBYTES; ++ ++ while( inlen__ >= PARALLELISM_DEGREE * BLAKE2B_BLOCKBYTES ) ++ { ++ blake2b_update( S[i], in__, BLAKE2B_BLOCKBYTES ); ++ in__ += PARALLELISM_DEGREE * BLAKE2B_BLOCKBYTES; ++ inlen__ -= PARALLELISM_DEGREE * BLAKE2B_BLOCKBYTES; ++ } ++ ++ if( inlen__ > i * BLAKE2B_BLOCKBYTES ) ++ { ++ const size_t left = inlen__ - i * BLAKE2B_BLOCKBYTES; ++ const size_t len = left <= BLAKE2B_BLOCKBYTES ? left : BLAKE2B_BLOCKBYTES; ++ blake2b_update( S[i], in__, len ); ++ } ++ ++ blake2b_final( S[i], hash[i], BLAKE2B_OUTBYTES ); ++ } ++ ++ if( blake2bp_init_root( FS, outlen, keylen ) < 0 ) ++ return -1; ++ ++ FS->last_node = 1; /* Mark as last node */ ++ ++ for( i = 0; i < PARALLELISM_DEGREE; ++i ) ++ blake2b_update( FS, hash[i], BLAKE2B_OUTBYTES ); ++ ++ return blake2b_final( FS, out, outlen );; ++} ++ ++#if defined(BLAKE2BP_SELFTEST) ++#include <string.h> ++#include "blake2-kat.h" ++int main( void ) ++{ ++ uint8_t key[BLAKE2B_KEYBYTES]; ++ uint8_t buf[BLAKE2_KAT_LENGTH]; ++ size_t i, step; ++ ++ for( i = 0; i < BLAKE2B_KEYBYTES; ++i ) ++ key[i] = ( uint8_t )i; ++ ++ for( i = 0; i < BLAKE2_KAT_LENGTH; ++i ) ++ buf[i] = ( uint8_t )i; ++ ++ /* Test simple API */ ++ for( i = 0; i < BLAKE2_KAT_LENGTH; ++i ) ++ { ++ uint8_t hash[BLAKE2B_OUTBYTES]; ++ blake2bp( hash, BLAKE2B_OUTBYTES, buf, i, key, BLAKE2B_KEYBYTES ); ++ ++ if( 0 != memcmp( hash, blake2bp_keyed_kat[i], BLAKE2B_OUTBYTES ) ) ++ { ++ goto fail; ++ } ++ } ++ ++ /* Test streaming API */ ++ for(step = 1; step < BLAKE2B_BLOCKBYTES; ++step) { ++ for (i = 0; i < BLAKE2_KAT_LENGTH; ++i) { ++ uint8_t hash[BLAKE2B_OUTBYTES]; ++ blake2bp_state S; ++ uint8_t * p = buf; ++ size_t mlen = i; ++ int err = 0; ++ ++ if( (err = blake2bp_init_key(&S, BLAKE2B_OUTBYTES, key, BLAKE2B_KEYBYTES)) < 0 ) { ++ goto fail; ++ } ++ ++ while (mlen >= step) { ++ if ( (err = blake2bp_update(&S, p, step)) < 0 ) { ++ goto fail; ++ } ++ mlen -= step; ++ p += step; ++ } ++ if ( (err = blake2bp_update(&S, p, mlen)) < 0) { ++ goto fail; ++ } ++ if ( (err = blake2bp_final(&S, hash, BLAKE2B_OUTBYTES)) < 0) { ++ goto fail; ++ } ++ ++ if (0 != memcmp(hash, blake2bp_keyed_kat[i], BLAKE2B_OUTBYTES)) { ++ goto fail; ++ } ++ } ++ } ++ ++ puts( "ok" ); ++ return 0; ++fail: ++ puts("error"); ++ return -1; ++} ++#endif +--- thirdparty/blake2/ref/blake2s-ref.c.orig 2025-09-03 12:27:32 UTC ++++ thirdparty/blake2/ref/blake2s-ref.c +@@ -0,0 +1,367 @@ ++/* ++ BLAKE2 reference source code package - reference C implementations ++ ++ Copyright 2012, Samuel Neves <sneves@dei.uc.pt>. You may use this under the ++ terms of the CC0, the OpenSSL Licence, or the Apache Public License 2.0, at ++ your option. The terms of these licenses can be found at: ++ ++ - CC0 1.0 Universal : http://creativecommons.org/publicdomain/zero/1.0 ++ - OpenSSL license : https://www.openssl.org/source/license.html ++ - Apache 2.0 : http://www.apache.org/licenses/LICENSE-2.0 ++ ++ More information about the BLAKE2 hash function can be found at ++ https://blake2.net. ++*/ ++ ++#include <stdint.h> ++#include <string.h> ++#include <stdio.h> ++ ++#include "blake2.h" ++#include "blake2-impl.h" ++ ++static const uint32_t blake2s_IV[8] = ++{ ++ 0x6A09E667UL, 0xBB67AE85UL, 0x3C6EF372UL, 0xA54FF53AUL, ++ 0x510E527FUL, 0x9B05688CUL, 0x1F83D9ABUL, 0x5BE0CD19UL ++}; ++ ++static const uint8_t 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 } , ++ { 11, 8, 12, 0, 5, 2, 15, 13, 10, 14, 3, 6, 7, 1, 9, 4 } , ++ { 7, 9, 3, 1, 13, 12, 11, 14, 2, 6, 5, 10, 4, 0, 15, 8 } , ++ { 9, 0, 5, 7, 2, 4, 10, 15, 14, 1, 11, 12, 6, 8, 3, 13 } , ++ { 2, 12, 6, 10, 0, 11, 8, 3, 4, 13, 7, 5, 15, 14, 1, 9 } , ++ { 12, 5, 1, 15, 14, 13, 4, 10, 0, 7, 6, 3, 9, 2, 8, 11 } , ++ { 13, 11, 7, 14, 12, 1, 3, 9, 5, 0, 15, 4, 8, 6, 2, 10 } , ++ { 6, 15, 14, 9, 11, 3, 0, 8, 12, 2, 13, 7, 1, 4, 10, 5 } , ++ { 10, 2, 8, 4, 7, 6, 1, 5, 15, 11, 9, 14, 3, 12, 13 , 0 } , ++}; ++ ++static void blake2s_set_lastnode( blake2s_state *S ) ++{ ++ S->f[1] = (uint32_t)-1; ++} ++ ++/* Some helper functions, not necessarily useful */ ++static int blake2s_is_lastblock( const blake2s_state *S ) ++{ ++ return S->f[0] != 0; ++} ++ ++static void blake2s_set_lastblock( blake2s_state *S ) ++{ ++ if( S->last_node ) blake2s_set_lastnode( S ); ++ ++ S->f[0] = (uint32_t)-1; ++} ++ ++static void blake2s_increment_counter( blake2s_state *S, const uint32_t inc ) ++{ ++ S->t[0] += inc; ++ S->t[1] += ( S->t[0] < inc ); ++} ++ ++static void blake2s_init0( blake2s_state *S ) ++{ ++ size_t i; ++ memset( S, 0, sizeof( blake2s_state ) ); ++ ++ for( i = 0; i < 8; ++i ) S->h[i] = blake2s_IV[i]; ++} ++ ++/* init2 xors IV with input parameter block */ ++int blake2s_init_param( blake2s_state *S, const blake2s_param *P ) ++{ ++ const unsigned char *p = ( const unsigned char * )( P ); ++ size_t i; ++ ++ blake2s_init0( S ); ++ ++ /* IV XOR ParamBlock */ ++ for( i = 0; i < 8; ++i ) ++ S->h[i] ^= load32( &p[i * 4] ); ++ ++ S->outlen = P->digest_length; ++ return 0; ++} ++ ++ ++/* Sequential blake2s initialization */ ++int blake2s_init( blake2s_state *S, size_t outlen ) ++{ ++ blake2s_param P[1]; ++ ++ /* Move interval verification here? */ ++ if ( ( !outlen ) || ( outlen > BLAKE2S_OUTBYTES ) ) return -1; ++ ++ P->digest_length = (uint8_t)outlen; ++ P->key_length = 0; ++ P->fanout = 1; ++ P->depth = 1; ++ store32( &P->leaf_length, 0 ); ++ store32( &P->node_offset, 0 ); ++ store16( &P->xof_length, 0 ); ++ P->node_depth = 0; ++ P->inner_length = 0; ++ /* memset(P->reserved, 0, sizeof(P->reserved) ); */ ++ memset( P->salt, 0, sizeof( P->salt ) ); ++ memset( P->personal, 0, sizeof( P->personal ) ); ++ return blake2s_init_param( S, P ); ++} ++ ++int blake2s_init_key( blake2s_state *S, size_t outlen, const void *key, size_t keylen ) ++{ ++ blake2s_param P[1]; ++ ++ if ( ( !outlen ) || ( outlen > BLAKE2S_OUTBYTES ) ) return -1; ++ ++ if ( !key || !keylen || keylen > BLAKE2S_KEYBYTES ) return -1; ++ ++ P->digest_length = (uint8_t)outlen; ++ P->key_length = (uint8_t)keylen; ++ P->fanout = 1; ++ P->depth = 1; ++ store32( &P->leaf_length, 0 ); ++ store32( &P->node_offset, 0 ); ++ store16( &P->xof_length, 0 ); ++ P->node_depth = 0; ++ P->inner_length = 0; ++ /* memset(P->reserved, 0, sizeof(P->reserved) ); */ ++ memset( P->salt, 0, sizeof( P->salt ) ); ++ memset( P->personal, 0, sizeof( P->personal ) ); ++ ++ if( blake2s_init_param( S, P ) < 0 ) return -1; ++ ++ { ++ uint8_t block[BLAKE2S_BLOCKBYTES]; ++ memset( block, 0, BLAKE2S_BLOCKBYTES ); ++ memcpy( block, key, keylen ); ++ blake2s_update( S, block, BLAKE2S_BLOCKBYTES ); ++ secure_zero_memory( block, BLAKE2S_BLOCKBYTES ); /* Burn the key from stack */ ++ } ++ return 0; ++} ++ ++#define G(r,i,a,b,c,d) \ ++ do { \ ++ a = a + b + m[blake2s_sigma[r][2*i+0]]; \ ++ d = rotr32(d ^ a, 16); \ ++ c = c + d; \ ++ b = rotr32(b ^ c, 12); \ ++ a = a + b + m[blake2s_sigma[r][2*i+1]]; \ ++ d = rotr32(d ^ a, 8); \ ++ c = c + d; \ ++ b = rotr32(b ^ c, 7); \ ++ } while(0) ++ ++#define ROUND(r) \ ++ do { \ ++ G(r,0,v[ 0],v[ 4],v[ 8],v[12]); \ ++ G(r,1,v[ 1],v[ 5],v[ 9],v[13]); \ ++ G(r,2,v[ 2],v[ 6],v[10],v[14]); \ ++ G(r,3,v[ 3],v[ 7],v[11],v[15]); \ ++ G(r,4,v[ 0],v[ 5],v[10],v[15]); \ ++ G(r,5,v[ 1],v[ 6],v[11],v[12]); \ ++ G(r,6,v[ 2],v[ 7],v[ 8],v[13]); \ ++ G(r,7,v[ 3],v[ 4],v[ 9],v[14]); \ ++ } while(0) ++ ++static void blake2s_compress( blake2s_state *S, const uint8_t in[BLAKE2S_BLOCKBYTES] ) ++{ ++ uint32_t m[16]; ++ uint32_t v[16]; ++ size_t i; ++ ++ for( i = 0; i < 16; ++i ) { ++ m[i] = load32( in + i * sizeof( m[i] ) ); ++ } ++ ++ for( i = 0; i < 8; ++i ) { ++ v[i] = S->h[i]; ++ } ++ ++ v[ 8] = blake2s_IV[0]; ++ v[ 9] = blake2s_IV[1]; ++ v[10] = blake2s_IV[2]; ++ v[11] = blake2s_IV[3]; ++ v[12] = S->t[0] ^ blake2s_IV[4]; ++ v[13] = S->t[1] ^ blake2s_IV[5]; ++ v[14] = S->f[0] ^ blake2s_IV[6]; ++ v[15] = S->f[1] ^ blake2s_IV[7]; ++ ++ ROUND( 0 ); ++ ROUND( 1 ); ++ ROUND( 2 ); ++ ROUND( 3 ); ++ ROUND( 4 ); ++ ROUND( 5 ); ++ ROUND( 6 ); ++ ROUND( 7 ); ++ ROUND( 8 ); ++ ROUND( 9 ); ++ ++ for( i = 0; i < 8; ++i ) { ++ S->h[i] = S->h[i] ^ v[i] ^ v[i + 8]; ++ } ++} ++ ++#undef G ++#undef ROUND ++ ++int blake2s_update( blake2s_state *S, const void *pin, size_t inlen ) ++{ ++ const unsigned char * in = (const unsigned char *)pin; ++ if( inlen > 0 ) ++ { ++ size_t left = S->buflen; ++ size_t fill = BLAKE2S_BLOCKBYTES - left; ++ if( inlen > fill ) ++ { ++ S->buflen = 0; ++ memcpy( S->buf + left, in, fill ); /* Fill buffer */ ++ blake2s_increment_counter( S, BLAKE2S_BLOCKBYTES ); ++ blake2s_compress( S, S->buf ); /* Compress */ ++ in += fill; inlen -= fill; ++ while(inlen > BLAKE2S_BLOCKBYTES) { ++ blake2s_increment_counter(S, BLAKE2S_BLOCKBYTES); ++ blake2s_compress( S, in ); ++ in += BLAKE2S_BLOCKBYTES; ++ inlen -= BLAKE2S_BLOCKBYTES; ++ } ++ } ++ memcpy( S->buf + S->buflen, in, inlen ); ++ S->buflen += inlen; ++ } ++ return 0; ++} ++ ++int blake2s_final( blake2s_state *S, void *out, size_t outlen ) ++{ ++ uint8_t buffer[BLAKE2S_OUTBYTES] = {0}; ++ size_t i; ++ ++ if( out == NULL || outlen < S->outlen ) ++ return -1; ++ ++ if( blake2s_is_lastblock( S ) ) ++ return -1; ++ ++ blake2s_increment_counter( S, ( uint32_t )S->buflen ); ++ blake2s_set_lastblock( S ); ++ memset( S->buf + S->buflen, 0, BLAKE2S_BLOCKBYTES - S->buflen ); /* Padding */ ++ blake2s_compress( S, S->buf ); ++ ++ for( i = 0; i < 8; ++i ) /* Output full hash to temp buffer */ ++ store32( buffer + sizeof( S->h[i] ) * i, S->h[i] ); ++ ++ memcpy( out, buffer, outlen ); ++ secure_zero_memory(buffer, sizeof(buffer)); ++ return 0; ++} ++ ++int blake2s( void *out, size_t outlen, const void *in, size_t inlen, const void *key, size_t keylen ) ++{ ++ blake2s_state S[1]; ++ ++ /* Verify parameters */ ++ if ( NULL == in && inlen > 0 ) return -1; ++ ++ if ( NULL == out ) return -1; ++ ++ if ( NULL == key && keylen > 0) return -1; ++ ++ if( !outlen || outlen > BLAKE2S_OUTBYTES ) return -1; ++ ++ if( keylen > BLAKE2S_KEYBYTES ) return -1; ++ ++ if( keylen > 0 ) ++ { ++ if( blake2s_init_key( S, outlen, key, keylen ) < 0 ) return -1; ++ } ++ else ++ { ++ if( blake2s_init( S, outlen ) < 0 ) return -1; ++ } ++ ++ blake2s_update( S, ( const uint8_t * )in, inlen ); ++ blake2s_final( S, out, outlen ); ++ return 0; ++} ++ ++#if defined(SUPERCOP) ++int crypto_hash( unsigned char *out, unsigned char *in, unsigned long long inlen ) ++{ ++ return blake2s( out, BLAKE2S_OUTBYTES, in, inlen, NULL, 0 ); ++} ++#endif ++ ++#if defined(BLAKE2S_SELFTEST) ++#include <string.h> ++#include "blake2-kat.h" ++int main( void ) ++{ ++ uint8_t key[BLAKE2S_KEYBYTES]; ++ uint8_t buf[BLAKE2_KAT_LENGTH]; ++ size_t i, step; ++ ++ for( i = 0; i < BLAKE2S_KEYBYTES; ++i ) ++ key[i] = ( uint8_t )i; ++ ++ for( i = 0; i < BLAKE2_KAT_LENGTH; ++i ) ++ buf[i] = ( uint8_t )i; ++ ++ /* Test simple API */ ++ for( i = 0; i < BLAKE2_KAT_LENGTH; ++i ) ++ { ++ uint8_t hash[BLAKE2S_OUTBYTES]; ++ blake2s( hash, BLAKE2S_OUTBYTES, buf, i, key, BLAKE2S_KEYBYTES ); ++ ++ if( 0 != memcmp( hash, blake2s_keyed_kat[i], BLAKE2S_OUTBYTES ) ) ++ { ++ goto fail; ++ } ++ } ++ ++ /* Test streaming API */ ++ for(step = 1; step < BLAKE2S_BLOCKBYTES; ++step) { ++ for (i = 0; i < BLAKE2_KAT_LENGTH; ++i) { ++ uint8_t hash[BLAKE2S_OUTBYTES]; ++ blake2s_state S; ++ uint8_t * p = buf; ++ size_t mlen = i; ++ int err = 0; ++ ++ if( (err = blake2s_init_key(&S, BLAKE2S_OUTBYTES, key, BLAKE2S_KEYBYTES)) < 0 ) { ++ goto fail; ++ } ++ ++ while (mlen >= step) { ++ if ( (err = blake2s_update(&S, p, step)) < 0 ) { ++ goto fail; ++ } ++ mlen -= step; ++ p += step; ++ } ++ if ( (err = blake2s_update(&S, p, mlen)) < 0) { ++ goto fail; ++ } ++ if ( (err = blake2s_final(&S, hash, BLAKE2S_OUTBYTES)) < 0) { ++ goto fail; ++ } ++ ++ if (0 != memcmp(hash, blake2s_keyed_kat[i], BLAKE2S_OUTBYTES)) { ++ goto fail; ++ } ++ } ++ } ++ ++ puts( "ok" ); ++ return 0; ++fail: ++ puts("error"); ++ return -1; ++} ++#endif +--- thirdparty/blake2/ref/blake2sp-ref.c.orig 2025-09-03 12:27:32 UTC ++++ thirdparty/blake2/ref/blake2sp-ref.c +@@ -0,0 +1,359 @@ ++/* ++ BLAKE2 reference source code package - reference C implementations ++ ++ Copyright 2012, Samuel Neves <sneves@dei.uc.pt>. You may use this under the ++ terms of the CC0, the OpenSSL Licence, or the Apache Public License 2.0, at ++ your option. The terms of these licenses can be found at: ++ ++ - CC0 1.0 Universal : http://creativecommons.org/publicdomain/zero/1.0 ++ - OpenSSL license : https://www.openssl.org/source/license.html ++ - Apache 2.0 : http://www.apache.org/licenses/LICENSE-2.0 ++ ++ More information about the BLAKE2 hash function can be found at ++ https://blake2.net. ++*/ ++ ++#include <stdlib.h> ++#include <string.h> ++#include <stdio.h> ++ ++#if defined(_OPENMP) ++#include <omp.h> ++#endif ++ ++#include "blake2.h" ++#include "blake2-impl.h" ++ ++#define PARALLELISM_DEGREE 8 ++ ++/* ++ blake2sp_init_param defaults to setting the expecting output length ++ from the digest_length parameter block field. ++ ++ In some cases, however, we do not want this, as the output length ++ of these instances is given by inner_length instead. ++*/ ++static int blake2sp_init_leaf_param( blake2s_state *S, const blake2s_param *P ) ++{ ++ int err = blake2s_init_param(S, P); ++ S->outlen = P->inner_length; ++ return err; ++} ++ ++static int blake2sp_init_leaf( blake2s_state *S, size_t outlen, size_t keylen, uint64_t offset ) ++{ ++ blake2s_param P[1]; ++ P->digest_length = (uint8_t)outlen; ++ P->key_length = (uint8_t)keylen; ++ P->fanout = PARALLELISM_DEGREE; ++ P->depth = 2; ++ store32( &P->leaf_length, 0 ); ++ store32( &P->node_offset, offset ); ++ store16( &P->xof_length, 0 ); ++ P->node_depth = 0; ++ P->inner_length = BLAKE2S_OUTBYTES; ++ memset( P->salt, 0, sizeof( P->salt ) ); ++ memset( P->personal, 0, sizeof( P->personal ) ); ++ return blake2sp_init_leaf_param( S, P ); ++} ++ ++static int blake2sp_init_root( blake2s_state *S, size_t outlen, size_t keylen ) ++{ ++ blake2s_param P[1]; ++ P->digest_length = (uint8_t)outlen; ++ P->key_length = (uint8_t)keylen; ++ P->fanout = PARALLELISM_DEGREE; ++ P->depth = 2; ++ store32( &P->leaf_length, 0 ); ++ store32( &P->node_offset, 0 ); ++ store16( &P->xof_length, 0 ); ++ P->node_depth = 1; ++ P->inner_length = BLAKE2S_OUTBYTES; ++ memset( P->salt, 0, sizeof( P->salt ) ); ++ memset( P->personal, 0, sizeof( P->personal ) ); ++ return blake2s_init_param( S, P ); ++} ++ ++ ++int blake2sp_init( blake2sp_state *S, size_t outlen ) ++{ ++ size_t i; ++ ++ if( !outlen || outlen > BLAKE2S_OUTBYTES ) return -1; ++ ++ memset( S->buf, 0, sizeof( S->buf ) ); ++ S->buflen = 0; ++ S->outlen = outlen; ++ ++ if( blake2sp_init_root( S->R, outlen, 0 ) < 0 ) ++ return -1; ++ ++ for( i = 0; i < PARALLELISM_DEGREE; ++i ) ++ if( blake2sp_init_leaf( S->S[i], outlen, 0, i ) < 0 ) return -1; ++ ++ S->R->last_node = 1; ++ S->S[PARALLELISM_DEGREE - 1]->last_node = 1; ++ return 0; ++} ++ ++int blake2sp_init_key( blake2sp_state *S, size_t outlen, const void *key, size_t keylen ) ++{ ++ size_t i; ++ ++ if( !outlen || outlen > BLAKE2S_OUTBYTES ) return -1; ++ ++ if( !key || !keylen || keylen > BLAKE2S_KEYBYTES ) return -1; ++ ++ memset( S->buf, 0, sizeof( S->buf ) ); ++ S->buflen = 0; ++ S->outlen = outlen; ++ ++ if( blake2sp_init_root( S->R, outlen, keylen ) < 0 ) ++ return -1; ++ ++ for( i = 0; i < PARALLELISM_DEGREE; ++i ) ++ if( blake2sp_init_leaf( S->S[i], outlen, keylen, i ) < 0 ) return -1; ++ ++ S->R->last_node = 1; ++ S->S[PARALLELISM_DEGREE - 1]->last_node = 1; ++ { ++ uint8_t block[BLAKE2S_BLOCKBYTES]; ++ memset( block, 0, BLAKE2S_BLOCKBYTES ); ++ memcpy( block, key, keylen ); ++ ++ for( i = 0; i < PARALLELISM_DEGREE; ++i ) ++ blake2s_update( S->S[i], block, BLAKE2S_BLOCKBYTES ); ++ ++ secure_zero_memory( block, BLAKE2S_BLOCKBYTES ); /* Burn the key from stack */ ++ } ++ return 0; ++} ++ ++ ++int blake2sp_update( blake2sp_state *S, const void *pin, size_t inlen ) ++{ ++ const unsigned char * in = (const unsigned char *)pin; ++ size_t left = S->buflen; ++ size_t fill = sizeof( S->buf ) - left; ++ size_t i; ++ ++ if( left && inlen >= fill ) ++ { ++ memcpy( S->buf + left, in, fill ); ++ ++ for( i = 0; i < PARALLELISM_DEGREE; ++i ) ++ blake2s_update( S->S[i], S->buf + i * BLAKE2S_BLOCKBYTES, BLAKE2S_BLOCKBYTES ); ++ ++ in += fill; ++ inlen -= fill; ++ left = 0; ++ } ++ ++#if defined(_OPENMP) ++ #pragma omp parallel shared(S), num_threads(PARALLELISM_DEGREE) ++#else ++ for( i = 0; i < PARALLELISM_DEGREE; ++i ) ++#endif ++ { ++#if defined(_OPENMP) ++ size_t i = omp_get_thread_num(); ++#endif ++ size_t inlen__ = inlen; ++ const unsigned char *in__ = ( const unsigned char * )in; ++ in__ += i * BLAKE2S_BLOCKBYTES; ++ ++ while( inlen__ >= PARALLELISM_DEGREE * BLAKE2S_BLOCKBYTES ) ++ { ++ blake2s_update( S->S[i], in__, BLAKE2S_BLOCKBYTES ); ++ in__ += PARALLELISM_DEGREE * BLAKE2S_BLOCKBYTES; ++ inlen__ -= PARALLELISM_DEGREE * BLAKE2S_BLOCKBYTES; ++ } ++ } ++ ++ in += inlen - inlen % ( PARALLELISM_DEGREE * BLAKE2S_BLOCKBYTES ); ++ inlen %= PARALLELISM_DEGREE * BLAKE2S_BLOCKBYTES; ++ ++ if( inlen > 0 ) ++ memcpy( S->buf + left, in, inlen ); ++ ++ S->buflen = left + inlen; ++ return 0; ++} ++ ++ ++int blake2sp_final( blake2sp_state *S, void *out, size_t outlen ) ++{ ++ uint8_t hash[PARALLELISM_DEGREE][BLAKE2S_OUTBYTES]; ++ size_t i; ++ ++ if(out == NULL || outlen < S->outlen) { ++ return -1; ++ } ++ ++ for( i = 0; i < PARALLELISM_DEGREE; ++i ) ++ { ++ if( S->buflen > i * BLAKE2S_BLOCKBYTES ) ++ { ++ size_t left = S->buflen - i * BLAKE2S_BLOCKBYTES; ++ ++ if( left > BLAKE2S_BLOCKBYTES ) left = BLAKE2S_BLOCKBYTES; ++ ++ blake2s_update( S->S[i], S->buf + i * BLAKE2S_BLOCKBYTES, left ); ++ } ++ ++ blake2s_final( S->S[i], hash[i], BLAKE2S_OUTBYTES ); ++ } ++ ++ for( i = 0; i < PARALLELISM_DEGREE; ++i ) ++ blake2s_update( S->R, hash[i], BLAKE2S_OUTBYTES ); ++ ++ return blake2s_final( S->R, out, S->outlen ); ++} ++ ++ ++int blake2sp( void *out, size_t outlen, const void *in, size_t inlen, const void *key, size_t keylen ) ++{ ++ uint8_t hash[PARALLELISM_DEGREE][BLAKE2S_OUTBYTES]; ++ blake2s_state S[PARALLELISM_DEGREE][1]; ++ blake2s_state FS[1]; ++ size_t i; ++ ++ /* Verify parameters */ ++ if ( NULL == in && inlen > 0 ) return -1; ++ ++ if ( NULL == out ) return -1; ++ ++ if ( NULL == key && keylen > 0) return -1; ++ ++ if( !outlen || outlen > BLAKE2S_OUTBYTES ) return -1; ++ ++ if( keylen > BLAKE2S_KEYBYTES ) return -1; ++ ++ for( i = 0; i < PARALLELISM_DEGREE; ++i ) ++ if( blake2sp_init_leaf( S[i], outlen, keylen, i ) < 0 ) return -1; ++ ++ S[PARALLELISM_DEGREE - 1]->last_node = 1; /* mark last node */ ++ ++ if( keylen > 0 ) ++ { ++ uint8_t block[BLAKE2S_BLOCKBYTES]; ++ memset( block, 0, BLAKE2S_BLOCKBYTES ); ++ memcpy( block, key, keylen ); ++ ++ for( i = 0; i < PARALLELISM_DEGREE; ++i ) ++ blake2s_update( S[i], block, BLAKE2S_BLOCKBYTES ); ++ ++ secure_zero_memory( block, BLAKE2S_BLOCKBYTES ); /* Burn the key from stack */ ++ } ++ ++#if defined(_OPENMP) ++ #pragma omp parallel shared(S,hash), num_threads(PARALLELISM_DEGREE) ++#else ++ ++ for( i = 0; i < PARALLELISM_DEGREE; ++i ) ++#endif ++ { ++#if defined(_OPENMP) ++ size_t i = omp_get_thread_num(); ++#endif ++ size_t inlen__ = inlen; ++ const unsigned char *in__ = ( const unsigned char * )in; ++ in__ += i * BLAKE2S_BLOCKBYTES; ++ ++ while( inlen__ >= PARALLELISM_DEGREE * BLAKE2S_BLOCKBYTES ) ++ { ++ blake2s_update( S[i], in__, BLAKE2S_BLOCKBYTES ); ++ in__ += PARALLELISM_DEGREE * BLAKE2S_BLOCKBYTES; ++ inlen__ -= PARALLELISM_DEGREE * BLAKE2S_BLOCKBYTES; ++ } ++ ++ if( inlen__ > i * BLAKE2S_BLOCKBYTES ) ++ { ++ const size_t left = inlen__ - i * BLAKE2S_BLOCKBYTES; ++ const size_t len = left <= BLAKE2S_BLOCKBYTES ? left : BLAKE2S_BLOCKBYTES; ++ blake2s_update( S[i], in__, len ); ++ } ++ ++ blake2s_final( S[i], hash[i], BLAKE2S_OUTBYTES ); ++ } ++ ++ if( blake2sp_init_root( FS, outlen, keylen ) < 0 ) ++ return -1; ++ ++ FS->last_node = 1; ++ ++ for( i = 0; i < PARALLELISM_DEGREE; ++i ) ++ blake2s_update( FS, hash[i], BLAKE2S_OUTBYTES ); ++ ++ return blake2s_final( FS, out, outlen ); ++} ++ ++ ++ ++#if defined(BLAKE2SP_SELFTEST) ++#include <string.h> ++#include "blake2-kat.h" ++int main( void ) ++{ ++ uint8_t key[BLAKE2S_KEYBYTES]; ++ uint8_t buf[BLAKE2_KAT_LENGTH]; ++ size_t i, step; ++ ++ for( i = 0; i < BLAKE2S_KEYBYTES; ++i ) ++ key[i] = ( uint8_t )i; ++ ++ for( i = 0; i < BLAKE2_KAT_LENGTH; ++i ) ++ buf[i] = ( uint8_t )i; ++ ++ /* Test simple API */ ++ for( i = 0; i < BLAKE2_KAT_LENGTH; ++i ) ++ { ++ uint8_t hash[BLAKE2S_OUTBYTES]; ++ blake2sp( hash, BLAKE2S_OUTBYTES, buf, i, key, BLAKE2S_KEYBYTES ); ++ ++ if( 0 != memcmp( hash, blake2sp_keyed_kat[i], BLAKE2S_OUTBYTES ) ) ++ { ++ goto fail; ++ } ++ } ++ ++ /* Test streaming API */ ++ for(step = 1; step < BLAKE2S_BLOCKBYTES; ++step) { ++ for (i = 0; i < BLAKE2_KAT_LENGTH; ++i) { ++ uint8_t hash[BLAKE2S_OUTBYTES]; ++ blake2sp_state S; ++ uint8_t * p = buf; ++ size_t mlen = i; ++ int err = 0; ++ ++ if( (err = blake2sp_init_key(&S, BLAKE2S_OUTBYTES, key, BLAKE2S_KEYBYTES)) < 0 ) { ++ goto fail; ++ } ++ ++ while (mlen >= step) { ++ if ( (err = blake2sp_update(&S, p, step)) < 0 ) { ++ goto fail; ++ } ++ mlen -= step; ++ p += step; ++ } ++ if ( (err = blake2sp_update(&S, p, mlen)) < 0) { ++ goto fail; ++ } ++ if ( (err = blake2sp_final(&S, hash, BLAKE2S_OUTBYTES)) < 0) { ++ goto fail; ++ } ++ ++ if (0 != memcmp(hash, blake2sp_keyed_kat[i], BLAKE2S_OUTBYTES)) { ++ goto fail; ++ } ++ } ++ } ++ ++ puts( "ok" ); ++ return 0; ++fail: ++ puts("error"); ++ return -1; ++} ++#endif +--- thirdparty/blake2/ref/blake2xb-ref.c.orig 2025-09-03 12:27:32 UTC ++++ thirdparty/blake2/ref/blake2xb-ref.c +@@ -0,0 +1,241 @@ ++/* ++ BLAKE2 reference source code package - reference C implementations ++ ++ Copyright 2016, JP Aumasson <jeanphilippe.aumasson@gmail.com>. ++ Copyright 2016, Samuel Neves <sneves@dei.uc.pt>. ++ ++ You may use this under the terms of the CC0, the OpenSSL Licence, or ++ the Apache Public License 2.0, at your option. The terms of these ++ licenses can be found at: ++ ++ - CC0 1.0 Universal : http://creativecommons.org/publicdomain/zero/1.0 ++ - OpenSSL license : https://www.openssl.org/source/license.html ++ - Apache 2.0 : http://www.apache.org/licenses/LICENSE-2.0 ++ ++ More information about the BLAKE2 hash function can be found at ++ https://blake2.net. ++*/ ++ ++#include <stdint.h> ++#include <string.h> ++#include <stdio.h> ++ ++#include "blake2.h" ++#include "blake2-impl.h" ++ ++int blake2xb_init( blake2xb_state *S, const size_t outlen ) { ++ return blake2xb_init_key(S, outlen, NULL, 0); ++} ++ ++int blake2xb_init_key( blake2xb_state *S, const size_t outlen, const void *key, size_t keylen) ++{ ++ if ( outlen == 0 || outlen > 0xFFFFFFFFUL ) { ++ return -1; ++ } ++ ++ if (NULL != key && keylen > BLAKE2B_KEYBYTES) { ++ return -1; ++ } ++ ++ if (NULL == key && keylen > 0) { ++ return -1; ++ } ++ ++ /* Initialize parameter block */ ++ S->P->digest_length = BLAKE2B_OUTBYTES; ++ S->P->key_length = keylen; ++ S->P->fanout = 1; ++ S->P->depth = 1; ++ store32( &S->P->leaf_length, 0 ); ++ store32( &S->P->node_offset, 0 ); ++ store32( &S->P->xof_length, outlen ); ++ S->P->node_depth = 0; ++ S->P->inner_length = 0; ++ memset( S->P->reserved, 0, sizeof( S->P->reserved ) ); ++ memset( S->P->salt, 0, sizeof( S->P->salt ) ); ++ memset( S->P->personal, 0, sizeof( S->P->personal ) ); ++ ++ if( blake2b_init_param( S->S, S->P ) < 0 ) { ++ return -1; ++ } ++ ++ if (keylen > 0) { ++ uint8_t block[BLAKE2B_BLOCKBYTES]; ++ memset(block, 0, BLAKE2B_BLOCKBYTES); ++ memcpy(block, key, keylen); ++ blake2b_update(S->S, block, BLAKE2B_BLOCKBYTES); ++ secure_zero_memory(block, BLAKE2B_BLOCKBYTES); ++ } ++ return 0; ++} ++ ++int blake2xb_update( blake2xb_state *S, const void *in, size_t inlen ) { ++ return blake2b_update( S->S, in, inlen ); ++} ++ ++int blake2xb_final( blake2xb_state *S, void *out, size_t outlen) { ++ ++ blake2b_state C[1]; ++ blake2b_param P[1]; ++ uint32_t xof_length = load32(&S->P->xof_length); ++ uint8_t root[BLAKE2B_BLOCKBYTES]; ++ size_t i; ++ ++ if (NULL == out) { ++ return -1; ++ } ++ ++ /* outlen must match the output size defined in xof_length, */ ++ /* unless it was -1, in which case anything goes except 0. */ ++ if(xof_length == 0xFFFFFFFFUL) { ++ if(outlen == 0) { ++ return -1; ++ } ++ } else { ++ if(outlen != xof_length) { ++ return -1; ++ } ++ } ++ ++ /* Finalize the root hash */ ++ if (blake2b_final(S->S, root, BLAKE2B_OUTBYTES) < 0) { ++ return -1; ++ } ++ ++ /* Set common block structure values */ ++ /* Copy values from parent instance, and only change the ones below */ ++ memcpy(P, S->P, sizeof(blake2b_param)); ++ P->key_length = 0; ++ P->fanout = 0; ++ P->depth = 0; ++ store32(&P->leaf_length, BLAKE2B_OUTBYTES); ++ P->inner_length = BLAKE2B_OUTBYTES; ++ P->node_depth = 0; ++ ++ for (i = 0; outlen > 0; ++i) { ++ const size_t block_size = (outlen < BLAKE2B_OUTBYTES) ? outlen : BLAKE2B_OUTBYTES; ++ /* Initialize state */ ++ P->digest_length = block_size; ++ store32(&P->node_offset, i); ++ blake2b_init_param(C, P); ++ /* Process key if needed */ ++ blake2b_update(C, root, BLAKE2B_OUTBYTES); ++ if (blake2b_final(C, (uint8_t *)out + i * BLAKE2B_OUTBYTES, block_size) < 0 ) { ++ return -1; ++ } ++ outlen -= block_size; ++ } ++ secure_zero_memory(root, sizeof(root)); ++ secure_zero_memory(P, sizeof(P)); ++ secure_zero_memory(C, sizeof(C)); ++ /* Put blake2xb in an invalid state? cf. blake2s_is_lastblock */ ++ return 0; ++ ++} ++ ++int blake2xb(void *out, size_t outlen, const void *in, size_t inlen, const void *key, size_t keylen) ++{ ++ blake2xb_state S[1]; ++ ++ /* Verify parameters */ ++ if (NULL == in && inlen > 0) ++ return -1; ++ ++ if (NULL == out) ++ return -1; ++ ++ if (NULL == key && keylen > 0) ++ return -1; ++ ++ if (keylen > BLAKE2B_KEYBYTES) ++ return -1; ++ ++ if (outlen == 0) ++ return -1; ++ ++ /* Initialize the root block structure */ ++ if (blake2xb_init_key(S, outlen, key, keylen) < 0) { ++ return -1; ++ } ++ ++ /* Absorb the input message */ ++ blake2xb_update(S, in, inlen); ++ ++ /* Compute the root node of the tree and the final hash using the counter construction */ ++ return blake2xb_final(S, out, outlen); ++} ++ ++#if defined(BLAKE2XB_SELFTEST) ++#include <string.h> ++#include "blake2-kat.h" ++int main( void ) ++{ ++ uint8_t key[BLAKE2B_KEYBYTES]; ++ uint8_t buf[BLAKE2_KAT_LENGTH]; ++ size_t i, step, outlen; ++ ++ for( i = 0; i < BLAKE2B_KEYBYTES; ++i ) { ++ key[i] = ( uint8_t )i; ++ } ++ ++ for( i = 0; i < BLAKE2_KAT_LENGTH; ++i ) { ++ buf[i] = ( uint8_t )i; ++ } ++ ++ /* Testing length of outputs rather than inputs */ ++ /* (Test of input lengths mostly covered by blake2b tests) */ ++ ++ /* Test simple API */ ++ for( outlen = 1; outlen <= BLAKE2_KAT_LENGTH; ++outlen ) ++ { ++ uint8_t hash[BLAKE2_KAT_LENGTH] = {0}; ++ if( blake2xb( hash, outlen, buf, BLAKE2_KAT_LENGTH, key, BLAKE2B_KEYBYTES ) < 0 ) { ++ goto fail; ++ } ++ ++ if( 0 != memcmp( hash, blake2xb_keyed_kat[outlen-1], outlen ) ) ++ { ++ goto fail; ++ } ++ } ++ ++ /* Test streaming API */ ++ for(step = 1; step < BLAKE2B_BLOCKBYTES; ++step) { ++ for (outlen = 1; outlen <= BLAKE2_KAT_LENGTH; ++outlen) { ++ uint8_t hash[BLAKE2_KAT_LENGTH]; ++ blake2xb_state S; ++ uint8_t * p = buf; ++ size_t mlen = BLAKE2_KAT_LENGTH; ++ int err = 0; ++ ++ if( (err = blake2xb_init_key(&S, outlen, key, BLAKE2B_KEYBYTES)) < 0 ) { ++ goto fail; ++ } ++ ++ while (mlen >= step) { ++ if ( (err = blake2xb_update(&S, p, step)) < 0 ) { ++ goto fail; ++ } ++ mlen -= step; ++ p += step; ++ } ++ if ( (err = blake2xb_update(&S, p, mlen)) < 0) { ++ goto fail; ++ } ++ if ( (err = blake2xb_final(&S, hash, outlen)) < 0) { ++ goto fail; ++ } ++ ++ if (0 != memcmp(hash, blake2xb_keyed_kat[outlen-1], outlen)) { ++ goto fail; ++ } ++ } ++ } ++ ++ puts( "ok" ); ++ return 0; ++fail: ++ puts("error"); ++ return -1; ++} ++#endif +--- thirdparty/blake2/ref/blake2xs-ref.c.orig 2025-09-03 12:27:32 UTC ++++ thirdparty/blake2/ref/blake2xs-ref.c +@@ -0,0 +1,239 @@ ++/* ++ BLAKE2 reference source code package - reference C implementations ++ ++ Copyright 2016, JP Aumasson <jeanphilippe.aumasson@gmail.com>. ++ Copyright 2016, Samuel Neves <sneves@dei.uc.pt>. ++ ++ You may use this under the terms of the CC0, the OpenSSL Licence, or ++ the Apache Public License 2.0, at your option. The terms of these ++ licenses can be found at: ++ ++ - CC0 1.0 Universal : http://creativecommons.org/publicdomain/zero/1.0 ++ - OpenSSL license : https://www.openssl.org/source/license.html ++ - Apache 2.0 : http://www.apache.org/licenses/LICENSE-2.0 ++ ++ More information about the BLAKE2 hash function can be found at ++ https://blake2.net. ++*/ ++ ++#include <stdint.h> ++#include <string.h> ++#include <stdio.h> ++ ++#include "blake2.h" ++#include "blake2-impl.h" ++ ++int blake2xs_init( blake2xs_state *S, const size_t outlen ) { ++ return blake2xs_init_key(S, outlen, NULL, 0); ++} ++ ++int blake2xs_init_key( blake2xs_state *S, const size_t outlen, const void *key, size_t keylen ) ++{ ++ if ( outlen == 0 || outlen > 0xFFFFUL ) { ++ return -1; ++ } ++ ++ if (NULL != key && keylen > BLAKE2B_KEYBYTES) { ++ return -1; ++ } ++ ++ if (NULL == key && keylen > 0) { ++ return -1; ++ } ++ ++ /* Initialize parameter block */ ++ S->P->digest_length = BLAKE2S_OUTBYTES; ++ S->P->key_length = keylen; ++ S->P->fanout = 1; ++ S->P->depth = 1; ++ store32( &S->P->leaf_length, 0 ); ++ store32( &S->P->node_offset, 0 ); ++ store16( &S->P->xof_length, outlen ); ++ S->P->node_depth = 0; ++ S->P->inner_length = 0; ++ memset( S->P->salt, 0, sizeof( S->P->salt ) ); ++ memset( S->P->personal, 0, sizeof( S->P->personal ) ); ++ ++ if( blake2s_init_param( S->S, S->P ) < 0 ) { ++ return -1; ++ } ++ ++ if (keylen > 0) { ++ uint8_t block[BLAKE2S_BLOCKBYTES]; ++ memset(block, 0, BLAKE2S_BLOCKBYTES); ++ memcpy(block, key, keylen); ++ blake2s_update(S->S, block, BLAKE2S_BLOCKBYTES); ++ secure_zero_memory(block, BLAKE2S_BLOCKBYTES); ++ } ++ return 0; ++} ++ ++int blake2xs_update( blake2xs_state *S, const void *in, size_t inlen ) { ++ return blake2s_update( S->S, in, inlen ); ++} ++ ++int blake2xs_final(blake2xs_state *S, void *out, size_t outlen) { ++ ++ blake2s_state C[1]; ++ blake2s_param P[1]; ++ uint16_t xof_length = load16(&S->P->xof_length); ++ uint8_t root[BLAKE2S_BLOCKBYTES]; ++ size_t i; ++ ++ if (NULL == out) { ++ return -1; ++ } ++ ++ /* outlen must match the output size defined in xof_length, */ ++ /* unless it was -1, in which case anything goes except 0. */ ++ if(xof_length == 0xFFFFUL) { ++ if(outlen == 0) { ++ return -1; ++ } ++ } else { ++ if(outlen != xof_length) { ++ return -1; ++ } ++ } ++ ++ /* Finalize the root hash */ ++ if (blake2s_final(S->S, root, BLAKE2S_OUTBYTES) < 0) { ++ return -1; ++ } ++ ++ /* Set common block structure values */ ++ /* Copy values from parent instance, and only change the ones below */ ++ memcpy(P, S->P, sizeof(blake2s_param)); ++ P->key_length = 0; ++ P->fanout = 0; ++ P->depth = 0; ++ store32(&P->leaf_length, BLAKE2S_OUTBYTES); ++ P->inner_length = BLAKE2S_OUTBYTES; ++ P->node_depth = 0; ++ ++ for (i = 0; outlen > 0; ++i) { ++ const size_t block_size = (outlen < BLAKE2S_OUTBYTES) ? outlen : BLAKE2S_OUTBYTES; ++ /* Initialize state */ ++ P->digest_length = block_size; ++ store32(&P->node_offset, i); ++ blake2s_init_param(C, P); ++ /* Process key if needed */ ++ blake2s_update(C, root, BLAKE2S_OUTBYTES); ++ if (blake2s_final(C, (uint8_t *)out + i * BLAKE2S_OUTBYTES, block_size) < 0) { ++ return -1; ++ } ++ outlen -= block_size; ++ } ++ secure_zero_memory(root, sizeof(root)); ++ secure_zero_memory(P, sizeof(P)); ++ secure_zero_memory(C, sizeof(C)); ++ /* Put blake2xs in an invalid state? cf. blake2s_is_lastblock */ ++ return 0; ++} ++ ++int blake2xs(void *out, size_t outlen, const void *in, size_t inlen, const void *key, size_t keylen) ++{ ++ blake2xs_state S[1]; ++ ++ /* Verify parameters */ ++ if (NULL == in && inlen > 0) ++ return -1; ++ ++ if (NULL == out) ++ return -1; ++ ++ if (NULL == key && keylen > 0) ++ return -1; ++ ++ if (keylen > BLAKE2S_KEYBYTES) ++ return -1; ++ ++ if (outlen == 0) ++ return -1; ++ ++ /* Initialize the root block structure */ ++ if (blake2xs_init_key(S, outlen, key, keylen) < 0) { ++ return -1; ++ } ++ ++ /* Absorb the input message */ ++ blake2xs_update(S, in, inlen); ++ ++ /* Compute the root node of the tree and the final hash using the counter construction */ ++ return blake2xs_final(S, out, outlen); ++} ++ ++#if defined(BLAKE2XS_SELFTEST) ++#include <string.h> ++#include "blake2-kat.h" ++int main( void ) ++{ ++ uint8_t key[BLAKE2S_KEYBYTES]; ++ uint8_t buf[BLAKE2_KAT_LENGTH]; ++ size_t i, step, outlen; ++ ++ for( i = 0; i < BLAKE2S_KEYBYTES; ++i ) { ++ key[i] = ( uint8_t )i; ++ } ++ ++ for( i = 0; i < BLAKE2_KAT_LENGTH; ++i ) { ++ buf[i] = ( uint8_t )i; ++ } ++ ++ /* Testing length of outputs rather than inputs */ ++ /* (Test of input lengths mostly covered by blake2s tests) */ ++ ++ /* Test simple API */ ++ for( outlen = 1; outlen <= BLAKE2_KAT_LENGTH; ++outlen ) ++ { ++ uint8_t hash[BLAKE2_KAT_LENGTH] = {0}; ++ if( blake2xs( hash, outlen, buf, BLAKE2_KAT_LENGTH, key, BLAKE2S_KEYBYTES ) < 0 ) { ++ goto fail; ++ } ++ ++ if( 0 != memcmp( hash, blake2xs_keyed_kat[outlen-1], outlen ) ) ++ { ++ goto fail; ++ } ++ } ++ ++ /* Test streaming API */ ++ for(step = 1; step < BLAKE2S_BLOCKBYTES; ++step) { ++ for (outlen = 1; outlen <= BLAKE2_KAT_LENGTH; ++outlen) { ++ uint8_t hash[BLAKE2_KAT_LENGTH]; ++ blake2xs_state S; ++ uint8_t * p = buf; ++ size_t mlen = BLAKE2_KAT_LENGTH; ++ int err = 0; ++ ++ if( (err = blake2xs_init_key(&S, outlen, key, BLAKE2S_KEYBYTES)) < 0 ) { ++ goto fail; ++ } ++ ++ while (mlen >= step) { ++ if ( (err = blake2xs_update(&S, p, step)) < 0 ) { ++ goto fail; ++ } ++ mlen -= step; ++ p += step; ++ } ++ if ( (err = blake2xs_update(&S, p, mlen)) < 0) { ++ goto fail; ++ } ++ if ( (err = blake2xs_final(&S, hash, outlen)) < 0) { ++ goto fail; ++ } ++ ++ if (0 != memcmp(hash, blake2xs_keyed_kat[outlen-1], outlen)) { ++ goto fail; ++ } ++ } ++ } ++ ++ puts( "ok" ); ++ return 0; ++fail: ++ puts("error"); ++ return -1; ++} ++#endif +--- thirdparty/blake2/ref/genkat-c.c.orig 2025-09-03 12:27:32 UTC ++++ thirdparty/blake2/ref/genkat-c.c +@@ -0,0 +1,139 @@ ++/* ++ BLAKE2 reference source code package - reference C implementations ++ ++ Copyright 2012, Samuel Neves <sneves@dei.uc.pt>. You may use this under the ++ terms of the CC0, the OpenSSL Licence, or the Apache Public License 2.0, at ++ your option. The terms of these licenses can be found at: ++ ++ - CC0 1.0 Universal : http://creativecommons.org/publicdomain/zero/1.0 ++ - OpenSSL license : https://www.openssl.org/source/license.html ++ - Apache 2.0 : http://www.apache.org/licenses/LICENSE-2.0 ++ ++ More information about the BLAKE2 hash function can be found at ++ https://blake2.net. ++*/ ++ ++#include <stdint.h> ++#include <stdio.h> ++#include <stdlib.h> ++#include <string.h> ++ ++#include "blake2.h" ++ ++#define STR_(x) #x ++#define STR(x) STR_(x) ++ ++#define LENGTH 256 ++ ++#define MAKE_KAT(name, size_prefix) \ ++ do { \ ++ printf("static const uint8_t " #name "_kat[BLAKE2_KAT_LENGTH][" #size_prefix \ ++ "_OUTBYTES] = \n{\n"); \ ++ \ ++ for (i = 0; i < LENGTH; ++i) { \ ++ name(hash, size_prefix##_OUTBYTES, in, i, NULL, 0); \ ++ printf("\t{\n\t\t"); \ ++ \ ++ for (j = 0; j < size_prefix##_OUTBYTES; ++j) \ ++ printf("0x%02X%s", hash[j], \ ++ (j + 1) == size_prefix##_OUTBYTES ? "\n" : j && !((j + 1) % 8) ? ",\n\t\t" : ", "); \ ++ \ ++ printf("\t},\n"); \ ++ } \ ++ \ ++ printf("};\n\n\n\n\n"); \ ++ } while (0) ++ ++#define MAKE_KEYED_KAT(name, size_prefix) \ ++ do { \ ++ printf("static const uint8_t " #name "_keyed_kat[BLAKE2_KAT_LENGTH][" #size_prefix \ ++ "_OUTBYTES] = \n{\n"); \ ++ \ ++ for (i = 0; i < LENGTH; ++i) { \ ++ name(hash, size_prefix##_OUTBYTES, in, i, key, size_prefix##_KEYBYTES); \ ++ printf("\t{\n\t\t"); \ ++ \ ++ for (j = 0; j < size_prefix##_OUTBYTES; ++j) \ ++ printf("0x%02X%s", hash[j], \ ++ (j + 1) == size_prefix##_OUTBYTES ? "\n" : j && !((j + 1) % 8) ? ",\n\t\t" : ", "); \ ++ \ ++ printf("\t},\n"); \ ++ } \ ++ \ ++ printf("};\n\n\n\n\n"); \ ++ } while (0) ++ ++#define MAKE_XOF_KAT(name) \ ++ do { \ ++ printf("static const uint8_t " #name "_kat[BLAKE2_KAT_LENGTH][BLAKE2_KAT_LENGTH] = \n{\n"); \ ++ \ ++ for (i = 1; i <= LENGTH; ++i) { \ ++ name(hash, i, in, LENGTH, NULL, 0); \ ++ printf("\t{\n\t\t"); \ ++ \ ++ for (j = 0; j < i; ++j) \ ++ printf("0x%02X%s", hash[j], \ ++ (j + 1) == LENGTH ? "\n" : j && !((j + 1) % 8) ? ",\n\t\t" : ", "); \ ++ \ ++ for (j = i; j < LENGTH; ++j) \ ++ printf("0x00%s", (j + 1) == LENGTH ? "\n" : j && !((j + 1) % 8) ? ",\n\t\t" : ", "); \ ++ \ ++ printf("\t},\n"); \ ++ } \ ++ \ ++ printf("};\n\n\n\n\n"); \ ++ } while (0) ++ ++#define MAKE_XOF_KEYED_KAT(name, size_prefix) \ ++ do { \ ++ printf("static const uint8_t " #name \ ++ "_keyed_kat[BLAKE2_KAT_LENGTH][BLAKE2_KAT_LENGTH] = \n{\n"); \ ++ \ ++ for (i = 1; i <= LENGTH; ++i) { \ ++ name(hash, i, in, LENGTH, key, size_prefix##_KEYBYTES); \ ++ printf("\t{\n\t\t"); \ ++ \ ++ for (j = 0; j < i; ++j) \ ++ printf("0x%02X%s", hash[j], \ ++ (j + 1) == LENGTH ? "\n" : j && !((j + 1) % 8) ? ",\n\t\t" : ", "); \ ++ \ ++ for (j = i; j < LENGTH; ++j) \ ++ printf("0x00%s", (j + 1) == LENGTH ? "\n" : j && !((j + 1) % 8) ? ",\n\t\t" : ", "); \ ++ \ ++ printf("\t},\n"); \ ++ } \ ++ \ ++ printf("};\n\n\n\n\n"); \ ++ } while (0) ++ ++int main() { ++ uint8_t key[64] = {0}; ++ uint8_t in[LENGTH] = {0}; ++ uint8_t hash[LENGTH] = {0}; ++ size_t i, j; ++ ++ for (i = 0; i < sizeof(in); ++i) ++ in[i] = i; ++ ++ for (i = 0; i < sizeof(key); ++i) ++ key[i] = i; ++ ++ puts("#ifndef BLAKE2_KAT_H\n" ++ "#define BLAKE2_KAT_H\n\n\n" ++ "#include <stdint.h>\n\n" ++ "#define BLAKE2_KAT_LENGTH " STR(LENGTH) "\n\n\n"); ++ MAKE_KAT(blake2s, BLAKE2S); ++ MAKE_KEYED_KAT(blake2s, BLAKE2S); ++ MAKE_KAT(blake2b, BLAKE2B); ++ MAKE_KEYED_KAT(blake2b, BLAKE2B); ++ MAKE_KAT(blake2sp, BLAKE2S); ++ MAKE_KEYED_KAT(blake2sp, BLAKE2S); ++ MAKE_KAT(blake2bp, BLAKE2B); ++ MAKE_KEYED_KAT(blake2bp, BLAKE2B); ++ MAKE_XOF_KAT(blake2xs); ++ MAKE_XOF_KEYED_KAT(blake2xs, BLAKE2S); ++ MAKE_XOF_KAT(blake2xb); ++ MAKE_XOF_KEYED_KAT(blake2xb, BLAKE2B); ++ puts("#endif"); ++ return 0; ++} +--- thirdparty/blake2/ref/genkat-json.c.orig 2025-09-03 12:27:32 UTC ++++ thirdparty/blake2/ref/genkat-json.c +@@ -0,0 +1,154 @@ ++/* ++ BLAKE2 reference source code package - reference C implementations ++ ++ Copyright 2012, Samuel Neves <sneves@dei.uc.pt>. You may use this under the ++ terms of the CC0, the OpenSSL Licence, or the Apache Public License 2.0, at ++ your option. The terms of these licenses can be found at: ++ ++ - CC0 1.0 Universal : http://creativecommons.org/publicdomain/zero/1.0 ++ - OpenSSL license : https://www.openssl.org/source/license.html ++ - Apache 2.0 : http://www.apache.org/licenses/LICENSE-2.0 ++ ++ More information about the BLAKE2 hash function can be found at ++ https://blake2.net. ++*/ ++ ++#include <stdint.h> ++#include <stdio.h> ++#include <stdlib.h> ++#include <string.h> ++ ++#include "blake2.h" ++ ++#define STR_(x) #x ++#define STR(x) STR_(x) ++ ++#define LENGTH 256 ++ ++#define MAKE_KAT(name, size_prefix, first) \ ++ do { \ ++ for (i = 0; i < LENGTH; ++i) { \ ++ printf("%s\n{\n", i == 0 && first ? "" : ","); \ ++ \ ++ printf(" \"hash\": \"" #name "\",\n"); \ ++ printf(" \"in\": \""); \ ++ for (j = 0; j < i; ++j) \ ++ printf("%02x", in[j]); \ ++ \ ++ printf("\",\n"); \ ++ printf(" \"key\": \"\",\n"); \ ++ printf(" \"out\": \""); \ ++ \ ++ name(hash, size_prefix##_OUTBYTES, in, i, NULL, 0); \ ++ \ ++ for (j = 0; j < size_prefix##_OUTBYTES; ++j) \ ++ printf("%02x", hash[j]); \ ++ printf("\"\n"); \ ++ printf("}"); \ ++ } \ ++ } while (0) ++ ++#define MAKE_KEYED_KAT(name, size_prefix, first) \ ++ do { \ ++ for (i = 0; i < LENGTH; ++i) { \ ++ printf("%s\n{\n", i == 0 && first ? "" : ","); \ ++ \ ++ printf(" \"hash\": \"" #name "\",\n"); \ ++ printf(" \"in\": \""); \ ++ for (j = 0; j < i; ++j) \ ++ printf("%02x", in[j]); \ ++ \ ++ printf("\",\n"); \ ++ printf(" \"key\": \""); \ ++ for (j = 0; j < size_prefix##_KEYBYTES; ++j) \ ++ printf("%02x", key[j]); \ ++ printf("\",\n"); \ ++ printf(" \"out\": \""); \ ++ \ ++ name(hash, size_prefix##_OUTBYTES, in, i, key, size_prefix##_KEYBYTES); \ ++ \ ++ for (j = 0; j < size_prefix##_OUTBYTES; ++j) \ ++ printf("%02x", hash[j]); \ ++ printf("\"\n"); \ ++ printf("}"); \ ++ } \ ++ } while (0) ++ ++#define MAKE_XOF_KAT(name, first) \ ++ do { \ ++ for (i = 1; i <= LENGTH; ++i) { \ ++ printf("%s\n{\n", i == 1 && first ? "" : ","); \ ++ \ ++ printf(" \"hash\": \"" #name "\",\n"); \ ++ printf(" \"in\": \""); \ ++ for (j = 0; j < LENGTH; ++j) \ ++ printf("%02x", in[j]); \ ++ \ ++ printf("\",\n"); \ ++ printf(" \"key\": \"\",\n"); \ ++ printf(" \"out\": \""); \ ++ \ ++ name(hash, i, in, LENGTH, NULL, 0); \ ++ \ ++ for (j = 0; j < i; ++j) \ ++ printf("%02x", hash[j]); \ ++ printf("\"\n"); \ ++ printf("}"); \ ++ } \ ++ } while (0) ++ ++#define MAKE_XOF_KEYED_KAT(name, size_prefix, first) \ ++ do { \ ++ for (i = 1; i <= LENGTH; ++i) { \ ++ printf("%s\n{\n", i == 1 && first ? "" : ","); \ ++ \ ++ printf(" \"hash\": \"" #name "\",\n"); \ ++ printf(" \"in\": \""); \ ++ for (j = 0; j < LENGTH; ++j) \ ++ printf("%02x", in[j]); \ ++ \ ++ printf("\",\n"); \ ++ printf(" \"key\": \""); \ ++ for (j = 0; j < size_prefix##_KEYBYTES; ++j) \ ++ printf("%02x", key[j]); \ ++ printf("\",\n"); \ ++ printf(" \"out\": \""); \ ++ \ ++ name(hash, i, in, LENGTH, key, size_prefix##_KEYBYTES); \ ++ \ ++ for (j = 0; j < i; ++j) \ ++ printf("%02x", hash[j]); \ ++ printf("\"\n"); \ ++ printf("}"); \ ++ } \ ++ } while (0) ++ ++int main() { ++ uint8_t key[64] = {0}; ++ uint8_t in[LENGTH] = {0}; ++ uint8_t hash[LENGTH] = {0}; ++ size_t i, j; ++ ++ for (i = 0; i < sizeof(in); ++i) ++ in[i] = i; ++ ++ for (i = 0; i < sizeof(key); ++i) ++ key[i] = i; ++ ++ printf("["); ++ MAKE_KAT(blake2s, BLAKE2S, 1); ++ MAKE_KEYED_KAT(blake2s, BLAKE2S, 0); ++ MAKE_KAT(blake2b, BLAKE2B, 0); ++ MAKE_KEYED_KAT(blake2b, BLAKE2B, 0); ++ MAKE_KAT(blake2sp, BLAKE2S, 0); ++ MAKE_KEYED_KAT(blake2sp, BLAKE2S, 0); ++ MAKE_KAT(blake2bp, BLAKE2B, 0); ++ MAKE_KEYED_KAT(blake2bp, BLAKE2B, 0); ++ MAKE_XOF_KAT(blake2xs, 0); ++ MAKE_XOF_KEYED_KAT(blake2xs, BLAKE2S, 0); ++ MAKE_XOF_KAT(blake2xb, 0); ++ MAKE_XOF_KEYED_KAT(blake2xb, BLAKE2B, 0); ++ printf("\n]\n"); ++ fflush(stdout); ++ return 0; ++} +--- thirdparty/blake2/ref/makefile.orig 2025-09-03 12:27:32 UTC ++++ thirdparty/blake2/ref/makefile +@@ -0,0 +1,40 @@ ++CC=gcc ++CFLAGS=-O2 -I../testvectors -Wall -Wextra -std=c89 -pedantic -Wno-long-long ++BLAKEBINS=blake2s blake2b blake2sp blake2bp blake2xs blake2xb ++ ++all: $(BLAKEBINS) check ++ ++blake2s: blake2s-ref.c ++ $(CC) blake2s-ref.c -o $@ $(CFLAGS) -DBLAKE2S_SELFTEST ++ ++blake2b: blake2b-ref.c ++ $(CC) blake2b-ref.c -o $@ $(CFLAGS) -DBLAKE2B_SELFTEST ++ ++blake2sp: blake2sp-ref.c blake2s-ref.c ++ $(CC) blake2sp-ref.c blake2s-ref.c -o $@ $(CFLAGS) -DBLAKE2SP_SELFTEST ++ ++blake2bp: blake2bp-ref.c blake2b-ref.c ++ $(CC) blake2bp-ref.c blake2b-ref.c -o $@ $(CFLAGS) -DBLAKE2BP_SELFTEST ++ ++blake2xs: blake2xs-ref.c blake2s-ref.c ++ $(CC) blake2xs-ref.c blake2s-ref.c -o $@ $(CFLAGS) -DBLAKE2XS_SELFTEST ++ ++blake2xb: blake2xb-ref.c blake2b-ref.c ++ $(CC) blake2xb-ref.c blake2b-ref.c -o $@ $(CFLAGS) -DBLAKE2XB_SELFTEST ++ ++check: blake2s blake2b blake2sp blake2bp blake2xs blake2xb ++ ./blake2s ++ ./blake2b ++ ./blake2sp ++ ./blake2bp ++ ./blake2xs ++ ./blake2xb ++ ++kat: ++ $(CC) $(CFLAGS) -o genkat-c genkat-c.c blake2b-ref.c blake2s-ref.c blake2sp-ref.c blake2bp-ref.c blake2xs-ref.c blake2xb-ref.c ++ $(CC) $(CFLAGS) -o genkat-json genkat-json.c blake2b-ref.c blake2s-ref.c blake2sp-ref.c blake2bp-ref.c blake2xs-ref.c blake2xb-ref.c ++ ./genkat-c > blake2-kat.h ++ ./genkat-json > blake2-kat.json ++ ++clean: ++ rm -rf *.o genkat-c genkat-json blake2-kat.h blake2-kat.json $(BLAKEBINS) +--- thirdparty/blake2/sse/blake2-config.h.orig 2025-09-03 12:27:32 UTC ++++ thirdparty/blake2/sse/blake2-config.h +@@ -0,0 +1,72 @@ ++/* ++ BLAKE2 reference source code package - optimized C implementations ++ ++ Copyright 2012, Samuel Neves <sneves@dei.uc.pt>. You may use this under the ++ terms of the CC0, the OpenSSL Licence, or the Apache Public License 2.0, at ++ your option. The terms of these licenses can be found at: ++ ++ - CC0 1.0 Universal : http://creativecommons.org/publicdomain/zero/1.0 ++ - OpenSSL license : https://www.openssl.org/source/license.html ++ - Apache 2.0 : http://www.apache.org/licenses/LICENSE-2.0 ++ ++ More information about the BLAKE2 hash function can be found at ++ https://blake2.net. ++*/ ++#ifndef BLAKE2_CONFIG_H ++#define BLAKE2_CONFIG_H ++ ++/* These don't work everywhere */ ++#if defined(__SSE2__) || defined(__x86_64__) || defined(__amd64__) ++#define HAVE_SSE2 ++#endif ++ ++#if defined(__SSSE3__) ++#define HAVE_SSSE3 ++#endif ++ ++#if defined(__SSE4_1__) ++#define HAVE_SSE41 ++#endif ++ ++#if defined(__AVX__) ++#define HAVE_AVX ++#endif ++ ++#if defined(__XOP__) ++#define HAVE_XOP ++#endif ++ ++ ++#ifdef HAVE_AVX2 ++#ifndef HAVE_AVX ++#define HAVE_AVX ++#endif ++#endif ++ ++#ifdef HAVE_XOP ++#ifndef HAVE_AVX ++#define HAVE_AVX ++#endif ++#endif ++ ++#ifdef HAVE_AVX ++#ifndef HAVE_SSE41 ++#define HAVE_SSE41 ++#endif ++#endif ++ ++#ifdef HAVE_SSE41 ++#ifndef HAVE_SSSE3 ++#define HAVE_SSSE3 ++#endif ++#endif ++ ++#ifdef HAVE_SSSE3 ++#define HAVE_SSE2 ++#endif ++ ++#if !defined(HAVE_SSE2) ++#error "This code requires at least SSE2." ++#endif ++ ++#endif +--- thirdparty/blake2/sse/blake2-impl.h.orig 2025-09-03 12:27:32 UTC ++++ thirdparty/blake2/sse/blake2-impl.h +@@ -0,0 +1,160 @@ ++/* ++ BLAKE2 reference source code package - reference C implementations ++ ++ Copyright 2012, Samuel Neves <sneves@dei.uc.pt>. You may use this under the ++ terms of the CC0, the OpenSSL Licence, or the Apache Public License 2.0, at ++ your option. The terms of these licenses can be found at: ++ ++ - CC0 1.0 Universal : http://creativecommons.org/publicdomain/zero/1.0 ++ - OpenSSL license : https://www.openssl.org/source/license.html ++ - Apache 2.0 : http://www.apache.org/licenses/LICENSE-2.0 ++ ++ More information about the BLAKE2 hash function can be found at ++ https://blake2.net. ++*/ ++#ifndef BLAKE2_IMPL_H ++#define BLAKE2_IMPL_H ++ ++#include <stdint.h> ++#include <string.h> ++ ++#if !defined(__cplusplus) && (!defined(__STDC_VERSION__) || __STDC_VERSION__ < 199901L) ++ #if defined(_MSC_VER) ++ #define BLAKE2_INLINE __inline ++ #elif defined(__GNUC__) ++ #define BLAKE2_INLINE __inline__ ++ #else ++ #define BLAKE2_INLINE ++ #endif ++#else ++ #define BLAKE2_INLINE inline ++#endif ++ ++static BLAKE2_INLINE uint32_t load32( const void *src ) ++{ ++#if defined(NATIVE_LITTLE_ENDIAN) ++ uint32_t w; ++ memcpy(&w, src, sizeof w); ++ return w; ++#else ++ const uint8_t *p = ( const uint8_t * )src; ++ return (( uint32_t )( p[0] ) << 0) | ++ (( uint32_t )( p[1] ) << 8) | ++ (( uint32_t )( p[2] ) << 16) | ++ (( uint32_t )( p[3] ) << 24) ; ++#endif ++} ++ ++static BLAKE2_INLINE uint64_t load64( const void *src ) ++{ ++#if defined(NATIVE_LITTLE_ENDIAN) ++ uint64_t w; ++ memcpy(&w, src, sizeof w); ++ return w; ++#else ++ const uint8_t *p = ( const uint8_t * )src; ++ return (( uint64_t )( p[0] ) << 0) | ++ (( uint64_t )( p[1] ) << 8) | ++ (( uint64_t )( p[2] ) << 16) | ++ (( uint64_t )( p[3] ) << 24) | ++ (( uint64_t )( p[4] ) << 32) | ++ (( uint64_t )( p[5] ) << 40) | ++ (( uint64_t )( p[6] ) << 48) | ++ (( uint64_t )( p[7] ) << 56) ; ++#endif ++} ++ ++static BLAKE2_INLINE uint16_t load16( const void *src ) ++{ ++#if defined(NATIVE_LITTLE_ENDIAN) ++ uint16_t w; ++ memcpy(&w, src, sizeof w); ++ return w; ++#else ++ const uint8_t *p = ( const uint8_t * )src; ++ return (( uint16_t )( p[0] ) << 0) | ++ (( uint16_t )( p[1] ) << 8) ; ++#endif ++} ++ ++static BLAKE2_INLINE void store16( void *dst, uint16_t w ) ++{ ++#if defined(NATIVE_LITTLE_ENDIAN) ++ memcpy(dst, &w, sizeof w); ++#else ++ uint8_t *p = ( uint8_t * )dst; ++ *p++ = ( uint8_t )w; w >>= 8; ++ *p++ = ( uint8_t )w; ++#endif ++} ++ ++static BLAKE2_INLINE void store32( void *dst, uint32_t w ) ++{ ++#if defined(NATIVE_LITTLE_ENDIAN) ++ memcpy(dst, &w, sizeof w); ++#else ++ uint8_t *p = ( uint8_t * )dst; ++ p[0] = (uint8_t)(w >> 0); ++ p[1] = (uint8_t)(w >> 8); ++ p[2] = (uint8_t)(w >> 16); ++ p[3] = (uint8_t)(w >> 24); ++#endif ++} ++ ++static BLAKE2_INLINE void store64( void *dst, uint64_t w ) ++{ ++#if defined(NATIVE_LITTLE_ENDIAN) ++ memcpy(dst, &w, sizeof w); ++#else ++ uint8_t *p = ( uint8_t * )dst; ++ p[0] = (uint8_t)(w >> 0); ++ p[1] = (uint8_t)(w >> 8); ++ p[2] = (uint8_t)(w >> 16); ++ p[3] = (uint8_t)(w >> 24); ++ p[4] = (uint8_t)(w >> 32); ++ p[5] = (uint8_t)(w >> 40); ++ p[6] = (uint8_t)(w >> 48); ++ p[7] = (uint8_t)(w >> 56); ++#endif ++} ++ ++static BLAKE2_INLINE uint64_t load48( const void *src ) ++{ ++ const uint8_t *p = ( const uint8_t * )src; ++ return (( uint64_t )( p[0] ) << 0) | ++ (( uint64_t )( p[1] ) << 8) | ++ (( uint64_t )( p[2] ) << 16) | ++ (( uint64_t )( p[3] ) << 24) | ++ (( uint64_t )( p[4] ) << 32) | ++ (( uint64_t )( p[5] ) << 40) ; ++} ++ ++static BLAKE2_INLINE void store48( void *dst, uint64_t w ) ++{ ++ uint8_t *p = ( uint8_t * )dst; ++ p[0] = (uint8_t)(w >> 0); ++ p[1] = (uint8_t)(w >> 8); ++ p[2] = (uint8_t)(w >> 16); ++ p[3] = (uint8_t)(w >> 24); ++ p[4] = (uint8_t)(w >> 32); ++ p[5] = (uint8_t)(w >> 40); ++} ++ ++static BLAKE2_INLINE uint32_t rotr32( const uint32_t w, const unsigned c ) ++{ ++ return ( w >> c ) | ( w << ( 32 - c ) ); ++} ++ ++static BLAKE2_INLINE uint64_t rotr64( const uint64_t w, const unsigned c ) ++{ ++ return ( w >> c ) | ( w << ( 64 - c ) ); ++} ++ ++/* prevents compiler optimizing out memset() */ ++static BLAKE2_INLINE void secure_zero_memory(void *v, size_t n) ++{ ++ static void *(*const volatile memset_v)(void *, int, size_t) = &memset; ++ memset_v(v, 0, n); ++} ++ ++#endif +--- thirdparty/blake2/sse/blake2.h.orig 2025-09-03 12:27:32 UTC ++++ thirdparty/blake2/sse/blake2.h +@@ -0,0 +1,195 @@ ++/* ++ BLAKE2 reference source code package - reference C implementations ++ ++ Copyright 2012, Samuel Neves <sneves@dei.uc.pt>. You may use this under the ++ terms of the CC0, the OpenSSL Licence, or the Apache Public License 2.0, at ++ your option. The terms of these licenses can be found at: ++ ++ - CC0 1.0 Universal : http://creativecommons.org/publicdomain/zero/1.0 ++ - OpenSSL license : https://www.openssl.org/source/license.html ++ - Apache 2.0 : http://www.apache.org/licenses/LICENSE-2.0 ++ ++ More information about the BLAKE2 hash function can be found at ++ https://blake2.net. ++*/ ++#ifndef BLAKE2_H ++#define BLAKE2_H ++ ++#include <stddef.h> ++#include <stdint.h> ++ ++#if defined(_MSC_VER) ++#define BLAKE2_PACKED(x) __pragma(pack(push, 1)) x __pragma(pack(pop)) ++#else ++#define BLAKE2_PACKED(x) x __attribute__((packed)) ++#endif ++ ++#if defined(__cplusplus) ++extern "C" { ++#endif ++ ++ enum blake2s_constant ++ { ++ BLAKE2S_BLOCKBYTES = 64, ++ BLAKE2S_OUTBYTES = 32, ++ BLAKE2S_KEYBYTES = 32, ++ BLAKE2S_SALTBYTES = 8, ++ BLAKE2S_PERSONALBYTES = 8 ++ }; ++ ++ enum blake2b_constant ++ { ++ BLAKE2B_BLOCKBYTES = 128, ++ BLAKE2B_OUTBYTES = 64, ++ BLAKE2B_KEYBYTES = 64, ++ BLAKE2B_SALTBYTES = 16, ++ BLAKE2B_PERSONALBYTES = 16 ++ }; ++ ++ typedef struct blake2s_state__ ++ { ++ uint32_t h[8]; ++ uint32_t t[2]; ++ uint32_t f[2]; ++ uint8_t buf[BLAKE2S_BLOCKBYTES]; ++ size_t buflen; ++ size_t outlen; ++ uint8_t last_node; ++ } blake2s_state; ++ ++ typedef struct blake2b_state__ ++ { ++ uint64_t h[8]; ++ uint64_t t[2]; ++ uint64_t f[2]; ++ uint8_t buf[BLAKE2B_BLOCKBYTES]; ++ size_t buflen; ++ size_t outlen; ++ uint8_t last_node; ++ } blake2b_state; ++ ++ typedef struct blake2sp_state__ ++ { ++ blake2s_state S[8][1]; ++ blake2s_state R[1]; ++ uint8_t buf[8 * BLAKE2S_BLOCKBYTES]; ++ size_t buflen; ++ size_t outlen; ++ } blake2sp_state; ++ ++ typedef struct blake2bp_state__ ++ { ++ blake2b_state S[4][1]; ++ blake2b_state R[1]; ++ uint8_t buf[4 * BLAKE2B_BLOCKBYTES]; ++ size_t buflen; ++ size_t outlen; ++ } blake2bp_state; ++ ++ ++ BLAKE2_PACKED(struct blake2s_param__ ++ { ++ uint8_t digest_length; /* 1 */ ++ uint8_t key_length; /* 2 */ ++ uint8_t fanout; /* 3 */ ++ uint8_t depth; /* 4 */ ++ uint32_t leaf_length; /* 8 */ ++ uint32_t node_offset; /* 12 */ ++ uint16_t xof_length; /* 14 */ ++ uint8_t node_depth; /* 15 */ ++ uint8_t inner_length; /* 16 */ ++ /* uint8_t reserved[0]; */ ++ uint8_t salt[BLAKE2S_SALTBYTES]; /* 24 */ ++ uint8_t personal[BLAKE2S_PERSONALBYTES]; /* 32 */ ++ }); ++ ++ typedef struct blake2s_param__ blake2s_param; ++ ++ BLAKE2_PACKED(struct blake2b_param__ ++ { ++ uint8_t digest_length; /* 1 */ ++ uint8_t key_length; /* 2 */ ++ uint8_t fanout; /* 3 */ ++ uint8_t depth; /* 4 */ ++ uint32_t leaf_length; /* 8 */ ++ uint32_t node_offset; /* 12 */ ++ uint32_t xof_length; /* 16 */ ++ uint8_t node_depth; /* 17 */ ++ uint8_t inner_length; /* 18 */ ++ uint8_t reserved[14]; /* 32 */ ++ uint8_t salt[BLAKE2B_SALTBYTES]; /* 48 */ ++ uint8_t personal[BLAKE2B_PERSONALBYTES]; /* 64 */ ++ }); ++ ++ typedef struct blake2b_param__ blake2b_param; ++ ++ typedef struct blake2xs_state__ ++ { ++ blake2s_state S[1]; ++ blake2s_param P[1]; ++ } blake2xs_state; ++ ++ typedef struct blake2xb_state__ ++ { ++ blake2b_state S[1]; ++ blake2b_param P[1]; ++ } blake2xb_state; ++ ++ /* Padded structs result in a compile-time error */ ++ enum { ++ BLAKE2_DUMMY_1 = 1/(sizeof(blake2s_param) == BLAKE2S_OUTBYTES), ++ BLAKE2_DUMMY_2 = 1/(sizeof(blake2b_param) == BLAKE2B_OUTBYTES) ++ }; ++ ++ /* Streaming API */ ++ int blake2s_init( blake2s_state *S, size_t outlen ); ++ int blake2s_init_key( blake2s_state *S, size_t outlen, const void *key, size_t keylen ); ++ int blake2s_init_param( blake2s_state *S, const blake2s_param *P ); ++ int blake2s_update( blake2s_state *S, const void *in, size_t inlen ); ++ int blake2s_final( blake2s_state *S, void *out, size_t outlen ); ++ ++ int blake2b_init( blake2b_state *S, size_t outlen ); ++ int blake2b_init_key( blake2b_state *S, size_t outlen, const void *key, size_t keylen ); ++ int blake2b_init_param( blake2b_state *S, const blake2b_param *P ); ++ int blake2b_update( blake2b_state *S, const void *in, size_t inlen ); ++ int blake2b_final( blake2b_state *S, void *out, size_t outlen ); ++ ++ int blake2sp_init( blake2sp_state *S, size_t outlen ); ++ int blake2sp_init_key( blake2sp_state *S, size_t outlen, const void *key, size_t keylen ); ++ int blake2sp_update( blake2sp_state *S, const void *in, size_t inlen ); ++ int blake2sp_final( blake2sp_state *S, void *out, size_t outlen ); ++ ++ int blake2bp_init( blake2bp_state *S, size_t outlen ); ++ int blake2bp_init_key( blake2bp_state *S, size_t outlen, const void *key, size_t keylen ); ++ int blake2bp_update( blake2bp_state *S, const void *in, size_t inlen ); ++ int blake2bp_final( blake2bp_state *S, void *out, size_t outlen ); ++ ++ /* Variable output length API */ ++ int blake2xs_init( blake2xs_state *S, const size_t outlen ); ++ int blake2xs_init_key( blake2xs_state *S, const size_t outlen, const void *key, size_t keylen ); ++ int blake2xs_update( blake2xs_state *S, const void *in, size_t inlen ); ++ int blake2xs_final(blake2xs_state *S, void *out, size_t outlen); ++ ++ int blake2xb_init( blake2xb_state *S, const size_t outlen ); ++ int blake2xb_init_key( blake2xb_state *S, const size_t outlen, const void *key, size_t keylen ); ++ int blake2xb_update( blake2xb_state *S, const void *in, size_t inlen ); ++ int blake2xb_final(blake2xb_state *S, void *out, size_t outlen); ++ ++ /* Simple API */ ++ int blake2s( void *out, size_t outlen, const void *in, size_t inlen, const void *key, size_t keylen ); ++ int blake2b( void *out, size_t outlen, const void *in, size_t inlen, const void *key, size_t keylen ); ++ ++ int blake2sp( void *out, size_t outlen, const void *in, size_t inlen, const void *key, size_t keylen ); ++ int blake2bp( void *out, size_t outlen, const void *in, size_t inlen, const void *key, size_t keylen ); ++ ++ int blake2xs( void *out, size_t outlen, const void *in, size_t inlen, const void *key, size_t keylen ); ++ int blake2xb( void *out, size_t outlen, const void *in, size_t inlen, const void *key, size_t keylen ); ++ ++ /* This is simply an alias for blake2b */ ++ int blake2( void *out, size_t outlen, const void *in, size_t inlen, const void *key, size_t keylen ); ++ ++#if defined(__cplusplus) ++} ++#endif ++ ++#endif +--- thirdparty/blake2/sse/blake2b-load-sse2.h.orig 2025-09-03 12:27:32 UTC ++++ thirdparty/blake2/sse/blake2b-load-sse2.h +@@ -0,0 +1,68 @@ ++/* ++ BLAKE2 reference source code package - optimized C implementations ++ ++ Copyright 2012, Samuel Neves <sneves@dei.uc.pt>. You may use this under the ++ terms of the CC0, the OpenSSL Licence, or the Apache Public License 2.0, at ++ your option. The terms of these licenses can be found at: ++ ++ - CC0 1.0 Universal : http://creativecommons.org/publicdomain/zero/1.0 ++ - OpenSSL license : https://www.openssl.org/source/license.html ++ - Apache 2.0 : http://www.apache.org/licenses/LICENSE-2.0 ++ ++ More information about the BLAKE2 hash function can be found at ++ https://blake2.net. ++*/ ++#ifndef BLAKE2B_LOAD_SSE2_H ++#define BLAKE2B_LOAD_SSE2_H ++ ++#define LOAD_MSG_0_1(b0, b1) b0 = _mm_set_epi64x(m2, m0); b1 = _mm_set_epi64x(m6, m4) ++#define LOAD_MSG_0_2(b0, b1) b0 = _mm_set_epi64x(m3, m1); b1 = _mm_set_epi64x(m7, m5) ++#define LOAD_MSG_0_3(b0, b1) b0 = _mm_set_epi64x(m10, m8); b1 = _mm_set_epi64x(m14, m12) ++#define LOAD_MSG_0_4(b0, b1) b0 = _mm_set_epi64x(m11, m9); b1 = _mm_set_epi64x(m15, m13) ++#define LOAD_MSG_1_1(b0, b1) b0 = _mm_set_epi64x(m4, m14); b1 = _mm_set_epi64x(m13, m9) ++#define LOAD_MSG_1_2(b0, b1) b0 = _mm_set_epi64x(m8, m10); b1 = _mm_set_epi64x(m6, m15) ++#define LOAD_MSG_1_3(b0, b1) b0 = _mm_set_epi64x(m0, m1); b1 = _mm_set_epi64x(m5, m11) ++#define LOAD_MSG_1_4(b0, b1) b0 = _mm_set_epi64x(m2, m12); b1 = _mm_set_epi64x(m3, m7) ++#define LOAD_MSG_2_1(b0, b1) b0 = _mm_set_epi64x(m12, m11); b1 = _mm_set_epi64x(m15, m5) ++#define LOAD_MSG_2_2(b0, b1) b0 = _mm_set_epi64x(m0, m8); b1 = _mm_set_epi64x(m13, m2) ++#define LOAD_MSG_2_3(b0, b1) b0 = _mm_set_epi64x(m3, m10); b1 = _mm_set_epi64x(m9, m7) ++#define LOAD_MSG_2_4(b0, b1) b0 = _mm_set_epi64x(m6, m14); b1 = _mm_set_epi64x(m4, m1) ++#define LOAD_MSG_3_1(b0, b1) b0 = _mm_set_epi64x(m3, m7); b1 = _mm_set_epi64x(m11, m13) ++#define LOAD_MSG_3_2(b0, b1) b0 = _mm_set_epi64x(m1, m9); b1 = _mm_set_epi64x(m14, m12) ++#define LOAD_MSG_3_3(b0, b1) b0 = _mm_set_epi64x(m5, m2); b1 = _mm_set_epi64x(m15, m4) ++#define LOAD_MSG_3_4(b0, b1) b0 = _mm_set_epi64x(m10, m6); b1 = _mm_set_epi64x(m8, m0) ++#define LOAD_MSG_4_1(b0, b1) b0 = _mm_set_epi64x(m5, m9); b1 = _mm_set_epi64x(m10, m2) ++#define LOAD_MSG_4_2(b0, b1) b0 = _mm_set_epi64x(m7, m0); b1 = _mm_set_epi64x(m15, m4) ++#define LOAD_MSG_4_3(b0, b1) b0 = _mm_set_epi64x(m11, m14); b1 = _mm_set_epi64x(m3, m6) ++#define LOAD_MSG_4_4(b0, b1) b0 = _mm_set_epi64x(m12, m1); b1 = _mm_set_epi64x(m13, m8) ++#define LOAD_MSG_5_1(b0, b1) b0 = _mm_set_epi64x(m6, m2); b1 = _mm_set_epi64x(m8, m0) ++#define LOAD_MSG_5_2(b0, b1) b0 = _mm_set_epi64x(m10, m12); b1 = _mm_set_epi64x(m3, m11) ++#define LOAD_MSG_5_3(b0, b1) b0 = _mm_set_epi64x(m7, m4); b1 = _mm_set_epi64x(m1, m15) ++#define LOAD_MSG_5_4(b0, b1) b0 = _mm_set_epi64x(m5, m13); b1 = _mm_set_epi64x(m9, m14) ++#define LOAD_MSG_6_1(b0, b1) b0 = _mm_set_epi64x(m1, m12); b1 = _mm_set_epi64x(m4, m14) ++#define LOAD_MSG_6_2(b0, b1) b0 = _mm_set_epi64x(m15, m5); b1 = _mm_set_epi64x(m10, m13) ++#define LOAD_MSG_6_3(b0, b1) b0 = _mm_set_epi64x(m6, m0); b1 = _mm_set_epi64x(m8, m9) ++#define LOAD_MSG_6_4(b0, b1) b0 = _mm_set_epi64x(m3, m7); b1 = _mm_set_epi64x(m11, m2) ++#define LOAD_MSG_7_1(b0, b1) b0 = _mm_set_epi64x(m7, m13); b1 = _mm_set_epi64x(m3, m12) ++#define LOAD_MSG_7_2(b0, b1) b0 = _mm_set_epi64x(m14, m11); b1 = _mm_set_epi64x(m9, m1) ++#define LOAD_MSG_7_3(b0, b1) b0 = _mm_set_epi64x(m15, m5); b1 = _mm_set_epi64x(m2, m8) ++#define LOAD_MSG_7_4(b0, b1) b0 = _mm_set_epi64x(m4, m0); b1 = _mm_set_epi64x(m10, m6) ++#define LOAD_MSG_8_1(b0, b1) b0 = _mm_set_epi64x(m14, m6); b1 = _mm_set_epi64x(m0, m11) ++#define LOAD_MSG_8_2(b0, b1) b0 = _mm_set_epi64x(m9, m15); b1 = _mm_set_epi64x(m8, m3) ++#define LOAD_MSG_8_3(b0, b1) b0 = _mm_set_epi64x(m13, m12); b1 = _mm_set_epi64x(m10, m1) ++#define LOAD_MSG_8_4(b0, b1) b0 = _mm_set_epi64x(m7, m2); b1 = _mm_set_epi64x(m5, m4) ++#define LOAD_MSG_9_1(b0, b1) b0 = _mm_set_epi64x(m8, m10); b1 = _mm_set_epi64x(m1, m7) ++#define LOAD_MSG_9_2(b0, b1) b0 = _mm_set_epi64x(m4, m2); b1 = _mm_set_epi64x(m5, m6) ++#define LOAD_MSG_9_3(b0, b1) b0 = _mm_set_epi64x(m9, m15); b1 = _mm_set_epi64x(m13, m3) ++#define LOAD_MSG_9_4(b0, b1) b0 = _mm_set_epi64x(m14, m11); b1 = _mm_set_epi64x(m0, m12) ++#define LOAD_MSG_10_1(b0, b1) b0 = _mm_set_epi64x(m2, m0); b1 = _mm_set_epi64x(m6, m4) ++#define LOAD_MSG_10_2(b0, b1) b0 = _mm_set_epi64x(m3, m1); b1 = _mm_set_epi64x(m7, m5) ++#define LOAD_MSG_10_3(b0, b1) b0 = _mm_set_epi64x(m10, m8); b1 = _mm_set_epi64x(m14, m12) ++#define LOAD_MSG_10_4(b0, b1) b0 = _mm_set_epi64x(m11, m9); b1 = _mm_set_epi64x(m15, m13) ++#define LOAD_MSG_11_1(b0, b1) b0 = _mm_set_epi64x(m4, m14); b1 = _mm_set_epi64x(m13, m9) ++#define LOAD_MSG_11_2(b0, b1) b0 = _mm_set_epi64x(m8, m10); b1 = _mm_set_epi64x(m6, m15) ++#define LOAD_MSG_11_3(b0, b1) b0 = _mm_set_epi64x(m0, m1); b1 = _mm_set_epi64x(m5, m11) ++#define LOAD_MSG_11_4(b0, b1) b0 = _mm_set_epi64x(m2, m12); b1 = _mm_set_epi64x(m3, m7) ++ ++ ++#endif +--- thirdparty/blake2/sse/blake2b-load-sse41.h.orig 2025-09-03 12:27:32 UTC ++++ thirdparty/blake2/sse/blake2b-load-sse41.h +@@ -0,0 +1,402 @@ ++/* ++ BLAKE2 reference source code package - optimized C implementations ++ ++ Copyright 2012, Samuel Neves <sneves@dei.uc.pt>. You may use this under the ++ terms of the CC0, the OpenSSL Licence, or the Apache Public License 2.0, at ++ your option. The terms of these licenses can be found at: ++ ++ - CC0 1.0 Universal : http://creativecommons.org/publicdomain/zero/1.0 ++ - OpenSSL license : https://www.openssl.org/source/license.html ++ - Apache 2.0 : http://www.apache.org/licenses/LICENSE-2.0 ++ ++ More information about the BLAKE2 hash function can be found at ++ https://blake2.net. ++*/ ++#ifndef BLAKE2B_LOAD_SSE41_H ++#define BLAKE2B_LOAD_SSE41_H ++ ++#define LOAD_MSG_0_1(b0, b1) \ ++do \ ++{ \ ++b0 = _mm_unpacklo_epi64(m0, m1); \ ++b1 = _mm_unpacklo_epi64(m2, m3); \ ++} while(0) ++ ++ ++#define LOAD_MSG_0_2(b0, b1) \ ++do \ ++{ \ ++b0 = _mm_unpackhi_epi64(m0, m1); \ ++b1 = _mm_unpackhi_epi64(m2, m3); \ ++} while(0) ++ ++ ++#define LOAD_MSG_0_3(b0, b1) \ ++do \ ++{ \ ++b0 = _mm_unpacklo_epi64(m4, m5); \ ++b1 = _mm_unpacklo_epi64(m6, m7); \ ++} while(0) ++ ++ ++#define LOAD_MSG_0_4(b0, b1) \ ++do \ ++{ \ ++b0 = _mm_unpackhi_epi64(m4, m5); \ ++b1 = _mm_unpackhi_epi64(m6, m7); \ ++} while(0) ++ ++ ++#define LOAD_MSG_1_1(b0, b1) \ ++do \ ++{ \ ++b0 = _mm_unpacklo_epi64(m7, m2); \ ++b1 = _mm_unpackhi_epi64(m4, m6); \ ++} while(0) ++ ++ ++#define LOAD_MSG_1_2(b0, b1) \ ++do \ ++{ \ ++b0 = _mm_unpacklo_epi64(m5, m4); \ ++b1 = _mm_alignr_epi8(m3, m7, 8); \ ++} while(0) ++ ++ ++#define LOAD_MSG_1_3(b0, b1) \ ++do \ ++{ \ ++b0 = _mm_shuffle_epi32(m0, _MM_SHUFFLE(1,0,3,2)); \ ++b1 = _mm_unpackhi_epi64(m5, m2); \ ++} while(0) ++ ++ ++#define LOAD_MSG_1_4(b0, b1) \ ++do \ ++{ \ ++b0 = _mm_unpacklo_epi64(m6, m1); \ ++b1 = _mm_unpackhi_epi64(m3, m1); \ ++} while(0) ++ ++ ++#define LOAD_MSG_2_1(b0, b1) \ ++do \ ++{ \ ++b0 = _mm_alignr_epi8(m6, m5, 8); \ ++b1 = _mm_unpackhi_epi64(m2, m7); \ ++} while(0) ++ ++ ++#define LOAD_MSG_2_2(b0, b1) \ ++do \ ++{ \ ++b0 = _mm_unpacklo_epi64(m4, m0); \ ++b1 = _mm_blend_epi16(m1, m6, 0xF0); \ ++} while(0) ++ ++ ++#define LOAD_MSG_2_3(b0, b1) \ ++do \ ++{ \ ++b0 = _mm_blend_epi16(m5, m1, 0xF0); \ ++b1 = _mm_unpackhi_epi64(m3, m4); \ ++} while(0) ++ ++ ++#define LOAD_MSG_2_4(b0, b1) \ ++do \ ++{ \ ++b0 = _mm_unpacklo_epi64(m7, m3); \ ++b1 = _mm_alignr_epi8(m2, m0, 8); \ ++} while(0) ++ ++ ++#define LOAD_MSG_3_1(b0, b1) \ ++do \ ++{ \ ++b0 = _mm_unpackhi_epi64(m3, m1); \ ++b1 = _mm_unpackhi_epi64(m6, m5); \ ++} while(0) ++ ++ ++#define LOAD_MSG_3_2(b0, b1) \ ++do \ ++{ \ ++b0 = _mm_unpackhi_epi64(m4, m0); \ ++b1 = _mm_unpacklo_epi64(m6, m7); \ ++} while(0) ++ ++ ++#define LOAD_MSG_3_3(b0, b1) \ ++do \ ++{ \ ++b0 = _mm_blend_epi16(m1, m2, 0xF0); \ ++b1 = _mm_blend_epi16(m2, m7, 0xF0); \ ++} while(0) ++ ++ ++#define LOAD_MSG_3_4(b0, b1) \ ++do \ ++{ \ ++b0 = _mm_unpacklo_epi64(m3, m5); \ ++b1 = _mm_unpacklo_epi64(m0, m4); \ ++} while(0) ++ ++ ++#define LOAD_MSG_4_1(b0, b1) \ ++do \ ++{ \ ++b0 = _mm_unpackhi_epi64(m4, m2); \ ++b1 = _mm_unpacklo_epi64(m1, m5); \ ++} while(0) ++ ++ ++#define LOAD_MSG_4_2(b0, b1) \ ++do \ ++{ \ ++b0 = _mm_blend_epi16(m0, m3, 0xF0); \ ++b1 = _mm_blend_epi16(m2, m7, 0xF0); \ ++} while(0) ++ ++ ++#define LOAD_MSG_4_3(b0, b1) \ ++do \ ++{ \ ++b0 = _mm_blend_epi16(m7, m5, 0xF0); \ ++b1 = _mm_blend_epi16(m3, m1, 0xF0); \ ++} while(0) ++ ++ ++#define LOAD_MSG_4_4(b0, b1) \ ++do \ ++{ \ ++b0 = _mm_alignr_epi8(m6, m0, 8); \ ++b1 = _mm_blend_epi16(m4, m6, 0xF0); \ ++} while(0) ++ ++ ++#define LOAD_MSG_5_1(b0, b1) \ ++do \ ++{ \ ++b0 = _mm_unpacklo_epi64(m1, m3); \ ++b1 = _mm_unpacklo_epi64(m0, m4); \ ++} while(0) ++ ++ ++#define LOAD_MSG_5_2(b0, b1) \ ++do \ ++{ \ ++b0 = _mm_unpacklo_epi64(m6, m5); \ ++b1 = _mm_unpackhi_epi64(m5, m1); \ ++} while(0) ++ ++ ++#define LOAD_MSG_5_3(b0, b1) \ ++do \ ++{ \ ++b0 = _mm_blend_epi16(m2, m3, 0xF0); \ ++b1 = _mm_unpackhi_epi64(m7, m0); \ ++} while(0) ++ ++ ++#define LOAD_MSG_5_4(b0, b1) \ ++do \ ++{ \ ++b0 = _mm_unpackhi_epi64(m6, m2); \ ++b1 = _mm_blend_epi16(m7, m4, 0xF0); \ ++} while(0) ++ ++ ++#define LOAD_MSG_6_1(b0, b1) \ ++do \ ++{ \ ++b0 = _mm_blend_epi16(m6, m0, 0xF0); \ ++b1 = _mm_unpacklo_epi64(m7, m2); \ ++} while(0) ++ ++ ++#define LOAD_MSG_6_2(b0, b1) \ ++do \ ++{ \ ++b0 = _mm_unpackhi_epi64(m2, m7); \ ++b1 = _mm_alignr_epi8(m5, m6, 8); \ ++} while(0) ++ ++ ++#define LOAD_MSG_6_3(b0, b1) \ ++do \ ++{ \ ++b0 = _mm_unpacklo_epi64(m0, m3); \ ++b1 = _mm_shuffle_epi32(m4, _MM_SHUFFLE(1,0,3,2)); \ ++} while(0) ++ ++ ++#define LOAD_MSG_6_4(b0, b1) \ ++do \ ++{ \ ++b0 = _mm_unpackhi_epi64(m3, m1); \ ++b1 = _mm_blend_epi16(m1, m5, 0xF0); \ ++} while(0) ++ ++ ++#define LOAD_MSG_7_1(b0, b1) \ ++do \ ++{ \ ++b0 = _mm_unpackhi_epi64(m6, m3); \ ++b1 = _mm_blend_epi16(m6, m1, 0xF0); \ ++} while(0) ++ ++ ++#define LOAD_MSG_7_2(b0, b1) \ ++do \ ++{ \ ++b0 = _mm_alignr_epi8(m7, m5, 8); \ ++b1 = _mm_unpackhi_epi64(m0, m4); \ ++} while(0) ++ ++ ++#define LOAD_MSG_7_3(b0, b1) \ ++do \ ++{ \ ++b0 = _mm_unpackhi_epi64(m2, m7); \ ++b1 = _mm_unpacklo_epi64(m4, m1); \ ++} while(0) ++ ++ ++#define LOAD_MSG_7_4(b0, b1) \ ++do \ ++{ \ ++b0 = _mm_unpacklo_epi64(m0, m2); \ ++b1 = _mm_unpacklo_epi64(m3, m5); \ ++} while(0) ++ ++ ++#define LOAD_MSG_8_1(b0, b1) \ ++do \ ++{ \ ++b0 = _mm_unpacklo_epi64(m3, m7); \ ++b1 = _mm_alignr_epi8(m0, m5, 8); \ ++} while(0) ++ ++ ++#define LOAD_MSG_8_2(b0, b1) \ ++do \ ++{ \ ++b0 = _mm_unpackhi_epi64(m7, m4); \ ++b1 = _mm_alignr_epi8(m4, m1, 8); \ ++} while(0) ++ ++ ++#define LOAD_MSG_8_3(b0, b1) \ ++do \ ++{ \ ++b0 = m6; \ ++b1 = _mm_alignr_epi8(m5, m0, 8); \ ++} while(0) ++ ++ ++#define LOAD_MSG_8_4(b0, b1) \ ++do \ ++{ \ ++b0 = _mm_blend_epi16(m1, m3, 0xF0); \ ++b1 = m2; \ ++} while(0) ++ ++ ++#define LOAD_MSG_9_1(b0, b1) \ ++do \ ++{ \ ++b0 = _mm_unpacklo_epi64(m5, m4); \ ++b1 = _mm_unpackhi_epi64(m3, m0); \ ++} while(0) ++ ++ ++#define LOAD_MSG_9_2(b0, b1) \ ++do \ ++{ \ ++b0 = _mm_unpacklo_epi64(m1, m2); \ ++b1 = _mm_blend_epi16(m3, m2, 0xF0); \ ++} while(0) ++ ++ ++#define LOAD_MSG_9_3(b0, b1) \ ++do \ ++{ \ ++b0 = _mm_unpackhi_epi64(m7, m4); \ ++b1 = _mm_unpackhi_epi64(m1, m6); \ ++} while(0) ++ ++ ++#define LOAD_MSG_9_4(b0, b1) \ ++do \ ++{ \ ++b0 = _mm_alignr_epi8(m7, m5, 8); \ ++b1 = _mm_unpacklo_epi64(m6, m0); \ ++} while(0) ++ ++ ++#define LOAD_MSG_10_1(b0, b1) \ ++do \ ++{ \ ++b0 = _mm_unpacklo_epi64(m0, m1); \ ++b1 = _mm_unpacklo_epi64(m2, m3); \ ++} while(0) ++ ++ ++#define LOAD_MSG_10_2(b0, b1) \ ++do \ ++{ \ ++b0 = _mm_unpackhi_epi64(m0, m1); \ ++b1 = _mm_unpackhi_epi64(m2, m3); \ ++} while(0) ++ ++ ++#define LOAD_MSG_10_3(b0, b1) \ ++do \ ++{ \ ++b0 = _mm_unpacklo_epi64(m4, m5); \ ++b1 = _mm_unpacklo_epi64(m6, m7); \ ++} while(0) ++ ++ ++#define LOAD_MSG_10_4(b0, b1) \ ++do \ ++{ \ ++b0 = _mm_unpackhi_epi64(m4, m5); \ ++b1 = _mm_unpackhi_epi64(m6, m7); \ ++} while(0) ++ ++ ++#define LOAD_MSG_11_1(b0, b1) \ ++do \ ++{ \ ++b0 = _mm_unpacklo_epi64(m7, m2); \ ++b1 = _mm_unpackhi_epi64(m4, m6); \ ++} while(0) ++ ++ ++#define LOAD_MSG_11_2(b0, b1) \ ++do \ ++{ \ ++b0 = _mm_unpacklo_epi64(m5, m4); \ ++b1 = _mm_alignr_epi8(m3, m7, 8); \ ++} while(0) ++ ++ ++#define LOAD_MSG_11_3(b0, b1) \ ++do \ ++{ \ ++b0 = _mm_shuffle_epi32(m0, _MM_SHUFFLE(1,0,3,2)); \ ++b1 = _mm_unpackhi_epi64(m5, m2); \ ++} while(0) ++ ++ ++#define LOAD_MSG_11_4(b0, b1) \ ++do \ ++{ \ ++b0 = _mm_unpacklo_epi64(m6, m1); \ ++b1 = _mm_unpackhi_epi64(m3, m1); \ ++} while(0) ++ ++ ++#endif +--- thirdparty/blake2/sse/blake2b-round.h.orig 2025-09-03 12:27:32 UTC ++++ thirdparty/blake2/sse/blake2b-round.h +@@ -0,0 +1,157 @@ ++/* ++ BLAKE2 reference source code package - optimized C implementations ++ ++ Copyright 2012, Samuel Neves <sneves@dei.uc.pt>. You may use this under the ++ terms of the CC0, the OpenSSL Licence, or the Apache Public License 2.0, at ++ your option. The terms of these licenses can be found at: ++ ++ - CC0 1.0 Universal : http://creativecommons.org/publicdomain/zero/1.0 ++ - OpenSSL license : https://www.openssl.org/source/license.html ++ - Apache 2.0 : http://www.apache.org/licenses/LICENSE-2.0 ++ ++ More information about the BLAKE2 hash function can be found at ++ https://blake2.net. ++*/ ++#ifndef BLAKE2B_ROUND_H ++#define BLAKE2B_ROUND_H ++ ++#define LOADU(p) _mm_loadu_si128( (const __m128i *)(p) ) ++#define STOREU(p,r) _mm_storeu_si128((__m128i *)(p), r) ++ ++#define TOF(reg) _mm_castsi128_ps((reg)) ++#define TOI(reg) _mm_castps_si128((reg)) ++ ++#define LIKELY(x) __builtin_expect((x),1) ++ ++ ++/* Microarchitecture-specific macros */ ++#ifndef HAVE_XOP ++#ifdef HAVE_SSSE3 ++#define _mm_roti_epi64(x, c) \ ++ (-(c) == 32) ? _mm_shuffle_epi32((x), _MM_SHUFFLE(2,3,0,1)) \ ++ : (-(c) == 24) ? _mm_shuffle_epi8((x), r24) \ ++ : (-(c) == 16) ? _mm_shuffle_epi8((x), r16) \ ++ : (-(c) == 63) ? _mm_xor_si128(_mm_srli_epi64((x), -(c)), _mm_add_epi64((x), (x))) \ ++ : _mm_xor_si128(_mm_srli_epi64((x), -(c)), _mm_slli_epi64((x), 64-(-(c)))) ++#else ++#define _mm_roti_epi64(r, c) _mm_xor_si128(_mm_srli_epi64( (r), -(c) ),_mm_slli_epi64( (r), 64-(-(c)) )) ++#endif ++#else ++/* ... */ ++#endif ++ ++ ++ ++#define G1(row1l,row2l,row3l,row4l,row1h,row2h,row3h,row4h,b0,b1) \ ++ row1l = _mm_add_epi64(_mm_add_epi64(row1l, b0), row2l); \ ++ row1h = _mm_add_epi64(_mm_add_epi64(row1h, b1), row2h); \ ++ \ ++ row4l = _mm_xor_si128(row4l, row1l); \ ++ row4h = _mm_xor_si128(row4h, row1h); \ ++ \ ++ row4l = _mm_roti_epi64(row4l, -32); \ ++ row4h = _mm_roti_epi64(row4h, -32); \ ++ \ ++ row3l = _mm_add_epi64(row3l, row4l); \ ++ row3h = _mm_add_epi64(row3h, row4h); \ ++ \ ++ row2l = _mm_xor_si128(row2l, row3l); \ ++ row2h = _mm_xor_si128(row2h, row3h); \ ++ \ ++ row2l = _mm_roti_epi64(row2l, -24); \ ++ row2h = _mm_roti_epi64(row2h, -24); \ ++ ++#define G2(row1l,row2l,row3l,row4l,row1h,row2h,row3h,row4h,b0,b1) \ ++ row1l = _mm_add_epi64(_mm_add_epi64(row1l, b0), row2l); \ ++ row1h = _mm_add_epi64(_mm_add_epi64(row1h, b1), row2h); \ ++ \ ++ row4l = _mm_xor_si128(row4l, row1l); \ ++ row4h = _mm_xor_si128(row4h, row1h); \ ++ \ ++ row4l = _mm_roti_epi64(row4l, -16); \ ++ row4h = _mm_roti_epi64(row4h, -16); \ ++ \ ++ row3l = _mm_add_epi64(row3l, row4l); \ ++ row3h = _mm_add_epi64(row3h, row4h); \ ++ \ ++ row2l = _mm_xor_si128(row2l, row3l); \ ++ row2h = _mm_xor_si128(row2h, row3h); \ ++ \ ++ row2l = _mm_roti_epi64(row2l, -63); \ ++ row2h = _mm_roti_epi64(row2h, -63); \ ++ ++#if defined(HAVE_SSSE3) ++#define DIAGONALIZE(row1l,row2l,row3l,row4l,row1h,row2h,row3h,row4h) \ ++ t0 = _mm_alignr_epi8(row2h, row2l, 8); \ ++ t1 = _mm_alignr_epi8(row2l, row2h, 8); \ ++ row2l = t0; \ ++ row2h = t1; \ ++ \ ++ t0 = row3l; \ ++ row3l = row3h; \ ++ row3h = t0; \ ++ \ ++ t0 = _mm_alignr_epi8(row4h, row4l, 8); \ ++ t1 = _mm_alignr_epi8(row4l, row4h, 8); \ ++ row4l = t1; \ ++ row4h = t0; ++ ++#define UNDIAGONALIZE(row1l,row2l,row3l,row4l,row1h,row2h,row3h,row4h) \ ++ t0 = _mm_alignr_epi8(row2l, row2h, 8); \ ++ t1 = _mm_alignr_epi8(row2h, row2l, 8); \ ++ row2l = t0; \ ++ row2h = t1; \ ++ \ ++ t0 = row3l; \ ++ row3l = row3h; \ ++ row3h = t0; \ ++ \ ++ t0 = _mm_alignr_epi8(row4l, row4h, 8); \ ++ t1 = _mm_alignr_epi8(row4h, row4l, 8); \ ++ row4l = t1; \ ++ row4h = t0; ++#else ++ ++#define DIAGONALIZE(row1l,row2l,row3l,row4l,row1h,row2h,row3h,row4h) \ ++ t0 = row4l;\ ++ t1 = row2l;\ ++ row4l = row3l;\ ++ row3l = row3h;\ ++ row3h = row4l;\ ++ row4l = _mm_unpackhi_epi64(row4h, _mm_unpacklo_epi64(t0, t0)); \ ++ row4h = _mm_unpackhi_epi64(t0, _mm_unpacklo_epi64(row4h, row4h)); \ ++ row2l = _mm_unpackhi_epi64(row2l, _mm_unpacklo_epi64(row2h, row2h)); \ ++ row2h = _mm_unpackhi_epi64(row2h, _mm_unpacklo_epi64(t1, t1)) ++ ++#define UNDIAGONALIZE(row1l,row2l,row3l,row4l,row1h,row2h,row3h,row4h) \ ++ t0 = row3l;\ ++ row3l = row3h;\ ++ row3h = t0;\ ++ t0 = row2l;\ ++ t1 = row4l;\ ++ row2l = _mm_unpackhi_epi64(row2h, _mm_unpacklo_epi64(row2l, row2l)); \ ++ row2h = _mm_unpackhi_epi64(t0, _mm_unpacklo_epi64(row2h, row2h)); \ ++ row4l = _mm_unpackhi_epi64(row4l, _mm_unpacklo_epi64(row4h, row4h)); \ ++ row4h = _mm_unpackhi_epi64(row4h, _mm_unpacklo_epi64(t1, t1)) ++ ++#endif ++ ++#if defined(HAVE_SSE41) ++#include "blake2b-load-sse41.h" ++#else ++#include "blake2b-load-sse2.h" ++#endif ++ ++#define ROUND(r) \ ++ LOAD_MSG_ ##r ##_1(b0, b1); \ ++ G1(row1l,row2l,row3l,row4l,row1h,row2h,row3h,row4h,b0,b1); \ ++ LOAD_MSG_ ##r ##_2(b0, b1); \ ++ G2(row1l,row2l,row3l,row4l,row1h,row2h,row3h,row4h,b0,b1); \ ++ DIAGONALIZE(row1l,row2l,row3l,row4l,row1h,row2h,row3h,row4h); \ ++ LOAD_MSG_ ##r ##_3(b0, b1); \ ++ G1(row1l,row2l,row3l,row4l,row1h,row2h,row3h,row4h,b0,b1); \ ++ LOAD_MSG_ ##r ##_4(b0, b1); \ ++ G2(row1l,row2l,row3l,row4l,row1h,row2h,row3h,row4h,b0,b1); \ ++ UNDIAGONALIZE(row1l,row2l,row3l,row4l,row1h,row2h,row3h,row4h); ++ ++#endif +--- thirdparty/blake2/sse/blake2b.c.orig 2025-09-03 12:27:32 UTC ++++ thirdparty/blake2/sse/blake2b.c +@@ -0,0 +1,373 @@ ++/* ++ BLAKE2 reference source code package - optimized C implementations ++ ++ Copyright 2012, Samuel Neves <sneves@dei.uc.pt>. You may use this under the ++ terms of the CC0, the OpenSSL Licence, or the Apache Public License 2.0, at ++ your option. The terms of these licenses can be found at: ++ ++ - CC0 1.0 Universal : http://creativecommons.org/publicdomain/zero/1.0 ++ - OpenSSL license : https://www.openssl.org/source/license.html ++ - Apache 2.0 : http://www.apache.org/licenses/LICENSE-2.0 ++ ++ More information about the BLAKE2 hash function can be found at ++ https://blake2.net. ++*/ ++ ++#include <stdint.h> ++#include <string.h> ++#include <stdio.h> ++ ++#include "blake2.h" ++#include "blake2-impl.h" ++ ++#include "blake2-config.h" ++ ++#ifdef _MSC_VER ++#include <intrin.h> /* for _mm_set_epi64x */ ++#endif ++#include <emmintrin.h> ++#if defined(HAVE_SSSE3) ++#include <tmmintrin.h> ++#endif ++#if defined(HAVE_SSE41) ++#include <smmintrin.h> ++#endif ++#if defined(HAVE_AVX) ++#include <immintrin.h> ++#endif ++#if defined(HAVE_XOP) ++#include <x86intrin.h> ++#endif ++ ++#include "blake2b-round.h" ++ ++static const uint64_t blake2b_IV[8] = ++{ ++ 0x6a09e667f3bcc908ULL, 0xbb67ae8584caa73bULL, ++ 0x3c6ef372fe94f82bULL, 0xa54ff53a5f1d36f1ULL, ++ 0x510e527fade682d1ULL, 0x9b05688c2b3e6c1fULL, ++ 0x1f83d9abfb41bd6bULL, 0x5be0cd19137e2179ULL ++}; ++ ++/* Some helper functions */ ++static void blake2b_set_lastnode( blake2b_state *S ) ++{ ++ S->f[1] = (uint64_t)-1; ++} ++ ++static int blake2b_is_lastblock( const blake2b_state *S ) ++{ ++ return S->f[0] != 0; ++} ++ ++static void blake2b_set_lastblock( blake2b_state *S ) ++{ ++ if( S->last_node ) blake2b_set_lastnode( S ); ++ ++ S->f[0] = (uint64_t)-1; ++} ++ ++static void blake2b_increment_counter( blake2b_state *S, const uint64_t inc ) ++{ ++ S->t[0] += inc; ++ S->t[1] += ( S->t[0] < inc ); ++} ++ ++/* init xors IV with input parameter block */ ++int blake2b_init_param( blake2b_state *S, const blake2b_param *P ) ++{ ++ size_t i; ++ /*blake2b_init0( S ); */ ++ const unsigned char * v = ( const unsigned char * )( blake2b_IV ); ++ const unsigned char * p = ( const unsigned char * )( P ); ++ unsigned char * h = ( unsigned char * )( S->h ); ++ /* IV XOR ParamBlock */ ++ memset( S, 0, sizeof( blake2b_state ) ); ++ ++ for( i = 0; i < BLAKE2B_OUTBYTES; ++i ) h[i] = v[i] ^ p[i]; ++ ++ S->outlen = P->digest_length; ++ return 0; ++} ++ ++ ++/* Some sort of default parameter block initialization, for sequential blake2b */ ++int blake2b_init( blake2b_state *S, size_t outlen ) ++{ ++ blake2b_param P[1]; ++ ++ if ( ( !outlen ) || ( outlen > BLAKE2B_OUTBYTES ) ) return -1; ++ ++ P->digest_length = (uint8_t)outlen; ++ P->key_length = 0; ++ P->fanout = 1; ++ P->depth = 1; ++ store32( &P->leaf_length, 0 ); ++ store32( &P->node_offset, 0 ); ++ store32( &P->xof_length, 0 ); ++ P->node_depth = 0; ++ P->inner_length = 0; ++ memset( P->reserved, 0, sizeof( P->reserved ) ); ++ memset( P->salt, 0, sizeof( P->salt ) ); ++ memset( P->personal, 0, sizeof( P->personal ) ); ++ ++ return blake2b_init_param( S, P ); ++} ++ ++int blake2b_init_key( blake2b_state *S, size_t outlen, const void *key, size_t keylen ) ++{ ++ blake2b_param P[1]; ++ ++ if ( ( !outlen ) || ( outlen > BLAKE2B_OUTBYTES ) ) return -1; ++ ++ if ( ( !keylen ) || keylen > BLAKE2B_KEYBYTES ) return -1; ++ ++ P->digest_length = (uint8_t)outlen; ++ P->key_length = (uint8_t)keylen; ++ P->fanout = 1; ++ P->depth = 1; ++ store32( &P->leaf_length, 0 ); ++ store32( &P->node_offset, 0 ); ++ store32( &P->xof_length, 0 ); ++ P->node_depth = 0; ++ P->inner_length = 0; ++ memset( P->reserved, 0, sizeof( P->reserved ) ); ++ memset( P->salt, 0, sizeof( P->salt ) ); ++ memset( P->personal, 0, sizeof( P->personal ) ); ++ ++ if( blake2b_init_param( S, P ) < 0 ) ++ return 0; ++ ++ { ++ uint8_t block[BLAKE2B_BLOCKBYTES]; ++ memset( block, 0, BLAKE2B_BLOCKBYTES ); ++ memcpy( block, key, keylen ); ++ blake2b_update( S, block, BLAKE2B_BLOCKBYTES ); ++ secure_zero_memory( block, BLAKE2B_BLOCKBYTES ); /* Burn the key from stack */ ++ } ++ return 0; ++} ++ ++static void blake2b_compress( blake2b_state *S, const uint8_t block[BLAKE2B_BLOCKBYTES] ) ++{ ++ __m128i row1l, row1h; ++ __m128i row2l, row2h; ++ __m128i row3l, row3h; ++ __m128i row4l, row4h; ++ __m128i b0, b1; ++ __m128i t0, t1; ++#if defined(HAVE_SSSE3) && !defined(HAVE_XOP) ++ const __m128i r16 = _mm_setr_epi8( 2, 3, 4, 5, 6, 7, 0, 1, 10, 11, 12, 13, 14, 15, 8, 9 ); ++ const __m128i r24 = _mm_setr_epi8( 3, 4, 5, 6, 7, 0, 1, 2, 11, 12, 13, 14, 15, 8, 9, 10 ); ++#endif ++#if defined(HAVE_SSE41) ++ const __m128i m0 = LOADU( block + 00 ); ++ const __m128i m1 = LOADU( block + 16 ); ++ const __m128i m2 = LOADU( block + 32 ); ++ const __m128i m3 = LOADU( block + 48 ); ++ const __m128i m4 = LOADU( block + 64 ); ++ const __m128i m5 = LOADU( block + 80 ); ++ const __m128i m6 = LOADU( block + 96 ); ++ const __m128i m7 = LOADU( block + 112 ); ++#else ++ const uint64_t m0 = load64(block + 0 * sizeof(uint64_t)); ++ const uint64_t m1 = load64(block + 1 * sizeof(uint64_t)); ++ const uint64_t m2 = load64(block + 2 * sizeof(uint64_t)); ++ const uint64_t m3 = load64(block + 3 * sizeof(uint64_t)); ++ const uint64_t m4 = load64(block + 4 * sizeof(uint64_t)); ++ const uint64_t m5 = load64(block + 5 * sizeof(uint64_t)); ++ const uint64_t m6 = load64(block + 6 * sizeof(uint64_t)); ++ const uint64_t m7 = load64(block + 7 * sizeof(uint64_t)); ++ const uint64_t m8 = load64(block + 8 * sizeof(uint64_t)); ++ const uint64_t m9 = load64(block + 9 * sizeof(uint64_t)); ++ const uint64_t m10 = load64(block + 10 * sizeof(uint64_t)); ++ const uint64_t m11 = load64(block + 11 * sizeof(uint64_t)); ++ const uint64_t m12 = load64(block + 12 * sizeof(uint64_t)); ++ const uint64_t m13 = load64(block + 13 * sizeof(uint64_t)); ++ const uint64_t m14 = load64(block + 14 * sizeof(uint64_t)); ++ const uint64_t m15 = load64(block + 15 * sizeof(uint64_t)); ++#endif ++ row1l = LOADU( &S->h[0] ); ++ row1h = LOADU( &S->h[2] ); ++ row2l = LOADU( &S->h[4] ); ++ row2h = LOADU( &S->h[6] ); ++ row3l = LOADU( &blake2b_IV[0] ); ++ row3h = LOADU( &blake2b_IV[2] ); ++ row4l = _mm_xor_si128( LOADU( &blake2b_IV[4] ), LOADU( &S->t[0] ) ); ++ row4h = _mm_xor_si128( LOADU( &blake2b_IV[6] ), LOADU( &S->f[0] ) ); ++ ROUND( 0 ); ++ ROUND( 1 ); ++ ROUND( 2 ); ++ ROUND( 3 ); ++ ROUND( 4 ); ++ ROUND( 5 ); ++ ROUND( 6 ); ++ ROUND( 7 ); ++ ROUND( 8 ); ++ ROUND( 9 ); ++ ROUND( 10 ); ++ ROUND( 11 ); ++ row1l = _mm_xor_si128( row3l, row1l ); ++ row1h = _mm_xor_si128( row3h, row1h ); ++ STOREU( &S->h[0], _mm_xor_si128( LOADU( &S->h[0] ), row1l ) ); ++ STOREU( &S->h[2], _mm_xor_si128( LOADU( &S->h[2] ), row1h ) ); ++ row2l = _mm_xor_si128( row4l, row2l ); ++ row2h = _mm_xor_si128( row4h, row2h ); ++ STOREU( &S->h[4], _mm_xor_si128( LOADU( &S->h[4] ), row2l ) ); ++ STOREU( &S->h[6], _mm_xor_si128( LOADU( &S->h[6] ), row2h ) ); ++} ++ ++ ++int blake2b_update( blake2b_state *S, const void *pin, size_t inlen ) ++{ ++ const unsigned char * in = (const unsigned char *)pin; ++ if( inlen > 0 ) ++ { ++ size_t left = S->buflen; ++ size_t fill = BLAKE2B_BLOCKBYTES - left; ++ if( inlen > fill ) ++ { ++ S->buflen = 0; ++ memcpy( S->buf + left, in, fill ); /* Fill buffer */ ++ blake2b_increment_counter( S, BLAKE2B_BLOCKBYTES ); ++ blake2b_compress( S, S->buf ); /* Compress */ ++ in += fill; inlen -= fill; ++ while(inlen > BLAKE2B_BLOCKBYTES) { ++ blake2b_increment_counter(S, BLAKE2B_BLOCKBYTES); ++ blake2b_compress( S, in ); ++ in += BLAKE2B_BLOCKBYTES; ++ inlen -= BLAKE2B_BLOCKBYTES; ++ } ++ } ++ memcpy( S->buf + S->buflen, in, inlen ); ++ S->buflen += inlen; ++ } ++ return 0; ++} ++ ++ ++int blake2b_final( blake2b_state *S, void *out, size_t outlen ) ++{ ++ if( out == NULL || outlen < S->outlen ) ++ return -1; ++ ++ if( blake2b_is_lastblock( S ) ) ++ return -1; ++ ++ blake2b_increment_counter( S, S->buflen ); ++ blake2b_set_lastblock( S ); ++ memset( S->buf + S->buflen, 0, BLAKE2B_BLOCKBYTES - S->buflen ); /* Padding */ ++ blake2b_compress( S, S->buf ); ++ ++ memcpy( out, &S->h[0], S->outlen ); ++ return 0; ++} ++ ++ ++int blake2b( void *out, size_t outlen, const void *in, size_t inlen, const void *key, size_t keylen ) ++{ ++ blake2b_state S[1]; ++ ++ /* Verify parameters */ ++ if ( NULL == in && inlen > 0 ) return -1; ++ ++ if ( NULL == out ) return -1; ++ ++ if( NULL == key && keylen > 0 ) return -1; ++ ++ if( !outlen || outlen > BLAKE2B_OUTBYTES ) return -1; ++ ++ if( keylen > BLAKE2B_KEYBYTES ) return -1; ++ ++ if( keylen ) ++ { ++ if( blake2b_init_key( S, outlen, key, keylen ) < 0 ) return -1; ++ } ++ else ++ { ++ if( blake2b_init( S, outlen ) < 0 ) return -1; ++ } ++ ++ blake2b_update( S, ( const uint8_t * )in, inlen ); ++ blake2b_final( S, out, outlen ); ++ return 0; ++} ++ ++int blake2( void *out, size_t outlen, const void *in, size_t inlen, const void *key, size_t keylen ) { ++ return blake2b(out, outlen, in, inlen, key, keylen); ++} ++ ++#if defined(SUPERCOP) ++int crypto_hash( unsigned char *out, unsigned char *in, unsigned long long inlen ) ++{ ++ return blake2b( out, BLAKE2B_OUTBYTES, in, inlen, NULL, 0 ); ++} ++#endif ++ ++#if defined(BLAKE2B_SELFTEST) ++#include <string.h> ++#include "blake2-kat.h" ++int main( void ) ++{ ++ uint8_t key[BLAKE2B_KEYBYTES]; ++ uint8_t buf[BLAKE2_KAT_LENGTH]; ++ size_t i, step; ++ ++ for( i = 0; i < BLAKE2B_KEYBYTES; ++i ) ++ key[i] = ( uint8_t )i; ++ ++ for( i = 0; i < BLAKE2_KAT_LENGTH; ++i ) ++ buf[i] = ( uint8_t )i; ++ ++ /* Test simple API */ ++ for( i = 0; i < BLAKE2_KAT_LENGTH; ++i ) ++ { ++ uint8_t hash[BLAKE2B_OUTBYTES]; ++ blake2b( hash, BLAKE2B_OUTBYTES, buf, i, key, BLAKE2B_KEYBYTES ); ++ ++ if( 0 != memcmp( hash, blake2b_keyed_kat[i], BLAKE2B_OUTBYTES ) ) ++ { ++ goto fail; ++ } ++ } ++ ++ /* Test streaming API */ ++ for(step = 1; step < BLAKE2B_BLOCKBYTES; ++step) { ++ for (i = 0; i < BLAKE2_KAT_LENGTH; ++i) { ++ uint8_t hash[BLAKE2B_OUTBYTES]; ++ blake2b_state S; ++ uint8_t * p = buf; ++ size_t mlen = i; ++ int err = 0; ++ ++ if( (err = blake2b_init_key(&S, BLAKE2B_OUTBYTES, key, BLAKE2B_KEYBYTES)) < 0 ) { ++ goto fail; ++ } ++ ++ while (mlen >= step) { ++ if ( (err = blake2b_update(&S, p, step)) < 0 ) { ++ goto fail; ++ } ++ mlen -= step; ++ p += step; ++ } ++ if ( (err = blake2b_update(&S, p, mlen)) < 0) { ++ goto fail; ++ } ++ if ( (err = blake2b_final(&S, hash, BLAKE2B_OUTBYTES)) < 0) { ++ goto fail; ++ } ++ ++ if (0 != memcmp(hash, blake2b_keyed_kat[i], BLAKE2B_OUTBYTES)) { ++ goto fail; ++ } ++ } ++ } ++ ++ puts( "ok" ); ++ return 0; ++fail: ++ puts("error"); ++ return -1; ++} ++#endif +--- thirdparty/blake2/sse/blake2bp.c.orig 2025-09-03 12:27:32 UTC ++++ thirdparty/blake2/sse/blake2bp.c +@@ -0,0 +1,361 @@ ++/* ++ BLAKE2 reference source code package - optimized C implementations ++ ++ Copyright 2012, Samuel Neves <sneves@dei.uc.pt>. You may use this under the ++ terms of the CC0, the OpenSSL Licence, or the Apache Public License 2.0, at ++ your option. The terms of these licenses can be found at: ++ ++ - CC0 1.0 Universal : http://creativecommons.org/publicdomain/zero/1.0 ++ - OpenSSL license : https://www.openssl.org/source/license.html ++ - Apache 2.0 : http://www.apache.org/licenses/LICENSE-2.0 ++ ++ More information about the BLAKE2 hash function can be found at ++ https://blake2.net. ++*/ ++ ++#include <stdio.h> ++#include <stdlib.h> ++#include <string.h> ++#include <stdint.h> ++ ++#if defined(_OPENMP) ++#include <omp.h> ++#endif ++ ++#include "blake2.h" ++#include "blake2-impl.h" ++ ++#define PARALLELISM_DEGREE 4 ++ ++/* ++ blake2b_init_param defaults to setting the expecting output length ++ from the digest_length parameter block field. ++ ++ In some cases, however, we do not want this, as the output length ++ of these instances is given by inner_length instead. ++*/ ++static int blake2bp_init_leaf_param( blake2b_state *S, const blake2b_param *P ) ++{ ++ int err = blake2b_init_param(S, P); ++ S->outlen = P->inner_length; ++ return err; ++} ++ ++static int blake2bp_init_leaf( blake2b_state *S, size_t outlen, size_t keylen, uint64_t offset ) ++{ ++ blake2b_param P[1]; ++ P->digest_length = (uint8_t)outlen; ++ P->key_length = (uint8_t)keylen; ++ P->fanout = PARALLELISM_DEGREE; ++ P->depth = 2; ++ P->leaf_length = 0; ++ P->node_offset = offset; ++ P->xof_length = 0; ++ P->node_depth = 0; ++ P->inner_length = BLAKE2B_OUTBYTES; ++ memset( P->reserved, 0, sizeof( P->reserved ) ); ++ memset( P->salt, 0, sizeof( P->salt ) ); ++ memset( P->personal, 0, sizeof( P->personal ) ); ++ return blake2bp_init_leaf_param( S, P ); ++} ++ ++static int blake2bp_init_root( blake2b_state *S, size_t outlen, size_t keylen ) ++{ ++ blake2b_param P[1]; ++ P->digest_length = (uint8_t)outlen; ++ P->key_length = (uint8_t)keylen; ++ P->fanout = PARALLELISM_DEGREE; ++ P->depth = 2; ++ P->leaf_length = 0; ++ P->node_offset = 0; ++ P->xof_length = 0; ++ P->node_depth = 1; ++ P->inner_length = BLAKE2B_OUTBYTES; ++ memset( P->reserved, 0, sizeof( P->reserved ) ); ++ memset( P->salt, 0, sizeof( P->salt ) ); ++ memset( P->personal, 0, sizeof( P->personal ) ); ++ return blake2b_init_param( S, P ); ++} ++ ++ ++int blake2bp_init( blake2bp_state *S, size_t outlen ) ++{ ++ size_t i; ++ if( !outlen || outlen > BLAKE2B_OUTBYTES ) return -1; ++ ++ memset( S->buf, 0, sizeof( S->buf ) ); ++ S->buflen = 0; ++ S->outlen = outlen; ++ ++ if( blake2bp_init_root( S->R, outlen, 0 ) < 0 ) ++ return -1; ++ ++ for( i = 0; i < PARALLELISM_DEGREE; ++i ) ++ if( blake2bp_init_leaf( S->S[i], outlen, 0, i ) < 0 ) return -1; ++ ++ S->R->last_node = 1; ++ S->S[PARALLELISM_DEGREE - 1]->last_node = 1; ++ return 0; ++} ++ ++int blake2bp_init_key( blake2bp_state *S, size_t outlen, const void *key, size_t keylen ) ++{ ++ size_t i; ++ ++ if( !outlen || outlen > BLAKE2B_OUTBYTES ) return -1; ++ ++ if( !key || !keylen || keylen > BLAKE2B_KEYBYTES ) return -1; ++ ++ memset( S->buf, 0, sizeof( S->buf ) ); ++ S->buflen = 0; ++ S->outlen = outlen; ++ ++ if( blake2bp_init_root( S->R, outlen, keylen ) < 0 ) ++ return -1; ++ ++ for( i = 0; i < PARALLELISM_DEGREE; ++i ) ++ if( blake2bp_init_leaf( S->S[i], outlen, keylen, i ) < 0 ) return -1; ++ ++ S->R->last_node = 1; ++ S->S[PARALLELISM_DEGREE - 1]->last_node = 1; ++ { ++ uint8_t block[BLAKE2B_BLOCKBYTES]; ++ memset( block, 0, BLAKE2B_BLOCKBYTES ); ++ memcpy( block, key, keylen ); ++ ++ for( i = 0; i < PARALLELISM_DEGREE; ++i ) ++ blake2b_update( S->S[i], block, BLAKE2B_BLOCKBYTES ); ++ ++ secure_zero_memory( block, BLAKE2B_BLOCKBYTES ); /* Burn the key from stack */ ++ } ++ return 0; ++} ++ ++ ++int blake2bp_update( blake2bp_state *S, const void *pin, size_t inlen ) ++{ ++ const unsigned char * in = (const unsigned char *)pin; ++ size_t left = S->buflen; ++ size_t fill = sizeof( S->buf ) - left; ++ size_t i; ++ ++ if( left && inlen >= fill ) ++ { ++ memcpy( S->buf + left, in, fill ); ++ ++ for( i = 0; i < PARALLELISM_DEGREE; ++i ) ++ blake2b_update( S->S[i], S->buf + i * BLAKE2B_BLOCKBYTES, BLAKE2B_BLOCKBYTES ); ++ ++ in += fill; ++ inlen -= fill; ++ left = 0; ++ } ++ ++#if defined(_OPENMP) ++ #pragma omp parallel shared(S), num_threads(PARALLELISM_DEGREE) ++#else ++ ++ for( i = 0; i < PARALLELISM_DEGREE; ++i ) ++#endif ++ { ++#if defined(_OPENMP) ++ size_t i = omp_get_thread_num(); ++#endif ++ size_t inlen__ = inlen; ++ const unsigned char *in__ = ( const unsigned char * )in; ++ in__ += i * BLAKE2B_BLOCKBYTES; ++ ++ while( inlen__ >= PARALLELISM_DEGREE * BLAKE2B_BLOCKBYTES ) ++ { ++ blake2b_update( S->S[i], in__, BLAKE2B_BLOCKBYTES ); ++ in__ += PARALLELISM_DEGREE * BLAKE2B_BLOCKBYTES; ++ inlen__ -= PARALLELISM_DEGREE * BLAKE2B_BLOCKBYTES; ++ } ++ } ++ ++ in += inlen - inlen % ( PARALLELISM_DEGREE * BLAKE2B_BLOCKBYTES ); ++ inlen %= PARALLELISM_DEGREE * BLAKE2B_BLOCKBYTES; ++ ++ if( inlen > 0 ) ++ memcpy( S->buf + left, in, inlen ); ++ ++ S->buflen = left + inlen; ++ return 0; ++} ++ ++ ++ ++int blake2bp_final( blake2bp_state *S, void *out, size_t outlen ) ++{ ++ uint8_t hash[PARALLELISM_DEGREE][BLAKE2B_OUTBYTES]; ++ size_t i; ++ ++ if(out == NULL || outlen < S->outlen) { ++ return -1; ++ } ++ ++ for( i = 0; i < PARALLELISM_DEGREE; ++i ) ++ { ++ if( S->buflen > i * BLAKE2B_BLOCKBYTES ) ++ { ++ size_t left = S->buflen - i * BLAKE2B_BLOCKBYTES; ++ ++ if( left > BLAKE2B_BLOCKBYTES ) left = BLAKE2B_BLOCKBYTES; ++ ++ blake2b_update( S->S[i], S->buf + i * BLAKE2B_BLOCKBYTES, left ); ++ } ++ ++ blake2b_final( S->S[i], hash[i], BLAKE2B_OUTBYTES ); ++ } ++ ++ for( i = 0; i < PARALLELISM_DEGREE; ++i ) ++ blake2b_update( S->R, hash[i], BLAKE2B_OUTBYTES ); ++ ++ return blake2b_final( S->R, out, S->outlen ); ++} ++ ++int blake2bp( void *out, size_t outlen, const void *in, size_t inlen, const void *key, size_t keylen ) ++{ ++ uint8_t hash[PARALLELISM_DEGREE][BLAKE2B_OUTBYTES]; ++ blake2b_state S[PARALLELISM_DEGREE][1]; ++ blake2b_state FS[1]; ++ size_t i; ++ ++ /* Verify parameters */ ++ if ( NULL == in && inlen > 0 ) return -1; ++ ++ if ( NULL == out ) return -1; ++ ++ if( NULL == key && keylen > 0 ) return -1; ++ ++ if( !outlen || outlen > BLAKE2B_OUTBYTES ) return -1; ++ ++ if( keylen > BLAKE2B_KEYBYTES ) return -1; ++ ++ for( i = 0; i < PARALLELISM_DEGREE; ++i ) ++ if( blake2bp_init_leaf( S[i], outlen, keylen, i ) < 0 ) return -1; ++ ++ S[PARALLELISM_DEGREE - 1]->last_node = 1; /* mark last node */ ++ ++ if( keylen > 0 ) ++ { ++ uint8_t block[BLAKE2B_BLOCKBYTES]; ++ memset( block, 0, BLAKE2B_BLOCKBYTES ); ++ memcpy( block, key, keylen ); ++ ++ for( i = 0; i < PARALLELISM_DEGREE; ++i ) ++ blake2b_update( S[i], block, BLAKE2B_BLOCKBYTES ); ++ ++ secure_zero_memory( block, BLAKE2B_BLOCKBYTES ); /* Burn the key from stack */ ++ } ++ ++#if defined(_OPENMP) ++ #pragma omp parallel shared(S,hash), num_threads(PARALLELISM_DEGREE) ++#else ++ ++ for( i = 0; i < PARALLELISM_DEGREE; ++i ) ++#endif ++ { ++#if defined(_OPENMP) ++ size_t i = omp_get_thread_num(); ++#endif ++ size_t inlen__ = inlen; ++ const unsigned char *in__ = ( const unsigned char * )in; ++ in__ += i * BLAKE2B_BLOCKBYTES; ++ ++ while( inlen__ >= PARALLELISM_DEGREE * BLAKE2B_BLOCKBYTES ) ++ { ++ blake2b_update( S[i], in__, BLAKE2B_BLOCKBYTES ); ++ in__ += PARALLELISM_DEGREE * BLAKE2B_BLOCKBYTES; ++ inlen__ -= PARALLELISM_DEGREE * BLAKE2B_BLOCKBYTES; ++ } ++ ++ if( inlen__ > i * BLAKE2B_BLOCKBYTES ) ++ { ++ const size_t left = inlen__ - i * BLAKE2B_BLOCKBYTES; ++ const size_t len = left <= BLAKE2B_BLOCKBYTES ? left : BLAKE2B_BLOCKBYTES; ++ blake2b_update( S[i], in__, len ); ++ } ++ ++ blake2b_final( S[i], hash[i], BLAKE2B_OUTBYTES ); ++ } ++ ++ if( blake2bp_init_root( FS, outlen, keylen ) < 0 ) ++ return -1; ++ ++ FS->last_node = 1; /* Mark as last node */ ++ ++ for( i = 0; i < PARALLELISM_DEGREE; ++i ) ++ blake2b_update( FS, hash[i], BLAKE2B_OUTBYTES ); ++ ++ return blake2b_final( FS, out, outlen ); ++} ++ ++ ++#if defined(BLAKE2BP_SELFTEST) ++#include <string.h> ++#include "blake2-kat.h" ++int main( void ) ++{ ++ uint8_t key[BLAKE2B_KEYBYTES]; ++ uint8_t buf[BLAKE2_KAT_LENGTH]; ++ size_t i, step; ++ ++ for( i = 0; i < BLAKE2B_KEYBYTES; ++i ) ++ key[i] = ( uint8_t )i; ++ ++ for( i = 0; i < BLAKE2_KAT_LENGTH; ++i ) ++ buf[i] = ( uint8_t )i; ++ ++ /* Test simple API */ ++ for( i = 0; i < BLAKE2_KAT_LENGTH; ++i ) ++ { ++ uint8_t hash[BLAKE2B_OUTBYTES]; ++ blake2bp( hash, BLAKE2B_OUTBYTES, buf, i, key, BLAKE2B_KEYBYTES ); ++ ++ if( 0 != memcmp( hash, blake2bp_keyed_kat[i], BLAKE2B_OUTBYTES ) ) ++ { ++ goto fail; ++ } ++ } ++ ++ /* Test streaming API */ ++ for(step = 1; step < BLAKE2B_BLOCKBYTES; ++step) { ++ for (i = 0; i < BLAKE2_KAT_LENGTH; ++i) { ++ uint8_t hash[BLAKE2B_OUTBYTES]; ++ blake2bp_state S; ++ uint8_t * p = buf; ++ size_t mlen = i; ++ int err = 0; ++ ++ if( (err = blake2bp_init_key(&S, BLAKE2B_OUTBYTES, key, BLAKE2B_KEYBYTES)) < 0 ) { ++ goto fail; ++ } ++ ++ while (mlen >= step) { ++ if ( (err = blake2bp_update(&S, p, step)) < 0 ) { ++ goto fail; ++ } ++ mlen -= step; ++ p += step; ++ } ++ if ( (err = blake2bp_update(&S, p, mlen)) < 0) { ++ goto fail; ++ } ++ if ( (err = blake2bp_final(&S, hash, BLAKE2B_OUTBYTES)) < 0) { ++ goto fail; ++ } ++ ++ if (0 != memcmp(hash, blake2bp_keyed_kat[i], BLAKE2B_OUTBYTES)) { ++ goto fail; ++ } ++ } ++ } ++ ++ puts( "ok" ); ++ return 0; ++fail: ++ puts("error"); ++ return -1; ++} ++#endif +--- thirdparty/blake2/sse/blake2s-load-sse2.h.orig 2025-09-03 12:27:32 UTC ++++ thirdparty/blake2/sse/blake2s-load-sse2.h +@@ -0,0 +1,60 @@ ++/* ++ BLAKE2 reference source code package - optimized C implementations ++ ++ Copyright 2012, Samuel Neves <sneves@dei.uc.pt>. You may use this under the ++ terms of the CC0, the OpenSSL Licence, or the Apache Public License 2.0, at ++ your option. The terms of these licenses can be found at: ++ ++ - CC0 1.0 Universal : http://creativecommons.org/publicdomain/zero/1.0 ++ - OpenSSL license : https://www.openssl.org/source/license.html ++ - Apache 2.0 : http://www.apache.org/licenses/LICENSE-2.0 ++ ++ More information about the BLAKE2 hash function can be found at ++ https://blake2.net. ++*/ ++#ifndef BLAKE2S_LOAD_SSE2_H ++#define BLAKE2S_LOAD_SSE2_H ++ ++#define LOAD_MSG_0_1(buf) buf = _mm_set_epi32(m6,m4,m2,m0) ++#define LOAD_MSG_0_2(buf) buf = _mm_set_epi32(m7,m5,m3,m1) ++#define LOAD_MSG_0_3(buf) buf = _mm_set_epi32(m14,m12,m10,m8) ++#define LOAD_MSG_0_4(buf) buf = _mm_set_epi32(m15,m13,m11,m9) ++#define LOAD_MSG_1_1(buf) buf = _mm_set_epi32(m13,m9,m4,m14) ++#define LOAD_MSG_1_2(buf) buf = _mm_set_epi32(m6,m15,m8,m10) ++#define LOAD_MSG_1_3(buf) buf = _mm_set_epi32(m5,m11,m0,m1) ++#define LOAD_MSG_1_4(buf) buf = _mm_set_epi32(m3,m7,m2,m12) ++#define LOAD_MSG_2_1(buf) buf = _mm_set_epi32(m15,m5,m12,m11) ++#define LOAD_MSG_2_2(buf) buf = _mm_set_epi32(m13,m2,m0,m8) ++#define LOAD_MSG_2_3(buf) buf = _mm_set_epi32(m9,m7,m3,m10) ++#define LOAD_MSG_2_4(buf) buf = _mm_set_epi32(m4,m1,m6,m14) ++#define LOAD_MSG_3_1(buf) buf = _mm_set_epi32(m11,m13,m3,m7) ++#define LOAD_MSG_3_2(buf) buf = _mm_set_epi32(m14,m12,m1,m9) ++#define LOAD_MSG_3_3(buf) buf = _mm_set_epi32(m15,m4,m5,m2) ++#define LOAD_MSG_3_4(buf) buf = _mm_set_epi32(m8,m0,m10,m6) ++#define LOAD_MSG_4_1(buf) buf = _mm_set_epi32(m10,m2,m5,m9) ++#define LOAD_MSG_4_2(buf) buf = _mm_set_epi32(m15,m4,m7,m0) ++#define LOAD_MSG_4_3(buf) buf = _mm_set_epi32(m3,m6,m11,m14) ++#define LOAD_MSG_4_4(buf) buf = _mm_set_epi32(m13,m8,m12,m1) ++#define LOAD_MSG_5_1(buf) buf = _mm_set_epi32(m8,m0,m6,m2) ++#define LOAD_MSG_5_2(buf) buf = _mm_set_epi32(m3,m11,m10,m12) ++#define LOAD_MSG_5_3(buf) buf = _mm_set_epi32(m1,m15,m7,m4) ++#define LOAD_MSG_5_4(buf) buf = _mm_set_epi32(m9,m14,m5,m13) ++#define LOAD_MSG_6_1(buf) buf = _mm_set_epi32(m4,m14,m1,m12) ++#define LOAD_MSG_6_2(buf) buf = _mm_set_epi32(m10,m13,m15,m5) ++#define LOAD_MSG_6_3(buf) buf = _mm_set_epi32(m8,m9,m6,m0) ++#define LOAD_MSG_6_4(buf) buf = _mm_set_epi32(m11,m2,m3,m7) ++#define LOAD_MSG_7_1(buf) buf = _mm_set_epi32(m3,m12,m7,m13) ++#define LOAD_MSG_7_2(buf) buf = _mm_set_epi32(m9,m1,m14,m11) ++#define LOAD_MSG_7_3(buf) buf = _mm_set_epi32(m2,m8,m15,m5) ++#define LOAD_MSG_7_4(buf) buf = _mm_set_epi32(m10,m6,m4,m0) ++#define LOAD_MSG_8_1(buf) buf = _mm_set_epi32(m0,m11,m14,m6) ++#define LOAD_MSG_8_2(buf) buf = _mm_set_epi32(m8,m3,m9,m15) ++#define LOAD_MSG_8_3(buf) buf = _mm_set_epi32(m10,m1,m13,m12) ++#define LOAD_MSG_8_4(buf) buf = _mm_set_epi32(m5,m4,m7,m2) ++#define LOAD_MSG_9_1(buf) buf = _mm_set_epi32(m1,m7,m8,m10) ++#define LOAD_MSG_9_2(buf) buf = _mm_set_epi32(m5,m6,m4,m2) ++#define LOAD_MSG_9_3(buf) buf = _mm_set_epi32(m13,m3,m9,m15) ++#define LOAD_MSG_9_4(buf) buf = _mm_set_epi32(m0,m12,m14,m11) ++ ++ ++#endif +--- thirdparty/blake2/sse/blake2s-load-sse41.h.orig 2025-09-03 12:27:32 UTC ++++ thirdparty/blake2/sse/blake2s-load-sse41.h +@@ -0,0 +1,229 @@ ++/* ++ BLAKE2 reference source code package - optimized C implementations ++ ++ Copyright 2012, Samuel Neves <sneves@dei.uc.pt>. You may use this under the ++ terms of the CC0, the OpenSSL Licence, or the Apache Public License 2.0, at ++ your option. The terms of these licenses can be found at: ++ ++ - CC0 1.0 Universal : http://creativecommons.org/publicdomain/zero/1.0 ++ - OpenSSL license : https://www.openssl.org/source/license.html ++ - Apache 2.0 : http://www.apache.org/licenses/LICENSE-2.0 ++ ++ More information about the BLAKE2 hash function can be found at ++ https://blake2.net. ++*/ ++#ifndef BLAKE2S_LOAD_SSE41_H ++#define BLAKE2S_LOAD_SSE41_H ++ ++#define LOAD_MSG_0_1(buf) \ ++buf = TOI(_mm_shuffle_ps(TOF(m0), TOF(m1), _MM_SHUFFLE(2,0,2,0))); ++ ++#define LOAD_MSG_0_2(buf) \ ++buf = TOI(_mm_shuffle_ps(TOF(m0), TOF(m1), _MM_SHUFFLE(3,1,3,1))); ++ ++#define LOAD_MSG_0_3(buf) \ ++buf = TOI(_mm_shuffle_ps(TOF(m2), TOF(m3), _MM_SHUFFLE(2,0,2,0))); ++ ++#define LOAD_MSG_0_4(buf) \ ++buf = TOI(_mm_shuffle_ps(TOF(m2), TOF(m3), _MM_SHUFFLE(3,1,3,1))); ++ ++#define LOAD_MSG_1_1(buf) \ ++t0 = _mm_blend_epi16(m1, m2, 0x0C); \ ++t1 = _mm_slli_si128(m3, 4); \ ++t2 = _mm_blend_epi16(t0, t1, 0xF0); \ ++buf = _mm_shuffle_epi32(t2, _MM_SHUFFLE(2,1,0,3)); ++ ++#define LOAD_MSG_1_2(buf) \ ++t0 = _mm_shuffle_epi32(m2,_MM_SHUFFLE(0,0,2,0)); \ ++t1 = _mm_blend_epi16(m1,m3,0xC0); \ ++t2 = _mm_blend_epi16(t0, t1, 0xF0); \ ++buf = _mm_shuffle_epi32(t2, _MM_SHUFFLE(2,3,0,1)); ++ ++#define LOAD_MSG_1_3(buf) \ ++t0 = _mm_slli_si128(m1, 4); \ ++t1 = _mm_blend_epi16(m2, t0, 0x30); \ ++t2 = _mm_blend_epi16(m0, t1, 0xF0); \ ++buf = _mm_shuffle_epi32(t2, _MM_SHUFFLE(2,3,0,1)); ++ ++#define LOAD_MSG_1_4(buf) \ ++t0 = _mm_unpackhi_epi32(m0,m1); \ ++t1 = _mm_slli_si128(m3, 4); \ ++t2 = _mm_blend_epi16(t0, t1, 0x0C); \ ++buf = _mm_shuffle_epi32(t2, _MM_SHUFFLE(2,3,0,1)); ++ ++#define LOAD_MSG_2_1(buf) \ ++t0 = _mm_unpackhi_epi32(m2,m3); \ ++t1 = _mm_blend_epi16(m3,m1,0x0C); \ ++t2 = _mm_blend_epi16(t0, t1, 0x0F); \ ++buf = _mm_shuffle_epi32(t2, _MM_SHUFFLE(3,1,0,2)); ++ ++#define LOAD_MSG_2_2(buf) \ ++t0 = _mm_unpacklo_epi32(m2,m0); \ ++t1 = _mm_blend_epi16(t0, m0, 0xF0); \ ++t2 = _mm_slli_si128(m3, 8); \ ++buf = _mm_blend_epi16(t1, t2, 0xC0); ++ ++#define LOAD_MSG_2_3(buf) \ ++t0 = _mm_blend_epi16(m0, m2, 0x3C); \ ++t1 = _mm_srli_si128(m1, 12); \ ++t2 = _mm_blend_epi16(t0,t1,0x03); \ ++buf = _mm_shuffle_epi32(t2, _MM_SHUFFLE(1,0,3,2)); ++ ++#define LOAD_MSG_2_4(buf) \ ++t0 = _mm_slli_si128(m3, 4); \ ++t1 = _mm_blend_epi16(m0, m1, 0x33); \ ++t2 = _mm_blend_epi16(t1, t0, 0xC0); \ ++buf = _mm_shuffle_epi32(t2, _MM_SHUFFLE(0,1,2,3)); ++ ++#define LOAD_MSG_3_1(buf) \ ++t0 = _mm_unpackhi_epi32(m0,m1); \ ++t1 = _mm_unpackhi_epi32(t0, m2); \ ++t2 = _mm_blend_epi16(t1, m3, 0x0C); \ ++buf = _mm_shuffle_epi32(t2, _MM_SHUFFLE(3,1,0,2)); ++ ++#define LOAD_MSG_3_2(buf) \ ++t0 = _mm_slli_si128(m2, 8); \ ++t1 = _mm_blend_epi16(m3,m0,0x0C); \ ++t2 = _mm_blend_epi16(t1, t0, 0xC0); \ ++buf = _mm_shuffle_epi32(t2, _MM_SHUFFLE(2,0,1,3)); ++ ++#define LOAD_MSG_3_3(buf) \ ++t0 = _mm_blend_epi16(m0,m1,0x0F); \ ++t1 = _mm_blend_epi16(t0, m3, 0xC0); \ ++buf = _mm_shuffle_epi32(t1, _MM_SHUFFLE(3,0,1,2)); ++ ++#define LOAD_MSG_3_4(buf) \ ++t0 = _mm_unpacklo_epi32(m0,m2); \ ++t1 = _mm_unpackhi_epi32(m1,m2); \ ++buf = _mm_unpacklo_epi64(t1,t0); ++ ++#define LOAD_MSG_4_1(buf) \ ++t0 = _mm_unpacklo_epi64(m1,m2); \ ++t1 = _mm_unpackhi_epi64(m0,m2); \ ++t2 = _mm_blend_epi16(t0,t1,0x33); \ ++buf = _mm_shuffle_epi32(t2, _MM_SHUFFLE(2,0,1,3)); ++ ++#define LOAD_MSG_4_2(buf) \ ++t0 = _mm_unpackhi_epi64(m1,m3); \ ++t1 = _mm_unpacklo_epi64(m0,m1); \ ++buf = _mm_blend_epi16(t0,t1,0x33); ++ ++#define LOAD_MSG_4_3(buf) \ ++t0 = _mm_unpackhi_epi64(m3,m1); \ ++t1 = _mm_unpackhi_epi64(m2,m0); \ ++buf = _mm_blend_epi16(t1,t0,0x33); ++ ++#define LOAD_MSG_4_4(buf) \ ++t0 = _mm_blend_epi16(m0,m2,0x03); \ ++t1 = _mm_slli_si128(t0, 8); \ ++t2 = _mm_blend_epi16(t1,m3,0x0F); \ ++buf = _mm_shuffle_epi32(t2, _MM_SHUFFLE(1,2,0,3)); ++ ++#define LOAD_MSG_5_1(buf) \ ++t0 = _mm_unpackhi_epi32(m0,m1); \ ++t1 = _mm_unpacklo_epi32(m0,m2); \ ++buf = _mm_unpacklo_epi64(t0,t1); ++ ++#define LOAD_MSG_5_2(buf) \ ++t0 = _mm_srli_si128(m2, 4); \ ++t1 = _mm_blend_epi16(m0,m3,0x03); \ ++buf = _mm_blend_epi16(t1,t0,0x3C); ++ ++#define LOAD_MSG_5_3(buf) \ ++t0 = _mm_blend_epi16(m1,m0,0x0C); \ ++t1 = _mm_srli_si128(m3, 4); \ ++t2 = _mm_blend_epi16(t0,t1,0x30); \ ++buf = _mm_shuffle_epi32(t2, _MM_SHUFFLE(1,2,3,0)); ++ ++#define LOAD_MSG_5_4(buf) \ ++t0 = _mm_unpacklo_epi64(m1,m2); \ ++t1= _mm_shuffle_epi32(m3, _MM_SHUFFLE(0,2,0,1)); \ ++buf = _mm_blend_epi16(t0,t1,0x33); ++ ++#define LOAD_MSG_6_1(buf) \ ++t0 = _mm_slli_si128(m1, 12); \ ++t1 = _mm_blend_epi16(m0,m3,0x33); \ ++buf = _mm_blend_epi16(t1,t0,0xC0); ++ ++#define LOAD_MSG_6_2(buf) \ ++t0 = _mm_blend_epi16(m3,m2,0x30); \ ++t1 = _mm_srli_si128(m1, 4); \ ++t2 = _mm_blend_epi16(t0,t1,0x03); \ ++buf = _mm_shuffle_epi32(t2, _MM_SHUFFLE(2,1,3,0)); ++ ++#define LOAD_MSG_6_3(buf) \ ++t0 = _mm_unpacklo_epi64(m0,m2); \ ++t1 = _mm_srli_si128(m1, 4); \ ++buf = _mm_shuffle_epi32(_mm_blend_epi16(t0,t1,0x0C), _MM_SHUFFLE(2,3,1,0)); ++ ++#define LOAD_MSG_6_4(buf) \ ++t0 = _mm_unpackhi_epi32(m1,m2); \ ++t1 = _mm_unpackhi_epi64(m0,t0); \ ++buf = _mm_shuffle_epi32(t1, _MM_SHUFFLE(3,0,1,2)); ++ ++#define LOAD_MSG_7_1(buf) \ ++t0 = _mm_unpackhi_epi32(m0,m1); \ ++t1 = _mm_blend_epi16(t0,m3,0x0F); \ ++buf = _mm_shuffle_epi32(t1,_MM_SHUFFLE(2,0,3,1)); ++ ++#define LOAD_MSG_7_2(buf) \ ++t0 = _mm_blend_epi16(m2,m3,0x30); \ ++t1 = _mm_srli_si128(m0,4); \ ++t2 = _mm_blend_epi16(t0,t1,0x03); \ ++buf = _mm_shuffle_epi32(t2, _MM_SHUFFLE(1,0,2,3)); ++ ++#define LOAD_MSG_7_3(buf) \ ++t0 = _mm_unpackhi_epi64(m0,m3); \ ++t1 = _mm_unpacklo_epi64(m1,m2); \ ++t2 = _mm_blend_epi16(t0,t1,0x3C); \ ++buf = _mm_shuffle_epi32(t2,_MM_SHUFFLE(0,2,3,1)); ++ ++#define LOAD_MSG_7_4(buf) \ ++t0 = _mm_unpacklo_epi32(m0,m1); \ ++t1 = _mm_unpackhi_epi32(m1,m2); \ ++buf = _mm_unpacklo_epi64(t0,t1); ++ ++#define LOAD_MSG_8_1(buf) \ ++t0 = _mm_unpackhi_epi32(m1,m3); \ ++t1 = _mm_unpacklo_epi64(t0,m0); \ ++t2 = _mm_blend_epi16(t1,m2,0xC0); \ ++buf = _mm_shufflehi_epi16(t2,_MM_SHUFFLE(1,0,3,2)); ++ ++#define LOAD_MSG_8_2(buf) \ ++t0 = _mm_unpackhi_epi32(m0,m3); \ ++t1 = _mm_blend_epi16(m2,t0,0xF0); \ ++buf = _mm_shuffle_epi32(t1,_MM_SHUFFLE(0,2,1,3)); ++ ++#define LOAD_MSG_8_3(buf) \ ++t0 = _mm_blend_epi16(m2,m0,0x0C); \ ++t1 = _mm_slli_si128(t0,4); \ ++buf = _mm_blend_epi16(t1,m3,0x0F); ++ ++#define LOAD_MSG_8_4(buf) \ ++t0 = _mm_blend_epi16(m1,m0,0x30); \ ++buf = _mm_shuffle_epi32(t0,_MM_SHUFFLE(1,0,3,2)); ++ ++#define LOAD_MSG_9_1(buf) \ ++t0 = _mm_blend_epi16(m0,m2,0x03); \ ++t1 = _mm_blend_epi16(m1,m2,0x30); \ ++t2 = _mm_blend_epi16(t1,t0,0x0F); \ ++buf = _mm_shuffle_epi32(t2,_MM_SHUFFLE(1,3,0,2)); ++ ++#define LOAD_MSG_9_2(buf) \ ++t0 = _mm_slli_si128(m0,4); \ ++t1 = _mm_blend_epi16(m1,t0,0xC0); \ ++buf = _mm_shuffle_epi32(t1,_MM_SHUFFLE(1,2,0,3)); ++ ++#define LOAD_MSG_9_3(buf) \ ++t0 = _mm_unpackhi_epi32(m0,m3); \ ++t1 = _mm_unpacklo_epi32(m2,m3); \ ++t2 = _mm_unpackhi_epi64(t0,t1); \ ++buf = _mm_shuffle_epi32(t2,_MM_SHUFFLE(3,0,2,1)); ++ ++#define LOAD_MSG_9_4(buf) \ ++t0 = _mm_blend_epi16(m3,m2,0xC0); \ ++t1 = _mm_unpacklo_epi32(m0,m3); \ ++t2 = _mm_blend_epi16(t0,t1,0x0F); \ ++buf = _mm_shuffle_epi32(t2,_MM_SHUFFLE(0,1,2,3)); ++ ++#endif +--- thirdparty/blake2/sse/blake2s-load-xop.h.orig 2025-09-03 12:27:32 UTC ++++ thirdparty/blake2/sse/blake2s-load-xop.h +@@ -0,0 +1,191 @@ ++/* ++ BLAKE2 reference source code package - optimized C implementations ++ ++ Copyright 2012, Samuel Neves <sneves@dei.uc.pt>. You may use this under the ++ terms of the CC0, the OpenSSL Licence, or the Apache Public License 2.0, at ++ your option. The terms of these licenses can be found at: ++ ++ - CC0 1.0 Universal : http://creativecommons.org/publicdomain/zero/1.0 ++ - OpenSSL license : https://www.openssl.org/source/license.html ++ - Apache 2.0 : http://www.apache.org/licenses/LICENSE-2.0 ++ ++ More information about the BLAKE2 hash function can be found at ++ https://blake2.net. ++*/ ++#ifndef BLAKE2S_LOAD_XOP_H ++#define BLAKE2S_LOAD_XOP_H ++ ++#define TOB(x) ((x)*4*0x01010101 + 0x03020100) /* ..or not TOB */ ++ ++#if 0 ++/* Basic VPPERM emulation, for testing purposes */ ++static __m128i _mm_perm_epi8(const __m128i src1, const __m128i src2, const __m128i sel) ++{ ++ const __m128i sixteen = _mm_set1_epi8(16); ++ const __m128i t0 = _mm_shuffle_epi8(src1, sel); ++ const __m128i s1 = _mm_shuffle_epi8(src2, _mm_sub_epi8(sel, sixteen)); ++ const __m128i mask = _mm_or_si128(_mm_cmpeq_epi8(sel, sixteen), ++ _mm_cmpgt_epi8(sel, sixteen)); /* (>=16) = 0xff : 00 */ ++ return _mm_blendv_epi8(t0, s1, mask); ++} ++#endif ++ ++#define LOAD_MSG_0_1(buf) \ ++buf = _mm_perm_epi8(m0, m1, _mm_set_epi32(TOB(6),TOB(4),TOB(2),TOB(0)) ); ++ ++#define LOAD_MSG_0_2(buf) \ ++buf = _mm_perm_epi8(m0, m1, _mm_set_epi32(TOB(7),TOB(5),TOB(3),TOB(1)) ); ++ ++#define LOAD_MSG_0_3(buf) \ ++buf = _mm_perm_epi8(m2, m3, _mm_set_epi32(TOB(6),TOB(4),TOB(2),TOB(0)) ); ++ ++#define LOAD_MSG_0_4(buf) \ ++buf = _mm_perm_epi8(m2, m3, _mm_set_epi32(TOB(7),TOB(5),TOB(3),TOB(1)) ); ++ ++#define LOAD_MSG_1_1(buf) \ ++t0 = _mm_perm_epi8(m1, m2, _mm_set_epi32(TOB(0),TOB(5),TOB(0),TOB(0)) ); \ ++buf = _mm_perm_epi8(t0, m3, _mm_set_epi32(TOB(5),TOB(2),TOB(1),TOB(6)) ); ++ ++#define LOAD_MSG_1_2(buf) \ ++t1 = _mm_perm_epi8(m1, m2, _mm_set_epi32(TOB(2),TOB(0),TOB(4),TOB(6)) ); \ ++buf = _mm_perm_epi8(t1, m3, _mm_set_epi32(TOB(3),TOB(7),TOB(1),TOB(0)) ); ++ ++#define LOAD_MSG_1_3(buf) \ ++t0 = _mm_perm_epi8(m0, m1, _mm_set_epi32(TOB(5),TOB(0),TOB(0),TOB(1)) ); \ ++buf = _mm_perm_epi8(t0, m2, _mm_set_epi32(TOB(3),TOB(7),TOB(1),TOB(0)) ); ++ ++#define LOAD_MSG_1_4(buf) \ ++t1 = _mm_perm_epi8(m0, m1, _mm_set_epi32(TOB(3),TOB(7),TOB(2),TOB(0)) ); \ ++buf = _mm_perm_epi8(t1, m3, _mm_set_epi32(TOB(3),TOB(2),TOB(1),TOB(4)) ); ++ ++#define LOAD_MSG_2_1(buf) \ ++t0 = _mm_perm_epi8(m1, m2, _mm_set_epi32(TOB(0),TOB(1),TOB(0),TOB(7)) ); \ ++buf = _mm_perm_epi8(t0, m3, _mm_set_epi32(TOB(7),TOB(2),TOB(4),TOB(0)) ); ++ ++#define LOAD_MSG_2_2(buf) \ ++t1 = _mm_perm_epi8(m0, m2, _mm_set_epi32(TOB(0),TOB(2),TOB(0),TOB(4)) ); \ ++buf = _mm_perm_epi8(t1, m3, _mm_set_epi32(TOB(5),TOB(2),TOB(1),TOB(0)) ); ++ ++#define LOAD_MSG_2_3(buf) \ ++t0 = _mm_perm_epi8(m0, m1, _mm_set_epi32(TOB(0),TOB(7),TOB(3),TOB(0)) ); \ ++buf = _mm_perm_epi8(t0, m2, _mm_set_epi32(TOB(5),TOB(2),TOB(1),TOB(6)) ); ++ ++#define LOAD_MSG_2_4(buf) \ ++t1 = _mm_perm_epi8(m0, m1, _mm_set_epi32(TOB(4),TOB(1),TOB(6),TOB(0)) ); \ ++buf = _mm_perm_epi8(t1, m3, _mm_set_epi32(TOB(3),TOB(2),TOB(1),TOB(6)) ); ++ ++#define LOAD_MSG_3_1(buf) \ ++t0 = _mm_perm_epi8(m0, m1, _mm_set_epi32(TOB(0),TOB(0),TOB(3),TOB(7)) ); \ ++t0 = _mm_perm_epi8(t0, m2, _mm_set_epi32(TOB(7),TOB(2),TOB(1),TOB(0)) ); \ ++buf = _mm_perm_epi8(t0, m3, _mm_set_epi32(TOB(3),TOB(5),TOB(1),TOB(0)) ); ++ ++#define LOAD_MSG_3_2(buf) \ ++t1 = _mm_perm_epi8(m0, m2, _mm_set_epi32(TOB(0),TOB(0),TOB(1),TOB(5)) ); \ ++buf = _mm_perm_epi8(t1, m3, _mm_set_epi32(TOB(6),TOB(4),TOB(1),TOB(0)) ); ++ ++#define LOAD_MSG_3_3(buf) \ ++t0 = _mm_perm_epi8(m0, m1, _mm_set_epi32(TOB(0),TOB(4),TOB(5),TOB(2)) ); \ ++buf = _mm_perm_epi8(t0, m3, _mm_set_epi32(TOB(7),TOB(2),TOB(1),TOB(0)) ); ++ ++#define LOAD_MSG_3_4(buf) \ ++t1 = _mm_perm_epi8(m0, m1, _mm_set_epi32(TOB(0),TOB(0),TOB(0),TOB(6)) ); \ ++buf = _mm_perm_epi8(t1, m2, _mm_set_epi32(TOB(4),TOB(2),TOB(6),TOB(0)) ); ++ ++#define LOAD_MSG_4_1(buf) \ ++t0 = _mm_perm_epi8(m0, m1, _mm_set_epi32(TOB(0),TOB(2),TOB(5),TOB(0)) ); \ ++buf = _mm_perm_epi8(t0, m2, _mm_set_epi32(TOB(6),TOB(2),TOB(1),TOB(5)) ); ++ ++#define LOAD_MSG_4_2(buf) \ ++t1 = _mm_perm_epi8(m0, m1, _mm_set_epi32(TOB(0),TOB(4),TOB(7),TOB(0)) ); \ ++buf = _mm_perm_epi8(t1, m3, _mm_set_epi32(TOB(7),TOB(2),TOB(1),TOB(0)) ); ++ ++#define LOAD_MSG_4_3(buf) \ ++t0 = _mm_perm_epi8(m0, m1, _mm_set_epi32(TOB(3),TOB(6),TOB(0),TOB(0)) ); \ ++t0 = _mm_perm_epi8(t0, m2, _mm_set_epi32(TOB(3),TOB(2),TOB(7),TOB(0)) ); \ ++buf = _mm_perm_epi8(t0, m3, _mm_set_epi32(TOB(3),TOB(2),TOB(1),TOB(6)) ); ++ ++#define LOAD_MSG_4_4(buf) \ ++t1 = _mm_perm_epi8(m0, m2, _mm_set_epi32(TOB(0),TOB(4),TOB(0),TOB(1)) ); \ ++buf = _mm_perm_epi8(t1, m3, _mm_set_epi32(TOB(5),TOB(2),TOB(4),TOB(0)) ); ++ ++#define LOAD_MSG_5_1(buf) \ ++t0 = _mm_perm_epi8(m0, m1, _mm_set_epi32(TOB(0),TOB(0),TOB(6),TOB(2)) ); \ ++buf = _mm_perm_epi8(t0, m2, _mm_set_epi32(TOB(4),TOB(2),TOB(1),TOB(0)) ); ++ ++#define LOAD_MSG_5_2(buf) \ ++t1 = _mm_perm_epi8(m0, m2, _mm_set_epi32(TOB(3),TOB(7),TOB(6),TOB(0)) ); \ ++buf = _mm_perm_epi8(t1, m3, _mm_set_epi32(TOB(3),TOB(2),TOB(1),TOB(4)) ); ++ ++#define LOAD_MSG_5_3(buf) \ ++t0 = _mm_perm_epi8(m0, m1, _mm_set_epi32(TOB(1),TOB(0),TOB(7),TOB(4)) ); \ ++buf = _mm_perm_epi8(t0, m3, _mm_set_epi32(TOB(3),TOB(7),TOB(1),TOB(0)) ); ++ ++#define LOAD_MSG_5_4(buf) \ ++t1 = _mm_perm_epi8(m1, m2, _mm_set_epi32(TOB(5),TOB(0),TOB(1),TOB(0)) ); \ ++buf = _mm_perm_epi8(t1, m3, _mm_set_epi32(TOB(3),TOB(6),TOB(1),TOB(5)) ); ++ ++#define LOAD_MSG_6_1(buf) \ ++t0 = _mm_perm_epi8(m0, m1, _mm_set_epi32(TOB(4),TOB(0),TOB(1),TOB(0)) ); \ ++buf = _mm_perm_epi8(t0, m3, _mm_set_epi32(TOB(3),TOB(6),TOB(1),TOB(4)) ); ++ ++#define LOAD_MSG_6_2(buf) \ ++t1 = _mm_perm_epi8(m1, m2, _mm_set_epi32(TOB(6),TOB(0),TOB(0),TOB(1)) ); \ ++buf = _mm_perm_epi8(t1, m3, _mm_set_epi32(TOB(3),TOB(5),TOB(7),TOB(0)) ); ++ ++#define LOAD_MSG_6_3(buf) \ ++t0 = _mm_perm_epi8(m0, m1, _mm_set_epi32(TOB(0),TOB(0),TOB(6),TOB(0)) ); \ ++buf = _mm_perm_epi8(t0, m2, _mm_set_epi32(TOB(4),TOB(5),TOB(1),TOB(0)) ); ++ ++#define LOAD_MSG_6_4(buf) \ ++t1 = _mm_perm_epi8(m0, m1, _mm_set_epi32(TOB(0),TOB(2),TOB(3),TOB(7)) ); \ ++buf = _mm_perm_epi8(t1, m2, _mm_set_epi32(TOB(7),TOB(2),TOB(1),TOB(0)) ); ++ ++#define LOAD_MSG_7_1(buf) \ ++t0 = _mm_perm_epi8(m0, m1, _mm_set_epi32(TOB(3),TOB(0),TOB(7),TOB(0)) ); \ ++buf = _mm_perm_epi8(t0, m3, _mm_set_epi32(TOB(3),TOB(4),TOB(1),TOB(5)) ); ++ ++#define LOAD_MSG_7_2(buf) \ ++t1 = _mm_perm_epi8(m0, m2, _mm_set_epi32(TOB(5),TOB(1),TOB(0),TOB(7)) ); \ ++buf = _mm_perm_epi8(t1, m3, _mm_set_epi32(TOB(3),TOB(2),TOB(6),TOB(0)) ); ++ ++#define LOAD_MSG_7_3(buf) \ ++t0 = _mm_perm_epi8(m0, m1, _mm_set_epi32(TOB(2),TOB(0),TOB(0),TOB(5)) ); \ ++t0 = _mm_perm_epi8(t0, m2, _mm_set_epi32(TOB(3),TOB(4),TOB(1),TOB(0)) ); \ ++buf = _mm_perm_epi8(t0, m3, _mm_set_epi32(TOB(3),TOB(2),TOB(7),TOB(0)) ); ++ ++#define LOAD_MSG_7_4(buf) \ ++t1 = _mm_perm_epi8(m0, m1, _mm_set_epi32(TOB(0),TOB(6),TOB(4),TOB(0)) ); \ ++buf = _mm_perm_epi8(t1, m2, _mm_set_epi32(TOB(6),TOB(2),TOB(1),TOB(0)) ); ++ ++#define LOAD_MSG_8_1(buf) \ ++t0 = _mm_perm_epi8(m0, m1, _mm_set_epi32(TOB(0),TOB(0),TOB(0),TOB(6)) ); \ ++t0 = _mm_perm_epi8(t0, m2, _mm_set_epi32(TOB(3),TOB(7),TOB(1),TOB(0)) ); \ ++buf = _mm_perm_epi8(t0, m3, _mm_set_epi32(TOB(3),TOB(2),TOB(6),TOB(0)) ); ++ ++#define LOAD_MSG_8_2(buf) \ ++t1 = _mm_perm_epi8(m0, m2, _mm_set_epi32(TOB(4),TOB(3),TOB(5),TOB(0)) ); \ ++buf = _mm_perm_epi8(t1, m3, _mm_set_epi32(TOB(3),TOB(2),TOB(1),TOB(7)) ); ++ ++#define LOAD_MSG_8_3(buf) \ ++t0 = _mm_perm_epi8(m0, m2, _mm_set_epi32(TOB(6),TOB(1),TOB(0),TOB(0)) ); \ ++buf = _mm_perm_epi8(t0, m3, _mm_set_epi32(TOB(3),TOB(2),TOB(5),TOB(4)) ); \ ++ ++#define LOAD_MSG_8_4(buf) \ ++buf = _mm_perm_epi8(m0, m1, _mm_set_epi32(TOB(5),TOB(4),TOB(7),TOB(2)) ); ++ ++#define LOAD_MSG_9_1(buf) \ ++t0 = _mm_perm_epi8(m0, m1, _mm_set_epi32(TOB(1),TOB(7),TOB(0),TOB(0)) ); \ ++buf = _mm_perm_epi8(t0, m2, _mm_set_epi32(TOB(3),TOB(2),TOB(4),TOB(6)) ); ++ ++#define LOAD_MSG_9_2(buf) \ ++buf = _mm_perm_epi8(m0, m1, _mm_set_epi32(TOB(5),TOB(6),TOB(4),TOB(2)) ); ++ ++#define LOAD_MSG_9_3(buf) \ ++t0 = _mm_perm_epi8(m0, m2, _mm_set_epi32(TOB(0),TOB(3),TOB(5),TOB(0)) ); \ ++buf = _mm_perm_epi8(t0, m3, _mm_set_epi32(TOB(5),TOB(2),TOB(1),TOB(7)) ); ++ ++#define LOAD_MSG_9_4(buf) \ ++t1 = _mm_perm_epi8(m0, m2, _mm_set_epi32(TOB(0),TOB(0),TOB(0),TOB(7)) ); \ ++buf = _mm_perm_epi8(t1, m3, _mm_set_epi32(TOB(3),TOB(4),TOB(6),TOB(0)) ); ++ ++#endif +--- thirdparty/blake2/sse/blake2s-round.h.orig 2025-09-03 12:27:32 UTC ++++ thirdparty/blake2/sse/blake2s-round.h +@@ -0,0 +1,88 @@ ++/* ++ BLAKE2 reference source code package - optimized C implementations ++ ++ Copyright 2012, Samuel Neves <sneves@dei.uc.pt>. You may use this under the ++ terms of the CC0, the OpenSSL Licence, or the Apache Public License 2.0, at ++ your option. The terms of these licenses can be found at: ++ ++ - CC0 1.0 Universal : http://creativecommons.org/publicdomain/zero/1.0 ++ - OpenSSL license : https://www.openssl.org/source/license.html ++ - Apache 2.0 : http://www.apache.org/licenses/LICENSE-2.0 ++ ++ More information about the BLAKE2 hash function can be found at ++ https://blake2.net. ++*/ ++#ifndef BLAKE2S_ROUND_H ++#define BLAKE2S_ROUND_H ++ ++#define LOADU(p) _mm_loadu_si128( (const __m128i *)(p) ) ++#define STOREU(p,r) _mm_storeu_si128((__m128i *)(p), r) ++ ++#define TOF(reg) _mm_castsi128_ps((reg)) ++#define TOI(reg) _mm_castps_si128((reg)) ++ ++#define LIKELY(x) __builtin_expect((x),1) ++ ++ ++/* Microarchitecture-specific macros */ ++#ifndef HAVE_XOP ++#ifdef HAVE_SSSE3 ++#define _mm_roti_epi32(r, c) ( \ ++ (8==-(c)) ? _mm_shuffle_epi8(r,r8) \ ++ : (16==-(c)) ? _mm_shuffle_epi8(r,r16) \ ++ : _mm_xor_si128(_mm_srli_epi32( (r), -(c) ),_mm_slli_epi32( (r), 32-(-(c)) )) ) ++#else ++#define _mm_roti_epi32(r, c) _mm_xor_si128(_mm_srli_epi32( (r), -(c) ),_mm_slli_epi32( (r), 32-(-(c)) )) ++#endif ++#else ++/* ... */ ++#endif ++ ++ ++#define G1(row1,row2,row3,row4,buf) \ ++ row1 = _mm_add_epi32( _mm_add_epi32( row1, buf), row2 ); \ ++ row4 = _mm_xor_si128( row4, row1 ); \ ++ row4 = _mm_roti_epi32(row4, -16); \ ++ row3 = _mm_add_epi32( row3, row4 ); \ ++ row2 = _mm_xor_si128( row2, row3 ); \ ++ row2 = _mm_roti_epi32(row2, -12); ++ ++#define G2(row1,row2,row3,row4,buf) \ ++ row1 = _mm_add_epi32( _mm_add_epi32( row1, buf), row2 ); \ ++ row4 = _mm_xor_si128( row4, row1 ); \ ++ row4 = _mm_roti_epi32(row4, -8); \ ++ row3 = _mm_add_epi32( row3, row4 ); \ ++ row2 = _mm_xor_si128( row2, row3 ); \ ++ row2 = _mm_roti_epi32(row2, -7); ++ ++#define DIAGONALIZE(row1,row2,row3,row4) \ ++ row4 = _mm_shuffle_epi32( row4, _MM_SHUFFLE(2,1,0,3) ); \ ++ row3 = _mm_shuffle_epi32( row3, _MM_SHUFFLE(1,0,3,2) ); \ ++ row2 = _mm_shuffle_epi32( row2, _MM_SHUFFLE(0,3,2,1) ); ++ ++#define UNDIAGONALIZE(row1,row2,row3,row4) \ ++ row4 = _mm_shuffle_epi32( row4, _MM_SHUFFLE(0,3,2,1) ); \ ++ row3 = _mm_shuffle_epi32( row3, _MM_SHUFFLE(1,0,3,2) ); \ ++ row2 = _mm_shuffle_epi32( row2, _MM_SHUFFLE(2,1,0,3) ); ++ ++#if defined(HAVE_XOP) ++#include "blake2s-load-xop.h" ++#elif defined(HAVE_SSE41) ++#include "blake2s-load-sse41.h" ++#else ++#include "blake2s-load-sse2.h" ++#endif ++ ++#define ROUND(r) \ ++ LOAD_MSG_ ##r ##_1(buf1); \ ++ G1(row1,row2,row3,row4,buf1); \ ++ LOAD_MSG_ ##r ##_2(buf2); \ ++ G2(row1,row2,row3,row4,buf2); \ ++ DIAGONALIZE(row1,row2,row3,row4); \ ++ LOAD_MSG_ ##r ##_3(buf3); \ ++ G1(row1,row2,row3,row4,buf3); \ ++ LOAD_MSG_ ##r ##_4(buf4); \ ++ G2(row1,row2,row3,row4,buf4); \ ++ UNDIAGONALIZE(row1,row2,row3,row4); \ ++ ++#endif +--- thirdparty/blake2/sse/blake2s.c.orig 2025-09-03 12:27:32 UTC ++++ thirdparty/blake2/sse/blake2s.c +@@ -0,0 +1,363 @@ ++/* ++ BLAKE2 reference source code package - optimized C implementations ++ ++ Copyright 2012, Samuel Neves <sneves@dei.uc.pt>. You may use this under the ++ terms of the CC0, the OpenSSL Licence, or the Apache Public License 2.0, at ++ your option. The terms of these licenses can be found at: ++ ++ - CC0 1.0 Universal : http://creativecommons.org/publicdomain/zero/1.0 ++ - OpenSSL license : https://www.openssl.org/source/license.html ++ - Apache 2.0 : http://www.apache.org/licenses/LICENSE-2.0 ++ ++ More information about the BLAKE2 hash function can be found at ++ https://blake2.net. ++*/ ++ ++#include <stdint.h> ++#include <string.h> ++#include <stdio.h> ++ ++#include "blake2.h" ++#include "blake2-impl.h" ++ ++#include "blake2-config.h" ++ ++ ++#include <emmintrin.h> ++#if defined(HAVE_SSSE3) ++#include <tmmintrin.h> ++#endif ++#if defined(HAVE_SSE41) ++#include <smmintrin.h> ++#endif ++#if defined(HAVE_AVX) ++#include <immintrin.h> ++#endif ++#if defined(HAVE_XOP) ++#include <x86intrin.h> ++#endif ++ ++#include "blake2s-round.h" ++ ++static const uint32_t blake2s_IV[8] = ++{ ++ 0x6A09E667UL, 0xBB67AE85UL, 0x3C6EF372UL, 0xA54FF53AUL, ++ 0x510E527FUL, 0x9B05688CUL, 0x1F83D9ABUL, 0x5BE0CD19UL ++}; ++ ++/* Some helper functions */ ++static void blake2s_set_lastnode( blake2s_state *S ) ++{ ++ S->f[1] = (uint32_t)-1; ++} ++ ++static int blake2s_is_lastblock( const blake2s_state *S ) ++{ ++ return S->f[0] != 0; ++} ++ ++static void blake2s_set_lastblock( blake2s_state *S ) ++{ ++ if( S->last_node ) blake2s_set_lastnode( S ); ++ ++ S->f[0] = (uint32_t)-1; ++} ++ ++static void blake2s_increment_counter( blake2s_state *S, const uint32_t inc ) ++{ ++ uint64_t t = ( ( uint64_t )S->t[1] << 32 ) | S->t[0]; ++ t += inc; ++ S->t[0] = ( uint32_t )( t >> 0 ); ++ S->t[1] = ( uint32_t )( t >> 32 ); ++} ++ ++/* init2 xors IV with input parameter block */ ++int blake2s_init_param( blake2s_state *S, const blake2s_param *P ) ++{ ++ size_t i; ++ /*blake2s_init0( S ); */ ++ const uint8_t * v = ( const uint8_t * )( blake2s_IV ); ++ const uint8_t * p = ( const uint8_t * )( P ); ++ uint8_t * h = ( uint8_t * )( S->h ); ++ /* IV XOR ParamBlock */ ++ memset( S, 0, sizeof( blake2s_state ) ); ++ ++ for( i = 0; i < BLAKE2S_OUTBYTES; ++i ) h[i] = v[i] ^ p[i]; ++ ++ S->outlen = P->digest_length; ++ return 0; ++} ++ ++ ++/* Some sort of default parameter block initialization, for sequential blake2s */ ++int blake2s_init( blake2s_state *S, size_t outlen ) ++{ ++ blake2s_param P[1]; ++ ++ /* Move interval verification here? */ ++ if ( ( !outlen ) || ( outlen > BLAKE2S_OUTBYTES ) ) return -1; ++ ++ P->digest_length = (uint8_t)outlen; ++ P->key_length = 0; ++ P->fanout = 1; ++ P->depth = 1; ++ store32( &P->leaf_length, 0 ); ++ store32( &P->node_offset, 0 ); ++ store16( &P->xof_length, 0 ); ++ P->node_depth = 0; ++ P->inner_length = 0; ++ /* memset(P->reserved, 0, sizeof(P->reserved) ); */ ++ memset( P->salt, 0, sizeof( P->salt ) ); ++ memset( P->personal, 0, sizeof( P->personal ) ); ++ ++ return blake2s_init_param( S, P ); ++} ++ ++ ++int blake2s_init_key( blake2s_state *S, size_t outlen, const void *key, size_t keylen ) ++{ ++ blake2s_param P[1]; ++ ++ /* Move interval verification here? */ ++ if ( ( !outlen ) || ( outlen > BLAKE2S_OUTBYTES ) ) return -1; ++ ++ if ( ( !key ) || ( !keylen ) || keylen > BLAKE2S_KEYBYTES ) return -1; ++ ++ P->digest_length = (uint8_t)outlen; ++ P->key_length = (uint8_t)keylen; ++ P->fanout = 1; ++ P->depth = 1; ++ store32( &P->leaf_length, 0 ); ++ store32( &P->node_offset, 0 ); ++ store16( &P->xof_length, 0 ); ++ P->node_depth = 0; ++ P->inner_length = 0; ++ /* memset(P->reserved, 0, sizeof(P->reserved) ); */ ++ memset( P->salt, 0, sizeof( P->salt ) ); ++ memset( P->personal, 0, sizeof( P->personal ) ); ++ ++ if( blake2s_init_param( S, P ) < 0 ) ++ return -1; ++ ++ { ++ uint8_t block[BLAKE2S_BLOCKBYTES]; ++ memset( block, 0, BLAKE2S_BLOCKBYTES ); ++ memcpy( block, key, keylen ); ++ blake2s_update( S, block, BLAKE2S_BLOCKBYTES ); ++ secure_zero_memory( block, BLAKE2S_BLOCKBYTES ); /* Burn the key from stack */ ++ } ++ return 0; ++} ++ ++ ++static void blake2s_compress( blake2s_state *S, const uint8_t block[BLAKE2S_BLOCKBYTES] ) ++{ ++ __m128i row1, row2, row3, row4; ++ __m128i buf1, buf2, buf3, buf4; ++#if defined(HAVE_SSE41) ++ __m128i t0, t1; ++#if !defined(HAVE_XOP) ++ __m128i t2; ++#endif ++#endif ++ __m128i ff0, ff1; ++#if defined(HAVE_SSSE3) && !defined(HAVE_XOP) ++ const __m128i r8 = _mm_set_epi8( 12, 15, 14, 13, 8, 11, 10, 9, 4, 7, 6, 5, 0, 3, 2, 1 ); ++ const __m128i r16 = _mm_set_epi8( 13, 12, 15, 14, 9, 8, 11, 10, 5, 4, 7, 6, 1, 0, 3, 2 ); ++#endif ++#if defined(HAVE_SSE41) ++ const __m128i m0 = LOADU( block + 00 ); ++ const __m128i m1 = LOADU( block + 16 ); ++ const __m128i m2 = LOADU( block + 32 ); ++ const __m128i m3 = LOADU( block + 48 ); ++#else ++ const uint32_t m0 = load32(block + 0 * sizeof(uint32_t)); ++ const uint32_t m1 = load32(block + 1 * sizeof(uint32_t)); ++ const uint32_t m2 = load32(block + 2 * sizeof(uint32_t)); ++ const uint32_t m3 = load32(block + 3 * sizeof(uint32_t)); ++ const uint32_t m4 = load32(block + 4 * sizeof(uint32_t)); ++ const uint32_t m5 = load32(block + 5 * sizeof(uint32_t)); ++ const uint32_t m6 = load32(block + 6 * sizeof(uint32_t)); ++ const uint32_t m7 = load32(block + 7 * sizeof(uint32_t)); ++ const uint32_t m8 = load32(block + 8 * sizeof(uint32_t)); ++ const uint32_t m9 = load32(block + 9 * sizeof(uint32_t)); ++ const uint32_t m10 = load32(block + 10 * sizeof(uint32_t)); ++ const uint32_t m11 = load32(block + 11 * sizeof(uint32_t)); ++ const uint32_t m12 = load32(block + 12 * sizeof(uint32_t)); ++ const uint32_t m13 = load32(block + 13 * sizeof(uint32_t)); ++ const uint32_t m14 = load32(block + 14 * sizeof(uint32_t)); ++ const uint32_t m15 = load32(block + 15 * sizeof(uint32_t)); ++#endif ++ row1 = ff0 = LOADU( &S->h[0] ); ++ row2 = ff1 = LOADU( &S->h[4] ); ++ row3 = _mm_loadu_si128( (__m128i const *)&blake2s_IV[0] ); ++ row4 = _mm_xor_si128( _mm_loadu_si128( (__m128i const *)&blake2s_IV[4] ), LOADU( &S->t[0] ) ); ++ ROUND( 0 ); ++ ROUND( 1 ); ++ ROUND( 2 ); ++ ROUND( 3 ); ++ ROUND( 4 ); ++ ROUND( 5 ); ++ ROUND( 6 ); ++ ROUND( 7 ); ++ ROUND( 8 ); ++ ROUND( 9 ); ++ STOREU( &S->h[0], _mm_xor_si128( ff0, _mm_xor_si128( row1, row3 ) ) ); ++ STOREU( &S->h[4], _mm_xor_si128( ff1, _mm_xor_si128( row2, row4 ) ) ); ++} ++ ++int blake2s_update( blake2s_state *S, const void *pin, size_t inlen ) ++{ ++ const unsigned char * in = (const unsigned char *)pin; ++ if( inlen > 0 ) ++ { ++ size_t left = S->buflen; ++ size_t fill = BLAKE2S_BLOCKBYTES - left; ++ if( inlen > fill ) ++ { ++ S->buflen = 0; ++ memcpy( S->buf + left, in, fill ); /* Fill buffer */ ++ blake2s_increment_counter( S, BLAKE2S_BLOCKBYTES ); ++ blake2s_compress( S, S->buf ); /* Compress */ ++ in += fill; inlen -= fill; ++ while(inlen > BLAKE2S_BLOCKBYTES) { ++ blake2s_increment_counter(S, BLAKE2S_BLOCKBYTES); ++ blake2s_compress( S, in ); ++ in += BLAKE2S_BLOCKBYTES; ++ inlen -= BLAKE2S_BLOCKBYTES; ++ } ++ } ++ memcpy( S->buf + S->buflen, in, inlen ); ++ S->buflen += inlen; ++ } ++ return 0; ++} ++ ++int blake2s_final( blake2s_state *S, void *out, size_t outlen ) ++{ ++ uint8_t buffer[BLAKE2S_OUTBYTES] = {0}; ++ size_t i; ++ ++ if( out == NULL || outlen < S->outlen ) ++ return -1; ++ ++ if( blake2s_is_lastblock( S ) ) ++ return -1; ++ ++ blake2s_increment_counter( S, (uint32_t)S->buflen ); ++ blake2s_set_lastblock( S ); ++ memset( S->buf + S->buflen, 0, BLAKE2S_BLOCKBYTES - S->buflen ); /* Padding */ ++ blake2s_compress( S, S->buf ); ++ ++ for( i = 0; i < 8; ++i ) /* Output full hash to temp buffer */ ++ store32( buffer + sizeof( S->h[i] ) * i, S->h[i] ); ++ ++ memcpy( out, buffer, S->outlen ); ++ secure_zero_memory( buffer, sizeof(buffer) ); ++ return 0; ++} ++ ++/* inlen, at least, should be uint64_t. Others can be size_t. */ ++int blake2s( void *out, size_t outlen, const void *in, size_t inlen, const void *key, size_t keylen ) ++{ ++ blake2s_state S[1]; ++ ++ /* Verify parameters */ ++ if ( NULL == in && inlen > 0 ) return -1; ++ ++ if ( NULL == out ) return -1; ++ ++ if ( NULL == key && keylen > 0) return -1; ++ ++ if( !outlen || outlen > BLAKE2S_OUTBYTES ) return -1; ++ ++ if( keylen > BLAKE2S_KEYBYTES ) return -1; ++ ++ if( keylen > 0 ) ++ { ++ if( blake2s_init_key( S, outlen, key, keylen ) < 0 ) return -1; ++ } ++ else ++ { ++ if( blake2s_init( S, outlen ) < 0 ) return -1; ++ } ++ ++ blake2s_update( S, ( const uint8_t * )in, inlen ); ++ blake2s_final( S, out, outlen ); ++ return 0; ++} ++ ++#if defined(SUPERCOP) ++int crypto_hash( unsigned char *out, unsigned char *in, unsigned long long inlen ) ++{ ++ return blake2s( out, BLAKE2S_OUTBYTES, in, inlen, NULL, 0 ); ++} ++#endif ++ ++#if defined(BLAKE2S_SELFTEST) ++#include <string.h> ++#include "blake2-kat.h" ++int main( void ) ++{ ++ uint8_t key[BLAKE2S_KEYBYTES]; ++ uint8_t buf[BLAKE2_KAT_LENGTH]; ++ size_t i, step; ++ ++ for( i = 0; i < BLAKE2S_KEYBYTES; ++i ) ++ key[i] = ( uint8_t )i; ++ ++ for( i = 0; i < BLAKE2_KAT_LENGTH; ++i ) ++ buf[i] = ( uint8_t )i; ++ ++ /* Test simple API */ ++ for( i = 0; i < BLAKE2_KAT_LENGTH; ++i ) ++ { ++ uint8_t hash[BLAKE2S_OUTBYTES]; ++ blake2s( hash, BLAKE2S_OUTBYTES, buf, i, key, BLAKE2S_KEYBYTES ); ++ ++ if( 0 != memcmp( hash, blake2s_keyed_kat[i], BLAKE2S_OUTBYTES ) ) ++ { ++ goto fail; ++ } ++ } ++ ++ /* Test streaming API */ ++ for(step = 1; step < BLAKE2S_BLOCKBYTES; ++step) { ++ for (i = 0; i < BLAKE2_KAT_LENGTH; ++i) { ++ uint8_t hash[BLAKE2S_OUTBYTES]; ++ blake2s_state S; ++ uint8_t * p = buf; ++ size_t mlen = i; ++ int err = 0; ++ ++ if( (err = blake2s_init_key(&S, BLAKE2S_OUTBYTES, key, BLAKE2S_KEYBYTES)) < 0 ) { ++ goto fail; ++ } ++ ++ while (mlen >= step) { ++ if ( (err = blake2s_update(&S, p, step)) < 0 ) { ++ goto fail; ++ } ++ mlen -= step; ++ p += step; ++ } ++ if ( (err = blake2s_update(&S, p, mlen)) < 0) { ++ goto fail; ++ } ++ if ( (err = blake2s_final(&S, hash, BLAKE2S_OUTBYTES)) < 0) { ++ goto fail; ++ } ++ ++ if (0 != memcmp(hash, blake2s_keyed_kat[i], BLAKE2S_OUTBYTES)) { ++ goto fail; ++ } ++ } ++ } ++ ++ puts( "ok" ); ++ return 0; ++fail: ++ puts("error"); ++ return -1; ++} ++#endif +--- thirdparty/blake2/sse/blake2sp.c.orig 2025-09-03 12:27:32 UTC ++++ thirdparty/blake2/sse/blake2sp.c +@@ -0,0 +1,358 @@ ++/* ++ BLAKE2 reference source code package - optimized C implementations ++ ++ Copyright 2012, Samuel Neves <sneves@dei.uc.pt>. You may use this under the ++ terms of the CC0, the OpenSSL Licence, or the Apache Public License 2.0, at ++ your option. The terms of these licenses can be found at: ++ ++ - CC0 1.0 Universal : http://creativecommons.org/publicdomain/zero/1.0 ++ - OpenSSL license : https://www.openssl.org/source/license.html ++ - Apache 2.0 : http://www.apache.org/licenses/LICENSE-2.0 ++ ++ More information about the BLAKE2 hash function can be found at ++ https://blake2.net. ++*/ ++ ++#include <stdlib.h> ++#include <string.h> ++#include <stdio.h> ++ ++#if defined(_OPENMP) ++#include <omp.h> ++#endif ++ ++#include "blake2.h" ++#include "blake2-impl.h" ++ ++#define PARALLELISM_DEGREE 8 ++ ++/* ++ blake2sp_init_param defaults to setting the expecting output length ++ from the digest_length parameter block field. ++ ++ In some cases, however, we do not want this, as the output length ++ of these instances is given by inner_length instead. ++*/ ++static int blake2sp_init_leaf_param( blake2s_state *S, const blake2s_param *P ) ++{ ++ int err = blake2s_init_param(S, P); ++ S->outlen = P->inner_length; ++ return err; ++} ++ ++static int blake2sp_init_leaf( blake2s_state *S, size_t outlen, size_t keylen, uint64_t offset ) ++{ ++ blake2s_param P[1]; ++ P->digest_length = (uint8_t)outlen; ++ P->key_length = (uint8_t)keylen; ++ P->fanout = PARALLELISM_DEGREE; ++ P->depth = 2; ++ P->leaf_length = 0; ++ P->node_offset = offset; ++ P->xof_length = 0; ++ P->node_depth = 0; ++ P->inner_length = BLAKE2S_OUTBYTES; ++ memset( P->salt, 0, sizeof( P->salt ) ); ++ memset( P->personal, 0, sizeof( P->personal ) ); ++ return blake2sp_init_leaf_param( S, P ); ++} ++ ++static int blake2sp_init_root( blake2s_state *S, size_t outlen, size_t keylen ) ++{ ++ blake2s_param P[1]; ++ P->digest_length = (uint8_t)outlen; ++ P->key_length = (uint8_t)keylen; ++ P->fanout = PARALLELISM_DEGREE; ++ P->depth = 2; ++ P->leaf_length = 0; ++ P->node_offset = 0; ++ P->xof_length = 0; ++ P->node_depth = 1; ++ P->inner_length = BLAKE2S_OUTBYTES; ++ memset( P->salt, 0, sizeof( P->salt ) ); ++ memset( P->personal, 0, sizeof( P->personal ) ); ++ return blake2s_init_param( S, P ); ++} ++ ++ ++int blake2sp_init( blake2sp_state *S, size_t outlen ) ++{ ++ size_t i; ++ ++ if( !outlen || outlen > BLAKE2S_OUTBYTES ) return -1; ++ ++ memset( S->buf, 0, sizeof( S->buf ) ); ++ S->buflen = 0; ++ S->outlen = outlen; ++ ++ if( blake2sp_init_root( S->R, outlen, 0 ) < 0 ) ++ return -1; ++ ++ for( i = 0; i < PARALLELISM_DEGREE; ++i ) ++ if( blake2sp_init_leaf( S->S[i], outlen, 0, i ) < 0 ) return -1; ++ ++ S->R->last_node = 1; ++ S->S[PARALLELISM_DEGREE - 1]->last_node = 1; ++ return 0; ++} ++ ++int blake2sp_init_key( blake2sp_state *S, size_t outlen, const void *key, size_t keylen ) ++{ ++ size_t i; ++ ++ if( !outlen || outlen > BLAKE2S_OUTBYTES ) return -1; ++ ++ if( !key || !keylen || keylen > BLAKE2S_KEYBYTES ) return -1; ++ ++ memset( S->buf, 0, sizeof( S->buf ) ); ++ S->buflen = 0; ++ S->outlen = outlen; ++ ++ if( blake2sp_init_root( S->R, outlen, keylen ) < 0 ) ++ return -1; ++ ++ for( i = 0; i < PARALLELISM_DEGREE; ++i ) ++ if( blake2sp_init_leaf( S->S[i], outlen, keylen, i ) < 0 ) return -1; ++ ++ S->R->last_node = 1; ++ S->S[PARALLELISM_DEGREE - 1]->last_node = 1; ++ { ++ uint8_t block[BLAKE2S_BLOCKBYTES]; ++ memset( block, 0, BLAKE2S_BLOCKBYTES ); ++ memcpy( block, key, keylen ); ++ ++ for( i = 0; i < PARALLELISM_DEGREE; ++i ) ++ blake2s_update( S->S[i], block, BLAKE2S_BLOCKBYTES ); ++ ++ secure_zero_memory( block, BLAKE2S_BLOCKBYTES ); /* Burn the key from stack */ ++ } ++ return 0; ++} ++ ++ ++int blake2sp_update( blake2sp_state *S, const void *pin, size_t inlen ) ++{ ++ const unsigned char * in = (const unsigned char *)pin; ++ size_t left = S->buflen; ++ size_t fill = sizeof( S->buf ) - left; ++ size_t i; ++ ++ if( left && inlen >= fill ) ++ { ++ memcpy( S->buf + left, in, fill ); ++ ++ for( i = 0; i < PARALLELISM_DEGREE; ++i ) ++ blake2s_update( S->S[i], S->buf + i * BLAKE2S_BLOCKBYTES, BLAKE2S_BLOCKBYTES ); ++ ++ in += fill; ++ inlen -= fill; ++ left = 0; ++ } ++ ++#if defined(_OPENMP) ++ #pragma omp parallel shared(S), num_threads(PARALLELISM_DEGREE) ++#else ++ ++ for( i = 0; i < PARALLELISM_DEGREE; ++i ) ++#endif ++ { ++#if defined(_OPENMP) ++ size_t i = omp_get_thread_num(); ++#endif ++ size_t inlen__ = inlen; ++ const unsigned char *in__ = ( const unsigned char * )in; ++ in__ += i * BLAKE2S_BLOCKBYTES; ++ ++ while( inlen__ >= PARALLELISM_DEGREE * BLAKE2S_BLOCKBYTES ) ++ { ++ blake2s_update( S->S[i], in__, BLAKE2S_BLOCKBYTES ); ++ in__ += PARALLELISM_DEGREE * BLAKE2S_BLOCKBYTES; ++ inlen__ -= PARALLELISM_DEGREE * BLAKE2S_BLOCKBYTES; ++ } ++ } ++ ++ in += inlen - inlen % ( PARALLELISM_DEGREE * BLAKE2S_BLOCKBYTES ); ++ inlen %= PARALLELISM_DEGREE * BLAKE2S_BLOCKBYTES; ++ ++ if( inlen > 0 ) ++ memcpy( S->buf + left, in, inlen ); ++ ++ S->buflen = left + inlen; ++ return 0; ++} ++ ++ ++int blake2sp_final( blake2sp_state *S, void *out, size_t outlen ) ++{ ++ uint8_t hash[PARALLELISM_DEGREE][BLAKE2S_OUTBYTES]; ++ size_t i; ++ ++ if(out == NULL || outlen < S->outlen) { ++ return -1; ++ } ++ ++ for( i = 0; i < PARALLELISM_DEGREE; ++i ) ++ { ++ if( S->buflen > i * BLAKE2S_BLOCKBYTES ) ++ { ++ size_t left = S->buflen - i * BLAKE2S_BLOCKBYTES; ++ ++ if( left > BLAKE2S_BLOCKBYTES ) left = BLAKE2S_BLOCKBYTES; ++ ++ blake2s_update( S->S[i], S->buf + i * BLAKE2S_BLOCKBYTES, left ); ++ } ++ ++ blake2s_final( S->S[i], hash[i], BLAKE2S_OUTBYTES ); ++ } ++ ++ for( i = 0; i < PARALLELISM_DEGREE; ++i ) ++ blake2s_update( S->R, hash[i], BLAKE2S_OUTBYTES ); ++ ++ return blake2s_final( S->R, out, S->outlen ); ++} ++ ++ ++int blake2sp( void *out, size_t outlen, const void *in, size_t inlen, const void *key, size_t keylen ) ++{ ++ uint8_t hash[PARALLELISM_DEGREE][BLAKE2S_OUTBYTES]; ++ blake2s_state S[PARALLELISM_DEGREE][1]; ++ blake2s_state FS[1]; ++ size_t i; ++ ++ /* Verify parameters */ ++ if ( NULL == in && inlen > 0 ) return -1; ++ ++ if ( NULL == out ) return -1; ++ ++ if ( NULL == key && keylen > 0) return -1; ++ ++ if( !outlen || outlen > BLAKE2S_OUTBYTES ) return -1; ++ ++ if( keylen > BLAKE2S_KEYBYTES ) return -1; ++ ++ for( i = 0; i < PARALLELISM_DEGREE; ++i ) ++ if( blake2sp_init_leaf( S[i], outlen, keylen, i ) < 0 ) return -1; ++ ++ S[PARALLELISM_DEGREE - 1]->last_node = 1; /* mark last node */ ++ ++ if( keylen > 0 ) ++ { ++ uint8_t block[BLAKE2S_BLOCKBYTES]; ++ memset( block, 0, BLAKE2S_BLOCKBYTES ); ++ memcpy( block, key, keylen ); ++ ++ for( i = 0; i < PARALLELISM_DEGREE; ++i ) ++ blake2s_update( S[i], block, BLAKE2S_BLOCKBYTES ); ++ ++ secure_zero_memory( block, BLAKE2S_BLOCKBYTES ); /* Burn the key from stack */ ++ } ++ ++#if defined(_OPENMP) ++ #pragma omp parallel shared(S,hash), num_threads(PARALLELISM_DEGREE) ++#else ++ ++ for( i = 0; i < PARALLELISM_DEGREE; ++i ) ++#endif ++ { ++#if defined(_OPENMP) ++ size_t i = omp_get_thread_num(); ++#endif ++ size_t inlen__ = inlen; ++ const unsigned char *in__ = ( const unsigned char * )in; ++ in__ += i * BLAKE2S_BLOCKBYTES; ++ ++ while( inlen__ >= PARALLELISM_DEGREE * BLAKE2S_BLOCKBYTES ) ++ { ++ blake2s_update( S[i], in__, BLAKE2S_BLOCKBYTES ); ++ in__ += PARALLELISM_DEGREE * BLAKE2S_BLOCKBYTES; ++ inlen__ -= PARALLELISM_DEGREE * BLAKE2S_BLOCKBYTES; ++ } ++ ++ if( inlen__ > i * BLAKE2S_BLOCKBYTES ) ++ { ++ const size_t left = inlen__ - i * BLAKE2S_BLOCKBYTES; ++ const size_t len = left <= BLAKE2S_BLOCKBYTES ? left : BLAKE2S_BLOCKBYTES; ++ blake2s_update( S[i], in__, len ); ++ } ++ ++ blake2s_final( S[i], hash[i], BLAKE2S_OUTBYTES ); ++ } ++ ++ if( blake2sp_init_root( FS, outlen, keylen ) < 0 ) ++ return -1; ++ ++ FS->last_node = 1; ++ ++ for( i = 0; i < PARALLELISM_DEGREE; ++i ) ++ blake2s_update( FS, hash[i], BLAKE2S_OUTBYTES ); ++ ++ return blake2s_final( FS, out, outlen ); ++} ++ ++#if defined(BLAKE2SP_SELFTEST) ++#include <string.h> ++#include "blake2-kat.h" ++int main( void ) ++{ ++ uint8_t key[BLAKE2S_KEYBYTES]; ++ uint8_t buf[BLAKE2_KAT_LENGTH]; ++ size_t i, step; ++ ++ for( i = 0; i < BLAKE2S_KEYBYTES; ++i ) ++ key[i] = ( uint8_t )i; ++ ++ for( i = 0; i < BLAKE2_KAT_LENGTH; ++i ) ++ buf[i] = ( uint8_t )i; ++ ++ /* Test simple API */ ++ for( i = 0; i < BLAKE2_KAT_LENGTH; ++i ) ++ { ++ uint8_t hash[BLAKE2S_OUTBYTES]; ++ blake2sp( hash, BLAKE2S_OUTBYTES, buf, i, key, BLAKE2S_KEYBYTES ); ++ ++ if( 0 != memcmp( hash, blake2sp_keyed_kat[i], BLAKE2S_OUTBYTES ) ) ++ { ++ goto fail; ++ } ++ } ++ ++ /* Test streaming API */ ++ for(step = 1; step < BLAKE2S_BLOCKBYTES; ++step) { ++ for (i = 0; i < BLAKE2_KAT_LENGTH; ++i) { ++ uint8_t hash[BLAKE2S_OUTBYTES]; ++ blake2sp_state S; ++ uint8_t * p = buf; ++ size_t mlen = i; ++ int err = 0; ++ ++ if( (err = blake2sp_init_key(&S, BLAKE2S_OUTBYTES, key, BLAKE2S_KEYBYTES)) < 0 ) { ++ goto fail; ++ } ++ ++ while (mlen >= step) { ++ if ( (err = blake2sp_update(&S, p, step)) < 0 ) { ++ goto fail; ++ } ++ mlen -= step; ++ p += step; ++ } ++ if ( (err = blake2sp_update(&S, p, mlen)) < 0) { ++ goto fail; ++ } ++ if ( (err = blake2sp_final(&S, hash, BLAKE2S_OUTBYTES)) < 0) { ++ goto fail; ++ } ++ ++ if (0 != memcmp(hash, blake2sp_keyed_kat[i], BLAKE2S_OUTBYTES)) { ++ goto fail; ++ } ++ } ++ } ++ ++ puts( "ok" ); ++ return 0; ++fail: ++ puts("error"); ++ return -1; ++} ++#endif +--- thirdparty/blake2/sse/blake2xb.c.orig 2025-09-03 12:27:32 UTC ++++ thirdparty/blake2/sse/blake2xb.c +@@ -0,0 +1,241 @@ ++/* ++ BLAKE2 reference source code package - reference C implementations ++ ++ Copyright 2016, JP Aumasson <jeanphilippe.aumasson@gmail.com>. ++ Copyright 2016, Samuel Neves <sneves@dei.uc.pt>. ++ ++ You may use this under the terms of the CC0, the OpenSSL Licence, or ++ the Apache Public License 2.0, at your option. The terms of these ++ licenses can be found at: ++ ++ - CC0 1.0 Universal : http://creativecommons.org/publicdomain/zero/1.0 ++ - OpenSSL license : https://www.openssl.org/source/license.html ++ - Apache 2.0 : http://www.apache.org/licenses/LICENSE-2.0 ++ ++ More information about the BLAKE2 hash function can be found at ++ https://blake2.net. ++*/ ++ ++#include <stdint.h> ++#include <string.h> ++#include <stdio.h> ++ ++#include "blake2.h" ++#include "blake2-impl.h" ++ ++int blake2xb_init( blake2xb_state *S, const size_t outlen ) { ++ return blake2xb_init_key(S, outlen, NULL, 0); ++} ++ ++int blake2xb_init_key( blake2xb_state *S, const size_t outlen, const void *key, size_t keylen) ++{ ++ if ( outlen == 0 || outlen > 0xFFFFFFFFUL ) { ++ return -1; ++ } ++ ++ if (NULL != key && keylen > BLAKE2B_KEYBYTES) { ++ return -1; ++ } ++ ++ if (NULL == key && keylen > 0) { ++ return -1; ++ } ++ ++ /* Initialize parameter block */ ++ S->P->digest_length = BLAKE2B_OUTBYTES; ++ S->P->key_length = keylen; ++ S->P->fanout = 1; ++ S->P->depth = 1; ++ store32( &S->P->leaf_length, 0 ); ++ store32( &S->P->node_offset, 0 ); ++ store32( &S->P->xof_length, outlen ); ++ S->P->node_depth = 0; ++ S->P->inner_length = 0; ++ memset( S->P->reserved, 0, sizeof( S->P->reserved ) ); ++ memset( S->P->salt, 0, sizeof( S->P->salt ) ); ++ memset( S->P->personal, 0, sizeof( S->P->personal ) ); ++ ++ if( blake2b_init_param( S->S, S->P ) < 0 ) { ++ return -1; ++ } ++ ++ if (keylen > 0) { ++ uint8_t block[BLAKE2B_BLOCKBYTES]; ++ memset(block, 0, BLAKE2B_BLOCKBYTES); ++ memcpy(block, key, keylen); ++ blake2b_update(S->S, block, BLAKE2B_BLOCKBYTES); ++ secure_zero_memory(block, BLAKE2B_BLOCKBYTES); ++ } ++ return 0; ++} ++ ++int blake2xb_update( blake2xb_state *S, const void *in, size_t inlen ) { ++ return blake2b_update( S->S, in, inlen ); ++} ++ ++int blake2xb_final( blake2xb_state *S, void *out, size_t outlen) { ++ ++ blake2b_state C[1]; ++ blake2b_param P[1]; ++ uint32_t xof_length = load32(&S->P->xof_length); ++ uint8_t root[BLAKE2B_BLOCKBYTES]; ++ size_t i; ++ ++ if (NULL == out) { ++ return -1; ++ } ++ ++ /* outlen must match the output size defined in xof_length, */ ++ /* unless it was -1, in which case anything goes except 0. */ ++ if(xof_length == 0xFFFFFFFFUL) { ++ if(outlen == 0) { ++ return -1; ++ } ++ } else { ++ if(outlen != xof_length) { ++ return -1; ++ } ++ } ++ ++ /* Finalize the root hash */ ++ if (blake2b_final(S->S, root, BLAKE2B_OUTBYTES) < 0) { ++ return -1; ++ } ++ ++ /* Set common block structure values */ ++ /* Copy values from parent instance, and only change the ones below */ ++ memcpy(P, S->P, sizeof(blake2b_param)); ++ P->key_length = 0; ++ P->fanout = 0; ++ P->depth = 0; ++ store32(&P->leaf_length, BLAKE2B_OUTBYTES); ++ P->inner_length = BLAKE2B_OUTBYTES; ++ P->node_depth = 0; ++ ++ for (i = 0; outlen > 0; ++i) { ++ const size_t block_size = (outlen < BLAKE2B_OUTBYTES) ? outlen : BLAKE2B_OUTBYTES; ++ /* Initialize state */ ++ P->digest_length = block_size; ++ store32(&P->node_offset, i); ++ blake2b_init_param(C, P); ++ /* Process key if needed */ ++ blake2b_update(C, root, BLAKE2B_OUTBYTES); ++ if (blake2b_final(C, (uint8_t *)out + i * BLAKE2B_OUTBYTES, block_size) < 0 ) { ++ return -1; ++ } ++ outlen -= block_size; ++ } ++ secure_zero_memory(root, sizeof(root)); ++ secure_zero_memory(P, sizeof(P)); ++ secure_zero_memory(C, sizeof(C)); ++ /* Put blake2xb in an invalid state? cf. blake2s_is_lastblock */ ++ return 0; ++ ++} ++ ++int blake2xb(void *out, size_t outlen, const void *in, size_t inlen, const void *key, size_t keylen) ++{ ++ blake2xb_state S[1]; ++ ++ /* Verify parameters */ ++ if (NULL == in && inlen > 0) ++ return -1; ++ ++ if (NULL == out) ++ return -1; ++ ++ if (NULL == key && keylen > 0) ++ return -1; ++ ++ if (keylen > BLAKE2B_KEYBYTES) ++ return -1; ++ ++ if (outlen == 0) ++ return -1; ++ ++ /* Initialize the root block structure */ ++ if (blake2xb_init_key(S, outlen, key, keylen) < 0) { ++ return -1; ++ } ++ ++ /* Absorb the input message */ ++ blake2xb_update(S, in, inlen); ++ ++ /* Compute the root node of the tree and the final hash using the counter construction */ ++ return blake2xb_final(S, out, outlen); ++} ++ ++#if defined(BLAKE2XB_SELFTEST) ++#include <string.h> ++#include "blake2-kat.h" ++int main( void ) ++{ ++ uint8_t key[BLAKE2B_KEYBYTES]; ++ uint8_t buf[BLAKE2_KAT_LENGTH]; ++ size_t i, step, outlen; ++ ++ for( i = 0; i < BLAKE2B_KEYBYTES; ++i ) { ++ key[i] = ( uint8_t )i; ++ } ++ ++ for( i = 0; i < BLAKE2_KAT_LENGTH; ++i ) { ++ buf[i] = ( uint8_t )i; ++ } ++ ++ /* Testing length of ouputs rather than inputs */ ++ /* (Test of input lengths mostly covered by blake2s tests) */ ++ ++ /* Test simple API */ ++ for( outlen = 1; outlen <= BLAKE2_KAT_LENGTH; ++outlen ) ++ { ++ uint8_t hash[BLAKE2_KAT_LENGTH] = {0}; ++ if( blake2xb( hash, outlen, buf, BLAKE2_KAT_LENGTH, key, BLAKE2B_KEYBYTES ) < 0 ) { ++ goto fail; ++ } ++ ++ if( 0 != memcmp( hash, blake2xb_keyed_kat[outlen-1], outlen ) ) ++ { ++ goto fail; ++ } ++ } ++ ++ /* Test streaming API */ ++ for(step = 1; step < BLAKE2B_BLOCKBYTES; ++step) { ++ for (outlen = 1; outlen <= BLAKE2_KAT_LENGTH; ++outlen) { ++ uint8_t hash[BLAKE2_KAT_LENGTH]; ++ blake2xb_state S; ++ uint8_t * p = buf; ++ size_t mlen = BLAKE2_KAT_LENGTH; ++ int err = 0; ++ ++ if( (err = blake2xb_init_key(&S, outlen, key, BLAKE2B_KEYBYTES)) < 0 ) { ++ goto fail; ++ } ++ ++ while (mlen >= step) { ++ if ( (err = blake2xb_update(&S, p, step)) < 0 ) { ++ goto fail; ++ } ++ mlen -= step; ++ p += step; ++ } ++ if ( (err = blake2xb_update(&S, p, mlen)) < 0) { ++ goto fail; ++ } ++ if ( (err = blake2xb_final(&S, hash, outlen)) < 0) { ++ goto fail; ++ } ++ ++ if (0 != memcmp(hash, blake2xb_keyed_kat[outlen-1], outlen)) { ++ goto fail; ++ } ++ } ++ } ++ ++ puts( "ok" ); ++ return 0; ++fail: ++ puts("error"); ++ return -1; ++} ++#endif +--- thirdparty/blake2/sse/blake2xs.c.orig 2025-09-03 12:27:32 UTC ++++ thirdparty/blake2/sse/blake2xs.c +@@ -0,0 +1,239 @@ ++/* ++ BLAKE2 reference source code package - reference C implementations ++ ++ Copyright 2016, JP Aumasson <jeanphilippe.aumasson@gmail.com>. ++ Copyright 2016, Samuel Neves <sneves@dei.uc.pt>. ++ ++ You may use this under the terms of the CC0, the OpenSSL Licence, or ++ the Apache Public License 2.0, at your option. The terms of these ++ licenses can be found at: ++ ++ - CC0 1.0 Universal : http://creativecommons.org/publicdomain/zero/1.0 ++ - OpenSSL license : https://www.openssl.org/source/license.html ++ - Apache 2.0 : http://www.apache.org/licenses/LICENSE-2.0 ++ ++ More information about the BLAKE2 hash function can be found at ++ https://blake2.net. ++*/ ++ ++#include <stdint.h> ++#include <string.h> ++#include <stdio.h> ++ ++#include "blake2.h" ++#include "blake2-impl.h" ++ ++int blake2xs_init( blake2xs_state *S, const size_t outlen ) { ++ return blake2xs_init_key(S, outlen, NULL, 0); ++} ++ ++int blake2xs_init_key( blake2xs_state *S, const size_t outlen, const void *key, size_t keylen ) ++{ ++ if ( outlen == 0 || outlen > 0xFFFFUL ) { ++ return -1; ++ } ++ ++ if (NULL != key && keylen > BLAKE2B_KEYBYTES) { ++ return -1; ++ } ++ ++ if (NULL == key && keylen > 0) { ++ return -1; ++ } ++ ++ /* Initialize parameter block */ ++ S->P->digest_length = BLAKE2S_OUTBYTES; ++ S->P->key_length = keylen; ++ S->P->fanout = 1; ++ S->P->depth = 1; ++ store32( &S->P->leaf_length, 0 ); ++ store32( &S->P->node_offset, 0 ); ++ store16( &S->P->xof_length, outlen ); ++ S->P->node_depth = 0; ++ S->P->inner_length = 0; ++ memset( S->P->salt, 0, sizeof( S->P->salt ) ); ++ memset( S->P->personal, 0, sizeof( S->P->personal ) ); ++ ++ if( blake2s_init_param( S->S, S->P ) < 0 ) { ++ return -1; ++ } ++ ++ if (keylen > 0) { ++ uint8_t block[BLAKE2S_BLOCKBYTES]; ++ memset(block, 0, BLAKE2S_BLOCKBYTES); ++ memcpy(block, key, keylen); ++ blake2s_update(S->S, block, BLAKE2S_BLOCKBYTES); ++ secure_zero_memory(block, BLAKE2S_BLOCKBYTES); ++ } ++ return 0; ++} ++ ++int blake2xs_update( blake2xs_state *S, const void *in, size_t inlen ) { ++ return blake2s_update( S->S, in, inlen ); ++} ++ ++int blake2xs_final(blake2xs_state *S, void *out, size_t outlen) { ++ ++ blake2s_state C[1]; ++ blake2s_param P[1]; ++ uint16_t xof_length = load16(&S->P->xof_length); ++ uint8_t root[BLAKE2S_BLOCKBYTES]; ++ size_t i; ++ ++ if (NULL == out) { ++ return -1; ++ } ++ ++ /* outlen must match the output size defined in xof_length, */ ++ /* unless it was -1, in which case anything goes except 0. */ ++ if(xof_length == 0xFFFFUL) { ++ if(outlen == 0) { ++ return -1; ++ } ++ } else { ++ if(outlen != xof_length) { ++ return -1; ++ } ++ } ++ ++ /* Finalize the root hash */ ++ if (blake2s_final(S->S, root, BLAKE2S_OUTBYTES) < 0) { ++ return -1; ++ } ++ ++ /* Set common block structure values */ ++ /* Copy values from parent instance, and only change the ones below */ ++ memcpy(P, S->P, sizeof(blake2s_param)); ++ P->key_length = 0; ++ P->fanout = 0; ++ P->depth = 0; ++ store32(&P->leaf_length, BLAKE2S_OUTBYTES); ++ P->inner_length = BLAKE2S_OUTBYTES; ++ P->node_depth = 0; ++ ++ for (i = 0; outlen > 0; ++i) { ++ const size_t block_size = (outlen < BLAKE2S_OUTBYTES) ? outlen : BLAKE2S_OUTBYTES; ++ /* Initialize state */ ++ P->digest_length = block_size; ++ store32(&P->node_offset, i); ++ blake2s_init_param(C, P); ++ /* Process key if needed */ ++ blake2s_update(C, root, BLAKE2S_OUTBYTES); ++ if (blake2s_final(C, (uint8_t *)out + i * BLAKE2S_OUTBYTES, block_size) < 0) { ++ return -1; ++ } ++ outlen -= block_size; ++ } ++ secure_zero_memory(root, sizeof(root)); ++ secure_zero_memory(P, sizeof(P)); ++ secure_zero_memory(C, sizeof(C)); ++ /* Put blake2xs in an invalid state? cf. blake2s_is_lastblock */ ++ return 0; ++} ++ ++int blake2xs(void *out, size_t outlen, const void *in, size_t inlen, const void *key, size_t keylen) ++{ ++ blake2xs_state S[1]; ++ ++ /* Verify parameters */ ++ if (NULL == in && inlen > 0) ++ return -1; ++ ++ if (NULL == out) ++ return -1; ++ ++ if (NULL == key && keylen > 0) ++ return -1; ++ ++ if (keylen > BLAKE2S_KEYBYTES) ++ return -1; ++ ++ if (outlen == 0) ++ return -1; ++ ++ /* Initialize the root block structure */ ++ if (blake2xs_init_key(S, outlen, key, keylen) < 0) { ++ return -1; ++ } ++ ++ /* Absorb the input message */ ++ blake2xs_update(S, in, inlen); ++ ++ /* Compute the root node of the tree and the final hash using the counter construction */ ++ return blake2xs_final(S, out, outlen); ++} ++ ++#if defined(BLAKE2XS_SELFTEST) ++#include <string.h> ++#include "blake2-kat.h" ++int main( void ) ++{ ++ uint8_t key[BLAKE2S_KEYBYTES]; ++ uint8_t buf[BLAKE2_KAT_LENGTH]; ++ size_t i, step, outlen; ++ ++ for( i = 0; i < BLAKE2S_KEYBYTES; ++i ) { ++ key[i] = ( uint8_t )i; ++ } ++ ++ for( i = 0; i < BLAKE2_KAT_LENGTH; ++i ) { ++ buf[i] = ( uint8_t )i; ++ } ++ ++ /* Testing length of ouputs rather than inputs */ ++ /* (Test of input lengths mostly covered by blake2s tests) */ ++ ++ /* Test simple API */ ++ for( outlen = 1; outlen <= BLAKE2_KAT_LENGTH; ++outlen ) ++ { ++ uint8_t hash[BLAKE2_KAT_LENGTH] = {0}; ++ if( blake2xs( hash, outlen, buf, BLAKE2_KAT_LENGTH, key, BLAKE2S_KEYBYTES ) < 0 ) { ++ goto fail; ++ } ++ ++ if( 0 != memcmp( hash, blake2xs_keyed_kat[outlen-1], outlen ) ) ++ { ++ goto fail; ++ } ++ } ++ ++ /* Test streaming API */ ++ for(step = 1; step < BLAKE2S_BLOCKBYTES; ++step) { ++ for (outlen = 1; outlen <= BLAKE2_KAT_LENGTH; ++outlen) { ++ uint8_t hash[BLAKE2_KAT_LENGTH]; ++ blake2xs_state S; ++ uint8_t * p = buf; ++ size_t mlen = BLAKE2_KAT_LENGTH; ++ int err = 0; ++ ++ if( (err = blake2xs_init_key(&S, outlen, key, BLAKE2S_KEYBYTES)) < 0 ) { ++ goto fail; ++ } ++ ++ while (mlen >= step) { ++ if ( (err = blake2xs_update(&S, p, step)) < 0 ) { ++ goto fail; ++ } ++ mlen -= step; ++ p += step; ++ } ++ if ( (err = blake2xs_update(&S, p, mlen)) < 0) { ++ goto fail; ++ } ++ if ( (err = blake2xs_final(&S, hash, outlen)) < 0) { ++ goto fail; ++ } ++ ++ if (0 != memcmp(hash, blake2xs_keyed_kat[outlen-1], outlen)) { ++ goto fail; ++ } ++ } ++ } ++ ++ puts( "ok" ); ++ return 0; ++fail: ++ puts("error"); ++ return -1; ++} ++#endif +--- thirdparty/blake2/sse/genkat-c.c.orig 2025-09-03 12:27:32 UTC ++++ thirdparty/blake2/sse/genkat-c.c +@@ -0,0 +1,139 @@ ++/* ++ BLAKE2 reference source code package - reference C implementations ++ ++ Copyright 2012, Samuel Neves <sneves@dei.uc.pt>. You may use this under the ++ terms of the CC0, the OpenSSL Licence, or the Apache Public License 2.0, at ++ your option. The terms of these licenses can be found at: ++ ++ - CC0 1.0 Universal : http://creativecommons.org/publicdomain/zero/1.0 ++ - OpenSSL license : https://www.openssl.org/source/license.html ++ - Apache 2.0 : http://www.apache.org/licenses/LICENSE-2.0 ++ ++ More information about the BLAKE2 hash function can be found at ++ https://blake2.net. ++*/ ++ ++#include <stdint.h> ++#include <stdio.h> ++#include <stdlib.h> ++#include <string.h> ++ ++#include "blake2.h" ++ ++#define STR_(x) #x ++#define STR(x) STR_(x) ++ ++#define LENGTH 256 ++ ++#define MAKE_KAT(name, size_prefix) \ ++ do { \ ++ printf("static const uint8_t " #name "_kat[BLAKE2_KAT_LENGTH][" #size_prefix \ ++ "_OUTBYTES] = \n{\n"); \ ++ \ ++ for (i = 0; i < LENGTH; ++i) { \ ++ name(hash, size_prefix##_OUTBYTES, in, i, NULL, 0); \ ++ printf("\t{\n\t\t"); \ ++ \ ++ for (j = 0; j < size_prefix##_OUTBYTES; ++j) \ ++ printf("0x%02X%s", hash[j], \ ++ (j + 1) == size_prefix##_OUTBYTES ? "\n" : j && !((j + 1) % 8) ? ",\n\t\t" : ", "); \ ++ \ ++ printf("\t},\n"); \ ++ } \ ++ \ ++ printf("};\n\n\n\n\n"); \ ++ } while (0) ++ ++#define MAKE_KEYED_KAT(name, size_prefix) \ ++ do { \ ++ printf("static const uint8_t " #name "_keyed_kat[BLAKE2_KAT_LENGTH][" #size_prefix \ ++ "_OUTBYTES] = \n{\n"); \ ++ \ ++ for (i = 0; i < LENGTH; ++i) { \ ++ name(hash, size_prefix##_OUTBYTES, in, i, key, size_prefix##_KEYBYTES); \ ++ printf("\t{\n\t\t"); \ ++ \ ++ for (j = 0; j < size_prefix##_OUTBYTES; ++j) \ ++ printf("0x%02X%s", hash[j], \ ++ (j + 1) == size_prefix##_OUTBYTES ? "\n" : j && !((j + 1) % 8) ? ",\n\t\t" : ", "); \ ++ \ ++ printf("\t},\n"); \ ++ } \ ++ \ ++ printf("};\n\n\n\n\n"); \ ++ } while (0) ++ ++#define MAKE_XOF_KAT(name) \ ++ do { \ ++ printf("static const uint8_t " #name "_kat[BLAKE2_KAT_LENGTH][BLAKE2_KAT_LENGTH] = \n{\n"); \ ++ \ ++ for (i = 1; i <= LENGTH; ++i) { \ ++ name(hash, i, in, LENGTH, NULL, 0); \ ++ printf("\t{\n\t\t"); \ ++ \ ++ for (j = 0; j < i; ++j) \ ++ printf("0x%02X%s", hash[j], \ ++ (j + 1) == LENGTH ? "\n" : j && !((j + 1) % 8) ? ",\n\t\t" : ", "); \ ++ \ ++ for (j = i; j < LENGTH; ++j) \ ++ printf("0x00%s", (j + 1) == LENGTH ? "\n" : j && !((j + 1) % 8) ? ",\n\t\t" : ", "); \ ++ \ ++ printf("\t},\n"); \ ++ } \ ++ \ ++ printf("};\n\n\n\n\n"); \ ++ } while (0) ++ ++#define MAKE_XOF_KEYED_KAT(name, size_prefix) \ ++ do { \ ++ printf("static const uint8_t " #name \ ++ "_keyed_kat[BLAKE2_KAT_LENGTH][BLAKE2_KAT_LENGTH] = \n{\n"); \ ++ \ ++ for (i = 1; i <= LENGTH; ++i) { \ ++ name(hash, i, in, LENGTH, key, size_prefix##_KEYBYTES); \ ++ printf("\t{\n\t\t"); \ ++ \ ++ for (j = 0; j < i; ++j) \ ++ printf("0x%02X%s", hash[j], \ ++ (j + 1) == LENGTH ? "\n" : j && !((j + 1) % 8) ? ",\n\t\t" : ", "); \ ++ \ ++ for (j = i; j < LENGTH; ++j) \ ++ printf("0x00%s", (j + 1) == LENGTH ? "\n" : j && !((j + 1) % 8) ? ",\n\t\t" : ", "); \ ++ \ ++ printf("\t},\n"); \ ++ } \ ++ \ ++ printf("};\n\n\n\n\n"); \ ++ } while (0) ++ ++int main() { ++ uint8_t key[64] = {0}; ++ uint8_t in[LENGTH] = {0}; ++ uint8_t hash[LENGTH] = {0}; ++ size_t i, j; ++ ++ for (i = 0; i < sizeof(in); ++i) ++ in[i] = i; ++ ++ for (i = 0; i < sizeof(key); ++i) ++ key[i] = i; ++ ++ puts("#ifndef BLAKE2_KAT_H\n" ++ "#define BLAKE2_KAT_H\n\n\n" ++ "#include <stdint.h>\n\n" ++ "#define BLAKE2_KAT_LENGTH " STR(LENGTH) "\n\n\n"); ++ MAKE_KAT(blake2s, BLAKE2S); ++ MAKE_KEYED_KAT(blake2s, BLAKE2S); ++ MAKE_KAT(blake2b, BLAKE2B); ++ MAKE_KEYED_KAT(blake2b, BLAKE2B); ++ MAKE_KAT(blake2sp, BLAKE2S); ++ MAKE_KEYED_KAT(blake2sp, BLAKE2S); ++ MAKE_KAT(blake2bp, BLAKE2B); ++ MAKE_KEYED_KAT(blake2bp, BLAKE2B); ++ MAKE_XOF_KAT(blake2xs); ++ MAKE_XOF_KEYED_KAT(blake2xs, BLAKE2S); ++ MAKE_XOF_KAT(blake2xb); ++ MAKE_XOF_KEYED_KAT(blake2xb, BLAKE2B); ++ puts("#endif"); ++ return 0; ++} +--- thirdparty/blake2/sse/genkat-json.c.orig 2025-09-03 12:27:32 UTC ++++ thirdparty/blake2/sse/genkat-json.c +@@ -0,0 +1,154 @@ ++/* ++ BLAKE2 reference source code package - reference C implementations ++ ++ Copyright 2012, Samuel Neves <sneves@dei.uc.pt>. You may use this under the ++ terms of the CC0, the OpenSSL Licence, or the Apache Public License 2.0, at ++ your option. The terms of these licenses can be found at: ++ ++ - CC0 1.0 Universal : http://creativecommons.org/publicdomain/zero/1.0 ++ - OpenSSL license : https://www.openssl.org/source/license.html ++ - Apache 2.0 : http://www.apache.org/licenses/LICENSE-2.0 ++ ++ More information about the BLAKE2 hash function can be found at ++ https://blake2.net. ++*/ ++ ++#include <stdint.h> ++#include <stdio.h> ++#include <stdlib.h> ++#include <string.h> ++ ++#include "blake2.h" ++ ++#define STR_(x) #x ++#define STR(x) STR_(x) ++ ++#define LENGTH 256 ++ ++#define MAKE_KAT(name, size_prefix, first) \ ++ do { \ ++ for (i = 0; i < LENGTH; ++i) { \ ++ printf("%s\n{\n", i == 0 && first ? "" : ","); \ ++ \ ++ printf(" \"hash\": \"" #name "\",\n"); \ ++ printf(" \"in\": \""); \ ++ for (j = 0; j < i; ++j) \ ++ printf("%02x", in[j]); \ ++ \ ++ printf("\",\n"); \ ++ printf(" \"key\": \"\",\n"); \ ++ printf(" \"out\": \""); \ ++ \ ++ name(hash, size_prefix##_OUTBYTES, in, i, NULL, 0); \ ++ \ ++ for (j = 0; j < size_prefix##_OUTBYTES; ++j) \ ++ printf("%02x", hash[j]); \ ++ printf("\"\n"); \ ++ printf("}"); \ ++ } \ ++ } while (0) ++ ++#define MAKE_KEYED_KAT(name, size_prefix, first) \ ++ do { \ ++ for (i = 0; i < LENGTH; ++i) { \ ++ printf("%s\n{\n", i == 0 && first ? "" : ","); \ ++ \ ++ printf(" \"hash\": \"" #name "\",\n"); \ ++ printf(" \"in\": \""); \ ++ for (j = 0; j < i; ++j) \ ++ printf("%02x", in[j]); \ ++ \ ++ printf("\",\n"); \ ++ printf(" \"key\": \""); \ ++ for (j = 0; j < size_prefix##_KEYBYTES; ++j) \ ++ printf("%02x", key[j]); \ ++ printf("\",\n"); \ ++ printf(" \"out\": \""); \ ++ \ ++ name(hash, size_prefix##_OUTBYTES, in, i, key, size_prefix##_KEYBYTES); \ ++ \ ++ for (j = 0; j < size_prefix##_OUTBYTES; ++j) \ ++ printf("%02x", hash[j]); \ ++ printf("\"\n"); \ ++ printf("}"); \ ++ } \ ++ } while (0) ++ ++#define MAKE_XOF_KAT(name, first) \ ++ do { \ ++ for (i = 1; i <= LENGTH; ++i) { \ ++ printf("%s\n{\n", i == 1 && first ? "" : ","); \ ++ \ ++ printf(" \"hash\": \"" #name "\",\n"); \ ++ printf(" \"in\": \""); \ ++ for (j = 0; j < LENGTH; ++j) \ ++ printf("%02x", in[j]); \ ++ \ ++ printf("\",\n"); \ ++ printf(" \"key\": \"\",\n"); \ ++ printf(" \"out\": \""); \ ++ \ ++ name(hash, i, in, LENGTH, NULL, 0); \ ++ \ ++ for (j = 0; j < i; ++j) \ ++ printf("%02x", hash[j]); \ ++ printf("\"\n"); \ ++ printf("}"); \ ++ } \ ++ } while (0) ++ ++#define MAKE_XOF_KEYED_KAT(name, size_prefix, first) \ ++ do { \ ++ for (i = 1; i <= LENGTH; ++i) { \ ++ printf("%s\n{\n", i == 1 && first ? "" : ","); \ ++ \ ++ printf(" \"hash\": \"" #name "\",\n"); \ ++ printf(" \"in\": \""); \ ++ for (j = 0; j < LENGTH; ++j) \ ++ printf("%02x", in[j]); \ ++ \ ++ printf("\",\n"); \ ++ printf(" \"key\": \""); \ ++ for (j = 0; j < size_prefix##_KEYBYTES; ++j) \ ++ printf("%02x", key[j]); \ ++ printf("\",\n"); \ ++ printf(" \"out\": \""); \ ++ \ ++ name(hash, i, in, LENGTH, key, size_prefix##_KEYBYTES); \ ++ \ ++ for (j = 0; j < i; ++j) \ ++ printf("%02x", hash[j]); \ ++ printf("\"\n"); \ ++ printf("}"); \ ++ } \ ++ } while (0) ++ ++int main() { ++ uint8_t key[64] = {0}; ++ uint8_t in[LENGTH] = {0}; ++ uint8_t hash[LENGTH] = {0}; ++ size_t i, j; ++ ++ for (i = 0; i < sizeof(in); ++i) ++ in[i] = i; ++ ++ for (i = 0; i < sizeof(key); ++i) ++ key[i] = i; ++ ++ printf("["); ++ MAKE_KAT(blake2s, BLAKE2S, 1); ++ MAKE_KEYED_KAT(blake2s, BLAKE2S, 0); ++ MAKE_KAT(blake2b, BLAKE2B, 0); ++ MAKE_KEYED_KAT(blake2b, BLAKE2B, 0); ++ MAKE_KAT(blake2sp, BLAKE2S, 0); ++ MAKE_KEYED_KAT(blake2sp, BLAKE2S, 0); ++ MAKE_KAT(blake2bp, BLAKE2B, 0); ++ MAKE_KEYED_KAT(blake2bp, BLAKE2B, 0); ++ MAKE_XOF_KAT(blake2xs, 0); ++ MAKE_XOF_KEYED_KAT(blake2xs, BLAKE2S, 0); ++ MAKE_XOF_KAT(blake2xb, 0); ++ MAKE_XOF_KEYED_KAT(blake2xb, BLAKE2B, 0); ++ printf("\n]\n"); ++ fflush(stdout); ++ return 0; ++} +--- thirdparty/blake2/sse/makefile.orig 2025-09-03 12:27:32 UTC ++++ thirdparty/blake2/sse/makefile +@@ -0,0 +1,40 @@ ++CC=gcc ++CFLAGS=-O3 -I../testvectors -Wall -Wextra -std=c89 -pedantic -Wno-long-long ++BLAKEBINS=blake2s blake2b blake2sp blake2bp blake2xs blake2xb ++ ++all: $(BLAKEBINS) check ++ ++blake2s: blake2s.c ++ $(CC) blake2s.c -o $@ $(CFLAGS) -DBLAKE2S_SELFTEST ++ ++blake2b: blake2b.c ++ $(CC) blake2b.c -o $@ $(CFLAGS) -DBLAKE2B_SELFTEST ++ ++blake2sp: blake2sp.c blake2s.c ++ $(CC) blake2sp.c blake2s.c -o $@ $(CFLAGS) -DBLAKE2SP_SELFTEST ++ ++blake2bp: blake2bp.c blake2b.c ++ $(CC) blake2bp.c blake2b.c -o $@ $(CFLAGS) -DBLAKE2BP_SELFTEST ++ ++blake2xs: blake2xs.c blake2s.c ++ $(CC) blake2xs.c blake2s.c -o $@ $(CFLAGS) -DBLAKE2XS_SELFTEST ++ ++blake2xb: blake2xb.c blake2b.c ++ $(CC) blake2xb.c blake2b.c -o $@ $(CFLAGS) -DBLAKE2XB_SELFTEST ++ ++check: blake2s blake2b blake2sp blake2bp blake2xs blake2xb ++ ./blake2s ++ ./blake2b ++ ./blake2sp ++ ./blake2bp ++ ./blake2xs ++ ./blake2xb ++ ++kat: ++ $(CC) $(CFLAGS) -o genkat-c genkat-c.c blake2b.c blake2s.c blake2sp.c blake2bp.c blake2xs.c blake2xb.c ++ $(CC) $(CFLAGS) -g -o genkat-json genkat-json.c blake2b.c blake2s.c blake2sp.c blake2bp.c blake2xs.c blake2xb.c ++ ./genkat-c > blake2-kat.h ++ ./genkat-json > blake2-kat.json ++ ++clean: ++ rm -rf *.o genkat-c genkat-json blake2-kat.h blake2-kat.json $(BLAKEBINS) diff --git a/games/palapeli/distinfo b/games/palapeli/distinfo index f614b2158b79..c5ec2f2086c1 100644 --- a/games/palapeli/distinfo +++ b/games/palapeli/distinfo @@ -1,3 +1,3 @@ -TIMESTAMP = 1754646353 -SHA256 (KDE/release-service/25.08.0/palapeli-25.08.0.tar.xz) = a5d2252a90968dfbd262e3e57cbf5c3e432efcf6908dde149b04428bed986e61 -SIZE (KDE/release-service/25.08.0/palapeli-25.08.0.tar.xz) = 2129648 +TIMESTAMP = 1757410062 +SHA256 (KDE/release-service/25.08.1/palapeli-25.08.1.tar.xz) = 5478c010563a31fcc3458184b88876b9df15c5e83216cc16934cb3faee37dcee +SIZE (KDE/release-service/25.08.1/palapeli-25.08.1.tar.xz) = 2130676 diff --git a/games/palapeli/pkg-plist b/games/palapeli/pkg-plist index b27ecde2e249..741d63d852e6 100644 --- a/games/palapeli/pkg-plist +++ b/games/palapeli/pkg-plist @@ -37,6 +37,7 @@ share/icons/hicolor/64x64/apps/palapeli.png share/icons/hicolor/64x64/mimetypes/application-x-palapeli.png share/kio/servicemenus/palapeli_servicemenu.desktop share/knotifications6/palapeli.notifyrc +share/locale/ar/LC_MESSAGES/palapeli.mo share/locale/ast/LC_MESSAGES/palapeli.mo share/locale/bg/LC_MESSAGES/palapeli.mo share/locale/bs/LC_MESSAGES/palapeli.mo diff --git a/games/palomino/Makefile b/games/palomino/Makefile deleted file mode 100644 index bfb7415f4539..000000000000 --- a/games/palomino/Makefile +++ /dev/null @@ -1,112 +0,0 @@ -PORTNAME= palomino -PORTVERSION= 20131231 -PORTREVISION= 10 -CATEGORIES= games -MASTER_SITES= SF/palomino-sim -DISTFILES= ${PORTNAME}_src_${PORTVERSION}.txz \ - ${PORTNAME}_data_misc_${MISC_VER}${EXTRACT_SUFX} \ - ${PORTNAME}_data_models_${MODELS_VER}${EXTRACT_SUFX} \ - ${PORTNAME}_data_sounds_${SOUNDS_VER}${EXTRACT_SUFX} \ - ${PORTNAME}_data_terrain_${TERRAIN_VER}${EXTRACT_SUFX} - -MAINTAINER= ports@FreeBSD.org -COMMENT= Action flight simulation computer program using OSG -WWW= https://www.palomino3d.org/ - -LICENSE= GPLv2 -LICENSE_FILE= ${WRKSRC}/LICENSE_GNU_GPL_2.txt - -DEPRECATED= Obsolete and abandoneed, last release in 2013, not playable -EXPIRATION_DATE=2025-09-10 - -LIB_DEPENDS= libosg.so:graphics/osg34 - -USES= alias compiler:c++11-lang cmake:insource,noninja gl lua:51 tar:xz -USE_CXXSTD= gnu++98 -USE_GL= gl glu - -DESKTOP_ENTRIES= "Palomino" "" "${PORTNAME}" \ - "${PORTNAME}" "Game;ArcadeGame;" "" - -WRKSRC= ${WRKDIR}/${PORTNAME} - -PORTDOCS= * - -OPTIONS_DEFINE= DOCS GUI PLIB SDL -OPTIONS_DEFAULT=GUI SDL -OPTIONS_SUB= yes - -GUI_DESC= Enable FLTK GUI -PLIB_DESC= Enable sound support through plib - -GUI_LIB_DEPENDS= libfltk.so:x11-toolkits/fltk -PLIB_BUILD_DEPENDS= ${LOCALBASE}/lib/libplibsl.a:x11-toolkits/plib -SDL_USES= sdl -SDL_USE= SDL=sdl,mixer - -MISC_VER= 20091027 -MODELS_VER= 20090615 -SOUNDS_VER= 20080704 -TERRAIN_VER= 20080206 - -post-patch: - @${FIND} ${WRKSRC}/CMakeModules -type f -print0 | ${XARGS} -0 \ - ${REINPLACE_CMD} -e 's|/usr/local|${LOCALBASE}|g' - @${REINPLACE_CMD} -e '/ rt / d' ${WRKSRC}/CMakeModules/libraries.cmake - @${REINPLACE_CMD} -e '/COMMAND/ s|lua|${LUA_CMD}|' \ - ${WRKSRC}/build/lua_bind/CMakeLists.txt - @${REINPLACE_CMD} -e '/FIND_PACKAGE(/ s|)| REQUIRED)|' \ - ${WRKSRC}/CMakeModules/libraries.cmake - @${REINPLACE_CMD} -e '/COMPILE_WITH_OSSIM/ d' ${WRKSRC}/CMakeLists.txt - -# Please see MOVED entry devel/linux-js||2013-06-04 - @${REINPLACE_CMD} -e '/COMPILE_WITH_LINUX_JOYSTICK/ d' ${WRKSRC}/CMakeLists.txt - - @${REINPLACE_CMD} -e 's|string sDataDir|&="${DATADIR}/data/"|'\ - ${WRKSRC}/src/base/conf.cc - @${REINPLACE_CMD} -e '/LUABIND_SCRIPTS_DIR/ s|scripts|${DATADIR}/&|' \ - ${WRKSRC}/src/lua_bind/defs.hh - @${REINPLACE_CMD} -e 's|doc/html/|${DOCSDIR}/|' ${WRKSRC}/src/gui/gui.cc - - @${REINPLACE_CMD} -e 's/computeBound/computeBoundingBox/g' \ - ${WRKSRC}/src/object/object.cc \ - ${WRKSRC}/src/fx/partsys_medium.cc - - @${REINPLACE_CMD} -e 's/CameraNode/Camera/g' \ - ${WRKSRC}/src/hud/hud.cc \ - ${WRKSRC}/src/hud/hud.hh \ - ${WRKSRC}/src/hud/hud_text.cc - - @${REINPLACE_CMD} -e '/std::make_pair/ s,<.*>,,' \ - ${WRKSRC}/src/collision/collision.cc \ - ${WRKSRC}/src/fx/image_cache.cc \ - ${WRKSRC}/src/graph/model_cache.cc \ - ${WRKSRC}/src/hud/font.cc \ - ${WRKSRC}/src/lua_bind/lua.cc \ - ${WRKSRC}/src/object/dyna.cc \ - ${WRKSRC}/src/sky/sky.cc \ - ${WRKSRC}/src/sky/sky_dome.cc \ - ${WRKSRC}/src/sky/sky_dome.hh \ - ${WRKSRC}/src/sky/sun.hh \ - ${WRKSRC}/src/sound/sound_base.cc - -post-patch-SDL-off: - @${REINPLACE_CMD} -e '/COMPILE_WITH_SDL/ d' ${WRKSRC}/CMakeLists.txt - -post-patch-PLIB-off: - @${REINPLACE_CMD} -e '/COMPILE_WITH_PLIB/ d' ${WRKSRC}/CMakeLists.txt - -post-patch-GUI-off: - @${REINPLACE_CMD} -e '/COMPILE_WITH_FLTK/ d' ${WRKSRC}/CMakeLists.txt - -post-install: - @${MKDIR} ${STAGEDIR}${DATADIR} - @(cd ${WRKSRC} && ${COPYTREE_SHARE} "data scripts" ${STAGEDIR}${DATADIR}) -# DOCS are used from within the game, so this is unconditional - @${MKDIR} ${STAGEDIR}${DOCSDIR} - @(cd ${WRKSRC}/doc/html && ${COPYTREE_SHARE} . ${STAGEDIR}${DOCSDIR}) - - ${LN} -sf ../../${DOCSDIR_REL}/images/palominoLogo.png \ - ${STAGEDIR}${PREFIX}/share/pixmaps/${PORTNAME}.png - -.include <bsd.port.mk> diff --git a/games/palomino/distinfo b/games/palomino/distinfo deleted file mode 100644 index 752cb47c1f07..000000000000 --- a/games/palomino/distinfo +++ /dev/null @@ -1,10 +0,0 @@ -SHA256 (palomino_src_20131231.txz) = 9dfa62f3a340637518e346824643e75fa8f320fe0dee951e028df6b64b9d1e2c -SIZE (palomino_src_20131231.txz) = 572412 -SHA256 (palomino_data_misc_20091027.tar.xz) = 63bee11652e227c0e37b08bf82b395ef7d2a50671ec4b8803242ba2415a6418d -SIZE (palomino_data_misc_20091027.tar.xz) = 616848 -SHA256 (palomino_data_models_20090615.tar.xz) = 9a7915ce64df46a780ce4b869665b10e3071d0b4499a46b03f3bf08613402894 -SIZE (palomino_data_models_20090615.tar.xz) = 28110056 -SHA256 (palomino_data_sounds_20080704.tar.xz) = 3ca093744cf3056f3ea2b5eebf62127c30e57e8c233c9e17af4fed4f33b61bae -SIZE (palomino_data_sounds_20080704.tar.xz) = 488576 -SHA256 (palomino_data_terrain_20080206.tar.xz) = b2818e3a56fcedfdcf8dde4de106b04b5cf696db09a1fb743f6b5f4c7e4a496c -SIZE (palomino_data_terrain_20080206.tar.xz) = 35801076 diff --git a/games/palomino/files/patch-src_input_device__keyboard__osg.cc b/games/palomino/files/patch-src_input_device__keyboard__osg.cc deleted file mode 100644 index ffdbbc17b941..000000000000 --- a/games/palomino/files/patch-src_input_device__keyboard__osg.cc +++ /dev/null @@ -1,15 +0,0 @@ ---- src/input/device_keyboard_osg.cc.orig 2012-10-26 01:35:57 UTC -+++ src/input/device_keyboard_osg.cc -@@ -105,12 +105,6 @@ KeyboardDeviceOSG::HandlerOSG::handle( c - } - } - --void --KeyboardDeviceOSG::HandlerOSG::accept( osgGA::GUIEventHandlerVisitor& v ) --{ -- v.visit( *this ); --} -- - } // namespace input - - #endif // COMPILE_OSG diff --git a/games/palomino/files/patch-src_input_device__keyboard__osg.hh b/games/palomino/files/patch-src_input_device__keyboard__osg.hh deleted file mode 100644 index 2d9e18b13ff8..000000000000 --- a/games/palomino/files/patch-src_input_device__keyboard__osg.hh +++ /dev/null @@ -1,10 +0,0 @@ ---- src/input/device_keyboard_osg.hh.orig 2009-11-22 23:05:48 UTC -+++ src/input/device_keyboard_osg.hh -@@ -57,7 +57,6 @@ private: - HandlerOSG( void ) { } - virtual ~HandlerOSG() { } - virtual bool handle( const osgGA::GUIEventAdapter& event, osgGA::GUIActionAdapter& action ); -- virtual void accept( osgGA::GUIEventHandlerVisitor& visitor ); - }; - }; - diff --git a/games/palomino/files/patch-src_input_device__mouse__osg.cc b/games/palomino/files/patch-src_input_device__mouse__osg.cc deleted file mode 100644 index 18c0ce5f3fa3..000000000000 --- a/games/palomino/files/patch-src_input_device__mouse__osg.cc +++ /dev/null @@ -1,15 +0,0 @@ ---- src/input/device_mouse_osg.cc.orig 2012-10-26 01:35:57 UTC -+++ src/input/device_mouse_osg.cc -@@ -145,12 +145,6 @@ MouseDeviceOSG::HandlerOSG::handle( cons - } - } - --void --MouseDeviceOSG::HandlerOSG::accept( osgGA::GUIEventHandlerVisitor& v ) --{ -- v.visit( *this ); --} -- - } // namespace input - - #endif // COMPILE_OSG diff --git a/games/palomino/files/patch-src_input_device__mouse__osg.hh b/games/palomino/files/patch-src_input_device__mouse__osg.hh deleted file mode 100644 index aa7b51ed381e..000000000000 --- a/games/palomino/files/patch-src_input_device__mouse__osg.hh +++ /dev/null @@ -1,10 +0,0 @@ ---- src/input/device_mouse_osg.hh.orig 2011-12-14 01:56:48 UTC -+++ src/input/device_mouse_osg.hh -@@ -41,7 +41,6 @@ private: - HandlerOSG( void ) { } - virtual ~HandlerOSG() { } - virtual bool handle( const osgGA::GUIEventAdapter& event, osgGA::GUIActionAdapter& action ); -- virtual void accept( osgGA::GUIEventHandlerVisitor& visitor ); - }; - }; - diff --git a/games/palomino/pkg-descr b/games/palomino/pkg-descr deleted file mode 100644 index 1732e3a11b30..000000000000 --- a/games/palomino/pkg-descr +++ /dev/null @@ -1,2 +0,0 @@ -Palomino is a flight simulation computer program. Version 3 renders using -OpenSceneGraph. OSG provides the ability to render satellite imagery. diff --git a/games/palomino/pkg-plist b/games/palomino/pkg-plist deleted file mode 100644 index 1a0a36884aa8..000000000000 --- a/games/palomino/pkg-plist +++ /dev/null @@ -1,442 +0,0 @@ -bin/palomino -%%DATADIR%%/data/fonts/README.txt -%%DATADIR%%/data/fonts/arial.ttf -%%DATADIR%%/data/fonts/masque.ttf -%%DATADIR%%/data/joystick.conf -%%DATADIR%%/data/models/README.txt -%%DATADIR%%/data/models/a4/README.txt -%%DATADIR%%/data/models/a4/a4-blue-0.png -%%DATADIR%%/data/models/a4/a4-blue-1.png -%%DATADIR%%/data/models/a4/a4-blue-2.png -%%DATADIR%%/data/models/a4/a4-blue-3.png -%%DATADIR%%/data/models/a4/a4-blue-4.png -%%DATADIR%%/data/models/a4/a4-blue-5.png -%%DATADIR%%/data/models/a4/a4-blue-6.png -%%DATADIR%%/data/models/a4/a4-blue-7.png -%%DATADIR%%/data/models/a4/a4.ac.gz -%%DATADIR%%/data/models/corsair/README.txt -%%DATADIR%%/data/models/corsair/alt.ac -%%DATADIR%%/data/models/corsair/asi.ac -%%DATADIR%%/data/models/corsair/blackout.ac -%%DATADIR%%/data/models/corsair/blaze.ac -%%DATADIR%%/data/models/corsair/blaze.png -%%DATADIR%%/data/models/corsair/clock.ac -%%DATADIR%%/data/models/corsair/corsair.ac.gz -%%DATADIR%%/data/models/corsair/crosshair.png -%%DATADIR%%/data/models/corsair/f4u-1.png -%%DATADIR%%/data/models/corsair/f4u-2.png -%%DATADIR%%/data/models/corsair/f4u-3.png -%%DATADIR%%/data/models/corsair/f4u-4.png -%%DATADIR%%/data/models/corsair/fastpdisk.png -%%DATADIR%%/data/models/corsair/gunsight.ac -%%DATADIR%%/data/models/corsair/hunter-asi.png -%%DATADIR%%/data/models/corsair/hunter-large-bezel.png -%%DATADIR%%/data/models/corsair/logo.png -%%DATADIR%%/data/models/corsair/logo1.png -%%DATADIR%%/data/models/corsair/logos.ac -%%DATADIR%%/data/models/corsair/man.ac -%%DATADIR%%/data/models/corsair/number.png -%%DATADIR%%/data/models/corsair/pdisk.ac -%%DATADIR%%/data/models/corsair/pilot-b.ac -%%DATADIR%%/data/models/corsair/pilot1.png -%%DATADIR%%/data/models/corsair/puff.ac -%%DATADIR%%/data/models/corsair/puff.png -%%DATADIR%%/data/models/corsair/remote.ac -%%DATADIR%%/data/models/corsair/slowpdisk.png -%%DATADIR%%/data/models/corsair/tach.ac -%%DATADIR%%/data/models/corsair/temp.ac -%%DATADIR%%/data/models/corsair/tracer.ac -%%DATADIR%%/data/models/corsair/transparent.ac -%%DATADIR%%/data/models/corsair/turn.ac -%%DATADIR%%/data/models/corsair/vac.ac -%%DATADIR%%/data/models/corsair/vsi.ac -%%DATADIR%%/data/models/f14/README.txt -%%DATADIR%%/data/models/f14/common.png -%%DATADIR%%/data/models/f14/common2.png -%%DATADIR%%/data/models/f14/f14b.osg.gz -%%DATADIR%%/data/models/f14/grip.png -%%DATADIR%%/data/models/f14/pilot-handle.png -%%DATADIR%%/data/models/f14/side1.png -%%DATADIR%%/data/models/f14/side2.png -%%DATADIR%%/data/models/f14/topbottom1.png -%%DATADIR%%/data/models/f14/topbottom2.png -%%DATADIR%%/data/models/f15/F15CCockpit.png -%%DATADIR%%/data/models/f15/F15CNose.png -%%DATADIR%%/data/models/f15/F15CRudder.png -%%DATADIR%%/data/models/f15/F15CSide.png -%%DATADIR%%/data/models/f15/f15c.osg.gz -%%DATADIR%%/data/models/f16/README.txt -%%DATADIR%%/data/models/f16/f16.osg.gz -%%DATADIR%%/data/models/f16/f16.png -%%DATADIR%%/data/models/f16/f16trans.png -%%DATADIR%%/data/models/f16/sidewinder.ac -%%DATADIR%%/data/models/f18/f18.osg.gz -%%DATADIR%%/data/models/f18/f18cockpit.png -%%DATADIR%%/data/models/f18/f18tail.png -%%DATADIR%%/data/models/f18/f18top.png -%%DATADIR%%/data/models/f86/README.txt -%%DATADIR%%/data/models/f86/blackout.ac -%%DATADIR%%/data/models/f86/droptank.ac -%%DATADIR%%/data/models/f86/f86f.ac.gz -%%DATADIR%%/data/models/f86/pylon.ac -%%DATADIR%%/data/models/f86/sabre-1.png -%%DATADIR%%/data/models/f86/sabre-3.png -%%DATADIR%%/data/models/f86/transparent.ac -%%DATADIR%%/data/models/kc135/kc135.ac.gz -%%DATADIR%%/data/models/kc135/kc135.png -%%DATADIR%%/data/models/mirage2000/mirage2000.osg.gz -%%DATADIR%%/data/models/mirage2000/mirage2000.png -%%DATADIR%%/data/models/mirage2000/mirage2000bottom.png -%%DATADIR%%/data/models/misc/aim9.ac.gz -%%DATADIR%%/data/models/misc/aim9.png -%%DATADIR%%/data/models/misc/crashTruck.ac.gz -%%DATADIR%%/data/models/misc/lighthouse.ac.gz -%%DATADIR%%/data/models/misc/lighthouse.png -%%DATADIR%%/data/models/misc/missileLauncher.osg.gz -%%DATADIR%%/data/models/misc/observatory.ac.gz -%%DATADIR%%/data/models/misc/observatory.png -%%DATADIR%%/data/models/misc/parachute.osg.gz -%%DATADIR%%/data/models/misc/parachute.png -%%DATADIR%%/data/models/misc/radar.ac.gz -%%DATADIR%%/data/models/misc/radome.ac.gz -%%DATADIR%%/data/models/misc/radome.png -%%DATADIR%%/data/models/misc/sailboat.ac.gz -%%DATADIR%%/data/models/misc/sailboat.png -%%DATADIR%%/data/models/misc/trailerLauncher.osg.gz -%%DATADIR%%/data/models/misc/ufo.ac.gz -%%DATADIR%%/data/models/misc/warehouse.ac.gz -%%DATADIR%%/data/models/misc/warehouse.png -%%DATADIR%%/data/models/nimitz/catapult.png -%%DATADIR%%/data/models/nimitz/crew_1.png -%%DATADIR%%/data/models/nimitz/crew_2.png -%%DATADIR%%/data/models/nimitz/crew_3.png -%%DATADIR%%/data/models/nimitz/deck-stripe.png -%%DATADIR%%/data/models/nimitz/deck_1.png -%%DATADIR%%/data/models/nimitz/flag.png -%%DATADIR%%/data/models/nimitz/holdback_marking.png -%%DATADIR%%/data/models/nimitz/hull_left.png -%%DATADIR%%/data/models/nimitz/hull_left1.png -%%DATADIR%%/data/models/nimitz/hullright.png -%%DATADIR%%/data/models/nimitz/hullright2.png -%%DATADIR%%/data/models/nimitz/island1.png -%%DATADIR%%/data/models/nimitz/island2_lm.png -%%DATADIR%%/data/models/nimitz/island3.png -%%DATADIR%%/data/models/nimitz/island_68.png -%%DATADIR%%/data/models/nimitz/island_69.png -%%DATADIR%%/data/models/nimitz/nimitz.osg.gz -%%DATADIR%%/data/models/nimitz/rainbow_10.png -%%DATADIR%%/data/models/nimitz/rainbow_11.png -%%DATADIR%%/data/models/nimitz/rainbow_2.png -%%DATADIR%%/data/models/nimitz/rainbow_21.png -%%DATADIR%%/data/models/nimitz/rainbow_31.png -%%DATADIR%%/data/models/nimitz/rainbow_4.png -%%DATADIR%%/data/models/nimitz/rainbow_41.png -%%DATADIR%%/data/models/nimitz/rainbow_5.png -%%DATADIR%%/data/models/nimitz/rainbow_6.png -%%DATADIR%%/data/models/nimitz/rainbow_61.png -%%DATADIR%%/data/models/nimitz/rainbow_7.png -%%DATADIR%%/data/models/nimitz/rainbow_71.png -%%DATADIR%%/data/models/nimitz/rainbow_8.png -%%DATADIR%%/data/models/nimitz/rainbow_81.png -%%DATADIR%%/data/models/nimitz/rainbow_9.png -%%DATADIR%%/data/models/nimitz/saratoga.png -%%DATADIR%%/data/models/p51/README.txt -%%DATADIR%%/data/models/p51/f82-jw-05.png -%%DATADIR%%/data/models/p51/f82.ac.gz -%%DATADIR%%/data/models/p51/hotspotgrid.png -%%DATADIR%%/data/models/p51/metal.png -%%DATADIR%%/data/models/p51/p51d-jw-01.png -%%DATADIR%%/data/models/p51/p51d-jw-02.png -%%DATADIR%%/data/models/p51/p51d-jw-03.png -%%DATADIR%%/data/models/p51/p51d-jw-05.png -%%DATADIR%%/data/models/p51/p51d-jw-acc.ac -%%DATADIR%%/data/models/p51/p51d-jw-acc.png -%%DATADIR%%/data/models/p51/p51d-jw-alt.ac -%%DATADIR%%/data/models/p51/p51d-jw-alt.png -%%DATADIR%%/data/models/p51/p51d-jw-altpress.png -%%DATADIR%%/data/models/p51/p51d-jw-arrows.png -%%DATADIR%%/data/models/p51/p51d-jw-asi.ac -%%DATADIR%%/data/models/p51/p51d-jw-asi.png -%%DATADIR%%/data/models/p51/p51d-jw-attitude-bezel.png -%%DATADIR%%/data/models/p51/p51d-jw-attitude.ac -%%DATADIR%%/data/models/p51/p51d-jw-attitude.png -%%DATADIR%%/data/models/p51/p51d-jw-clock.ac -%%DATADIR%%/data/models/p51/p51d-jw-clock.png -%%DATADIR%%/data/models/p51/p51d-jw-compass-bezel.png -%%DATADIR%%/data/models/p51/p51d-jw-compass.ac -%%DATADIR%%/data/models/p51/p51d-jw-compass.png -%%DATADIR%%/data/models/p51/p51d-jw-engine.ac -%%DATADIR%%/data/models/p51/p51d-jw-engine.png -%%DATADIR%%/data/models/p51/p51d-jw-gearwarn.ac -%%DATADIR%%/data/models/p51/p51d-jw-gearwarn.png -%%DATADIR%%/data/models/p51/p51d-jw-gunsight.ac -%%DATADIR%%/data/models/p51/p51d-jw-gunsight.png -%%DATADIR%%/data/models/p51/p51d-jw-ignition.ac -%%DATADIR%%/data/models/p51/p51d-jw-ignition.png -%%DATADIR%%/data/models/p51/p51d-jw-large-bezel.png -%%DATADIR%%/data/models/p51/p51d-jw-magcompass.ac -%%DATADIR%%/data/models/p51/p51d-jw-magcompass.png -%%DATADIR%%/data/models/p51/p51d-jw-man.ac -%%DATADIR%%/data/models/p51/p51d-jw-man.png -%%DATADIR%%/data/models/p51/p51d-jw-med-bezel.png -%%DATADIR%%/data/models/p51/p51d-jw-remote.ac -%%DATADIR%%/data/models/p51/p51d-jw-remote.png -%%DATADIR%%/data/models/p51/p51d-jw-remotearrow.png -%%DATADIR%%/data/models/p51/p51d-jw-tach.ac -%%DATADIR%%/data/models/p51/p51d-jw-tach.png -%%DATADIR%%/data/models/p51/p51d-jw-temp.ac -%%DATADIR%%/data/models/p51/p51d-jw-temp.png -%%DATADIR%%/data/models/p51/p51d-jw-throttle.ac -%%DATADIR%%/data/models/p51/p51d-jw-throttle.png -%%DATADIR%%/data/models/p51/p51d-jw-trimknob.png -%%DATADIR%%/data/models/p51/p51d-jw-trimknobaileron.ac -%%DATADIR%%/data/models/p51/p51d-jw-trimknobrudder.ac -%%DATADIR%%/data/models/p51/p51d-jw-trimwheel.png -%%DATADIR%%/data/models/p51/p51d-jw-trimwheelelevator.ac -%%DATADIR%%/data/models/p51/p51d-jw-turn.ac -%%DATADIR%%/data/models/p51/p51d-jw-turn.png -%%DATADIR%%/data/models/p51/p51d-jw-vac.ac -%%DATADIR%%/data/models/p51/p51d-jw-vac.png -%%DATADIR%%/data/models/p51/p51d-jw-vsi.ac -%%DATADIR%%/data/models/p51/p51d-jw-vsi.png -%%DATADIR%%/data/models/p51/p51d-jw.ac.gz -%%DATADIR%%/data/models/p51/transparent-bg.png -%%DATADIR%%/data/models/scenery/GoldenGateBridge.osg.gz -%%DATADIR%%/data/models/scenery/GoldenGateBridge_redLight.png -%%DATADIR%%/data/models/scenery/GoldenGateBridge_road3.png -%%DATADIR%%/data/models/scenery/GoldenGateBridge_struct.png -%%DATADIR%%/data/models/scenery/GoldenGateBridge_struct2.png -%%DATADIR%%/data/models/scenery/GoldenGateBridge_susp.png -%%DATADIR%%/data/models/scenery/GoldenGateBridge_wall.png -%%DATADIR%%/data/models/scenery/GoldenGateBridge_yellowLight.png -%%DATADIR%%/data/models/scenery/alcatraz.ac.gz -%%DATADIR%%/data/models/scenery/alcatraz.jpg -%%DATADIR%%/data/models/sikorsky76/S76livery.png -%%DATADIR%%/data/models/sikorsky76/blur.png -%%DATADIR%%/data/models/sikorsky76/chrome1.png -%%DATADIR%%/data/models/sikorsky76/panel.png -%%DATADIR%%/data/models/sikorsky76/s76c.ac.gz -%%DATADIR%%/data/models/spaceShuttle/NASA_images_permission.txt -%%DATADIR%%/data/models/spaceShuttle/SpaceShuttle.osg.gz -%%DATADIR%%/data/models/spaceShuttle/spstob_1.png -%%DATADIR%%/data/models/spaceShuttle/spstob_2.png -%%DATADIR%%/data/models/spaceShuttle/spstob_3.png -%%DATADIR%%/data/models/spaceShuttle/spstob_4.png -%%DATADIR%%/data/models/spaceShuttle/spstob_e.png -%%DATADIR%%/data/models/spitfire/Pilot_1.png -%%DATADIR%%/data/models/spitfire/Pilot_2.png -%%DATADIR%%/data/models/spitfire/Pilot_2n.png -%%DATADIR%%/data/models/spitfire/UC-up-down.png -%%DATADIR%%/data/models/spitfire/altimeter.ac -%%DATADIR%%/data/models/spitfire/asi.ac -%%DATADIR%%/data/models/spitfire/attitude-bezel.png -%%DATADIR%%/data/models/spitfire/attitude.ac -%%DATADIR%%/data/models/spitfire/attitude.png -%%DATADIR%%/data/models/spitfire/blackout.ac -%%DATADIR%%/data/models/spitfire/boost.ac -%%DATADIR%%/data/models/spitfire/clock.ac -%%DATADIR%%/data/models/spitfire/clock.png -%%DATADIR%%/data/models/spitfire/compass-bezel.png -%%DATADIR%%/data/models/spitfire/compass.ac -%%DATADIR%%/data/models/spitfire/compass.png -%%DATADIR%%/data/models/spitfire/control-stick.ac -%%DATADIR%%/data/models/spitfire/cut-off.ac -%%DATADIR%%/data/models/spitfire/dimmer.ac -%%DATADIR%%/data/models/spitfire/dimmer.png -%%DATADIR%%/data/models/spitfire/engine-start.png -%%DATADIR%%/data/models/spitfire/flaps.ac -%%DATADIR%%/data/models/spitfire/flaps.png -%%DATADIR%%/data/models/spitfire/fuel-cocks.ac -%%DATADIR%%/data/models/spitfire/fuel-pressure.ac -%%DATADIR%%/data/models/spitfire/fuel-pressure.png -%%DATADIR%%/data/models/spitfire/fuel.ac -%%DATADIR%%/data/models/spitfire/fuel.png -%%DATADIR%%/data/models/spitfire/green.png -%%DATADIR%%/data/models/spitfire/hotspotgrid.png -%%DATADIR%%/data/models/spitfire/hunter-alt.png -%%DATADIR%%/data/models/spitfire/hunter-altpress.png -%%DATADIR%%/data/models/spitfire/hunter-turn-face.png -%%DATADIR%%/data/models/spitfire/hunter-turn.png -%%DATADIR%%/data/models/spitfire/hunter-vsi.png -%%DATADIR%%/data/models/spitfire/hunter__a.png -%%DATADIR%%/data/models/spitfire/hurricane-starter.png -%%DATADIR%%/data/models/spitfire/hurricane-turn-a.png -%%DATADIR%%/data/models/spitfire/large-bezel.png -%%DATADIR%%/data/models/spitfire/light-green-flare.ac -%%DATADIR%%/data/models/spitfire/light-red-flare.ac -%%DATADIR%%/data/models/spitfire/light-white-flare.ac -%%DATADIR%%/data/models/spitfire/magcompass.png -%%DATADIR%%/data/models/spitfire/magneto.ac -%%DATADIR%%/data/models/spitfire/magneto.png -%%DATADIR%%/data/models/spitfire/nav-light-switch.ac -%%DATADIR%%/data/models/spitfire/navigation-lights-switch.png -%%DATADIR%%/data/models/spitfire/oil-pressure.ac -%%DATADIR%%/data/models/spitfire/oil-pressure.png -%%DATADIR%%/data/models/spitfire/primer.ac -%%DATADIR%%/data/models/spitfire/puff-new.png -%%DATADIR%%/data/models/spitfire/puff.ac -%%DATADIR%%/data/models/spitfire/puff.png -%%DATADIR%%/data/models/spitfire/red.png -%%DATADIR%%/data/models/spitfire/reflector_gun_sight-01.png -%%DATADIR%%/data/models/spitfire/reflector_gun_sight.png -%%DATADIR%%/data/models/spitfire/rgs-dimmer-switch.ac -%%DATADIR%%/data/models/spitfire/rgs-dimmer-switch.png -%%DATADIR%%/data/models/spitfire/rgs-main-switch.ac -%%DATADIR%%/data/models/spitfire/rgs-main-switch.png -%%DATADIR%%/data/models/spitfire/rgs.ac -%%DATADIR%%/data/models/spitfire/ring-pull.ac -%%DATADIR%%/data/models/spitfire/rpm.ac -%%DATADIR%%/data/models/spitfire/seafire-boost.ac -%%DATADIR%%/data/models/spitfire/seafire-boost.png -%%DATADIR%%/data/models/spitfire/seafire-tx-00.png -%%DATADIR%%/data/models/spitfire/seafire-tx-01.png -%%DATADIR%%/data/models/spitfire/seafire-tx-02.png -%%DATADIR%%/data/models/spitfire/seafire-tx-03.png -%%DATADIR%%/data/models/spitfire/seafire-tx-04.png -%%DATADIR%%/data/models/spitfire/seafire-tx-05.png -%%DATADIR%%/data/models/spitfire/seafireIIIc.osg.gz -%%DATADIR%%/data/models/spitfire/spitfire-asi.png -%%DATADIR%%/data/models/spitfire/spitfire-attitude.png -%%DATADIR%%/data/models/spitfire/spitfire-boost.png -%%DATADIR%%/data/models/spitfire/spitfire-rpm.png -%%DATADIR%%/data/models/spitfire/spitfire-trim.png -%%DATADIR%%/data/models/spitfire/spitfire-triple.png -%%DATADIR%%/data/models/spitfire/spitfire-turn.png -%%DATADIR%%/data/models/spitfire/spitfire-tx-00.png -%%DATADIR%%/data/models/spitfire/spitfire-tx-01.png -%%DATADIR%%/data/models/spitfire/spitfire-tx-02.png -%%DATADIR%%/data/models/spitfire/spitfire-tx-03.png -%%DATADIR%%/data/models/spitfire/spitfire-tx-04.png -%%DATADIR%%/data/models/spitfire/spitfire-tx-05.png -%%DATADIR%%/data/models/spitfire/spitfire-vsi.png -%%DATADIR%%/data/models/spitfire/starter.ac -%%DATADIR%%/data/models/spitfire/switch.png -%%DATADIR%%/data/models/spitfire/throttle.ac -%%DATADIR%%/data/models/spitfire/transparent-bg.png -%%DATADIR%%/data/models/spitfire/trim-knob-rudder.ac -%%DATADIR%%/data/models/spitfire/trim-knob.png -%%DATADIR%%/data/models/spitfire/trim-wheel-elev.ac -%%DATADIR%%/data/models/spitfire/trim.ac -%%DATADIR%%/data/models/spitfire/triple.ac -%%DATADIR%%/data/models/spitfire/turn.ac -%%DATADIR%%/data/models/spitfire/undercarriage-up-down.ac -%%DATADIR%%/data/models/spitfire/vsi.ac -%%DATADIR%%/data/models/spitfire/white.png -%%DATADIR%%/data/models/sr71/Halos.png -%%DATADIR%%/data/models/sr71/RedLight1.ac -%%DATADIR%%/data/models/sr71/colors.png -%%DATADIR%%/data/models/sr71/fire.png -%%DATADIR%%/data/models/sr71/glass.png -%%DATADIR%%/data/models/sr71/grey-blue-flood.png -%%DATADIR%%/data/models/sr71/parachut.png -%%DATADIR%%/data/models/sr71/sr71.osg.gz -%%DATADIR%%/data/models/sr71/wheels.png -%%DATADIR%%/data/models/su37/SU-37-Intake-Screen.png -%%DATADIR%%/data/models/su37/SU-37-Petal.png -%%DATADIR%%/data/models/su37/SU-37-reheat.png -%%DATADIR%%/data/models/su37/SU-37-top.png -%%DATADIR%%/data/models/su37/Trajectory-Marker.ac -%%DATADIR%%/data/models/su37/su37.osg.gz -%%DATADIR%%/data/ossim.kwl -%%DATADIR%%/data/palomino.conf -%%DATADIR%%/data/physics_a4.conf -%%DATADIR%%/data/physics_corsair.conf -%%DATADIR%%/data/physics_f14.conf -%%DATADIR%%/data/physics_f15.conf -%%DATADIR%%/data/physics_f16.conf -%%DATADIR%%/data/physics_f18.conf -%%DATADIR%%/data/physics_f82.conf -%%DATADIR%%/data/physics_f86.conf -%%DATADIR%%/data/physics_mirage2000.conf -%%DATADIR%%/data/physics_p51.conf -%%DATADIR%%/data/physics_sikorsky.conf -%%DATADIR%%/data/physics_spaceShuttle.conf -%%DATADIR%%/data/physics_spitfire.conf -%%DATADIR%%/data/physics_sr71.conf -%%DATADIR%%/data/physics_su37.conf -%%DATADIR%%/data/replays/replayTakeoffFrontSlot.dat.gz -%%DATADIR%%/data/replays/replayTakeoffRearSlot.dat.gz -%%DATADIR%%/data/shaders/aircraft_frag.glsl -%%DATADIR%%/data/shaders/aircraft_highSpecular_frag.glsl -%%DATADIR%%/data/shaders/aircraft_highSpecular_vert.glsl -%%DATADIR%%/data/shaders/aircraft_lowSpecular_frag.glsl -%%DATADIR%%/data/shaders/aircraft_lowSpecular_vert.glsl -%%DATADIR%%/data/shaders/aircraft_sr71_frag.glsl -%%DATADIR%%/data/shaders/aircraft_sr71_vert.glsl -%%DATADIR%%/data/shaders/aircraft_vert.glsl -%%DATADIR%%/data/shaders/color_frag.glsl -%%DATADIR%%/data/shaders/color_vert.glsl -%%DATADIR%%/data/shaders/default_frag.glsl -%%DATADIR%%/data/shaders/default_vert.glsl -%%DATADIR%%/data/shaders/inc_ComputeDiffuseSpecular_vert.glsl -%%DATADIR%%/data/shaders/inc_aircraft_frag.glsl -%%DATADIR%%/data/shaders/inc_brightness_frag.glsl -%%DATADIR%%/data/shaders/inc_color_vert.glsl -%%DATADIR%%/data/shaders/inc_fog_frag.glsl -%%DATADIR%%/data/shaders/inc_fog_vert.glsl -%%DATADIR%%/data/shaders/inc_frag.glsl -%%DATADIR%%/data/shaders/inc_shadow_frag.glsl -%%DATADIR%%/data/shaders/inc_shadow_vert.glsl -%%DATADIR%%/data/shaders/inc_vert.glsl -%%DATADIR%%/data/shaders/module.txt -%%DATADIR%%/data/shaders/nop_frag.glsl -%%DATADIR%%/data/shaders/nop_vert.glsl -%%DATADIR%%/data/shaders/reference/inc_DirectionalLight_vert.glsl -%%DATADIR%%/data/shaders/reference/inc_PointLight_vert.glsl -%%DATADIR%%/data/shaders/reference/inc_SpotLight_vert.glsl -%%DATADIR%%/data/shaders/reference/inc_color_vert.glsl -%%DATADIR%%/data/sounds/README.txt -%%DATADIR%%/data/sounds/beep1.wav.gz -%%DATADIR%%/data/sounds/beep2.wav.gz -%%DATADIR%%/data/sounds/crash.wav.gz -%%DATADIR%%/data/sounds/gear.wav.gz -%%DATADIR%%/data/sounds/hit.wav.gz -%%DATADIR%%/data/sounds/jet.wav.gz -%%DATADIR%%/data/sounds/jet_whine.wav.gz -%%DATADIR%%/data/sounds/laser.wav.gz -%%DATADIR%%/data/sounds/missile.wav.gz -%%DATADIR%%/data/sounds/piston.wav.gz -%%DATADIR%%/data/sounds/piston_cough.wav.gz -%%DATADIR%%/data/sounds/rotor.wav.gz -%%DATADIR%%/data/sounds/rumble.wav.gz -%%DATADIR%%/data/sounds/stall.wav.gz -%%DATADIR%%/data/sounds/thunder.wav.gz -%%DATADIR%%/data/sounds/turboprop1.wav.gz -%%DATADIR%%/data/terrain/GoldenGate.osga -%%DATADIR%%/data/textures/README.txt -%%DATADIR%%/data/textures/cloud0.png -%%DATADIR%%/data/textures/cloud1.png -%%DATADIR%%/data/textures/cloud2.png -%%DATADIR%%/data/textures/cloud3.png -%%DATADIR%%/data/textures/cloudRain0.png -%%DATADIR%%/data/textures/moon.png -%%DATADIR%%/data/textures/smoke.png -%%DATADIR%%/scripts/actors.lua -%%DATADIR%%/scripts/cmd.lua -%%DATADIR%%/scripts/defs.lua -%%DATADIR%%/scripts/events.lua -%%DATADIR%%/scripts/game.lua -%%DATADIR%%/scripts/gfx.lua -%%DATADIR%%/scripts/hud.lua -%%DATADIR%%/scripts/joystick.lua -%%DATADIR%%/scripts/keyboard.lua -%%DATADIR%%/scripts/keyboard_defs.lua -%%DATADIR%%/scripts/lib.lua -%%DATADIR%%/scripts/manipulator_mode.lua -%%DATADIR%%/scripts/mission.lua -%%DATADIR%%/scripts/mission_carrier.lua -%%DATADIR%%/scripts/mission_ossim.lua -%%DATADIR%%/scripts/module.txt -%%DATADIR%%/scripts/module_lua_coding.txt -%%DATADIR%%/scripts/replay.lua -%%DATADIR%%/scripts/scene.lua -%%DATADIR%%/scripts/scene_GoldenGate.lua -%%DATADIR%%/scripts/sim_generic.lua -%%DATADIR%%/scripts/sim_specific.lua -%%DATADIR%%/scripts/sound.lua -%%DATADIR%%/scripts/startup.lua -%%DATADIR%%/scripts/tick.lua -%%DATADIR%%/scripts/timer.lua -%%DATADIR%%/scripts/views.lua -%%DATADIR%%/scripts/weapons.lua -share/pixmaps/palomino.png diff --git a/games/picmi/distinfo b/games/picmi/distinfo index 4cea97ba2d6a..04be2c4a808b 100644 --- a/games/picmi/distinfo +++ b/games/picmi/distinfo @@ -1,3 +1,3 @@ -TIMESTAMP = 1754646355 -SHA256 (KDE/release-service/25.08.0/picmi-25.08.0.tar.xz) = c0edbe4da0fbc78223893a3fec1cba75840f0b1eb735a4a10be422f79bb959a3 -SIZE (KDE/release-service/25.08.0/picmi-25.08.0.tar.xz) = 1521852 +TIMESTAMP = 1757410065 +SHA256 (KDE/release-service/25.08.1/picmi-25.08.1.tar.xz) = b4c7549f66d0a1d81888b2f8c97574a40feab9cfb730723576fc375f6aaa2f4e +SIZE (KDE/release-service/25.08.1/picmi-25.08.1.tar.xz) = 1523712 diff --git a/games/picmi/pkg-plist b/games/picmi/pkg-plist index 5fb299c4fa83..0bf79d42f0b0 100644 --- a/games/picmi/pkg-plist +++ b/games/picmi/pkg-plist @@ -7,6 +7,7 @@ share/icons/hicolor/256x256/apps/picmi.png share/icons/hicolor/32x32/apps/picmi.png share/icons/hicolor/48x48/apps/picmi.png share/icons/hicolor/64x64/apps/picmi.png +share/locale/ar/LC_MESSAGES/picmi.mo share/locale/ast/LC_MESSAGES/picmi.mo share/locale/bs/LC_MESSAGES/picmi.mo share/locale/ca/LC_MESSAGES/picmi.mo diff --git a/games/retroarch/files/patch-fix-ffmpeg8 b/games/retroarch/files/patch-fix-ffmpeg8 new file mode 100644 index 000000000000..148e4d47957f --- /dev/null +++ b/games/retroarch/files/patch-fix-ffmpeg8 @@ -0,0 +1,97 @@ +From 21776a2e59f5f5899ff2198c0df25a95b5020012 Mon Sep 17 00:00:00 2001 +From: libretroadmin <reallibretroretroarch@gmail.com> +Date: Fri, 12 Sep 2025 01:44:51 +0200 +Subject: [PATCH] Attempt to fix ffmpeg 8.0 build errors + +--- + cores/libretro-ffmpeg/ffmpeg_core.c | 14 ++++++++++++++ + record/drivers/record_ffmpeg.c | 17 +++++++++++++++++ + 2 files changed, 31 insertions(+) + +diff --git cores/libretro-ffmpeg/ffmpeg_core.c cores/libretro-ffmpeg/ffmpeg_core.c +index af1a9c6ac76..90272e8e2e2 100644 +--- cores/libretro-ffmpeg/ffmpeg_core.c ++++ cores/libretro-ffmpeg/ffmpeg_core.c +@@ -101,6 +101,9 @@ static tpool_t *tpool; + #define FFMPEG3 ((LIBAVUTIL_VERSION_INT < (56, 6, 100)) || \ + (LIBAVCODEC_VERSION_INT < AV_VERSION_INT(58, 10, 100))) + #endif ++#ifndef FFMPEG8 ++#define FFMPEG8 (LIBAVCODEC_VERSION_MAJOR >= 62) ++#endif + + #if ENABLE_HW_ACCEL + static enum AVHWDeviceType hw_decoder; +@@ -2093,17 +2096,28 @@ void CORE_PREFIX(retro_unload_game)(void) + + for (i = 0; i < MAX_STREAMS; i++) + { ++#if FFMPEG8 ++ if (sctx[i]) ++ avcodec_free_context(&sctx[i]); ++ if (actx[i]) ++ avcodec_free_context(&actx[i]); ++#else + if (sctx[i]) + avcodec_close(sctx[i]); + if (actx[i]) + avcodec_close(actx[i]); ++#endif + sctx[i] = NULL; + actx[i] = NULL; + } + + if (vctx) + { ++#if FFMPEG8 ++ avcodec_free_context(&vctx); ++#else + avcodec_close(vctx); ++#endif + vctx = NULL; + } + +diff --git record/drivers/record_ffmpeg.c record/drivers/record_ffmpeg.c +index 1c97c66886c..41063495c88 100644 +--- record/drivers/record_ffmpeg.c ++++ record/drivers/record_ffmpeg.c +@@ -73,6 +73,15 @@ extern "C" { + #define FFMPEG3 ((LIBAVUTIL_VERSION_INT < (56, 6, 100)) || \ + (LIBAVCODEC_VERSION_INT < AV_VERSION_INT(58, 10, 100))) + #endif ++ ++#ifndef FFMPEG8 ++#define FFMPEG8 (LIBAVCODEC_VERSION_MAJOR >= 62) ++#endif ++ ++#ifndef AV_INPUT_BUFFER_MIN_SIZE ++#define AV_INPUT_BUFFER_MIN_SIZE 16384 ++#endif ++ + #define HAVE_CH_LAYOUT (LIBAVUTIL_VERSION_INT >= AV_VERSION_INT(57, 28, 100)) + + struct ff_video_info +@@ -952,7 +961,11 @@ static void ffmpeg_free(void *data) + + if (handle->audio.codec) + { ++#if FFMPEG8 ++ avcodec_free_context(&handle->audio.codec); ++#else + avcodec_close(handle->audio.codec); ++#endif + av_free(handle->audio.codec); + } + +@@ -960,7 +973,11 @@ static void ffmpeg_free(void *data) + + if (handle->video.codec) + { ++#if FFMPEG8 ++ avcodec_free_context(&handle->video.codec); ++#else + avcodec_close(handle->video.codec); ++#endif + av_free(handle->video.codec); + } + diff --git a/games/skladnik/distinfo b/games/skladnik/distinfo index 38415e788049..c5fb0d05a7c7 100644 --- a/games/skladnik/distinfo +++ b/games/skladnik/distinfo @@ -1,3 +1,3 @@ -TIMESTAMP = 1754646358 -SHA256 (KDE/release-service/25.08.0/skladnik-25.08.0.tar.xz) = 530256e6e7c4fa65a21f1cbb367a2a638daef34ddcc2a51180de223fb1ba694d -SIZE (KDE/release-service/25.08.0/skladnik-25.08.0.tar.xz) = 416776 +TIMESTAMP = 1757410067 +SHA256 (KDE/release-service/25.08.1/skladnik-25.08.1.tar.xz) = fb20efa2b867a42d35575e0758abcbb821451412092ac53a14a8529e8866125d +SIZE (KDE/release-service/25.08.1/skladnik-25.08.1.tar.xz) = 417720 diff --git a/games/skladnik/pkg-plist b/games/skladnik/pkg-plist index d2d50c5537c2..00628fd0dc96 100644 --- a/games/skladnik/pkg-plist +++ b/games/skladnik/pkg-plist @@ -8,6 +8,7 @@ share/icons/hicolor/48x48/apps/skladnik.png share/icons/hicolor/64x64/apps/skladnik.png share/locale/ar/LC_MESSAGES/skladnik.mo share/locale/ast/LC_MESSAGES/skladnik.mo +share/locale/bg/LC_MESSAGES/skladnik.mo share/locale/bs/LC_MESSAGES/skladnik.mo share/locale/ca/LC_MESSAGES/skladnik.mo share/locale/ca@valencia/LC_MESSAGES/skladnik.mo |