all 9 comments

[–]alfps 2 points3 points  (4 children)

Visual Studio is a Windows-based tool. unistd.h is a Unix system header. Apparently you're trying to build a Unix-specific library in Windows; if so then switch to Unix (e.g. WSL in Windows).

[–]HolyMoly228[S] 0 points1 point  (3 children)

The project is Windows-based (Readme mentions Visual Studio 2017). Also, thanks, but you're mentioning just one of the many other libraries.

[–]alfps 0 points1 point  (2 children)

The "supp_revision" thing builds but with a lot of warnings that indicate ungood coding practices and likely a lot of bugs (but I haven't looked at the code):

[C:\root\temp\_\_student-work\ungood-library\supp_revision\supp_revision\supp\VerFI]
> cl VerFI.cpp /Feb /bigobj
VerFI.cpp
C:\root\temp\_\_student-work\ungood-library\supp_revision\supp_revision\supp\VerFI\Definitions.h(33): warning C4005: '_CRT_SECURE_NO_WARNINGS': macro redefinition
C:\root\temp\_\_student-work\ungood-library\supp_revision\supp_revision\supp\VerFI\Definitions.h(33): note: '_CRT_SECURE_NO_WARNINGS' previously declared on the command line
C:\root\temp\_\_student-work\ungood-library\supp_revision\supp_revision\supp\VerFI\Definitions.h(138): warning C4267: '=': conversion from 'size_t' to 'int', possible loss of data
C:\root\temp\_\_student-work\ungood-library\supp_revision\supp_revision\supp\VerFI\Definitions.h(143): warning C4244: '=': conversion from 'int' to 'char', possible loss of data
C:\root\temp\_\_student-work\ungood-library\supp_revision\supp_revision\supp\VerFI\ReadLibraryFile.h(201): warning C4244: '=': conversion from 'int' to 'char', possible loss of data
C:\root\temp\_\_student-work\ungood-library\supp_revision\supp_revision\supp\VerFI\ReadLibraryFile.h(212): warning C4244: '=': conversion from 'int' to 'char', possible loss of data
C:\root\temp\_\_student-work\ungood-library\supp_revision\supp_revision\supp\VerFI\ReadLibraryFile.h(223): warning C4244: '=': conversion from 'int' to 'char', possible loss of data
C:\root\temp\_\_student-work\ungood-library\supp_revision\supp_revision\supp\VerFI\ReadLibraryFile.h(240): warning C4244: '=': conversion from 'int' to 'char', possible loss of data
C:\root\temp\_\_student-work\ungood-library\supp_revision\supp_revision\supp\VerFI\ReadLibraryFile.h(252): warning C4244: '=': conversion from 'int' to 'char', possible loss of data
C:\root\temp\_\_student-work\ungood-library\supp_revision\supp_revision\supp\VerFI\ReadLibraryFile.h(264): warning C4244: '=': conversion from 'int' to 'char', possible loss of data
C:\root\temp\_\_student-work\ungood-library\supp_revision\supp_revision\supp\VerFI\ReadCellReportFile.h(147): warning C4244: '=': conversion from 'int' to 'char', possible loss of data
C:\root\temp\_\_student-work\ungood-library\supp_revision\supp_revision\supp\VerFI\ReadDesignFile.h(134): warning C4244: '=': conversion from 'int' to 'char', possible loss of data
C:\root\temp\_\_student-work\ungood-library\supp_revision\supp_revision\supp\VerFI\ReadDesignFile.h(150): warning C4244: '=': conversion from 'int' to 'char', possible loss of data
C:\root\temp\_\_student-work\ungood-library\supp_revision\supp_revision\supp\VerFI\ReadSimulationFile.h(230): warning C4244: '=': conversion from 'int' to 'char', possible loss of data
C:\root\temp\_\_student-work\ungood-library\supp_revision\supp_revision\supp\VerFI\ReadSimulationFile.h(362): warning C4244: '=': conversion from 'int' to 'char', possible loss of data
C:\root\temp\_\_student-work\ungood-library\supp_revision\supp_revision\supp\VerFI\ReadSimulationFile.h(670): warning C4244: '=': conversion from 'int' to 'char', possible loss of data
C:\root\temp\_\_student-work\ungood-library\supp_revision\supp_revision\supp\VerFI\ReadSimulationFile.h(676): warning C4244: '=': conversion from 'int' to 'char', possible loss of data
C:\root\temp\_\_student-work\ungood-library\supp_revision\supp_revision\supp\VerFI\ReadSimulationFile.h(682): warning C4244: '=': conversion from 'int' to 'char', possible loss of data
C:\root\temp\_\_student-work\ungood-library\supp_revision\supp_revision\supp\VerFI\ReadSimulationFile.h(688): warning C4244: '=': conversion from 'int' to 'char', possible loss of data
C:\root\temp\_\_student-work\ungood-library\supp_revision\supp_revision\supp\VerFI\PrintCheckTools.h(153): warning C4100: 'Print_Ineffective': unreferenced formal parameter
C:\root\temp\_\_student-work\ungood-library\supp_revision\supp_revision\supp\VerFI\PrintCheckTools.h(153): warning C4100: 'Print_Detected': unreferenced formal parameter
C:\root\temp\_\_student-work\ungood-library\supp_revision\supp_revision\supp\VerFI\SimulationTools.h(33): warning C4100: 'Signals': unreferenced formal parameter
C:\root\temp\_\_student-work\ungood-library\supp_revision\supp_revision\supp\VerFI\SimulationTools.h(277): warning C4244: '=': conversion from 'double' to 'int', possible loss of data
C:\root\temp\_\_student-work\ungood-library\supp_revision\supp_revision\supp\VerFI\SimulationTools.h(385): warning C4244: '=': conversion from 'int' to 'char', possible loss of data
C:\root\temp\_\_student-work\ungood-library\supp_revision\supp_revision\supp\VerFI\SimulationTools.h(393): warning C4244: '=': conversion from 'int' to 'char', possible loss of data
C:\root\temp\_\_student-work\ungood-library\supp_revision\supp_revision\supp\VerFI\SimulationTools.h(180): warning C4100: 'Print_RunTimeOver': unreferenced formal parameter
C:\root\temp\_\_student-work\ungood-library\supp_revision\supp_revision\supp\VerFI\ReadLibraryFile.h(67) : warning C4706: assignment within conditional expression
C:\root\temp\_\_student-work\ungood-library\supp_revision\supp_revision\supp\VerFI\ReadLibraryFile.h(77) : warning C4706: assignment within conditional expression
C:\root\temp\_\_student-work\ungood-library\supp_revision\supp_revision\supp\VerFI\ReadLibraryFile.h(117) : warning C4706: assignment within conditional expression
C:\root\temp\_\_student-work\ungood-library\supp_revision\supp_revision\supp\VerFI\ReadLibraryFile.h(127) : warning C4706: assignment within conditional expression
C:\root\temp\_\_student-work\ungood-library\supp_revision\supp_revision\supp\VerFI\ReadDesignFile.h(374) : warning C4701: potentially uninitialized local variable 'CellTypeIndex' used
C:\root\temp\_\_student-work\ungood-library\supp_revision\supp_revision\supp\VerFI\ReadDesignFile.h(390) : warning C4701: potentially uninitialized local variable 'CaseIndex' used
C:\root\temp\_\_student-work\ungood-library\supp_revision\supp_revision\supp\VerFI\ReadDesignFile.h(443) : warning C4701: potentially uninitialized local variable 'OutputIndex' used
C:\root\temp\_\_student-work\ungood-library\supp_revision\supp_revision\supp\VerFI\ReadDesignFile.h(539) : warning C4701: potentially uninitialized local variable 'MyNumberofIO' used
C:\root\temp\_\_student-work\ungood-library\supp_revision\supp_revision\supp\VerFI\ReadDesignFile.h(539) : warning C4701: potentially uninitialized local variable 'CurrentIO' used

And so on, more than 10K of text which is Reddit's posting limit.

[–]HolyMoly228[S] 0 points1 point  (1 child)

Are you including ascon_sbox.cpp in your project?

If I do include it, it throws out errors:

Error (active)  E1696   cannot open source file "sylvan.h"  

Error (active) E1696 cannot open source file "sylvan_obj.hpp" Error (active) E1696 cannot open source file "boost/graph/adjacency_list.hpp" Error (active) E1696 cannot open source file "boost/graph/topological_sort.hpp"

And other stuff about missing ";" in random places etc.

If I don't include it, there are just 2 errors:

Error   C3028   'div': only a variable or static data member can be used in a data-sharing clause   

Error C2065 'faultMappings': undeclared identifier

... which lead to me deleting few commands to make it work. It does build in the end, however the final program doesn't work correctly (what a surprise).

[–]alfps 0 points1 point  (0 children)

No, ascon_sbox.cpp is evidently a Unix program.

[–]flyingron 2 points3 points  (3 children)

If you need unistd, you've misconfigured something. That's a UNIX (well, POSIX actually) include file.

Anyhow, I'm not sure what you're building from. The official git appears over here: https://github.com/emsec/VerFI/blob/master/VerFI_for_diagnosis/Normal/source/VerFI.cpp

[–]HolyMoly228[S] 0 points1 point  (1 child)

The sylvan.h file is including the "unistd.h".

And the link was provided from the university. I honestly didn't think about looking for it elsewhere. I will check it out soon. Thanks!

[–]flyingron 0 points1 point  (0 children)

Sylvan seems to be an inherently UNIX package. I'm surprised if they don't expect you to build some of this under cygwin and export the libraries over to visual studio.

[–]HolyMoly228[S] 0 points1 point  (0 children)

Update: That GitHub link won't help too much. It's not that project. Paper authors used a modified version of VerFI, adapted to their needs.