implemented generate_signature, added test in main.cpp