balena / aes-whitebox Goto Github PK
View Code? Open in Web Editor NEWWBC AES implementation in C++ using Chow and Muir papers supporting 128, 192, 256, 512, 1024, 2048 and 4096-bit keys
License: Other
WBC AES implementation in C++ using Chow and Muir papers supporting 128, 192, 256, 512, 1024, 2048 and 4096-bit keys
License: Other
https://github.com/balena/aes-whitebox/blob/master/aes_tests.c#L59
read_hex(argv[2], plain, 4*16, "plain");
read_hex(argv[3], iv_or_nonce, 16, "iv-or-nonce");
read_hex(argv[4], cipher, 4*16, "cipher");
should be after the following if-else block.
this line won't compile.
https://github.com/balena/aes-whitebox/blob/master/aes_whitebox_compiler.cc#L162C1-L162C31
It would be very kind of you if you made examples:
PS: Thank you for you work
Is that the reason why all the values in XorTable are entirely the same for every entry?
Right now, you could get a ton more performance if you just didn't generate those and do:
n0 = ((aa >> 28) & 0xf) ^ ((bb >> 28) & 0xf);
etc.
which is what the current tables achieve, since the codegen does:
uint8_t Xor[Nr-1][96][16][16];
for (int r = 0; r < Nr-1; r++)
for (int n = 0; n < 96; n++)
for (int i = 0; i < 16; i++)
for (int j = 0; j < 16; j++)
Xor[r][n][i][j] = i ^ j;
r and n are no factor in the calculation, which is either a bug, or we can just get rid of this table entirely.
Before compiling, I installed the NTL dependency from Ubuntu repos:
$ sudo apt-get install libntl-dev libntl35
The idea was to include this whitebox implementation in an Android c++ application, and include the tables as binaries files in the assets folders of the app.
[18:09 edu@xps aes-whitebox] (master)> make
g++ -lntl aes_whitebox_compiler.o -o aes_whitebox_compiler
aes_whitebox_compiler.o: In function `(anonymous namespace)::GenerateGF2RandomMatrix(int)':
/usr/include/NTL/GF2.h:264: undefined reference to `NTL::RandomBnd(long)'
aes_whitebox_compiler.o: In function `(anonymous namespace)::GenerateRandomGF2InvertibleMatrix(int)':
/usr/include/NTL/mat_GF2.h:102: undefined reference to `NTL::determinant(NTL::ref_GF2, NTL::Mat<NTL::GF2> const&)'
aes_whitebox_compiler.o: In function `(anonymous namespace)::CalculateTyBoxes(unsigned int*, unsigned int (*) [16][256], unsigned char (*) [256], unsigned int (*) [16][256], bool, bool, int)':
/usr/include/NTL/vec_GF2.h:43: undefined reference to `NTL::WordVector::~WordVector()'
aes_whitebox_compiler.o: In function `(anonymous namespace)::CalculateTyBoxes(unsigned int*, unsigned int (*) [16][256], unsigned char (*) [256], unsigned int (*) [16][256], bool, bool, int)':
/tmp/aes-whitebox/aes_whitebox_compiler.cc:90: undefined reference to `NTL::operator*(NTL::Mat<NTL::GF2> const&, NTL::Vec<NTL::GF2> const&)'
aes_whitebox_compiler.o: In function `(anonymous namespace)::CalculateTyBoxes(unsigned int*, unsigned int (*) [16][256], unsigned char (*) [256], unsigned int (*) [16][256], bool, bool, int)':
/usr/include/NTL/vec_GF2.h:43: undefined reference to `NTL::WordVector::~WordVector()'
/usr/include/NTL/vec_GF2.h:43: undefined reference to `NTL::WordVector::~WordVector()'
aes_whitebox_compiler.o: In function `(anonymous namespace)::CalculateTyBoxes(unsigned int*, unsigned int (*) [16][256], unsigned char (*) [256], unsigned int (*) [16][256], bool, bool, int)':
/usr/include/NTL/mat_GF2.h:73: undefined reference to `NTL::inv(NTL::Mat<NTL::GF2>&, NTL::Mat<NTL::GF2> const&)'
aes_whitebox_compiler.o: In function `(anonymous namespace)::CalculateTyBoxes(unsigned int*, unsigned int (*) [16][256], unsigned char (*) [256], unsigned int (*) [16][256], bool, bool, int)':
/usr/include/NTL/vec_GF2.h:43: undefined reference to `NTL::WordVector::~WordVector()'
aes_whitebox_compiler.o: In function `(anonymous namespace)::CalculateTyBoxes(unsigned int*, unsigned int (*) [16][256], unsigned char (*) [256], unsigned int (*) [16][256], bool, bool, int)':
/tmp/aes-whitebox/aes_whitebox_compiler.cc:56: undefined reference to `NTL::Vec<NTL::GF2>::SetLength(long)'
aes_whitebox_compiler.o: In function `(anonymous namespace)::CalculateTyBoxes(unsigned int*, unsigned int (*) [16][256], unsigned char (*) [256], unsigned int (*) [16][256], bool, bool, int)':
/usr/include/NTL/vec_GF2.h:43: undefined reference to `NTL::WordVector::~WordVector()'
aes_whitebox_compiler.o: In function `(anonymous namespace)::CalculateTyBoxes(unsigned int*, unsigned int (*) [16][256], unsigned char (*) [256], unsigned int (*) [16][256], bool, bool, int)':
/tmp/aes-whitebox/aes_whitebox_compiler.cc:90: undefined reference to `NTL::operator*(NTL::Mat<NTL::GF2> const&, NTL::Vec<NTL::GF2> const&)'
aes_whitebox_compiler.o: In function `(anonymous namespace)::CalculateTyBoxes(unsigned int*, unsigned int (*) [16][256], unsigned char (*) [256], unsigned int (*) [16][256], bool, bool, int)':
/usr/include/NTL/vec_GF2.h:43: undefined reference to `NTL::WordVector::~WordVector()'
/usr/include/NTL/vec_GF2.h:43: undefined reference to `NTL::WordVector::~WordVector()'
aes_whitebox_compiler.o: In function `(anonymous namespace)::CalculateTyBoxes(unsigned int*, unsigned int (*) [16][256], unsigned char (*) [256], unsigned int (*) [16][256], bool, bool, int)':
/tmp/aes-whitebox/aes_whitebox_compiler.cc:56: undefined reference to `NTL::Vec<NTL::GF2>::SetLength(long)'
aes_whitebox_compiler.o: In function `(anonymous namespace)::CalculateTyBoxes(unsigned int*, unsigned int (*) [16][256], unsigned char (*) [256], unsigned int (*) [16][256], bool, bool, int)':
/usr/include/NTL/vec_GF2.h:43: undefined reference to `NTL::WordVector::~WordVector()'
aes_whitebox_compiler.o: In function `(anonymous namespace)::CalculateTyBoxes(unsigned int*, unsigned int (*) [16][256], unsigned char (*) [256], unsigned int (*) [16][256], bool, bool, int)':
/tmp/aes-whitebox/aes_whitebox_compiler.cc:46: undefined reference to `NTL::Vec<NTL::GF2>::SetLength(long)'
aes_whitebox_compiler.o: In function `(anonymous namespace)::CalculateTyBoxes(unsigned int*, unsigned int (*) [16][256], unsigned char (*) [256], unsigned int (*) [16][256], bool, bool, int)':
/usr/include/NTL/vec_GF2.h:43: undefined reference to `NTL::WordVector::~WordVector()'
aes_whitebox_compiler.o: In function `(anonymous namespace)::CalculateTyBoxes(unsigned int*, unsigned int (*) [16][256], unsigned char (*) [256], unsigned int (*) [16][256], bool, bool, int)':
/tmp/aes-whitebox/aes_whitebox_compiler.cc:90: undefined reference to `NTL::operator*(NTL::Mat<NTL::GF2> const&, NTL::Vec<NTL::GF2> const&)'
aes_whitebox_compiler.o: In function `(anonymous namespace)::CalculateTyBoxes(unsigned int*, unsigned int (*) [16][256], unsigned char (*) [256], unsigned int (*) [16][256], bool, bool, int)':
/usr/include/NTL/vec_GF2.h:43: undefined reference to `NTL::WordVector::~WordVector()'
/usr/include/NTL/vec_GF2.h:43: undefined reference to `NTL::WordVector::~WordVector()'
aes_whitebox_compiler.o: In function `(anonymous namespace)::CalculateTyBoxes(unsigned int*, unsigned int (*) [16][256], unsigned char (*) [256], unsigned int (*) [16][256], bool, bool, int)':
/usr/include/NTL/mat_GF2.h:73: undefined reference to `NTL::inv(NTL::Mat<NTL::GF2>&, NTL::Mat<NTL::GF2> const&)'
aes_whitebox_compiler.o: In function `(anonymous namespace)::CalculateTyBoxes(unsigned int*, unsigned int (*) [16][256], unsigned char (*) [256], unsigned int (*) [16][256], bool, bool, int)':
/usr/include/NTL/vec_GF2.h:43: undefined reference to `NTL::WordVector::~WordVector()'
/usr/include/NTL/vec_GF2.h:43: undefined reference to `NTL::WordVector::~WordVector()'
aes_whitebox_compiler.o: In function `(anonymous namespace)::CalculateTyBoxes(unsigned int*, unsigned int (*) [16][256], unsigned char (*) [256], unsigned int (*) [16][256], bool, bool, int)':
/tmp/aes-whitebox/aes_whitebox_compiler.cc:90: undefined reference to `NTL::operator*(NTL::Mat<NTL::GF2> const&, NTL::Vec<NTL::GF2> const&)'
aes_whitebox_compiler.o: In function `(anonymous namespace)::CalculateTyBoxes(unsigned int*, unsigned int (*) [16][256], unsigned char (*) [256], unsigned int (*) [16][256], bool, bool, int)':
/usr/include/NTL/vec_GF2.h:43: undefined reference to `NTL::WordVector::~WordVector()'
/usr/include/NTL/vec_GF2.h:43: undefined reference to `NTL::WordVector::~WordVector()'
aes_whitebox_compiler.o: In function `(anonymous namespace)::CalculateTyBoxes(unsigned int*, unsigned int (*) [16][256], unsigned char (*) [256], unsigned int (*) [16][256], bool, bool, int)':
/tmp/aes-whitebox/aes_whitebox_compiler.cc:46: undefined reference to `NTL::Vec<NTL::GF2>::SetLength(long)'
aes_whitebox_compiler.o: In function `(anonymous namespace)::CalculateTyBoxes(unsigned int*, unsigned int (*) [16][256], unsigned char (*) [256], unsigned int (*) [16][256], bool, bool, int)':
/usr/include/NTL/vec_GF2.h:43: undefined reference to `NTL::WordVector::~WordVector()'
/usr/include/NTL/vec_GF2.h:43: undefined reference to `NTL::WordVector::~WordVector()'
aes_whitebox_compiler.o: In function `(anonymous namespace)::CalculateTyBoxes(unsigned int*, unsigned int (*) [16][256], unsigned char (*) [256], unsigned int (*) [16][256], bool, bool, int)':
/tmp/aes-whitebox/aes_whitebox_compiler.cc:90: undefined reference to `NTL::operator*(NTL::Mat<NTL::GF2> const&, NTL::Vec<NTL::GF2> const&)'
aes_whitebox_compiler.o: In function `(anonymous namespace)::CalculateTyBoxes(unsigned int*, unsigned int (*) [16][256], unsigned char (*) [256], unsigned int (*) [16][256], bool, bool, int)':
/usr/include/NTL/vec_GF2.h:43: undefined reference to `NTL::WordVector::~WordVector()'
/usr/include/NTL/vec_GF2.h:43: undefined reference to `NTL::WordVector::~WordVector()'
aes_whitebox_compiler.o: In function `(anonymous namespace)::CalculateTyBoxes(unsigned int*, unsigned int (*) [16][256], unsigned char (*) [256], unsigned int (*) [16][256], bool, bool, int)':
/tmp/aes-whitebox/aes_whitebox_compiler.cc:46: undefined reference to `NTL::Vec<NTL::GF2>::SetLength(long)'
aes_whitebox_compiler.o: In function `(anonymous namespace)::CalculateTyBoxes(unsigned int*, unsigned int (*) [16][256], unsigned char (*) [256], unsigned int (*) [16][256], bool, bool, int)':
/usr/include/NTL/vec_GF2.h:43: undefined reference to `NTL::WordVector::~WordVector()'
/usr/include/NTL/vec_GF2.h:43: undefined reference to `NTL::WordVector::~WordVector()'
aes_whitebox_compiler.o: In function `(anonymous namespace)::CalculateTyBoxes(unsigned int*, unsigned int (*) [16][256], unsigned char (*) [256], unsigned int (*) [16][256], bool, bool, int)':
/tmp/aes-whitebox/aes_whitebox_compiler.cc:90: undefined reference to `NTL::operator*(NTL::Mat<NTL::GF2> const&, NTL::Vec<NTL::GF2> const&)'
aes_whitebox_compiler.o: In function `(anonymous namespace)::CalculateTyBoxes(unsigned int*, unsigned int (*) [16][256], unsigned char (*) [256], unsigned int (*) [16][256], bool, bool, int)':
/usr/include/NTL/vec_GF2.h:43: undefined reference to `NTL::WordVector::~WordVector()'
/usr/include/NTL/vec_GF2.h:43: undefined reference to `NTL::WordVector::~WordVector()'
aes_whitebox_compiler.o: In function `(anonymous namespace)::CalculateTyBoxes(unsigned int*, unsigned int (*) [16][256], unsigned char (*) [256], unsigned int (*) [16][256], bool, bool, int)':
/tmp/aes-whitebox/aes_whitebox_compiler.cc:46: undefined reference to `NTL::Vec<NTL::GF2>::SetLength(long)'
aes_whitebox_compiler.o: In function `(anonymous namespace)::CalculateTyBoxes(unsigned int*, unsigned int (*) [16][256], unsigned char (*) [256], unsigned int (*) [16][256], bool, bool, int)':
/usr/include/NTL/vec_GF2.h:43: undefined reference to `NTL::WordVector::~WordVector()'
/usr/include/NTL/vec_GF2.h:43: undefined reference to `NTL::WordVector::~WordVector()'
aes_whitebox_compiler.o: In function `(anonymous namespace)::CalculateTyBoxes(unsigned int*, unsigned int (*) [16][256], unsigned char (*) [256], unsigned int (*) [16][256], bool, bool, int)':
/tmp/aes-whitebox/aes_whitebox_compiler.cc:90: undefined reference to `NTL::operator*(NTL::Mat<NTL::GF2> const&, NTL::Vec<NTL::GF2> const&)'
aes_whitebox_compiler.o: In function `(anonymous namespace)::CalculateTyBoxes(unsigned int*, unsigned int (*) [16][256], unsigned char (*) [256], unsigned int (*) [16][256], bool, bool, int)':
/usr/include/NTL/vec_GF2.h:43: undefined reference to `NTL::WordVector::~WordVector()'
/usr/include/NTL/vec_GF2.h:43: undefined reference to `NTL::WordVector::~WordVector()'
aes_whitebox_compiler.o: In function `(anonymous namespace)::CalculateTyBoxes(unsigned int*, unsigned int (*) [16][256], unsigned char (*) [256], unsigned int (*) [16][256], bool, bool, int)':
/tmp/aes-whitebox/aes_whitebox_compiler.cc:46: undefined reference to `NTL::Vec<NTL::GF2>::SetLength(long)'
aes_whitebox_compiler.o: In function `(anonymous namespace)::CalculateTyBoxes(unsigned int*, unsigned int (*) [16][256], unsigned char (*) [256], unsigned int (*) [16][256], bool, bool, int)':
/usr/include/NTL/vec_GF2.h:43: undefined reference to `NTL::WordVector::~WordVector()'
/usr/include/NTL/vec_GF2.h:43: undefined reference to `NTL::WordVector::~WordVector()'
aes_whitebox_compiler.o: In function `(anonymous namespace)::CalculateTyBoxes(unsigned int*, unsigned int (*) [16][256], unsigned char (*) [256], unsigned int (*) [16][256], bool, bool, int)':
/tmp/aes-whitebox/aes_whitebox_compiler.cc:90: undefined reference to `NTL::operator*(NTL::Mat<NTL::GF2> const&, NTL::Vec<NTL::GF2> const&)'
aes_whitebox_compiler.o: In function `(anonymous namespace)::CalculateTyBoxes(unsigned int*, unsigned int (*) [16][256], unsigned char (*) [256], unsigned int (*) [16][256], bool, bool, int)':
/usr/include/NTL/vec_GF2.h:43: undefined reference to `NTL::WordVector::~WordVector()'
/usr/include/NTL/vec_GF2.h:43: undefined reference to `NTL::WordVector::~WordVector()'
aes_whitebox_compiler.o: In function `(anonymous namespace)::CalculateTyBoxes(unsigned int*, unsigned int (*) [16][256], unsigned char (*) [256], unsigned int (*) [16][256], bool, bool, int)':
/tmp/aes-whitebox/aes_whitebox_compiler.cc:46: undefined reference to `NTL::Vec<NTL::GF2>::SetLength(long)'
aes_whitebox_compiler.o: In function `(anonymous namespace)::CalculateTyBoxes(unsigned int*, unsigned int (*) [16][256], unsigned char (*) [256], unsigned int (*) [16][256], bool, bool, int)':
/usr/include/NTL/vec_GF2.h:43: undefined reference to `NTL::WordVector::~WordVector()'
/usr/include/NTL/vec_GF2.h:43: undefined reference to `NTL::WordVector::~WordVector()'
aes_whitebox_compiler.o: In function `(anonymous namespace)::CalculateTyBoxes(unsigned int*, unsigned int (*) [16][256], unsigned char (*) [256], unsigned int (*) [16][256], bool, bool, int)':
/tmp/aes-whitebox/aes_whitebox_compiler.cc:90: undefined reference to `NTL::operator*(NTL::Mat<NTL::GF2> const&, NTL::Vec<NTL::GF2> const&)'
aes_whitebox_compiler.o: In function `(anonymous namespace)::CalculateTyBoxes(unsigned int*, unsigned int (*) [16][256], unsigned char (*) [256], unsigned int (*) [16][256], bool, bool, int)':
/usr/include/NTL/vec_GF2.h:43: undefined reference to `NTL::WordVector::~WordVector()'
/usr/include/NTL/vec_GF2.h:43: undefined reference to `NTL::WordVector::~WordVector()'
aes_whitebox_compiler.o: In function `(anonymous namespace)::CalculateTyBoxes(unsigned int*, unsigned int (*) [16][256], unsigned char (*) [256], unsigned int (*) [16][256], bool, bool, int)':
/tmp/aes-whitebox/aes_whitebox_compiler.cc:46: undefined reference to `NTL::Vec<NTL::GF2>::SetLength(long)'
aes_whitebox_compiler.o: In function `(anonymous namespace)::CalculateTyBoxes(unsigned int*, unsigned int (*) [16][256], unsigned char (*) [256], unsigned int (*) [16][256], bool, bool, int)':
/usr/include/NTL/vec_GF2.h:43: undefined reference to `NTL::WordVector::~WordVector()'
/usr/include/NTL/vec_GF2.h:43: undefined reference to `NTL::WordVector::~WordVector()'
aes_whitebox_compiler.o: In function `(anonymous namespace)::CalculateTyBoxes(unsigned int*, unsigned int (*) [16][256], unsigned char (*) [256], unsigned int (*) [16][256], bool, bool, int)':
/tmp/aes-whitebox/aes_whitebox_compiler.cc:90: undefined reference to `NTL::operator*(NTL::Mat<NTL::GF2> const&, NTL::Vec<NTL::GF2> const&)'
aes_whitebox_compiler.o: In function `(anonymous namespace)::CalculateTyBoxes(unsigned int*, unsigned int (*) [16][256], unsigned char (*) [256], unsigned int (*) [16][256], bool, bool, int)':
/usr/include/NTL/vec_GF2.h:43: undefined reference to `NTL::WordVector::~WordVector()'
/usr/include/NTL/vec_GF2.h:43: undefined reference to `NTL::WordVector::~WordVector()'
aes_whitebox_compiler.o: In function `(anonymous namespace)::CalculateTyBoxes(unsigned int*, unsigned int (*) [16][256], unsigned char (*) [256], unsigned int (*) [16][256], bool, bool, int)':
/tmp/aes-whitebox/aes_whitebox_compiler.cc:46: undefined reference to `NTL::Vec<NTL::GF2>::SetLength(long)'
aes_whitebox_compiler.o: In function `(anonymous namespace)::CalculateTyBoxes(unsigned int*, unsigned int (*) [16][256], unsigned char (*) [256], unsigned int (*) [16][256], bool, bool, int)':
/usr/include/NTL/vec_GF2.h:43: undefined reference to `NTL::WordVector::~WordVector()'
/usr/include/NTL/vec_GF2.h:43: undefined reference to `NTL::WordVector::~WordVector()'
aes_whitebox_compiler.o: In function `(anonymous namespace)::CalculateTyBoxes(unsigned int*, unsigned int (*) [16][256], unsigned char (*) [256], unsigned int (*) [16][256], bool, bool, int)':
/tmp/aes-whitebox/aes_whitebox_compiler.cc:90: undefined reference to `NTL::operator*(NTL::Mat<NTL::GF2> const&, NTL::Vec<NTL::GF2> const&)'
aes_whitebox_compiler.o: In function `(anonymous namespace)::CalculateTyBoxes(unsigned int*, unsigned int (*) [16][256], unsigned char (*) [256], unsigned int (*) [16][256], bool, bool, int)':
/usr/include/NTL/vec_GF2.h:43: undefined reference to `NTL::WordVector::~WordVector()'
/usr/include/NTL/vec_GF2.h:43: undefined reference to `NTL::WordVector::~WordVector()'
aes_whitebox_compiler.o: In function `(anonymous namespace)::CalculateTyBoxes(unsigned int*, unsigned int (*) [16][256], unsigned char (*) [256], unsigned int (*) [16][256], bool, bool, int)':
/tmp/aes-whitebox/aes_whitebox_compiler.cc:46: undefined reference to `NTL::Vec<NTL::GF2>::SetLength(long)'
aes_whitebox_compiler.o: In function `(anonymous namespace)::CalculateTyBoxes(unsigned int*, unsigned int (*) [16][256], unsigned char (*) [256], unsigned int (*) [16][256], bool, bool, int)':
/usr/include/NTL/vec_GF2.h:43: undefined reference to `NTL::WordVector::~WordVector()'
/usr/include/NTL/vec_GF2.h:43: undefined reference to `NTL::WordVector::~WordVector()'
aes_whitebox_compiler.o: In function `(anonymous namespace)::CalculateTyBoxes(unsigned int*, unsigned int (*) [16][256], unsigned char (*) [256], unsigned int (*) [16][256], bool, bool, int)':
/tmp/aes-whitebox/aes_whitebox_compiler.cc:90: undefined reference to `NTL::operator*(NTL::Mat<NTL::GF2> const&, NTL::Vec<NTL::GF2> const&)'
aes_whitebox_compiler.o: In function `(anonymous namespace)::CalculateTyBoxes(unsigned int*, unsigned int (*) [16][256], unsigned char (*) [256], unsigned int (*) [16][256], bool, bool, int)':
/usr/include/NTL/vec_GF2.h:43: undefined reference to `NTL::WordVector::~WordVector()'
/usr/include/NTL/vec_GF2.h:43: undefined reference to `NTL::WordVector::~WordVector()'
aes_whitebox_compiler.o: In function `(anonymous namespace)::CalculateTyBoxes(unsigned int*, unsigned int (*) [16][256], unsigned char (*) [256], unsigned int (*) [16][256], bool, bool, int)':
/tmp/aes-whitebox/aes_whitebox_compiler.cc:46: undefined reference to `NTL::Vec<NTL::GF2>::SetLength(long)'
aes_whitebox_compiler.o: In function `(anonymous namespace)::CalculateTyBoxes(unsigned int*, unsigned int (*) [16][256], unsigned char (*) [256], unsigned int (*) [16][256], bool, bool, int)':
/usr/include/NTL/vec_GF2.h:43: undefined reference to `NTL::WordVector::~WordVector()'
/usr/include/NTL/vec_GF2.h:43: undefined reference to `NTL::WordVector::~WordVector()'
aes_whitebox_compiler.o: In function `(anonymous namespace)::CalculateTyBoxes(unsigned int*, unsigned int (*) [16][256], unsigned char (*) [256], unsigned int (*) [16][256], bool, bool, int)':
/tmp/aes-whitebox/aes_whitebox_compiler.cc:90: undefined reference to `NTL::operator*(NTL::Mat<NTL::GF2> const&, NTL::Vec<NTL::GF2> const&)'
aes_whitebox_compiler.o: In function `(anonymous namespace)::CalculateTyBoxes(unsigned int*, unsigned int (*) [16][256], unsigned char (*) [256], unsigned int (*) [16][256], bool, bool, int)':
/usr/include/NTL/vec_GF2.h:43: undefined reference to `NTL::WordVector::~WordVector()'
/usr/include/NTL/vec_GF2.h:43: undefined reference to `NTL::WordVector::~WordVector()'
aes_whitebox_compiler.o: In function `(anonymous namespace)::CalculateTyBoxes(unsigned int*, unsigned int (*) [16][256], unsigned char (*) [256], unsigned int (*) [16][256], bool, bool, int)':
/tmp/aes-whitebox/aes_whitebox_compiler.cc:46: undefined reference to `NTL::Vec<NTL::GF2>::SetLength(long)'
aes_whitebox_compiler.o: In function `(anonymous namespace)::CalculateTyBoxes(unsigned int*, unsigned int (*) [16][256], unsigned char (*) [256], unsigned int (*) [16][256], bool, bool, int)':
/usr/include/NTL/vec_GF2.h:43: undefined reference to `NTL::WordVector::~WordVector()'
/usr/include/NTL/vec_GF2.h:43: undefined reference to `NTL::WordVector::~WordVector()'
aes_whitebox_compiler.o: In function `(anonymous namespace)::CalculateTyBoxes(unsigned int*, unsigned int (*) [16][256], unsigned char (*) [256], unsigned int (*) [16][256], bool, bool, int)':
/tmp/aes-whitebox/aes_whitebox_compiler.cc:90: undefined reference to `NTL::operator*(NTL::Mat<NTL::GF2> const&, NTL::Vec<NTL::GF2> const&)'
aes_whitebox_compiler.o: In function `(anonymous namespace)::CalculateTyBoxes(unsigned int*, unsigned int (*) [16][256], unsigned char (*) [256], unsigned int (*) [16][256], bool, bool, int)':
/usr/include/NTL/vec_GF2.h:43: undefined reference to `NTL::WordVector::~WordVector()'
/usr/include/NTL/vec_GF2.h:43: undefined reference to `NTL::WordVector::~WordVector()'
aes_whitebox_compiler.o: In function `(anonymous namespace)::CalculateTyBoxes(unsigned int*, unsigned int (*) [16][256], unsigned char (*) [256], unsigned int (*) [16][256], bool, bool, int)':
/tmp/aes-whitebox/aes_whitebox_compiler.cc:46: undefined reference to `NTL::Vec<NTL::GF2>::SetLength(long)'
aes_whitebox_compiler.o: In function `(anonymous namespace)::CalculateTyBoxes(unsigned int*, unsigned int (*) [16][256], unsigned char (*) [256], unsigned int (*) [16][256], bool, bool, int)':
/usr/include/NTL/vec_GF2.h:43: undefined reference to `NTL::WordVector::~WordVector()'
/usr/include/NTL/vec_GF2.h:43: undefined reference to `NTL::WordVector::~WordVector()'
aes_whitebox_compiler.o: In function `(anonymous namespace)::CalculateTyBoxes(unsigned int*, unsigned int (*) [16][256], unsigned char (*) [256], unsigned int (*) [16][256], bool, bool, int)':
/tmp/aes-whitebox/aes_whitebox_compiler.cc:90: undefined reference to `NTL::operator*(NTL::Mat<NTL::GF2> const&, NTL::Vec<NTL::GF2> const&)'
aes_whitebox_compiler.o: In function `(anonymous namespace)::CalculateTyBoxes(unsigned int*, unsigned int (*) [16][256], unsigned char (*) [256], unsigned int (*) [16][256], bool, bool, int)':
/usr/include/NTL/vec_GF2.h:43: undefined reference to `NTL::WordVector::~WordVector()'
/usr/include/NTL/vec_GF2.h:43: undefined reference to `NTL::WordVector::~WordVector()'
aes_whitebox_compiler.o: In function `(anonymous namespace)::CalculateTyBoxes(unsigned int*, unsigned int (*) [16][256], unsigned char (*) [256], unsigned int (*) [16][256], bool, bool, int)':
/tmp/aes-whitebox/aes_whitebox_compiler.cc:46: undefined reference to `NTL::Vec<NTL::GF2>::SetLength(long)'
aes_whitebox_compiler.o: In function `(anonymous namespace)::CalculateTyBoxes(unsigned int*, unsigned int (*) [16][256], unsigned char (*) [256], unsigned int (*) [16][256], bool, bool, int)':
/usr/include/NTL/vec_GF2.h:43: undefined reference to `NTL::WordVector::~WordVector()'
/usr/include/NTL/vec_GF2.h:43: undefined reference to `NTL::WordVector::~WordVector()'
aes_whitebox_compiler.o: In function `(anonymous namespace)::CalculateTyBoxes(unsigned int*, unsigned int (*) [16][256], unsigned char (*) [256], unsigned int (*) [16][256], bool, bool, int)':
/tmp/aes-whitebox/aes_whitebox_compiler.cc:90: undefined reference to `NTL::operator*(NTL::Mat<NTL::GF2> const&, NTL::Vec<NTL::GF2> const&)'
aes_whitebox_compiler.o: In function `(anonymous namespace)::CalculateTyBoxes(unsigned int*, unsigned int (*) [16][256], unsigned char (*) [256], unsigned int (*) [16][256], bool, bool, int)':
/usr/include/NTL/vec_GF2.h:43: undefined reference to `NTL::WordVector::~WordVector()'
/usr/include/NTL/vec_GF2.h:43: undefined reference to `NTL::WordVector::~WordVector()'
aes_whitebox_compiler.o: In function `(anonymous namespace)::CalculateTyBoxes(unsigned int*, unsigned int (*) [16][256], unsigned char (*) [256], unsigned int (*) [16][256], bool, bool, int)':
/tmp/aes-whitebox/aes_whitebox_compiler.cc:46: undefined reference to `NTL::Vec<NTL::GF2>::SetLength(long)'
aes_whitebox_compiler.o: In function `(anonymous namespace)::CalculateTyBoxes(unsigned int*, unsigned int (*) [16][256], unsigned char (*) [256], unsigned int (*) [16][256], bool, bool, int)':
/usr/include/NTL/vec_GF2.h:43: undefined reference to `NTL::WordVector::~WordVector()'
/usr/include/NTL/vec_GF2.h:43: undefined reference to `NTL::WordVector::~WordVector()'
aes_whitebox_compiler.o: In function `(anonymous namespace)::CalculateTyBoxes(unsigned int*, unsigned int (*) [16][256], unsigned char (*) [256], unsigned int (*) [16][256], bool, bool, int)':
/tmp/aes-whitebox/aes_whitebox_compiler.cc:90: undefined reference to `NTL::operator*(NTL::Mat<NTL::GF2> const&, NTL::Vec<NTL::GF2> const&)'
aes_whitebox_compiler.o: In function `(anonymous namespace)::CalculateTyBoxes(unsigned int*, unsigned int (*) [16][256], unsigned char (*) [256], unsigned int (*) [16][256], bool, bool, int)':
/usr/include/NTL/vec_GF2.h:43: undefined reference to `NTL::WordVector::~WordVector()'
/usr/include/NTL/vec_GF2.h:43: undefined reference to `NTL::WordVector::~WordVector()'
aes_whitebox_compiler.o: In function `(anonymous namespace)::CalculateTyBoxes(unsigned int*, unsigned int (*) [16][256], unsigned char (*) [256], unsigned int (*) [16][256], bool, bool, int)':
/tmp/aes-whitebox/aes_whitebox_compiler.cc:46: undefined reference to `NTL::Vec<NTL::GF2>::SetLength(long)'
aes_whitebox_compiler.o: In function `(anonymous namespace)::CalculateTyBoxes(unsigned int*, unsigned int (*) [16][256], unsigned char (*) [256], unsigned int (*) [16][256], bool, bool, int)':
/usr/include/NTL/vec_GF2.h:43: undefined reference to `NTL::WordVector::~WordVector()'
/usr/include/NTL/vec_GF2.h:43: undefined reference to `NTL::WordVector::~WordVector()'
aes_whitebox_compiler.o: In function `(anonymous namespace)::CalculateTyBoxes(unsigned int*, unsigned int (*) [16][256], unsigned char (*) [256], unsigned int (*) [16][256], bool, bool, int)':
/tmp/aes-whitebox/aes_whitebox_compiler.cc:90: undefined reference to `NTL::operator*(NTL::Mat<NTL::GF2> const&, NTL::Vec<NTL::GF2> const&)'
aes_whitebox_compiler.o: In function `(anonymous namespace)::CalculateTyBoxes(unsigned int*, unsigned int (*) [16][256], unsigned char (*) [256], unsigned int (*) [16][256], bool, bool, int)':
/usr/include/NTL/vec_GF2.h:43: undefined reference to `NTL::WordVector::~WordVector()'
/usr/include/NTL/vec_GF2.h:43: undefined reference to `NTL::WordVector::~WordVector()'
aes_whitebox_compiler.o: In function `(anonymous namespace)::CalculateTyBoxes(unsigned int*, unsigned int (*) [16][256], unsigned char (*) [256], unsigned int (*) [16][256], bool, bool, int)':
/tmp/aes-whitebox/aes_whitebox_compiler.cc:46: undefined reference to `NTL::Vec<NTL::GF2>::SetLength(long)'
aes_whitebox_compiler.o: In function `(anonymous namespace)::CalculateTyBoxes(unsigned int*, unsigned int (*) [16][256], unsigned char (*) [256], unsigned int (*) [16][256], bool, bool, int)':
/usr/include/NTL/vec_GF2.h:43: undefined reference to `NTL::WordVector::~WordVector()'
/usr/include/NTL/vec_GF2.h:43: undefined reference to `NTL::WordVector::~WordVector()'
aes_whitebox_compiler.o: In function `(anonymous namespace)::CalculateTyBoxes(unsigned int*, unsigned int (*) [16][256], unsigned char (*) [256], unsigned int (*) [16][256], bool, bool, int)':
/tmp/aes-whitebox/aes_whitebox_compiler.cc:90: undefined reference to `NTL::operator*(NTL::Mat<NTL::GF2> const&, NTL::Vec<NTL::GF2> const&)'
aes_whitebox_compiler.o: In function `(anonymous namespace)::CalculateTyBoxes(unsigned int*, unsigned int (*) [16][256], unsigned char (*) [256], unsigned int (*) [16][256], bool, bool, int)':
/usr/include/NTL/vec_GF2.h:43: undefined reference to `NTL::WordVector::~WordVector()'
/usr/include/NTL/vec_GF2.h:43: undefined reference to `NTL::WordVector::~WordVector()'
aes_whitebox_compiler.o: In function `(anonymous namespace)::CalculateTyBoxes(unsigned int*, unsigned int (*) [16][256], unsigned char (*) [256], unsigned int (*) [16][256], bool, bool, int)':
/tmp/aes-whitebox/aes_whitebox_compiler.cc:46: undefined reference to `NTL::Vec<NTL::GF2>::SetLength(long)'
aes_whitebox_compiler.o: In function `(anonymous namespace)::CalculateTyBoxes(unsigned int*, unsigned int (*) [16][256], unsigned char (*) [256], unsigned int (*) [16][256], bool, bool, int)':
/usr/include/NTL/vec_GF2.h:43: undefined reference to `NTL::WordVector::~WordVector()'
aes_whitebox_compiler.o: In function `(anonymous namespace)::CalculateTyBoxes(unsigned int*, unsigned int (*) [16][256], unsigned char (*) [256], unsigned int (*) [16][256], bool, bool, int)':
/tmp/aes-whitebox/aes_whitebox_compiler.cc:46: undefined reference to `NTL::Vec<NTL::GF2>::SetLength(long)'
aes_whitebox_compiler.o: In function `(anonymous namespace)::CalculateTyBoxes(unsigned int*, unsigned int (*) [16][256], unsigned char (*) [256], unsigned int (*) [16][256], bool, bool, int)':
/usr/include/NTL/vec_GF2.h:43: undefined reference to `NTL::WordVector::~WordVector()'
aes_whitebox_compiler.o: In function `(anonymous namespace)::CalculateTyBoxes(unsigned int*, unsigned int (*) [16][256], unsigned char (*) [256], unsigned int (*) [16][256], bool, bool, int)':
/tmp/aes-whitebox/aes_whitebox_compiler.cc:90: undefined reference to `NTL::operator*(NTL::Mat<NTL::GF2> const&, NTL::Vec<NTL::GF2> const&)'
aes_whitebox_compiler.o: In function `(anonymous namespace)::CalculateTyBoxes(unsigned int*, unsigned int (*) [16][256], unsigned char (*) [256], unsigned int (*) [16][256], bool, bool, int)':
/usr/include/NTL/vec_GF2.h:43: undefined reference to `NTL::WordVector::~WordVector()'
/usr/include/NTL/vec_GF2.h:43: undefined reference to `NTL::WordVector::~WordVector()'
aes_whitebox_compiler.o: In function `(anonymous namespace)::CalculateTyBoxes(unsigned int*, unsigned int (*) [16][256], unsigned char (*) [256], unsigned int (*) [16][256], bool, bool, int)':
/usr/include/NTL/mat_GF2.h:73: undefined reference to `NTL::inv(NTL::Mat<NTL::GF2>&, NTL::Mat<NTL::GF2> const&)'
aes_whitebox_compiler.o: In function `(anonymous namespace)::CalculateTyBoxes(unsigned int*, unsigned int (*) [16][256], unsigned char (*) [256], unsigned int (*) [16][256], bool, bool, int)':
/usr/include/NTL/vec_GF2.h:43: undefined reference to `NTL::WordVector::~WordVector()'
aes_whitebox_compiler.o: In function `NTL::Vec<NTL::Vec<NTL::GF2> >::swap(NTL::Vec<NTL::Vec<NTL::GF2> >&)':
/usr/include/NTL/tools.h:561: undefined reference to `NTL::TerminalError(char const*)'
aes_whitebox_compiler.o: In function `NTL::Vec<NTL::Vec<NTL::GF2> >::ReAllocate(long, NTL::VecStrategy<true>)':
/usr/include/NTL/tools.h:559: undefined reference to `NTL::TerminalError(char const*)'
aes_whitebox_compiler.o: In function `NTL::Vec<NTL::Vec<NTL::GF2> >::AllocateTo(long)':
/usr/include/NTL/tools.h:561: undefined reference to `NTL::TerminalError(char const*)'
/usr/include/NTL/tools.h:561: undefined reference to `NTL::TerminalError(char const*)'
/usr/include/NTL/tools.h:564: undefined reference to `NTL::TerminalError(char const*)'
aes_whitebox_compiler.o:/usr/include/NTL/tools.h:559: more undefined references to `NTL::TerminalError(char const*)' follow
aes_whitebox_compiler.o: In function `void NTL::default_BlockDestroy<NTL::Vec<NTL::GF2> >(NTL::Vec<NTL::GF2>*, long)':
/usr/include/NTL/vec_GF2.h:43: undefined reference to `NTL::WordVector::~WordVector()'
aes_whitebox_compiler.o: In function `void NTL::default_BlockConstructFromVec<NTL::Vec<NTL::GF2> >(NTL::Vec<NTL::GF2>*, long, NTL::Vec<NTL::GF2> const*)':
/usr/include/NTL/vec_GF2.h:39: undefined reference to `NTL::WordVector::~WordVector()'
aes_whitebox_compiler.o: In function `void NTL::default_BlockConstructFromVec<NTL::Vec<NTL::GF2> >(NTL::Vec<NTL::GF2>*, long, NTL::Vec<NTL::GF2> const*)':
/usr/include/NTL/tools.h:627: undefined reference to `NTL::TerminalError(char const*)'
aes_whitebox_compiler.o: In function `void NTL::default_BlockConstructFromVec<NTL::Vec<NTL::GF2> >(NTL::Vec<NTL::GF2>*, long, NTL::Vec<NTL::GF2> const*)':
/usr/include/NTL/vec_GF2.h:39: undefined reference to `NTL::Vec<NTL::GF2>::operator=(NTL::Vec<NTL::GF2> const&)'
aes_whitebox_compiler.o: In function `NTL::Mat<NTL::GF2>::Mat(NTL::Mat<NTL::GF2> const&)':
/usr/include/NTL/matrix.h:123: undefined reference to `NTL::Vec<NTL::GF2>::FixAtCurrentLength()'
aes_whitebox_compiler.o: In function `NTL::Vec<NTL::Vec<NTL::GF2> >::operator=(NTL::Vec<NTL::Vec<NTL::GF2> > const&)':
/usr/include/NTL/vector.h:810: undefined reference to `NTL::Vec<NTL::GF2>::operator=(NTL::Vec<NTL::GF2> const&)'
/usr/include/NTL/vector.h:816: undefined reference to `NTL::Vec<NTL::GF2>::operator=(NTL::Vec<NTL::GF2> const&)'
aes_whitebox_compiler.o: In function `void NTL::Vec<NTL::Vec<NTL::GF2> >::InitAndApply<NTL::Mat<NTL::GF2>::Fixer>(long, NTL::Mat<NTL::GF2>::Fixer&)':
/usr/include/NTL/matrix.h:21: undefined reference to `NTL::Vec<NTL::GF2>::FixLength(long)'
aes_whitebox_compiler.o: In function `void NTL::Vec<NTL::Vec<NTL::GF2> >::InitAndApply<NTL::Mat<NTL::GF2>::Fixer>(long, NTL::Mat<NTL::GF2>::Fixer&)':
/usr/include/NTL/tools.h:627: undefined reference to `NTL::TerminalError(char const*)'
aes_whitebox_compiler.o: In function `NTL::Mat<NTL::GF2>::SetDims(long, long)':
/usr/include/NTL/tools.h:561: undefined reference to `NTL::TerminalError(char const*)'
aes_whitebox_compiler.o: In function `NTL::Mat<NTL::GF2>::operator=(NTL::Mat<NTL::GF2> const&)':
/usr/include/NTL/matrix.h:146: undefined reference to `NTL::Vec<NTL::GF2>::FixAtCurrentLength()'
collect2: error: ld returned 1 exit status
Makefile:47: recipe for target 'aes_whitebox_compiler' failed
make: *** [aes_whitebox_compiler] Error 1
Hi,thank you for sharing this project.
I have a question about ECB and CBC.
As I know, OFB / CFB / CTR do Ciper with IV/nonce first, then XOR with original input, so encryption and decryption can be the same way.
But for ECB and CBC, the table in this project only support encryption I think, is that right ?
So if I want to make it support ECB and CBC, I should make decrypt_table or just make new Cipher method?
https://github.com/balena/aes-whitebox/blob/master/aes_whitebox_compiler.cc#L11
https://github.com/balena/aes-whitebox/blob/master/aes_whitebox.cc#L7
https://github.com/balena/aes-whitebox/blob/master/aes_whitebox.cc#L41
https://github.com/balena/aes-whitebox/blob/master/aes_whitebox.cc#L105
Please fix
I have a question.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.