Skip to content
Snippets Groups Projects
Commit 7358091f authored by alexey.stratulat's avatar alexey.stratulat
Browse files

[*] Changed, hiring, that everything would be done in the same style.

parent 6a95628f
No related branches found
No related tags found
1 merge request!26Support 3689
......@@ -21,10 +21,10 @@ static PyObject *dap_crypto_deinit();
static PyMethodDef DapCryptoMethods[] = {
{"init", dap_crypto_init, METH_VARARGS, "Initialization of the DAP (Deus Applicaions Prototypes) crypto library"},
{"deinit", dap_crypto_deinit, METH_NOARGS, "Deinitialization of the DAP (Deus Applicaions Prototypes) crypto library"},
{"encode_base58", dap_encode_base58_py, METH_VARARGS, "Encrypts information using the base58 algorithm from the DAP crypto library"},
{"decode_base58", dap_decode_base58_py, METH_VARARGS, "Dencrypts information using the base58 algorithm from the DAP crypto library"},
{"encode_base64", dap_encode_base64_py, METH_VARARGS, "Encrypts information using the base64 algorithm from the DAP crypto library"},
{"decode_base64", dap_decode_base64_py, METH_VARARGS, "Dencrypts information using the base64 algorithm from the DAP crypto library"},
{"encodeBase58", dap_encode_base58_py, METH_VARARGS, "Encrypts information using the base58 algorithm from the DAP crypto library"},
{"decodeBase58", dap_decode_base58_py, METH_VARARGS, "Dencrypts information using the base58 algorithm from the DAP crypto library"},
{"encodeBase64", dap_encode_base64_py, METH_VARARGS, "Encrypts information using the base64 algorithm from the DAP crypto library"},
{"decodeBase64", dap_decode_base64_py, METH_VARARGS, "Dencrypts information using the base64 algorithm from the DAP crypto library"},
{NULL, NULL, 0, NULL}
};
......
......@@ -8,13 +8,13 @@ class TestLibdapCryptoPythonModule(unittest.TestCase):
self.assertTrue(crypto.deinit() == 0, "Failed deinit libdap crypto python")
def test_b58(self):
s = "REvgshguqwt76thuioh1`lwi0-8i-d0hjwpeocnpgh89efty7ug"
crypt = crypto.encode_base58(s)
decrypt = crypto.decode_base58(crypt)
crypt = crypto.encodeBase58(s)
decrypt = crypto.decodeBase58(crypt)
self.assertTrue(s == decrypt, "Encoding and decoded information using the base58 algorithm does not match the original")
def test_b64(self):
s = "LindyfekrngFHJFGR23356fer"
crypt = crypto.encode_base64(s)
decrypt = crypto.decode_base64(crypt, len(s))
crypt = crypto.encodeBase64(s)
decrypt = crypto.decodeBase64(crypt, len(s))
self.assertTrue(s == decrypt, "Encoding and decoded information using the base64 algorithm does not match the original")
if __name__ == '__main__':
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment