forked from hyperledger-iroha/iroha-dco
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add python bindings for iroha crypto.
Signed-off-by: luckychess <[email protected]>
- Loading branch information
1 parent
42ba1be
commit 044ae40
Showing
10 changed files
with
85 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
shared_model/cryptography/ed25519_sha3_impl/bindings/CMakeLists.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# Copyright 2017 Soramitsu Co., Ltd. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
find_package(SWIG REQUIRED) | ||
INCLUDE(${SWIG_USE_FILE}) | ||
|
||
FIND_PACKAGE(PythonLibs REQUIRED) | ||
INCLUDE_DIRECTORIES(${PYTHON_INCLUDE_PATH}) | ||
SET(CMAKE_SWIG_FLAGS "") | ||
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) | ||
|
||
SET_SOURCE_FILES_PROPERTIES(crypto.i PROPERTIES CPLUSPLUS ON) | ||
SWIG_ADD_LIBRARY(crypto LANGUAGE python SOURCES crypto.i) | ||
|
||
SWIG_LINK_LIBRARIES(crypto ${PYTHON_LIBRARIES} shared_ed25519_sha3 hash cryptography ed25519_sha3) |
51 changes: 51 additions & 0 deletions
51
shared_model/cryptography/ed25519_sha3_impl/bindings/crypto.i
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
/** | ||
* Copyright Soramitsu Co., Ltd. 2017 All Rights Reserved. | ||
* http://soramitsu.co.jp | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
%module crypto | ||
%include "std_string.i" | ||
|
||
%{ | ||
#include "cryptography/ed25519_sha3_impl/crypto_provider.hpp" | ||
%} | ||
|
||
%include "interfaces/model_primitive.hpp" | ||
%include "interfaces/primitive.hpp" | ||
%include "cryptography/blob.hpp" | ||
%include "cryptography/seed.hpp" | ||
%include "cryptography/signed.hpp" | ||
%include "cryptography/public_key.hpp" | ||
%include "cryptography/private_key.hpp" | ||
%include "cryptography/keypair.hpp" | ||
%include "cryptography/ed25519_sha3_impl/crypto_provider.hpp" | ||
|
||
namespace shared_model { | ||
namespace interface { | ||
%template(imodelprim) shared_model::interface::ModelPrimitive<shared_model::crypto::Blob>; | ||
%template(ikeypair) ModelPrimitive<crypto::Keypair>; | ||
%template(iprim) shared_model::interface::Primitive<crypto::Keypair, iroha::keypair_t>; | ||
} | ||
|
||
namespace crypto { | ||
class Blob; | ||
class Keypair; | ||
class Seed; | ||
class Signed; | ||
class PublicKey; | ||
class PrivateKey; | ||
class CryptoProvider; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,7 +22,6 @@ add_library(hash | |
) | ||
|
||
target_link_libraries(hash | ||
ed25519_sha3 | ||
common | ||
pb_model_converters | ||
) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,4 +11,3 @@ add_library(ed25519_sha3 | |
sign.c | ||
verify.c | ||
) | ||
#target_include_directories(ed25519_sha3 INTERFACE ed25519) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters