Package for zx/zomp

This commit is contained in:
Craig Everett 2022-05-16 21:26:04 +09:00
parent e557b1c405
commit 8b2fd35408
12 changed files with 42 additions and 7 deletions

2
.gitignore vendored
View File

@ -7,7 +7,7 @@ _*
*.swp *.swp
*.swo *.swo
.erlang.cookie .erlang.cookie
ebin ebin/*.beam
log log
erl_crash.dump erl_crash.dump
.rebar .rebar

1
Emakefile Normal file
View File

@ -0,0 +1 @@
{"src/*", [debug_info, {i, "include/"}, {outdir, "ebin/"}]}.

12
LICENSE
View File

@ -1,11 +1,11 @@
Copyright 2022 Hans Svensson Copyright 2022 Hans Svensson
Permission is hereby granted, free of charge, to any person obtaining a copy of Permission is hereby granted, free of charge, to any person obtaining a copy
this software and associated documentation files (the "Software"), to deal in of this software and associated documentation files (the "Software"), to deal
the Software without restriction, including without limitation the rights to in the Software without restriction, including without limitation the rights
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
of the Software, and to permit persons to whom the Software is furnished to do copies of the Software, and to permit persons to whom the Software is
so, subject to the following conditions: furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software. copies or substantial portions of the Software.

10
ebin/ec_utils.app Normal file
View File

@ -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]}]}.

View File

@ -1,3 +1,4 @@
-module(ec_utils). -module(ec_utils).
-vsn("0.1.0").
-export([]). -export([]).

View File

@ -3,6 +3,7 @@
%%% Description : %%% Description :
%%% Created : 13 Jan 2022 by Hans Svensson %%% Created : 13 Jan 2022 by Hans Svensson
-module(ecu_crypto). -module(ecu_crypto).
-vsn("0.1.0").
-export([private_to_short/2, public_to_short/2, -export([private_to_short/2, public_to_short/2,
eth_sign/2, eth_recover/2, eth_verify/3, eth_msg_hash/1, eth_sign/2, eth_recover/2, eth_verify/3, eth_msg_hash/1,

View File

@ -3,6 +3,7 @@
%%% Description : ecdsa functionality %%% Description : ecdsa functionality
%%% Created : 13 Jan 2022 by Hans Svensson %%% Created : 13 Jan 2022 by Hans Svensson
-module(ecu_ecdsa). -module(ecu_ecdsa).
-vsn("0.1.0").
-export([sign/3, verify/4, -export([sign/3, verify/4,
sign_secp256k1/2, sign_secp256k1/2,

View File

@ -4,6 +4,7 @@
%%% Just for usage when speed isn't crucial... %%% Just for usage when speed isn't crucial...
%%% Created : 13 Jan 2022 by Hans Svensson %%% Created : 13 Jan 2022 by Hans Svensson
-module(ecu_ed25519). -module(ecu_ed25519).
-vsn("0.1.0").
-define(P, 16#7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFED). -define(P, 16#7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFED).
-define(N, 16#1000000000000000000000000000000014DEF9DEA2F79CD65812631A5CF5D3ED). -define(N, 16#1000000000000000000000000000000014DEF9DEA2F79CD65812631A5CF5D3ED).

View File

@ -3,6 +3,7 @@
%%% Description : eddsa functionality - when possible compatible with enacl. %%% Description : eddsa functionality - when possible compatible with enacl.
%%% Created : 19 Jan 2022 by Hans Svensson %%% Created : 19 Jan 2022 by Hans Svensson
-module(ecu_eddsa). -module(ecu_eddsa).
-vsn("0.1.0").
-export([sign_keypair/0, -export([sign_keypair/0,
sign_seed_keypair/1, sign_seed_keypair/1,

View File

@ -3,6 +3,7 @@
%%% Description : Misc. functionality %%% Description : Misc. functionality
%%% Created : 13 Jan 2022 by Hans Svensson %%% Created : 13 Jan 2022 by Hans Svensson
-module(ecu_misc). -module(ecu_misc).
-vsn("0.1.0").
-export([eea/2, exp_mod/3, -export([eea/2, exp_mod/3,
hex_to_bin/1, bin_to_hex/1, hex_to_bin/1, bin_to_hex/1,

View File

@ -4,6 +4,7 @@
%%% Just for usage when speed isn't crucial... %%% Just for usage when speed isn't crucial...
%%% Created : 22 Dec 2021 by Hans Svensson %%% Created : 22 Dec 2021 by Hans Svensson
-module(ecu_secp256k1). -module(ecu_secp256k1).
-vsn("0.1.0").
-define(P, 16#FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFC2F). -define(P, 16#FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFC2F).
-define(A, 16#00). -define(A, 16#00).

17
zomp.meta Normal file
View File

@ -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"}.