Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • cellframe/libdap-crypto-python
1 result
Show changes
...@@ -7,20 +7,20 @@ ...@@ -7,20 +7,20 @@
* Copyright (c) 2017-2020 * Copyright (c) 2017-2020
* All rights reserved. * All rights reserved.
This file is part of DAP (Deus Applications Prototypes) the open source project This file is part of CellFrame SDK the open source project
DAP (Deus Applicaions Prototypes) is free software: you can redistribute it and/or modify CellFrame SDK is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or the Free Software Foundation, either version 3 of the License, or
(at your option) any later version. (at your option) any later version.
DAP is distributed in the hope that it will be useful, CellFrame SDK is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details. GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with any DAP based project. If not, see <http://www.gnu.org/licenses/>. along with any CellFrame SDK based project. If not, see <http://www.gnu.org/licenses/>.
*/ */
#pragma once #pragma once
......
...@@ -7,20 +7,20 @@ ...@@ -7,20 +7,20 @@
* Copyright (c) 2017-2020 * Copyright (c) 2017-2020
* All rights reserved. * All rights reserved.
This file is part of DAP (Deus Applications Prototypes) the open source project This file is part of CellFrame SDK the open source project
DAP (Deus Applicaions Prototypes) is free software: you can redistribute it and/or modify CellFrame SDK is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or the Free Software Foundation, either version 3 of the License, or
(at your option) any later version. (at your option) any later version.
DAP is distributed in the hope that it will be useful, CellFrame SDK is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details. GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with any DAP based project. If not, see <http://www.gnu.org/licenses/>. along with any CellFrame SDK based project. If not, see <http://www.gnu.org/licenses/>.
*/ */
#pragma once #pragma once
......
/*
* Authors:
* Alexey Stratulat <alexey.stratulat@demlabs.net>
* DeM Labs Inc. https://demlabs.net
* CellFrame https://cellframe.net
* Sources https://gitlab.demlabs.net/cellframe
* Copyright (c) 2017-2020
* All rights reserved.
This file is part of CellFrame SDK the open source project
CellFrame SDK is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
CellFrame SDK is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with any CellFrame SDK based project. If not, see <http://www.gnu.org/licenses/>.
*/
#include "wrapping_dap_enc_iaes.h" #include "wrapping_dap_enc_iaes.h"
#define LOG_TAG "wrapping-dap-enc-iaes" #define LOG_TAG "wrapping-dap-enc-iaes"
...@@ -40,7 +64,9 @@ PyObject* dap_enc_iaes_key_generate_py(PyObject *self, PyObject *args){ ...@@ -40,7 +64,9 @@ PyObject* dap_enc_iaes_key_generate_py(PyObject *self, PyObject *args){
return PyLong_FromLong(0); return PyLong_FromLong(0);
} }
PyObject* dap_enc_iaes256_calc_encode_size_py(PyObject *self, PyObject *args){ PyObject* dap_enc_iaes256_calc_encode_size_py(PyObject *self, PyObject *args)
{
UNUSED(self);
size_t size; size_t size;
if (!PyArg_ParseTuple(args, "n", &size)){ if (!PyArg_ParseTuple(args, "n", &size)){
return NULL; return NULL;
...@@ -49,26 +75,38 @@ PyObject* dap_enc_iaes256_calc_encode_size_py(PyObject *self, PyObject *args){ ...@@ -49,26 +75,38 @@ PyObject* dap_enc_iaes256_calc_encode_size_py(PyObject *self, PyObject *args){
return PyLong_FromSize_t(new_size); return PyLong_FromSize_t(new_size);
} }
PyObject* dap_enc_iaes256_calc_decode_size_py(PyObject *self, PyObject *args){
PyObject* dap_enc_iaes256_calc_decode_size_py(PyObject *self, PyObject *args)
{
UNUSED(self);
size_t size; size_t size;
if (!PyArg_ParseTuple(args, "n", &size)){ if (!PyArg_ParseTuple(args, "n", &size)){
return NULL; return NULL;
} }
size_t new_size = dap_enc_iaes256_calc_decode_size(size); size_t new_size = dap_enc_iaes256_calc_decode_max_size(size);
return PyLong_FromSize_t(new_size); return PyLong_FromSize_t(new_size);
} }
PyObject* dap_enc_iaes256_cbc_decrypt_py(PyObject *self, PyObject *args){ PyObject* dap_enc_iaes256_cbc_decrypt_py(PyObject *self, PyObject *args)
{
UNUSED(self);
UNUSED(args);
//TODO //TODO
return PyLong_FromLong(0); return PyLong_FromLong(0);
} }
PyObject* dap_enc_iaes256_cbc_encrypt_py(PyObject *self, PyObject *args){ PyObject* dap_enc_iaes256_cbc_encrypt_py(PyObject *self, PyObject *args)
{
UNUSED(self);
UNUSED(args);
//TODO //TODO
return PyLong_FromLong(0); return PyLong_FromLong(0);
} }
// Writes result ( out ) in already allocated buffer // Writes result ( out ) in already allocated buffer
PyObject* dap_enc_iaes256_cbc_decrypt_fast_py(PyObject *self, PyObject *args){ PyObject* dap_enc_iaes256_cbc_decrypt_fast_py(PyObject *self, PyObject *args)
{
UNUSED(self);
PyObject* in_key; PyObject* in_key;
PyBytesObject *a_in; PyBytesObject *a_in;
size_t a_in_size; size_t a_in_size;
...@@ -84,7 +122,9 @@ PyObject* dap_enc_iaes256_cbc_decrypt_fast_py(PyObject *self, PyObject *args){ ...@@ -84,7 +122,9 @@ PyObject* dap_enc_iaes256_cbc_decrypt_fast_py(PyObject *self, PyObject *args){
} }
// if "a_in size mod IAES_BLOCK_SIZE = 0" encryption will be faster // if "a_in size mod IAES_BLOCK_SIZE = 0" encryption will be faster
PyObject* dap_enc_iaes256_cbc_encrypt_fast_py(PyObject *self, PyObject *args){ PyObject* dap_enc_iaes256_cbc_encrypt_fast_py(PyObject *self, PyObject *args)
{
UNUSED(self);
PyObject *in_key; PyObject *in_key;
PyBytesObject *a_in; PyBytesObject *a_in;
size_t a_in_size; size_t a_in_size;
......
/*
* Authors:
* Alexey Stratulat <alexey.stratulat@demlabs.net>
* DeM Labs Inc. https://demlabs.net
* CellFrame https://cellframe.net
* Sources https://gitlab.demlabs.net/cellframe
* Copyright (c) 2017-2020
* All rights reserved.
This file is part of CellFrame SDK the open source project
CellFrame SDK is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
CellFrame SDK is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with any CellFrame SDK based project. If not, see <http://www.gnu.org/licenses/>.
*/
#include "wrapping_dap_enc_key.h" #include "wrapping_dap_enc_key.h"
#define LOG_TAG "wrapping-dap-enc-key" #define LOG_TAG "wrapping-dap-enc-key"
......