Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
python-cellframe
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Code
Merge requests
3
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
cellframe
python-cellframe
Commits
7358091f
Commit
7358091f
authored
5 years ago
by
alexey.stratulat
Browse files
Options
Downloads
Patches
Plain Diff
[*] Changed, hiring, that everything would be done in the same style.
parent
6a95628f
No related branches found
No related tags found
1 merge request
!26
Support 3689
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
include/libdap-crypto-python.h
+4
-4
4 additions, 4 deletions
include/libdap-crypto-python.h
test/test.py
+4
-4
4 additions, 4 deletions
test/test.py
with
8 additions
and
8 deletions
include/libdap-crypto-python.h
+
4
−
4
View file @
7358091f
...
...
@@ -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
_b
ase58"
,
dap_encode_base58_py
,
METH_VARARGS
,
"Encrypts information using the base58 algorithm from the DAP crypto library"
},
{
"decode
_b
ase58"
,
dap_decode_base58_py
,
METH_VARARGS
,
"Dencrypts information using the base58 algorithm from the DAP crypto library"
},
{
"encode
_b
ase64"
,
dap_encode_base64_py
,
METH_VARARGS
,
"Encrypts information using the base64 algorithm from the DAP crypto library"
},
{
"decode
_b
ase64"
,
dap_decode_base64_py
,
METH_VARARGS
,
"Dencrypts information using the base64 algorithm from the DAP crypto library"
},
{
"encode
B
ase58"
,
dap_encode_base58_py
,
METH_VARARGS
,
"Encrypts information using the base58 algorithm from the DAP crypto library"
},
{
"decode
B
ase58"
,
dap_decode_base58_py
,
METH_VARARGS
,
"Dencrypts information using the base58 algorithm from the DAP crypto library"
},
{
"encode
B
ase64"
,
dap_encode_base64_py
,
METH_VARARGS
,
"Encrypts information using the base64 algorithm from the DAP crypto library"
},
{
"decode
B
ase64"
,
dap_decode_base64_py
,
METH_VARARGS
,
"Dencrypts information using the base64 algorithm from the DAP crypto library"
},
{
NULL
,
NULL
,
0
,
NULL
}
};
...
...
This diff is collapsed.
Click to expand it.
test/test.py
+
4
−
4
View file @
7358091f
...
...
@@ -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
_b
ase58
(
s
)
decrypt
=
crypto
.
decode
_b
ase58
(
crypt
)
crypt
=
crypto
.
encode
B
ase58
(
s
)
decrypt
=
crypto
.
decode
B
ase58
(
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
_b
ase64
(
s
)
decrypt
=
crypto
.
decode
_b
ase64
(
crypt
,
len
(
s
))
crypt
=
crypto
.
encode
B
ase64
(
s
)
decrypt
=
crypto
.
decode
B
ase64
(
crypt
,
len
(
s
))
self
.
assertTrue
(
s
==
decrypt
,
"
Encoding and decoded information using the base64 algorithm does not match the original
"
)
if
__name__
==
'
__main__
'
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment