Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
Welcome to the Intel Community. If you get an answer you like, please mark it as an Accepted Solution to help others. Thank you!
26746 Discussions

Missing constants for Windows 7 API cryptographic functions in IVF 2017.1

jcarbaut
Beginner
169 Views

Hello all.

While trying to use Windows functions from the ADVAPI32 module to compute SHA keys, I noticed that the Microsoft AES Cryptographic Provider constant MS_ENH_RSA_AES_PROV is not defined in the IFWINTY module. Character strings definitions of providers are here on MSDN. For this provider, it is "Microsoft Enhanced RSA and AES Cryptographic Provider".

Instead, there is a MS_ENH_RSA_AES_PROV_A constant (equal to "Microsoft Enhanced RSA and AES Cryptographic Provider (Prototype)") that, according to Microsoft, was used on Windows XP, under the name MS_ENH_RSA_AES_PROV.

Likewise, several algorithm constants are not defined, for instance CALG_SHA_256 and the other SHA-2 algorithms.

It's not much of an issue, since all of this is documented on the MSDN and I can simply add the constants to my program, but maybe the modules will have to be updated eventually.

I added working examples on the Rosetta Code web site, for MD5, SHA-1 and SHA-256. Problems arised with the last, as MD5 and SHA-1 come with the "Microsoft Base Cryptographic Provider", for which IVF has all the necessary constants.

Best regards,

Jean-Claude Arbaut

0 Kudos
1 Solution
Steven_L_Intel1
Employee
169 Views

Try the attached - unzip and add it to your project.

View solution in original post

5 Replies
Steven_L_Intel1
Employee
169 Views

We have been trying to keep up with the Windows API, but it's difficult because changes are not all listed in one place. It's a manual process and we've been concentrating on kernel32 changes mostly.

I'll take a look at the crypto API and see what needs to be added. If you come across any other useful APIs and constants missing, please do let us know.

jcarbaut
Beginner
169 Views

Thank you. I didn't realize that this is done by hand, I thought it could be possible to write a script to automatically translate Windows C headers into Fortran interface modules.

Jean-Claude Arbaut

Steven_L_Intel1
Employee
169 Views

It is possible, but a lot of hand editing and checking is also needed. The C headers don't always "translate" into what a Fortran user would want.

Steven_L_Intel1
Employee
170 Views

Try the attached - unzip and add it to your project.

View solution in original post

jcarbaut
Beginner
169 Views

It's working now, thanks!

Reply