Crystal Kell AES

I need a small, two-layer version of AES . I googled and found AES - Advanced Encryption Standard (source code), but the code seems to be written for Windows and I need multi-platform.

Is there any other small version of the well-known name AES or a fix for the functions used that seem to be unknown on Linux?

My compiler says these are unknown functions:

./aes/AES.cpp:198:17: error: '_rotl' was not declared in this scope ./aes/AES.cpp:608:20: error: '_rotr' was not declared in this scope 

I also got:

 ./aes/AES.cpp:764:34: error: 'memset' was not declared in this scope ./aes/AES.cpp:770:36: error: 'memcpy' was not declared in this scope 

Because they should be known, given that they include:

 #include "AES.hpp" #include <assert.h> #include <stdio.h> #include <cstdio> #include <cstdlib> #include <fstream> #include <iostream> 
0
source share
3 answers

The reference implementation for AES can be found here: http://www.efgh.com/software/rijndael.htm . The main source file includes only <stdio.h> , but it does not even depend on it; You should not have any problems using it on any platform.

0
source

Use a well-tested cryptographic library, such as cryptlib or OpenSSL , instead of some random snippets found on the 40th page of search results. Depending on what you are doing, you probably should also use higher level constructors, not AES directly.

+4
source

since it goes high in Google's search for this error, here is what I did for my program, which refused to compile on the x64 CentOS system, which ia32intrin.h lacks:

 #if !defined(_rotr) && (defined(__i386__) || defined(__x86_64__)) static inline unsigned int _rotr(unsigned int n, const int count) { asm volatile ( "rorl %1, %0;" : "=r" (n) : "nI" (count), "0" (n) ); return n; } #endif 

as mentioned in avakar, you need to enable cstring or alternatively string.h to get memset and memcpy.

the code for _rotl would be identical, except for the operation code mnemonics, which would be roll .

0
source

All Articles