From 8b2fd354081fad78fb1f656cad569e1bf936660d Mon Sep 17 00:00:00 2001 From: Craig Everett Date: Mon, 16 May 2022 21:26:04 +0900 Subject: [PATCH] Package for zx/zomp --- .gitignore | 2 +- Emakefile | 1 + LICENSE | 12 ++++++------ ebin/ec_utils.app | 10 ++++++++++ src/ec_utils.erl | 1 + src/ecu_crypto.erl | 1 + src/ecu_ecdsa.erl | 1 + src/ecu_ed25519.erl | 1 + src/ecu_eddsa.erl | 1 + src/ecu_misc.erl | 1 + src/ecu_secp256k1.erl | 1 + zomp.meta | 17 +++++++++++++++++ 12 files changed, 42 insertions(+), 7 deletions(-) create mode 100644 Emakefile create mode 100644 ebin/ec_utils.app create mode 100644 zomp.meta diff --git a/.gitignore b/.gitignore index a78b024..86f7a0c 100644 --- a/.gitignore +++ b/.gitignore @@ -7,7 +7,7 @@ _* *.swp *.swo .erlang.cookie -ebin +ebin/*.beam log erl_crash.dump .rebar diff --git a/Emakefile b/Emakefile new file mode 100644 index 0000000..68c7b67 --- /dev/null +++ b/Emakefile @@ -0,0 +1 @@ +{"src/*", [debug_info, {i, "include/"}, {outdir, "ebin/"}]}. diff --git a/LICENSE b/LICENSE index fcf003b..2c9d8ba 100644 --- a/LICENSE +++ b/LICENSE @@ -1,11 +1,11 @@ Copyright 2022 Hans Svensson -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies -of the Software, and to permit persons to whom the Software is furnished to do -so, subject to the following conditions: +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. diff --git a/ebin/ec_utils.app b/ebin/ec_utils.app new file mode 100644 index 0000000..27540f9 --- /dev/null +++ b/ebin/ec_utils.app @@ -0,0 +1,10 @@ +{application,ec_utils, + [{description,"Helper functions for cryptography, mostly related to elliptic curves."}, + {registered,[]}, + {included_applications,[]}, + {applications,[stdlib,kernel]}, + {vsn,"0.1.0"}, + {modules,[ed25519_eqc,eddsa_eqc,ec_utils,ecu_crypto,ecu_ecdsa, + ecu_ed25519,ecu_eddsa,ecu_misc,ecu_secp256k1, + benchmark_tests,crypto_tests,ecdsa_tests, + secp256k1_tests]}]}. diff --git a/src/ec_utils.erl b/src/ec_utils.erl index 997ed10..fb850c3 100644 --- a/src/ec_utils.erl +++ b/src/ec_utils.erl @@ -1,3 +1,4 @@ -module(ec_utils). +-vsn("0.1.0"). -export([]). diff --git a/src/ecu_crypto.erl b/src/ecu_crypto.erl index c2a166e..380e23d 100644 --- a/src/ecu_crypto.erl +++ b/src/ecu_crypto.erl @@ -3,6 +3,7 @@ %%% Description : %%% Created : 13 Jan 2022 by Hans Svensson -module(ecu_crypto). +-vsn("0.1.0"). -export([private_to_short/2, public_to_short/2, eth_sign/2, eth_recover/2, eth_verify/3, eth_msg_hash/1, diff --git a/src/ecu_ecdsa.erl b/src/ecu_ecdsa.erl index f455b1e..2936a41 100644 --- a/src/ecu_ecdsa.erl +++ b/src/ecu_ecdsa.erl @@ -3,6 +3,7 @@ %%% Description : ecdsa functionality %%% Created : 13 Jan 2022 by Hans Svensson -module(ecu_ecdsa). +-vsn("0.1.0"). -export([sign/3, verify/4, sign_secp256k1/2, diff --git a/src/ecu_ed25519.erl b/src/ecu_ed25519.erl index 4db11cb..103a25d 100644 --- a/src/ecu_ed25519.erl +++ b/src/ecu_ed25519.erl @@ -4,6 +4,7 @@ %%% Just for usage when speed isn't crucial... %%% Created : 13 Jan 2022 by Hans Svensson -module(ecu_ed25519). +-vsn("0.1.0"). -define(P, 16#7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFED). -define(N, 16#1000000000000000000000000000000014DEF9DEA2F79CD65812631A5CF5D3ED). diff --git a/src/ecu_eddsa.erl b/src/ecu_eddsa.erl index 4d383a5..40b112a 100644 --- a/src/ecu_eddsa.erl +++ b/src/ecu_eddsa.erl @@ -3,6 +3,7 @@ %%% Description : eddsa functionality - when possible compatible with enacl. %%% Created : 19 Jan 2022 by Hans Svensson -module(ecu_eddsa). +-vsn("0.1.0"). -export([sign_keypair/0, sign_seed_keypair/1, diff --git a/src/ecu_misc.erl b/src/ecu_misc.erl index 9f9dc3a..09ef9f4 100644 --- a/src/ecu_misc.erl +++ b/src/ecu_misc.erl @@ -3,6 +3,7 @@ %%% Description : Misc. functionality %%% Created : 13 Jan 2022 by Hans Svensson -module(ecu_misc). +-vsn("0.1.0"). -export([eea/2, exp_mod/3, hex_to_bin/1, bin_to_hex/1, diff --git a/src/ecu_secp256k1.erl b/src/ecu_secp256k1.erl index 185c681..f1502d7 100644 --- a/src/ecu_secp256k1.erl +++ b/src/ecu_secp256k1.erl @@ -4,6 +4,7 @@ %%% Just for usage when speed isn't crucial... %%% Created : 22 Dec 2021 by Hans Svensson -module(ecu_secp256k1). +-vsn("0.1.0"). -define(P, 16#FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFC2F). -define(A, 16#00). diff --git a/zomp.meta b/zomp.meta new file mode 100644 index 0000000..6fc189b --- /dev/null +++ b/zomp.meta @@ -0,0 +1,17 @@ +{a_email,"zxq9@zxq9.com"}. +{author,"Craig Everett"}. +{c_email,[]}. +{copyright,"Hans Svensson"}. +{deps,[]}. +{desc,"Helper functions for cryptography, mostly related to elliptic curves."}. +{file_exts,[]}. +{key_name,none}. +{license,"MIT"}. +{modules,[]}. +{name,"Elliptic Curve Utils"}. +{package_id,{"otpr","ec_utils",{0,1,0}}}. +{prefix,none}. +{repo_url,"https://github.com/zxq9/ec_utils"}. +{tags,[]}. +{type,lib}. +{ws_url,"https://github.com/hanssv/ec_utils"}.