diff --git a/LameXP_VS2013.vcxproj b/LameXP_VS2013.vcxproj index 8ba2e965..3b0ddd65 100644 --- a/LameXP_VS2013.vcxproj +++ b/LameXP_VS2013.vcxproj @@ -78,7 +78,7 @@ Disabled - $(SolutionDir)\tmp\$(ProjectName);$(QTDIR)\include;$(QTDIR)\include\QtCore;$(QTDIR)\include\QtGui;$(SolutionDir)\etc\Prerequisites\VisualLeakDetector\include;$(SolutionDir)\etc\Prerequisites\keccak\include;$(SolutionDir)\etc\Prerequisites\strnatcmp\include;%(AdditionalIncludeDirectories) + $(SolutionDir)\tmp\$(ProjectName);$(SolutionDir)\..\MUtilities\include;$(QTDIR)\include;$(QTDIR)\include\QtCore;$(QTDIR)\include\QtGui;$(SolutionDir)\etc\Prerequisites\VisualLeakDetector\include;$(SolutionDir)\etc\Prerequisites\strnatcmp\include;%(AdditionalIncludeDirectories) _CONFIG_NAME=$(ConfigurationName);WIN32;_DEBUG;_CONSOLE;QT_GUI_LIB;QT_CORE_LIB;QT_THREAD_SUPPORT;QT_DLL;QT_DEBUG;%(PreprocessorDefinitions) false EnableFastChecks @@ -91,7 +91,7 @@ "/MANIFESTDEPENDENCY:type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' publicKeyToken='6595b64144ccf1df' language='*' processorArchitecture='*'" %(AdditionalOptions) - QtCored4.lib;QtGuid4.lib;Winmm.lib;Shlwapi.lib;Sensapi.lib;PowrProf.lib;psapi.lib;QKeccakHash_VS2013.lib;%(AdditionalDependencies) + QtCored4.lib;QtGuid4.lib;Winmm.lib;Shlwapi.lib;Sensapi.lib;PowrProf.lib;psapi.lib;%(AdditionalDependencies) $(QTDIR)\lib;$(QTDIR)\plugins\imageformats;$(SolutionDir)\etc\Prerequisites\VisualLeakDetector\lib\Win32;$(SolutionDir)\etc\Prerequisites\keccak\lib\$(Configuration);%(AdditionalLibraryDirectories) true Windows @@ -132,7 +132,7 @@ copy /Y "$(SolutionDir)\etc\Prerequisites\VisualLeakDetector\bin\Win32\*.manifes Speed true true - $(SolutionDir)\tmp\$(ProjectName);$(QTDIR)\include;$(QTDIR)\include\QtCore;$(QTDIR)\include\QtGui;$(SolutionDir)\etc\Prerequisites\VisualLeakDetector\include;$(SolutionDir)\etc\Prerequisites\keccak\include;$(SolutionDir)\etc\Prerequisites\strnatcmp\include;%(AdditionalIncludeDirectories) + $(SolutionDir)\tmp\$(ProjectName);$(SolutionDir)\..\MUtilities\include;$(QTDIR)\include;$(QTDIR)\include\QtCore;$(QTDIR)\include\QtGui;$(SolutionDir)\etc\Prerequisites\VisualLeakDetector\include;$(SolutionDir)\etc\Prerequisites\strnatcmp\include;%(AdditionalIncludeDirectories) _CONFIG_NAME=$(ConfigurationName);WIN32;NDEBUG;_CONSOLE;QT_GUI_LIB;QT_CORE_LIB;QT_THREAD_SUPPORT;QT_DLL;QT_NO_DEBUG;%(PreprocessorDefinitions) false Default @@ -155,7 +155,7 @@ copy /Y "$(SolutionDir)\etc\Prerequisites\VisualLeakDetector\bin\Win32\*.manifes "/MANIFESTDEPENDENCY:type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' publicKeyToken='6595b64144ccf1df' language='*' processorArchitecture='*'" %(AdditionalOptions) - QtCore4.lib;QtGui4.lib;Winmm.lib;Shlwapi.lib;Sensapi.lib;PowrProf.lib;psapi.lib;QKeccakHash_VS2013.lib;%(AdditionalDependencies) + QtCore4.lib;QtGui4.lib;Winmm.lib;Shlwapi.lib;Sensapi.lib;PowrProf.lib;psapi.lib;%(AdditionalDependencies) LinkVerboseLib @@ -212,7 +212,7 @@ del "$(TargetDir)imageformats\q???d4.dll" Speed true true - $(SolutionDir)\tmp\$(ProjectName);$(QTDIR)\include;$(QTDIR)\include\QtCore;$(QTDIR)\include\QtGui;$(SolutionDir)\etc\Prerequisites\VisualLeakDetector\include;$(SolutionDir)\etc\Prerequisites\keccak\include;$(SolutionDir)\etc\Prerequisites\strnatcmp\include;%(AdditionalIncludeDirectories) + $(SolutionDir)\tmp\$(ProjectName);$(SolutionDir)\..\MUtilities\include;$(QTDIR)\include;$(QTDIR)\include\QtCore;$(QTDIR)\include\QtGui;$(SolutionDir)\etc\Prerequisites\VisualLeakDetector\include;$(SolutionDir)\etc\Prerequisites\strnatcmp\include;%(AdditionalIncludeDirectories) _CONFIG_NAME=$(ConfigurationName);WIN32;NDEBUG;_CONSOLE;QT_GUI_LIB;QT_CORE_LIB;QT_THREAD_SUPPORT;QT_NO_DEBUG;QT_NODLL;%(PreprocessorDefinitions) false Default @@ -235,7 +235,7 @@ del "$(TargetDir)imageformats\q???d4.dll" "/MANIFESTDEPENDENCY:type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' publicKeyToken='6595b64144ccf1df' language='*' processorArchitecture='*'" %(AdditionalOptions) - QtCore.lib;QtGui.lib;QtSvg.lib;qtmain.lib;qsvg.lib;qico.lib;qtga.lib;Winmm.lib;imm32.lib;ws2_32.lib;Shlwapi.lib;Sensapi.lib;PowrProf.lib;psapi.lib;QKeccakHash_VS2013.lib;EncodePointer.lib;%(AdditionalDependencies) + QtCore.lib;QtGui.lib;QtSvg.lib;qtmain.lib;qsvg.lib;qico.lib;qtga.lib;Winmm.lib;imm32.lib;ws2_32.lib;Shlwapi.lib;Sensapi.lib;PowrProf.lib;psapi.lib;EncodePointer.lib;%(AdditionalDependencies) LinkVerboseLib $(SolutionDir)\etc\Prerequisites\qt4_static\lib;$(SolutionDir)\etc\Prerequisites\qt4_static\plugins\imageformats;$(SolutionDir)\etc\Prerequisites\EncodePointer\lib;$(SolutionDir)\etc\Prerequisites\VisualLeakDetector\lib\Win32;$(SolutionDir)\etc\Prerequisites\keccak\lib\$(Configuration);%(AdditionalLibraryDirectories) %(IgnoreSpecificDefaultLibraries) @@ -343,7 +343,6 @@ del "$(TargetDir)imageformats\q???d4.dll" - @@ -390,7 +389,6 @@ del "$(TargetDir)imageformats\q???d4.dll" - @@ -589,17 +587,6 @@ del "$(TargetDir)imageformats\q???d4.dll" $(SolutionDir)tmp\$(ProjectName)\MOC_%(Filename).cpp;%(Outputs) - - "$(QTDIR)\bin\moc.exe" -o "$(SolutionDir)tmp\$(ProjectName)\MOC_%(Filename).cpp" "%(FullPath)" - "$(QTDIR)\bin\moc.exe" -o "$(SolutionDir)tmp\$(ProjectName)\MOC_%(Filename).cpp" "%(FullPath)" - "$(QTDIR)\bin\moc.exe" -o "$(SolutionDir)tmp\$(ProjectName)\MOC_%(Filename).cpp" "%(FullPath)" - MOC "$(SolutionDir)tmp\$(ProjectName)\MOC_%(Filename).cpp" - MOC "$(SolutionDir)tmp\$(ProjectName)\MOC_%(Filename).cpp" - MOC "$(SolutionDir)tmp\$(ProjectName)\MOC_%(Filename).cpp" - $(SolutionDir)tmp\$(ProjectName)\MOC_%(Filename).cpp;%(Outputs) - $(SolutionDir)tmp\$(ProjectName)\MOC_%(Filename).cpp;%(Outputs) - $(SolutionDir)tmp\$(ProjectName)\MOC_%(Filename).cpp;%(Outputs) - "$(QTDIR)\bin\moc.exe" -o "$(SolutionDir)tmp\$(ProjectName)\MOC_%(Filename).cpp" "%(FullPath)" @@ -1263,6 +1250,11 @@ del "$(TargetDir)imageformats\q???d4.dll" + + + {55405fe1-149f-434c-9d72-4b64348d2a08} + + \ No newline at end of file diff --git a/LameXP_VS2013.vcxproj.filters b/LameXP_VS2013.vcxproj.filters index cb117b47..85a69751 100644 --- a/LameXP_VS2013.vcxproj.filters +++ b/LameXP_VS2013.vcxproj.filters @@ -238,9 +238,6 @@ Source Files - - Source Files\Threads - Source Files @@ -325,9 +322,6 @@ Generated Files\MOC - - Generated Files\MOC - Generated Files\MOC @@ -773,9 +767,6 @@ Header Files\Encoders - - Header Files\Threads - diff --git a/etc/Prerequisites/keccak/GPL.txt b/etc/Prerequisites/keccak/GPL.txt deleted file mode 100644 index 94a9ed02..00000000 --- a/etc/Prerequisites/keccak/GPL.txt +++ /dev/null @@ -1,674 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 3, 29 June 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The GNU General Public License is a free, copyleft license for -software and other kinds of works. - - The licenses for most software and other practical works are designed -to take away your freedom to share and change the works. By contrast, -the GNU General Public License is intended to guarantee your freedom to -share and change all versions of a program--to make sure it remains free -software for all its users. We, the Free Software Foundation, use the -GNU General Public License for most of our software; it applies also to -any other work released this way by its authors. You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -them if you wish), that you receive source code or can get it if you -want it, that you can change the software or use pieces of it in new -free programs, and that you know you can do these things. - - To protect your rights, we need to prevent others from denying you -these rights or asking you to surrender the rights. Therefore, you have -certain responsibilities if you distribute copies of the software, or if -you modify it: responsibilities to respect the freedom of others. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must pass on to the recipients the same -freedoms that you received. You must make sure that they, too, receive -or can get the source code. And you must show them these terms so they -know their rights. - - Developers that use the GNU GPL protect your rights with two steps: -(1) assert copyright on the software, and (2) offer you this License -giving you legal permission to copy, distribute and/or modify it. - - For the developers' and authors' protection, the GPL clearly explains -that there is no warranty for this free software. For both users' and -authors' sake, the GPL requires that modified versions be marked as -changed, so that their problems will not be attributed erroneously to -authors of previous versions. - - Some devices are designed to deny users access to install or run -modified versions of the software inside them, although the manufacturer -can do so. This is fundamentally incompatible with the aim of -protecting users' freedom to change the software. The systematic -pattern of such abuse occurs in the area of products for individuals to -use, which is precisely where it is most unacceptable. Therefore, we -have designed this version of the GPL to prohibit the practice for those -products. If such problems arise substantially in other domains, we -stand ready to extend this provision to those domains in future versions -of the GPL, as needed to protect the freedom of users. - - Finally, every program is threatened constantly by software patents. -States should not allow patents to restrict development and use of -software on general-purpose computers, but in those that do, we wish to -avoid the special danger that patents applied to a free program could -make it effectively proprietary. To prevent this, the GPL assures that -patents cannot be used to render the program non-free. - - The precise terms and conditions for copying, distribution and -modification follow. - - TERMS AND CONDITIONS - - 0. Definitions. - - "This License" refers to version 3 of the GNU General Public License. - - "Copyright" also means copyright-like laws that apply to other kinds of -works, such as semiconductor masks. - - "The Program" refers to any copyrightable work licensed under this -License. Each licensee is addressed as "you". "Licensees" and -"recipients" may be individuals or organizations. - - To "modify" a work means to copy from or adapt all or part of the work -in a fashion requiring copyright permission, other than the making of an -exact copy. The resulting work is called a "modified version" of the -earlier work or a work "based on" the earlier work. - - A "covered work" means either the unmodified Program or a work based -on the Program. - - To "propagate" a work means to do anything with it that, without -permission, would make you directly or secondarily liable for -infringement under applicable copyright law, except executing it on a -computer or modifying a private copy. Propagation includes copying, -distribution (with or without modification), making available to the -public, and in some countries other activities as well. - - To "convey" a work means any kind of propagation that enables other -parties to make or receive copies. Mere interaction with a user through -a computer network, with no transfer of a copy, is not conveying. - - An interactive user interface displays "Appropriate Legal Notices" -to the extent that it includes a convenient and prominently visible -feature that (1) displays an appropriate copyright notice, and (2) -tells the user that there is no warranty for the work (except to the -extent that warranties are provided), that licensees may convey the -work under this License, and how to view a copy of this License. If -the interface presents a list of user commands or options, such as a -menu, a prominent item in the list meets this criterion. - - 1. Source Code. - - The "source code" for a work means the preferred form of the work -for making modifications to it. "Object code" means any non-source -form of a work. - - A "Standard Interface" means an interface that either is an official -standard defined by a recognized standards body, or, in the case of -interfaces specified for a particular programming language, one that -is widely used among developers working in that language. - - The "System Libraries" of an executable work include anything, other -than the work as a whole, that (a) is included in the normal form of -packaging a Major Component, but which is not part of that Major -Component, and (b) serves only to enable use of the work with that -Major Component, or to implement a Standard Interface for which an -implementation is available to the public in source code form. A -"Major Component", in this context, means a major essential component -(kernel, window system, and so on) of the specific operating system -(if any) on which the executable work runs, or a compiler used to -produce the work, or an object code interpreter used to run it. - - The "Corresponding Source" for a work in object code form means all -the source code needed to generate, install, and (for an executable -work) run the object code and to modify the work, including scripts to -control those activities. However, it does not include the work's -System Libraries, or general-purpose tools or generally available free -programs which are used unmodified in performing those activities but -which are not part of the work. For example, Corresponding Source -includes interface definition files associated with source files for -the work, and the source code for shared libraries and dynamically -linked subprograms that the work is specifically designed to require, -such as by intimate data communication or control flow between those -subprograms and other parts of the work. - - The Corresponding Source need not include anything that users -can regenerate automatically from other parts of the Corresponding -Source. - - The Corresponding Source for a work in source code form is that -same work. - - 2. Basic Permissions. - - All rights granted under this License are granted for the term of -copyright on the Program, and are irrevocable provided the stated -conditions are met. This License explicitly affirms your unlimited -permission to run the unmodified Program. The output from running a -covered work is covered by this License only if the output, given its -content, constitutes a covered work. This License acknowledges your -rights of fair use or other equivalent, as provided by copyright law. - - You may make, run and propagate covered works that you do not -convey, without conditions so long as your license otherwise remains -in force. You may convey covered works to others for the sole purpose -of having them make modifications exclusively for you, or provide you -with facilities for running those works, provided that you comply with -the terms of this License in conveying all material for which you do -not control copyright. Those thus making or running the covered works -for you must do so exclusively on your behalf, under your direction -and control, on terms that prohibit them from making any copies of -your copyrighted material outside their relationship with you. - - Conveying under any other circumstances is permitted solely under -the conditions stated below. Sublicensing is not allowed; section 10 -makes it unnecessary. - - 3. Protecting Users' Legal Rights From Anti-Circumvention Law. - - No covered work shall be deemed part of an effective technological -measure under any applicable law fulfilling obligations under article -11 of the WIPO copyright treaty adopted on 20 December 1996, or -similar laws prohibiting or restricting circumvention of such -measures. - - When you convey a covered work, you waive any legal power to forbid -circumvention of technological measures to the extent such circumvention -is effected by exercising rights under this License with respect to -the covered work, and you disclaim any intention to limit operation or -modification of the work as a means of enforcing, against the work's -users, your or third parties' legal rights to forbid circumvention of -technological measures. - - 4. Conveying Verbatim Copies. - - You may convey verbatim copies of the Program's source code as you -receive it, in any medium, provided that you conspicuously and -appropriately publish on each copy an appropriate copyright notice; -keep intact all notices stating that this License and any -non-permissive terms added in accord with section 7 apply to the code; -keep intact all notices of the absence of any warranty; and give all -recipients a copy of this License along with the Program. - - You may charge any price or no price for each copy that you convey, -and you may offer support or warranty protection for a fee. - - 5. Conveying Modified Source Versions. - - You may convey a work based on the Program, or the modifications to -produce it from the Program, in the form of source code under the -terms of section 4, provided that you also meet all of these conditions: - - a) The work must carry prominent notices stating that you modified - it, and giving a relevant date. - - b) The work must carry prominent notices stating that it is - released under this License and any conditions added under section - 7. This requirement modifies the requirement in section 4 to - "keep intact all notices". - - c) You must license the entire work, as a whole, under this - License to anyone who comes into possession of a copy. This - License will therefore apply, along with any applicable section 7 - additional terms, to the whole of the work, and all its parts, - regardless of how they are packaged. This License gives no - permission to license the work in any other way, but it does not - invalidate such permission if you have separately received it. - - d) If the work has interactive user interfaces, each must display - Appropriate Legal Notices; however, if the Program has interactive - interfaces that do not display Appropriate Legal Notices, your - work need not make them do so. - - A compilation of a covered work with other separate and independent -works, which are not by their nature extensions of the covered work, -and which are not combined with it such as to form a larger program, -in or on a volume of a storage or distribution medium, is called an -"aggregate" if the compilation and its resulting copyright are not -used to limit the access or legal rights of the compilation's users -beyond what the individual works permit. Inclusion of a covered work -in an aggregate does not cause this License to apply to the other -parts of the aggregate. - - 6. Conveying Non-Source Forms. - - You may convey a covered work in object code form under the terms -of sections 4 and 5, provided that you also convey the -machine-readable Corresponding Source under the terms of this License, -in one of these ways: - - a) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by the - Corresponding Source fixed on a durable physical medium - customarily used for software interchange. - - b) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by a - written offer, valid for at least three years and valid for as - long as you offer spare parts or customer support for that product - model, to give anyone who possesses the object code either (1) a - copy of the Corresponding Source for all the software in the - product that is covered by this License, on a durable physical - medium customarily used for software interchange, for a price no - more than your reasonable cost of physically performing this - conveying of source, or (2) access to copy the - Corresponding Source from a network server at no charge. - - c) Convey individual copies of the object code with a copy of the - written offer to provide the Corresponding Source. This - alternative is allowed only occasionally and noncommercially, and - only if you received the object code with such an offer, in accord - with subsection 6b. - - d) Convey the object code by offering access from a designated - place (gratis or for a charge), and offer equivalent access to the - Corresponding Source in the same way through the same place at no - further charge. You need not require recipients to copy the - Corresponding Source along with the object code. If the place to - copy the object code is a network server, the Corresponding Source - may be on a different server (operated by you or a third party) - that supports equivalent copying facilities, provided you maintain - clear directions next to the object code saying where to find the - Corresponding Source. Regardless of what server hosts the - Corresponding Source, you remain obligated to ensure that it is - available for as long as needed to satisfy these requirements. - - e) Convey the object code using peer-to-peer transmission, provided - you inform other peers where the object code and Corresponding - Source of the work are being offered to the general public at no - charge under subsection 6d. - - A separable portion of the object code, whose source code is excluded -from the Corresponding Source as a System Library, need not be -included in conveying the object code work. - - A "User Product" is either (1) a "consumer product", which means any -tangible personal property which is normally used for personal, family, -or household purposes, or (2) anything designed or sold for incorporation -into a dwelling. In determining whether a product is a consumer product, -doubtful cases shall be resolved in favor of coverage. For a particular -product received by a particular user, "normally used" refers to a -typical or common use of that class of product, regardless of the status -of the particular user or of the way in which the particular user -actually uses, or expects or is expected to use, the product. A product -is a consumer product regardless of whether the product has substantial -commercial, industrial or non-consumer uses, unless such uses represent -the only significant mode of use of the product. - - "Installation Information" for a User Product means any methods, -procedures, authorization keys, or other information required to install -and execute modified versions of a covered work in that User Product from -a modified version of its Corresponding Source. The information must -suffice to ensure that the continued functioning of the modified object -code is in no case prevented or interfered with solely because -modification has been made. - - If you convey an object code work under this section in, or with, or -specifically for use in, a User Product, and the conveying occurs as -part of a transaction in which the right of possession and use of the -User Product is transferred to the recipient in perpetuity or for a -fixed term (regardless of how the transaction is characterized), the -Corresponding Source conveyed under this section must be accompanied -by the Installation Information. But this requirement does not apply -if neither you nor any third party retains the ability to install -modified object code on the User Product (for example, the work has -been installed in ROM). - - The requirement to provide Installation Information does not include a -requirement to continue to provide support service, warranty, or updates -for a work that has been modified or installed by the recipient, or for -the User Product in which it has been modified or installed. Access to a -network may be denied when the modification itself materially and -adversely affects the operation of the network or violates the rules and -protocols for communication across the network. - - Corresponding Source conveyed, and Installation Information provided, -in accord with this section must be in a format that is publicly -documented (and with an implementation available to the public in -source code form), and must require no special password or key for -unpacking, reading or copying. - - 7. Additional Terms. - - "Additional permissions" are terms that supplement the terms of this -License by making exceptions from one or more of its conditions. -Additional permissions that are applicable to the entire Program shall -be treated as though they were included in this License, to the extent -that they are valid under applicable law. If additional permissions -apply only to part of the Program, that part may be used separately -under those permissions, but the entire Program remains governed by -this License without regard to the additional permissions. - - When you convey a copy of a covered work, you may at your option -remove any additional permissions from that copy, or from any part of -it. (Additional permissions may be written to require their own -removal in certain cases when you modify the work.) You may place -additional permissions on material, added by you to a covered work, -for which you have or can give appropriate copyright permission. - - Notwithstanding any other provision of this License, for material you -add to a covered work, you may (if authorized by the copyright holders of -that material) supplement the terms of this License with terms: - - a) Disclaiming warranty or limiting liability differently from the - terms of sections 15 and 16 of this License; or - - b) Requiring preservation of specified reasonable legal notices or - author attributions in that material or in the Appropriate Legal - Notices displayed by works containing it; or - - c) Prohibiting misrepresentation of the origin of that material, or - requiring that modified versions of such material be marked in - reasonable ways as different from the original version; or - - d) Limiting the use for publicity purposes of names of licensors or - authors of the material; or - - e) Declining to grant rights under trademark law for use of some - trade names, trademarks, or service marks; or - - f) Requiring indemnification of licensors and authors of that - material by anyone who conveys the material (or modified versions of - it) with contractual assumptions of liability to the recipient, for - any liability that these contractual assumptions directly impose on - those licensors and authors. - - All other non-permissive additional terms are considered "further -restrictions" within the meaning of section 10. If the Program as you -received it, or any part of it, contains a notice stating that it is -governed by this License along with a term that is a further -restriction, you may remove that term. If a license document contains -a further restriction but permits relicensing or conveying under this -License, you may add to a covered work material governed by the terms -of that license document, provided that the further restriction does -not survive such relicensing or conveying. - - If you add terms to a covered work in accord with this section, you -must place, in the relevant source files, a statement of the -additional terms that apply to those files, or a notice indicating -where to find the applicable terms. - - Additional terms, permissive or non-permissive, may be stated in the -form of a separately written license, or stated as exceptions; -the above requirements apply either way. - - 8. Termination. - - You may not propagate or modify a covered work except as expressly -provided under this License. Any attempt otherwise to propagate or -modify it is void, and will automatically terminate your rights under -this License (including any patent licenses granted under the third -paragraph of section 11). - - However, if you cease all violation of this License, then your -license from a particular copyright holder is reinstated (a) -provisionally, unless and until the copyright holder explicitly and -finally terminates your license, and (b) permanently, if the copyright -holder fails to notify you of the violation by some reasonable means -prior to 60 days after the cessation. - - Moreover, your license from a particular copyright holder is -reinstated permanently if the copyright holder notifies you of the -violation by some reasonable means, this is the first time you have -received notice of violation of this License (for any work) from that -copyright holder, and you cure the violation prior to 30 days after -your receipt of the notice. - - Termination of your rights under this section does not terminate the -licenses of parties who have received copies or rights from you under -this License. If your rights have been terminated and not permanently -reinstated, you do not qualify to receive new licenses for the same -material under section 10. - - 9. Acceptance Not Required for Having Copies. - - You are not required to accept this License in order to receive or -run a copy of the Program. Ancillary propagation of a covered work -occurring solely as a consequence of using peer-to-peer transmission -to receive a copy likewise does not require acceptance. However, -nothing other than this License grants you permission to propagate or -modify any covered work. These actions infringe copyright if you do -not accept this License. Therefore, by modifying or propagating a -covered work, you indicate your acceptance of this License to do so. - - 10. Automatic Licensing of Downstream Recipients. - - Each time you convey a covered work, the recipient automatically -receives a license from the original licensors, to run, modify and -propagate that work, subject to this License. You are not responsible -for enforcing compliance by third parties with this License. - - An "entity transaction" is a transaction transferring control of an -organization, or substantially all assets of one, or subdividing an -organization, or merging organizations. If propagation of a covered -work results from an entity transaction, each party to that -transaction who receives a copy of the work also receives whatever -licenses to the work the party's predecessor in interest had or could -give under the previous paragraph, plus a right to possession of the -Corresponding Source of the work from the predecessor in interest, if -the predecessor has it or can get it with reasonable efforts. - - You may not impose any further restrictions on the exercise of the -rights granted or affirmed under this License. For example, you may -not impose a license fee, royalty, or other charge for exercise of -rights granted under this License, and you may not initiate litigation -(including a cross-claim or counterclaim in a lawsuit) alleging that -any patent claim is infringed by making, using, selling, offering for -sale, or importing the Program or any portion of it. - - 11. Patents. - - A "contributor" is a copyright holder who authorizes use under this -License of the Program or a work on which the Program is based. The -work thus licensed is called the contributor's "contributor version". - - A contributor's "essential patent claims" are all patent claims -owned or controlled by the contributor, whether already acquired or -hereafter acquired, that would be infringed by some manner, permitted -by this License, of making, using, or selling its contributor version, -but do not include claims that would be infringed only as a -consequence of further modification of the contributor version. For -purposes of this definition, "control" includes the right to grant -patent sublicenses in a manner consistent with the requirements of -this License. - - Each contributor grants you a non-exclusive, worldwide, royalty-free -patent license under the contributor's essential patent claims, to -make, use, sell, offer for sale, import and otherwise run, modify and -propagate the contents of its contributor version. - - In the following three paragraphs, a "patent license" is any express -agreement or commitment, however denominated, not to enforce a patent -(such as an express permission to practice a patent or covenant not to -sue for patent infringement). To "grant" such a patent license to a -party means to make such an agreement or commitment not to enforce a -patent against the party. - - If you convey a covered work, knowingly relying on a patent license, -and the Corresponding Source of the work is not available for anyone -to copy, free of charge and under the terms of this License, through a -publicly available network server or other readily accessible means, -then you must either (1) cause the Corresponding Source to be so -available, or (2) arrange to deprive yourself of the benefit of the -patent license for this particular work, or (3) arrange, in a manner -consistent with the requirements of this License, to extend the patent -license to downstream recipients. "Knowingly relying" means you have -actual knowledge that, but for the patent license, your conveying the -covered work in a country, or your recipient's use of the covered work -in a country, would infringe one or more identifiable patents in that -country that you have reason to believe are valid. - - If, pursuant to or in connection with a single transaction or -arrangement, you convey, or propagate by procuring conveyance of, a -covered work, and grant a patent license to some of the parties -receiving the covered work authorizing them to use, propagate, modify -or convey a specific copy of the covered work, then the patent license -you grant is automatically extended to all recipients of the covered -work and works based on it. - - A patent license is "discriminatory" if it does not include within -the scope of its coverage, prohibits the exercise of, or is -conditioned on the non-exercise of one or more of the rights that are -specifically granted under this License. You may not convey a covered -work if you are a party to an arrangement with a third party that is -in the business of distributing software, under which you make payment -to the third party based on the extent of your activity of conveying -the work, and under which the third party grants, to any of the -parties who would receive the covered work from you, a discriminatory -patent license (a) in connection with copies of the covered work -conveyed by you (or copies made from those copies), or (b) primarily -for and in connection with specific products or compilations that -contain the covered work, unless you entered into that arrangement, -or that patent license was granted, prior to 28 March 2007. - - Nothing in this License shall be construed as excluding or limiting -any implied license or other defenses to infringement that may -otherwise be available to you under applicable patent law. - - 12. No Surrender of Others' Freedom. - - If conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot convey a -covered work so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you may -not convey it at all. For example, if you agree to terms that obligate you -to collect a royalty for further conveying from those to whom you convey -the Program, the only way you could satisfy both those terms and this -License would be to refrain entirely from conveying the Program. - - 13. Use with the GNU Affero General Public License. - - Notwithstanding any other provision of this License, you have -permission to link or combine any covered work with a work licensed -under version 3 of the GNU Affero General Public License into a single -combined work, and to convey the resulting work. The terms of this -License will continue to apply to the part which is the covered work, -but the special requirements of the GNU Affero General Public License, -section 13, concerning interaction through a network will apply to the -combination as such. - - 14. Revised Versions of this License. - - The Free Software Foundation may publish revised and/or new versions of -the GNU General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - - Each version is given a distinguishing version number. If the -Program specifies that a certain numbered version of the GNU General -Public License "or any later version" applies to it, you have the -option of following the terms and conditions either of that numbered -version or of any later version published by the Free Software -Foundation. If the Program does not specify a version number of the -GNU General Public License, you may choose any version ever published -by the Free Software Foundation. - - If the Program specifies that a proxy can decide which future -versions of the GNU General Public License can be used, that proxy's -public statement of acceptance of a version permanently authorizes you -to choose that version for the Program. - - Later license versions may give you additional or different -permissions. However, no additional obligations are imposed on any -author or copyright holder as a result of your choosing to follow a -later version. - - 15. Disclaimer of Warranty. - - THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY -APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT -HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY -OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM -IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF -ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. Limitation of Liability. - - IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS -THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY -GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE -USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF -DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD -PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), -EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF -SUCH DAMAGES. - - 17. Interpretation of Sections 15 and 16. - - If the disclaimer of warranty and limitation of liability provided -above cannot be given local legal effect according to their terms, -reviewing courts shall apply local law that most closely approximates -an absolute waiver of all civil liability in connection with the -Program, unless a warranty or assumption of liability accompanies a -copy of the Program in return for a fee. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -state the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . - -Also add information on how to contact you by electronic and paper mail. - - If the program does terminal interaction, make it output a short -notice like this when it starts in an interactive mode: - - Copyright (C) - This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, your program's commands -might be different; for a GUI interface, you would use an "about box". - - You should also get your employer (if you work as a programmer) or school, -if any, to sign a "copyright disclaimer" for the program, if necessary. -For more information on this, and how to apply and follow the GNU GPL, see -. - - The GNU General Public License does not permit incorporating your program -into proprietary programs. If your program is a subroutine library, you -may consider it more useful to permit linking proprietary applications with -the library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. But first, please read -. diff --git a/etc/Prerequisites/keccak/QKeccakHash_VS2010.sln b/etc/Prerequisites/keccak/QKeccakHash_VS2010.sln deleted file mode 100644 index 753b5a58..00000000 --- a/etc/Prerequisites/keccak/QKeccakHash_VS2010.sln +++ /dev/null @@ -1,23 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 11.00 -# Visual Studio 2010 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "QKeccakHash_VS2010", "QKeccakHash_VS2010.vcxproj", "{70E8B639-3DB7-479A-AFED-4CECDD747657}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Win32 = Debug|Win32 - Release_Static|Win32 = Release_Static|Win32 - Release|Win32 = Release|Win32 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {70E8B639-3DB7-479A-AFED-4CECDD747657}.Debug|Win32.ActiveCfg = Debug|Win32 - {70E8B639-3DB7-479A-AFED-4CECDD747657}.Debug|Win32.Build.0 = Debug|Win32 - {70E8B639-3DB7-479A-AFED-4CECDD747657}.Release_Static|Win32.ActiveCfg = Release_Static|Win32 - {70E8B639-3DB7-479A-AFED-4CECDD747657}.Release_Static|Win32.Build.0 = Release_Static|Win32 - {70E8B639-3DB7-479A-AFED-4CECDD747657}.Release|Win32.ActiveCfg = Release|Win32 - {70E8B639-3DB7-479A-AFED-4CECDD747657}.Release|Win32.Build.0 = Release|Win32 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/etc/Prerequisites/keccak/QKeccakHash_VS2010.vcxproj b/etc/Prerequisites/keccak/QKeccakHash_VS2010.vcxproj deleted file mode 100644 index be4f9095..00000000 --- a/etc/Prerequisites/keccak/QKeccakHash_VS2010.vcxproj +++ /dev/null @@ -1,157 +0,0 @@ - - - - - Debug - Win32 - - - Release_Static - Win32 - - - Release - Win32 - - - - - true - true - true - - - - - - - - {70E8B639-3DB7-479A-AFED-4CECDD747657} - Win32Proj - qkeccakhash - - - - StaticLibrary - true - Unicode - Windows7.1SDK - false - - - StaticLibrary - false - true - Unicode - Windows7.1SDK - - - StaticLibrary - false - true - Unicode - Windows7.1SDK - - - - - - - - - - - - - - - - $(SolutionDir)\lib\$(Configuration)\ - - - $(SolutionDir)\obj\$(Configuration)\ - - - $(SolutionDir)\lib\$(Configuration)\ - - - $(SolutionDir)\lib\$(Configuration)\ - - - $(SolutionDir)\obj\$(Configuration)\ - - - $(SolutionDir)\obj\$(Configuration)\ - - - - NotUsing - Level3 - Disabled - WIN32;_DEBUG;_LIB;QT_LARGEFILE_SUPPORT;QT_GUI_LIB;QT_CORE_LIB;QT_THREAD_SUPPORT;QT_DLL;QT_DEBUG;%(PreprocessorDefinitions) - $(SolutionDir)\include;$(QTDIR)\include;$(QTDIR)\include\QtCore;%(AdditionalIncludeDirectories) - ProgramDatabase - - - Windows - true - - - - - Level3 - NotUsing - Full - true - true - WIN32;NDEBUG;_LIB;QT_LARGEFILE_SUPPORT;QT_GUI_LIB;QT_CORE_LIB;QT_THREAD_SUPPORT;QT_DLL;QT_NO_DEBUG;%(PreprocessorDefinitions) - $(SolutionDir)\include;$(QTDIR)\include;$(QTDIR)\include\QtCore;%(AdditionalIncludeDirectories) - AnySuitable - Speed - true - true - MultiThreadedDLL - NotSet - false - - - Windows - true - true - true - - - true - - - - - Level3 - NotUsing - Full - true - true - WIN32;NDEBUG;_LIB;QT_LARGEFILE_SUPPORT;QT_GUI_LIB;QT_CORE_LIB;QT_THREAD_SUPPORT;QT_NO_DEBUG;QT_NODLL;%(PreprocessorDefinitions) - $(SolutionDir)\include;$(QTDIR)\include;$(QTDIR)\include\QtCore;%(AdditionalIncludeDirectories) - AnySuitable - Speed - true - true - MultiThreaded - NotSet - false - - - Windows - true - true - true - - - true - - - - - - \ No newline at end of file diff --git a/etc/Prerequisites/keccak/QKeccakHash_VS2010.vcxproj.filters b/etc/Prerequisites/keccak/QKeccakHash_VS2010.vcxproj.filters deleted file mode 100644 index 7ee57688..00000000 --- a/etc/Prerequisites/keccak/QKeccakHash_VS2010.vcxproj.filters +++ /dev/null @@ -1,30 +0,0 @@ - - - - - {4FC737F1-C7A5-4376-A066-2A32D752A2FF} - cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx - - - {93995380-89BD-4b04-88EB-625FBE52EBFB} - h;hpp;hxx;hm;inl;inc;xsd - - - {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} - rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms - - - - - Source Files - - - Source Files - - - - - Header Files - - - \ No newline at end of file diff --git a/etc/Prerequisites/keccak/QKeccakHash_VS2012.sln b/etc/Prerequisites/keccak/QKeccakHash_VS2012.sln deleted file mode 100644 index 6ce88498..00000000 --- a/etc/Prerequisites/keccak/QKeccakHash_VS2012.sln +++ /dev/null @@ -1,23 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2012 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "QKeccakHash_VS2012", "QKeccakHash_VS2012.vcxproj", "{70E8B639-3DB7-479A-AFED-4CECDD747657}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Win32 = Debug|Win32 - Release_Static|Win32 = Release_Static|Win32 - Release|Win32 = Release|Win32 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {70E8B639-3DB7-479A-AFED-4CECDD747657}.Debug|Win32.ActiveCfg = Debug|Win32 - {70E8B639-3DB7-479A-AFED-4CECDD747657}.Debug|Win32.Build.0 = Debug|Win32 - {70E8B639-3DB7-479A-AFED-4CECDD747657}.Release_Static|Win32.ActiveCfg = Release_Static|Win32 - {70E8B639-3DB7-479A-AFED-4CECDD747657}.Release_Static|Win32.Build.0 = Release_Static|Win32 - {70E8B639-3DB7-479A-AFED-4CECDD747657}.Release|Win32.ActiveCfg = Release|Win32 - {70E8B639-3DB7-479A-AFED-4CECDD747657}.Release|Win32.Build.0 = Release|Win32 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/etc/Prerequisites/keccak/QKeccakHash_VS2012.vcxproj b/etc/Prerequisites/keccak/QKeccakHash_VS2012.vcxproj deleted file mode 100644 index f415f349..00000000 --- a/etc/Prerequisites/keccak/QKeccakHash_VS2012.vcxproj +++ /dev/null @@ -1,158 +0,0 @@ - - - - - Debug - Win32 - - - Release_Static - Win32 - - - Release - Win32 - - - - - true - true - true - - - - - - - - {70E8B639-3DB7-479A-AFED-4CECDD747657} - Win32Proj - qkeccakhash - - - - StaticLibrary - true - Unicode - v110 - false - - - StaticLibrary - false - true - Unicode - v110 - - - StaticLibrary - false - true - Unicode - v110 - - - - - - - - - - - - - - - - $(SolutionDir)\lib\$(Configuration)\ - - - $(SolutionDir)\obj\$(Configuration)\ - - - $(SolutionDir)\lib\$(Configuration)\ - - - $(SolutionDir)\lib\$(Configuration)\ - - - $(SolutionDir)\obj\$(Configuration)\ - - - $(SolutionDir)\obj\$(Configuration)\ - - - - NotUsing - Level3 - Disabled - WIN32;_DEBUG;_LIB;QT_LARGEFILE_SUPPORT;QT_GUI_LIB;QT_CORE_LIB;QT_THREAD_SUPPORT;QT_DLL;QT_DEBUG;%(PreprocessorDefinitions) - $(SolutionDir)\include;$(QTDIR)\include;$(QTDIR)\include\QtCore;%(AdditionalIncludeDirectories) - ProgramDatabase - NoExtensions - - - Windows - true - - - - - Level3 - NotUsing - Full - true - true - WIN32;NDEBUG;_LIB;QT_LARGEFILE_SUPPORT;QT_GUI_LIB;QT_CORE_LIB;QT_THREAD_SUPPORT;QT_DLL;QT_NO_DEBUG;%(PreprocessorDefinitions) - $(SolutionDir)\include;$(QTDIR)\include;$(QTDIR)\include\QtCore;%(AdditionalIncludeDirectories) - AnySuitable - Speed - true - true - MultiThreadedDLL - NoExtensions - false - - - Windows - true - true - true - - - true - - - - - Level3 - NotUsing - Full - true - true - WIN32;NDEBUG;_LIB;QT_LARGEFILE_SUPPORT;QT_GUI_LIB;QT_CORE_LIB;QT_THREAD_SUPPORT;QT_NO_DEBUG;QT_NODLL;%(PreprocessorDefinitions) - $(SolutionDir)\include;$(QTDIR)\include;$(QTDIR)\include\QtCore;%(AdditionalIncludeDirectories) - AnySuitable - Speed - true - true - MultiThreaded - NoExtensions - false - - - Windows - true - true - true - - - true - - - - - - \ No newline at end of file diff --git a/etc/Prerequisites/keccak/QKeccakHash_VS2012.vcxproj.filters b/etc/Prerequisites/keccak/QKeccakHash_VS2012.vcxproj.filters deleted file mode 100644 index 7ee57688..00000000 --- a/etc/Prerequisites/keccak/QKeccakHash_VS2012.vcxproj.filters +++ /dev/null @@ -1,30 +0,0 @@ - - - - - {4FC737F1-C7A5-4376-A066-2A32D752A2FF} - cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx - - - {93995380-89BD-4b04-88EB-625FBE52EBFB} - h;hpp;hxx;hm;inl;inc;xsd - - - {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} - rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms - - - - - Source Files - - - Source Files - - - - - Header Files - - - \ No newline at end of file diff --git a/etc/Prerequisites/keccak/QKeccakHash_VS2013.sln b/etc/Prerequisites/keccak/QKeccakHash_VS2013.sln deleted file mode 100644 index 0e93a295..00000000 --- a/etc/Prerequisites/keccak/QKeccakHash_VS2013.sln +++ /dev/null @@ -1,25 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Express 2013 for Windows Desktop -VisualStudioVersion = 12.0.21005.1 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "QKeccakHash_VS2013", "QKeccakHash_VS2013.vcxproj", "{70E8B639-3DB7-479A-AFED-4CECDD747657}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Win32 = Debug|Win32 - Release_Static|Win32 = Release_Static|Win32 - Release|Win32 = Release|Win32 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {70E8B639-3DB7-479A-AFED-4CECDD747657}.Debug|Win32.ActiveCfg = Debug|Win32 - {70E8B639-3DB7-479A-AFED-4CECDD747657}.Debug|Win32.Build.0 = Debug|Win32 - {70E8B639-3DB7-479A-AFED-4CECDD747657}.Release_Static|Win32.ActiveCfg = Release_Static|Win32 - {70E8B639-3DB7-479A-AFED-4CECDD747657}.Release_Static|Win32.Build.0 = Release_Static|Win32 - {70E8B639-3DB7-479A-AFED-4CECDD747657}.Release|Win32.ActiveCfg = Release|Win32 - {70E8B639-3DB7-479A-AFED-4CECDD747657}.Release|Win32.Build.0 = Release|Win32 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/etc/Prerequisites/keccak/QKeccakHash_VS2013.vcxproj b/etc/Prerequisites/keccak/QKeccakHash_VS2013.vcxproj deleted file mode 100644 index 00b8a077..00000000 --- a/etc/Prerequisites/keccak/QKeccakHash_VS2013.vcxproj +++ /dev/null @@ -1,166 +0,0 @@ - - - - - Debug - Win32 - - - Release_Static - Win32 - - - Release - Win32 - - - - - true - true - true - - - - - - - - {70E8B639-3DB7-479A-AFED-4CECDD747657} - Win32Proj - qkeccakhash - - - - StaticLibrary - true - Unicode - v120_xp - false - - - StaticLibrary - false - true - Unicode - v120_xp - - - StaticLibrary - false - true - Unicode - v120_xp - - - - - - - - - - - - - - - - $(SolutionDir)\lib\$(Configuration)\ - - - $(SolutionDir)\obj\$(Configuration)\ - - - $(SolutionDir)\lib\$(Configuration)\ - - - $(SolutionDir)\lib\$(Configuration)\ - - - $(SolutionDir)\obj\$(Configuration)\ - - - $(SolutionDir)\obj\$(Configuration)\ - - - - NotUsing - Level3 - Disabled - WIN32;_DEBUG;_LIB;QT_GUI_LIB;QT_CORE_LIB;QT_THREAD_SUPPORT;QT_DLL;QT_DEBUG;%(PreprocessorDefinitions) - $(SolutionDir)\include;$(QTDIR)\include;$(QTDIR)\include\QtCore;%(AdditionalIncludeDirectories) - ProgramDatabase - NoExtensions - - - Windows - true - - - - - Level3 - NotUsing - Full - true - true - WIN32;NDEBUG;_LIB;QT_GUI_LIB;QT_CORE_LIB;QT_THREAD_SUPPORT;QT_DLL;QT_NO_DEBUG;%(PreprocessorDefinitions) - $(SolutionDir)\include;$(QTDIR)\include;$(QTDIR)\include\QtCore;%(AdditionalIncludeDirectories) - AnySuitable - Speed - true - true - MultiThreadedDLL - NoExtensions - false - false - false - false - None - - - Windows - true - true - true - - - true - - - - - Level3 - NotUsing - Full - true - true - WIN32;NDEBUG;_LIB;QT_GUI_LIB;QT_CORE_LIB;QT_THREAD_SUPPORT;QT_NO_DEBUG;QT_NODLL;%(PreprocessorDefinitions) - $(SolutionDir)\include;$(QTDIR)\include;$(QTDIR)\include\QtCore;%(AdditionalIncludeDirectories) - AnySuitable - Speed - true - true - MultiThreaded - NoExtensions - false - false - false - false - None - - - Windows - true - true - true - - - true - - - - - - \ No newline at end of file diff --git a/etc/Prerequisites/keccak/QKeccakHash_VS2013.vcxproj.filters b/etc/Prerequisites/keccak/QKeccakHash_VS2013.vcxproj.filters deleted file mode 100644 index 7ee57688..00000000 --- a/etc/Prerequisites/keccak/QKeccakHash_VS2013.vcxproj.filters +++ /dev/null @@ -1,30 +0,0 @@ - - - - - {4FC737F1-C7A5-4376-A066-2A32D752A2FF} - cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx - - - {93995380-89BD-4b04-88EB-625FBE52EBFB} - h;hpp;hxx;hm;inl;inc;xsd - - - {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} - rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms - - - - - Source Files - - - Source Files - - - - - Header Files - - - \ No newline at end of file diff --git a/etc/Prerequisites/keccak/include/QKeccakHash b/etc/Prerequisites/keccak/include/QKeccakHash deleted file mode 100644 index 81780c2c..00000000 --- a/etc/Prerequisites/keccak/include/QKeccakHash +++ /dev/null @@ -1 +0,0 @@ -#include "../src/qkeccakhash.h" diff --git a/etc/Prerequisites/keccak/lib/Debug/QKeccakHash_VS2010.lib b/etc/Prerequisites/keccak/lib/Debug/QKeccakHash_VS2010.lib deleted file mode 100644 index 1ef99252..00000000 Binary files a/etc/Prerequisites/keccak/lib/Debug/QKeccakHash_VS2010.lib and /dev/null differ diff --git a/etc/Prerequisites/keccak/lib/Debug/QKeccakHash_VS2012.lib b/etc/Prerequisites/keccak/lib/Debug/QKeccakHash_VS2012.lib deleted file mode 100644 index 45884268..00000000 Binary files a/etc/Prerequisites/keccak/lib/Debug/QKeccakHash_VS2012.lib and /dev/null differ diff --git a/etc/Prerequisites/keccak/lib/Debug/QKeccakHash_VS2013.lib b/etc/Prerequisites/keccak/lib/Debug/QKeccakHash_VS2013.lib deleted file mode 100644 index 9291fbd0..00000000 Binary files a/etc/Prerequisites/keccak/lib/Debug/QKeccakHash_VS2013.lib and /dev/null differ diff --git a/etc/Prerequisites/keccak/lib/Release/QKeccakHash_VS2010.lib b/etc/Prerequisites/keccak/lib/Release/QKeccakHash_VS2010.lib deleted file mode 100644 index ad106980..00000000 Binary files a/etc/Prerequisites/keccak/lib/Release/QKeccakHash_VS2010.lib and /dev/null differ diff --git a/etc/Prerequisites/keccak/lib/Release/QKeccakHash_VS2012.lib b/etc/Prerequisites/keccak/lib/Release/QKeccakHash_VS2012.lib deleted file mode 100644 index 120bfe36..00000000 Binary files a/etc/Prerequisites/keccak/lib/Release/QKeccakHash_VS2012.lib and /dev/null differ diff --git a/etc/Prerequisites/keccak/lib/Release/QKeccakHash_VS2013.lib b/etc/Prerequisites/keccak/lib/Release/QKeccakHash_VS2013.lib deleted file mode 100644 index 587d31c2..00000000 Binary files a/etc/Prerequisites/keccak/lib/Release/QKeccakHash_VS2013.lib and /dev/null differ diff --git a/etc/Prerequisites/keccak/lib/Release_Static/QKeccakHash_VS2010.lib b/etc/Prerequisites/keccak/lib/Release_Static/QKeccakHash_VS2010.lib deleted file mode 100644 index f8ae37b0..00000000 Binary files a/etc/Prerequisites/keccak/lib/Release_Static/QKeccakHash_VS2010.lib and /dev/null differ diff --git a/etc/Prerequisites/keccak/lib/Release_Static/QKeccakHash_VS2012.lib b/etc/Prerequisites/keccak/lib/Release_Static/QKeccakHash_VS2012.lib deleted file mode 100644 index 049227ff..00000000 Binary files a/etc/Prerequisites/keccak/lib/Release_Static/QKeccakHash_VS2012.lib and /dev/null differ diff --git a/etc/Prerequisites/keccak/lib/Release_Static/QKeccakHash_VS2013.lib b/etc/Prerequisites/keccak/lib/Release_Static/QKeccakHash_VS2013.lib deleted file mode 100644 index 9af32bb6..00000000 Binary files a/etc/Prerequisites/keccak/lib/Release_Static/QKeccakHash_VS2013.lib and /dev/null differ diff --git a/etc/Prerequisites/keccak/src/keccakimpl.cpp b/etc/Prerequisites/keccak/src/keccakimpl.cpp deleted file mode 100644 index 3ced5a0b..00000000 --- a/etc/Prerequisites/keccak/src/keccakimpl.cpp +++ /dev/null @@ -1,1999 +0,0 @@ -/*************************************************************************** -** ** -** Keccak (http://keccak.noekeon.org/) implementation file ** -** ** -** This file implements the Keccak hash algorithm as provided by the ** -** inventors, and submitted to the third round of the NIST SHA-3 ** -** competition. ** -** For the QKeccakHash wrapper, the originally multiple files were ** -** combined in this one. Slight modifications have been made to ** -** allow use in C++ as an independently included .cpp file. ** -** It is not meant to be compiled into an object, hence, there is no ** -** header. ** -** ** -** The code here is not part of the actual QKeccakHash implementation ** -** and thus not licensed under the GPLv3 but under its respecitve ** -** license given by the inventors. Typically, this means it is in the ** -** public domain, if not noted otherwise. ** -** ** -***************************************************************************/ - -namespace KeccakImpl { - -typedef unsigned char UINT8; -typedef unsigned short UINT16; -typedef unsigned int UINT32; -typedef unsigned long long int UINT64; - -// ================================================================================ -// =================== brg_endian.h -// ================================================================================ - - -/* - --------------------------------------------------------------------------- - Copyright (c) 1998-2008, Brian Gladman, Worcester, UK. All rights reserved. - - LICENSE TERMS - - The redistribution and use of this software (with or without changes) - is allowed without the payment of fees or royalties provided that: - - 1. source code distributions include the above copyright notice, this - list of conditions and the following disclaimer; - - 2. binary distributions include the above copyright notice, this list - of conditions and the following disclaimer in their documentation; - - 3. the name of the copyright holder is not used to endorse products - built using this software without specific written permission. - - DISCLAIMER - - This software is provided 'as is' with no explicit or implied warranties - in respect of its properties, including, but not limited to, correctness - and/or fitness for purpose. - --------------------------------------------------------------------------- - Issue Date: 20/12/2007 - Changes for ARM 9/9/2010 -*/ - -#ifndef _BRG_ENDIAN_H -#define _BRG_ENDIAN_H - -#define IS_BIG_ENDIAN 4321 /* byte 0 is most significant (mc68k) */ -#define IS_LITTLE_ENDIAN 1234 /* byte 0 is least significant (i386) */ - -#if 0 -/* Include files where endian defines and byteswap functions may reside */ -#if defined( __sun ) -# include -#elif defined( __FreeBSD__ ) || defined( __OpenBSD__ ) || defined( __NetBSD__ ) -# include -#elif defined( BSD ) && ( BSD >= 199103 ) || defined( __APPLE__ ) || \ - defined( __CYGWIN32__ ) || defined( __DJGPP__ ) || defined( __osf__ ) -# include -#elif defined( __linux__ ) || defined( __GNUC__ ) || defined( __GNU_LIBRARY__ ) -# if !defined( __MINGW32__ ) && !defined( _AIX ) -# include -# if !defined( __BEOS__ ) -# include -# endif -# endif -#endif -#endif - -/* Now attempt to set the define for platform byte order using any */ -/* of the four forms SYMBOL, _SYMBOL, __SYMBOL & __SYMBOL__, which */ -/* seem to encompass most endian symbol definitions */ - -#if defined( BIG_ENDIAN ) && defined( LITTLE_ENDIAN ) -# if defined( BYTE_ORDER ) && BYTE_ORDER == BIG_ENDIAN -# define PLATFORM_BYTE_ORDER IS_BIG_ENDIAN -# elif defined( BYTE_ORDER ) && BYTE_ORDER == LITTLE_ENDIAN -# define PLATFORM_BYTE_ORDER IS_LITTLE_ENDIAN -# endif -#elif defined( BIG_ENDIAN ) -# define PLATFORM_BYTE_ORDER IS_BIG_ENDIAN -#elif defined( LITTLE_ENDIAN ) -# define PLATFORM_BYTE_ORDER IS_LITTLE_ENDIAN -#endif - -#if defined( _BIG_ENDIAN ) && defined( _LITTLE_ENDIAN ) -# if defined( _BYTE_ORDER ) && _BYTE_ORDER == _BIG_ENDIAN -# define PLATFORM_BYTE_ORDER IS_BIG_ENDIAN -# elif defined( _BYTE_ORDER ) && _BYTE_ORDER == _LITTLE_ENDIAN -# define PLATFORM_BYTE_ORDER IS_LITTLE_ENDIAN -# endif -#elif defined( _BIG_ENDIAN ) -# define PLATFORM_BYTE_ORDER IS_BIG_ENDIAN -#elif defined( _LITTLE_ENDIAN ) -# define PLATFORM_BYTE_ORDER IS_LITTLE_ENDIAN -#endif - -#if defined( __BIG_ENDIAN ) && defined( __LITTLE_ENDIAN ) -# if defined( __BYTE_ORDER ) && __BYTE_ORDER == __BIG_ENDIAN -# define PLATFORM_BYTE_ORDER IS_BIG_ENDIAN -# elif defined( __BYTE_ORDER ) && __BYTE_ORDER == __LITTLE_ENDIAN -# define PLATFORM_BYTE_ORDER IS_LITTLE_ENDIAN -# endif -#elif defined( __BIG_ENDIAN ) -# define PLATFORM_BYTE_ORDER IS_BIG_ENDIAN -#elif defined( __LITTLE_ENDIAN ) -# define PLATFORM_BYTE_ORDER IS_LITTLE_ENDIAN -#endif - -#if defined( __BIG_ENDIAN__ ) && defined( __LITTLE_ENDIAN__ ) -# if defined( __BYTE_ORDER__ ) && __BYTE_ORDER__ == __BIG_ENDIAN__ -# define PLATFORM_BYTE_ORDER IS_BIG_ENDIAN -# elif defined( __BYTE_ORDER__ ) && __BYTE_ORDER__ == __LITTLE_ENDIAN__ -# define PLATFORM_BYTE_ORDER IS_LITTLE_ENDIAN -# endif -#elif defined( __BIG_ENDIAN__ ) -# define PLATFORM_BYTE_ORDER IS_BIG_ENDIAN -#elif defined( __LITTLE_ENDIAN__ ) -# define PLATFORM_BYTE_ORDER IS_LITTLE_ENDIAN -#endif - -/* if the platform byte order could not be determined, then try to */ -/* set this define using common machine defines */ -#if !defined(PLATFORM_BYTE_ORDER) - -#if defined( __alpha__ ) || defined( __alpha ) || defined( i386 ) || \ - defined( __i386__ ) || defined( _M_I86 ) || defined( _M_IX86 ) || \ - defined( __OS2__ ) || defined( sun386 ) || defined( __TURBOC__ ) || \ - defined( vax ) || defined( vms ) || defined( VMS ) || \ - defined( __VMS ) || defined( _M_X64 ) -# define PLATFORM_BYTE_ORDER IS_LITTLE_ENDIAN - -#elif defined( AMIGA ) || defined( applec ) || defined( __AS400__ ) || \ - defined( _CRAY ) || defined( __hppa ) || defined( __hp9000 ) || \ - defined( ibm370 ) || defined( mc68000 ) || defined( m68k ) || \ - defined( __MRC__ ) || defined( __MVS__ ) || defined( __MWERKS__ ) || \ - defined( sparc ) || defined( __sparc) || defined( SYMANTEC_C ) || \ - defined( __VOS__ ) || defined( __TIGCC__ ) || defined( __TANDEM ) || \ - defined( THINK_C ) || defined( __VMCMS__ ) || defined( _AIX ) -# define PLATFORM_BYTE_ORDER IS_BIG_ENDIAN - -#elif defined(__arm__) -# ifdef __BIG_ENDIAN -# define PLATFORM_BYTE_ORDER IS_BIG_ENDIAN -# else -# define PLATFORM_BYTE_ORDER IS_LITTLE_ENDIAN -# endif -#elif 1 /* **** EDIT HERE IF NECESSARY **** */ -# define PLATFORM_BYTE_ORDER IS_LITTLE_ENDIAN -#elif 0 /* **** EDIT HERE IF NECESSARY **** */ -# define PLATFORM_BYTE_ORDER IS_BIG_ENDIAN -#else -# error Please edit lines 132 or 134 in brg_endian.h to set the platform byte order -#endif - -#endif - -#endif - -// ================================================================================ -// =================== KeccakSponge.h -// ================================================================================ - -/* -The Keccak sponge function, designed by Guido Bertoni, Joan Daemen, -Michaël Peeters and Gilles Van Assche. For more information, feedback or -questions, please refer to our website: http://keccak.noekeon.org/ - -Implementation by the designers, -hereby denoted as "the implementer". - -To the extent possible under law, the implementer has waived all copyright -and related or neighboring rights to the source code in this file. -http://creativecommons.org/publicdomain/zero/1.0/ -*/ - -#ifndef _KeccakSponge_h_ -#define _KeccakSponge_h_ - -/** - * Function to initialize the state of the Keccak[r, c] sponge function. - * The sponge function is set to the absorbing phase. - * @param state Pointer to the state of the sponge function to be initialized. - * @param rate The value of the rate r. - * @param capacity The value of the capacity c. - * @pre One must have r+c=1600 and the rate a multiple of 64 bits in this implementation. - * @return Zero if successful, 1 otherwise. - */ -int InitSponge(spongeState *state, unsigned int rate, unsigned int capacity); -/** - * Function to give input data for the sponge function to absorb. - * @param state Pointer to the state of the sponge function initialized by InitSponge(). - * @param data Pointer to the input data. - * When @a databitLen is not a multiple of 8, the last bits of data must be - * in the least significant bits of the last byte. - * @param databitLen The number of input bits provided in the input data. - * @pre In the previous call to Absorb(), databitLen was a multiple of 8. - * @pre The sponge function must be in the absorbing phase, - * i.e., Squeeze() must not have been called before. - * @return Zero if successful, 1 otherwise. - */ -int Absorb(spongeState *state, const unsigned char *data, unsigned long long databitlen); -/** - * Function to squeeze output data from the sponge function. - * If the sponge function was in the absorbing phase, this function - * switches it to the squeezing phase. - * @param state Pointer to the state of the sponge function initialized by InitSponge(). - * @param output Pointer to the buffer where to store the output data. - * @param outputLength The number of output bits desired. - * It must be a multiple of 8. - * @return Zero if successful, 1 otherwise. - */ -int Squeeze(spongeState *state, unsigned char *output, unsigned long long outputLength); - -#endif - -// ================================================================================ -// =================== KeccakF-1600-int-set.h -// ================================================================================ - - -#define ProvideFast576 -#define ProvideFast832 -#define ProvideFast1024 -#define ProvideFast1088 -#define ProvideFast1152 -#define ProvideFast1344 - - -// ================================================================================ -// =================== KeccakF-1600-interface.h -// ================================================================================ - - -/* -The Keccak sponge function, designed by Guido Bertoni, Joan Daemen, -Michaël Peeters and Gilles Van Assche. For more information, feedback or -questions, please refer to our website: http://keccak.noekeon.org/ - -Implementation by the designers, -hereby denoted as "the implementer". - -To the extent possible under law, the implementer has waived all copyright -and related or neighboring rights to the source code in this file. -http://creativecommons.org/publicdomain/zero/1.0/ -*/ - -#ifndef _KeccakPermutationInterface_h_ -#define _KeccakPermutationInterface_h_ - -//#include "KeccakF-1600-int-set.h" - -void KeccakInitialize( void ); -void KeccakInitializeState(unsigned char *state); -void KeccakPermutation(unsigned char *state); -#ifdef ProvideFast576 -void KeccakAbsorb576bits(unsigned char *state, const unsigned char *data); -#endif -#ifdef ProvideFast832 -void KeccakAbsorb832bits(unsigned char *state, const unsigned char *data); -#endif -#ifdef ProvideFast1024 -void KeccakAbsorb1024bits(unsigned char *state, const unsigned char *data); -#endif -#ifdef ProvideFast1088 -void KeccakAbsorb1088bits(unsigned char *state, const unsigned char *data); -#endif -#ifdef ProvideFast1152 -void KeccakAbsorb1152bits(unsigned char *state, const unsigned char *data); -#endif -#ifdef ProvideFast1344 -void KeccakAbsorb1344bits(unsigned char *state, const unsigned char *data); -#endif -void KeccakAbsorb(unsigned char *state, const unsigned char *data, unsigned int laneCount); -#ifdef ProvideFast1024 -void KeccakExtract1024bits(const unsigned char *state, unsigned char *data); -#endif -void KeccakExtract(const unsigned char *state, unsigned char *data, unsigned int laneCount); - -#endif - - -// ================================================================================ -// =================== KeccakF-1600-opt32-settings.h -// ================================================================================ - - -#define Unrolling 2 -//#define UseBebigokimisa -//#define UseInterleaveTables -#define UseSchedule 3 - - -// ================================================================================ -// =================== KeccakF-1600-unrolling.macros -// ================================================================================ - -/* -The Keccak sponge function, designed by Guido Bertoni, Joan Daemen, -Michaël Peeters and Gilles Van Assche. For more information, feedback or -questions, please refer to our website: http://keccak.noekeon.org/ - -Implementation by the designers, -hereby denoted as "the implementer". - -To the extent possible under law, the implementer has waived all copyright -and related or neighboring rights to the source code in this file. -http://creativecommons.org/publicdomain/zero/1.0/ -*/ - -#if (Unrolling == 24) -#define rounds \ - prepareTheta \ - thetaRhoPiChiIotaPrepareTheta( 0, A, E) \ - thetaRhoPiChiIotaPrepareTheta( 1, E, A) \ - thetaRhoPiChiIotaPrepareTheta( 2, A, E) \ - thetaRhoPiChiIotaPrepareTheta( 3, E, A) \ - thetaRhoPiChiIotaPrepareTheta( 4, A, E) \ - thetaRhoPiChiIotaPrepareTheta( 5, E, A) \ - thetaRhoPiChiIotaPrepareTheta( 6, A, E) \ - thetaRhoPiChiIotaPrepareTheta( 7, E, A) \ - thetaRhoPiChiIotaPrepareTheta( 8, A, E) \ - thetaRhoPiChiIotaPrepareTheta( 9, E, A) \ - thetaRhoPiChiIotaPrepareTheta(10, A, E) \ - thetaRhoPiChiIotaPrepareTheta(11, E, A) \ - thetaRhoPiChiIotaPrepareTheta(12, A, E) \ - thetaRhoPiChiIotaPrepareTheta(13, E, A) \ - thetaRhoPiChiIotaPrepareTheta(14, A, E) \ - thetaRhoPiChiIotaPrepareTheta(15, E, A) \ - thetaRhoPiChiIotaPrepareTheta(16, A, E) \ - thetaRhoPiChiIotaPrepareTheta(17, E, A) \ - thetaRhoPiChiIotaPrepareTheta(18, A, E) \ - thetaRhoPiChiIotaPrepareTheta(19, E, A) \ - thetaRhoPiChiIotaPrepareTheta(20, A, E) \ - thetaRhoPiChiIotaPrepareTheta(21, E, A) \ - thetaRhoPiChiIotaPrepareTheta(22, A, E) \ - thetaRhoPiChiIota(23, E, A) \ - copyToState(state, A) -#elif (Unrolling == 12) -#define rounds \ - prepareTheta \ - for(i=0; i<24; i+=12) { \ - thetaRhoPiChiIotaPrepareTheta(i , A, E) \ - thetaRhoPiChiIotaPrepareTheta(i+ 1, E, A) \ - thetaRhoPiChiIotaPrepareTheta(i+ 2, A, E) \ - thetaRhoPiChiIotaPrepareTheta(i+ 3, E, A) \ - thetaRhoPiChiIotaPrepareTheta(i+ 4, A, E) \ - thetaRhoPiChiIotaPrepareTheta(i+ 5, E, A) \ - thetaRhoPiChiIotaPrepareTheta(i+ 6, A, E) \ - thetaRhoPiChiIotaPrepareTheta(i+ 7, E, A) \ - thetaRhoPiChiIotaPrepareTheta(i+ 8, A, E) \ - thetaRhoPiChiIotaPrepareTheta(i+ 9, E, A) \ - thetaRhoPiChiIotaPrepareTheta(i+10, A, E) \ - thetaRhoPiChiIotaPrepareTheta(i+11, E, A) \ - } \ - copyToState(state, A) -#elif (Unrolling == 8) -#define rounds \ - prepareTheta \ - for(i=0; i<24; i+=8) { \ - thetaRhoPiChiIotaPrepareTheta(i , A, E) \ - thetaRhoPiChiIotaPrepareTheta(i+1, E, A) \ - thetaRhoPiChiIotaPrepareTheta(i+2, A, E) \ - thetaRhoPiChiIotaPrepareTheta(i+3, E, A) \ - thetaRhoPiChiIotaPrepareTheta(i+4, A, E) \ - thetaRhoPiChiIotaPrepareTheta(i+5, E, A) \ - thetaRhoPiChiIotaPrepareTheta(i+6, A, E) \ - thetaRhoPiChiIotaPrepareTheta(i+7, E, A) \ - } \ - copyToState(state, A) -#elif (Unrolling == 6) -#define rounds \ - prepareTheta \ - for(i=0; i<24; i+=6) { \ - thetaRhoPiChiIotaPrepareTheta(i , A, E) \ - thetaRhoPiChiIotaPrepareTheta(i+1, E, A) \ - thetaRhoPiChiIotaPrepareTheta(i+2, A, E) \ - thetaRhoPiChiIotaPrepareTheta(i+3, E, A) \ - thetaRhoPiChiIotaPrepareTheta(i+4, A, E) \ - thetaRhoPiChiIotaPrepareTheta(i+5, E, A) \ - } \ - copyToState(state, A) -#elif (Unrolling == 4) -#define rounds \ - prepareTheta \ - for(i=0; i<24; i+=4) { \ - thetaRhoPiChiIotaPrepareTheta(i , A, E) \ - thetaRhoPiChiIotaPrepareTheta(i+1, E, A) \ - thetaRhoPiChiIotaPrepareTheta(i+2, A, E) \ - thetaRhoPiChiIotaPrepareTheta(i+3, E, A) \ - } \ - copyToState(state, A) -#elif (Unrolling == 3) -#define rounds \ - prepareTheta \ - for(i=0; i<24; i+=3) { \ - thetaRhoPiChiIotaPrepareTheta(i , A, E) \ - thetaRhoPiChiIotaPrepareTheta(i+1, E, A) \ - thetaRhoPiChiIotaPrepareTheta(i+2, A, E) \ - copyStateVariables(A, E) \ - } \ - copyToState(state, A) -#elif (Unrolling == 2) -#define rounds \ - prepareTheta \ - for(i=0; i<24; i+=2) { \ - thetaRhoPiChiIotaPrepareTheta(i , A, E) \ - thetaRhoPiChiIotaPrepareTheta(i+1, E, A) \ - } \ - copyToState(state, A) -#elif (Unrolling == 1) -#define rounds \ - prepareTheta \ - for(i=0; i<24; i++) { \ - thetaRhoPiChiIotaPrepareTheta(i , A, E) \ - copyStateVariables(A, E) \ - } \ - copyToState(state, A) -#else -#error "Unrolling is not correctly specified!" -#endif - - -// ================================================================================ -// =================== KeccakF-1600-32-rvk.macros -// ================================================================================ - -/* -The Keccak sponge function, designed by Guido Bertoni, Joan Daemen, -Michaël Peeters and Gilles Van Assche. For more information, feedback or -questions, please refer to our website: http://keccak.noekeon.org/ - -Implementation by Ronny Van Keer, -hereby denoted as "the implementer". - -To the extent possible under law, the implementer has waived all copyright -and related or neighboring rights to the source code in this file. -http://creativecommons.org/publicdomain/zero/1.0/ -*/ - -static const UINT32 KeccakF1600RoundConstants_int2[2*24] = -{ - 0x00000001UL, 0x00000000UL, - 0x00000000UL, 0x00000089UL, - 0x00000000UL, 0x8000008bUL, - 0x00000000UL, 0x80008080UL, - 0x00000001UL, 0x0000008bUL, - 0x00000001UL, 0x00008000UL, - 0x00000001UL, 0x80008088UL, - 0x00000001UL, 0x80000082UL, - 0x00000000UL, 0x0000000bUL, - 0x00000000UL, 0x0000000aUL, - 0x00000001UL, 0x00008082UL, - 0x00000000UL, 0x00008003UL, - 0x00000001UL, 0x0000808bUL, - 0x00000001UL, 0x8000000bUL, - 0x00000001UL, 0x8000008aUL, - 0x00000001UL, 0x80000081UL, - 0x00000000UL, 0x80000081UL, - 0x00000000UL, 0x80000008UL, - 0x00000000UL, 0x00000083UL, - 0x00000000UL, 0x80008003UL, - 0x00000001UL, 0x80008088UL, - 0x00000000UL, 0x80000088UL, - 0x00000001UL, 0x00008000UL, - 0x00000000UL, 0x80008082UL -}; - -#undef rounds - -#define rounds \ -{ \ - UINT32 Da0, De0, Di0, Do0, Du0; \ - UINT32 Da1, De1, Di1, Do1, Du1; \ - UINT32 Ba, Be, Bi, Bo, Bu; \ - UINT32 Aba0, Abe0, Abi0, Abo0, Abu0; \ - UINT32 Aba1, Abe1, Abi1, Abo1, Abu1; \ - UINT32 Aga0, Age0, Agi0, Ago0, Agu0; \ - UINT32 Aga1, Age1, Agi1, Ago1, Agu1; \ - UINT32 Aka0, Ake0, Aki0, Ako0, Aku0; \ - UINT32 Aka1, Ake1, Aki1, Ako1, Aku1; \ - UINT32 Ama0, Ame0, Ami0, Amo0, Amu0; \ - UINT32 Ama1, Ame1, Ami1, Amo1, Amu1; \ - UINT32 Asa0, Ase0, Asi0, Aso0, Asu0; \ - UINT32 Asa1, Ase1, Asi1, Aso1, Asu1; \ - UINT32 Cw, Cx, Cy, Cz; \ - UINT32 Eba0, Ebe0, Ebi0, Ebo0, Ebu0; \ - UINT32 Eba1, Ebe1, Ebi1, Ebo1, Ebu1; \ - UINT32 Ega0, Ege0, Egi0, Ego0, Egu0; \ - UINT32 Ega1, Ege1, Egi1, Ego1, Egu1; \ - UINT32 Eka0, Eke0, Eki0, Eko0, Eku0; \ - UINT32 Eka1, Eke1, Eki1, Eko1, Eku1; \ - UINT32 Ema0, Eme0, Emi0, Emo0, Emu0; \ - UINT32 Ema1, Eme1, Emi1, Emo1, Emu1; \ - UINT32 Esa0, Ese0, Esi0, Eso0, Esu0; \ - UINT32 Esa1, Ese1, Esi1, Eso1, Esu1; \ - const UINT32 * pRoundConstants = KeccakF1600RoundConstants_int2; \ - UINT32 i; \ -\ - copyFromState(A, state) \ -\ - for( i = 12; i != 0; --i ) { \ - Cx = Abu0^Agu0^Aku0^Amu0^Asu0; \ - Du1 = Abe1^Age1^Ake1^Ame1^Ase1; \ - Da0 = Cx^ROL32(Du1, 1); \ - Cz = Abu1^Agu1^Aku1^Amu1^Asu1; \ - Du0 = Abe0^Age0^Ake0^Ame0^Ase0; \ - Da1 = Cz^Du0; \ -\ - Cw = Abi0^Agi0^Aki0^Ami0^Asi0; \ - Do0 = Cw^ROL32(Cz, 1); \ - Cy = Abi1^Agi1^Aki1^Ami1^Asi1; \ - Do1 = Cy^Cx; \ -\ - Cx = Aba0^Aga0^Aka0^Ama0^Asa0; \ - De0 = Cx^ROL32(Cy, 1); \ - Cz = Aba1^Aga1^Aka1^Ama1^Asa1; \ - De1 = Cz^Cw; \ -\ - Cy = Abo1^Ago1^Ako1^Amo1^Aso1; \ - Di0 = Du0^ROL32(Cy, 1); \ - Cw = Abo0^Ago0^Ako0^Amo0^Aso0; \ - Di1 = Du1^Cw; \ -\ - Du0 = Cw^ROL32(Cz, 1); \ - Du1 = Cy^Cx; \ -\ - Aba0 ^= Da0; \ - Ba = Aba0; \ - Age0 ^= De0; \ - Be = ROL32(Age0, 22); \ - Aki1 ^= Di1; \ - Bi = ROL32(Aki1, 22); \ - Amo1 ^= Do1; \ - Bo = ROL32(Amo1, 11); \ - Asu0 ^= Du0; \ - Bu = ROL32(Asu0, 7); \ - Eba0 = Ba ^((~Be)& Bi ) ^ *(pRoundConstants++); \ - Ebe0 = Be ^((~Bi)& Bo ); \ - Ebi0 = Bi ^((~Bo)& Bu ); \ - Ebo0 = Bo ^((~Bu)& Ba ); \ - Ebu0 = Bu ^((~Ba)& Be ); \ -\ - Abo0 ^= Do0; \ - Ba = ROL32(Abo0, 14); \ - Agu0 ^= Du0; \ - Be = ROL32(Agu0, 10); \ - Aka1 ^= Da1; \ - Bi = ROL32(Aka1, 2); \ - Ame1 ^= De1; \ - Bo = ROL32(Ame1, 23); \ - Asi1 ^= Di1; \ - Bu = ROL32(Asi1, 31); \ - Ega0 = Ba ^((~Be)& Bi ); \ - Ege0 = Be ^((~Bi)& Bo ); \ - Egi0 = Bi ^((~Bo)& Bu ); \ - Ego0 = Bo ^((~Bu)& Ba ); \ - Egu0 = Bu ^((~Ba)& Be ); \ -\ - Abe1 ^= De1; \ - Ba = ROL32(Abe1, 1); \ - Agi0 ^= Di0; \ - Be = ROL32(Agi0, 3); \ - Ako1 ^= Do1; \ - Bi = ROL32(Ako1, 13); \ - Amu0 ^= Du0; \ - Bo = ROL32(Amu0, 4); \ - Asa0 ^= Da0; \ - Bu = ROL32(Asa0, 9); \ - Eka0 = Ba ^((~Be)& Bi ); \ - Eke0 = Be ^((~Bi)& Bo ); \ - Eki0 = Bi ^((~Bo)& Bu ); \ - Eko0 = Bo ^((~Bu)& Ba ); \ - Eku0 = Bu ^((~Ba)& Be ); \ -\ - Abu1 ^= Du1; \ - Ba = ROL32(Abu1, 14); \ - Aga0 ^= Da0; \ - Be = ROL32(Aga0, 18); \ - Ake0 ^= De0; \ - Bi = ROL32(Ake0, 5); \ - Ami1 ^= Di1; \ - Bo = ROL32(Ami1, 8); \ - Aso0 ^= Do0; \ - Bu = ROL32(Aso0, 28); \ - Ema0 = Ba ^((~Be)& Bi ); \ - Eme0 = Be ^((~Bi)& Bo ); \ - Emi0 = Bi ^((~Bo)& Bu ); \ - Emo0 = Bo ^((~Bu)& Ba ); \ - Emu0 = Bu ^((~Ba)& Be ); \ -\ - Abi0 ^= Di0; \ - Ba = ROL32(Abi0, 31); \ - Ago1 ^= Do1; \ - Be = ROL32(Ago1, 28); \ - Aku1 ^= Du1; \ - Bi = ROL32(Aku1, 20); \ - Ama1 ^= Da1; \ - Bo = ROL32(Ama1, 21); \ - Ase0 ^= De0; \ - Bu = ROL32(Ase0, 1); \ - Esa0 = Ba ^((~Be)& Bi ); \ - Ese0 = Be ^((~Bi)& Bo ); \ - Esi0 = Bi ^((~Bo)& Bu ); \ - Eso0 = Bo ^((~Bu)& Ba ); \ - Esu0 = Bu ^((~Ba)& Be ); \ -\ - Aba1 ^= Da1; \ - Ba = Aba1; \ - Age1 ^= De1; \ - Be = ROL32(Age1, 22); \ - Aki0 ^= Di0; \ - Bi = ROL32(Aki0, 21); \ - Amo0 ^= Do0; \ - Bo = ROL32(Amo0, 10); \ - Asu1 ^= Du1; \ - Bu = ROL32(Asu1, 7); \ - Eba1 = Ba ^((~Be)& Bi ); \ - Eba1 ^= *(pRoundConstants++); \ - Ebe1 = Be ^((~Bi)& Bo ); \ - Ebi1 = Bi ^((~Bo)& Bu ); \ - Ebo1 = Bo ^((~Bu)& Ba ); \ - Ebu1 = Bu ^((~Ba)& Be ); \ -\ - Abo1 ^= Do1; \ - Ba = ROL32(Abo1, 14); \ - Agu1 ^= Du1; \ - Be = ROL32(Agu1, 10); \ - Aka0 ^= Da0; \ - Bi = ROL32(Aka0, 1); \ - Ame0 ^= De0; \ - Bo = ROL32(Ame0, 22); \ - Asi0 ^= Di0; \ - Bu = ROL32(Asi0, 30); \ - Ega1 = Ba ^((~Be)& Bi ); \ - Ege1 = Be ^((~Bi)& Bo ); \ - Egi1 = Bi ^((~Bo)& Bu ); \ - Ego1 = Bo ^((~Bu)& Ba ); \ - Egu1 = Bu ^((~Ba)& Be ); \ -\ - Abe0 ^= De0; \ - Ba = Abe0; \ - Agi1 ^= Di1; \ - Be = ROL32(Agi1, 3); \ - Ako0 ^= Do0; \ - Bi = ROL32(Ako0, 12); \ - Amu1 ^= Du1; \ - Bo = ROL32(Amu1, 4); \ - Asa1 ^= Da1; \ - Bu = ROL32(Asa1, 9); \ - Eka1 = Ba ^((~Be)& Bi ); \ - Eke1 = Be ^((~Bi)& Bo ); \ - Eki1 = Bi ^((~Bo)& Bu ); \ - Eko1 = Bo ^((~Bu)& Ba ); \ - Eku1 = Bu ^((~Ba)& Be ); \ -\ - Abu0 ^= Du0; \ - Ba = ROL32(Abu0, 13); \ - Aga1 ^= Da1; \ - Be = ROL32(Aga1, 18); \ - Ake1 ^= De1; \ - Bi = ROL32(Ake1, 5); \ - Ami0 ^= Di0; \ - Bo = ROL32(Ami0, 7); \ - Aso1 ^= Do1; \ - Bu = ROL32(Aso1, 28); \ - Ema1 = Ba ^((~Be)& Bi ); \ - Eme1 = Be ^((~Bi)& Bo ); \ - Emi1 = Bi ^((~Bo)& Bu ); \ - Emo1 = Bo ^((~Bu)& Ba ); \ - Emu1 = Bu ^((~Ba)& Be ); \ -\ - Abi1 ^= Di1; \ - Ba = ROL32(Abi1, 31); \ - Ago0 ^= Do0; \ - Be = ROL32(Ago0, 27); \ - Aku0 ^= Du0; \ - Bi = ROL32(Aku0, 19); \ - Ama0 ^= Da0; \ - Bo = ROL32(Ama0, 20); \ - Ase1 ^= De1; \ - Bu = ROL32(Ase1, 1); \ - Esa1 = Ba ^((~Be)& Bi ); \ - Ese1 = Be ^((~Bi)& Bo ); \ - Esi1 = Bi ^((~Bo)& Bu ); \ - Eso1 = Bo ^((~Bu)& Ba ); \ - Esu1 = Bu ^((~Ba)& Be ); \ -\ - Cx = Ebu0^Egu0^Eku0^Emu0^Esu0; \ - Du1 = Ebe1^Ege1^Eke1^Eme1^Ese1; \ - Da0 = Cx^ROL32(Du1, 1); \ - Cz = Ebu1^Egu1^Eku1^Emu1^Esu1; \ - Du0 = Ebe0^Ege0^Eke0^Eme0^Ese0; \ - Da1 = Cz^Du0; \ -\ - Cw = Ebi0^Egi0^Eki0^Emi0^Esi0; \ - Do0 = Cw^ROL32(Cz, 1); \ - Cy = Ebi1^Egi1^Eki1^Emi1^Esi1; \ - Do1 = Cy^Cx; \ -\ - Cx = Eba0^Ega0^Eka0^Ema0^Esa0; \ - De0 = Cx^ROL32(Cy, 1); \ - Cz = Eba1^Ega1^Eka1^Ema1^Esa1; \ - De1 = Cz^Cw; \ -\ - Cy = Ebo1^Ego1^Eko1^Emo1^Eso1; \ - Di0 = Du0^ROL32(Cy, 1); \ - Cw = Ebo0^Ego0^Eko0^Emo0^Eso0; \ - Di1 = Du1^Cw; \ -\ - Du0 = Cw^ROL32(Cz, 1); \ - Du1 = Cy^Cx; \ -\ - Eba0 ^= Da0; \ - Ba = Eba0; \ - Ege0 ^= De0; \ - Be = ROL32(Ege0, 22); \ - Eki1 ^= Di1; \ - Bi = ROL32(Eki1, 22); \ - Emo1 ^= Do1; \ - Bo = ROL32(Emo1, 11); \ - Esu0 ^= Du0; \ - Bu = ROL32(Esu0, 7); \ - Aba0 = Ba ^((~Be)& Bi ); \ - Aba0 ^= *(pRoundConstants++); \ - Abe0 = Be ^((~Bi)& Bo ); \ - Abi0 = Bi ^((~Bo)& Bu ); \ - Abo0 = Bo ^((~Bu)& Ba ); \ - Abu0 = Bu ^((~Ba)& Be ); \ -\ - Ebo0 ^= Do0; \ - Ba = ROL32(Ebo0, 14); \ - Egu0 ^= Du0; \ - Be = ROL32(Egu0, 10); \ - Eka1 ^= Da1; \ - Bi = ROL32(Eka1, 2); \ - Eme1 ^= De1; \ - Bo = ROL32(Eme1, 23); \ - Esi1 ^= Di1; \ - Bu = ROL32(Esi1, 31); \ - Aga0 = Ba ^((~Be)& Bi ); \ - Age0 = Be ^((~Bi)& Bo ); \ - Agi0 = Bi ^((~Bo)& Bu ); \ - Ago0 = Bo ^((~Bu)& Ba ); \ - Agu0 = Bu ^((~Ba)& Be ); \ -\ - Ebe1 ^= De1; \ - Ba = ROL32(Ebe1, 1); \ - Egi0 ^= Di0; \ - Be = ROL32(Egi0, 3); \ - Eko1 ^= Do1; \ - Bi = ROL32(Eko1, 13); \ - Emu0 ^= Du0; \ - Bo = ROL32(Emu0, 4); \ - Esa0 ^= Da0; \ - Bu = ROL32(Esa0, 9); \ - Aka0 = Ba ^((~Be)& Bi ); \ - Ake0 = Be ^((~Bi)& Bo ); \ - Aki0 = Bi ^((~Bo)& Bu ); \ - Ako0 = Bo ^((~Bu)& Ba ); \ - Aku0 = Bu ^((~Ba)& Be ); \ -\ - Ebu1 ^= Du1; \ - Ba = ROL32(Ebu1, 14); \ - Ega0 ^= Da0; \ - Be = ROL32(Ega0, 18); \ - Eke0 ^= De0; \ - Bi = ROL32(Eke0, 5); \ - Emi1 ^= Di1; \ - Bo = ROL32(Emi1, 8); \ - Eso0 ^= Do0; \ - Bu = ROL32(Eso0, 28); \ - Ama0 = Ba ^((~Be)& Bi ); \ - Ame0 = Be ^((~Bi)& Bo ); \ - Ami0 = Bi ^((~Bo)& Bu ); \ - Amo0 = Bo ^((~Bu)& Ba ); \ - Amu0 = Bu ^((~Ba)& Be ); \ -\ - Ebi0 ^= Di0; \ - Ba = ROL32(Ebi0, 31); \ - Ego1 ^= Do1; \ - Be = ROL32(Ego1, 28); \ - Eku1 ^= Du1; \ - Bi = ROL32(Eku1, 20); \ - Ema1 ^= Da1; \ - Bo = ROL32(Ema1, 21); \ - Ese0 ^= De0; \ - Bu = ROL32(Ese0, 1); \ - Asa0 = Ba ^((~Be)& Bi ); \ - Ase0 = Be ^((~Bi)& Bo ); \ - Asi0 = Bi ^((~Bo)& Bu ); \ - Aso0 = Bo ^((~Bu)& Ba ); \ - Asu0 = Bu ^((~Ba)& Be ); \ -\ - Eba1 ^= Da1; \ - Ba = Eba1; \ - Ege1 ^= De1; \ - Be = ROL32(Ege1, 22); \ - Eki0 ^= Di0; \ - Bi = ROL32(Eki0, 21); \ - Emo0 ^= Do0; \ - Bo = ROL32(Emo0, 10); \ - Esu1 ^= Du1; \ - Bu = ROL32(Esu1, 7); \ - Aba1 = Ba ^((~Be)& Bi ); \ - Aba1 ^= *(pRoundConstants++); \ - Abe1 = Be ^((~Bi)& Bo ); \ - Abi1 = Bi ^((~Bo)& Bu ); \ - Abo1 = Bo ^((~Bu)& Ba ); \ - Abu1 = Bu ^((~Ba)& Be ); \ -\ - Ebo1 ^= Do1; \ - Ba = ROL32(Ebo1, 14); \ - Egu1 ^= Du1; \ - Be = ROL32(Egu1, 10); \ - Eka0 ^= Da0; \ - Bi = ROL32(Eka0, 1); \ - Eme0 ^= De0; \ - Bo = ROL32(Eme0, 22); \ - Esi0 ^= Di0; \ - Bu = ROL32(Esi0, 30); \ - Aga1 = Ba ^((~Be)& Bi ); \ - Age1 = Be ^((~Bi)& Bo ); \ - Agi1 = Bi ^((~Bo)& Bu ); \ - Ago1 = Bo ^((~Bu)& Ba ); \ - Agu1 = Bu ^((~Ba)& Be ); \ -\ - Ebe0 ^= De0; \ - Ba = Ebe0; \ - Egi1 ^= Di1; \ - Be = ROL32(Egi1, 3); \ - Eko0 ^= Do0; \ - Bi = ROL32(Eko0, 12); \ - Emu1 ^= Du1; \ - Bo = ROL32(Emu1, 4); \ - Esa1 ^= Da1; \ - Bu = ROL32(Esa1, 9); \ - Aka1 = Ba ^((~Be)& Bi ); \ - Ake1 = Be ^((~Bi)& Bo ); \ - Aki1 = Bi ^((~Bo)& Bu ); \ - Ako1 = Bo ^((~Bu)& Ba ); \ - Aku1 = Bu ^((~Ba)& Be ); \ -\ - Ebu0 ^= Du0; \ - Ba = ROL32(Ebu0, 13); \ - Ega1 ^= Da1; \ - Be = ROL32(Ega1, 18); \ - Eke1 ^= De1; \ - Bi = ROL32(Eke1, 5); \ - Emi0 ^= Di0; \ - Bo = ROL32(Emi0, 7); \ - Eso1 ^= Do1; \ - Bu = ROL32(Eso1, 28); \ - Ama1 = Ba ^((~Be)& Bi ); \ - Ame1 = Be ^((~Bi)& Bo ); \ - Ami1 = Bi ^((~Bo)& Bu ); \ - Amo1 = Bo ^((~Bu)& Ba ); \ - Amu1 = Bu ^((~Ba)& Be ); \ -\ - Ebi1 ^= Di1; \ - Ba = ROL32(Ebi1, 31); \ - Ego0 ^= Do0; \ - Be = ROL32(Ego0, 27); \ - Eku0 ^= Du0; \ - Bi = ROL32(Eku0, 19); \ - Ema0 ^= Da0; \ - Bo = ROL32(Ema0, 20); \ - Ese1 ^= De1; \ - Bu = ROL32(Ese1, 1); \ - Asa1 = Ba ^((~Be)& Bi ); \ - Ase1 = Be ^((~Bi)& Bo ); \ - Asi1 = Bi ^((~Bo)& Bu ); \ - Aso1 = Bo ^((~Bu)& Ba ); \ - Asu1 = Bu ^((~Ba)& Be ); \ - } \ - copyToState(state, A) \ -} - -#define copyFromState(X, state) \ - X##ba0 = state[ 0]; \ - X##ba1 = state[ 1]; \ - X##be0 = state[ 2]; \ - X##be1 = state[ 3]; \ - X##bi0 = state[ 4]; \ - X##bi1 = state[ 5]; \ - X##bo0 = state[ 6]; \ - X##bo1 = state[ 7]; \ - X##bu0 = state[ 8]; \ - X##bu1 = state[ 9]; \ - X##ga0 = state[10]; \ - X##ga1 = state[11]; \ - X##ge0 = state[12]; \ - X##ge1 = state[13]; \ - X##gi0 = state[14]; \ - X##gi1 = state[15]; \ - X##go0 = state[16]; \ - X##go1 = state[17]; \ - X##gu0 = state[18]; \ - X##gu1 = state[19]; \ - X##ka0 = state[20]; \ - X##ka1 = state[21]; \ - X##ke0 = state[22]; \ - X##ke1 = state[23]; \ - X##ki0 = state[24]; \ - X##ki1 = state[25]; \ - X##ko0 = state[26]; \ - X##ko1 = state[27]; \ - X##ku0 = state[28]; \ - X##ku1 = state[29]; \ - X##ma0 = state[30]; \ - X##ma1 = state[31]; \ - X##me0 = state[32]; \ - X##me1 = state[33]; \ - X##mi0 = state[34]; \ - X##mi1 = state[35]; \ - X##mo0 = state[36]; \ - X##mo1 = state[37]; \ - X##mu0 = state[38]; \ - X##mu1 = state[39]; \ - X##sa0 = state[40]; \ - X##sa1 = state[41]; \ - X##se0 = state[42]; \ - X##se1 = state[43]; \ - X##si0 = state[44]; \ - X##si1 = state[45]; \ - X##so0 = state[46]; \ - X##so1 = state[47]; \ - X##su0 = state[48]; \ - X##su1 = state[49]; \ - -#define copyToState(state, X) \ - state[ 0] = X##ba0; \ - state[ 1] = X##ba1; \ - state[ 2] = X##be0; \ - state[ 3] = X##be1; \ - state[ 4] = X##bi0; \ - state[ 5] = X##bi1; \ - state[ 6] = X##bo0; \ - state[ 7] = X##bo1; \ - state[ 8] = X##bu0; \ - state[ 9] = X##bu1; \ - state[10] = X##ga0; \ - state[11] = X##ga1; \ - state[12] = X##ge0; \ - state[13] = X##ge1; \ - state[14] = X##gi0; \ - state[15] = X##gi1; \ - state[16] = X##go0; \ - state[17] = X##go1; \ - state[18] = X##gu0; \ - state[19] = X##gu1; \ - state[20] = X##ka0; \ - state[21] = X##ka1; \ - state[22] = X##ke0; \ - state[23] = X##ke1; \ - state[24] = X##ki0; \ - state[25] = X##ki1; \ - state[26] = X##ko0; \ - state[27] = X##ko1; \ - state[28] = X##ku0; \ - state[29] = X##ku1; \ - state[30] = X##ma0; \ - state[31] = X##ma1; \ - state[32] = X##me0; \ - state[33] = X##me1; \ - state[34] = X##mi0; \ - state[35] = X##mi1; \ - state[36] = X##mo0; \ - state[37] = X##mo1; \ - state[38] = X##mu0; \ - state[39] = X##mu1; \ - state[40] = X##sa0; \ - state[41] = X##sa1; \ - state[42] = X##se0; \ - state[43] = X##se1; \ - state[44] = X##si0; \ - state[45] = X##si1; \ - state[46] = X##so0; \ - state[47] = X##so1; \ - state[48] = X##su0; \ - state[49] = X##su1; \ - - -// ================================================================================ -// =================== KeccakF-1600-32.macros -// ================================================================================ - -/* -The Keccak sponge function, designed by Guido Bertoni, Joan Daemen, -Michaël Peeters and Gilles Van Assche. For more information, feedback or -questions, please refer to our website: http://keccak.noekeon.org/ - -Implementation by the designers, -hereby denoted as "the implementer". - -To the extent possible under law, the implementer has waived all copyright -and related or neighboring rights to the source code in this file. -http://creativecommons.org/publicdomain/zero/1.0/ -*/ - -#ifdef UseSchedule - #if (UseSchedule == 1) - #include "KeccakF-1600-32-s1.macros" - #elif (UseSchedule == 2) - #include "KeccakF-1600-32-s2.macros" - #elif (UseSchedule == 3) - //#include "KeccakF-1600-32-rvk.macros" - #else - #error "This schedule is not supported." - #endif -#else - #include "KeccakF-1600-32-s1.macros" -#endif - -// ================================================================================ -// =================== KeccakF-1600-opt32.c -// ================================================================================ - - -/* -The Keccak sponge function, designed by Guido Bertoni, Joan Daemen, -Michaël Peeters and Gilles Van Assche. For more information, feedback or -questions, please refer to our website: http://keccak.noekeon.org/ - -Implementation by the designers, -hereby denoted as "the implementer". - -To the extent possible under law, the implementer has waived all copyright -and related or neighboring rights to the source code in this file. -http://creativecommons.org/publicdomain/zero/1.0/ -*/ - -#include -//#include "brg_endian.h" -//#include "KeccakF-1600-opt32-settings.h" -//#include "KeccakF-1600-interface.h" - - - -#ifdef UseInterleaveTables -int interleaveTablesBuilt = 0; -UINT16 interleaveTable[65536]; -UINT16 deinterleaveTable[65536]; - -void buildInterleaveTables() -{ - UINT32 i, j; - UINT16 x; - - if (!interleaveTablesBuilt) { - for(i=0; i<65536; i++) { - x = 0; - for(j=0; j<16; j++) { - if (i & (1 << j)) - x |= (1 << (j/2 + 8*(j%2))); - } - interleaveTable[i] = x; - deinterleaveTable[x] = (UINT16)i; - } - interleaveTablesBuilt = 1; - } -} - -#if (PLATFORM_BYTE_ORDER == IS_LITTLE_ENDIAN) - -#define xor2bytesIntoInterleavedWords(even, odd, source, j) \ - i##j = interleaveTable[((const UINT16*)source)[j]]; \ - ((UINT8*)even)[j] ^= i##j & 0xFF; \ - ((UINT8*)odd)[j] ^= i##j >> 8; - -#define setInterleavedWordsInto2bytes(dest, even, odd, j) \ - d##j = deinterleaveTable[((even >> (j*8)) & 0xFF) ^ (((odd >> (j*8)) & 0xFF) << 8)]; \ - ((UINT16*)dest)[j] = d##j; - -#else // (PLATFORM_BYTE_ORDER == IS_BIG_ENDIAN) - -#define xor2bytesIntoInterleavedWords(even, odd, source, j) \ - i##j = interleaveTable[source[2*j] ^ ((UINT16)source[2*j+1] << 8)]; \ - *even ^= (i##j & 0xFF) << (j*8); \ - *odd ^= ((i##j >> 8) & 0xFF) << (j*8); - -#define setInterleavedWordsInto2bytes(dest, even, odd, j) \ - d##j = deinterleaveTable[((even >> (j*8)) & 0xFF) ^ (((odd >> (j*8)) & 0xFF) << 8)]; \ - dest[2*j] = d##j & 0xFF; \ - dest[2*j+1] = d##j >> 8; - -#endif // Endianness - -void xor8bytesIntoInterleavedWords(UINT32 *even, UINT32 *odd, const UINT8* source) -{ - UINT16 i0, i1, i2, i3; - - xor2bytesIntoInterleavedWords(even, odd, source, 0) - xor2bytesIntoInterleavedWords(even, odd, source, 1) - xor2bytesIntoInterleavedWords(even, odd, source, 2) - xor2bytesIntoInterleavedWords(even, odd, source, 3) -} - -#define xorLanesIntoState(laneCount, state, input) \ - { \ - int i; \ - for(i=0; i<(laneCount); i++) \ - xor8bytesIntoInterleavedWords(state+i*2, state+i*2+1, input+i*8); \ - } - -void setInterleavedWordsInto8bytes(UINT8* dest, UINT32 even, UINT32 odd) -{ - UINT16 d0, d1, d2, d3; - - setInterleavedWordsInto2bytes(dest, even, odd, 0) - setInterleavedWordsInto2bytes(dest, even, odd, 1) - setInterleavedWordsInto2bytes(dest, even, odd, 2) - setInterleavedWordsInto2bytes(dest, even, odd, 3) -} - -#define extractLanes(laneCount, state, data) \ - { \ - int i; \ - for(i=0; i<(laneCount); i++) \ - setInterleavedWordsInto8bytes(data+i*8, ((UINT32*)state)[i*2], ((UINT32*)state)[i*2+1]); \ - } - -#else // No interleaving tables - -#if (PLATFORM_BYTE_ORDER == IS_LITTLE_ENDIAN) - -// Credit: Henry S. Warren, Hacker's Delight, Addison-Wesley, 2002 -#define xorInterleavedLE(rateInLanes, state, input) \ - { \ - const UINT32 * pI = (const UINT32 *)input; \ - UINT32 * pS = state; \ - UINT32 t, x0, x1; \ - int i; \ - for (i = (rateInLanes)-1; i >= 0; --i) \ - { \ - x0 = *(pI++); \ - t = (x0 ^ (x0 >> 1)) & 0x22222222UL; x0 = x0 ^ t ^ (t << 1); \ - t = (x0 ^ (x0 >> 2)) & 0x0C0C0C0CUL; x0 = x0 ^ t ^ (t << 2); \ - t = (x0 ^ (x0 >> 4)) & 0x00F000F0UL; x0 = x0 ^ t ^ (t << 4); \ - t = (x0 ^ (x0 >> 8)) & 0x0000FF00UL; x0 = x0 ^ t ^ (t << 8); \ - x1 = *(pI++); \ - t = (x1 ^ (x1 >> 1)) & 0x22222222UL; x1 = x1 ^ t ^ (t << 1); \ - t = (x1 ^ (x1 >> 2)) & 0x0C0C0C0CUL; x1 = x1 ^ t ^ (t << 2); \ - t = (x1 ^ (x1 >> 4)) & 0x00F000F0UL; x1 = x1 ^ t ^ (t << 4); \ - t = (x1 ^ (x1 >> 8)) & 0x0000FF00UL; x1 = x1 ^ t ^ (t << 8); \ - *(pS++) ^= (UINT16)x0 | (x1 << 16); \ - *(pS++) ^= (x0 >> 16) | (x1 & 0xFFFF0000); \ - } \ - } - -#define xorLanesIntoState(laneCount, state, input) \ - xorInterleavedLE(laneCount, state, input) - -#else // (PLATFORM_BYTE_ORDER == IS_BIG_ENDIAN) - -// Credit: Henry S. Warren, Hacker's Delight, Addison-Wesley, 2002 -UINT64 toInterleaving(UINT64 x) -{ - UINT64 t; - - t = (x ^ (x >> 1)) & 0x2222222222222222ULL; x = x ^ t ^ (t << 1); - t = (x ^ (x >> 2)) & 0x0C0C0C0C0C0C0C0CULL; x = x ^ t ^ (t << 2); - t = (x ^ (x >> 4)) & 0x00F000F000F000F0ULL; x = x ^ t ^ (t << 4); - t = (x ^ (x >> 8)) & 0x0000FF000000FF00ULL; x = x ^ t ^ (t << 8); - t = (x ^ (x >> 16)) & 0x00000000FFFF0000ULL; x = x ^ t ^ (t << 16); - - return x; -} - -void xor8bytesIntoInterleavedWords(UINT32* evenAndOdd, const UINT8* source) -{ - // This can be optimized - UINT64 sourceWord = - (UINT64)source[0] - ^ (((UINT64)source[1]) << 8) - ^ (((UINT64)source[2]) << 16) - ^ (((UINT64)source[3]) << 24) - ^ (((UINT64)source[4]) << 32) - ^ (((UINT64)source[5]) << 40) - ^ (((UINT64)source[6]) << 48) - ^ (((UINT64)source[7]) << 56); - UINT64 evenAndOddWord = toInterleaving(sourceWord); - evenAndOdd[0] ^= (UINT32)evenAndOddWord; - evenAndOdd[1] ^= (UINT32)(evenAndOddWord >> 32); -} - -#define xorLanesIntoState(laneCount, state, input) \ - { \ - int i; \ - for(i=0; i<(laneCount); i++) \ - xor8bytesIntoInterleavedWords(state+i*2, input+i*8); \ - } - -#endif // Endianness - -// Credit: Henry S. Warren, Hacker's Delight, Addison-Wesley, 2002 -UINT64 fromInterleaving(UINT64 x) -{ - UINT64 t; - - t = (x ^ (x >> 16)) & 0x00000000FFFF0000ULL; x = x ^ t ^ (t << 16); - t = (x ^ (x >> 8)) & 0x0000FF000000FF00ULL; x = x ^ t ^ (t << 8); - t = (x ^ (x >> 4)) & 0x00F000F000F000F0ULL; x = x ^ t ^ (t << 4); - t = (x ^ (x >> 2)) & 0x0C0C0C0C0C0C0C0CULL; x = x ^ t ^ (t << 2); - t = (x ^ (x >> 1)) & 0x2222222222222222ULL; x = x ^ t ^ (t << 1); - - return x; -} - -void setInterleavedWordsInto8bytes(UINT8* dest, UINT32* evenAndOdd) -{ -#if (PLATFORM_BYTE_ORDER == IS_LITTLE_ENDIAN) - ((UINT64*)dest)[0] = fromInterleaving(*(UINT64*)evenAndOdd); -#else // (PLATFORM_BYTE_ORDER == IS_BIG_ENDIAN) - // This can be optimized - UINT64 evenAndOddWord = (UINT64)evenAndOdd[0] ^ ((UINT64)evenAndOdd[1] << 32); - UINT64 destWord = fromInterleaving(evenAndOddWord); - dest[0] = destWord & 0xFF; - dest[1] = (destWord >> 8) & 0xFF; - dest[2] = (destWord >> 16) & 0xFF; - dest[3] = (destWord >> 24) & 0xFF; - dest[4] = (destWord >> 32) & 0xFF; - dest[5] = (destWord >> 40) & 0xFF; - dest[6] = (destWord >> 48) & 0xFF; - dest[7] = (destWord >> 56) & 0xFF; -#endif // Endianness -} - -#define extractLanes(laneCount, state, data) \ - { \ - int i; \ - for(i=0; i<(laneCount); i++) \ - setInterleavedWordsInto8bytes(data+i*8, (UINT32*)state+i*2); \ - } - -#endif // With or without interleaving tables - -#if defined(_MSC_VER) -#define ROL32(a, offset) _rotl(a, offset) -#elif (defined (__arm__) && defined(__ARMCC_VERSION)) -#define ROL32(a, offset) __ror(a, 32-(offset)) -#else -#define ROL32(a, offset) ((((UINT32)a) << (offset)) ^ (((UINT32)a) >> (32-(offset)))) -#endif - -//#include "KeccakF-1600-unrolling.macros" -//#include "KeccakF-1600-32.macros" - -#if (UseSchedule == 3) - -#ifdef UseBebigokimisa -#error "No lane complementing with schedule 3." -#endif - -#if (Unrolling != 2) -#error "Only unrolling 2 is supported by schedule 3." -#endif - -void KeccakPermutationOnWords(UINT32 *state) -{ - rounds -} - -void KeccakPermutationOnWordsAfterXoring(UINT32 *state, const UINT8 *input, unsigned int laneCount) -{ - xorLanesIntoState(laneCount, state, input) - rounds -} - -#ifdef ProvideFast576 -void KeccakPermutationOnWordsAfterXoring576bits(UINT32 *state, const UINT8 *input) -{ - xorLanesIntoState(9, state, input) - rounds -} -#endif - -#ifdef ProvideFast832 -void KeccakPermutationOnWordsAfterXoring832bits(UINT32 *state, const UINT8 *input) -{ - xorLanesIntoState(13, state, input) - rounds -} -#endif - -#ifdef ProvideFast1024 -void KeccakPermutationOnWordsAfterXoring1024bits(UINT32 *state, const UINT8 *input) -{ - xorLanesIntoState(16, state, input) - rounds -} -#endif - -#ifdef ProvideFast1088 -void KeccakPermutationOnWordsAfterXoring1088bits(UINT32 *state, const UINT8 *input) -{ - xorLanesIntoState(17, state, input) - rounds -} -#endif - -#ifdef ProvideFast1152 -void KeccakPermutationOnWordsAfterXoring1152bits(UINT32 *state, const UINT8 *input) -{ - xorLanesIntoState(18, state, input) - rounds -} -#endif - -#ifdef ProvideFast1344 -void KeccakPermutationOnWordsAfterXoring1344bits(UINT32 *state, const UINT8 *input) -{ - xorLanesIntoState(21, state, input) - rounds -} -#endif - -#else // (Schedule != 3) - -void KeccakPermutationOnWords(UINT32 *state) -{ - declareABCDE -#if (Unrolling != 24) - unsigned int i; -#endif - - copyFromState(A, state) - rounds -} - -void KeccakPermutationOnWordsAfterXoring(UINT32 *state, const UINT8 *input, unsigned int laneCount) -{ - declareABCDE - unsigned int i; - - xorLanesIntoState(laneCount, state, input) - copyFromState(A, state) - rounds -} - -#ifdef ProvideFast576 -void KeccakPermutationOnWordsAfterXoring576bits(UINT32 *state, const UINT8 *input) -{ - declareABCDE - unsigned int i; - - xorLanesIntoState(9, state, input) - copyFromState(A, state) - rounds -} -#endif - -#ifdef ProvideFast832 -void KeccakPermutationOnWordsAfterXoring832bits(UINT32 *state, const UINT8 *input) -{ - declareABCDE - unsigned int i; - - xorLanesIntoState(13, state, input) - copyFromState(A, state) - rounds -} -#endif - -#ifdef ProvideFast1024 -void KeccakPermutationOnWordsAfterXoring1024bits(UINT32 *state, const UINT8 *input) -{ - declareABCDE - unsigned int i; - - xorLanesIntoState(16, state, input) - copyFromState(A, state) - rounds -} -#endif - -#ifdef ProvideFast1088 -void KeccakPermutationOnWordsAfterXoring1088bits(UINT32 *state, const UINT8 *input) -{ - declareABCDE - unsigned int i; - - xorLanesIntoState(17, state, input) - copyFromState(A, state) - rounds -} -#endif - -#ifdef ProvideFast1152 -void KeccakPermutationOnWordsAfterXoring1152bits(UINT32 *state, const UINT8 *input) -{ - declareABCDE - unsigned int i; - - xorLanesIntoState(18, state, input) - copyFromState(A, state) - rounds -} -#endif - -#ifdef ProvideFast1344 -void KeccakPermutationOnWordsAfterXoring1344bits(UINT32 *state, const UINT8 *input) -{ - declareABCDE - unsigned int i; - - xorLanesIntoState(21, state, input) - copyFromState(A, state) - rounds -} -#endif - -#endif - -void KeccakInitialize() -{ -#ifdef UseInterleaveTables - buildInterleaveTables(); -#endif -} - -void KeccakInitializeState(unsigned char *state) -{ - memset(state, 0, 200); -#ifdef UseBebigokimisa - ((UINT32*)state)[ 2] = ~(UINT32)0; - ((UINT32*)state)[ 3] = ~(UINT32)0; - ((UINT32*)state)[ 4] = ~(UINT32)0; - ((UINT32*)state)[ 5] = ~(UINT32)0; - ((UINT32*)state)[16] = ~(UINT32)0; - ((UINT32*)state)[17] = ~(UINT32)0; - ((UINT32*)state)[24] = ~(UINT32)0; - ((UINT32*)state)[25] = ~(UINT32)0; - ((UINT32*)state)[34] = ~(UINT32)0; - ((UINT32*)state)[35] = ~(UINT32)0; - ((UINT32*)state)[40] = ~(UINT32)0; - ((UINT32*)state)[41] = ~(UINT32)0; -#endif -} - -void KeccakPermutation(unsigned char *state) -{ - // We assume the state is always stored as interleaved 32-bit words - KeccakPermutationOnWords((UINT32*)state); -} - -#ifdef ProvideFast576 -void KeccakAbsorb576bits(unsigned char *state, const unsigned char *data) -{ - KeccakPermutationOnWordsAfterXoring576bits((UINT32*)state, data); -} -#endif - -#ifdef ProvideFast832 -void KeccakAbsorb832bits(unsigned char *state, const unsigned char *data) -{ - KeccakPermutationOnWordsAfterXoring832bits((UINT32*)state, data); -} -#endif - -#ifdef ProvideFast1024 -void KeccakAbsorb1024bits(unsigned char *state, const unsigned char *data) -{ - KeccakPermutationOnWordsAfterXoring1024bits((UINT32*)state, data); -} -#endif - -#ifdef ProvideFast1088 -void KeccakAbsorb1088bits(unsigned char *state, const unsigned char *data) -{ - KeccakPermutationOnWordsAfterXoring1088bits((UINT32*)state, data); -} -#endif - -#ifdef ProvideFast1152 -void KeccakAbsorb1152bits(unsigned char *state, const unsigned char *data) -{ - KeccakPermutationOnWordsAfterXoring1152bits((UINT32*)state, data); -} -#endif - -#ifdef ProvideFast1344 -void KeccakAbsorb1344bits(unsigned char *state, const unsigned char *data) -{ - KeccakPermutationOnWordsAfterXoring1344bits((UINT32*)state, data); -} -#endif - -void KeccakAbsorb(unsigned char *state, const unsigned char *data, unsigned int laneCount) -{ - KeccakPermutationOnWordsAfterXoring((UINT32*)state, data, laneCount); -} - -#ifdef ProvideFast1024 -void KeccakExtract1024bits(const unsigned char *state, unsigned char *data) -{ - extractLanes(16, state, data) -#ifdef UseBebigokimisa - ((UINT32*)data)[ 2] = ~((UINT32*)data)[ 2]; - ((UINT32*)data)[ 3] = ~((UINT32*)data)[ 3]; - ((UINT32*)data)[ 4] = ~((UINT32*)data)[ 4]; - ((UINT32*)data)[ 5] = ~((UINT32*)data)[ 5]; - ((UINT32*)data)[16] = ~((UINT32*)data)[16]; - ((UINT32*)data)[17] = ~((UINT32*)data)[17]; - ((UINT32*)data)[24] = ~((UINT32*)data)[24]; - ((UINT32*)data)[25] = ~((UINT32*)data)[25]; -#endif -} -#endif - -void KeccakExtract(const unsigned char *state, unsigned char *data, unsigned int laneCount) -{ - extractLanes((int)laneCount, state, data) -#ifdef UseBebigokimisa - if (laneCount > 1) { - ((UINT32*)data)[ 2] = ~((UINT32*)data)[ 2]; - ((UINT32*)data)[ 3] = ~((UINT32*)data)[ 3]; - if (laneCount > 2) { - ((UINT32*)data)[ 4] = ~((UINT32*)data)[ 4]; - ((UINT32*)data)[ 5] = ~((UINT32*)data)[ 5]; - if (laneCount > 8) { - ((UINT32*)data)[16] = ~((UINT32*)data)[16]; - ((UINT32*)data)[17] = ~((UINT32*)data)[17]; - if (laneCount > 12) { - ((UINT32*)data)[24] = ~((UINT32*)data)[24]; - ((UINT32*)data)[25] = ~((UINT32*)data)[25]; - if (laneCount > 17) { - ((UINT32*)data)[34] = ~((UINT32*)data)[34]; - ((UINT32*)data)[35] = ~((UINT32*)data)[35]; - if (laneCount > 20) { - ((UINT32*)data)[40] = ~((UINT32*)data)[40]; - ((UINT32*)data)[41] = ~((UINT32*)data)[41]; - } - } - } - } - } - } -#endif -} - - -// ================================================================================ -// =================== KeccakSponge.c -// ================================================================================ - - -/* -The Keccak sponge function, designed by Guido Bertoni, Joan Daemen, -Michaël Peeters and Gilles Van Assche. For more information, feedback or -questions, please refer to our website: http://keccak.noekeon.org/ - -Implementation by the designers, -hereby denoted as "the implementer". - -To the extent possible under law, the implementer has waived all copyright -and related or neighboring rights to the source code in this file. -http://creativecommons.org/publicdomain/zero/1.0/ -*/ - -#include -//#include "KeccakSponge.h" -//#include "KeccakF-1600-interface.h" -#ifdef KeccakReference -//#include "displayIntermediateValues.h" -#endif - -int InitSponge(spongeState *state, unsigned int rate, unsigned int capacity) -{ - if (rate+capacity != 1600) - return 1; - if ((rate <= 0) || (rate >= 1600) || ((rate % 64) != 0)) - return 1; - KeccakInitialize(); - state->rate = rate; - state->capacity = capacity; - state->fixedOutputLength = 0; - KeccakInitializeState(state->state); - memset(state->dataQueue, 0, KeccakMaximumRateInBytes); - state->bitsInQueue = 0; - state->squeezing = 0; - state->bitsAvailableForSqueezing = 0; - - return 0; -} - -void AbsorbQueue(spongeState *state) -{ - // state->bitsInQueue is assumed to be equal to state->rate - #ifdef KeccakReference - displayBytes(1, "Block to be absorbed", state->dataQueue, state->rate/8); - #endif -#ifdef ProvideFast576 - if (state->rate == 576) - KeccakAbsorb576bits(state->state, state->dataQueue); - else -#endif -#ifdef ProvideFast832 - if (state->rate == 832) - KeccakAbsorb832bits(state->state, state->dataQueue); - else -#endif -#ifdef ProvideFast1024 - if (state->rate == 1024) - KeccakAbsorb1024bits(state->state, state->dataQueue); - else -#endif -#ifdef ProvideFast1088 - if (state->rate == 1088) - KeccakAbsorb1088bits(state->state, state->dataQueue); - else -#endif -#ifdef ProvideFast1152 - if (state->rate == 1152) - KeccakAbsorb1152bits(state->state, state->dataQueue); - else -#endif -#ifdef ProvideFast1344 - if (state->rate == 1344) - KeccakAbsorb1344bits(state->state, state->dataQueue); - else -#endif - KeccakAbsorb(state->state, state->dataQueue, state->rate/64); - state->bitsInQueue = 0; -} - -int Absorb(spongeState *state, const unsigned char *data, unsigned long long databitlen) -{ - unsigned long long i, j, wholeBlocks; - unsigned int partialBlock, partialByte; - const unsigned char *curData; - - if ((state->bitsInQueue % 8) != 0) - return 1; // Only the last call may contain a partial byte - if (state->squeezing) - return 1; // Too late for additional input - - i = 0; - while(i < databitlen) { - if ((state->bitsInQueue == 0) && (databitlen >= state->rate) && (i <= (databitlen-state->rate))) { - wholeBlocks = (databitlen-i)/state->rate; - curData = data+i/8; -#ifdef ProvideFast576 - if (state->rate == 576) { - for(j=0; jrate/8); - #endif - KeccakAbsorb576bits(state->state, curData); - } - } - else -#endif -#ifdef ProvideFast832 - if (state->rate == 832) { - for(j=0; jrate/8); - #endif - KeccakAbsorb832bits(state->state, curData); - } - } - else -#endif -#ifdef ProvideFast1024 - if (state->rate == 1024) { - for(j=0; jrate/8); - #endif - KeccakAbsorb1024bits(state->state, curData); - } - } - else -#endif -#ifdef ProvideFast1088 - if (state->rate == 1088) { - for(j=0; jrate/8); - #endif - KeccakAbsorb1088bits(state->state, curData); - } - } - else -#endif -#ifdef ProvideFast1152 - if (state->rate == 1152) { - for(j=0; jrate/8); - #endif - KeccakAbsorb1152bits(state->state, curData); - } - } - else -#endif -#ifdef ProvideFast1344 - if (state->rate == 1344) { - for(j=0; jrate/8); - #endif - KeccakAbsorb1344bits(state->state, curData); - } - } - else -#endif - { - for(j=0; jrate/8) { - #ifdef KeccakReference - displayBytes(1, "Block to be absorbed", curData, state->rate/8); - #endif - KeccakAbsorb(state->state, curData, state->rate/64); - } - } - i += wholeBlocks*state->rate; - } - else { - partialBlock = (unsigned int)(databitlen - i); - if (partialBlock+state->bitsInQueue > state->rate) - partialBlock = state->rate-state->bitsInQueue; - partialByte = partialBlock % 8; - partialBlock -= partialByte; - memcpy(state->dataQueue+state->bitsInQueue/8, data+i/8, partialBlock/8); - state->bitsInQueue += partialBlock; - i += partialBlock; - if (state->bitsInQueue == state->rate) - AbsorbQueue(state); - if (partialByte > 0) { - unsigned char mask = (1 << partialByte)-1; - state->dataQueue[state->bitsInQueue/8] = data[i/8] & mask; - state->bitsInQueue += partialByte; - i += partialByte; - } - } - } - return 0; -} - -void PadAndSwitchToSqueezingPhase(spongeState *state) -{ - // Note: the bits are numbered from 0=LSB to 7=MSB - if (state->bitsInQueue + 1 == state->rate) { - state->dataQueue[state->bitsInQueue/8 ] |= 1 << (state->bitsInQueue % 8); - AbsorbQueue(state); - memset(state->dataQueue, 0, state->rate/8); - } - else { - memset(state->dataQueue + (state->bitsInQueue+7)/8, 0, state->rate/8 - (state->bitsInQueue+7)/8); - state->dataQueue[state->bitsInQueue/8 ] |= 1 << (state->bitsInQueue % 8); - } - state->dataQueue[(state->rate-1)/8] |= 1 << ((state->rate-1) % 8); - AbsorbQueue(state); - - #ifdef KeccakReference - displayText(1, "--- Switching to squeezing phase ---"); - #endif -#ifdef ProvideFast1024 - if (state->rate == 1024) { - KeccakExtract1024bits(state->state, state->dataQueue); - state->bitsAvailableForSqueezing = 1024; - } - else -#endif - { - KeccakExtract(state->state, state->dataQueue, state->rate/64); - state->bitsAvailableForSqueezing = state->rate; - } - #ifdef KeccakReference - displayBytes(1, "Block available for squeezing", state->dataQueue, state->bitsAvailableForSqueezing/8); - #endif - state->squeezing = 1; -} - -int Squeeze(spongeState *state, unsigned char *output, unsigned long long outputLength) -{ - unsigned long long i; - unsigned int partialBlock; - - if (!state->squeezing) - PadAndSwitchToSqueezingPhase(state); - if ((outputLength % 8) != 0) - return 1; // Only multiple of 8 bits are allowed, truncation can be done at user level - - i = 0; - while(i < outputLength) { - if (state->bitsAvailableForSqueezing == 0) { - KeccakPermutation(state->state); -#ifdef ProvideFast1024 - if (state->rate == 1024) { - KeccakExtract1024bits(state->state, state->dataQueue); - state->bitsAvailableForSqueezing = 1024; - } - else -#endif - { - KeccakExtract(state->state, state->dataQueue, state->rate/64); - state->bitsAvailableForSqueezing = state->rate; - } - #ifdef KeccakReference - displayBytes(1, "Block available for squeezing", state->dataQueue, state->bitsAvailableForSqueezing/8); - #endif - } - partialBlock = state->bitsAvailableForSqueezing; - if ((unsigned long long)partialBlock > outputLength - i) - partialBlock = (unsigned int)(outputLength - i); - memcpy(output+i/8, state->dataQueue+(state->rate-state->bitsAvailableForSqueezing)/8, partialBlock/8); - state->bitsAvailableForSqueezing -= partialBlock; - i += partialBlock; - } - return 0; -} - - - -// ================================================================================ -// =================== KeccakNISTInterface.h -// ================================================================================ - - -/* -The Keccak sponge function, designed by Guido Bertoni, Joan Daemen, -Michaël Peeters and Gilles Van Assche. For more information, feedback or -questions, please refer to our website: http://keccak.noekeon.org/ - -Implementation by the designers, -hereby denoted as "the implementer". - -To the extent possible under law, the implementer has waived all copyright -and related or neighboring rights to the source code in this file. -http://creativecommons.org/publicdomain/zero/1.0/ -*/ - -#ifndef _KeccakNISTInterface_h_ -#define _KeccakNISTInterface_h_ - -//#include "KeccakSponge.h" - -typedef unsigned char BitSequence; -typedef unsigned long long DataLength; -typedef enum { SUCCESS = 0, FAIL = 1, BAD_HASHLEN = 2 } HashReturn; - -typedef spongeState hashState; - -/** - * Function to initialize the state of the Keccak[r, c] sponge function. - * The rate r and capacity c values are determined from @a hashbitlen. - * @param state Pointer to the state of the sponge function to be initialized. - * @param hashbitlen The desired number of output bits, - * or 0 for Keccak[] with default parameters - * and arbitrarily-long output. - * @pre The value of hashbitlen must be one of 0, 224, 256, 384 and 512. - * @return SUCCESS if successful, BAD_HASHLEN if the value of hashbitlen is incorrect. - */ -HashReturn Init(hashState *state, int hashbitlen); -/** - * Function to give input data for the sponge function to absorb. - * @param state Pointer to the state of the sponge function initialized by Init(). - * @param data Pointer to the input data. - * When @a databitLen is not a multiple of 8, the last bits of data must be - * in the most significant bits of the last byte. - * @param databitLen The number of input bits provided in the input data. - * @pre In the previous call to Absorb(), databitLen was a multiple of 8. - * @return SUCCESS if successful, FAIL otherwise. - */ -HashReturn Update(hashState *state, const BitSequence *data, DataLength databitlen); -/** - * Function to squeeze output data from the sponge function. - * If @a hashbitlen was not 0 in the call to Init(), the number of output bits is equal to @a hashbitlen. - * If @a hashbitlen was 0 in the call to Init(), the output bits must be extracted using the Squeeze() function. - * @param state Pointer to the state of the sponge function initialized by Init(). - * @param hashval Pointer to the buffer where to store the output data. - * @return SUCCESS if successful, FAIL otherwise. - */ -HashReturn Final(hashState *state, BitSequence *hashval); -/** - * Function to compute a hash using the Keccak[r, c] sponge function. - * The rate r and capacity c values are determined from @a hashbitlen. - * @param hashbitlen The desired number of output bits. - * @param data Pointer to the input data. - * When @a databitLen is not a multiple of 8, the last bits of data must be - * in the most significant bits of the last byte. - * @param databitLen The number of input bits provided in the input data. - * @param hashval Pointer to the buffer where to store the output data. - * @pre The value of hashbitlen must be one of 224, 256, 384 and 512. - * @return SUCCESS if successful, BAD_HASHLEN if the value of hashbitlen is incorrect. - */ -HashReturn Hash(int hashbitlen, const BitSequence *data, DataLength databitlen, BitSequence *hashval); - -#endif - - -// ================================================================================ -// =================== KeccakNISTInterface.c -// ================================================================================ - - - -/* -The Keccak sponge function, designed by Guido Bertoni, Joan Daemen, -Michaël Peeters and Gilles Van Assche. For more information, feedback or -questions, please refer to our website: http://keccak.noekeon.org/ - -Implementation by the designers, -hereby denoted as "the implementer". - -To the extent possible under law, the implementer has waived all copyright -and related or neighboring rights to the source code in this file. -http://creativecommons.org/publicdomain/zero/1.0/ -*/ - -#include -//#include "KeccakNISTInterface.h" -//#include "KeccakF-1600-interface.h" - -HashReturn Init(hashState *state, int hashbitlen) -{ - switch(hashbitlen) { - case 0: // Default parameters, arbitrary length output - InitSponge((spongeState*)state, 1024, 576); - break; - case 224: - InitSponge((spongeState*)state, 1152, 448); - break; - case 256: - InitSponge((spongeState*)state, 1088, 512); - break; - case 384: - InitSponge((spongeState*)state, 832, 768); - break; - case 512: - InitSponge((spongeState*)state, 576, 1024); - break; - default: - return BAD_HASHLEN; - } - state->fixedOutputLength = hashbitlen; - return SUCCESS; -} - -HashReturn Update(hashState *state, const BitSequence *data, DataLength databitlen) -{ - if ((databitlen % 8) == 0) - return (HashReturn)Absorb((spongeState*)state, data, databitlen); - else { - HashReturn ret = (HashReturn)Absorb((spongeState*)state, data, databitlen - (databitlen % 8)); - if (ret == SUCCESS) { - unsigned char lastByte; - // Align the last partial byte to the least significant bits - lastByte = data[databitlen/8] >> (8 - (databitlen % 8)); - return (HashReturn)Absorb((spongeState*)state, &lastByte, databitlen % 8); - } - else - return ret; - } -} - -HashReturn Final(hashState *state, BitSequence *hashval) -{ - return (HashReturn)Squeeze(state, hashval, state->fixedOutputLength); -} - -HashReturn Hash(int hashbitlen, const BitSequence *data, DataLength databitlen, BitSequence *hashval) -{ - hashState state; - HashReturn result; - - if ((hashbitlen != 224) && (hashbitlen != 256) && (hashbitlen != 384) && (hashbitlen != 512)) - return BAD_HASHLEN; // Only the four fixed output lengths available through this API - result = Init(&state, hashbitlen); - if (result != SUCCESS) - return result; - result = Update(&state, data, databitlen); - if (result != SUCCESS) - return result; - result = Final(&state, hashval); - return result; -} - - -} // end of namespace KeccakImpl - diff --git a/etc/Prerequisites/keccak/src/qkeccakhash.cpp b/etc/Prerequisites/keccak/src/qkeccakhash.cpp deleted file mode 100644 index bba43dc6..00000000 --- a/etc/Prerequisites/keccak/src/qkeccakhash.cpp +++ /dev/null @@ -1,189 +0,0 @@ -/*************************************************************************** -** ** -** QKeccakHash, an API wrapper bringing the optimized implementation of ** -** Keccak (http://keccak.noekeon.org/) to Qt. ** -** Copyright (C) 2013 Emanuel Eichhammer ** -** ** -** This program is free software: you can redistribute it and/or modify ** -** it under the terms of the GNU General Public License as published by ** -** the Free Software Foundation, either version 3 of the License, or ** -** (at your option) any later version. ** -** ** -** This program is distributed in the hope that it will be useful, ** -** but WITHOUT ANY WARRANTY; without even the implied warranty of ** -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** -** GNU General Public License for more details. ** -** ** -** You should have received a copy of the GNU General Public License ** -** along with this program. If not, see http://www.gnu.org/licenses/. ** -** ** -**************************************************************************** -** Author: Emanuel Eichhammer ** -** Website/Contact: http://www.WorksLikeClockwork.com/ ** -** Date: 12.01.12 ** -****************************************************************************/ - -#include "qkeccakhash.h" -#include - -#include "keccakimpl.cpp" - -QKeccakHash::QKeccakHash() -{ - m_initialized = false; - m_state = (KeccakImpl::hashState*) _aligned_malloc(sizeof(KeccakImpl::hashState), 32); - if(!m_state) - { - throw "[QKeccakHash] Error: _aligned_malloc() has failed, probably out of heap space!"; - } - memset(m_state, 0, sizeof(KeccakImpl::hashState)); - m_hashResult.clear(); -} - -QKeccakHash::~QKeccakHash() -{ - m_hashResult.clear(); - - if(m_state) - { - _aligned_free(m_state); - m_state = NULL; - } -} - -bool QKeccakHash::init(HashBits hashBits) -{ - if(m_initialized) - { - qWarning("QKeccakHash has already been initialized!"); - return false; - } - - m_hashResult.clear(); - memset(m_state, 0, sizeof(KeccakImpl::hashState)); - int hashBitLength = 0; - - switch (hashBits) - { - case hb224: hashBitLength = 224; break; - case hb256: hashBitLength = 256; break; - case hb384: hashBitLength = 384; break; - case hb512: hashBitLength = 512; break; - default: throw "Invalid hash length!!"; - } - - if(KeccakImpl::Init(m_state, hashBitLength) != KeccakImpl::SUCCESS) - { - qWarning("KeccakImpl::Init() has failed unexpectedly!"); - return false; - } - - m_hashResult.fill(char(0), hashBitLength/8); - m_initialized = true; - - return true; -} - -bool QKeccakHash::addData(const QByteArray &data) -{ - return addData(data.constData(), data.size()); -} - -bool QKeccakHash::addData(const char *data, int size) -{ - if(!m_initialized) - { - qWarning("QKeccakHash has not been initialized yet!"); - return false; - } - - if(KeccakImpl::Update(m_state, (KeccakImpl::BitSequence*)data, size*8) != KeccakImpl::SUCCESS) - { - qWarning("KeccakImpl::Update() has failed unexpectedly!"); - m_hashResult.clear(); - m_initialized = false; - return false; - } - - return true; -} - -const QByteArray &QKeccakHash::finalize() -{ - if(!m_initialized) - { - qWarning("QKeccakHash has not been initialized yet!"); - m_hashResult.clear(); - return m_hashResult; - } - - if(KeccakImpl::Final(m_state, (KeccakImpl::BitSequence*)m_hashResult.data()) != KeccakImpl::SUCCESS) - { - qWarning("KeccakImpl::Final() has failed unexpectedly!"); - m_hashResult.clear(); - } - - m_initialized = false; - return m_hashResult; -} - -bool QKeccakHash::selfTest(void) -{ - QKeccakHash hash; - const QByteArray input("The quick brown fox jumps over the lazy dog"); - bool passed[4] = {false, false, false, false}; - - if(hash.init(QKeccakHash::hb224)) - { - if(hash.addData(input)) - { - QByteArray result = hash.finalize(); - if(!result.isEmpty()) - { - passed[0] = (_stricmp(result.toHex().constData(), "310aee6b30c47350576ac2873fa89fd190cdc488442f3ef654cf23fe") == 0); - if(!passed[0]) qWarning("QKeccakHash self-test: Test #1 failed !!!"); - } - } - } - - if(hash.init(QKeccakHash::hb256)) - { - if(hash.addData(input)) - { - QByteArray result = hash.finalize(); - if(!result.isEmpty()) - { - passed[1] = (_stricmp(result.toHex().constData(), "4d741b6f1eb29cb2a9b9911c82f56fa8d73b04959d3d9d222895df6c0b28aa15") == 0); - if(!passed[1]) qWarning("QKeccakHash self-test: Test #2 failed !!!"); - } - } - } - - if(hash.init(QKeccakHash::hb384)) - { - if(hash.addData(input)) - { - QByteArray result = hash.finalize(); - if(!result.isEmpty()) - { - passed[2] = (_stricmp(result.toHex().constData(), "283990fa9d5fb731d786c5bbee94ea4db4910f18c62c03d173fc0a5e494422e8a0b3da7574dae7fa0baf005e504063b3") == 0); - if(!passed[2]) qWarning("QKeccakHash self-test: Test #3 failed !!!"); - } - } - } - - if(hash.init(QKeccakHash::hb512)) - { - if(hash.addData(input)) - { - QByteArray result = hash.finalize(); - if(!result.isEmpty()) - { - passed[3] = (_stricmp(result.toHex().constData(), "d135bb84d0439dbac432247ee573a23ea7d3c9deb2a968eb31d47c4fb45f1ef4422d6c531b5b9bd6f449ebcc449ea94d0a8f05f62130fda612da53c79659f609") == 0); - if(!passed[3]) qWarning("QKeccakHash self-test: Test #4 failed !!!"); - } - } - } - - return (passed[0] && passed[1] && passed[2] && passed[3]); -} diff --git a/etc/Prerequisites/keccak/src/qkeccakhash.h b/etc/Prerequisites/keccak/src/qkeccakhash.h deleted file mode 100644 index b137d488..00000000 --- a/etc/Prerequisites/keccak/src/qkeccakhash.h +++ /dev/null @@ -1,86 +0,0 @@ -/*************************************************************************** -** ** -** QKeccakHash, an API wrapper bringing the optimized implementation of ** -** Keccak (http://keccak.noekeon.org/) to Qt. ** -** Copyright (C) 2013 Emanuel Eichhammer ** -** ** -** This program is free software: you can redistribute it and/or modify ** -** it under the terms of the GNU General Public License as published by ** -** the Free Software Foundation, either version 3 of the License, or ** -** (at your option) any later version. ** -** ** -** This program is distributed in the hope that it will be useful, ** -** but WITHOUT ANY WARRANTY; without even the implied warranty of ** -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** -** GNU General Public License for more details. ** -** ** -** You should have received a copy of the GNU General Public License ** -** along with this program. If not, see http://www.gnu.org/licenses/. ** -** ** -**************************************************************************** -** Author: Emanuel Eichhammer ** -** Website/Contact: http://www.WorksLikeClockwork.com/ ** -** Date: 12.01.12 ** -****************************************************************************/ - -#ifndef QKECCAKHASH_H -#define QKECCAKHASH_H - -#include -#include -#include - -// Section from KeccakSponge.h -// needed here, since hashState needs to be explicitly 32-byte aligned and therefore can't be -// transformed into a class (in order to forward declarate) like in the other hash wrappers. -namespace KeccakImpl -{ - #define KeccakPermutationSize 1600 - #define KeccakPermutationSizeInBytes (KeccakPermutationSize/8) - #define KeccakMaximumRate 1536 - #define KeccakMaximumRateInBytes (KeccakMaximumRate/8) - - #if defined(__GNUC__) - #define ALIGN __attribute__ ((aligned(32))) - #elif defined(_MSC_VER) - #define ALIGN __declspec(align(32)) - #else - #define ALIGN - #endif - - ALIGN typedef struct spongeStateStruct { - ALIGN unsigned char state[KeccakPermutationSizeInBytes]; - ALIGN unsigned char dataQueue[KeccakMaximumRateInBytes]; - unsigned int rate; - unsigned int capacity; - unsigned int bitsInQueue; - unsigned int fixedOutputLength; - int squeezing; - unsigned int bitsAvailableForSqueezing; - } spongeState; - typedef spongeState hashState; -} -// End Section from KeccakSponge.h - -class QKeccakHash -{ -public: - enum HashBits {hb224, hb256, hb384, hb512}; - - QKeccakHash(); - ~QKeccakHash(); - - static bool selfTest(void); - - bool init(HashBits hashBits=hb256); - bool addData(const QByteArray &data); - bool addData(const char *data, int size); - const QByteArray &finalize(); - -protected: - bool m_initialized; - KeccakImpl::hashState *m_state; - QByteArray m_hashResult; -}; - -#endif // QKECCAKHASH_H diff --git a/src/Config.h b/src/Config.h index ff7e814b..b7e599a6 100644 --- a/src/Config.h +++ b/src/Config.h @@ -35,7 +35,7 @@ #define VER_LAMEXP_MINOR_LO 1 #define VER_LAMEXP_TYPE Beta #define VER_LAMEXP_PATCH 1 -#define VER_LAMEXP_BUILD 1584 +#define VER_LAMEXP_BUILD 1586 #define VER_LAMEXP_CONFG 1558 /////////////////////////////////////////////////////////////////////////////// diff --git a/src/Dialog_Update.cpp b/src/Dialog_Update.cpp index 7ed98423..2d1d6aec 100644 --- a/src/Dialog_Update.cpp +++ b/src/Dialog_Update.cpp @@ -27,11 +27,13 @@ //LameXP includes #include "Global.h" -#include "Thread_CheckUpdate.h" #include "Dialog_LogView.h" #include "Model_Settings.h" #include "WinSevenTaskbar.h" +//MUtils +#include + //Qt includes #include #include @@ -159,7 +161,7 @@ void UpdateDialog::showEvent(QShowEvent *event) { if(!m_thread) { - m_thread = new UpdateCheckThread(m_binaryWGet, m_binaryGnuPG, m_binaryKeys, m_betaUpdates); + m_thread = new MUtils::UpdateChecker(m_binaryWGet, m_binaryGnuPG, m_binaryKeys, QLatin1String("LameXP"), lamexp_version_build(), m_betaUpdates); connect(m_thread, SIGNAL(statusChanged(int)), this, SLOT(threadStatusChanged(int))); connect(m_thread, SIGNAL(progressChanged(int)), this, SLOT(threadProgressChanged(int))); connect(m_thread, SIGNAL(messageLogged(QString)), this, SLOT(threadMessageLogged(QString))); @@ -286,41 +288,41 @@ void UpdateDialog::threadStatusChanged(const int status) { switch(status) { - case UpdateCheckThread::UpdateStatus_NotStartedYet: + case MUtils::UpdateChecker::UpdateStatus_NotStartedYet: ui->statusLabel->setText(tr("Initializing, please wait...")); break; - case UpdateCheckThread::UpdateStatus_CheckingConnection: + case MUtils::UpdateChecker::UpdateStatus_CheckingConnection: ui->statusLabel->setText(tr("Testing your internet connection, please wait...")); break; - case UpdateCheckThread::UpdateStatus_FetchingUpdates: + case MUtils::UpdateChecker::UpdateStatus_FetchingUpdates: ui->statusLabel->setText(tr("Checking for new updates online, please wait...")); break; - case UpdateCheckThread::UpdateStatus_CompletedUpdateAvailable: + case MUtils::UpdateChecker::UpdateStatus_CompletedUpdateAvailable: ui->statusLabel->setText(tr("A new version of LameXP is available!")); SHOW_HINT(tr("We highly recommend all users to install this update as soon as possible."), ":/icons/shield_exclamation.png"); UPDATE_TASKBAR(WinSevenTaskbar::WinSevenTaskbarNormalState, ":/icons/shield_exclamation.png"); break; - case UpdateCheckThread::UpdateStatus_CompletedNoUpdates: + case MUtils::UpdateChecker::UpdateStatus_CompletedNoUpdates: ui->statusLabel->setText(tr("No new updates available at this time.")); SHOW_HINT(tr("Your version of LameXP is still up-to-date. Please check for updates regularly!"), ":/icons/shield_green.png"); UPDATE_TASKBAR(WinSevenTaskbar::WinSevenTaskbarNormalState, ":/icons/shield_green.png"); break; - case UpdateCheckThread::UpdateStatus_CompletedNewVersionOlder: + case MUtils::UpdateChecker::UpdateStatus_CompletedNewVersionOlder: ui->statusLabel->setText(tr("Your version appears to be newer than the latest release.")); SHOW_HINT(tr("This usually indicates your are currently using a pre-release version of LameXP."), ":/icons/shield_blue.png"); UPDATE_TASKBAR(WinSevenTaskbar::WinSevenTaskbarNormalState, ":/icons/shield_error.png"); break; - case UpdateCheckThread::UpdateStatus_ErrorNoConnection: + case MUtils::UpdateChecker::UpdateStatus_ErrorNoConnection: ui->statusLabel->setText(tr("It appears that the computer currently is offline!")); SHOW_HINT(tr("Please make sure your computer is connected to the internet and try again."), ":/icons/network_error.png"); UPDATE_TASKBAR(WinSevenTaskbar::WinSevenTaskbarErrorState, ":/icons/exclamation.png"); break; - case UpdateCheckThread::UpdateStatus_ErrorConnectionTestFailed: + case MUtils::UpdateChecker::UpdateStatus_ErrorConnectionTestFailed: ui->statusLabel->setText(tr("Network connectivity test has failed!")); SHOW_HINT(tr("Please make sure your computer is connected to the internet and try again."), ":/icons/network_error.png"); UPDATE_TASKBAR(WinSevenTaskbar::WinSevenTaskbarErrorState, ":/icons/exclamation.png"); break; - case UpdateCheckThread::UpdateStatus_ErrorFetchUpdateInfo: + case MUtils::UpdateChecker::UpdateStatus_ErrorFetchUpdateInfo: ui->statusLabel->setText(tr("Failed to fetch update information from server!")); SHOW_HINT(tr("Sorry, the update server might be busy at this time. Plase try again later."), ":/icons/server_error.png"); UPDATE_TASKBAR(WinSevenTaskbar::WinSevenTaskbarErrorState, ":/icons/exclamation.png"); @@ -354,14 +356,14 @@ void UpdateDialog::threadFinished(void) } else { - const bool bHaveUpdate = (m_thread->getUpdateStatus() == UpdateCheckThread::UpdateStatus_CompletedUpdateAvailable); + const bool bHaveUpdate = (m_thread->getUpdateStatus() == MUtils::UpdateChecker::UpdateStatus_CompletedUpdateAvailable); ui->installButton->setEnabled(bHaveUpdate); lamexp_beep(bHaveUpdate ? lamexp_beep_info : lamexp_beep_warning); - if(const UpdateInfo *const updateInfo = m_thread->getUpdateInfo()) + if(const MUtils::UpdateCheckerInfo *const updateInfo = m_thread->getUpdateInfo()) { - ui->infoLabel->setText(QString("%1
%2").arg(tr("More information available at:"), updateInfo->m_downloadSite)); - ui->labelVersionLatest->setText(QString("%1 %2 (%3)").arg(tr("Build"), QString::number(updateInfo->m_buildNo), updateInfo->m_buildDate.toString(Qt::ISODate))); + ui->infoLabel->setText(QString("%1
%2").arg(tr("More information available at:"), updateInfo->getDownloadSite())); + ui->labelVersionLatest->setText(QString("%1 %2 (%3)").arg(tr("Build"), QString::number(updateInfo->getBuildNo()), updateInfo->getBuildDate().toString(Qt::ISODate))); ui->infoLabel->show(); } @@ -387,7 +389,7 @@ void UpdateDialog::applyUpdate(void) ui->closeButton->setEnabled(false); ui->retryButton->setEnabled(false); - if(const UpdateInfo *updateInfo = m_thread->getUpdateInfo()) + if(const MUtils::UpdateCheckerInfo *updateInfo = m_thread->getUpdateInfo()) { ui->statusLabel->setText(tr("Update is being downloaded, please be patient...")); ui->frameAnimation->show(); @@ -407,12 +409,12 @@ void UpdateDialog::applyUpdate(void) connect(&process, SIGNAL(error(QProcess::ProcessError)), &loop, SLOT(quit())); connect(&process, SIGNAL(finished(int,QProcess::ExitStatus)), &loop, SLOT(quit())); - args << QString("/Location=%1").arg(updateInfo->m_downloadAddress); - args << QString("/Filename=%1").arg(updateInfo->m_downloadFilename); - args << QString("/TicketID=%1").arg(updateInfo->m_downloadFilecode); + args << QString("/Location=%1").arg(updateInfo->getDownloadAddress()); + args << QString("/Filename=%1").arg(updateInfo->getDownloadFilename()); + args << QString("/TicketID=%1").arg(updateInfo->getDownloadFilecode()); args << QString("/ToFolder=%1").arg(QDir::toNativeSeparators(QDir(QApplication::applicationDirPath()).canonicalPath())); args << QString("/ToExFile=%1.exe").arg(QFileInfo(QFileInfo(QApplication::applicationFilePath()).canonicalFilePath()).completeBaseName()); - args << QString("/AppTitle=LameXP (Build #%1)").arg(QString::number(updateInfo->m_buildNo)); + args << QString("/AppTitle=LameXP (Build #%1)").arg(QString::number(updateInfo->getBuildNo())); QApplication::setOverrideCursor(Qt::WaitCursor); UPDATE_TASKBAR(WinSevenTaskbar::WinSevenTaskbarIndeterminateState, ":/icons/transmit_blue.png"); @@ -471,7 +473,7 @@ void UpdateDialog::testKnownHosts(void) { ui->statusLabel->setText("Testing all known hosts, this may take a few minutes..."); - if(UpdateCheckThread *testThread = new UpdateCheckThread(m_binaryWGet, m_binaryGnuPG, m_binaryKeys, m_betaUpdates, true)) + if(MUtils::UpdateChecker *testThread = new MUtils::UpdateChecker(m_binaryWGet, m_binaryGnuPG, m_binaryKeys, QLatin1String("LameXP"), lamexp_version_build(), m_betaUpdates, true)) { QEventLoop loop; m_logFile->clear(); diff --git a/src/Dialog_Update.h b/src/Dialog_Update.h index 2961e19e..42bfa1cd 100644 --- a/src/Dialog_Update.h +++ b/src/Dialog_Update.h @@ -24,10 +24,14 @@ #include -class UpdateInfo; class SettingsModel; class QMovie; -class UpdateCheckThread; + +//MUtils forward declaration +namespace MUtils +{ + class UpdateChecker; +} //UIC forward declartion namespace Ui { @@ -76,7 +80,7 @@ private: const QString m_binaryKeys; const QString m_binaryUpdater; - UpdateCheckThread *m_thread; + MUtils::UpdateChecker *m_thread; QStringList *m_logFile; SettingsModel *m_settings; QMovie *m_animator; diff --git a/src/LockedFile.cpp b/src/LockedFile.cpp index b87cdd45..a9d97198 100644 --- a/src/LockedFile.cpp +++ b/src/LockedFile.cpp @@ -23,12 +23,15 @@ #include "LockedFile.h" #include "Global.h" +//MUtils +#include + +//Qt #include #include #include #include #include -#include #include #include @@ -61,13 +64,13 @@ QByteArray LockedFile::fileHash(QFile &file) if(file.isOpen() && file.reset()) { - QKeccakHash keccak; + MUtils::KeccakHash keccak; const QByteArray data = file.readAll(); const QByteArray seed = QByteArray::fromHex(g_seed); const QByteArray salt = QByteArray::fromHex(g_salt); - if(keccak.init(QKeccakHash::hb384)) + if(keccak.init(MUtils::KeccakHash::hb384)) { bool ok = true; ok = ok && keccak.addData(seed); @@ -256,7 +259,7 @@ const QString &LockedFile::filePath() void LockedFile::selfTest() { - if(!QKeccakHash::selfTest()) + if(!MUtils::KeccakHash::selfTest()) { THROW("QKeccakHash self-test has failed!"); } diff --git a/src/Thread_CheckUpdate.cpp b/src/Thread_CheckUpdate.cpp deleted file mode 100644 index 507dccff..00000000 --- a/src/Thread_CheckUpdate.cpp +++ /dev/null @@ -1,751 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// LameXP - Audio Encoder Front-End -// Copyright (C) 2004-2014 LoRd_MuldeR -// -// This program is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation; either version 2 of the License, or -// (at your option) any later version, but always including the *additional* -// restrictions defined in the "License.txt" file. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License along -// with this program; if not, write to the Free Software Foundation, Inc., -// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -// -// http://www.gnu.org/licenses/gpl-2.0.txt -/////////////////////////////////////////////////////////////////////////////// - -#include "Thread_CheckUpdate.h" - -#include "Global.h" - -#include -#include -#include -#include -#include -#include -#include - -/////////////////////////////////////////////////////////////////////////////// -// CONSTANTS -/////////////////////////////////////////////////////////////////////////////// - -static const char *header_id = "!Update"; -static const char *section_id = "LameXP"; - -static const char *mirror_url_postfix[] = -{ - "update.ver", - "update_beta.ver", - NULL -}; - -static const char *update_mirrors_prim[] = -{ - "http://muldersoft.com/", - "http://mulder.bplaced.net/", - "http://mulder.cwsurf.de/", - "http://mulder.6te.net/", - "http://mulder.webuda.com/", - "http://mulder.byethost13.com/", - "http://muldersoft.kilu.de/", - "http://mulder.pe.hu/", - "http://muldersoft.zxq.net/", - "http://lamexp.sourceforge.net/", - "http://lordmulder.github.io/LameXP/", - "http://lord_mulder.bitbucket.org/", - "http://www.tricksoft.de/", - NULL -}; - -static const char *update_mirrors_back[] = -{ - "http://mplayer.savedonthe.net/", - NULL -}; - -static const char *known_hosts[] = //Taken form: http://www.alexa.com/topsites !!! -{ - "http://www.163.com/", - "http://www.7-zip.org/", - "http://www.ac3filter.net/", - "http://www.amazon.com/", - "http://antergos.com/", - "http://www.aol.com/", - "http://www.apache.org/", - "http://www.apple.com/", - "http://www.adobe.com/", - "http://www.avidemux.org/", - "http://www.babylon.com/", - "http://www.baidu.com/", - "http://bandcamp.com/", - "http://www.bbc.co.uk/", - "http://www.berlios.de/", - "http://www.bing.com/", - "http://www.cnet.com/", - "http://cnzz.com/", - "http://www.codeplex.com/", - "http://qt.digia.com/", - "http://www.ebay.com/", - "http://www.equation.com/", - "http://fc2.com/", - "http://fedoraproject.org/", - "http://www.ffmpeg.org/", - "http://blog.flickr.net/en", - "http://free-codecs.com/", - "http://blog.gitorious.org/", - "http://git-scm.com/", - "http://www.gmx.net/", - "http://www.gnome.org/", - "http://www.gnu.org/", - "http://go.com/", - "http://code.google.com/", - "http://www.heise.de/", - "http://www.huffingtonpost.co.uk/", - "http://www.iana.org/", - "http://www.imdb.com/", - "http://www.imgburn.com/", - "http://imgur.com/", - "http://en.jd.com/", - "http://kannmanumdieuhrzeitschonnbierchentrinken.de/", - "http://mirrors.kernel.org/", - "http://lame.sourceforge.net/", - "http://www.libav.org/", - "http://www.linkedin.com/about-us", - "http://www.linuxmint.com/", - "http://www.livedoor.com/", - "http://www.livejournal.com/", - "http://go.mail.ru/", - "http://www.mediafire.com/", - "http://ftp.mozilla.org/", - "http://mplayerhq.hu/", - "http://www.msn.com/?st=1", - "http://oss.netfarm.it/", - "http://www.nytimes.com/", - "http://www.opera.com/", - "http://pastie.org/", - "http://www.portablefreeware.com/", - "http://qt-project.org/", - "http://www.quakelive.com/", - "http://www.seamonkey-project.org/", - "http://www.sina.com.cn/", - "http://www.sohu.com/", - "http://www.soso.com/", - "http://sourceforge.net/", - "http://www.spiegel.de/", - "http://tdm-gcc.tdragon.net/", - "http://www.tdrsmusic.com/", - "http://www.ubuntu.com/", - "http://status.twitter.com/", - "http://www.uol.com.br/", - "http://www.videohelp.com/", - "http://www.videolan.org/", - "http://virtualdub.org/", - "http://blog.virustotal.com/", - "http://weibo.com/login.php", - "http://www.wikipedia.org/", - "http://www.winamp.com/", - "http://wordpress.com/about/", - "http://xiph.org/", - "http://us.mail.yahoo.com/", - "http://www.yandex.ru/", - "http://www.youtube.com/yt/about/", - "http://www.zedo.com/", - "http://ffmpeg.zeranoe.com/", - NULL -}; - -static const int MIN_CONNSCORE = 8; -static const int VERSION_INFO_EXPIRES_MONTHS = 6; -static char *USER_AGENT_STR = "Mozilla/5.0 (X11; Linux i686; rv:7.0.1) Gecko/20111106 IceCat/7.0.1"; - -//Helper function -static int getMaxProgress(void) -{ - int counter = MIN_CONNSCORE + 2; - for(int i = 0; update_mirrors_prim[i]; i++) counter++; - for(int i = 0; update_mirrors_back[i]; i++) counter++; - return counter; -} - -//////////////////////////////////////////////////////////// -// Update Info Class -//////////////////////////////////////////////////////////// - -UpdateInfo::UpdateInfo(void) -{ - resetInfo(); -} - -void UpdateInfo::resetInfo(void) -{ - m_buildNo = 0; - m_buildDate.setDate(1900, 1, 1); - m_downloadSite.clear(); - m_downloadAddress.clear(); - m_downloadFilename.clear(); - m_downloadFilecode.clear(); -} - -//////////////////////////////////////////////////////////// -// Constructor & Destructor -//////////////////////////////////////////////////////////// - -UpdateCheckThread::UpdateCheckThread(const QString &binWGet, const QString &binGnuPG, const QString &binKeys, const bool betaUpdates, const bool testMode) -: - m_updateInfo(new UpdateInfo()), - m_binaryWGet(binWGet), - m_binaryGnuPG(binGnuPG), - m_binaryKeys(binKeys), - m_betaUpdates(betaUpdates), - m_testMode(testMode), - m_maxProgress(getMaxProgress()) -{ - m_success = false; - m_status = UpdateStatus_NotStartedYet; - m_progress = 0; - - if(m_binaryWGet.isEmpty() || m_binaryGnuPG.isEmpty() || m_binaryKeys.isEmpty()) - { - THROW("Tools not initialized correctly!"); - } -} - -UpdateCheckThread::~UpdateCheckThread(void) -{ - delete m_updateInfo; -} - -//////////////////////////////////////////////////////////// -// Protected functions -//////////////////////////////////////////////////////////// - -void UpdateCheckThread::run(void) -{ - qDebug("Update checker thread started!"); - - try - { - m_testMode ? testKnownHosts() : checkForUpdates(); - } - catch(const std::exception &error) - { - PRINT_ERROR("\nGURU MEDITATION !!!\n\nException error:\n%s\n", error.what()); - lamexp_fatal_exit("Unhandeled C++ exception error, application will exit!"); - } - catch(...) - { - PRINT_ERROR("\nGURU MEDITATION !!!\n\nUnknown exception error!\n"); - lamexp_fatal_exit("Unhandeled C++ exception error, application will exit!"); - } - - qDebug("Update checker thread completed."); -} - -void UpdateCheckThread::checkForUpdates(void) -{ - // ----- Initialization ----- // - - m_success = false; - m_updateInfo->resetInfo(); - setProgress(0); - - // ----- Test Internet Connection ----- // - - int connectionScore = 0; - int maxConnectTries = (3 * MIN_CONNSCORE) / 2; - - log("Checking internet connection..."); - setStatus(UpdateStatus_CheckingConnection); - - const int networkStatus = lamexp_network_status(); - if(networkStatus == lamexp_network_non) - { - log("", "Operating system reports that the computer is currently offline !!!"); - setProgress(m_maxProgress); - setStatus(UpdateStatus_ErrorNoConnection); - return; - } - - setProgress(1); - - // ----- Test Known Hosts Connectivity ----- // - - QStringList hostList; - for(int i = 0; known_hosts[i]; i++) - { - hostList << QString::fromLatin1(known_hosts[i]); - } - - lamexp_seed_rand(); - - while(!(hostList.isEmpty() || (connectionScore >= MIN_CONNSCORE) || (maxConnectTries < 1))) - { - switch(tryContactHost(hostList.takeAt(lamexp_rand() % hostList.count()))) - { - case 01: connectionScore += 1; break; - case 02: connectionScore += 2; break; - default: maxConnectTries -= 1; break; - } - setProgress(qBound(1, connectionScore + 1, MIN_CONNSCORE + 1)); - lamexp_sleep(64); - } - - if(connectionScore < MIN_CONNSCORE) - { - log("", "Connectivity test has failed: Internet connection appears to be broken!"); - setProgress(m_maxProgress); - setStatus(UpdateStatus_ErrorConnectionTestFailed); - return; - } - - // ----- Build Mirror List ----- // - - log("", "----", "", "Checking for updates online..."); - setStatus(UpdateStatus_FetchingUpdates); - - QStringList mirrorList; - for(int index = 0; update_mirrors_prim[index]; index++) - { - mirrorList << QString::fromLatin1(update_mirrors_prim[index]); - } - - lamexp_seed_rand(); - if(const int len = mirrorList.count()) - { - const int rounds = len * 1097; - for(int i = 0; i < rounds; i++) - { - mirrorList.swap(i % len, lamexp_rand() % len); - } - } - - for(int index = 0; update_mirrors_back[index]; index++) - { - mirrorList << QString::fromLatin1(update_mirrors_back[index]); - } - - // ----- Fetch Update Info From Server ----- // - - while(!mirrorList.isEmpty()) - { - QString currentMirror = mirrorList.takeFirst(); - setProgress(m_progress + 1); - if(!m_success) - { - if(tryUpdateMirror(m_updateInfo, currentMirror)) - { - m_success = true; - } - } - else - { - lamexp_sleep(64); - } - } - - setProgress(m_maxProgress); - - if(m_success) - { - if(m_updateInfo->m_buildNo > lamexp_version_build()) - { - setStatus(UpdateStatus_CompletedUpdateAvailable); - } - else if(m_updateInfo->m_buildNo == lamexp_version_build()) - { - setStatus(UpdateStatus_CompletedNoUpdates); - } - else - { - setStatus(UpdateStatus_CompletedNewVersionOlder); - } - } - else - { - setStatus(UpdateStatus_ErrorFetchUpdateInfo); - } -} - -void UpdateCheckThread::testKnownHosts(void) -{ - QStringList hostList; - for(int i = 0; known_hosts[i]; i++) - { - hostList << QString::fromLatin1(known_hosts[i]); - } - - qDebug("\n[Known Hosts]"); - log("Testing all known hosts...", "", "---"); - - int hostCount = hostList.count(); - while(!hostList.isEmpty()) - { - QString currentHost = hostList.takeFirst(); - qDebug("Testing: %s", currentHost.toLatin1().constData()); - log("", "Testing:", currentHost, ""); - QString outFile = QString("%1/%2.htm").arg(lamexp_temp_folder2(), lamexp_rand_str()); - bool httpOk = false; - if(!getFile(currentHost, outFile, 0, &httpOk)) - { - if(httpOk) - { - qWarning("\nConnectivity test was SLOW on the following site:\n%s\n", currentHost.toLatin1().constData()); - } - else - { - qWarning("\nConnectivity test FAILED on the following site:\n%s\n", currentHost.toLatin1().constData()); - } - } - log("", "---"); - QFile::remove(outFile); - } -} - -//////////////////////////////////////////////////////////// -// PRIVATE FUNCTIONS -//////////////////////////////////////////////////////////// - -void UpdateCheckThread::setStatus(const int status) -{ - if(m_status != status) - { - m_status = status; - emit statusChanged(status); - } -} - -void UpdateCheckThread::setProgress(const int progress) -{ - if(m_progress != progress) - { - m_progress = progress; - emit progressChanged(progress); - } -} - -void UpdateCheckThread::log(const QString &str1, const QString &str2, const QString &str3, const QString &str4) -{ - if(!str1.isNull()) emit messageLogged(str1); - if(!str2.isNull()) emit messageLogged(str2); - if(!str3.isNull()) emit messageLogged(str3); - if(!str4.isNull()) emit messageLogged(str4); -} - -int UpdateCheckThread::tryContactHost(const QString &url) -{ - int result = -1; bool httpOkay = false; - const QString outFile = QString("%1/%2.htm").arg(lamexp_temp_folder2(), lamexp_rand_str()); - log("", "Testing host:", url); - - if(getFile(url, outFile, 0, &httpOkay)) - { - log("Connection to host was established successfully."); - result = 2; - } - else - { - if(httpOkay) - { - log("Connection to host timed out after HTTP OK was received."); - result = 1; - } - else - { - log("Connection failed: The host could not be reached!"); - result = 0; - } - } - - QFile::remove(outFile); - return result; -} - -bool UpdateCheckThread::tryUpdateMirror(UpdateInfo *updateInfo, const QString &url) -{ - bool success = false; - log("", "Trying mirror:", url); - - const QString randPart = lamexp_rand_str(); - const QString outFileVers = QString("%1/%2.ver").arg(lamexp_temp_folder2(), randPart); - const QString outFileSign = QString("%1/%2.sig").arg(lamexp_temp_folder2(), randPart); - - if(getUpdateInfo(url, outFileVers, outFileSign)) - { - log("", "Download okay, checking signature:"); - if(checkSignature(outFileVers, outFileSign)) - { - log("", "Signature okay, parsing info:"); - success = parseVersionInfo(outFileVers, updateInfo); - } - else - { - log("", "Bad signature, take care!"); - } - } - else - { - log("", "Download has failed!"); - } - - QFile::remove(outFileVers); - QFile::remove(outFileSign); - - return success; -} - -bool UpdateCheckThread::getUpdateInfo(const QString &url, const QString &outFileVers, const QString &outFileSign) -{ - log("", "Downloading update info:"); - if(!getFile(QString("%1%2" ).arg(url, mirror_url_postfix[m_betaUpdates ? 1 : 0]), outFileVers)) - { - return false; - } - - log("", "Downloading signature:"); - if(!getFile(QString("%1%2.sig").arg(url, mirror_url_postfix[m_betaUpdates ? 1 : 0]), outFileSign)) - { - return false; - } - - return true; -} - -bool UpdateCheckThread::getFile(const QString &url, const QString &outFile, unsigned int maxRedir, bool *httpOk) -{ - QFileInfo output(outFile); - output.setCaching(false); - if(httpOk) *httpOk = false; - - if(output.exists()) - { - QFile::remove(output.canonicalFilePath()); - if(output.exists()) - { - return false; - } - } - - QProcess process; - lamexp_init_process(process, output.absolutePath()); - - QStringList args; - args << "-T" << "15" << "--no-cache" << "--no-dns-cache" << QString().sprintf("--max-redirect=%u", maxRedir); - args << QString("--referer=%1://%2/").arg(QUrl(url).scheme(), QUrl(url).host()) << "-U" << USER_AGENT_STR; - args << "-O" << output.fileName() << url; - - QEventLoop loop; - connect(&process, SIGNAL(error(QProcess::ProcessError)), &loop, SLOT(quit())); - connect(&process, SIGNAL(finished(int,QProcess::ExitStatus)), &loop, SLOT(quit())); - connect(&process, SIGNAL(readyRead()), &loop, SLOT(quit())); - - QTimer timer; - timer.setSingleShot(true); - timer.setInterval(25000); - connect(&timer, SIGNAL(timeout()), &loop, SLOT(quit())); - - const QRegExp httpResponseOK("200 OK$"); - - process.start(m_binaryWGet, args); - - if(!process.waitForStarted()) - { - return false; - } - - timer.start(); - - while(process.state() != QProcess::NotRunning) - { - loop.exec(); - const bool bTimeOut = (!timer.isActive()); - while(process.canReadLine()) - { - QString line = QString::fromLatin1(process.readLine()).simplified(); - if(line.contains(httpResponseOK)) - { - line.append(" [OK]"); - if(httpOk) *httpOk = true; - } - log(line); - } - if(bTimeOut) - { - qWarning("WGet process timed out <-- killing!"); - process.kill(); - process.waitForFinished(); - log("!!! TIMEOUT !!!"); - return false; - } - } - - timer.stop(); - timer.disconnect(&timer, SIGNAL(timeout()), &loop, SLOT(quit())); - - log(QString().sprintf("Exited with code %d", process.exitCode())); - return (process.exitCode() == 0) && output.exists() && output.isFile(); -} - -bool UpdateCheckThread::checkSignature(const QString &file, const QString &signature) -{ - if(QFileInfo(file).absolutePath().compare(QFileInfo(signature).absolutePath(), Qt::CaseInsensitive) != 0) - { - qWarning("CheckSignature: File and signature should be in same folder!"); - return false; - } - if(QFileInfo(file).absolutePath().compare(QFileInfo(m_binaryKeys).absolutePath(), Qt::CaseInsensitive) != 0) - { - qWarning("CheckSignature: File and keyring should be in same folder!"); - return false; - } - - QProcess process; - lamexp_init_process(process, QFileInfo(file).absolutePath()); - - QEventLoop loop; - connect(&process, SIGNAL(error(QProcess::ProcessError)), &loop, SLOT(quit())); - connect(&process, SIGNAL(finished(int,QProcess::ExitStatus)), &loop, SLOT(quit())); - connect(&process, SIGNAL(readyRead()), &loop, SLOT(quit())); - - process.start(m_binaryGnuPG, QStringList() << "--homedir" << "." << "--keyring" << QFileInfo(m_binaryKeys).fileName() << QFileInfo(signature).fileName() << QFileInfo(file).fileName()); - - if(!process.waitForStarted()) - { - return false; - } - - while(process.state() == QProcess::Running) - { - loop.exec(); - while(process.canReadLine()) - { - log(QString::fromLatin1(process.readLine()).simplified()); - } - } - - log(QString().sprintf("Exited with code %d", process.exitCode())); - return (process.exitCode() == 0); -} - -bool UpdateCheckThread::parseVersionInfo(const QString &file, UpdateInfo *updateInfo) -{ - QRegExp value("^(\\w+)=(.+)$"); - QRegExp section("^\\[(.+)\\]$"); - - QDate updateInfoDate; - updateInfo->resetInfo(); - - QFile data(file); - if(!data.open(QIODevice::ReadOnly)) - { - qWarning("Cannot open update info file for reading!"); - return false; - } - - bool inHeader = false; - bool inSection = false; - - while(!data.atEnd()) - { - QString line = QString::fromLatin1(data.readLine()).trimmed(); - if(section.indexIn(line) >= 0) - { - log(QString("Sec: [%1]").arg(section.cap(1))); - inSection = (section.cap(1).compare(section_id, Qt::CaseInsensitive) == 0); - inHeader = (section.cap(1).compare(header_id, Qt::CaseInsensitive) == 0); - continue; - } - if(inSection && (value.indexIn(line) >= 0)) - { - log(QString("Val: '%1' ==> '%2").arg(value.cap(1), value.cap(2))); - if(value.cap(1).compare("BuildNo", Qt::CaseInsensitive) == 0) - { - bool ok = false; - unsigned int temp = value.cap(2).toUInt(&ok); - if(ok) updateInfo->m_buildNo = temp; - } - else if(value.cap(1).compare("BuildDate", Qt::CaseInsensitive) == 0) - { - QDate temp = QDate::fromString(value.cap(2).trimmed(), Qt::ISODate); - if(temp.isValid()) updateInfo->m_buildDate = temp; - } - else if(value.cap(1).compare("DownloadSite", Qt::CaseInsensitive) == 0) - { - updateInfo->m_downloadSite = value.cap(2).trimmed(); - } - else if(value.cap(1).compare("DownloadAddress", Qt::CaseInsensitive) == 0) - { - updateInfo->m_downloadAddress = value.cap(2).trimmed(); - } - else if(value.cap(1).compare("DownloadFilename", Qt::CaseInsensitive) == 0) - { - updateInfo->m_downloadFilename = value.cap(2).trimmed(); - } - else if(value.cap(1).compare("DownloadFilecode", Qt::CaseInsensitive) == 0) - { - updateInfo->m_downloadFilecode = value.cap(2).trimmed(); - } - } - if(inHeader && (value.indexIn(line) >= 0)) - { - log(QString("Val: '%1' ==> '%2").arg(value.cap(1), value.cap(2))); - if(value.cap(1).compare("TimestampCreated", Qt::CaseInsensitive) == 0) - { - QDate temp = QDate::fromString(value.cap(2).trimmed(), Qt::ISODate); - if(temp.isValid()) updateInfoDate = temp; - } - } - } - - if(!updateInfoDate.isValid()) - { - updateInfo->resetInfo(); - log("WARNING: Version info timestamp is missing!"); - return false; - } - else if(updateInfoDate.addMonths(VERSION_INFO_EXPIRES_MONTHS) < lamexp_current_date_safe()) - { - updateInfo->resetInfo(); - log(QString::fromLatin1("WARNING: This version info has expired at %1!").arg(updateInfoDate.addMonths(VERSION_INFO_EXPIRES_MONTHS).toString(Qt::ISODate))); - return false; - } - else if(lamexp_current_date_safe() < updateInfoDate) - { - log("Version info is from the future, take care!"); - qWarning("Version info is from the future, take care!"); - } - - bool complete = true; - - if(!(updateInfo->m_buildNo > 0)) complete = false; - if(!(updateInfo->m_buildDate.year() >= 2010)) complete = false; - if(updateInfo->m_downloadSite.isEmpty()) complete = false; - if(updateInfo->m_downloadAddress.isEmpty()) complete = false; - if(updateInfo->m_downloadFilename.isEmpty()) complete = false; - if(updateInfo->m_downloadFilecode.isEmpty()) complete = false; - - if(!complete) - { - log("WARNING: Version info is incomplete!"); - } - - return complete; -} - -//////////////////////////////////////////////////////////// -// SLOTS -//////////////////////////////////////////////////////////// - -/*NONE*/ - -//////////////////////////////////////////////////////////// -// EVENTS -//////////////////////////////////////////////////////////// - -/*NONE*/ diff --git a/src/Thread_CheckUpdate.h b/src/Thread_CheckUpdate.h deleted file mode 100644 index 31c26d24..00000000 --- a/src/Thread_CheckUpdate.h +++ /dev/null @@ -1,110 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// LameXP - Audio Encoder Front-End -// Copyright (C) 2004-2014 LoRd_MuldeR -// -// This program is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation; either version 2 of the License, or -// (at your option) any later version, but always including the *additional* -// restrictions defined in the "License.txt" file. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License along -// with this program; if not, write to the Free Software Foundation, Inc., -// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -// -// http://www.gnu.org/licenses/gpl-2.0.txt -/////////////////////////////////////////////////////////////////////////////// - -#pragma once - -#include -#include - -/////////////////////////////////////////////////////////////////////////////// - -class UpdateInfo -{ -public: - UpdateInfo(void); - void resetInfo(void); - - unsigned int m_buildNo; - QDate m_buildDate; - QString m_downloadSite; - QString m_downloadAddress; - QString m_downloadFilename; - QString m_downloadFilecode; -}; - -/////////////////////////////////////////////////////////////////////////////// - -class UpdateCheckThread : public QThread -{ - Q_OBJECT - -public: - enum - { - UpdateStatus_NotStartedYet = 0, - UpdateStatus_CheckingConnection = 1, - UpdateStatus_FetchingUpdates = 2, - UpdateStatus_CompletedUpdateAvailable = 3, - UpdateStatus_CompletedNoUpdates = 4, - UpdateStatus_CompletedNewVersionOlder = 5, - UpdateStatus_ErrorNoConnection = 6, - UpdateStatus_ErrorConnectionTestFailed = 7, - UpdateStatus_ErrorFetchUpdateInfo = 8 - } - update_status_t; - - UpdateCheckThread(const QString &binWGet, const QString &binGnuPG, const QString &binKeys, const bool betaUpdates, const bool testMode = false); - ~UpdateCheckThread(void); - - const int getUpdateStatus(void) const { return m_status; } - const bool getSuccess(void) const { return m_success; }; - const int getMaximumProgress(void) const { return m_maxProgress; }; - const int getCurrentProgress(void) const { return m_progress; }; - const UpdateInfo *getUpdateInfo(void) const { return m_updateInfo; } - -protected: - void run(void); - void checkForUpdates(void); - void testKnownHosts(void); - -signals: - void statusChanged(const int status); - void progressChanged(const int progress); - void messageLogged(const QString &text); - -private: - const int m_maxProgress; - UpdateInfo *const m_updateInfo; - - const bool m_betaUpdates; - const bool m_testMode; - - const QString m_binaryWGet; - const QString m_binaryGnuPG; - const QString m_binaryKeys; - - volatile bool m_success; - - int m_status; - int m_progress; - - inline void setStatus(const int status); - inline void setProgress(const int progress); - inline void log(const QString &str1, const QString &str2 = QString(), const QString &str3 = QString(), const QString &str4 = QString()); - - bool getFile(const QString &url, const QString &outFile, unsigned int maxRedir = 5, bool *httpOk = NULL); - bool getUpdateInfo(const QString &url, const QString &outFileVers, const QString &outFileSign); - int tryContactHost(const QString &url); - bool tryUpdateMirror(UpdateInfo *updateInfo, const QString &url); - bool checkSignature(const QString &file, const QString &signature); - bool parseVersionInfo(const QString &file, UpdateInfo *updateInfo); -};