peigen-sboxes / PEIGEN

An open source project for study S-boxes
GNU General Public License v3.0
37 stars 19 forks source link

Compiling Errors #10

Closed thangvu97 closed 2 years ago

thangvu97 commented 2 years ago

Hello, i have this error while trying to compline code

#include <iostream>
#include "func.hpp"
using namespace Peigen;
using std::cout;
using std::endl;

int main(int argc, char** argv) {
    auto SboxLUTstr = "0c05060b09000a0d030e0f0804070102";
    Peigen::function_t<4> S(SboxLUTstr);
    cout << "ANF: " << S.show_coordinates_ANF() << endl;
    cout << "DDT: " << S.show_difference_distribution_matrix() << endl;
}

I got this error:

  330 | const array<int, N+1> HWorder_off = [&]
      |                                      ^
constants.hpp:342:35: error: non-local lambda expression cannot have a capture-default
  342 | const array<int, 1<<N> HWorder = [&]
      |                                   ^
constants.hpp: In member function ‘void OPs_t<N>::gen_subspaces(std::vector<std::vector<std::vector<unsigned char> > >&)’:
constants.hpp:666:4: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation]
  666 |    for (int i=0; i<=(N0-M0); i++) A0[i] = 0; for (int i=N0-M0+1; i<=N0; i++) A0[i] = 1;
      |    ^~~
constants.hpp:666:46: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’
  666 |    for (int i=0; i<=(N0-M0); i++) A0[i] = 0; for (int i=N0-M0+1; i<=N0; i++) A0[i] = 1;
      |                                              ^~~
constants.hpp: At global scope:
constants.hpp:1092:50: error: non-local lambda expression cannot have a capture-default
 1092 | const array<Peigen::function_t<N>, (1<<N)> XE = [&]
      |                                                  ^
constants.hpp:1109:31: error: non-local lambda expression cannot have a capture-default
 1109 | const bit_slice_t<N> masks = [&]
      |                               ^
In file included from faster_func.hpp:41,
                 from faster.hpp:41,
                 from test.cpp:2:
constants.hpp:1139:64: error: non-local lambda expression cannot have a capture-default
 1139 | const map<array<uint8_t, LUT_UNIT_N>, LExinfoGx_t<N> > G_Rs = [&]
      |                                                                ^
In file included from constants.hpp:1196,
                 from faster_func.hpp:41,
                 from faster.hpp:41,
                 from test.cpp:2:
subspaces.hpp:54:54: error: non-local lambda expression cannot have a capture-default
   54 | const vector<vector<vector<uint8_t> > > SubSpaces = [&]
thangvu97 commented 2 years ago

I got the code to work, but how can i find the non-linearity or linearity of an S-box? Thank you very much!