//+------------------------------------------------------------------+ //| EA.mq5 | //| Copyright 2026, Niquel Mendoza | //| https://www.mql5.com | //+------------------------------------------------------------------+ #property copyright "Copyright 2026, Niquel Mendoza" #property link "https://www.mql5.com" #property version "1.00" #property strict //+------------------------------------------------------------------+ //| | //+------------------------------------------------------------------+ #define TSN_MQLCI_INLINE_TEST //+------------------------------------------------------------------+ //| | //+------------------------------------------------------------------+ #include "TestNistVectors.mqh" //--- MQLARTICLES_STRUCTBYTES_CRE(SHA3_256_OUT_BSIZE) MQLARTICLES_STRUCTBYTES_CRE(SHA3_512_OUT_BSIZE) MQLARTICLES_STRUCTBYTES_CRE(SHA3_384_OUT_BSIZE) //--- MQLARTICLES_STRUCTBYTES_CRE(CRYPTOBYLEO_SHA512_SIZET_FHASH) MQLARTICLES_STRUCTBYTES_CRE(CRYPTOBYLEO_SHA512_224_SIZET_FHASH) MQLARTICLES_STRUCTBYTES_CRE(CRYPTOBYLEO_SHA512_256_SIZET_FHASH) MQLARTICLES_STRUCTBYTES_CRE(CRYPTOBYLEO_SHA384_SIZET_FHASH) //+------------------------------------------------------------------+ //| Inputs | //+------------------------------------------------------------------+ input long InpCharId = 0; input string InpTestName = "CryptoByLeo - Full Suite"; //+------------------------------------------------------------------+ //| Expert initialization function | //+------------------------------------------------------------------+ int OnInit() { //--- TSN::CiTestUtil util; util.AddLogFlags(LOG_ALL); util.TestSize(13); //--- int i = 0; //--- SHA2 util.SetTestPtr(i++, new TSN::CTestNistVectors_SHA( "SHA2-256 Test NIST Vectors", TSN::g_rsptestvector_sha2_256_fn, TSN::CCryptoHash::SHA256)); util.SetTestPtr(i++, new TSN::CTestNistVectors_SHA( "SHA2-384 Test NIST Vectors", TSN::g_rsptestvector_sha2_384_fn, TSN::CCryptoHash::SHA384)); util.SetTestPtr(i++, new TSN::CTestNistVectors_SHA( "SHA2-512 Test NIST Vectors", TSN::g_rsptestvector_sha2_512_fn, TSN::CCryptoHash::SHA512)); util.SetTestPtr(i++, new TSN::CTestNistVectors_SHA( "SHA2-512/224 Test NIST Vectors", TSN::g_rsptestvector_sha2_512_224_fn, TSN::CCryptoHash::SHA512_224)); util.SetTestPtr(i++, new TSN::CTestNistVectors_SHA( "SHA2-512/256 Test NIST Vectors", TSN::g_rsptestvector_sha2_512_256_fn, TSN::CCryptoHash::SHA512_256)); //--- SHA3 util.SetTestPtr(i++, new TSN::CTestNistVectors_SHA( "SHA3-256 Test NIST Vectors", TSN::g_rsptestvector_sha3_256_fn, TSN::CCryptoHashSHA3::SHA3_256)); util.SetTestPtr(i++, new TSN::CTestNistVectors_SHA( "SHA3-384 Test NIST Vectors", TSN::g_rsptestvector_sha3_384_fn, TSN::CCryptoHashSHA3::SHA3_384)); util.SetTestPtr(i++, new TSN::CTestNistVectors_SHA( "SHA3-512 Test NIST Vectors", TSN::g_rsptestvector_sha3_512_fn, TSN::CCryptoHashSHA3::SHA3_512)); //--- BLAKE2 util.SetTestPtr(i++, new TSN::CTest_BLAKE2()); //--- AES ECB util.SetTestPtr(i++, new TSN::CTest_AES_ECB(TSN::g_rsptestvector_aes_ecb_128, "AES-128 ECB Test NIST Vectors", TSN::AES_CRYPTH_128)); util.SetTestPtr(i++, new TSN::CTest_AES_ECB(TSN::g_rsptestvector_aes_ecb_256, "AES-256 ECB Test NIST Vectors", TSN::AES_CRYPTH_256)); //--- AES CBC util.SetTestPtr(i++, new TSN::CTest_AES_CBC(TSN::g_rsptestvector_aes_cbc_128, "AES-128 CBC Test NIST Vectors", TSN::AES_CRYPTH_128)); util.SetTestPtr(i++, new TSN::CTest_AES_CBC(TSN::g_rsptestvector_aes_cbc_256, "AES-256 CBC Test NIST Vectors", TSN::AES_CRYPTH_256)); //--- if(i != 13) { #ifdef TSN_MQLCI_INLINE_TEST PrintFormat("ERROR: se instanciaron %d tests, esperado 13 (revisar Test.mq5)", i); return INIT_FAILED; #else TSN_MQLCI_INLINE_TEST ::EventChartCustom(m_chart_id, CIBYLEO_ONEVENT_RES, CYBYLEO_CODE_ERROR, 0.00, m_test_name); return CIBYLEO_ONINIT_FINISH; #endif // TSN_MQLCI_INLINE_TEST } //--- (chart_id, min_importance_for_early_exit, label, min_percentage_to_pass) util.Init(InpCharId, 70, InpTestName, 90.0); #ifdef TSN_MQLCI_INLINE_TEST if(!util.RunAllTestAndSend()) { FastLog(FUNCION_ACTUAL, FATAL_ERROR_TEXT, InpTestName); return CIBYLEO_ONINIT_FINISH; } #else util.RunAllTestAndSend(); #endif //TSN_MQLCI_INLINE_TEST //--- return CIBYLEO_ONINIT_FINISH; return(INIT_SUCCEEDED); } //+------------------------------------------------------------------+ //| Expert deinitialization function | //+------------------------------------------------------------------+ void OnDeinit(const int reason) { //--- } //+------------------------------------------------------------------+ //| Expert tick function | //+------------------------------------------------------------------+ void OnTick() { //--- } //+------------------------------------------------------------------+