Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/golang #16

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions .drone.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
kind: pipeline
name: default

steps:
- name: Build library
image: gcc:10.2
environment:
JAVA_HOME: /usr/lib/jvm/java-11-openjdk-amd64
commands:
- apt-get update
- apt-get install -y openjdk-11-jdk
- make -j 4

- name: publish
image: plugins/github-release
settings:
api_key:
from_secret: kite_bot_key
files: libmpc_crypto.so
checksum:
- md5
- sha256
- sha512
when:
event: [tag]

trigger:
event:
- push
- tag
29 changes: 29 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Compiled Object files
*.slo
*.lo
*.o
*.obj

# Precompiled Headers
*.gch
*.pch

# Compiled Dynamic libraries
*.so
*.dylib
*.dll

# Fortran module files
*.mod
*.smod

# Compiled Static libraries
*.lai
*.la
*.a
*.lib

# Executables
*.exe
*.out
*.app
9 changes: 4 additions & 5 deletions include/mpc_crypto.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,22 +43,21 @@ typedef struct tag_MPCCryptoKey MPCCryptoShare;
typedef struct tag_MPCCryptoContext MPCCryptoContext;
typedef struct tag_MPCCryptoMessage MPCCryptoMessage;

enum mpc_crypto_key_e : unsigned
typedef enum
{
mpc_none = 0,

mpc_eddsa = 2,
mpc_ecdsa = 3,
mpc_generic_secret = 4, // used for the seed
};
} mpc_crypto_key_e;

enum mpc_crypto_err_e
typedef enum
{
MPC_E_BADARG = 0xff010002, // bad argument
MPC_E_FORMAT = 0xff010003, // invalid format
MPC_E_TOO_SMALL = 0xff010008, // buffer too small
MPC_E_CRYPTO = 0xff040001, // crypto error, process is being tampered
};
} mpc_crypto_err_e;

typedef struct tag_mpc_crypto_share_info_t
{
Expand Down
22 changes: 22 additions & 0 deletions mpc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
GENERATOR:
PackageName: "mpc"
PackageDescription: "Package crypto-mpc provides Go bindings for blockchain-crypto-mpc, library released by Unbound Tech"
PackageLicense: "THE AUTOGENERATED LICENSE. ALL THE RIGHTS ARE RESERVED BY ROBOTS."
Includes: ["mpc_crypto.h"]

PARSER:
IncludePaths: ["/usr/include", "/usr/local/include", "/usr/lib/gcc/x86_64-pc-linux-gnu/10.2.0/include"]
SourcesPaths: ["include/mpc_crypto.h"]

TRANSLATOR:
ConstRules:
defines: eval
PtrTips:
function:
Rules:
global:
- {transform: lower}
- {action: accept, from: "^MPCCrypto_"}
- {action: replace, from: "^MPCCrypto_", to: "mpc_"}
- {transform: export}
Loading