the-lambda-way / bruteforce-enigma

A tool for cracking and bruteforcing Enigma ciphers.
MIT License
19 stars 3 forks source link

Build errors #1

Closed Dreamoochy closed 1 year ago

Dreamoochy commented 1 year ago

In the Readme.md, section Cracking unknown ring and rotor positions, there's a code

EnigmaBase base {ETW_ABCDEF, m3_IV, m3_V, m3_II, UKWB};

HighScores scores = smart_decipher(base, plug, ct);

But UKWB is undefined. It seems m3_UKVB should be used instead. And when compiling, I get the following errors:

.../include/bruteforce-enigma.h:352:66: error: no matching function for call to 'smart_decipher_positions<std::vector<int, std::allocator<int> >, 10, double (*)(const std::vector<int, std::allocator<int> >&)>(const basic_enigma_base<EnigmaKey>&, const Plugboard&, const std::vector<int>&, double (*&)(const std::vector<int>&))'
...
.../include/bruteforce-enigma.h:354:7: error: could not convert '{ct, <expression error>}' from '<brace-enclosed initializer list>' to 'HighScores<10, EnigmaKey>'

I'm compiling under Windows with TDM-GCC-64 (g++ v10.3.0). Sorry, I'm almost total zero in C++. What should I do to fix errors?

the-lambda-way commented 1 year ago

Fixed. I will add test coverage for this sometime next week. Thanks.

the-lambda-way commented 1 year ago

The same typo occurs in the section Bruteforcing unknown ring and rotor positions. I will update that as well when I handle the tests.