On 27 March 2012 16:42, Cactus <rieman...@gmail.com> wrote: > > On Tuesday, March 27, 2012 2:38:57 PM UTC+1, michael85 wrote: >> >> Hello, >> >> I have started working on a client server system in C++ for privacy >> preserving signal processing applications. Since this system will rely on >> certain public key cryptography primitives, I decided to try and implement >> them with MPIR, since GMP seems a bit more complicated to compile on >> Windows... In this (long) message, I will detail my current progress with >> MPIR, the inconsistencies / errors that I noticed and, at the end, some >> questions. >> >> At the moment, I downloaded mpir-2.5.1 and I think I managed to build the >> library for x64 and the SandyBridge platform - dll_mpir_sandybridge (I'm >> working on a Core i5 SandyBridge). In order to do this, I had to run the >> build.vc10\mpir_config.py (need to cd to \build.vc10\ before running it) in >> order to create the dll and lib projects for this platform (by the way, >> \build.vc10\readme.txt says to use "mpir_build.py" which does not exist). >> Afterwards, from the VS GUI, I had some issue with the prebuild.bat script, >> because you need to add the path for the sandybridge option into it in order >> to build this project, so I added this line: >> >> if /i "%1" EQU "sandybridge" ((set sdir=x86_64w\sandybridge) & (set >> platform=x64)) >> >> (hopefully, I got it right) >> >> After this, I noticed some inconsistencies in the documentation concerning >> the way it creates directories: >> - \dll\x64\Release >> - \lib\x64\Release >> - \build.vc10\x64\Release >> - the build.vc10\lib and \build.vc10\dll remain empty >> >> Afterwards, I decided to build the tests, to check if all went OK. For >> this, I build the lib_mpir_cxx project first (mpir-tests.sln it nags about a >> missing mpirxx.h without it). Sometimes, it throws build errors for certain >> test projects (regarding missing add-test-lib). I managed to get all of them >> to build correctly only after running build on add-test-lib and then >> (re)building those that fail one by one. I think it has something to do with >> the build order and some concurrency issues. Can they be built in batch mode >> without involving VS? >> >> I went to the \build.vc10\mpir-tests directory and ran run-tests.py. I got >> an error: no such file or directory '..\\dll\\x64\\Release\\mpir.dll at line >> 33. From what I can tell, the path there is wrong, probably because of the >> directory inconsistencies I mentioned above. I corrected it and got that 182 >> tests ran correctly (some were skipped with message "test suppressed for >> windows DLL"). >> >> \build.vc10\readme.txt mentions a last_build.txt generated in >> \build.vc10\, but I am unable to find it. Perhaps this functionality got >> removed... > > Hi > > Thank you for a most useful report of the issues that you faced in building > MPIR. This will, I hope, allow me to ensure that these issues are smoothed > out in our next release. In particular, the Python build generator in MPIR > 2.5.x is still experimental so I am not surprised that you ran into a few > issues. And, as you have discovered, I have been moving the output > directories to make it easier to build MPIR for future Visual Studio > releases. > >> Questions: >> - I don't have that much experience in designing and writing >> (multiplatform) C++ applications from scratch and I was wondering if there >> is any article or book that helps in this sense or maybe some project that I >> could, at least, use as inspiration; >> - I saw that GMP has also added a C++ class interface. Is it compatible >> with the MPIR one? > > I believe that they are compatible although I cannot be certain about this > because I think that the C++ interface in GMP might have evolved since MPIR > forked from it. > >> - The documentation states that "MPIR does not support the secure >> cryptographic functions provided by GMP". Could you please detail this >> statement? > > Several MPIR team members who are involved in both MPIR and cryptographic > information security believe that neither MPIR nor GMP are suitable for > cryptographic use. In consequence we have decided not to add functions that > give any impression that such use is supported. > > I can't speak for everyone here, but my reason for this decision is that > both GMP and MPIR place great emphasis on speed at the expense of code > structure, code quality and code correctness (look at the code if you don't > believe me). In consequence code analysis and the verification of code > correctness - often critical requirements for cryptographic code - are at > best difficult and at worst impossible. > >> >> - For the client - server communication part, I think that OpenSSL is a >> good choice, which, as far as I've read, can be configured to use GMP as a >> big number library. Does this mean that I can use it with MPIR as well? Is >> there any guide on how to do this? > > In compatibility mode MPIR should be a direct replacement ffor GMP. > >> >> - Since MPIR is forked from GMP to make it more Windows friendly, does >> this create any issues under Linux? At the moment, I am thinking of trying >> to use a Linux virtual machine for tests on my current platform. Are there >> any issues with running this library in a virtual machine? > > I will leave someone else with direct experience of such use to answer > this. >
Some VM's misreport CPU data and MPIR doesn't build correctly on them. But this is a problem for any assembly optimised software. You can still build MPIR for the required system by specifying it to configure (see the documentation for details). Bill. -- You received this message because you are subscribed to the Google Groups "mpir-devel" group. To post to this group, send email to mpir-devel@googlegroups.com. To unsubscribe from this group, send email to mpir-devel+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/mpir-devel?hl=en.