From b8db4141bc66d354899e775bbd3bbdc338b9a6c4 Mon Sep 17 00:00:00 2001 From: Paul Driver Date: Mon, 27 Jul 2020 19:19:17 -0700 Subject: [PATCH 001/329] urcrypt pkg with one function, building --- nix/deps-env.nix | 2 +- nix/pkgs/default.nix | 9 +++++++-- nix/pkgs/urbit/default.nix | 4 ++-- nix/pkgs/urbit/release.nix | 2 +- nix/pkgs/urbit/shell.nix | 2 +- nix/pkgs/urcrypt/builder.sh | 7 +++++++ nix/pkgs/urcrypt/cross.nix | 12 ++++++++++++ nix/pkgs/urcrypt/default.nix | 9 +++++++++ nix/pkgs/urcrypt/release.sh | 13 +++++++++++++ nix/release.nix | 3 +++ pkg/urbit/configure | 2 +- pkg/urbit/jets/e/ed_scalarmult.c | 28 ++++++++++++++++++++++++++++ pkg/urcrypt/Makefile | 20 ++++++++++++++++++++ pkg/urcrypt/urcrypt.c | 19 +++++++++++++++++++ pkg/urcrypt/urcrypt.h | 10 ++++++++++ 15 files changed, 134 insertions(+), 8 deletions(-) create mode 100644 nix/pkgs/urcrypt/builder.sh create mode 100644 nix/pkgs/urcrypt/cross.nix create mode 100644 nix/pkgs/urcrypt/default.nix create mode 100644 nix/pkgs/urcrypt/release.sh create mode 100644 pkg/urcrypt/Makefile create mode 100644 pkg/urcrypt/urcrypt.c create mode 100644 pkg/urcrypt/urcrypt.h diff --git a/nix/deps-env.nix b/nix/deps-env.nix index 6f7357b4f..7935da6ba 100644 --- a/nix/deps-env.nix +++ b/nix/deps-env.nix @@ -20,7 +20,7 @@ let vendor = with deps; - [ argon2 ed25519 h2o murmur3 scrypt secp256k1 softfloat3 uv ent ge-additions ivory-header ca-header ]; + [ argon2 ed25519 h2o murmur3 scrypt secp256k1 softfloat3 uv ent ge-additions urcrypt ivory-header ca-header ]; in diff --git a/nix/pkgs/default.nix b/nix/pkgs/default.nix index ba1129dd3..9404cbd9e 100644 --- a/nix/pkgs/default.nix +++ b/nix/pkgs/default.nix @@ -14,13 +14,18 @@ let inherit (deps) ed25519; }; + urcrypt = import ./urcrypt { + inherit pkgs ge-additions; + inherit (deps) ed25519; + }; + libaes_siv = import ./libaes_siv { inherit pkgs; }; mkUrbit = { debug }: import ./urbit { - inherit pkgs ent debug ge-additions libaes_siv; + inherit pkgs ent debug ge-additions urcrypt libaes_siv; inherit (deps) argon2 murmur3 uv ed25519 scrypt softfloat3; inherit (deps) secp256k1 h2o ivory-header ca-header; }; @@ -30,4 +35,4 @@ let in -{ inherit ent ge-additions libaes_siv arvo arvo-ropsten herb urbit urbit-debug; } +{ inherit ent ge-additions urcrypt libaes_siv arvo arvo-ropsten herb urbit urbit-debug; } diff --git a/nix/pkgs/urbit/default.nix b/nix/pkgs/urbit/default.nix index 19befa1ef..b808d0afb 100644 --- a/nix/pkgs/urbit/default.nix +++ b/nix/pkgs/urbit/default.nix @@ -1,7 +1,7 @@ { pkgs, debug, - argon2, ed25519, ent, ge-additions, libaes_siv, h2o, murmur3, scrypt, secp256k1, softfloat3, uv, ivory-header, ca-header + argon2, ed25519, ent, ge-additions, urcrypt, libaes_siv, h2o, murmur3, scrypt, secp256k1, softfloat3, uv, ivory-header, ca-header }: let @@ -26,7 +26,7 @@ let [ curl gmp sigseg openssl zlib lmdb ]; vendor = - [ argon2 softfloat3 ed25519 ent ge-additions libaes_siv h2o scrypt uv murmur3 secp256k1 ivory-header ca-header ]; + [ argon2 softfloat3 ed25519 ent ge-additions urcrypt libaes_siv h2o scrypt uv murmur3 secp256k1 ivory-header ca-header ]; urbit = pkgs.stdenv.mkDerivation { inherit name meta; diff --git a/nix/pkgs/urbit/release.nix b/nix/pkgs/urbit/release.nix index 9d486f3df..411be8868 100644 --- a/nix/pkgs/urbit/release.nix +++ b/nix/pkgs/urbit/release.nix @@ -16,7 +16,7 @@ let vendor = with deps; - [ argon2 softfloat3 ed25519 ge-additions libaes_siv h2o scrypt uv murmur3 secp256k1 ivory-header ca-header ]; + [ argon2 softfloat3 ed25519 ge-additions urcrypt libaes_siv h2o scrypt uv murmur3 secp256k1 ivory-header ca-header ]; in diff --git a/nix/pkgs/urbit/shell.nix b/nix/pkgs/urbit/shell.nix index dee99d962..9e5d781af 100644 --- a/nix/pkgs/urbit/shell.nix +++ b/nix/pkgs/urbit/shell.nix @@ -10,7 +10,7 @@ import ./default.nix { inherit pkgs; debug = false; inherit (tlon) - ent ge-additions libaes_siv; + ent ge-additions urcrypt libaes_siv; inherit (deps) argon2 ed25519 h2o murmur3 scrypt secp256k1 softfloat3 uv ivory-header ca-header; } diff --git a/nix/pkgs/urcrypt/builder.sh b/nix/pkgs/urcrypt/builder.sh new file mode 100644 index 000000000..5a0404377 --- /dev/null +++ b/nix/pkgs/urcrypt/builder.sh @@ -0,0 +1,7 @@ +source $stdenv/setup + +cp -r $src ./src +chmod -R u+w ./src +cd ./src + +PREFIX=$out make install diff --git a/nix/pkgs/urcrypt/cross.nix b/nix/pkgs/urcrypt/cross.nix new file mode 100644 index 000000000..48ef204bf --- /dev/null +++ b/nix/pkgs/urcrypt/cross.nix @@ -0,0 +1,12 @@ +{ env_name, env, deps }: + +env.make_derivation rec { + name = "urcrypt"; + builder = ./release.sh; + src = ../../../pkg/urcrypt; + + cross_inputs = [ deps.ed25519 deps.ge-additions ]; + + CC = "${env.host}-gcc"; + AR = "${env.host}-ar"; +} diff --git a/nix/pkgs/urcrypt/default.nix b/nix/pkgs/urcrypt/default.nix new file mode 100644 index 000000000..bb99897c4 --- /dev/null +++ b/nix/pkgs/urcrypt/default.nix @@ -0,0 +1,9 @@ +{ pkgs, ge-additions, ed25519 }: + +pkgs.stdenv.mkDerivation rec { + name = "urcrypt"; + builder = ./builder.sh; + src = ../../../pkg/urcrypt; + + nativeBuildInputs = [ ed25519 ge-additions ]; +} diff --git a/nix/pkgs/urcrypt/release.sh b/nix/pkgs/urcrypt/release.sh new file mode 100644 index 000000000..aaa54b5e1 --- /dev/null +++ b/nix/pkgs/urcrypt/release.sh @@ -0,0 +1,13 @@ +source $setup + +cp -r $src ./src +chmod -R u+w ./src +cd ./src + +for dep in $cross_inputs; do + export CFLAGS="${CFLAGS-} -I$dep/include" + export LDFLAGS="${LDFLAGS-} -L$dep/lib" +done + +PREFIX=$out make install + diff --git a/nix/release.nix b/nix/release.nix index 2ccd1098b..dc1ce41e7 100644 --- a/nix/release.nix +++ b/nix/release.nix @@ -19,6 +19,9 @@ let ge-additions = env: import ./pkgs/ge-additions/cross.nix env; + urcrypt = env: + import ./pkgs/urcrypt/cross.nix env; + libaes_siv = env: import ./pkgs/libaes_siv/cross.nix env; diff --git a/pkg/urbit/configure b/pkg/urbit/configure index 6157fb544..d496a86c0 100755 --- a/pkg/urbit/configure +++ b/pkg/urbit/configure @@ -6,7 +6,7 @@ URBIT_VERSION="0.10.8" deps=" \ curl gmp sigsegv argon2 ed25519 ent h2o scrypt uv murmur3 secp256k1 \ - softfloat3 ssl crypto z lmdb ge-additions aes_siv pthread \ + softfloat3 ssl crypto z lmdb ge-additions aes_siv urcrypt pthread \ " headers=" \ diff --git a/pkg/urbit/jets/e/ed_scalarmult.c b/pkg/urbit/jets/e/ed_scalarmult.c index aca547e39..607a40caf 100644 --- a/pkg/urbit/jets/e/ed_scalarmult.c +++ b/pkg/urbit/jets/e/ed_scalarmult.c @@ -6,9 +6,37 @@ #include #include "ge-additions.h" +#include "urcrypt.h" /* functions */ + // TODO: should these exits be u3_none or bail: fail instead? + u3_noun + u3qc_scalarmult_new(u3_atom a, u3_atom b) + { + c3_w ate_w, bet_w; + c3_y a_y[32], b_y[32], out_y[32]; + + if ( (ate_w = u3r_met(3, a)) > 32 ) { + return u3m_bail(c3__exit); + } + + if ( (bet_w = u3r_met(3, b)) > 32 ) { + return u3m_bail(c3__exit); + } + + memset(a_y, 0, 32); + memset(b_y, 0, 32); + u3r_bytes(0, ate_w, a_y, a); + u3r_bytes(0, bet_w, b_y, b); + + if ( 0 != urcrypt_ed_scalarmult(a_y, b_y, out_y) ) { + return u3m_bail(c3__exit); + } + + return u3i_bytes(32, out_y); + } + u3_noun u3qc_scalarmult(u3_atom a, u3_atom b) diff --git a/pkg/urcrypt/Makefile b/pkg/urcrypt/Makefile new file mode 100644 index 000000000..b1c6e51dd --- /dev/null +++ b/pkg/urcrypt/Makefile @@ -0,0 +1,20 @@ +CC ?= cc +AR ?= ar +PREFIX ?= ./out + +################################################################################ + +.PHONY: all test install clean + +all: urcrypt.c urcrypt.h + $(CC) $(CFLAGS) -O3 -Wall -Werror -pedantic -std=gnu99 -c urcrypt.c + $(AR) rcs liburcrypt.a urcrypt.o + +install: all + @mkdir -p $(PREFIX)/lib/ + @mkdir -p $(PREFIX)/include/ + cp liburcrypt.a $(PREFIX)/lib/ + cp urcrypt.h $(PREFIX)/include/ + +clean: + rm -rf ./out diff --git a/pkg/urcrypt/urcrypt.c b/pkg/urcrypt/urcrypt.c new file mode 100644 index 000000000..41f5c7c73 --- /dev/null +++ b/pkg/urcrypt/urcrypt.c @@ -0,0 +1,19 @@ +#include "urcrypt.h" + +int +urcrypt_ed_scalarmult(uint8_t a[32], uint8_t b[32], uint8_t out[32]) +{ + ge_p3 B, result; + + if ( ge_frombytes_negate_vartime(&B, b) != 0 ) { + return -1; + } + + // Undo the negation from above. See add_scalar.c in the ed25519 distro. + fe_neg(B.X, B.X); + fe_neg(B.T, B.T); + + ge_scalarmult(&result, a, &B); + ge_p3_tobytes(out, &result); + return 0; +} diff --git a/pkg/urcrypt/urcrypt.h b/pkg/urcrypt/urcrypt.h new file mode 100644 index 000000000..9a0360469 --- /dev/null +++ b/pkg/urcrypt/urcrypt.h @@ -0,0 +1,10 @@ +#ifndef URCRYPT_H +#define URCRYPT_H + +#include +#include +#include + +int urcrypt_ed_scalarmult(uint8_t a[32], uint8_t b[32], uint8_t out[32]); + +#endif From d7287d2114a91dd9321f325487b9421f52239fed Mon Sep 17 00:00:00 2001 From: Paul Driver Date: Mon, 27 Jul 2020 19:30:20 -0700 Subject: [PATCH 002/329] ed_scalarmult jet only uses urcrypt --- pkg/urbit/jets/e/ed_scalarmult.c | 47 ++------------------------------ 1 file changed, 2 insertions(+), 45 deletions(-) diff --git a/pkg/urbit/jets/e/ed_scalarmult.c b/pkg/urbit/jets/e/ed_scalarmult.c index 607a40caf..0e7136f66 100644 --- a/pkg/urbit/jets/e/ed_scalarmult.c +++ b/pkg/urbit/jets/e/ed_scalarmult.c @@ -2,17 +2,14 @@ ** */ #include "all.h" - -#include - -#include "ge-additions.h" #include "urcrypt.h" /* functions */ // TODO: should these exits be u3_none or bail: fail instead? u3_noun - u3qc_scalarmult_new(u3_atom a, u3_atom b) + u3qc_scalarmult(u3_atom a, + u3_atom b) { c3_w ate_w, bet_w; c3_y a_y[32], b_y[32], out_y[32]; @@ -37,46 +34,6 @@ return u3i_bytes(32, out_y); } - u3_noun - u3qc_scalarmult(u3_atom a, - u3_atom b) - { - c3_y met_w; - - met_w = u3r_met(3, a); - if (met_w > 32) { - return u3m_bail(c3__exit); - } - c3_y a_y[32]; - memset(a_y, 0, 32); - u3r_bytes(0, met_w, a_y, a); - - met_w = u3r_met(3, b); - if (met_w > 32) { - return u3m_bail(c3__exit); - } - c3_y b_y[32]; - memset(b_y, 0, 32); - u3r_bytes(0, met_w, b_y, b); - - ge_p3 B; - if (ge_frombytes_negate_vartime(&B, b_y) != 0) { - return u3m_bail(c3__exit); - } - - // Undo the negation from above. See add_scalar.c in the ed25519 distro. - fe_neg(B.X, B.X); - fe_neg(B.T, B.T); - - ge_p3 result; - ge_scalarmult(&result, a_y, &B); - - c3_y output_y[32]; - ge_p3_tobytes(output_y, &result); - - return u3i_bytes(32, output_y); - } - u3_noun u3wee_scalarmult(u3_noun cor) { From 74d06deb1b0ca2f2e3359694b841195510c5cd9a Mon Sep 17 00:00:00 2001 From: Paul Driver Date: Thu, 30 Jul 2020 13:07:13 -0700 Subject: [PATCH 003/329] one working function in so --- nix/pkgs/urcrypt/cross.nix | 12 ------------ nix/pkgs/urcrypt/default.nix | 2 +- nix/pkgs/urcrypt/release.sh | 13 ------------- nix/release.nix | 3 --- pkg/urcrypt/Makefile | 18 +++++++++++++++--- 5 files changed, 16 insertions(+), 32 deletions(-) delete mode 100644 nix/pkgs/urcrypt/cross.nix delete mode 100644 nix/pkgs/urcrypt/release.sh diff --git a/nix/pkgs/urcrypt/cross.nix b/nix/pkgs/urcrypt/cross.nix deleted file mode 100644 index 48ef204bf..000000000 --- a/nix/pkgs/urcrypt/cross.nix +++ /dev/null @@ -1,12 +0,0 @@ -{ env_name, env, deps }: - -env.make_derivation rec { - name = "urcrypt"; - builder = ./release.sh; - src = ../../../pkg/urcrypt; - - cross_inputs = [ deps.ed25519 deps.ge-additions ]; - - CC = "${env.host}-gcc"; - AR = "${env.host}-ar"; -} diff --git a/nix/pkgs/urcrypt/default.nix b/nix/pkgs/urcrypt/default.nix index bb99897c4..4367c6597 100644 --- a/nix/pkgs/urcrypt/default.nix +++ b/nix/pkgs/urcrypt/default.nix @@ -5,5 +5,5 @@ pkgs.stdenv.mkDerivation rec { builder = ./builder.sh; src = ../../../pkg/urcrypt; - nativeBuildInputs = [ ed25519 ge-additions ]; + buildInputs = [ ed25519 ge-additions ]; } diff --git a/nix/pkgs/urcrypt/release.sh b/nix/pkgs/urcrypt/release.sh deleted file mode 100644 index aaa54b5e1..000000000 --- a/nix/pkgs/urcrypt/release.sh +++ /dev/null @@ -1,13 +0,0 @@ -source $setup - -cp -r $src ./src -chmod -R u+w ./src -cd ./src - -for dep in $cross_inputs; do - export CFLAGS="${CFLAGS-} -I$dep/include" - export LDFLAGS="${LDFLAGS-} -L$dep/lib" -done - -PREFIX=$out make install - diff --git a/nix/release.nix b/nix/release.nix index dc1ce41e7..2ccd1098b 100644 --- a/nix/release.nix +++ b/nix/release.nix @@ -19,9 +19,6 @@ let ge-additions = env: import ./pkgs/ge-additions/cross.nix env; - urcrypt = env: - import ./pkgs/urcrypt/cross.nix env; - libaes_siv = env: import ./pkgs/libaes_siv/cross.nix env; diff --git a/pkg/urcrypt/Makefile b/pkg/urcrypt/Makefile index b1c6e51dd..d67fe974d 100644 --- a/pkg/urcrypt/Makefile +++ b/pkg/urcrypt/Makefile @@ -6,14 +6,26 @@ PREFIX ?= ./out .PHONY: all test install clean -all: urcrypt.c urcrypt.h - $(CC) $(CFLAGS) -O3 -Wall -Werror -pedantic -std=gnu99 -c urcrypt.c - $(AR) rcs liburcrypt.a urcrypt.o +CFLAGS := $(CFLAGS) -O3 -Wall -Werror -pedantic -std=gnu99 +SOURCES = urcrypt.c urcrypt.h + +liburcrypt.a: $(SOURCES) + $(CC) $(CFLAGS) -c urcrypt.c -o urcrypt-static.o + $(AR) rcs liburcrypt.a urcrypt-static.o + +liburcrypt.so: $(SOURCES) + $(CC) $(CFLAGS) -fPIC -c urcrypt.c -o urcrypt-shared.o + $(CC) -shared urcrypt-shared.o -o liburcrypt.so \ + -led25519 -lge-additions \ + -Wl,--no-undefined + +all: liburcrypt.a liburcrypt.so install: all @mkdir -p $(PREFIX)/lib/ @mkdir -p $(PREFIX)/include/ cp liburcrypt.a $(PREFIX)/lib/ + cp liburcrypt.so $(PREFIX)/lib/ cp urcrypt.h $(PREFIX)/include/ clean: From 6cb81fe08461f6517d2e5c3cb48a27c8a6558efc Mon Sep 17 00:00:00 2001 From: Paul Driver Date: Thu, 30 Jul 2020 14:40:47 -0700 Subject: [PATCH 004/329] ed_sign moved to urcrypt --- pkg/urbit/jets/e/ed_scalarmult.c | 9 +++---- pkg/urbit/jets/e/ed_sign.c | 40 ++++++++++++++------------------ pkg/urcrypt/urcrypt.c | 16 +++++++++++++ pkg/urcrypt/urcrypt.h | 5 ++++ 4 files changed, 43 insertions(+), 27 deletions(-) diff --git a/pkg/urbit/jets/e/ed_scalarmult.c b/pkg/urbit/jets/e/ed_scalarmult.c index 0e7136f66..727ba9f7e 100644 --- a/pkg/urbit/jets/e/ed_scalarmult.c +++ b/pkg/urbit/jets/e/ed_scalarmult.c @@ -6,7 +6,6 @@ /* functions */ - // TODO: should these exits be u3_none or bail: fail instead? u3_noun u3qc_scalarmult(u3_atom a, u3_atom b) @@ -15,11 +14,12 @@ c3_y a_y[32], b_y[32], out_y[32]; if ( (ate_w = u3r_met(3, a)) > 32 ) { - return u3m_bail(c3__exit); + // hoon does not check size of inputs + return u3_none; } if ( (bet_w = u3r_met(3, b)) > 32 ) { - return u3m_bail(c3__exit); + return u3_none; } memset(a_y, 0, 32); @@ -28,7 +28,8 @@ u3r_bytes(0, bet_w, b_y, b); if ( 0 != urcrypt_ed_scalarmult(a_y, b_y, out_y) ) { - return u3m_bail(c3__exit); + // this is unlikely to happen, but there is a return code. + return u3_none; } return u3i_bytes(32, out_y); diff --git a/pkg/urbit/jets/e/ed_sign.c b/pkg/urbit/jets/e/ed_sign.c index cef88afc6..db59b1252 100644 --- a/pkg/urbit/jets/e/ed_sign.c +++ b/pkg/urbit/jets/e/ed_sign.c @@ -2,9 +2,7 @@ ** */ #include "all.h" - - -#include +#include /* functions */ @@ -12,30 +10,26 @@ _cqee_sign(u3_noun a, u3_noun b) { - c3_y sig_y[64]; - c3_y sed_y[32]; - c3_y pub_y[64]; - c3_y sec_y[64]; + c3_w b_w = u3r_met(3, b); - c3_w mesm_w = u3r_met(3, a); - c3_w mess_w = u3r_met(3, b); + if ( b_w > 32 ) { + // hoon calls suck, which calls puck, which crashes + return u3m_bail(c3__exit); + } + else { + c3_w a_w = u3r_met(3, a); + c3_y* mes_y = u3a_malloc(a_w); + c3_y sed_y[32], sig_y[64]; - c3_y* mes_y = 0; + memset(sed_y, 0, 32); + u3r_bytes(0, a_w, mes_y, a); + u3r_bytes(0, b_w, sed_y, b); - memset(sig_y, 0, 64); - memset(sed_y, 0, 32); - memset(pub_y, 0, 64); - memset(sec_y, 0, 64); + urcrypt_ed_sign(mes_y, a_w, sed_y, sig_y); - mes_y = u3a_malloc(mesm_w); - - u3r_bytes(0, mesm_w, mes_y, a); - u3r_bytes(0, mess_w, sed_y, b); - - ed25519_create_keypair(pub_y, sec_y, sed_y); - ed25519_sign(sig_y, mes_y, mesm_w, pub_y, sec_y); - u3a_free(mes_y); - return u3i_bytes(64, sig_y); + u3a_free(mes_y); + return u3i_bytes(64, sig_y); + } } u3_noun diff --git a/pkg/urcrypt/urcrypt.c b/pkg/urcrypt/urcrypt.c index 41f5c7c73..9e06b3d43 100644 --- a/pkg/urcrypt/urcrypt.c +++ b/pkg/urcrypt/urcrypt.c @@ -17,3 +17,19 @@ urcrypt_ed_scalarmult(uint8_t a[32], uint8_t b[32], uint8_t out[32]) ge_p3_tobytes(out, &result); return 0; } + +void +urcrypt_ed_sign(uint8_t *message, + size_t length, + uint8_t seed[32], + uint8_t out[64]) +{ + uint8_t public[64], secret[64]; + + memset(public, 0, 64); + memset(secret, 0, 64); + memset(out, 0, 64); + + ed25519_create_keypair(public, secret, seed); + ed25519_sign(out, message, length, public, secret); +} diff --git a/pkg/urcrypt/urcrypt.h b/pkg/urcrypt/urcrypt.h index 9a0360469..277d04bca 100644 --- a/pkg/urcrypt/urcrypt.h +++ b/pkg/urcrypt/urcrypt.h @@ -2,9 +2,14 @@ #define URCRYPT_H #include +#include #include #include int urcrypt_ed_scalarmult(uint8_t a[32], uint8_t b[32], uint8_t out[32]); +void urcrypt_ed_sign(uint8_t *message, + size_t length, + uint8_t seed[32], + uint8_t signature[64]); #endif From cc5998ae07a2b373ae33d33a1f44a14d794fa6f2 Mon Sep 17 00:00:00 2001 From: Paul Driver Date: Fri, 31 Jul 2020 10:50:46 -0700 Subject: [PATCH 005/329] move ed_point_add to urcrypt --- pkg/urbit/jets/e/ed_point_add.c | 63 +++++++++------------------------ pkg/urcrypt/urcrypt.c | 31 ++++++++++++++++ pkg/urcrypt/urcrypt.h | 1 + 3 files changed, 48 insertions(+), 47 deletions(-) diff --git a/pkg/urbit/jets/e/ed_point_add.c b/pkg/urbit/jets/e/ed_point_add.c index 9d57b7dea..a1eff2e58 100644 --- a/pkg/urbit/jets/e/ed_point_add.c +++ b/pkg/urbit/jets/e/ed_point_add.c @@ -2,64 +2,33 @@ ** */ #include "all.h" - - -#include -#include +#include /* functions */ + u3_noun u3qc_point_add(u3_atom a, u3_atom b) { - c3_y met_w; + c3_w ate_w, bet_w; - met_w = u3r_met(3, a); - if (met_w > 32) { - return u3m_bail(c3__fail); + if ( ((ate_w = u3r_met(3, a)) > 32) || + ((bet_w = u3r_met(3, b)) > 32) ) { + return u3_none; } - c3_y a_y[32]; - memset(a_y, 0, 32); - u3r_bytes(0, met_w, a_y, a); + else { + c3_y a_y[32], b_y[32], out_y[32]; - met_w = u3r_met(3, b); - if (met_w > 32) { - return u3m_bail(c3__fail); + memset(a_y, 0, 32); + memset(b_y, 0, 32); + u3r_bytes(0, ate_w, a_y, a); + u3r_bytes(0, bet_w, b_y, b); + + return ( 0 == urcrypt_ed_point_add(a_y, b_y, out_y) ) + ? u3i_bytes(32, out_y) + : u3_none; } - c3_y b_y[32]; - memset(b_y, 0, 32); - u3r_bytes(0, met_w, b_y, b); - - ge_p3 A; - if (ge_frombytes_negate_vartime(&A, a_y) != 0) { - return u3m_bail(c3__exit); - } - - ge_p3 B; - if (ge_frombytes_negate_vartime(&B, b_y) != 0) { - return u3m_bail(c3__exit); - } - - // Undo the negation from above. See add_scalar.c in the ed25519 distro. - fe_neg(A.X, A.X); - fe_neg(A.T, A.T); - fe_neg(B.X, B.X); - fe_neg(B.T, B.T); - - ge_cached b_cached; - ge_p3_to_cached(&b_cached, &B); - - ge_p1p1 sum; - ge_add(&sum, &A, &b_cached); - - ge_p3 result; - ge_p1p1_to_p3(&result, &sum); - - c3_y output_y[32]; - ge_p3_tobytes(output_y, &result); - - return u3i_bytes(32, output_y); } u3_noun diff --git a/pkg/urcrypt/urcrypt.c b/pkg/urcrypt/urcrypt.c index 9e06b3d43..96b455ce4 100644 --- a/pkg/urcrypt/urcrypt.c +++ b/pkg/urcrypt/urcrypt.c @@ -1,5 +1,36 @@ #include "urcrypt.h" +int +urcrypt_ed_point_add(uint8_t a[32], uint8_t b[32], uint8_t out[32]) +{ + ge_p3 A, B; + ge_cached b_cached; + ge_p1p1 sum; + ge_p3 result; + + if ( ge_frombytes_negate_vartime(&A, a) != 0 ) { + return -1; + } + + if ( ge_frombytes_negate_vartime(&B, b) != 0 ) { + return -1; + } + + // Undo the negation from above. See add_scalar.c in the ed25519 distro. + fe_neg(A.X, A.X); + fe_neg(A.T, A.T); + fe_neg(B.X, B.X); + fe_neg(B.T, B.T); + + ge_p3_to_cached(&b_cached, &B); + ge_add(&sum, &A, &b_cached); + ge_p1p1_to_p3(&result, &sum); + + ge_p3_tobytes(out, &result); + + return 0; +} + int urcrypt_ed_scalarmult(uint8_t a[32], uint8_t b[32], uint8_t out[32]) { diff --git a/pkg/urcrypt/urcrypt.h b/pkg/urcrypt/urcrypt.h index 277d04bca..1204cda38 100644 --- a/pkg/urcrypt/urcrypt.h +++ b/pkg/urcrypt/urcrypt.h @@ -6,6 +6,7 @@ #include #include +int urcrypt_ed_point_add(uint8_t a[32], uint8_t b[32], uint8_t out[32]); int urcrypt_ed_scalarmult(uint8_t a[32], uint8_t b[32], uint8_t out[32]); void urcrypt_ed_sign(uint8_t *message, size_t length, From cfb9b21018a21e683571b3fdb37cd9c6a4a709f0 Mon Sep 17 00:00:00 2001 From: Paul Driver Date: Fri, 31 Jul 2020 11:55:02 -0700 Subject: [PATCH 006/329] ed_scalarmult_base -> urcrypt --- pkg/urbit/jets/e/ed_scalarmult_base.c | 45 ++++++++++++++------------- pkg/urcrypt/urcrypt.c | 8 +++++ pkg/urcrypt/urcrypt.h | 1 + 3 files changed, 33 insertions(+), 21 deletions(-) diff --git a/pkg/urbit/jets/e/ed_scalarmult_base.c b/pkg/urbit/jets/e/ed_scalarmult_base.c index bc3cda7f6..3bdbedaa1 100644 --- a/pkg/urbit/jets/e/ed_scalarmult_base.c +++ b/pkg/urbit/jets/e/ed_scalarmult_base.c @@ -2,35 +2,38 @@ ** */ #include "all.h" - -#include -#include +#include /* functions */ + u3_noun + u3qc_scalarmult_base(u3_atom a) + { + c3_w met_w = u3r_met(3, a); + + if ( met_w > 32 ) { + return u3_none; + } + else { + c3_y a_y[32], out_y[32]; + + memset(a_y, 0, 32); + u3r_bytes(0, met_w, a_y, a); + + urcrypt_ed_scalarmult_base(a_y, out_y); + return u3i_bytes(32, out_y); + } + } + u3_noun u3wee_scalarmult_base(u3_noun cor) { - u3_noun scalar = u3r_at(u3x_sam, cor); + u3_noun a = u3r_at(u3x_sam, cor); - if ( (u3_none == scalar) || (c3n == u3ud(scalar)) ) { + if ( (u3_none == a) || (c3n == u3ud(a)) ) { return u3m_bail(c3__exit); } - - c3_w met_w = u3r_met(3, scalar); - if ( met_w > 32 ) { - return u3m_bail(c3__fail); + else { + return u3qc_scalarmult_base(a); } - - c3_y scalar_y[32]; - memset(scalar_y, 0, 32); - u3r_bytes(0, met_w, scalar_y, scalar); - - ge_p3 R; - ge_scalarmult_base(&R, scalar_y); - - c3_y output_y[32]; - ge_p3_tobytes(output_y, &R); - - return u3i_bytes(32, output_y); } diff --git a/pkg/urcrypt/urcrypt.c b/pkg/urcrypt/urcrypt.c index 96b455ce4..2539e7ee9 100644 --- a/pkg/urcrypt/urcrypt.c +++ b/pkg/urcrypt/urcrypt.c @@ -49,6 +49,14 @@ urcrypt_ed_scalarmult(uint8_t a[32], uint8_t b[32], uint8_t out[32]) return 0; } +void +urcrypt_ed_scalarmult_base(uint8_t a[32], uint8_t out[32]) +{ + ge_p3 R; + ge_scalarmult_base(&R, a); + ge_p3_tobytes(out, &R); +} + void urcrypt_ed_sign(uint8_t *message, size_t length, diff --git a/pkg/urcrypt/urcrypt.h b/pkg/urcrypt/urcrypt.h index 1204cda38..d6019d684 100644 --- a/pkg/urcrypt/urcrypt.h +++ b/pkg/urcrypt/urcrypt.h @@ -8,6 +8,7 @@ int urcrypt_ed_point_add(uint8_t a[32], uint8_t b[32], uint8_t out[32]); int urcrypt_ed_scalarmult(uint8_t a[32], uint8_t b[32], uint8_t out[32]); +void urcrypt_ed_scalarmult_base(uint8_t a[32], uint8_t out[32]); void urcrypt_ed_sign(uint8_t *message, size_t length, uint8_t seed[32], From 5b9f60fd2fd005ab2b8a8cf442a0738e3c4e61e0 Mon Sep 17 00:00:00 2001 From: Paul Driver Date: Fri, 31 Jul 2020 14:21:02 -0700 Subject: [PATCH 007/329] urcrypt_ed_add_scalarmult_scalarmult_base --- .../e/ed_add_scalarmult_scalarmult_base.c | 66 ++++++------------- pkg/urcrypt/Makefile | 4 +- pkg/urcrypt/urcrypt.c | 23 +++++++ pkg/urcrypt/urcrypt.h | 4 ++ 4 files changed, 50 insertions(+), 47 deletions(-) diff --git a/pkg/urbit/jets/e/ed_add_scalarmult_scalarmult_base.c b/pkg/urbit/jets/e/ed_add_scalarmult_scalarmult_base.c index aea3c92af..8596ea536 100644 --- a/pkg/urbit/jets/e/ed_add_scalarmult_scalarmult_base.c +++ b/pkg/urbit/jets/e/ed_add_scalarmult_scalarmult_base.c @@ -2,61 +2,37 @@ ** */ #include "all.h" - - -#include -#include +#include /* functions */ - u3_noun u3qc_add_scalarmult_scalarmult_base(u3_atom a, - u3_atom a_point, - u3_atom b) + u3_atom b, + u3_atom c) { - c3_y met_w; + c3_w ate_w, bet_w, get_w; - met_w = u3r_met(3, a); - if (met_w > 32) { - return u3m_bail(c3__fail); + if ( ((ate_w = u3r_met(3, a)) > 32) || + ((bet_w = u3r_met(3, b)) > 32) || + ((get_w = u3r_met(3, c)) > 32) ) { + return u3_none; } - c3_y a_y[32]; - memset(a_y, 0, 32); - u3r_bytes(0, met_w, a_y, a); + else { + c3_y a_y[32], b_y[32], c_y[32], out_y[32]; - met_w = u3r_met(3, a_point); - if (met_w > 32) { - return u3m_bail(c3__fail); + memset(a_y, 0, 32); + memset(b_y, 0, 32); + memset(c_y, 0, 32); + u3r_bytes(0, ate_w, a_y, a); + u3r_bytes(0, bet_w, b_y, b); + u3r_bytes(0, get_w, c_y, c); + + return + ( 0 == urcrypt_ed_add_scalarmult_scalarmult_base(a_y, b_y, c_y, out_y) ) + ? u3i_bytes(32, out_y) + : u3_none; } - c3_y a_point_y[32]; - memset(a_point_y, 0, 32); - u3r_bytes(0, met_w, a_point_y, a_point); - - met_w = u3r_met(3, b); - if (met_w > 32) { - return u3m_bail(c3__fail); - } - c3_y b_y[32]; - memset(b_y, 0, 32); - u3r_bytes(0, met_w, b_y, b); - - ge_p3 A; - if (ge_frombytes_negate_vartime(&A, a_point_y) != 0) { - return u3m_bail(c3__exit); - } - - // Undo the negation from above. See add_scalar.c in the ed25519 distro. - fe_neg(A.X, A.X); - fe_neg(A.T, A.T); - - ge_p2 r; - ge_double_scalarmult_vartime(&r, a_y, &A, b_y); - - c3_y output_y[32]; - ge_tobytes(output_y, &r); - - return u3i_bytes(32, output_y); } u3_noun diff --git a/pkg/urcrypt/Makefile b/pkg/urcrypt/Makefile index d67fe974d..6c283fcc3 100644 --- a/pkg/urcrypt/Makefile +++ b/pkg/urcrypt/Makefile @@ -4,7 +4,7 @@ PREFIX ?= ./out ################################################################################ -.PHONY: all test install clean +.PHONY: all install clean CFLAGS := $(CFLAGS) -O3 -Wall -Werror -pedantic -std=gnu99 SOURCES = urcrypt.c urcrypt.h @@ -29,4 +29,4 @@ install: all cp urcrypt.h $(PREFIX)/include/ clean: - rm -rf ./out + rm urcrypt-static.o urcrypt-shared.o liburcrypt.a liburcrypt.so diff --git a/pkg/urcrypt/urcrypt.c b/pkg/urcrypt/urcrypt.c index 2539e7ee9..28796aa32 100644 --- a/pkg/urcrypt/urcrypt.c +++ b/pkg/urcrypt/urcrypt.c @@ -57,6 +57,29 @@ urcrypt_ed_scalarmult_base(uint8_t a[32], uint8_t out[32]) ge_p3_tobytes(out, &R); } +int +urcrypt_ed_add_scalarmult_scalarmult_base(uint8_t a[32], + uint8_t a_point[32], + uint8_t b[32], + uint8_t out[32]) +{ + ge_p2 r; + ge_p3 A; + + if (ge_frombytes_negate_vartime(&A, a_point) != 0) { + return -1; + } + + // Undo the negation from above. See add_scalar.c in the ed25519 distro. + fe_neg(A.X, A.X); + fe_neg(A.T, A.T); + + ge_double_scalarmult_vartime(&r, a, &A, b); + ge_tobytes(out, &r); + + return 0; +} + void urcrypt_ed_sign(uint8_t *message, size_t length, diff --git a/pkg/urcrypt/urcrypt.h b/pkg/urcrypt/urcrypt.h index d6019d684..d9bb411f5 100644 --- a/pkg/urcrypt/urcrypt.h +++ b/pkg/urcrypt/urcrypt.h @@ -9,6 +9,10 @@ int urcrypt_ed_point_add(uint8_t a[32], uint8_t b[32], uint8_t out[32]); int urcrypt_ed_scalarmult(uint8_t a[32], uint8_t b[32], uint8_t out[32]); void urcrypt_ed_scalarmult_base(uint8_t a[32], uint8_t out[32]); +int urcrypt_ed_add_scalarmult_scalarmult_base(uint8_t a[32], + uint8_t a_point[32], + uint8_t b[32], + uint8_t out[32]); void urcrypt_ed_sign(uint8_t *message, size_t length, uint8_t seed[32], From 2369b4eae26ac4069b458435631ced2b3c2dfbad Mon Sep 17 00:00:00 2001 From: Paul Driver Date: Fri, 31 Jul 2020 14:46:19 -0700 Subject: [PATCH 008/329] urcrypt_ed_add_double_scalarmult --- pkg/urbit/jets/e/ed_add_double_scalarmult.c | 94 +++++---------------- pkg/urcrypt/urcrypt.c | 39 +++++++++ pkg/urcrypt/urcrypt.h | 5 ++ 3 files changed, 67 insertions(+), 71 deletions(-) diff --git a/pkg/urbit/jets/e/ed_add_double_scalarmult.c b/pkg/urbit/jets/e/ed_add_double_scalarmult.c index cee7af3e5..46b9c9515 100644 --- a/pkg/urbit/jets/e/ed_add_double_scalarmult.c +++ b/pkg/urbit/jets/e/ed_add_double_scalarmult.c @@ -2,88 +2,40 @@ ** */ #include "all.h" - -#include -#include - -#include "ge-additions.h" +#include /* functions */ u3_noun u3qc_add_double_scalarmult(u3_atom a, - u3_atom a_point, u3_atom b, - u3_atom b_point) + u3_atom c, + u3_atom d) { - c3_y met_w; + c3_w ate_w, bet_w, get_w, det_w; - met_w = u3r_met(3, a); - if (met_w > 32) { - return u3m_bail(c3__fail); + if ( ((ate_w = u3r_met(3, a)) > 32) || + ((bet_w = u3r_met(3, b)) > 32) || + ((get_w = u3r_met(3, c)) > 32) || + ((det_w = u3r_met(3, d)) > 32) ) { + return u3_none; } - c3_y a_y[32]; - memset(a_y, 0, 32); - u3r_bytes(0, met_w, a_y, a); + else { + c3_y a_y[32], b_y[32], c_y[32], d_y[32], out_y[32]; - met_w = u3r_met(3, a_point); - if (met_w > 32) { - return u3m_bail(c3__fail); + memset(a_y, 0, 32); + memset(b_y, 0, 32); + memset(c_y, 0, 32); + memset(d_y, 0, 32); + u3r_bytes(0, ate_w, a_y, a); + u3r_bytes(0, bet_w, b_y, b); + u3r_bytes(0, get_w, c_y, c); + u3r_bytes(0, det_w, d_y, d); + + return ( 0 == urcrypt_ed_add_double_scalarmult(a_y, b_y, c_y, d_y, out_y) ) + ? u3i_bytes(32, out_y) + : u3_none; } - c3_y a_point_y[32]; - memset(a_point_y, 0, 32); - u3r_bytes(0, met_w, a_point_y, a_point); - - met_w = u3r_met(3, b); - if (met_w > 32) { - return u3m_bail(c3__fail); - } - c3_y b_y[32]; - memset(b_y, 0, 32); - u3r_bytes(0, met_w, b_y, b); - - met_w = u3r_met(3, b_point); - if (met_w > 32) { - return u3m_bail(c3__fail); - } - c3_y b_point_y[32]; - memset(b_point_y, 0, 32); - u3r_bytes(0, met_w, b_point_y, b_point); - - ge_p3 A; - if (ge_frombytes_negate_vartime(&A, a_point_y) != 0) { - return u3m_bail(c3__exit); - } - - ge_p3 B; - if (ge_frombytes_negate_vartime(&B, b_point_y) != 0) { - return u3m_bail(c3__exit); - } - - // Undo the negation from above. See add_scalar.c in the ed25519 distro. - fe_neg(A.X, A.X); - fe_neg(A.T, A.T); - fe_neg(B.X, B.X); - fe_neg(B.T, B.T); - - // Perform the multiplications of a*A and b*B - ge_p3 a_result, b_result; - ge_scalarmult(&a_result, a_y, &A); - ge_scalarmult(&b_result, b_y, &B); - - // Sum those two points - ge_cached b_result_cached; - ge_p3_to_cached(&b_result_cached, &b_result); - ge_p1p1 sum; - ge_add(&sum, &a_result, &b_result_cached); - - ge_p3 final_result; - ge_p1p1_to_p3(&final_result, &sum); - - c3_y output_y[32]; - ge_p3_tobytes(output_y, &final_result); - - return u3i_bytes(32, output_y); } u3_noun diff --git a/pkg/urcrypt/urcrypt.c b/pkg/urcrypt/urcrypt.c index 28796aa32..7cc214aaa 100644 --- a/pkg/urcrypt/urcrypt.c +++ b/pkg/urcrypt/urcrypt.c @@ -80,6 +80,45 @@ urcrypt_ed_add_scalarmult_scalarmult_base(uint8_t a[32], return 0; } +int +urcrypt_ed_add_double_scalarmult(uint8_t a[32], + uint8_t a_point[32], + uint8_t b[32], + uint8_t b_point[32], + uint8_t out[32]) +{ + ge_p3 A, B, a_result, b_result, final_result; + ge_cached b_result_cached; + ge_p1p1 sum; + + if ( ge_frombytes_negate_vartime(&A, a_point) != 0 ) { + return -1; + } + + if ( ge_frombytes_negate_vartime(&B, b_point) != 0 ) { + return -1; + } + + // Undo the negation from above. See add_scalar.c in the ed25519 distro. + fe_neg(A.X, A.X); + fe_neg(A.T, A.T); + fe_neg(B.X, B.X); + fe_neg(B.T, B.T); + + // Perform the multiplications of a*A and b*B + ge_scalarmult(&a_result, a, &A); + ge_scalarmult(&b_result, b, &B); + + // Sum those two points + ge_p3_to_cached(&b_result_cached, &b_result); + ge_add(&sum, &a_result, &b_result_cached); + + ge_p1p1_to_p3(&final_result, &sum); + ge_p3_tobytes(out, &final_result); + + return 0; +} + void urcrypt_ed_sign(uint8_t *message, size_t length, diff --git a/pkg/urcrypt/urcrypt.h b/pkg/urcrypt/urcrypt.h index d9bb411f5..62e0c279a 100644 --- a/pkg/urcrypt/urcrypt.h +++ b/pkg/urcrypt/urcrypt.h @@ -13,6 +13,11 @@ int urcrypt_ed_add_scalarmult_scalarmult_base(uint8_t a[32], uint8_t a_point[32], uint8_t b[32], uint8_t out[32]); +int urcrypt_ed_add_double_scalarmult(uint8_t a[32], + uint8_t a_point[32], + uint8_t b[32], + uint8_t b_point[32], + uint8_t out[32]); void urcrypt_ed_sign(uint8_t *message, size_t length, uint8_t seed[32], From bd17aa70ca3a6ce690c373fcfd52a9b11d49afe8 Mon Sep 17 00:00:00 2001 From: Paul Driver Date: Fri, 31 Jul 2020 16:31:56 -0700 Subject: [PATCH 009/329] urcrypt_ed_puck --- pkg/urbit/jets/e/ed_add_double_scalarmult.c | 6 +-- .../e/ed_add_scalarmult_scalarmult_base.c | 6 +-- pkg/urbit/jets/e/ed_point_add.c | 6 +-- pkg/urbit/jets/e/ed_puck.c | 37 +++++++++++-------- pkg/urbit/jets/e/ed_scalarmult.c | 6 +-- pkg/urbit/jets/e/ed_scalarmult_base.c | 6 +-- pkg/urbit/jets/e/ed_sign.c | 2 +- pkg/urcrypt/urcrypt.c | 7 ++++ pkg/urcrypt/urcrypt.h | 3 +- 9 files changed, 46 insertions(+), 33 deletions(-) diff --git a/pkg/urbit/jets/e/ed_add_double_scalarmult.c b/pkg/urbit/jets/e/ed_add_double_scalarmult.c index 46b9c9515..b177d826d 100644 --- a/pkg/urbit/jets/e/ed_add_double_scalarmult.c +++ b/pkg/urbit/jets/e/ed_add_double_scalarmult.c @@ -6,8 +6,8 @@ /* functions */ - u3_noun - u3qc_add_double_scalarmult(u3_atom a, + static u3_atom + _cqee_add_double_scalarmult(u3_atom a, u3_atom b, u3_atom c, u3_atom d) @@ -53,6 +53,6 @@ { return u3m_bail(c3__exit); } else { - return u3qc_add_double_scalarmult(a, b, c, d); + return _cqee_add_double_scalarmult(a, b, c, d); } } diff --git a/pkg/urbit/jets/e/ed_add_scalarmult_scalarmult_base.c b/pkg/urbit/jets/e/ed_add_scalarmult_scalarmult_base.c index 8596ea536..4ac8fc1ec 100644 --- a/pkg/urbit/jets/e/ed_add_scalarmult_scalarmult_base.c +++ b/pkg/urbit/jets/e/ed_add_scalarmult_scalarmult_base.c @@ -6,8 +6,8 @@ /* functions */ - u3_noun - u3qc_add_scalarmult_scalarmult_base(u3_atom a, + static u3_atom + _cqee_add_scalarmult_scalarmult_base(u3_atom a, u3_atom b, u3_atom c) { @@ -49,6 +49,6 @@ { return u3m_bail(c3__exit); } else { - return u3qc_add_scalarmult_scalarmult_base(a, b, c); + return _cqee_add_scalarmult_scalarmult_base(a, b, c); } } diff --git a/pkg/urbit/jets/e/ed_point_add.c b/pkg/urbit/jets/e/ed_point_add.c index a1eff2e58..fe105ac6e 100644 --- a/pkg/urbit/jets/e/ed_point_add.c +++ b/pkg/urbit/jets/e/ed_point_add.c @@ -7,8 +7,8 @@ /* functions */ - u3_noun - u3qc_point_add(u3_atom a, + static u3_atom + _cqee_point_add(u3_atom a, u3_atom b) { c3_w ate_w, bet_w; @@ -43,6 +43,6 @@ { return u3m_bail(c3__exit); } else { - return u3qc_point_add(a, b); + return _cqee_point_add(a, b); } } diff --git a/pkg/urbit/jets/e/ed_puck.c b/pkg/urbit/jets/e/ed_puck.c index 781899784..8c6f3760f 100644 --- a/pkg/urbit/jets/e/ed_puck.c +++ b/pkg/urbit/jets/e/ed_puck.c @@ -2,32 +2,37 @@ ** */ #include "all.h" - - -#include +#include /* functions */ + static u3_atom + _cqee_puck(u3_atom sed) + { + c3_y sed_y[32], pub_y[32]; + c3_w met_w; + + if ( (met_w = u3r_met(3, sed)) > 32 ) { + // hoon explicitly crashes on mis-size + return u3m_bail(c3__exit); + } + + memset(sed_y, 0, 32); + u3r_bytes(0, met_w, sed_y, sed); + + urcrypt_ed_puck(sed_y, pub_y); + return u3i_bytes(32, pub_y); + } + u3_noun u3wee_puck(u3_noun cor) { - c3_y pub_y[32]; - c3_y sec_y[64]; - c3_y sed_y[32]; - c3_w met_w; u3_noun a = u3r_at(u3x_sam, cor); if ( (u3_none == a) || (c3n == u3ud(a)) ) { return u3m_bail(c3__exit); } - - met_w = u3r_met(3, a); - if ( met_w > 32 ) { - return u3m_bail(c3__exit); + else { + return _cqee_puck(a); } - - memset(sed_y, 0, 32); - u3r_bytes(0, met_w, sed_y, a); - ed25519_create_keypair(pub_y, sec_y, sed_y); - return u3i_bytes(32, pub_y); } diff --git a/pkg/urbit/jets/e/ed_scalarmult.c b/pkg/urbit/jets/e/ed_scalarmult.c index 727ba9f7e..bee52d958 100644 --- a/pkg/urbit/jets/e/ed_scalarmult.c +++ b/pkg/urbit/jets/e/ed_scalarmult.c @@ -6,8 +6,8 @@ /* functions */ - u3_noun - u3qc_scalarmult(u3_atom a, + static u3_atom + _cqee_scalarmult(u3_atom a, u3_atom b) { c3_w ate_w, bet_w; @@ -47,6 +47,6 @@ { return u3m_bail(c3__exit); } else { - return u3qc_scalarmult(a, b); + return _cqee_scalarmult(a, b); } } diff --git a/pkg/urbit/jets/e/ed_scalarmult_base.c b/pkg/urbit/jets/e/ed_scalarmult_base.c index 3bdbedaa1..fb0d2f813 100644 --- a/pkg/urbit/jets/e/ed_scalarmult_base.c +++ b/pkg/urbit/jets/e/ed_scalarmult_base.c @@ -6,8 +6,8 @@ /* functions */ - u3_noun - u3qc_scalarmult_base(u3_atom a) + static u3_atom + _cqee_scalarmult_base(u3_atom a) { c3_w met_w = u3r_met(3, a); @@ -34,6 +34,6 @@ return u3m_bail(c3__exit); } else { - return u3qc_scalarmult_base(a); + return _cqee_scalarmult_base(a); } } diff --git a/pkg/urbit/jets/e/ed_sign.c b/pkg/urbit/jets/e/ed_sign.c index db59b1252..f26c04afd 100644 --- a/pkg/urbit/jets/e/ed_sign.c +++ b/pkg/urbit/jets/e/ed_sign.c @@ -6,7 +6,7 @@ /* functions */ - static u3_noun + static u3_atom _cqee_sign(u3_noun a, u3_noun b) { diff --git a/pkg/urcrypt/urcrypt.c b/pkg/urcrypt/urcrypt.c index 7cc214aaa..a6f9a64e1 100644 --- a/pkg/urcrypt/urcrypt.c +++ b/pkg/urcrypt/urcrypt.c @@ -119,6 +119,13 @@ urcrypt_ed_add_double_scalarmult(uint8_t a[32], return 0; } +void +urcrypt_ed_puck(uint8_t seed[32], uint8_t out[32]) +{ + uint8_t secret[64]; + ed25519_create_keypair(out, secret, seed); +} + void urcrypt_ed_sign(uint8_t *message, size_t length, diff --git a/pkg/urcrypt/urcrypt.h b/pkg/urcrypt/urcrypt.h index 62e0c279a..9ca52dd59 100644 --- a/pkg/urcrypt/urcrypt.h +++ b/pkg/urcrypt/urcrypt.h @@ -18,9 +18,10 @@ int urcrypt_ed_add_double_scalarmult(uint8_t a[32], uint8_t b[32], uint8_t b_point[32], uint8_t out[32]); +void urcrypt_ed_puck(uint8_t seed[32], uint8_t out[32]); void urcrypt_ed_sign(uint8_t *message, size_t length, uint8_t seed[32], - uint8_t signature[64]); + uint8_t out[64]); #endif From 98d2ad9f08d4da54ad407889b1e1617be86e85f6 Mon Sep 17 00:00:00 2001 From: Paul Driver Date: Fri, 31 Jul 2020 16:56:39 -0700 Subject: [PATCH 010/329] urcrypt_ed_shar --- pkg/urbit/jets/e/ed_shar.c | 39 ++++++++++++++++++-------------------- pkg/urcrypt/urcrypt.c | 13 +++++++++++++ pkg/urcrypt/urcrypt.h | 1 + 3 files changed, 32 insertions(+), 21 deletions(-) diff --git a/pkg/urbit/jets/e/ed_shar.c b/pkg/urbit/jets/e/ed_shar.c index d67110699..0c57bc97b 100644 --- a/pkg/urbit/jets/e/ed_shar.c +++ b/pkg/urbit/jets/e/ed_shar.c @@ -2,33 +2,30 @@ ** */ #include "all.h" +#include -#include - - u3_noun - u3qee_shar(u3_atom pub, u3_atom sek) + static u3_atom + _cqee_shar(u3_atom pub, u3_atom sek) { - c3_y pub_y[32], sek_y[32], self_y[32], exp_y[64], shr_y[32]; - c3_w met_pub_w, met_sek_w; + c3_w pet_w, set_w; - met_pub_w = u3r_met(3, pub); - met_sek_w = u3r_met(3, sek); - - if ( (met_pub_w > 32) || (met_sek_w > 32) ) { + if ( (pet_w = u3r_met(3, pub)) > 32 ) { + // pub is not size checked in the hoon + return u3_none; + } + else if ( (set_w = u3r_met(3, sek)) > 32 ) { + // sek explicitly bails through suck return u3m_bail(c3__exit); } + else { + c3_y pub_y[32], sek_y[32], shr_y[32]; - u3r_bytes(0, 32, pub_y, pub); - u3r_bytes(0, 32, sek_y, sek); + u3r_bytes(0, 32, pub_y, pub); + u3r_bytes(0, 32, sek_y, sek); - memset(self_y, 0, 32); - memset(exp_y, 0, 64); - memset(shr_y, 0, 32); - - ed25519_create_keypair(self_y, exp_y, sek_y); - ed25519_key_exchange(shr_y, pub_y, exp_y); - - return u3i_bytes(32, shr_y); + urcrypt_ed_shar(pub_y, sek_y, shr_y); + return u3i_bytes(32, shr_y); + } } u3_noun @@ -42,6 +39,6 @@ { return u3m_bail(c3__exit); } else { - return u3qee_shar(pub, sek); + return _cqee_shar(pub, sek); } } diff --git a/pkg/urcrypt/urcrypt.c b/pkg/urcrypt/urcrypt.c index a6f9a64e1..4d7f9f875 100644 --- a/pkg/urcrypt/urcrypt.c +++ b/pkg/urcrypt/urcrypt.c @@ -126,6 +126,19 @@ urcrypt_ed_puck(uint8_t seed[32], uint8_t out[32]) ed25519_create_keypair(out, secret, seed); } +void +urcrypt_ed_shar(uint8_t public[32], uint8_t seed[32], uint8_t out[32]) +{ + uint8_t self[32], exp[64]; + + memset(self, 0, 32); + memset(exp, 0, 64); + memset(out, 0, 32); + + ed25519_create_keypair(self, exp, seed); + ed25519_key_exchange(out, public, exp); +} + void urcrypt_ed_sign(uint8_t *message, size_t length, diff --git a/pkg/urcrypt/urcrypt.h b/pkg/urcrypt/urcrypt.h index 9ca52dd59..2d21bd74e 100644 --- a/pkg/urcrypt/urcrypt.h +++ b/pkg/urcrypt/urcrypt.h @@ -19,6 +19,7 @@ int urcrypt_ed_add_double_scalarmult(uint8_t a[32], uint8_t b_point[32], uint8_t out[32]); void urcrypt_ed_puck(uint8_t seed[32], uint8_t out[32]); +void urcrypt_ed_shar(uint8_t public[32], uint8_t seed[32], uint8_t out[32]); void urcrypt_ed_sign(uint8_t *message, size_t length, uint8_t seed[32], From 542bd55dc26a73200fbe77d8c15a157273bcee2a Mon Sep 17 00:00:00 2001 From: Paul Driver Date: Fri, 31 Jul 2020 17:30:09 -0700 Subject: [PATCH 011/329] urcrypt_ed_veri --- pkg/urbit/jets/e/ed_shar.c | 2 ++ pkg/urbit/jets/e/ed_veri.c | 42 ++++++++++++++++++++------------------ pkg/urcrypt/urcrypt.c | 9 ++++++++ pkg/urcrypt/urcrypt.h | 3 +++ 4 files changed, 36 insertions(+), 20 deletions(-) diff --git a/pkg/urbit/jets/e/ed_shar.c b/pkg/urbit/jets/e/ed_shar.c index 0c57bc97b..5bf93a645 100644 --- a/pkg/urbit/jets/e/ed_shar.c +++ b/pkg/urbit/jets/e/ed_shar.c @@ -20,6 +20,8 @@ else { c3_y pub_y[32], sek_y[32], shr_y[32]; + memset(pub_y, 0, 32); + memset(sek_y, 0, 32); u3r_bytes(0, 32, pub_y, pub); u3r_bytes(0, 32, sek_y, sek); diff --git a/pkg/urbit/jets/e/ed_veri.c b/pkg/urbit/jets/e/ed_veri.c index 146ec54c6..634c95509 100644 --- a/pkg/urbit/jets/e/ed_veri.c +++ b/pkg/urbit/jets/e/ed_veri.c @@ -2,36 +2,38 @@ ** */ #include "all.h" - - -#include +#include /* functions */ - static u3_noun + static u3_atom _cqee_veri(u3_noun s, u3_noun m, u3_noun pk) { - c3_y sig_y[64]; - c3_y pub_y[32]; - c3_w ret; - c3_y* mes_y; + c3_w set_w, pek_w; - c3_w mesm_w = u3r_met(3, m); + if ( ((set_w = u3r_met(3, s)) > 64) || + ((pek_w = u3r_met(3, pk)) > 32) ) { + // hoon checks sizes, but weirdly and without crashes + return u3_none; + } + else { + c3_y sig_y[64], pub_y[32]; + c3_w met_w = u3r_met(3, m); + c3_y* mes_y = u3a_malloc(met_w); + c3_o ret_o; - memset(sig_y, 0, 64); - memset(pub_y, 0, 32); + memset(sig_y, 0, 64); + memset(pub_y, 0, 32); + u3r_bytes(0, 64, sig_y, s); + u3r_bytes(0, 32, pub_y, pk); + u3r_bytes(0, met_w, mes_y, m); - mes_y = u3a_malloc(mesm_w); - - u3r_bytes(0, 64, sig_y, s); - u3r_bytes(0, 32, pub_y, pk); - u3r_bytes(0, mesm_w, mes_y, m); - - ret = ed25519_verify(sig_y, mes_y, mesm_w, pub_y) == 1 ? c3y : c3n; - u3a_free(mes_y); - return ret; + ret_o = urcrypt_ed_veri(mes_y, met_w, pub_y, sig_y) ? c3y : c3n; + u3a_free(mes_y); + return ret_o; + } } u3_noun diff --git a/pkg/urcrypt/urcrypt.c b/pkg/urcrypt/urcrypt.c index 4d7f9f875..c44cae36f 100644 --- a/pkg/urcrypt/urcrypt.c +++ b/pkg/urcrypt/urcrypt.c @@ -154,3 +154,12 @@ urcrypt_ed_sign(uint8_t *message, ed25519_create_keypair(public, secret, seed); ed25519_sign(out, message, length, public, secret); } + +bool +urcrypt_ed_veri(uint8_t *message, size_t length, + uint8_t public[32], uint8_t signature[64]) +{ + return ( ed25519_verify(signature, message, length, public) == 1 ) + ? true + : false; +} diff --git a/pkg/urcrypt/urcrypt.h b/pkg/urcrypt/urcrypt.h index 2d21bd74e..3a15c0412 100644 --- a/pkg/urcrypt/urcrypt.h +++ b/pkg/urcrypt/urcrypt.h @@ -2,6 +2,7 @@ #define URCRYPT_H #include +#include #include #include #include @@ -25,4 +26,6 @@ void urcrypt_ed_sign(uint8_t *message, uint8_t seed[32], uint8_t out[64]); +bool urcrypt_ed_veri(uint8_t *message, size_t length, + uint8_t signature[64], uint8_t public[32]); #endif From 84c959313d35eecceb2cd4b745a103433a78e0f9 Mon Sep 17 00:00:00 2001 From: Paul Driver Date: Tue, 4 Aug 2020 13:10:30 -0700 Subject: [PATCH 012/329] begin move to u3r_unpack() (new function) for consistency in crypto jets combining the padding and length checking into one function helps make the crypto jets really boring and easy to scan, improving auditability. --- pkg/urbit/include/noun/retrieve.h | 9 +++++++ pkg/urbit/jets/e/ed_add_double_scalarmult.c | 29 +++++++-------------- pkg/urbit/noun/retrieve.c | 17 ++++++++++++ 3 files changed, 35 insertions(+), 20 deletions(-) diff --git a/pkg/urbit/include/noun/retrieve.h b/pkg/urbit/include/noun/retrieve.h index eed2bcc91..c17877d9d 100644 --- a/pkg/urbit/include/noun/retrieve.h +++ b/pkg/urbit/include/noun/retrieve.h @@ -346,6 +346,15 @@ c3_y* c_y, u3_atom d); + /* u3r_unpack(): + ** + ** Copy (len_w) bytes of (a) into (buf_y) if it fits, returning overage + */ + c3_w + u3r_unpack(c3_w len_w, + c3_y *buf_y, + u3_atom a); + /* u3r_chop(): ** ** Into the bloq space of `met`, from position `fum` for a diff --git a/pkg/urbit/jets/e/ed_add_double_scalarmult.c b/pkg/urbit/jets/e/ed_add_double_scalarmult.c index b177d826d..a89ed34d1 100644 --- a/pkg/urbit/jets/e/ed_add_double_scalarmult.c +++ b/pkg/urbit/jets/e/ed_add_double_scalarmult.c @@ -12,29 +12,18 @@ u3_atom c, u3_atom d) { - c3_w ate_w, bet_w, get_w, det_w; + c3_y a_y[32], b_y[32], c_y[32], d_y[32], out_y[32]; - if ( ((ate_w = u3r_met(3, a)) > 32) || - ((bet_w = u3r_met(3, b)) > 32) || - ((get_w = u3r_met(3, c)) > 32) || - ((det_w = u3r_met(3, d)) > 32) ) { - return u3_none; + if ( (0 == u3r_unpack(32, a_y, a)) && + (0 == u3r_unpack(32, b_y, b)) && + (0 == u3r_unpack(32, c_y, c)) && + (0 == u3r_unpack(32, d_y, d)) && + (0 == urcrypt_ed_add_double_scalarmult(a_y, b_y, c_y, d_y, out_y)) ) + { + return u3i_bytes(32, out_y); } else { - c3_y a_y[32], b_y[32], c_y[32], d_y[32], out_y[32]; - - memset(a_y, 0, 32); - memset(b_y, 0, 32); - memset(c_y, 0, 32); - memset(d_y, 0, 32); - u3r_bytes(0, ate_w, a_y, a); - u3r_bytes(0, bet_w, b_y, b); - u3r_bytes(0, get_w, c_y, c); - u3r_bytes(0, det_w, d_y, d); - - return ( 0 == urcrypt_ed_add_double_scalarmult(a_y, b_y, c_y, d_y, out_y) ) - ? u3i_bytes(32, out_y) - : u3_none; + return u3_none; } } diff --git a/pkg/urbit/noun/retrieve.c b/pkg/urbit/noun/retrieve.c index 63589ab1e..36fed5073 100644 --- a/pkg/urbit/noun/retrieve.c +++ b/pkg/urbit/noun/retrieve.c @@ -1076,6 +1076,23 @@ u3r_bytes(c3_w a_w, } } +/* u3r_unpack(): +** +** Copy (len_w) bytes of (a) into (buf_y) if it fits, returning overage +*/ +c3_w +u3r_unpack(c3_w len_w, c3_y *buf_y, u3_atom a) +{ + c3_w met_w = u3r_met(3, a); + if ( met_w <= len_w ) { + u3r_bytes(0, len_w, buf_y, a); + return 0; + } + else { + return len_w - met_w; + } +} + /* u3r_mp(): ** ** Copy (b) into (a_mp). From 4218308d040793021b277717c569a2bc9633f618 Mon Sep 17 00:00:00 2001 From: Paul Driver Date: Tue, 4 Aug 2020 13:42:10 -0700 Subject: [PATCH 013/329] more unpacks --- pkg/urbit/jets/e/ed_add_double_scalarmult.c | 3 +-- .../e/ed_add_scalarmult_scalarmult_base.c | 25 ++++++------------- pkg/urbit/jets/e/ed_point_add.c | 20 +++++---------- pkg/urbit/jets/e/ed_puck.c | 12 ++++----- pkg/urbit/jets/e/ed_scalarmult.c | 24 +++++------------- 5 files changed, 25 insertions(+), 59 deletions(-) diff --git a/pkg/urbit/jets/e/ed_add_double_scalarmult.c b/pkg/urbit/jets/e/ed_add_double_scalarmult.c index a89ed34d1..58b2a0781 100644 --- a/pkg/urbit/jets/e/ed_add_double_scalarmult.c +++ b/pkg/urbit/jets/e/ed_add_double_scalarmult.c @@ -18,8 +18,7 @@ (0 == u3r_unpack(32, b_y, b)) && (0 == u3r_unpack(32, c_y, c)) && (0 == u3r_unpack(32, d_y, d)) && - (0 == urcrypt_ed_add_double_scalarmult(a_y, b_y, c_y, d_y, out_y)) ) - { + (0 == urcrypt_ed_add_double_scalarmult(a_y, b_y, c_y, d_y, out_y)) ) { return u3i_bytes(32, out_y); } else { diff --git a/pkg/urbit/jets/e/ed_add_scalarmult_scalarmult_base.c b/pkg/urbit/jets/e/ed_add_scalarmult_scalarmult_base.c index 4ac8fc1ec..395fccd8f 100644 --- a/pkg/urbit/jets/e/ed_add_scalarmult_scalarmult_base.c +++ b/pkg/urbit/jets/e/ed_add_scalarmult_scalarmult_base.c @@ -11,27 +11,16 @@ u3_atom b, u3_atom c) { - c3_w ate_w, bet_w, get_w; + c3_y a_y[32], b_y[32], c_y[32], out_y[32]; - if ( ((ate_w = u3r_met(3, a)) > 32) || - ((bet_w = u3r_met(3, b)) > 32) || - ((get_w = u3r_met(3, c)) > 32) ) { - return u3_none; + if ( (0 == u3r_unpack(32, a_y, a)) && + (0 == u3r_unpack(32, b_y, b)) && + (0 == u3r_unpack(32, c_y, c)) && + (0 == urcrypt_ed_add_scalarmult_scalarmult_base(a_y, b_y, c_y, out_y)) ) { + return u3i_bytes(32, out_y); } else { - c3_y a_y[32], b_y[32], c_y[32], out_y[32]; - - memset(a_y, 0, 32); - memset(b_y, 0, 32); - memset(c_y, 0, 32); - u3r_bytes(0, ate_w, a_y, a); - u3r_bytes(0, bet_w, b_y, b); - u3r_bytes(0, get_w, c_y, c); - - return - ( 0 == urcrypt_ed_add_scalarmult_scalarmult_base(a_y, b_y, c_y, out_y) ) - ? u3i_bytes(32, out_y) - : u3_none; + return u3_none; } } diff --git a/pkg/urbit/jets/e/ed_point_add.c b/pkg/urbit/jets/e/ed_point_add.c index fe105ac6e..c21bdab0e 100644 --- a/pkg/urbit/jets/e/ed_point_add.c +++ b/pkg/urbit/jets/e/ed_point_add.c @@ -11,23 +11,15 @@ _cqee_point_add(u3_atom a, u3_atom b) { - c3_w ate_w, bet_w; + c3_y a_y[32], b_y[32], out_y[32]; - if ( ((ate_w = u3r_met(3, a)) > 32) || - ((bet_w = u3r_met(3, b)) > 32) ) { - return u3_none; + if ( (0 == u3r_unpack(32, a_y, a)) && + (0 == u3r_unpack(32, b_y, b)) && + (0 == urcrypt_ed_point_add(a_y, b_y, out_y)) ) { + return u3i_bytes(32, out_y); } else { - c3_y a_y[32], b_y[32], out_y[32]; - - memset(a_y, 0, 32); - memset(b_y, 0, 32); - u3r_bytes(0, ate_w, a_y, a); - u3r_bytes(0, bet_w, b_y, b); - - return ( 0 == urcrypt_ed_point_add(a_y, b_y, out_y) ) - ? u3i_bytes(32, out_y) - : u3_none; + return u3_none; } } diff --git a/pkg/urbit/jets/e/ed_puck.c b/pkg/urbit/jets/e/ed_puck.c index 8c6f3760f..5154df4e5 100644 --- a/pkg/urbit/jets/e/ed_puck.c +++ b/pkg/urbit/jets/e/ed_puck.c @@ -12,16 +12,14 @@ c3_y sed_y[32], pub_y[32]; c3_w met_w; - if ( (met_w = u3r_met(3, sed)) > 32 ) { + if ( 0 == u3r_unpack(32, sed_y, sed) ) { + urcrypt_ed_puck(sed_y, pub_y); + return u3i_bytes(32, pub_y); + } + else { // hoon explicitly crashes on mis-size return u3m_bail(c3__exit); } - - memset(sed_y, 0, 32); - u3r_bytes(0, met_w, sed_y, sed); - - urcrypt_ed_puck(sed_y, pub_y); - return u3i_bytes(32, pub_y); } u3_noun diff --git a/pkg/urbit/jets/e/ed_scalarmult.c b/pkg/urbit/jets/e/ed_scalarmult.c index bee52d958..96e0e757b 100644 --- a/pkg/urbit/jets/e/ed_scalarmult.c +++ b/pkg/urbit/jets/e/ed_scalarmult.c @@ -10,29 +10,17 @@ _cqee_scalarmult(u3_atom a, u3_atom b) { - c3_w ate_w, bet_w; c3_y a_y[32], b_y[32], out_y[32]; - if ( (ate_w = u3r_met(3, a)) > 32 ) { + if ( (0 == u3r_unpack(32, a_y, a)) && + (0 == u3r_unpack(32, b_y, b)) && + (0 == urcrypt_ed_scalarmult(a_y, b_y, out_y)) ) { + return u3i_bytes(32, out_y); + } + else { // hoon does not check size of inputs return u3_none; } - - if ( (bet_w = u3r_met(3, b)) > 32 ) { - return u3_none; - } - - memset(a_y, 0, 32); - memset(b_y, 0, 32); - u3r_bytes(0, ate_w, a_y, a); - u3r_bytes(0, bet_w, b_y, b); - - if ( 0 != urcrypt_ed_scalarmult(a_y, b_y, out_y) ) { - // this is unlikely to happen, but there is a return code. - return u3_none; - } - - return u3i_bytes(32, out_y); } u3_noun From c8714ebc54fa61fa8ad089baa7fc009ea6511568 Mon Sep 17 00:00:00 2001 From: Paul Driver Date: Tue, 4 Aug 2020 16:58:38 -0700 Subject: [PATCH 014/329] rest of the unpacks --- pkg/urbit/jets/e/ed_add_double_scalarmult.c | 14 ++++++------ .../e/ed_add_scalarmult_scalarmult_base.c | 12 +++++----- pkg/urbit/jets/e/ed_point_add.c | 10 ++++----- pkg/urbit/jets/e/ed_puck.c | 14 ++++++------ pkg/urbit/jets/e/ed_scalarmult.c | 12 +++++----- pkg/urbit/jets/e/ed_scalarmult_base.c | 10 +++------ pkg/urbit/jets/e/ed_shar.c | 14 ++++-------- pkg/urbit/jets/e/ed_sign.c | 20 ++++++++--------- pkg/urbit/jets/e/ed_veri.c | 22 ++++++++----------- 9 files changed, 56 insertions(+), 72 deletions(-) diff --git a/pkg/urbit/jets/e/ed_add_double_scalarmult.c b/pkg/urbit/jets/e/ed_add_double_scalarmult.c index 58b2a0781..e49a0bf16 100644 --- a/pkg/urbit/jets/e/ed_add_double_scalarmult.c +++ b/pkg/urbit/jets/e/ed_add_double_scalarmult.c @@ -14,15 +14,15 @@ { c3_y a_y[32], b_y[32], c_y[32], d_y[32], out_y[32]; - if ( (0 == u3r_unpack(32, a_y, a)) && - (0 == u3r_unpack(32, b_y, b)) && - (0 == u3r_unpack(32, c_y, c)) && - (0 == u3r_unpack(32, d_y, d)) && - (0 == urcrypt_ed_add_double_scalarmult(a_y, b_y, c_y, d_y, out_y)) ) { - return u3i_bytes(32, out_y); + if ( (0 != u3r_unpack(32, a_y, a)) || + (0 != u3r_unpack(32, b_y, b)) || + (0 != u3r_unpack(32, c_y, c)) || + (0 != u3r_unpack(32, d_y, d)) || + (0 != urcrypt_ed_add_double_scalarmult(a_y, b_y, c_y, d_y, out_y)) ) { + return u3_none; } else { - return u3_none; + return u3i_bytes(32, out_y); } } diff --git a/pkg/urbit/jets/e/ed_add_scalarmult_scalarmult_base.c b/pkg/urbit/jets/e/ed_add_scalarmult_scalarmult_base.c index 395fccd8f..0a0e2d2d4 100644 --- a/pkg/urbit/jets/e/ed_add_scalarmult_scalarmult_base.c +++ b/pkg/urbit/jets/e/ed_add_scalarmult_scalarmult_base.c @@ -13,14 +13,14 @@ { c3_y a_y[32], b_y[32], c_y[32], out_y[32]; - if ( (0 == u3r_unpack(32, a_y, a)) && - (0 == u3r_unpack(32, b_y, b)) && - (0 == u3r_unpack(32, c_y, c)) && - (0 == urcrypt_ed_add_scalarmult_scalarmult_base(a_y, b_y, c_y, out_y)) ) { - return u3i_bytes(32, out_y); + if ( (0 != u3r_unpack(32, a_y, a)) || + (0 != u3r_unpack(32, b_y, b)) || + (0 != u3r_unpack(32, c_y, c)) || + (0 != urcrypt_ed_add_scalarmult_scalarmult_base(a_y, b_y, c_y, out_y)) ) { + return u3_none; } else { - return u3_none; + return u3i_bytes(32, out_y); } } diff --git a/pkg/urbit/jets/e/ed_point_add.c b/pkg/urbit/jets/e/ed_point_add.c index c21bdab0e..a93f798b3 100644 --- a/pkg/urbit/jets/e/ed_point_add.c +++ b/pkg/urbit/jets/e/ed_point_add.c @@ -13,13 +13,13 @@ { c3_y a_y[32], b_y[32], out_y[32]; - if ( (0 == u3r_unpack(32, a_y, a)) && - (0 == u3r_unpack(32, b_y, b)) && - (0 == urcrypt_ed_point_add(a_y, b_y, out_y)) ) { - return u3i_bytes(32, out_y); + if ( (0 != u3r_unpack(32, a_y, a)) || + (0 != u3r_unpack(32, b_y, b)) || + (0 != urcrypt_ed_point_add(a_y, b_y, out_y)) ) { + return u3_none; } else { - return u3_none; + return u3i_bytes(32, out_y); } } diff --git a/pkg/urbit/jets/e/ed_puck.c b/pkg/urbit/jets/e/ed_puck.c index 5154df4e5..8257b937e 100644 --- a/pkg/urbit/jets/e/ed_puck.c +++ b/pkg/urbit/jets/e/ed_puck.c @@ -9,17 +9,17 @@ static u3_atom _cqee_puck(u3_atom sed) { - c3_y sed_y[32], pub_y[32]; - c3_w met_w; + c3_y sed_y[32]; - if ( 0 == u3r_unpack(32, sed_y, sed) ) { - urcrypt_ed_puck(sed_y, pub_y); - return u3i_bytes(32, pub_y); - } - else { + if ( 0 != u3r_unpack(32, sed_y, sed) ) { // hoon explicitly crashes on mis-size return u3m_bail(c3__exit); } + else { + c3_y pub_y[32]; + urcrypt_ed_puck(sed_y, pub_y); + return u3i_bytes(32, pub_y); + } } u3_noun diff --git a/pkg/urbit/jets/e/ed_scalarmult.c b/pkg/urbit/jets/e/ed_scalarmult.c index 96e0e757b..224fba3f6 100644 --- a/pkg/urbit/jets/e/ed_scalarmult.c +++ b/pkg/urbit/jets/e/ed_scalarmult.c @@ -12,15 +12,15 @@ { c3_y a_y[32], b_y[32], out_y[32]; - if ( (0 == u3r_unpack(32, a_y, a)) && - (0 == u3r_unpack(32, b_y, b)) && - (0 == urcrypt_ed_scalarmult(a_y, b_y, out_y)) ) { - return u3i_bytes(32, out_y); - } - else { + if ( (0 != u3r_unpack(32, a_y, a)) || + (0 != u3r_unpack(32, b_y, b)) || + (0 != urcrypt_ed_scalarmult(a_y, b_y, out_y)) ) { // hoon does not check size of inputs return u3_none; } + else { + return u3i_bytes(32, out_y); + } } u3_noun diff --git a/pkg/urbit/jets/e/ed_scalarmult_base.c b/pkg/urbit/jets/e/ed_scalarmult_base.c index fb0d2f813..c1b641bd9 100644 --- a/pkg/urbit/jets/e/ed_scalarmult_base.c +++ b/pkg/urbit/jets/e/ed_scalarmult_base.c @@ -9,17 +9,13 @@ static u3_atom _cqee_scalarmult_base(u3_atom a) { - c3_w met_w = u3r_met(3, a); + c3_y a_y[32]; - if ( met_w > 32 ) { + if ( 0 != u3r_unpack(32, a_y, a) ) { return u3_none; } else { - c3_y a_y[32], out_y[32]; - - memset(a_y, 0, 32); - u3r_bytes(0, met_w, a_y, a); - + c3_y out_y[32]; urcrypt_ed_scalarmult_base(a_y, out_y); return u3i_bytes(32, out_y); } diff --git a/pkg/urbit/jets/e/ed_shar.c b/pkg/urbit/jets/e/ed_shar.c index 5bf93a645..5ed28df37 100644 --- a/pkg/urbit/jets/e/ed_shar.c +++ b/pkg/urbit/jets/e/ed_shar.c @@ -7,24 +7,18 @@ static u3_atom _cqee_shar(u3_atom pub, u3_atom sek) { - c3_w pet_w, set_w; + c3_y pub_y[32], sek_y[32]; - if ( (pet_w = u3r_met(3, pub)) > 32 ) { + if ( 0 != u3r_unpack(32, pub_y, pub) ) { // pub is not size checked in the hoon return u3_none; } - else if ( (set_w = u3r_met(3, sek)) > 32 ) { + else if ( 0 != u3r_unpack(32, sek_y, sek) ) { // sek explicitly bails through suck return u3m_bail(c3__exit); } else { - c3_y pub_y[32], sek_y[32], shr_y[32]; - - memset(pub_y, 0, 32); - memset(sek_y, 0, 32); - u3r_bytes(0, 32, pub_y, pub); - u3r_bytes(0, 32, sek_y, sek); - + c3_y shr_y[32]; urcrypt_ed_shar(pub_y, sek_y, shr_y); return u3i_bytes(32, shr_y); } diff --git a/pkg/urbit/jets/e/ed_sign.c b/pkg/urbit/jets/e/ed_sign.c index f26c04afd..606282947 100644 --- a/pkg/urbit/jets/e/ed_sign.c +++ b/pkg/urbit/jets/e/ed_sign.c @@ -10,24 +10,22 @@ _cqee_sign(u3_noun a, u3_noun b) { - c3_w b_w = u3r_met(3, b); + c3_y sed_y[32]; - if ( b_w > 32 ) { + if ( 0 != u3r_unpack(32, sed_y, b) ) { // hoon calls suck, which calls puck, which crashes return u3m_bail(c3__exit); } else { - c3_w a_w = u3r_met(3, a); - c3_y* mes_y = u3a_malloc(a_w); - c3_y sed_y[32], sig_y[64]; - - memset(sed_y, 0, 32); - u3r_bytes(0, a_w, mes_y, a); - u3r_bytes(0, b_w, sed_y, b); - - urcrypt_ed_sign(mes_y, a_w, sed_y, sig_y); + c3_y sig_y[64]; + c3_y* mes_y; + c3_w met_w = u3r_met(3, a); + mes_y = u3a_malloc(met_w); + u3r_bytes(0, met_w, mes_y, a); + urcrypt_ed_sign(mes_y, met_w, sed_y, sig_y); u3a_free(mes_y); + return u3i_bytes(64, sig_y); } } diff --git a/pkg/urbit/jets/e/ed_veri.c b/pkg/urbit/jets/e/ed_veri.c index 634c95509..646dd89ca 100644 --- a/pkg/urbit/jets/e/ed_veri.c +++ b/pkg/urbit/jets/e/ed_veri.c @@ -11,28 +11,24 @@ u3_noun m, u3_noun pk) { - c3_w set_w, pek_w; + c3_y sig_y[64], pub_y[32]; - if ( ((set_w = u3r_met(3, s)) > 64) || - ((pek_w = u3r_met(3, pk)) > 32) ) { + if ( (0 != u3r_unpack(64, sig_y, s)) || + (0 != u3r_unpack(32, pub_y, pk)) ) { // hoon checks sizes, but weirdly and without crashes return u3_none; } else { - c3_y sig_y[64], pub_y[32]; + c3_t val_t; + c3_y* mes_y; c3_w met_w = u3r_met(3, m); - c3_y* mes_y = u3a_malloc(met_w); - c3_o ret_o; - memset(sig_y, 0, 64); - memset(pub_y, 0, 32); - u3r_bytes(0, 64, sig_y, s); - u3r_bytes(0, 32, pub_y, pk); + mes_y = u3a_malloc(met_w); u3r_bytes(0, met_w, mes_y, m); - - ret_o = urcrypt_ed_veri(mes_y, met_w, pub_y, sig_y) ? c3y : c3n; + val_t = urcrypt_ed_veri(mes_y, met_w, pub_y, sig_y); u3a_free(mes_y); - return ret_o; + + return val_t ? c3y : c3n; } } From cd4b8cb9b05af84cc5649f12fc3c634046c02437 Mon Sep 17 00:00:00 2001 From: Paul Driver Date: Wed, 5 Aug 2020 16:06:04 -0700 Subject: [PATCH 015/329] aes_ecb -> urcrypt --- nix/pkgs/urcrypt/default.nix | 2 +- pkg/urbit/jets/e/aes_ecb.c | 327 ++++++----------------------------- pkg/urcrypt/Makefile | 2 +- pkg/urcrypt/urcrypt.c | 122 +++++++++++++ pkg/urcrypt/urcrypt.h | 11 ++ 5 files changed, 191 insertions(+), 273 deletions(-) diff --git a/nix/pkgs/urcrypt/default.nix b/nix/pkgs/urcrypt/default.nix index 4367c6597..592e46cfe 100644 --- a/nix/pkgs/urcrypt/default.nix +++ b/nix/pkgs/urcrypt/default.nix @@ -5,5 +5,5 @@ pkgs.stdenv.mkDerivation rec { builder = ./builder.sh; src = ../../../pkg/urcrypt; - buildInputs = [ ed25519 ge-additions ]; + buildInputs = [ pkgs.openssl ed25519 ge-additions ]; } diff --git a/pkg/urbit/jets/e/aes_ecb.c b/pkg/urbit/jets/e/aes_ecb.c index be7d12008..3aae07d54 100644 --- a/pkg/urbit/jets/e/aes_ecb.c +++ b/pkg/urbit/jets/e/aes_ecb.c @@ -2,64 +2,26 @@ ** */ #include "all.h" - -#include - -#include "aes_siv.h" +#include /* functions */ - u3_noun - u3qea_ecba_en(u3_atom key, + + static u3_atom + _cqea_ecba_en(u3_atom key, u3_atom blk) { - c3_y key_y[16]; - c3_y blk_y[16]; - AES_KEY key_u; + c3_y key_y[16], blk_y[16], out_y[16]; - c3_assert(u3r_met(3, key) <= 16); - c3_assert(u3r_met(3, blk) <= 16); + u3r_bytes(0, 16, key_y, key); + u3r_bytes(0, 16, blk_y, blk); - { - int i = 15; - - do { - key_y[i] = u3r_byte(15-i, key); - i--; - } while (i >= 0); - } - { - int i = 15; - - do { - blk_y[i] = u3r_byte(15-i, blk); - i--; - } while (i >= 0); - } - - if ( 0 != AES_set_encrypt_key(key_y, 128, &key_u) ) { - return u3m_bail(c3__exit); + if ( 0 != urcrypt_aes_ecba_en(key_y, blk_y, out_y) ) { + return u3_none; } else { - AES_ecb_encrypt(blk_y, blk_y, &key_u, AES_ENCRYPT); + return u3i_bytes(16, out_y); } - - /* array reverse - we can write backwards u3i_bytes * - * in the unlikely event that this becomes a problem */ - { - int i = 15; - int j = 0; - c3_y tmp; - - do { - tmp = blk_y[i]; - blk_y[i] = blk_y[j]; - blk_y[j] = tmp; - i--; j++; - } while (i > j); - } - - return u3i_bytes(16, blk_y); } u3_noun @@ -72,60 +34,25 @@ c3n == u3ud(b) ) { return u3m_bail(c3__exit); } else { - return u3qea_ecba_en(a, b); + return _cqea_ecba_en(a, b); } } - u3_noun - u3qea_ecba_de(u3_atom key, + static u3_atom + _cqea_ecba_de(u3_atom key, u3_atom blk) { - c3_y key_y[16]; - c3_y blk_y[16]; - AES_KEY key_u; + c3_y key_y[16], blk_y[16], out_y[16]; - c3_assert(u3r_met(3, key) <= 16); - c3_assert(u3r_met(3, blk) <= 16); + u3r_bytes(0, 16, key_y, key); + u3r_bytes(0, 16, blk_y, blk); - { - int i = 15; - - do { - key_y[i] = u3r_byte(15-i, key); - i--; - } while (i >= 0); - } - { - int i = 15; - - do { - blk_y[i] = u3r_byte(15-i, blk); - i--; - } while (i >= 0); - } - - if ( 0 != AES_set_decrypt_key(key_y, 128, &key_u) ) { - return u3m_bail(c3__exit); + if ( 0 != urcrypt_aes_ecba_de(key_y, blk_y, out_y) ) { + return u3_none; } else { - AES_ecb_encrypt(blk_y, blk_y, &key_u, AES_DECRYPT); + return u3i_bytes(16, out_y); } - - /* array reverse - we can write backwards u3i_bytes * - * in the unlikely event that this becomes a problem */ - { - int i = 15; - int j = 0; - c3_y tmp; - - do { - tmp = blk_y[i]; - blk_y[i] = blk_y[j]; - blk_y[j] = tmp; - i--; j++; - } while (i > j); - } - return u3i_bytes(16, blk_y); } u3_noun @@ -138,61 +65,25 @@ c3n == u3ud(b) ) { return u3m_bail(c3__exit); } else { - return u3qea_ecba_de(a, b); + return _cqea_ecba_de(a, b); } } - u3_noun - u3qea_ecbb_en(u3_atom key, + static u3_atom + _cqea_ecbb_en(u3_atom key, u3_atom blk) { - c3_y key_y[24]; - c3_y blk_y[16]; - AES_KEY key_u; + c3_y key_y[24], blk_y[16], out_y[16]; - c3_assert(u3r_met(3, key) <= 24); - c3_assert(u3r_met(3, blk) <= 16); + u3r_bytes(0, 24, key_y, key); + u3r_bytes(0, 16, blk_y, blk); - { - int i = 23; - - do { - key_y[i] = u3r_byte(23-i, key); - i--; - } while (i >= 0); - } - { - int i = 15; - - do { - blk_y[i] = u3r_byte(15-i, blk); - i--; - } while (i >= 0); - } - - if ( 0 != AES_set_encrypt_key(key_y, 192, &key_u) ) { - return u3m_bail(c3__exit); + if ( 0 != urcrypt_aes_ecbb_en(key_y, blk_y, out_y) ) { + return u3_none; } else { - AES_ecb_encrypt(blk_y, blk_y, &key_u, AES_ENCRYPT); + return u3i_bytes(16, out_y); } - - /* array reverse - we can write backwards u3i_bytes * - * in the unlikely event that this becomes a problem */ - { - int i = 15; - int j = 0; - c3_y tmp; - - do { - tmp = blk_y[i]; - blk_y[i] = blk_y[j]; - blk_y[j] = tmp; - i--; j++; - } while (i > j); - } - - return u3i_bytes(16, blk_y); } u3_noun @@ -205,60 +96,25 @@ c3n == u3ud(b) ) { return u3m_bail(c3__exit); } else { - return u3qea_ecbb_en(a, b); + return _cqea_ecbb_en(a, b); } } - u3_noun - u3qea_ecbb_de(u3_atom key, + static u3_atom + _cqea_ecbb_de(u3_atom key, u3_atom blk) { - c3_y key_y[24]; - c3_y blk_y[16]; - AES_KEY key_u; + c3_y key_y[24], blk_y[16], out_y[16]; - c3_assert(u3r_met(3, key) <= 24); - c3_assert(u3r_met(3, blk) <= 16); + u3r_bytes(0, 24, key_y, key); + u3r_bytes(0, 16, blk_y, blk); - { - int i = 23; - - do { - key_y[i] = u3r_byte(23-i, key); - i--; - } while (i >= 0); - } - { - int i = 15; - - do { - blk_y[i] = u3r_byte(15-i, blk); - i--; - } while (i >= 0); - } - - if ( 0 != AES_set_decrypt_key(key_y, 192, &key_u) ) { - return u3m_bail(c3__exit); + if ( 0 != urcrypt_aes_ecbb_de(key_y, blk_y, out_y) ) { + return u3_none; } else { - AES_ecb_encrypt(blk_y, blk_y, &key_u, AES_DECRYPT); + return u3i_bytes(16, out_y); } - - /* array reverse - we can write backwards u3i_bytes * - * in the unlikely event that this becomes a problem */ - { - int i = 15; - int j = 0; - c3_y tmp; - - do { - tmp = blk_y[i]; - blk_y[i] = blk_y[j]; - blk_y[j] = tmp; - i--; j++; - } while (i > j); - } - return u3i_bytes(16, blk_y); } u3_noun @@ -271,61 +127,25 @@ c3n == u3ud(b) ) { return u3m_bail(c3__exit); } else { - return u3qea_ecbb_de(a, b); + return _cqea_ecbb_de(a, b); } } - u3_noun - u3qea_ecbc_en(u3_atom key, + static u3_atom + _cqea_ecbc_en(u3_atom key, u3_atom blk) { - c3_y key_y[32]; - c3_y blk_y[16]; - AES_KEY key_u; + c3_y key_y[32], blk_y[16], out_y[16]; - c3_assert(u3r_met(3, key) <= 32); - c3_assert(u3r_met(3, blk) <= 16); + u3r_bytes(0, 32, key_y, key); + u3r_bytes(0, 16, blk_y, blk); - { - int i = 31; - - do { - key_y[i] = u3r_byte(31-i, key); - i--; - } while (i >= 0); - } - { - int i = 15; - - do { - blk_y[i] = u3r_byte(15-i, blk); - i--; - } while (i >= 0); - } - - if ( 0 != AES_set_encrypt_key(key_y, 256, &key_u) ) { - return u3m_bail(c3__exit); + if ( 0 != urcrypt_aes_ecbc_en(key_y, blk_y, out_y) ) { + return u3_none; } else { - AES_ecb_encrypt(blk_y, blk_y, &key_u, AES_ENCRYPT); + return u3i_bytes(16, out_y); } - - /* array reverse - we can write backwards u3i_bytes * - * in the unlikely event that this becomes a problem */ - { - int i = 15; - int j = 0; - c3_y tmp; - - do { - tmp = blk_y[i]; - blk_y[i] = blk_y[j]; - blk_y[j] = tmp; - i--; j++; - } while (i > j); - } - - return u3i_bytes(16, blk_y); } u3_noun @@ -338,60 +158,25 @@ c3n == u3ud(b) ) { return u3m_bail(c3__exit); } else { - return u3qea_ecbc_en(a, b); + return _cqea_ecbc_en(a, b); } } - u3_noun - u3qea_ecbc_de(u3_atom key, + static u3_atom + _cqea_ecbc_de(u3_atom key, u3_atom blk) { - c3_y key_y[32]; - c3_y blk_y[16]; - AES_KEY key_u; + c3_y key_y[32], blk_y[16], out_y[16]; - c3_assert(u3r_met(3, key) <= 32); - c3_assert(u3r_met(3, blk) <= 16); + u3r_bytes(0, 32, key_y, key); + u3r_bytes(0, 16, blk_y, blk); - { - int i = 31; - - do { - key_y[i] = u3r_byte(31-i, key); - i--; - } while (i >= 0); - } - { - int i = 15; - - do { - blk_y[i] = u3r_byte(15-i, blk); - i--; - } while (i >= 0); - } - - if ( 0 != AES_set_decrypt_key(key_y, 256, &key_u) ) { - return u3m_bail(c3__exit); + if ( 0 != urcrypt_aes_ecbc_de(key_y, blk_y, out_y) ) { + return u3_none; } else { - AES_ecb_encrypt(blk_y, blk_y, &key_u, AES_DECRYPT); + return u3i_bytes(16, out_y); } - - /* array reverse - we can write backwards u3i_bytes * - * in the unlikely event that this becomes a problem */ - { - int i = 15; - int j = 0; - c3_y tmp; - - do { - tmp = blk_y[i]; - blk_y[i] = blk_y[j]; - blk_y[j] = tmp; - i--; j++; - } while (i > j); - } - return u3i_bytes(16, blk_y); } u3_noun @@ -404,6 +189,6 @@ c3n == u3ud(b) ) { return u3m_bail(c3__exit); } else { - return u3qea_ecbc_de(a, b); + return _cqea_ecbc_de(a, b); } } diff --git a/pkg/urcrypt/Makefile b/pkg/urcrypt/Makefile index 6c283fcc3..7b2a0ecc3 100644 --- a/pkg/urcrypt/Makefile +++ b/pkg/urcrypt/Makefile @@ -16,7 +16,7 @@ liburcrypt.a: $(SOURCES) liburcrypt.so: $(SOURCES) $(CC) $(CFLAGS) -fPIC -c urcrypt.c -o urcrypt-shared.o $(CC) -shared urcrypt-shared.o -o liburcrypt.so \ - -led25519 -lge-additions \ + -led25519 -lge-additions -lssl \ -Wl,--no-undefined all: liburcrypt.a liburcrypt.so diff --git a/pkg/urcrypt/urcrypt.c b/pkg/urcrypt/urcrypt.c index c44cae36f..5da4383f4 100644 --- a/pkg/urcrypt/urcrypt.c +++ b/pkg/urcrypt/urcrypt.c @@ -163,3 +163,125 @@ urcrypt_ed_veri(uint8_t *message, size_t length, ? true : false; } + +static void +reverse_bytes(size_t size, uint8_t *in, uint8_t *out) { + size_t i, j; + for ( i = 0, j = size - 1; i < size; i++, j-- ) { + out[i] = in[j]; + } +} + +int +urcrypt_aes_ecba_en(uint8_t key[16], uint8_t block[16], uint8_t out[16]) +{ + AES_KEY aes_key; + uint8_t rkey[16], rblock[16], rout[16]; + + reverse_bytes(16, key, rkey); + reverse_bytes(16, block, rblock); + + if ( 0 != AES_set_encrypt_key(rkey, 128, &aes_key) ) { + return -1; + } + else { + AES_ecb_encrypt(rblock, rout, &aes_key, AES_ENCRYPT); + reverse_bytes(16, rout, out); + return 0; + } +} + +int +urcrypt_aes_ecba_de(uint8_t key[16], uint8_t block[16], uint8_t out[16]) +{ + AES_KEY aes_key; + uint8_t rkey[16], rblock[16], rout[16]; + + reverse_bytes(16, key, rkey); + reverse_bytes(16, block, rblock); + + if ( 0 != AES_set_decrypt_key(rkey, 128, &aes_key) ) { + return -1; + } + else { + AES_ecb_encrypt(rblock, rout, &aes_key, AES_DECRYPT); + reverse_bytes(16, rout, out); + return 0; + } +} + +int +urcrypt_aes_ecbb_en(uint8_t key[24], uint8_t block[16], uint8_t out[16]) +{ + AES_KEY aes_key; + uint8_t rkey[24], rblock[16], rout[16]; + + reverse_bytes(24, key, rkey); + reverse_bytes(16, block, rblock); + + if ( 0 != AES_set_encrypt_key(rkey, 192, &aes_key) ) { + return -1; + } + else { + AES_ecb_encrypt(rblock, rout, &aes_key, AES_ENCRYPT); + reverse_bytes(16, rout, out); + return 0; + } +} + +int +urcrypt_aes_ecbb_de(uint8_t key[24], uint8_t block[16], uint8_t out[16]) +{ + AES_KEY aes_key; + uint8_t rkey[24], rblock[16], rout[16]; + + reverse_bytes(24, key, rkey); + reverse_bytes(16, block, rblock); + + if ( 0 != AES_set_decrypt_key(rkey, 192, &aes_key) ) { + return -1; + } + else { + AES_ecb_encrypt(rblock, rout, &aes_key, AES_DECRYPT); + reverse_bytes(16, rout, out); + return 0; + } +} + +int +urcrypt_aes_ecbc_en(uint8_t key[32], uint8_t block[16], uint8_t out[16]) +{ + AES_KEY aes_key; + uint8_t rkey[32], rblock[16], rout[16]; + + reverse_bytes(32, key, rkey); + reverse_bytes(16, block, rblock); + + if ( 0 != AES_set_encrypt_key(rkey, 256, &aes_key) ) { + return -1; + } + else { + AES_ecb_encrypt(rblock, rout, &aes_key, AES_ENCRYPT); + reverse_bytes(16, rout, out); + return 0; + } +} + +int +urcrypt_aes_ecbc_de(uint8_t key[32], uint8_t block[16], uint8_t out[16]) +{ + AES_KEY aes_key; + uint8_t rkey[32], rblock[16], rout[16]; + + reverse_bytes(32, key, rkey); + reverse_bytes(16, block, rblock); + + if ( 0 != AES_set_decrypt_key(rkey, 256, &aes_key) ) { + return -1; + } + else { + AES_ecb_encrypt(rblock, rout, &aes_key, AES_DECRYPT); + reverse_bytes(16, rout, out); + return 0; + } +} diff --git a/pkg/urcrypt/urcrypt.h b/pkg/urcrypt/urcrypt.h index 3a15c0412..ee4f68732 100644 --- a/pkg/urcrypt/urcrypt.h +++ b/pkg/urcrypt/urcrypt.h @@ -4,9 +4,12 @@ #include #include #include + #include #include +#include + int urcrypt_ed_point_add(uint8_t a[32], uint8_t b[32], uint8_t out[32]); int urcrypt_ed_scalarmult(uint8_t a[32], uint8_t b[32], uint8_t out[32]); void urcrypt_ed_scalarmult_base(uint8_t a[32], uint8_t out[32]); @@ -19,6 +22,7 @@ int urcrypt_ed_add_double_scalarmult(uint8_t a[32], uint8_t b[32], uint8_t b_point[32], uint8_t out[32]); + void urcrypt_ed_puck(uint8_t seed[32], uint8_t out[32]); void urcrypt_ed_shar(uint8_t public[32], uint8_t seed[32], uint8_t out[32]); void urcrypt_ed_sign(uint8_t *message, @@ -28,4 +32,11 @@ void urcrypt_ed_sign(uint8_t *message, bool urcrypt_ed_veri(uint8_t *message, size_t length, uint8_t signature[64], uint8_t public[32]); + +int urcrypt_aes_ecba_en(uint8_t key[16], uint8_t block[16], uint8_t out[16]); +int urcrypt_aes_ecba_de(uint8_t key[16], uint8_t block[16], uint8_t out[16]); +int urcrypt_aes_ecbb_en(uint8_t key[24], uint8_t block[16], uint8_t out[16]); +int urcrypt_aes_ecbb_de(uint8_t key[24], uint8_t block[16], uint8_t out[16]); +int urcrypt_aes_ecbc_en(uint8_t key[32], uint8_t block[16], uint8_t out[16]); +int urcrypt_aes_ecbc_de(uint8_t key[32], uint8_t block[16], uint8_t out[16]); #endif From 6e065b6979c618a0ce8e689a33e695f1f01cb35a Mon Sep 17 00:00:00 2001 From: Paul Driver Date: Fri, 7 Aug 2020 12:28:50 -0700 Subject: [PATCH 016/329] const qualifiers, inplace reverse, aes_cbca --- pkg/urbit/jets/e/aes_cbc.c | 89 ++++---------- pkg/urbit/jets/e/aes_ecb.c | 3 + pkg/urbit/noun/manage.c | 7 +- pkg/urcrypt/urcrypt.c | 242 +++++++++++++++++++++++++++++-------- pkg/urcrypt/urcrypt.h | 85 +++++++++---- 5 files changed, 281 insertions(+), 145 deletions(-) diff --git a/pkg/urbit/jets/e/aes_cbc.c b/pkg/urbit/jets/e/aes_cbc.c index 81233e506..e1604188a 100644 --- a/pkg/urbit/jets/e/aes_cbc.c +++ b/pkg/urbit/jets/e/aes_cbc.c @@ -2,85 +2,42 @@ ** */ #include "all.h" +#include #include +/* All of the CBC hoon truncates its key and prv inputs by passing them to + * the ECB functions, which truncate them, hence the raw u3r_bytes unpacking. + */ + /* functions */ - u3_noun - u3qea_cbca_en(u3_atom key, + static u3_atom + _cqea_cbca_en(u3_atom key, u3_atom iv, u3_atom msg) { - c3_y key_y[16]; - c3_y iv_y[16]; - c3_w len_msg_w; - c3_w len_out_w; - c3_y *msg_y; - c3_y *out_y; - u3_atom out; - AES_KEY key_u; + c3_y key_y[16], iv_y[16], *msg_y, *out_y; + c3_w met_w; + size_t len; - c3_assert(u3r_met(3, key) <= 16); - c3_assert(u3r_met(3, iv) <= 16); - len_msg_w = u3r_met(3, msg); - len_out_w = (len_msg_w % 16) == 0 ? len_msg_w : len_msg_w + (16 - (len_msg_w % 16)); - len_msg_w = len_out_w; + u3r_bytes(0, 16, key_y, key); + u3r_bytes(0, 16, iv_y, iv); - msg_y = u3a_malloc(len_msg_w); - out_y = u3a_malloc(len_out_w); + met_w = u3r_met(3, msg); + msg_y = u3a_malloc(met_w); + u3r_bytes(0, met_w, msg_y, msg); + out_y = urcrypt_aes_cbca_en(msg_y, met_w, key_y, iv_y, &len); + u3a_free(msg_y); - { - int i = 15; - - do { - key_y[i] = u3r_byte(15-i, key); - i--; - } while (i >= 0); - } - { - int i = 15; - - do { - iv_y[i] = u3r_byte(15-i, iv); - i--; - } while (i >= 0); - } - { - int i = len_msg_w - 1; - - do { - msg_y[i] = u3r_byte((len_msg_w - 1)-i, msg); - i--; - } while (i >= 0); - } - - if ( 0 != AES_set_encrypt_key(key_y, 128, &key_u) ) { - return u3m_bail(c3__exit); + if ( NULL == out_y ) { + return u3_none; } else { - AES_cbc_encrypt(msg_y, out_y, len_msg_w, &key_u, iv_y, AES_ENCRYPT); + u3_atom ret = u3i_bytes(len, out_y); + urcrypt_free(out_y); + return ret; } - - /* array reverse - we can write backwards u3i_bytes * - * in the unlikely event that this becomes a problem */ - { - int i = len_out_w - 1; - int j = 0; - c3_y tmp; - - do { - tmp = out_y[i]; - out_y[i] = out_y[j]; - out_y[j] = tmp; - i--; j++; - } while (i > j); - } - - out = u3i_bytes(len_out_w, out_y); - u3a_free(msg_y); - u3a_free(out_y); - return out; } u3_noun @@ -93,7 +50,7 @@ c3n == u3ud(b) ) { return u3m_bail(c3__exit); } else { - return u3qea_cbca_en(a, b, c); + return _cqea_cbca_en(a, b, c); } } diff --git a/pkg/urbit/jets/e/aes_ecb.c b/pkg/urbit/jets/e/aes_ecb.c index 3aae07d54..8ca616d4a 100644 --- a/pkg/urbit/jets/e/aes_ecb.c +++ b/pkg/urbit/jets/e/aes_ecb.c @@ -7,6 +7,9 @@ /* functions */ + /* All of the ECB hoon truncates its key and blk inputs with +fe, in these + * jets we unpack with an unconditional u3r_bytes */ + static u3_atom _cqea_ecba_en(u3_atom key, u3_atom blk) diff --git a/pkg/urbit/noun/manage.c b/pkg/urbit/noun/manage.c index c83d00605..86601968e 100644 --- a/pkg/urbit/noun/manage.c +++ b/pkg/urbit/noun/manage.c @@ -7,7 +7,7 @@ #include #include #include -#include +#include #include "all.h" #include "vere/vere.h" @@ -1656,10 +1656,9 @@ u3m_boot(c3_c* dir_c) */ u3m_init(); - /* In the worker, set the openssl memory allocation functions to always - ** work on the loom. + /* Initialize cryptography suite with loom allocation functions. */ - CRYPTO_set_mem_functions(u3a_malloc_ssl, u3a_realloc_ssl, u3a_free_ssl); + urcrypt_init(&u3a_malloc, &u3a_realloc, &u3a_free); /* Activate the storage system. */ diff --git a/pkg/urcrypt/urcrypt.c b/pkg/urcrypt/urcrypt.c index 5da4383f4..9c973a228 100644 --- a/pkg/urcrypt/urcrypt.c +++ b/pkg/urcrypt/urcrypt.c @@ -1,7 +1,76 @@ #include "urcrypt.h" +static bool initialized = false; +static urcrypt_malloc_t urcrypt_malloc_ptr; +static urcrypt_realloc_t urcrypt_realloc_ptr; +static urcrypt_free_t urcrypt_free_ptr; + +void* urcrypt_malloc(size_t len) +{ + return (*urcrypt_malloc_ptr)(len); +} + +void* urcrypt_realloc(void *ptr, size_t len) +{ + return (*urcrypt_realloc_ptr)(ptr, len); +} + +void urcrypt_free(void *ptr) +{ + (*urcrypt_free_ptr)(ptr); +} + +static void* +urcrypt_malloc_ssl(size_t len +#if OPENSSL_VERSION_NUMBER >= 0x10100000L + , const char* file, int line +#endif +) { return urcrypt_malloc(len); } + +static void* +urcrypt_realloc_ssl(void* ptr, size_t len +#if OPENSSL_VERSION_NUMBER >= 0x10100000L + , const char* file, int line +#endif +) { return urcrypt_realloc(ptr, len); } + +static void +urcrypt_free_ssl(void* ptr +#if OPENSSL_VERSION_NUMBER >= 0x10100000L + , const char* file, int line +#endif +) { urcrypt_free(ptr); } + +/* IMPORTANT: it is an error (undefined behavior) to call functions in + * this library without first calling urcrypt_init() exactly once. + */ int -urcrypt_ed_point_add(uint8_t a[32], uint8_t b[32], uint8_t out[32]) +urcrypt_init(urcrypt_malloc_t m, urcrypt_realloc_t r, urcrypt_free_t f) +{ + if ( initialized ) { + return -1; + } + else { + initialized = true; + urcrypt_malloc_ptr = ( NULL == m ) ? &malloc : m; + urcrypt_realloc_ptr = ( NULL == r ) ? &realloc : r; + urcrypt_free_ptr = ( NULL == f ) ? &free : f; + + if ( CRYPTO_set_mem_functions(&urcrypt_malloc_ssl, + &urcrypt_realloc_ssl, + &urcrypt_free_ssl) ) { + return 0; + } + else { + return -2; + } + } +} + +int +urcrypt_ed_point_add(const uint8_t a[32], + const uint8_t b[32], + uint8_t out[32]) { ge_p3 A, B; ge_cached b_cached; @@ -32,7 +101,9 @@ urcrypt_ed_point_add(uint8_t a[32], uint8_t b[32], uint8_t out[32]) } int -urcrypt_ed_scalarmult(uint8_t a[32], uint8_t b[32], uint8_t out[32]) +urcrypt_ed_scalarmult(const uint8_t a[32], + const uint8_t b[32], + uint8_t out[32]) { ge_p3 B, result; @@ -50,7 +121,8 @@ urcrypt_ed_scalarmult(uint8_t a[32], uint8_t b[32], uint8_t out[32]) } void -urcrypt_ed_scalarmult_base(uint8_t a[32], uint8_t out[32]) +urcrypt_ed_scalarmult_base(const uint8_t a[32], + uint8_t out[32]) { ge_p3 R; ge_scalarmult_base(&R, a); @@ -58,9 +130,9 @@ urcrypt_ed_scalarmult_base(uint8_t a[32], uint8_t out[32]) } int -urcrypt_ed_add_scalarmult_scalarmult_base(uint8_t a[32], - uint8_t a_point[32], - uint8_t b[32], +urcrypt_ed_add_scalarmult_scalarmult_base(const uint8_t a[32], + const uint8_t a_point[32], + const uint8_t b[32], uint8_t out[32]) { ge_p2 r; @@ -81,10 +153,10 @@ urcrypt_ed_add_scalarmult_scalarmult_base(uint8_t a[32], } int -urcrypt_ed_add_double_scalarmult(uint8_t a[32], - uint8_t a_point[32], - uint8_t b[32], - uint8_t b_point[32], +urcrypt_ed_add_double_scalarmult(const uint8_t a[32], + const uint8_t a_point[32], + const uint8_t b[32], + const uint8_t b_point[32], uint8_t out[32]) { ge_p3 A, B, a_result, b_result, final_result; @@ -120,14 +192,17 @@ urcrypt_ed_add_double_scalarmult(uint8_t a[32], } void -urcrypt_ed_puck(uint8_t seed[32], uint8_t out[32]) +urcrypt_ed_puck(const uint8_t seed[32], + uint8_t out[32]) { uint8_t secret[64]; ed25519_create_keypair(out, secret, seed); } void -urcrypt_ed_shar(uint8_t public[32], uint8_t seed[32], uint8_t out[32]) +urcrypt_ed_shar(const uint8_t public[32], + const uint8_t seed[32], + uint8_t out[32]) { uint8_t self[32], exp[64]; @@ -140,9 +215,9 @@ urcrypt_ed_shar(uint8_t public[32], uint8_t seed[32], uint8_t out[32]) } void -urcrypt_ed_sign(uint8_t *message, +urcrypt_ed_sign(const uint8_t *message, size_t length, - uint8_t seed[32], + const uint8_t seed[32], uint8_t out[64]) { uint8_t public[64], secret[64]; @@ -156,8 +231,10 @@ urcrypt_ed_sign(uint8_t *message, } bool -urcrypt_ed_veri(uint8_t *message, size_t length, - uint8_t public[32], uint8_t signature[64]) +urcrypt_ed_veri(const uint8_t *message, + size_t length, + const uint8_t public[32], + const uint8_t signature[64]) { return ( ed25519_verify(signature, message, length, public) == 1 ) ? true @@ -165,123 +242,182 @@ urcrypt_ed_veri(uint8_t *message, size_t length, } static void -reverse_bytes(size_t size, uint8_t *in, uint8_t *out) { +reverse_copy(size_t size, const uint8_t *in, uint8_t *out) { size_t i, j; for ( i = 0, j = size - 1; i < size; i++, j-- ) { out[i] = in[j]; } } +static void +reverse_inplace(size_t size, uint8_t *ptr) { + size_t i, j; + uint8_t tmp; + for ( i = 0, j = size - 1; i < j; i++, j-- ) { + tmp = ptr[i]; + ptr[i] = ptr[j]; + ptr[j] = tmp; + } +} + int -urcrypt_aes_ecba_en(uint8_t key[16], uint8_t block[16], uint8_t out[16]) +urcrypt_aes_ecba_en(const uint8_t key[16], + const uint8_t block[16], + uint8_t out[16]) { AES_KEY aes_key; - uint8_t rkey[16], rblock[16], rout[16]; + uint8_t rkey[16], rblock[16]; - reverse_bytes(16, key, rkey); - reverse_bytes(16, block, rblock); + reverse_copy(16, key, rkey); + reverse_copy(16, block, rblock); if ( 0 != AES_set_encrypt_key(rkey, 128, &aes_key) ) { return -1; } else { - AES_ecb_encrypt(rblock, rout, &aes_key, AES_ENCRYPT); - reverse_bytes(16, rout, out); + AES_ecb_encrypt(rblock, out, &aes_key, AES_ENCRYPT); + reverse_inplace(16, out); return 0; } } int -urcrypt_aes_ecba_de(uint8_t key[16], uint8_t block[16], uint8_t out[16]) +urcrypt_aes_ecba_de(const uint8_t key[16], + const uint8_t block[16], + uint8_t out[16]) { AES_KEY aes_key; - uint8_t rkey[16], rblock[16], rout[16]; + uint8_t rkey[16], rblock[16]; - reverse_bytes(16, key, rkey); - reverse_bytes(16, block, rblock); + reverse_copy(16, key, rkey); + reverse_copy(16, block, rblock); if ( 0 != AES_set_decrypt_key(rkey, 128, &aes_key) ) { return -1; } else { - AES_ecb_encrypt(rblock, rout, &aes_key, AES_DECRYPT); - reverse_bytes(16, rout, out); + AES_ecb_encrypt(rblock, out, &aes_key, AES_DECRYPT); + reverse_inplace(16, out); return 0; } } int -urcrypt_aes_ecbb_en(uint8_t key[24], uint8_t block[16], uint8_t out[16]) +urcrypt_aes_ecbb_en(const uint8_t key[24], + const uint8_t block[16], + uint8_t out[16]) { AES_KEY aes_key; - uint8_t rkey[24], rblock[16], rout[16]; + uint8_t rkey[24], rblock[16]; - reverse_bytes(24, key, rkey); - reverse_bytes(16, block, rblock); + reverse_copy(24, key, rkey); + reverse_copy(16, block, rblock); if ( 0 != AES_set_encrypt_key(rkey, 192, &aes_key) ) { return -1; } else { - AES_ecb_encrypt(rblock, rout, &aes_key, AES_ENCRYPT); - reverse_bytes(16, rout, out); + AES_ecb_encrypt(rblock, out, &aes_key, AES_ENCRYPT); + reverse_inplace(16, out); return 0; } } int -urcrypt_aes_ecbb_de(uint8_t key[24], uint8_t block[16], uint8_t out[16]) +urcrypt_aes_ecbb_de(const uint8_t key[24], + const uint8_t block[16], + uint8_t out[16]) { AES_KEY aes_key; - uint8_t rkey[24], rblock[16], rout[16]; + uint8_t rkey[24], rblock[16]; - reverse_bytes(24, key, rkey); - reverse_bytes(16, block, rblock); + reverse_copy(24, key, rkey); + reverse_copy(16, block, rblock); if ( 0 != AES_set_decrypt_key(rkey, 192, &aes_key) ) { return -1; } else { - AES_ecb_encrypt(rblock, rout, &aes_key, AES_DECRYPT); - reverse_bytes(16, rout, out); + AES_ecb_encrypt(rblock, out, &aes_key, AES_DECRYPT); + reverse_inplace(16, out); return 0; } } int -urcrypt_aes_ecbc_en(uint8_t key[32], uint8_t block[16], uint8_t out[16]) +urcrypt_aes_ecbc_en(const uint8_t key[32], + const uint8_t block[16], + uint8_t out[16]) { AES_KEY aes_key; - uint8_t rkey[32], rblock[16], rout[16]; + uint8_t rkey[32], rblock[16]; - reverse_bytes(32, key, rkey); - reverse_bytes(16, block, rblock); + reverse_copy(32, key, rkey); + reverse_copy(16, block, rblock); if ( 0 != AES_set_encrypt_key(rkey, 256, &aes_key) ) { return -1; } else { - AES_ecb_encrypt(rblock, rout, &aes_key, AES_ENCRYPT); - reverse_bytes(16, rout, out); + AES_ecb_encrypt(rblock, out, &aes_key, AES_ENCRYPT); + reverse_inplace(16, out); return 0; } } int -urcrypt_aes_ecbc_de(uint8_t key[32], uint8_t block[16], uint8_t out[16]) +urcrypt_aes_ecbc_de(const uint8_t key[32], + const uint8_t block[16], + uint8_t out[16]) { AES_KEY aes_key; - uint8_t rkey[32], rblock[16], rout[16]; + uint8_t rkey[32], rblock[16]; - reverse_bytes(32, key, rkey); - reverse_bytes(16, block, rblock); + reverse_copy(32, key, rkey); + reverse_copy(16, block, rblock); if ( 0 != AES_set_decrypt_key(rkey, 256, &aes_key) ) { return -1; } else { - AES_ecb_encrypt(rblock, rout, &aes_key, AES_DECRYPT); - reverse_bytes(16, rout, out); + AES_ecb_encrypt(rblock, out, &aes_key, AES_DECRYPT); + reverse_inplace(16, out); return 0; } } + +uint8_t* +urcrypt_aes_cbca_en(const uint8_t *message, + size_t length, + const uint8_t key[16], + const uint8_t ivec[16], + size_t *out_length) +{ + AES_KEY aes_key; + uint8_t rkey[16]; + + reverse_copy(16, key, rkey); + + if ( 0 != AES_set_encrypt_key(rkey, 128, &aes_key) ) { + return NULL; + } + else { + uint8_t riv[16], *in, *out; + size_t padding = 16 - (length % 16), + padded = length + padding; + + reverse_copy(16, ivec, riv); + + in = urcrypt_malloc(padded); + memset(in, 0, padding); + reverse_copy(length, message, in + padding); + + out = urcrypt_malloc(padded); + AES_cbc_encrypt(in, out, padded, &aes_key, riv, AES_ENCRYPT); + urcrypt_free(in); + + reverse_inplace(padded, out); + *out_length = padded; + return out; + } +} diff --git a/pkg/urcrypt/urcrypt.h b/pkg/urcrypt/urcrypt.h index ee4f68732..ca2d52cf7 100644 --- a/pkg/urcrypt/urcrypt.h +++ b/pkg/urcrypt/urcrypt.h @@ -3,40 +3,81 @@ #include #include +#include #include #include #include +#include #include -int urcrypt_ed_point_add(uint8_t a[32], uint8_t b[32], uint8_t out[32]); -int urcrypt_ed_scalarmult(uint8_t a[32], uint8_t b[32], uint8_t out[32]); -void urcrypt_ed_scalarmult_base(uint8_t a[32], uint8_t out[32]); -int urcrypt_ed_add_scalarmult_scalarmult_base(uint8_t a[32], - uint8_t a_point[32], - uint8_t b[32], +typedef void *(*urcrypt_malloc_t)(size_t); +typedef void *(*urcrypt_realloc_t)(void*, size_t); +typedef void (*urcrypt_free_t)(void*); + +int urcrypt_init(urcrypt_malloc_t, urcrypt_realloc_t, urcrypt_free_t); + +void *urcrypt_malloc(size_t); +void *urcrypt_realloc(void*, size_t); +void urcrypt_free(void*); + +int urcrypt_ed_point_add(const uint8_t a[32], + const uint8_t b[32], + uint8_t out[32]); +int urcrypt_ed_scalarmult(const uint8_t a[32], + const uint8_t b[32], + uint8_t out[32]); +void urcrypt_ed_scalarmult_base(const uint8_t a[32], + uint8_t out[32]); +int urcrypt_ed_add_scalarmult_scalarmult_base(const uint8_t a[32], + const uint8_t a_point[32], + const uint8_t b[32], uint8_t out[32]); -int urcrypt_ed_add_double_scalarmult(uint8_t a[32], - uint8_t a_point[32], - uint8_t b[32], - uint8_t b_point[32], +int urcrypt_ed_add_double_scalarmult(const uint8_t a[32], + const uint8_t a_point[32], + const uint8_t b[32], + const uint8_t b_point[32], uint8_t out[32]); -void urcrypt_ed_puck(uint8_t seed[32], uint8_t out[32]); -void urcrypt_ed_shar(uint8_t public[32], uint8_t seed[32], uint8_t out[32]); -void urcrypt_ed_sign(uint8_t *message, +void urcrypt_ed_puck(const uint8_t seed[32], + uint8_t out[32]); +void urcrypt_ed_shar(const uint8_t public[32], + const uint8_t seed[32], + uint8_t out[32]); +void urcrypt_ed_sign(const uint8_t *message, size_t length, - uint8_t seed[32], + const uint8_t seed[32], uint8_t out[64]); +bool urcrypt_ed_veri(const uint8_t *message, + size_t length, + const uint8_t signature[64], + const uint8_t public[32]); + +int urcrypt_aes_ecba_en(const uint8_t key[16], + const uint8_t block[16], + uint8_t out[16]); +int urcrypt_aes_ecba_de(const uint8_t key[16], + const uint8_t block[16], + uint8_t out[16]); +int urcrypt_aes_ecbb_en(const uint8_t key[24], + const uint8_t block[16], + uint8_t out[16]); +int urcrypt_aes_ecbb_de(const uint8_t key[24], + const uint8_t block[16], + uint8_t out[16]); +int urcrypt_aes_ecbc_en(const uint8_t key[32], + const uint8_t block[16], + uint8_t out[16]); +int urcrypt_aes_ecbc_de(const uint8_t key[32], + const uint8_t block[16], + uint8_t out[16]); + +uint8_t* urcrypt_aes_cbca_en(const uint8_t *message, + size_t length, + const uint8_t key[16], + const uint8_t ivec[16], + size_t *out_length); -bool urcrypt_ed_veri(uint8_t *message, size_t length, - uint8_t signature[64], uint8_t public[32]); -int urcrypt_aes_ecba_en(uint8_t key[16], uint8_t block[16], uint8_t out[16]); -int urcrypt_aes_ecba_de(uint8_t key[16], uint8_t block[16], uint8_t out[16]); -int urcrypt_aes_ecbb_en(uint8_t key[24], uint8_t block[16], uint8_t out[16]); -int urcrypt_aes_ecbb_de(uint8_t key[24], uint8_t block[16], uint8_t out[16]); -int urcrypt_aes_ecbc_en(uint8_t key[32], uint8_t block[16], uint8_t out[16]); -int urcrypt_aes_ecbc_de(uint8_t key[32], uint8_t block[16], uint8_t out[16]); #endif From e863afd30eb0c5feccb1bfb999f4a1826174da2c Mon Sep 17 00:00:00 2001 From: Paul Driver Date: Fri, 7 Aug 2020 12:47:43 -0700 Subject: [PATCH 017/329] add u3r_unpack_alloc() --- pkg/urbit/include/noun/retrieve.h | 7 +++++++ pkg/urbit/jets/e/aes_cbc.c | 4 +--- pkg/urbit/jets/e/ed_sign.c | 6 ++---- pkg/urbit/jets/e/ed_veri.c | 10 +++------- pkg/urbit/noun/retrieve.c | 14 ++++++++++++++ 5 files changed, 27 insertions(+), 14 deletions(-) diff --git a/pkg/urbit/include/noun/retrieve.h b/pkg/urbit/include/noun/retrieve.h index c17877d9d..295ad622a 100644 --- a/pkg/urbit/include/noun/retrieve.h +++ b/pkg/urbit/include/noun/retrieve.h @@ -355,6 +355,13 @@ c3_y *buf_y, u3_atom a); + /* u3r_unpack_alloc(): + ** + ** Allocate a new byte array with all the bytes of (a) + */ + c3_y* + u3r_unpack_alloc(c3_w* len_w, u3_atom a); + /* u3r_chop(): ** ** Into the bloq space of `met`, from position `fum` for a diff --git a/pkg/urbit/jets/e/aes_cbc.c b/pkg/urbit/jets/e/aes_cbc.c index e1604188a..af8325751 100644 --- a/pkg/urbit/jets/e/aes_cbc.c +++ b/pkg/urbit/jets/e/aes_cbc.c @@ -24,9 +24,7 @@ u3r_bytes(0, 16, key_y, key); u3r_bytes(0, 16, iv_y, iv); - met_w = u3r_met(3, msg); - msg_y = u3a_malloc(met_w); - u3r_bytes(0, met_w, msg_y, msg); + msg_y = u3r_unpack_alloc(&met_w, msg); out_y = urcrypt_aes_cbca_en(msg_y, met_w, key_y, iv_y, &len); u3a_free(msg_y); diff --git a/pkg/urbit/jets/e/ed_sign.c b/pkg/urbit/jets/e/ed_sign.c index 606282947..e6a153ba1 100644 --- a/pkg/urbit/jets/e/ed_sign.c +++ b/pkg/urbit/jets/e/ed_sign.c @@ -18,11 +18,9 @@ } else { c3_y sig_y[64]; - c3_y* mes_y; - c3_w met_w = u3r_met(3, a); + c3_w met_w; + c3_y* mes_y = u3r_unpack_alloc(&met_w, a); - mes_y = u3a_malloc(met_w); - u3r_bytes(0, met_w, mes_y, a); urcrypt_ed_sign(mes_y, met_w, sed_y, sig_y); u3a_free(mes_y); diff --git a/pkg/urbit/jets/e/ed_veri.c b/pkg/urbit/jets/e/ed_veri.c index 646dd89ca..f4bf30ac3 100644 --- a/pkg/urbit/jets/e/ed_veri.c +++ b/pkg/urbit/jets/e/ed_veri.c @@ -19,13 +19,9 @@ return u3_none; } else { - c3_t val_t; - c3_y* mes_y; - c3_w met_w = u3r_met(3, m); - - mes_y = u3a_malloc(met_w); - u3r_bytes(0, met_w, mes_y, m); - val_t = urcrypt_ed_veri(mes_y, met_w, pub_y, sig_y); + c3_w met_w; + c3_y* mes_y = u3r_unpack_alloc(&met_w, m); + c3_t val_t = urcrypt_ed_veri(mes_y, met_w, pub_y, sig_y); u3a_free(mes_y); return val_t ? c3y : c3n; diff --git a/pkg/urbit/noun/retrieve.c b/pkg/urbit/noun/retrieve.c index 36fed5073..b8f875b86 100644 --- a/pkg/urbit/noun/retrieve.c +++ b/pkg/urbit/noun/retrieve.c @@ -1093,6 +1093,20 @@ u3r_unpack(c3_w len_w, c3_y *buf_y, u3_atom a) } } +/* u3r_unpack_alloc(): +** +** Allocate a new byte array with all the bytes of (a) +*/ +c3_y* +u3r_unpack_alloc(c3_w* len_w, u3_atom a) +{ + c3_w met_w = u3r_met(3, a); + c3_y* a_y = u3a_malloc(met_w); + u3r_bytes(0, met_w, a_y, a); + *len_w = met_w; + return a_y; +} + /* u3r_mp(): ** ** Copy (b) into (a_mp). From a1c1f3b9eed5b49b206ecca8e4dcdaf51fcb9bd6 Mon Sep 17 00:00:00 2001 From: Paul Driver Date: Fri, 7 Aug 2020 13:06:44 -0700 Subject: [PATCH 018/329] making the bodies of the cbc functions call helpers to be more boring --- pkg/urbit/jets/e/aes_cbc.c | 4 +- pkg/urcrypt/urcrypt.c | 75 +++++++++++++++++++++----------------- 2 files changed, 44 insertions(+), 35 deletions(-) diff --git a/pkg/urbit/jets/e/aes_cbc.c b/pkg/urbit/jets/e/aes_cbc.c index af8325751..e0c2c1056 100644 --- a/pkg/urbit/jets/e/aes_cbc.c +++ b/pkg/urbit/jets/e/aes_cbc.c @@ -17,9 +17,9 @@ u3_atom iv, u3_atom msg) { - c3_y key_y[16], iv_y[16], *msg_y, *out_y; - c3_w met_w; size_t len; + c3_w met_w; + c3_y key_y[16], iv_y[16], *msg_y, *out_y; u3r_bytes(0, 16, key_y, key); u3r_bytes(0, 16, iv_y, iv); diff --git a/pkg/urcrypt/urcrypt.c b/pkg/urcrypt/urcrypt.c index 9c973a228..36f603af2 100644 --- a/pkg/urcrypt/urcrypt.c +++ b/pkg/urcrypt/urcrypt.c @@ -242,7 +242,7 @@ urcrypt_ed_veri(const uint8_t *message, } static void -reverse_copy(size_t size, const uint8_t *in, uint8_t *out) { +_urcrypt_reverse_copy(size_t size, const uint8_t *in, uint8_t *out) { size_t i, j; for ( i = 0, j = size - 1; i < size; i++, j-- ) { out[i] = in[j]; @@ -250,7 +250,7 @@ reverse_copy(size_t size, const uint8_t *in, uint8_t *out) { } static void -reverse_inplace(size_t size, uint8_t *ptr) { +_urcrypt_reverse_inplace(size_t size, uint8_t *ptr) { size_t i, j; uint8_t tmp; for ( i = 0, j = size - 1; i < j; i++, j-- ) { @@ -268,15 +268,15 @@ urcrypt_aes_ecba_en(const uint8_t key[16], AES_KEY aes_key; uint8_t rkey[16], rblock[16]; - reverse_copy(16, key, rkey); - reverse_copy(16, block, rblock); + _urcrypt_reverse_copy(16, key, rkey); + _urcrypt_reverse_copy(16, block, rblock); if ( 0 != AES_set_encrypt_key(rkey, 128, &aes_key) ) { return -1; } else { AES_ecb_encrypt(rblock, out, &aes_key, AES_ENCRYPT); - reverse_inplace(16, out); + _urcrypt_reverse_inplace(16, out); return 0; } } @@ -289,15 +289,15 @@ urcrypt_aes_ecba_de(const uint8_t key[16], AES_KEY aes_key; uint8_t rkey[16], rblock[16]; - reverse_copy(16, key, rkey); - reverse_copy(16, block, rblock); + _urcrypt_reverse_copy(16, key, rkey); + _urcrypt_reverse_copy(16, block, rblock); if ( 0 != AES_set_decrypt_key(rkey, 128, &aes_key) ) { return -1; } else { AES_ecb_encrypt(rblock, out, &aes_key, AES_DECRYPT); - reverse_inplace(16, out); + _urcrypt_reverse_inplace(16, out); return 0; } } @@ -310,15 +310,15 @@ urcrypt_aes_ecbb_en(const uint8_t key[24], AES_KEY aes_key; uint8_t rkey[24], rblock[16]; - reverse_copy(24, key, rkey); - reverse_copy(16, block, rblock); + _urcrypt_reverse_copy(24, key, rkey); + _urcrypt_reverse_copy(16, block, rblock); if ( 0 != AES_set_encrypt_key(rkey, 192, &aes_key) ) { return -1; } else { AES_ecb_encrypt(rblock, out, &aes_key, AES_ENCRYPT); - reverse_inplace(16, out); + _urcrypt_reverse_inplace(16, out); return 0; } } @@ -331,15 +331,15 @@ urcrypt_aes_ecbb_de(const uint8_t key[24], AES_KEY aes_key; uint8_t rkey[24], rblock[16]; - reverse_copy(24, key, rkey); - reverse_copy(16, block, rblock); + _urcrypt_reverse_copy(24, key, rkey); + _urcrypt_reverse_copy(16, block, rblock); if ( 0 != AES_set_decrypt_key(rkey, 192, &aes_key) ) { return -1; } else { AES_ecb_encrypt(rblock, out, &aes_key, AES_DECRYPT); - reverse_inplace(16, out); + _urcrypt_reverse_inplace(16, out); return 0; } } @@ -352,15 +352,15 @@ urcrypt_aes_ecbc_en(const uint8_t key[32], AES_KEY aes_key; uint8_t rkey[32], rblock[16]; - reverse_copy(32, key, rkey); - reverse_copy(16, block, rblock); + _urcrypt_reverse_copy(32, key, rkey); + _urcrypt_reverse_copy(16, block, rblock); if ( 0 != AES_set_encrypt_key(rkey, 256, &aes_key) ) { return -1; } else { AES_ecb_encrypt(rblock, out, &aes_key, AES_ENCRYPT); - reverse_inplace(16, out); + _urcrypt_reverse_inplace(16, out); return 0; } } @@ -373,19 +373,34 @@ urcrypt_aes_ecbc_de(const uint8_t key[32], AES_KEY aes_key; uint8_t rkey[32], rblock[16]; - reverse_copy(32, key, rkey); - reverse_copy(16, block, rblock); + _urcrypt_reverse_copy(32, key, rkey); + _urcrypt_reverse_copy(16, block, rblock); if ( 0 != AES_set_decrypt_key(rkey, 256, &aes_key) ) { return -1; } else { AES_ecb_encrypt(rblock, out, &aes_key, AES_DECRYPT); - reverse_inplace(16, out); + _urcrypt_reverse_inplace(16, out); return 0; } } +static uint8_t* +_urcrypt_cbc_pad(size_t *length_ptr, const uint8_t *message) +{ + size_t length = *length_ptr, + padding = 16 - (length % 16), + padded = length + padding; + uint8_t *buf = urcrypt_malloc(padded); + + memset(buf, 0, padding); + _urcrypt_reverse_copy(length, message, buf + padding); + + *length_ptr = padded; + return buf; +} + uint8_t* urcrypt_aes_cbca_en(const uint8_t *message, size_t length, @@ -396,28 +411,22 @@ urcrypt_aes_cbca_en(const uint8_t *message, AES_KEY aes_key; uint8_t rkey[16]; - reverse_copy(16, key, rkey); + _urcrypt_reverse_copy(16, key, rkey); if ( 0 != AES_set_encrypt_key(rkey, 128, &aes_key) ) { return NULL; } else { uint8_t riv[16], *in, *out; - size_t padding = 16 - (length % 16), - padded = length + padding; - reverse_copy(16, ivec, riv); - - in = urcrypt_malloc(padded); - memset(in, 0, padding); - reverse_copy(length, message, in + padding); - - out = urcrypt_malloc(padded); - AES_cbc_encrypt(in, out, padded, &aes_key, riv, AES_ENCRYPT); + _urcrypt_reverse_copy(16, ivec, riv); + in = _urcrypt_cbc_pad(&length, message); + out = urcrypt_malloc(length); + AES_cbc_encrypt(in, out, length, &aes_key, riv, AES_ENCRYPT); urcrypt_free(in); - reverse_inplace(padded, out); - *out_length = padded; + _urcrypt_reverse_inplace(length, out); + *out_length = length; return out; } } From a9bbac948ec477282240c0011afbdce3bd184a3a Mon Sep 17 00:00:00 2001 From: Paul Driver Date: Fri, 7 Aug 2020 14:40:27 -0700 Subject: [PATCH 019/329] more helper functions for shorter, more boring code in aes ecb, cbc --- pkg/urbit/jets/e/aes_cbc.c | 101 +++++++++---------------------------- pkg/urbit/jets/e/aes_ecb.c | 79 +++++++++-------------------- pkg/urcrypt/urcrypt.c | 70 ++++++++++++++++++++----- pkg/urcrypt/urcrypt.h | 6 ++- 4 files changed, 111 insertions(+), 145 deletions(-) diff --git a/pkg/urbit/jets/e/aes_cbc.c b/pkg/urbit/jets/e/aes_cbc.c index e0c2c1056..6f40c8aa8 100644 --- a/pkg/urbit/jets/e/aes_cbc.c +++ b/pkg/urbit/jets/e/aes_cbc.c @@ -10,22 +10,25 @@ * the ECB functions, which truncate them, hence the raw u3r_bytes unpacking. */ +typedef c3_y* (*urcrypt_cbc)(const c3_y*, + size_t, + const c3_y*, + const c3_y*, + size_t*); + /* functions */ static u3_atom - _cqea_cbca_en(u3_atom key, - u3_atom iv, - u3_atom msg) + _cqea_cbc_help(c3_y* key_y, u3_atom iv, u3_atom msg, urcrypt_cbc low_f) { size_t len; c3_w met_w; - c3_y key_y[16], iv_y[16], *msg_y, *out_y; + c3_y iv_y[16], *msg_y, *out_y; - u3r_bytes(0, 16, key_y, key); u3r_bytes(0, 16, iv_y, iv); msg_y = u3r_unpack_alloc(&met_w, msg); - out_y = urcrypt_aes_cbca_en(msg_y, met_w, key_y, iv_y, &len); + out_y = (*low_f)(msg_y, met_w, key_y, iv_y, &len); u3a_free(msg_y); if ( NULL == out_y ) { @@ -38,6 +41,16 @@ } } + static u3_atom + _cqea_cbca_en(u3_atom key, + u3_atom iv, + u3_atom msg) + { + c3_y key_y[16]; + u3r_bytes(0, 16, key_y, key); + return _cqea_cbc_help(key_y, iv, msg, &urcrypt_aes_cbca_en); + } + u3_noun u3wea_cbca_en(u3_noun cor) { @@ -52,80 +65,14 @@ } } - u3_noun - u3qea_cbca_de(u3_atom key, + static u3_atom + _cqea_cbca_de(u3_atom key, u3_atom iv, u3_atom msg) { c3_y key_y[16]; - c3_y iv_y[16]; - c3_w len_msg_w; - c3_w len_out_w; - c3_y *msg_y; - c3_y *out_y; - u3_atom out; - AES_KEY key_u; - - c3_assert(u3r_met(3, key) <= 16); - c3_assert(u3r_met(3, iv) <= 16); - len_msg_w = u3r_met(3, msg); - len_out_w = (len_msg_w % 16) == 0 ? len_msg_w : len_msg_w + (16 - (len_msg_w % 16)); - len_msg_w = len_out_w; - - msg_y = u3a_malloc(len_msg_w); - out_y = u3a_malloc(len_out_w); - - { - int i = 15; - - do { - key_y[i] = u3r_byte(15-i, key); - i--; - } while (i >= 0); - } - { - int i = 15; - - do { - iv_y[i] = u3r_byte(15-i, iv); - i--; - } while (i >= 0); - } - { - int i = len_msg_w - 1; - - do { - msg_y[i] = u3r_byte((len_msg_w - 1)-i, msg); - i--; - } while (i >= 0); - } - - if ( 0 != AES_set_decrypt_key(key_y, 128, &key_u) ) { - return u3m_bail(c3__exit); - } - else { - AES_cbc_encrypt(msg_y, out_y, len_msg_w, &key_u, iv_y, AES_DECRYPT); - } - - /* array reverse - we can write backwards u3i_bytes * - * in the unlikely event that this becomes a problem */ - { - int i = len_out_w - 1; - int j = 0; - c3_y tmp; - - do { - tmp = out_y[i]; - out_y[i] = out_y[j]; - out_y[j] = tmp; - i--; j++; - } while (i > j); - } - - out = u3i_bytes(len_out_w, out_y); - u3a_free(msg_y); - u3a_free(out_y); - return out; + u3r_bytes(0, 16, key_y, key); + return _cqea_cbc_help(key_y, iv, msg, &urcrypt_aes_cbca_de); } u3_noun @@ -138,7 +85,7 @@ c3n == u3ud(b) ) { return u3m_bail(c3__exit); } else { - return u3qea_cbca_de(a, b, c); + return _cqea_cbca_de(a, b, c); } } diff --git a/pkg/urbit/jets/e/aes_ecb.c b/pkg/urbit/jets/e/aes_ecb.c index 8ca616d4a..b95a36a73 100644 --- a/pkg/urbit/jets/e/aes_ecb.c +++ b/pkg/urbit/jets/e/aes_ecb.c @@ -4,6 +4,8 @@ #include "all.h" #include +typedef int (*urcrypt_ecb)(const c3_y*, const c3_y[16], c3_y[16]); + /* functions */ @@ -11,15 +13,13 @@ * jets we unpack with an unconditional u3r_bytes */ static u3_atom - _cqea_ecba_en(u3_atom key, - u3_atom blk) + _cqea_ecba_help(c3_y* key_y, u3_atom blk, urcrypt_ecb low_f) { - c3_y key_y[16], blk_y[16], out_y[16]; + c3_y blk_y[16], out_y[16]; - u3r_bytes(0, 16, key_y, key); u3r_bytes(0, 16, blk_y, blk); - if ( 0 != urcrypt_aes_ecba_en(key_y, blk_y, out_y) ) { + if ( 0 != (*low_f)(key_y, blk_y, out_y) ) { return u3_none; } else { @@ -27,6 +27,15 @@ } } + static u3_atom + _cqea_ecba_en(u3_atom key, + u3_atom blk) + { + c3_y key_y[16]; + u3r_bytes(0, 16, key_y, key); + return _cqea_ecba_help(key_y, blk, &urcrypt_aes_ecba_en); + } + u3_noun u3wea_ecba_en(u3_noun cor) { @@ -45,17 +54,9 @@ _cqea_ecba_de(u3_atom key, u3_atom blk) { - c3_y key_y[16], blk_y[16], out_y[16]; - + c3_y key_y[16]; u3r_bytes(0, 16, key_y, key); - u3r_bytes(0, 16, blk_y, blk); - - if ( 0 != urcrypt_aes_ecba_de(key_y, blk_y, out_y) ) { - return u3_none; - } - else { - return u3i_bytes(16, out_y); - } + return _cqea_ecba_help(key_y, blk, &urcrypt_aes_ecba_de); } u3_noun @@ -76,17 +77,9 @@ _cqea_ecbb_en(u3_atom key, u3_atom blk) { - c3_y key_y[24], blk_y[16], out_y[16]; - + c3_y key_y[24]; u3r_bytes(0, 24, key_y, key); - u3r_bytes(0, 16, blk_y, blk); - - if ( 0 != urcrypt_aes_ecbb_en(key_y, blk_y, out_y) ) { - return u3_none; - } - else { - return u3i_bytes(16, out_y); - } + return _cqea_ecba_help(key_y, blk, &urcrypt_aes_ecbb_en); } u3_noun @@ -107,17 +100,9 @@ _cqea_ecbb_de(u3_atom key, u3_atom blk) { - c3_y key_y[24], blk_y[16], out_y[16]; - + c3_y key_y[24]; u3r_bytes(0, 24, key_y, key); - u3r_bytes(0, 16, blk_y, blk); - - if ( 0 != urcrypt_aes_ecbb_de(key_y, blk_y, out_y) ) { - return u3_none; - } - else { - return u3i_bytes(16, out_y); - } + return _cqea_ecba_help(key_y, blk, &urcrypt_aes_ecbb_de); } u3_noun @@ -138,17 +123,9 @@ _cqea_ecbc_en(u3_atom key, u3_atom blk) { - c3_y key_y[32], blk_y[16], out_y[16]; - + c3_y key_y[32]; u3r_bytes(0, 32, key_y, key); - u3r_bytes(0, 16, blk_y, blk); - - if ( 0 != urcrypt_aes_ecbc_en(key_y, blk_y, out_y) ) { - return u3_none; - } - else { - return u3i_bytes(16, out_y); - } + return _cqea_ecba_help(key_y, blk, &urcrypt_aes_ecbc_en); } u3_noun @@ -169,17 +146,9 @@ _cqea_ecbc_de(u3_atom key, u3_atom blk) { - c3_y key_y[32], blk_y[16], out_y[16]; - + c3_y key_y[32]; u3r_bytes(0, 32, key_y, key); - u3r_bytes(0, 16, blk_y, blk); - - if ( 0 != urcrypt_aes_ecbc_de(key_y, blk_y, out_y) ) { - return u3_none; - } - else { - return u3i_bytes(16, out_y); - } + return _cqea_ecba_help(key_y, blk, &urcrypt_aes_ecbc_de); } u3_noun diff --git a/pkg/urcrypt/urcrypt.c b/pkg/urcrypt/urcrypt.c index 36f603af2..f7604e2b1 100644 --- a/pkg/urcrypt/urcrypt.c +++ b/pkg/urcrypt/urcrypt.c @@ -390,7 +390,8 @@ static uint8_t* _urcrypt_cbc_pad(size_t *length_ptr, const uint8_t *message) { size_t length = *length_ptr, - padding = 16 - (length % 16), + rem = length % 16, + padding = rem ? 16 - rem : 0, padded = length + padding; uint8_t *buf = urcrypt_malloc(padded); @@ -401,6 +402,31 @@ _urcrypt_cbc_pad(size_t *length_ptr, const uint8_t *message) return buf; } +uint8_t* +_urcrypt_cbc_help(const uint8_t *message, + size_t length, + const AES_KEY *key, + const uint8_t ivec[16], + const int enc, + size_t *out_length) +{ + uint8_t riv[16], *in, *out; + + _urcrypt_reverse_copy(16, ivec, riv); + FILE* nukes = fopen("/tmp/urcrypt.txt", "w"); + fprintf(nukes, "length before: %d\r\n", (int) length); + in = _urcrypt_cbc_pad(&length, message); + fprintf(nukes, "length after: %d\r\n", (int) length); + fclose(nukes); + out = urcrypt_malloc(length); + AES_cbc_encrypt(in, out, length, key, riv, enc); + urcrypt_free(in); + + _urcrypt_reverse_inplace(length, out); + *out_length = length; + return out; +} + uint8_t* urcrypt_aes_cbca_en(const uint8_t *message, size_t length, @@ -417,16 +443,36 @@ urcrypt_aes_cbca_en(const uint8_t *message, return NULL; } else { - uint8_t riv[16], *in, *out; - - _urcrypt_reverse_copy(16, ivec, riv); - in = _urcrypt_cbc_pad(&length, message); - out = urcrypt_malloc(length); - AES_cbc_encrypt(in, out, length, &aes_key, riv, AES_ENCRYPT); - urcrypt_free(in); - - _urcrypt_reverse_inplace(length, out); - *out_length = length; - return out; + return _urcrypt_cbc_help(message, + length, + &aes_key, + ivec, + AES_ENCRYPT, + out_length); + } +} + +uint8_t* +urcrypt_aes_cbca_de(const uint8_t *message, + size_t length, + const uint8_t key[16], + const uint8_t ivec[16], + size_t *out_length) +{ + AES_KEY aes_key; + uint8_t rkey[16]; + + _urcrypt_reverse_copy(16, key, rkey); + + if ( 0 != AES_set_decrypt_key(rkey, 128, &aes_key) ) { + return NULL; + } + else { + return _urcrypt_cbc_help(message, + length, + &aes_key, + ivec, + AES_DECRYPT, + out_length); } } diff --git a/pkg/urcrypt/urcrypt.h b/pkg/urcrypt/urcrypt.h index ca2d52cf7..3471c25d1 100644 --- a/pkg/urcrypt/urcrypt.h +++ b/pkg/urcrypt/urcrypt.h @@ -78,6 +78,10 @@ uint8_t* urcrypt_aes_cbca_en(const uint8_t *message, const uint8_t key[16], const uint8_t ivec[16], size_t *out_length); - +uint8_t* urcrypt_aes_cbca_de(const uint8_t *message, + size_t length, + const uint8_t key[16], + const uint8_t ivec[16], + size_t *out_length); #endif From fe1375ef6b0060acd72055a4025f28884e2ade6b Mon Sep 17 00:00:00 2001 From: Paul Driver Date: Fri, 7 Aug 2020 16:28:00 -0700 Subject: [PATCH 020/329] cbc:aes -> urcrypt --- pkg/urbit/jets/e/aes_cbc.c | 306 +++---------------------------------- pkg/urcrypt/urcrypt.c | 104 ++++++++++++- pkg/urcrypt/urcrypt.h | 20 +++ 3 files changed, 140 insertions(+), 290 deletions(-) diff --git a/pkg/urbit/jets/e/aes_cbc.c b/pkg/urbit/jets/e/aes_cbc.c index 6f40c8aa8..19e129132 100644 --- a/pkg/urbit/jets/e/aes_cbc.c +++ b/pkg/urbit/jets/e/aes_cbc.c @@ -4,8 +4,6 @@ #include "all.h" #include -#include - /* All of the CBC hoon truncates its key and prv inputs by passing them to * the ECB functions, which truncate them, hence the raw u3r_bytes unpacking. */ @@ -89,80 +87,14 @@ typedef c3_y* (*urcrypt_cbc)(const c3_y*, } } - u3_noun - u3qea_cbcb_en(u3_atom key, + static u3_atom + _cqea_cbcb_en(u3_atom key, u3_atom iv, u3_atom msg) { c3_y key_y[24]; - c3_y iv_y[16]; - c3_w len_msg_w; - c3_w len_out_w; - c3_y *msg_y; - c3_y *out_y; - u3_atom out; - AES_KEY key_u; - - c3_assert(u3r_met(3, key) <= 24); - c3_assert(u3r_met(3, iv) <= 16); - len_msg_w = u3r_met(3, msg); - len_out_w = (len_msg_w % 16) == 0 ? len_msg_w : len_msg_w + (16 - (len_msg_w % 16)); - len_msg_w = len_out_w; - - msg_y = u3a_malloc(len_msg_w); - out_y = u3a_malloc(len_out_w); - - { - int i = 23; - - do { - key_y[i] = u3r_byte(23-i, key); - i--; - } while (i >= 0); - } - { - int i = 15; - - do { - iv_y[i] = u3r_byte(15-i, iv); - i--; - } while (i >= 0); - } - { - int i = len_msg_w - 1; - - do { - msg_y[i] = u3r_byte((len_msg_w - 1)-i, msg); - i--; - } while (i >= 0); - } - - if ( 0 != AES_set_encrypt_key(key_y, 192, &key_u) ) { - return u3m_bail(c3__exit); - } - else { - AES_cbc_encrypt(msg_y, out_y, len_msg_w, &key_u, iv_y, AES_ENCRYPT); - } - - /* array reverse - we can write backwards u3i_bytes * - * in the unlikely event that this becomes a problem */ - { - int i = len_out_w - 1; - int j = 0; - c3_y tmp; - - do { - tmp = out_y[i]; - out_y[i] = out_y[j]; - out_y[j] = tmp; - i--; j++; - } while (i > j); - } - - out = u3i_bytes(len_out_w, out_y); - u3a_free(msg_y); - u3a_free(out_y); - return out; + u3r_bytes(0, 24, key_y, key); + return _cqea_cbc_help(key_y, iv, msg, &urcrypt_aes_cbcb_en); } u3_noun @@ -175,84 +107,18 @@ typedef c3_y* (*urcrypt_cbc)(const c3_y*, c3n == u3ud(b) ) { return u3m_bail(c3__exit); } else { - return u3qea_cbcb_en(a, b, c); + return _cqea_cbcb_en(a, b, c); } } - u3_noun - u3qea_cbcb_de(u3_atom key, + static u3_atom + _cqea_cbcb_de(u3_atom key, u3_atom iv, u3_atom msg) { c3_y key_y[24]; - c3_y iv_y[16]; - c3_w len_msg_w; - c3_w len_out_w; - c3_y *msg_y; - c3_y *out_y; - u3_atom out; - AES_KEY key_u; - - c3_assert(u3r_met(3, key) <= 24); - c3_assert(u3r_met(3, iv) <= 16); - len_msg_w = u3r_met(3, msg); - len_out_w = (len_msg_w % 16) == 0 ? len_msg_w : len_msg_w + (16 - (len_msg_w % 16)); - len_msg_w = len_out_w; - - msg_y = u3a_malloc(len_msg_w); - out_y = u3a_malloc(len_out_w); - - { - int i = 23; - - do { - key_y[i] = u3r_byte(23-i, key); - i--; - } while (i >= 0); - } - { - int i = 15; - - do { - iv_y[i] = u3r_byte(15-i, iv); - i--; - } while (i >= 0); - } - { - int i = len_msg_w - 1; - - do { - msg_y[i] = u3r_byte((len_msg_w - 1)-i, msg); - i--; - } while (i >= 0); - } - - if ( 0 != AES_set_decrypt_key(key_y, 192, &key_u) ) { - return u3m_bail(c3__exit); - } - else { - AES_cbc_encrypt(msg_y, out_y, len_msg_w, &key_u, iv_y, AES_DECRYPT); - } - - /* array reverse - we can write backwards u3i_bytes * - * in the unlikely event that this becomes a problem */ - { - int i = len_out_w - 1; - int j = 0; - c3_y tmp; - - do { - tmp = out_y[i]; - out_y[i] = out_y[j]; - out_y[j] = tmp; - i--; j++; - } while (i > j); - } - - out = u3i_bytes(len_out_w, out_y); - u3a_free(msg_y); - u3a_free(out_y); - return out; + u3r_bytes(0, 24, key_y, key); + return _cqea_cbc_help(key_y, iv, msg, &urcrypt_aes_cbcb_de); } u3_noun @@ -265,84 +131,18 @@ typedef c3_y* (*urcrypt_cbc)(const c3_y*, c3n == u3ud(b) ) { return u3m_bail(c3__exit); } else { - return u3qea_cbcb_de(a, b, c); + return _cqea_cbcb_de(a, b, c); } } - u3_noun - u3qea_cbcc_en(u3_atom key, + static u3_atom + _cqea_cbcc_en(u3_atom key, u3_atom iv, u3_atom msg) { c3_y key_y[32]; - c3_y iv_y[16]; - c3_w len_msg_w; - c3_w len_out_w; - c3_y *msg_y; - c3_y *out_y; - u3_atom out; - AES_KEY key_u; - - c3_assert(u3r_met(3, key) <= 32); - c3_assert(u3r_met(3, iv) <= 16); - len_msg_w = u3r_met(3, msg); - len_out_w = (len_msg_w % 16) == 0 ? len_msg_w : len_msg_w + (16 - (len_msg_w % 16)); - len_msg_w = len_out_w; - - msg_y = u3a_malloc(len_msg_w); - out_y = u3a_malloc(len_out_w); - - { - int i = 31; - - do { - key_y[i] = u3r_byte(31-i, key); - i--; - } while (i >= 0); - } - { - int i = 15; - - do { - iv_y[i] = u3r_byte(15-i, iv); - i--; - } while (i >= 0); - } - { - int i = len_msg_w - 1; - - do { - msg_y[i] = u3r_byte((len_msg_w - 1)-i, msg); - i--; - } while (i >= 0); - } - - if ( 0 != AES_set_encrypt_key(key_y, 256, &key_u) ) { - return u3m_bail(c3__exit); - } - else { - AES_cbc_encrypt(msg_y, out_y, len_msg_w, &key_u, iv_y, AES_ENCRYPT); - } - - /* array reverse - we can write backwards u3i_bytes * - * in the unlikely event that this becomes a problem */ - { - int i = len_out_w - 1; - int j = 0; - c3_y tmp; - - do { - tmp = out_y[i]; - out_y[i] = out_y[j]; - out_y[j] = tmp; - i--; j++; - } while (i > j); - } - - out = u3i_bytes(len_out_w, out_y); - u3a_free(msg_y); - u3a_free(out_y); - return out; + u3r_bytes(0, 32, key_y, key); + return _cqea_cbc_help(key_y, iv, msg, &urcrypt_aes_cbcc_en); } u3_noun @@ -355,84 +155,18 @@ typedef c3_y* (*urcrypt_cbc)(const c3_y*, c3n == u3ud(b) ) { return u3m_bail(c3__exit); } else { - return u3qea_cbcc_en(a, b, c); + return _cqea_cbcc_en(a, b, c); } } - u3_noun - u3qea_cbcc_de(u3_atom key, + static u3_atom + _cqea_cbcc_de(u3_atom key, u3_atom iv, u3_atom msg) { c3_y key_y[32]; - c3_y iv_y[16]; - c3_w len_msg_w; - c3_w len_out_w; - c3_y *msg_y; - c3_y *out_y; - u3_atom out; - AES_KEY key_u; - - c3_assert(u3r_met(3, key) <= 32); - c3_assert(u3r_met(3, iv) <= 16); - len_msg_w = u3r_met(3, msg); - len_out_w = (len_msg_w % 16) == 0 ? len_msg_w : len_msg_w + (16 - (len_msg_w % 16)); - len_msg_w = len_out_w; - - msg_y = u3a_malloc(len_msg_w); - out_y = u3a_malloc(len_out_w); - - { - int i = 31; - - do { - key_y[i] = u3r_byte(31-i, key); - i--; - } while (i >= 0); - } - { - int i = 15; - - do { - iv_y[i] = u3r_byte(15-i, iv); - i--; - } while (i >= 0); - } - { - int i = len_msg_w - 1; - - do { - msg_y[i] = u3r_byte((len_msg_w - 1)-i, msg); - i--; - } while (i >= 0); - } - - if ( 0 != AES_set_decrypt_key(key_y, 256, &key_u) ) { - return u3m_bail(c3__exit); - } - else { - AES_cbc_encrypt(msg_y, out_y, len_msg_w, &key_u, iv_y, AES_DECRYPT); - } - - /* array reverse - we can write backwards u3i_bytes * - * in the unlikely event that this becomes a problem */ - { - int i = len_out_w - 1; - int j = 0; - c3_y tmp; - - do { - tmp = out_y[i]; - out_y[i] = out_y[j]; - out_y[j] = tmp; - i--; j++; - } while (i > j); - } - - out = u3i_bytes(len_out_w, out_y); - u3a_free(msg_y); - u3a_free(out_y); - return out; + u3r_bytes(0, 32, key_y, key); + return _cqea_cbc_help(key_y, iv, msg, &urcrypt_aes_cbcc_de); } u3_noun @@ -445,6 +179,6 @@ typedef c3_y* (*urcrypt_cbc)(const c3_y*, c3n == u3ud(b) ) { return u3m_bail(c3__exit); } else { - return u3qea_cbcc_de(a, b, c); + return _cqea_cbcc_de(a, b, c); } } diff --git a/pkg/urcrypt/urcrypt.c b/pkg/urcrypt/urcrypt.c index f7604e2b1..ff1c72135 100644 --- a/pkg/urcrypt/urcrypt.c +++ b/pkg/urcrypt/urcrypt.c @@ -413,11 +413,7 @@ _urcrypt_cbc_help(const uint8_t *message, uint8_t riv[16], *in, *out; _urcrypt_reverse_copy(16, ivec, riv); - FILE* nukes = fopen("/tmp/urcrypt.txt", "w"); - fprintf(nukes, "length before: %d\r\n", (int) length); in = _urcrypt_cbc_pad(&length, message); - fprintf(nukes, "length after: %d\r\n", (int) length); - fclose(nukes); out = urcrypt_malloc(length); AES_cbc_encrypt(in, out, length, key, riv, enc); urcrypt_free(in); @@ -476,3 +472,103 @@ urcrypt_aes_cbca_de(const uint8_t *message, out_length); } } + +uint8_t* +urcrypt_aes_cbcb_en(const uint8_t *message, + size_t length, + const uint8_t key[24], + const uint8_t ivec[16], + size_t *out_length) +{ + AES_KEY aes_key; + uint8_t rkey[24]; + + _urcrypt_reverse_copy(24, key, rkey); + + if ( 0 != AES_set_encrypt_key(rkey, 192, &aes_key) ) { + return NULL; + } + else { + return _urcrypt_cbc_help(message, + length, + &aes_key, + ivec, + AES_ENCRYPT, + out_length); + } +} + +uint8_t* +urcrypt_aes_cbcb_de(const uint8_t *message, + size_t length, + const uint8_t key[24], + const uint8_t ivec[16], + size_t *out_length) +{ + AES_KEY aes_key; + uint8_t rkey[24]; + + _urcrypt_reverse_copy(24, key, rkey); + + if ( 0 != AES_set_decrypt_key(rkey, 192, &aes_key) ) { + return NULL; + } + else { + return _urcrypt_cbc_help(message, + length, + &aes_key, + ivec, + AES_DECRYPT, + out_length); + } +} + +uint8_t* +urcrypt_aes_cbcc_en(const uint8_t *message, + size_t length, + const uint8_t key[32], + const uint8_t ivec[16], + size_t *out_length) +{ + AES_KEY aes_key; + uint8_t rkey[32]; + + _urcrypt_reverse_copy(32, key, rkey); + + if ( 0 != AES_set_encrypt_key(rkey, 256, &aes_key) ) { + return NULL; + } + else { + return _urcrypt_cbc_help(message, + length, + &aes_key, + ivec, + AES_ENCRYPT, + out_length); + } +} + +uint8_t* +urcrypt_aes_cbcc_de(const uint8_t *message, + size_t length, + const uint8_t key[32], + const uint8_t ivec[16], + size_t *out_length) +{ + AES_KEY aes_key; + uint8_t rkey[32]; + + _urcrypt_reverse_copy(32, key, rkey); + + if ( 0 != AES_set_decrypt_key(rkey, 256, &aes_key) ) { + return NULL; + } + else { + return _urcrypt_cbc_help(message, + length, + &aes_key, + ivec, + AES_DECRYPT, + out_length); + } +} diff --git a/pkg/urcrypt/urcrypt.h b/pkg/urcrypt/urcrypt.h index 3471c25d1..89699d6b0 100644 --- a/pkg/urcrypt/urcrypt.h +++ b/pkg/urcrypt/urcrypt.h @@ -83,5 +83,25 @@ uint8_t* urcrypt_aes_cbca_de(const uint8_t *message, const uint8_t key[16], const uint8_t ivec[16], size_t *out_length); +uint8_t* urcrypt_aes_cbcb_en(const uint8_t *message, + size_t length, + const uint8_t key[24], + const uint8_t ivec[16], + size_t *out_length); +uint8_t* urcrypt_aes_cbcb_de(const uint8_t *message, + size_t length, + const uint8_t key[24], + const uint8_t ivec[16], + size_t *out_length); +uint8_t* urcrypt_aes_cbcc_en(const uint8_t *message, + size_t length, + const uint8_t key[32], + const uint8_t ivec[16], + size_t *out_length); +uint8_t* urcrypt_aes_cbcc_de(const uint8_t *message, + size_t length, + const uint8_t key[32], + const uint8_t ivec[16], + size_t *out_length); #endif From 6fdc65dea61edb79ba3c05b7bcebc679b51731e1 Mon Sep 17 00:00:00 2001 From: Paul Driver Date: Mon, 10 Aug 2020 15:19:32 -0700 Subject: [PATCH 021/329] argon2 --- nix/pkgs/default.nix | 2 +- nix/pkgs/urcrypt/default.nix | 4 +- pkg/urbit/jets/e/argon2.c | 172 +++++++++++++++++++---------------- pkg/urcrypt/Makefile | 2 +- pkg/urcrypt/urcrypt.c | 114 +++++++++++++++++++++++ pkg/urcrypt/urcrypt.h | 25 +++++ 6 files changed, 239 insertions(+), 80 deletions(-) diff --git a/nix/pkgs/default.nix b/nix/pkgs/default.nix index 9404cbd9e..db5120376 100644 --- a/nix/pkgs/default.nix +++ b/nix/pkgs/default.nix @@ -16,7 +16,7 @@ let urcrypt = import ./urcrypt { inherit pkgs ge-additions; - inherit (deps) ed25519; + inherit (deps) ed25519 argon2; }; libaes_siv = import ./libaes_siv { diff --git a/nix/pkgs/urcrypt/default.nix b/nix/pkgs/urcrypt/default.nix index 592e46cfe..e81413ca0 100644 --- a/nix/pkgs/urcrypt/default.nix +++ b/nix/pkgs/urcrypt/default.nix @@ -1,9 +1,9 @@ -{ pkgs, ge-additions, ed25519 }: +{ pkgs, ed25519, ge-additions, argon2 }: pkgs.stdenv.mkDerivation rec { name = "urcrypt"; builder = ./builder.sh; src = ../../../pkg/urcrypt; - buildInputs = [ pkgs.openssl ed25519 ge-additions ]; + buildInputs = [ pkgs.openssl ed25519 ge-additions argon2 ]; } diff --git a/pkg/urbit/jets/e/argon2.c b/pkg/urbit/jets/e/argon2.c index 0663304b7..55764b9f6 100644 --- a/pkg/urbit/jets/e/argon2.c +++ b/pkg/urbit/jets/e/argon2.c @@ -2,104 +2,124 @@ ** */ #include "all.h" - -#include +#include /* helpers */ - int argon2_alloc(uint8_t** output, size_t bytes) + static c3_t + _cqear_unpack_word(c3_w *out, u3_atom in) { - *output = u3a_malloc(bytes); - return (NULL != output); + if ( u3r_met(5, in) > 1 ) { + return 0; + } + else { + *out = u3r_word(0, in); + return 1; + } } - void argon2_free(uint8_t* memory, size_t bytes) + static c3_t + _cqear_unpack_size(size_t *out, u3_atom in) { - u3a_free(memory); + c3_w out_w; + if ( _cqear_unpack_word(&out_w, in) ) { + *out = out_w; + return 1; + } + else { + return 0; + } + } + + static c3_t + _cqear_unpack_type(urcrypt_argon2_type *out, u3_atom in) + { + switch ( in ) { + default: + return 0; + case c3__d: + *out = urcrypt_argon2_d; + return 1; + case c3__i: + *out = urcrypt_argon2_i; + return 1; + case c3__id: + *out = urcrypt_argon2_id; + return 1; + case c3__u: + *out = urcrypt_argon2_u; + return 1; + } + } + + static c3_y* + _cqear_unpack_bytes(size_t size, u3_atom in) + { + c3_y* out = u3a_malloc(size); + u3r_bytes(0, (c3_w) size, out, in); + return out; } /* functions */ - u3_noun - u3qe_argon2( // configuration params, + static u3_atom + _cqe_argon2( // configuration params, u3_atom out, u3_atom type, u3_atom version, u3_atom threads, u3_atom mem_cost, u3_atom time_cost, u3_atom wik, u3_atom key, u3_atom wix, u3_atom extra, // input params u3_atom wid, u3_atom dat, u3_atom wis, u3_atom sat ) { - c3_assert( _(u3a_is_cat(out)) && _(u3a_is_cat(type)) && - _(u3a_is_cat(version)) && _(u3a_is_cat(threads)) && - _(u3a_is_cat(mem_cost)) && _(u3a_is_cat(time_cost)) && - _(u3a_is_cat(wik)) && _(u3a_is_cat(wix)) && - _(u3a_is_cat(wid)) && _(u3a_is_cat(wis)) ); + size_t out_sz, key_sz, ex_sz, dat_sz, sat_sz; + c3_w ver_w, ted_w, mem_w, tim_w; + urcrypt_argon2_type typ_u; - // flip endianness for argon2 - key = u3qc_rev(3, wik, key); - extra = u3qc_rev(3, wix, extra); - dat = u3qc_rev(3, wid, dat); - sat = u3qc_rev(3, wis, sat); - - // atoms to byte arrays - c3_y bytes_key[wik]; - u3r_bytes(0, wik, bytes_key, key); - c3_y bytes_extra[wix]; - u3r_bytes(0, wix, bytes_extra, extra); - c3_y bytes_dat[wid]; - u3r_bytes(0, wid, bytes_dat, dat); - c3_y bytes_sat[wis]; - u3r_bytes(0, wis, bytes_sat, sat); - - c3_y outhash[out]; - argon2_context context = { - outhash, // output array, at least [digest length] in size - out, // digest length - bytes_dat, // password array - wid, // password length - bytes_sat, // salt array - wis, // salt length - bytes_key, wik, // optional secret data - bytes_extra, wix, // optional associated data - time_cost, mem_cost, threads, threads, // performance cost configuration - version, // algorithm version - argon2_alloc, // custom memory allocation function - argon2_free, // custom memory deallocation function - ARGON2_DEFAULT_FLAGS // by default only internal memory is cleared - }; - - int argon_res; - switch ( type ) { - default: - u3l_log("\nunjetted argon2 variant %i\n", type); - u3m_bail(c3__exit); - break; - // - case c3__d: - argon_res = argon2d_ctx(&context); - break; - // - case c3__i: - argon_res = argon2i_ctx(&context); - break; - // - case c3__id: - argon_res = argon2id_ctx(&context); - break; - // - case c3__u: - argon_res = argon2u_ctx(&context); - break; + if ( !(_cqear_unpack_size(&out_sz, out) && + _cqear_unpack_type(&typ_u, type) && + _cqear_unpack_word(&ver_w, version) && + _cqear_unpack_word(&ted_w, threads) && + _cqear_unpack_word(&mem_w, mem_cost) && + _cqear_unpack_word(&tim_w, time_cost) && + _cqear_unpack_size(&key_sz, wik) && + _cqear_unpack_size(&ex_sz, wix) && + _cqear_unpack_size(&dat_sz, wid) && + _cqear_unpack_size(&sat_sz, wis)) ) { + u3l_log("%s\r\n", "argon2-punt"); + return u3_none; } + else { + u3_atom ret; + c3_y *key_y = _cqear_unpack_bytes(key_sz, key), + *ex_y = _cqear_unpack_bytes(ex_sz, extra), + *dat_y = _cqear_unpack_bytes(dat_sz, dat), + *sat_y = _cqear_unpack_bytes(sat_sz, sat), + *out_y = u3a_malloc(out_sz); + const c3_c* err_c = urcrypt_argon2( + typ_u, ver_w, ted_w, mem_w, tim_w, + key_sz, key_y, + ex_sz, ex_y, + dat_sz, dat_y, + sat_sz, sat_y, + out_sz, out_y); - if ( ARGON2_OK != argon_res ) { - u3l_log("\nargon2 error: %s\n", argon2_error_message(argon_res)); - u3m_bail(c3__exit); + u3a_free(key_y); + u3a_free(ex_y); + u3a_free(dat_y); + u3a_free(sat_y); + + if ( NULL == err_c ) { + ret = u3i_bytes(out_sz, out_y); + } + else { + ret = u3_none; + u3l_log("argon2-punt: %s\r\n", err_c); + } + + u3a_free(out_y); + return ret; } - - u3z(key); u3z(extra); u3z(dat); u3z(sat); - return u3kc_rev(3, out, u3i_bytes(out, outhash)); } u3_noun @@ -138,7 +158,7 @@ return u3m_bail(c3__exit); } else { - return u3qe_argon2(out, type, version, + return _cqe_argon2(out, type, version, threads, mem_cost, time_cost, wik, key, wix, extra, wid, dat, wis, sat); diff --git a/pkg/urcrypt/Makefile b/pkg/urcrypt/Makefile index 7b2a0ecc3..045b85416 100644 --- a/pkg/urcrypt/Makefile +++ b/pkg/urcrypt/Makefile @@ -16,7 +16,7 @@ liburcrypt.a: $(SOURCES) liburcrypt.so: $(SOURCES) $(CC) $(CFLAGS) -fPIC -c urcrypt.c -o urcrypt-shared.o $(CC) -shared urcrypt-shared.o -o liburcrypt.so \ - -led25519 -lge-additions -lssl \ + -led25519 -lge-additions -lssl -largon2 \ -Wl,--no-undefined all: liburcrypt.a liburcrypt.so diff --git a/pkg/urcrypt/urcrypt.c b/pkg/urcrypt/urcrypt.c index ff1c72135..5f1b12d81 100644 --- a/pkg/urcrypt/urcrypt.c +++ b/pkg/urcrypt/urcrypt.c @@ -249,6 +249,14 @@ _urcrypt_reverse_copy(size_t size, const uint8_t *in, uint8_t *out) { } } +static uint8_t* +_urcrypt_reverse_alloc(size_t size, const uint8_t *in) +{ + uint8_t *out = urcrypt_malloc(size); + _urcrypt_reverse_copy(size, in, out); + return out; +} + static void _urcrypt_reverse_inplace(size_t size, uint8_t *ptr) { size_t i, j; @@ -572,3 +580,109 @@ urcrypt_aes_cbcc_de(const uint8_t *message, out_length); } } + +static int +_urcrypt_argon2_alloc(uint8_t** output, size_t bytes) +{ + *output = urcrypt_malloc(bytes); + return (NULL != output); +} + +static void +_urcrypt_argon2_free(uint8_t* memory, size_t bytes) +{ + urcrypt_free(memory); +} + +// library convention is to have sizes in size_t, but argon2 wants them +// in uint32_t, so here's a helper macro for ensuring equivalence. +#define SZ_32(s) ( sizeof(size_t) <= sizeof(uint32_t) || s <= 0xFFFFFFFF ) + +// returns a constant error message string or NULL for success +// (so user doesn't have to call argon2_error_message) +const char* +urcrypt_argon2(urcrypt_argon2_type type, + uint32_t version, + uint32_t threads, + uint32_t memory_cost, + uint32_t time_cost, + size_t secret_length, + const uint8_t *secret, + size_t associated_length, + const uint8_t *associated, + size_t password_length, + const uint8_t *password, + size_t salt_length, + const uint8_t *salt, + size_t out_length, + uint8_t *out) +{ + if ( !( SZ_32(secret_length) && + SZ_32(associated_length) && + SZ_32(password_length) && + SZ_32(salt_length) && + SZ_32(out_length) ) ) { + return "length > 32 bits"; + } + else { + int (*f)(argon2_context*); + int result; + uint8_t *rsecret, *rassoc, *rpassword, *rsalt; + + switch ( type ) { + default: + return "unknown type"; + case urcrypt_argon2_d: + f = &argon2d_ctx; + break; + case urcrypt_argon2_i: + f = &argon2i_ctx; + break; + case urcrypt_argon2_id: + f = &argon2id_ctx; + break; + case urcrypt_argon2_u: + f = &argon2u_ctx; + break; + } + + rsecret = _urcrypt_reverse_alloc(secret_length, secret); + rassoc = _urcrypt_reverse_alloc(associated_length, associated); + rpassword = _urcrypt_reverse_alloc(password_length, password); + rsalt = _urcrypt_reverse_alloc(salt_length, salt); + argon2_context context = { + out, // output array, at least [digest length] in size + out_length, // digest length + rpassword, // password array + password_length, // password length + rsalt, // salt array + salt_length, // salt length + rsecret, // optional secret data + secret_length, + rassoc, // optional associated data + associated_length, + time_cost, // performance cost configuration + memory_cost, + threads, + threads, + version, // algorithm version + &_urcrypt_argon2_alloc,// custom memory allocation function + &_urcrypt_argon2_free, // custom memory deallocation function + ARGON2_DEFAULT_FLAGS // by default only internal memory is cleared + }; + + result = (*f)(&context); + urcrypt_free(rsecret); + urcrypt_free(rassoc); + urcrypt_free(rpassword); + urcrypt_free(rsalt); + + if ( ARGON2_OK != result ) { + return argon2_error_message(result); + } + else { + _urcrypt_reverse_inplace(out_length, out); + return NULL; + } + } +} diff --git a/pkg/urcrypt/urcrypt.h b/pkg/urcrypt/urcrypt.h index 89699d6b0..da0b2beb3 100644 --- a/pkg/urcrypt/urcrypt.h +++ b/pkg/urcrypt/urcrypt.h @@ -12,6 +12,8 @@ #include #include +#include + typedef void *(*urcrypt_malloc_t)(size_t); typedef void *(*urcrypt_realloc_t)(void*, size_t); typedef void (*urcrypt_free_t)(void*); @@ -104,4 +106,27 @@ uint8_t* urcrypt_aes_cbcc_de(const uint8_t *message, const uint8_t ivec[16], size_t *out_length); +typedef enum urcrypt_argon2_type { + urcrypt_argon2_d = 0, + urcrypt_argon2_i = 1, + urcrypt_argon2_id = 2, + urcrypt_argon2_u = 10, +} urcrypt_argon2_type; + +const char* urcrypt_argon2(urcrypt_argon2_type type, + uint32_t version, + uint32_t threads, + uint32_t memory_cost, + uint32_t time_cost, + size_t secret_length, + const uint8_t *secret, + size_t associated_length, + const uint8_t *associated, + size_t password_length, + const uint8_t *password, + size_t salt_length, + const uint8_t *salt, + size_t out_length, + uint8_t *out); + #endif From 6deec6229288d5dccd7cc7ae30437db84f4b3961 Mon Sep 17 00:00:00 2001 From: Paul Driver Date: Tue, 11 Aug 2020 11:12:25 -0700 Subject: [PATCH 022/329] rename u3r_unpack->u3r_bytes_fit, u3r_unpack_alloc->u3r_bytes_all --- pkg/urbit/include/noun/retrieve.h | 13 +++++++------ pkg/urbit/jets/e/aes_cbc.c | 2 +- pkg/urbit/jets/e/ed_add_double_scalarmult.c | 8 ++++---- .../jets/e/ed_add_scalarmult_scalarmult_base.c | 6 +++--- pkg/urbit/jets/e/ed_point_add.c | 4 ++-- pkg/urbit/jets/e/ed_puck.c | 2 +- pkg/urbit/jets/e/ed_scalarmult.c | 4 ++-- pkg/urbit/jets/e/ed_scalarmult_base.c | 2 +- pkg/urbit/jets/e/ed_shar.c | 4 ++-- pkg/urbit/jets/e/ed_sign.c | 4 ++-- pkg/urbit/jets/e/ed_veri.c | 6 +++--- pkg/urbit/noun/retrieve.c | 8 ++++---- 12 files changed, 32 insertions(+), 31 deletions(-) diff --git a/pkg/urbit/include/noun/retrieve.h b/pkg/urbit/include/noun/retrieve.h index 295ad622a..8eb6ed880 100644 --- a/pkg/urbit/include/noun/retrieve.h +++ b/pkg/urbit/include/noun/retrieve.h @@ -346,21 +346,22 @@ c3_y* c_y, u3_atom d); - /* u3r_unpack(): + /* u3r_bytes_fit(): ** ** Copy (len_w) bytes of (a) into (buf_y) if it fits, returning overage */ c3_w - u3r_unpack(c3_w len_w, - c3_y *buf_y, - u3_atom a); + u3r_bytes_fit(c3_w len_w, + c3_y* buf_y, + u3_atom a); - /* u3r_unpack_alloc(): + /* u3r_bytes_all(): ** ** Allocate a new byte array with all the bytes of (a) */ c3_y* - u3r_unpack_alloc(c3_w* len_w, u3_atom a); + u3r_bytes_all(c3_w* len_w, + u3_atom a); /* u3r_chop(): ** diff --git a/pkg/urbit/jets/e/aes_cbc.c b/pkg/urbit/jets/e/aes_cbc.c index 19e129132..06d9df381 100644 --- a/pkg/urbit/jets/e/aes_cbc.c +++ b/pkg/urbit/jets/e/aes_cbc.c @@ -25,7 +25,7 @@ typedef c3_y* (*urcrypt_cbc)(const c3_y*, u3r_bytes(0, 16, iv_y, iv); - msg_y = u3r_unpack_alloc(&met_w, msg); + msg_y = u3r_bytes_all(&met_w, msg); out_y = (*low_f)(msg_y, met_w, key_y, iv_y, &len); u3a_free(msg_y); diff --git a/pkg/urbit/jets/e/ed_add_double_scalarmult.c b/pkg/urbit/jets/e/ed_add_double_scalarmult.c index e49a0bf16..af73d5964 100644 --- a/pkg/urbit/jets/e/ed_add_double_scalarmult.c +++ b/pkg/urbit/jets/e/ed_add_double_scalarmult.c @@ -14,10 +14,10 @@ { c3_y a_y[32], b_y[32], c_y[32], d_y[32], out_y[32]; - if ( (0 != u3r_unpack(32, a_y, a)) || - (0 != u3r_unpack(32, b_y, b)) || - (0 != u3r_unpack(32, c_y, c)) || - (0 != u3r_unpack(32, d_y, d)) || + if ( (0 != u3r_bytes_fit(32, a_y, a)) || + (0 != u3r_bytes_fit(32, b_y, b)) || + (0 != u3r_bytes_fit(32, c_y, c)) || + (0 != u3r_bytes_fit(32, d_y, d)) || (0 != urcrypt_ed_add_double_scalarmult(a_y, b_y, c_y, d_y, out_y)) ) { return u3_none; } diff --git a/pkg/urbit/jets/e/ed_add_scalarmult_scalarmult_base.c b/pkg/urbit/jets/e/ed_add_scalarmult_scalarmult_base.c index 0a0e2d2d4..2db437aec 100644 --- a/pkg/urbit/jets/e/ed_add_scalarmult_scalarmult_base.c +++ b/pkg/urbit/jets/e/ed_add_scalarmult_scalarmult_base.c @@ -13,9 +13,9 @@ { c3_y a_y[32], b_y[32], c_y[32], out_y[32]; - if ( (0 != u3r_unpack(32, a_y, a)) || - (0 != u3r_unpack(32, b_y, b)) || - (0 != u3r_unpack(32, c_y, c)) || + if ( (0 != u3r_bytes_fit(32, a_y, a)) || + (0 != u3r_bytes_fit(32, b_y, b)) || + (0 != u3r_bytes_fit(32, c_y, c)) || (0 != urcrypt_ed_add_scalarmult_scalarmult_base(a_y, b_y, c_y, out_y)) ) { return u3_none; } diff --git a/pkg/urbit/jets/e/ed_point_add.c b/pkg/urbit/jets/e/ed_point_add.c index a93f798b3..2a5da2938 100644 --- a/pkg/urbit/jets/e/ed_point_add.c +++ b/pkg/urbit/jets/e/ed_point_add.c @@ -13,8 +13,8 @@ { c3_y a_y[32], b_y[32], out_y[32]; - if ( (0 != u3r_unpack(32, a_y, a)) || - (0 != u3r_unpack(32, b_y, b)) || + if ( (0 != u3r_bytes_fit(32, a_y, a)) || + (0 != u3r_bytes_fit(32, b_y, b)) || (0 != urcrypt_ed_point_add(a_y, b_y, out_y)) ) { return u3_none; } diff --git a/pkg/urbit/jets/e/ed_puck.c b/pkg/urbit/jets/e/ed_puck.c index 8257b937e..436650e1a 100644 --- a/pkg/urbit/jets/e/ed_puck.c +++ b/pkg/urbit/jets/e/ed_puck.c @@ -11,7 +11,7 @@ { c3_y sed_y[32]; - if ( 0 != u3r_unpack(32, sed_y, sed) ) { + if ( 0 != u3r_bytes_fit(32, sed_y, sed) ) { // hoon explicitly crashes on mis-size return u3m_bail(c3__exit); } diff --git a/pkg/urbit/jets/e/ed_scalarmult.c b/pkg/urbit/jets/e/ed_scalarmult.c index 224fba3f6..97c88c4f6 100644 --- a/pkg/urbit/jets/e/ed_scalarmult.c +++ b/pkg/urbit/jets/e/ed_scalarmult.c @@ -12,8 +12,8 @@ { c3_y a_y[32], b_y[32], out_y[32]; - if ( (0 != u3r_unpack(32, a_y, a)) || - (0 != u3r_unpack(32, b_y, b)) || + if ( (0 != u3r_bytes_fit(32, a_y, a)) || + (0 != u3r_bytes_fit(32, b_y, b)) || (0 != urcrypt_ed_scalarmult(a_y, b_y, out_y)) ) { // hoon does not check size of inputs return u3_none; diff --git a/pkg/urbit/jets/e/ed_scalarmult_base.c b/pkg/urbit/jets/e/ed_scalarmult_base.c index c1b641bd9..9756e65a5 100644 --- a/pkg/urbit/jets/e/ed_scalarmult_base.c +++ b/pkg/urbit/jets/e/ed_scalarmult_base.c @@ -11,7 +11,7 @@ { c3_y a_y[32]; - if ( 0 != u3r_unpack(32, a_y, a) ) { + if ( 0 != u3r_bytes_fit(32, a_y, a) ) { return u3_none; } else { diff --git a/pkg/urbit/jets/e/ed_shar.c b/pkg/urbit/jets/e/ed_shar.c index 5ed28df37..7db4e6175 100644 --- a/pkg/urbit/jets/e/ed_shar.c +++ b/pkg/urbit/jets/e/ed_shar.c @@ -9,11 +9,11 @@ { c3_y pub_y[32], sek_y[32]; - if ( 0 != u3r_unpack(32, pub_y, pub) ) { + if ( 0 != u3r_bytes_fit(32, pub_y, pub) ) { // pub is not size checked in the hoon return u3_none; } - else if ( 0 != u3r_unpack(32, sek_y, sek) ) { + else if ( 0 != u3r_bytes_fit(32, sek_y, sek) ) { // sek explicitly bails through suck return u3m_bail(c3__exit); } diff --git a/pkg/urbit/jets/e/ed_sign.c b/pkg/urbit/jets/e/ed_sign.c index e6a153ba1..09fd317d0 100644 --- a/pkg/urbit/jets/e/ed_sign.c +++ b/pkg/urbit/jets/e/ed_sign.c @@ -12,14 +12,14 @@ { c3_y sed_y[32]; - if ( 0 != u3r_unpack(32, sed_y, b) ) { + if ( 0 != u3r_bytes_fit(32, sed_y, b) ) { // hoon calls suck, which calls puck, which crashes return u3m_bail(c3__exit); } else { c3_y sig_y[64]; c3_w met_w; - c3_y* mes_y = u3r_unpack_alloc(&met_w, a); + c3_y* mes_y = u3r_bytes_all(&met_w, a); urcrypt_ed_sign(mes_y, met_w, sed_y, sig_y); u3a_free(mes_y); diff --git a/pkg/urbit/jets/e/ed_veri.c b/pkg/urbit/jets/e/ed_veri.c index f4bf30ac3..c4a4b6f2d 100644 --- a/pkg/urbit/jets/e/ed_veri.c +++ b/pkg/urbit/jets/e/ed_veri.c @@ -13,14 +13,14 @@ { c3_y sig_y[64], pub_y[32]; - if ( (0 != u3r_unpack(64, sig_y, s)) || - (0 != u3r_unpack(32, pub_y, pk)) ) { + if ( (0 != u3r_bytes_fit(64, sig_y, s)) || + (0 != u3r_bytes_fit(32, pub_y, pk)) ) { // hoon checks sizes, but weirdly and without crashes return u3_none; } else { c3_w met_w; - c3_y* mes_y = u3r_unpack_alloc(&met_w, m); + c3_y* mes_y = u3r_bytes_all(&met_w, m); c3_t val_t = urcrypt_ed_veri(mes_y, met_w, pub_y, sig_y); u3a_free(mes_y); diff --git a/pkg/urbit/noun/retrieve.c b/pkg/urbit/noun/retrieve.c index b8f875b86..8354d4243 100644 --- a/pkg/urbit/noun/retrieve.c +++ b/pkg/urbit/noun/retrieve.c @@ -1076,12 +1076,12 @@ u3r_bytes(c3_w a_w, } } -/* u3r_unpack(): +/* u3r_bytes_fit(): ** ** Copy (len_w) bytes of (a) into (buf_y) if it fits, returning overage */ c3_w -u3r_unpack(c3_w len_w, c3_y *buf_y, u3_atom a) +u3r_bytes_fit(c3_w len_w, c3_y *buf_y, u3_atom a) { c3_w met_w = u3r_met(3, a); if ( met_w <= len_w ) { @@ -1093,12 +1093,12 @@ u3r_unpack(c3_w len_w, c3_y *buf_y, u3_atom a) } } -/* u3r_unpack_alloc(): +/* u3r_bytes_all(): ** ** Allocate a new byte array with all the bytes of (a) */ c3_y* -u3r_unpack_alloc(c3_w* len_w, u3_atom a) +u3r_bytes_all(c3_w* len_w, u3_atom a) { c3_w met_w = u3r_met(3, a); c3_y* a_y = u3a_malloc(met_w); From 3f917d784817efaa7dea3c3933e522fc6dcb1b2b Mon Sep 17 00:00:00 2001 From: Paul Driver Date: Tue, 11 Aug 2020 13:04:04 -0700 Subject: [PATCH 023/329] move argon unpacking helpers to u3r --- pkg/urbit/include/noun/retrieve.h | 31 ++++++++++++- pkg/urbit/jets/e/argon2.c | 50 ++++++--------------- pkg/urbit/noun/retrieve.c | 74 ++++++++++++++++++++++++++++--- 3 files changed, 110 insertions(+), 45 deletions(-) diff --git a/pkg/urbit/include/noun/retrieve.h b/pkg/urbit/include/noun/retrieve.h index 8eb6ed880..33a5f6c3c 100644 --- a/pkg/urbit/include/noun/retrieve.h +++ b/pkg/urbit/include/noun/retrieve.h @@ -348,16 +348,26 @@ /* u3r_bytes_fit(): ** - ** Copy (len_w) bytes of (a) into (buf_y) if it fits, returning overage + ** Copy (len_w) bytes of (a) into (buf_y) if it fits, returning overage. */ c3_w u3r_bytes_fit(c3_w len_w, c3_y* buf_y, u3_atom a); + /* u3r_bytes_alloc(): + ** + ** Copy (len_w) bytes starting at (a_w) from (b) into a fresh allocation. + */ + c3_y* + u3r_bytes_alloc(c3_w a_w, + c3_w len_w, + u3_atom b); + /* u3r_bytes_all(): ** - ** Allocate a new byte array with all the bytes of (a) + ** Allocate and return a new byte array with all the bytes of (a), + ** storing the length in (len_w). */ c3_y* u3r_bytes_all(c3_w* len_w, @@ -393,6 +403,23 @@ u3r_word(c3_w a_w, u3_atom b); + + /* u3r_word_fit(): + ** + ** Fill (out_w) with (a) if it fits, returning success. + */ + c3_t + u3r_word_fit(c3_w* out_w, + u3_atom a); + + /* u3r_size_fit(): + ** + ** Fill (out) with (a) if it fits, returning success. + */ + c3_t + u3r_size_fit(size_t *out_p, + u3_atom a); + /* u3r_chub(): ** ** Return double-word (a_w) of (b). diff --git a/pkg/urbit/jets/e/argon2.c b/pkg/urbit/jets/e/argon2.c index 55764b9f6..f2c04fbd0 100644 --- a/pkg/urbit/jets/e/argon2.c +++ b/pkg/urbit/jets/e/argon2.c @@ -7,31 +7,6 @@ /* helpers */ - static c3_t - _cqear_unpack_word(c3_w *out, u3_atom in) - { - if ( u3r_met(5, in) > 1 ) { - return 0; - } - else { - *out = u3r_word(0, in); - return 1; - } - } - - static c3_t - _cqear_unpack_size(size_t *out, u3_atom in) - { - c3_w out_w; - if ( _cqear_unpack_word(&out_w, in) ) { - *out = out_w; - return 1; - } - else { - return 0; - } - } - static c3_t _cqear_unpack_type(urcrypt_argon2_type *out, u3_atom in) { @@ -56,9 +31,9 @@ static c3_y* _cqear_unpack_bytes(size_t size, u3_atom in) { - c3_y* out = u3a_malloc(size); - u3r_bytes(0, (c3_w) size, out, in); - return out; + c3_w len_w = size; + c3_assert(size == len_w); + return u3r_bytes_alloc(0, len_w, in); } /* functions @@ -76,16 +51,16 @@ c3_w ver_w, ted_w, mem_w, tim_w; urcrypt_argon2_type typ_u; - if ( !(_cqear_unpack_size(&out_sz, out) && + if ( !(u3r_size_fit(&out_sz, out) && _cqear_unpack_type(&typ_u, type) && - _cqear_unpack_word(&ver_w, version) && - _cqear_unpack_word(&ted_w, threads) && - _cqear_unpack_word(&mem_w, mem_cost) && - _cqear_unpack_word(&tim_w, time_cost) && - _cqear_unpack_size(&key_sz, wik) && - _cqear_unpack_size(&ex_sz, wix) && - _cqear_unpack_size(&dat_sz, wid) && - _cqear_unpack_size(&sat_sz, wis)) ) { + u3r_word_fit(&ver_w, version) && + u3r_word_fit(&ted_w, threads) && + u3r_word_fit(&mem_w, mem_cost) && + u3r_word_fit(&tim_w, time_cost) && + u3r_size_fit(&key_sz, wik) && + u3r_size_fit(&ex_sz, wix) && + u3r_size_fit(&dat_sz, wid) && + u3r_size_fit(&sat_sz, wis)) ) { u3l_log("%s\r\n", "argon2-punt"); return u3_none; } @@ -96,6 +71,7 @@ *dat_y = _cqear_unpack_bytes(dat_sz, dat), *sat_y = _cqear_unpack_bytes(sat_sz, sat), *out_y = u3a_malloc(out_sz); + const c3_c* err_c = urcrypt_argon2( typ_u, ver_w, ted_w, mem_w, tim_w, key_sz, key_y, diff --git a/pkg/urbit/noun/retrieve.c b/pkg/urbit/noun/retrieve.c index 8354d4243..345c3add7 100644 --- a/pkg/urbit/noun/retrieve.c +++ b/pkg/urbit/noun/retrieve.c @@ -1093,18 +1093,30 @@ u3r_bytes_fit(c3_w len_w, c3_y *buf_y, u3_atom a) } } +/* u3r_bytes_alloc(): +** +** Copy (len_w) bytes starting at (a_w) from (b) into a fresh allocation. +*/ +c3_y* +u3r_bytes_alloc(c3_w a_w, + c3_w len_w, + u3_atom b) +{ + c3_y* b_y = u3a_malloc(len_w); + u3r_bytes(a_w, a_w + len_w, b_y, b); + return b_y; +} + /* u3r_bytes_all(): ** -** Allocate a new byte array with all the bytes of (a) +** Allocate and return a new byte array with all the bytes of (a), +** storing the length in (len_w). */ c3_y* u3r_bytes_all(c3_w* len_w, u3_atom a) { - c3_w met_w = u3r_met(3, a); - c3_y* a_y = u3a_malloc(met_w); - u3r_bytes(0, met_w, a_y, a); - *len_w = met_w; - return a_y; + c3_w met_w = *len_w = u3r_met(3, a); + return u3r_bytes_alloc(0, met_w, a); } /* u3r_mp(): @@ -1165,6 +1177,56 @@ u3r_word(c3_w a_w, } } +/* u3r_word_fit(): +** +** Fill (out_w) with (a) if it fits, returning success. +*/ +c3_t +u3r_word_fit(c3_w *out_w, u3_atom a) +{ + if ( u3r_met(5, a) > 1 ) { + return 0; + } + else { + *out_w = u3r_word(0, a); + return 1; + } +} + +/* u3r_size_fit(): +** +** Fill (out) with (a) if it fits, returning success. +*/ +c3_t +u3r_size_fit(size_t *out_p, u3_atom a) +{ + if ( 0 == a ) { + *out_p = 0; + return 1; + } + else { + c3_w met_w = u3r_met(3, a); + if ( met_w > sizeof(size_t) ) { + return 0; + } + else { + u3r_bytes(0, sizeof(size_t), (c3_y*) out_p, a); +#if c3_endian == c3_endian_big + { // reverse those bytes + c3_w i_w, j_w; + c3_y tmp, *s_y = (c3_y*) out_p; + for ( i_w = 0, j_w = sizeof(size_t) - 1; i_w < j_w; ++i_w, --j_w ) { + tmp = s_y[i_w]; + s_y[i_w] = s_y[j_w]; + s_y[j_w] = tmp; + } + } +#endif + return 1; + } + } +} + /* u3r_chub(): ** ** Return double-word (a_w) of (b). From ab8d0dd7efb3ccd3571f365184fa513c3b6cbbe5 Mon Sep 17 00:00:00 2001 From: Paul Driver Date: Tue, 11 Aug 2020 15:01:24 -0700 Subject: [PATCH 024/329] blake2b --- pkg/urbit/include/noun/retrieve.h | 8 ---- pkg/urbit/jets/e/argon2.c | 43 ++++++++------------ pkg/urbit/jets/e/blake.c | 67 +++++++++++++------------------ pkg/urbit/noun/retrieve.c | 34 ---------------- pkg/urcrypt/urcrypt.c | 33 +++++++++++++++ pkg/urcrypt/urcrypt.h | 8 ++++ 6 files changed, 86 insertions(+), 107 deletions(-) diff --git a/pkg/urbit/include/noun/retrieve.h b/pkg/urbit/include/noun/retrieve.h index 33a5f6c3c..3fc20a988 100644 --- a/pkg/urbit/include/noun/retrieve.h +++ b/pkg/urbit/include/noun/retrieve.h @@ -412,14 +412,6 @@ u3r_word_fit(c3_w* out_w, u3_atom a); - /* u3r_size_fit(): - ** - ** Fill (out) with (a) if it fits, returning success. - */ - c3_t - u3r_size_fit(size_t *out_p, - u3_atom a); - /* u3r_chub(): ** ** Return double-word (a_w) of (b). diff --git a/pkg/urbit/jets/e/argon2.c b/pkg/urbit/jets/e/argon2.c index f2c04fbd0..9c145e00f 100644 --- a/pkg/urbit/jets/e/argon2.c +++ b/pkg/urbit/jets/e/argon2.c @@ -28,14 +28,6 @@ } } - static c3_y* - _cqear_unpack_bytes(size_t size, u3_atom in) - { - c3_w len_w = size; - c3_assert(size == len_w); - return u3r_bytes_alloc(0, len_w, in); - } - /* functions */ @@ -47,38 +39,37 @@ // input params u3_atom wid, u3_atom dat, u3_atom wis, u3_atom sat ) { - size_t out_sz, key_sz, ex_sz, dat_sz, sat_sz; - c3_w ver_w, ted_w, mem_w, tim_w; urcrypt_argon2_type typ_u; + c3_w out_w, wik_w, wix_w, wid_w, wis_w, ver_w, ted_w, mem_w, tim_w; - if ( !(u3r_size_fit(&out_sz, out) && + if ( !(u3r_word_fit(&out_w, out) && _cqear_unpack_type(&typ_u, type) && u3r_word_fit(&ver_w, version) && u3r_word_fit(&ted_w, threads) && u3r_word_fit(&mem_w, mem_cost) && u3r_word_fit(&tim_w, time_cost) && - u3r_size_fit(&key_sz, wik) && - u3r_size_fit(&ex_sz, wix) && - u3r_size_fit(&dat_sz, wid) && - u3r_size_fit(&sat_sz, wis)) ) { + u3r_word_fit(&wik_w, wik) && + u3r_word_fit(&wix_w, wix) && + u3r_word_fit(&wid_w, wid) && + u3r_word_fit(&wis_w, wis)) ) { u3l_log("%s\r\n", "argon2-punt"); return u3_none; } else { u3_atom ret; - c3_y *key_y = _cqear_unpack_bytes(key_sz, key), - *ex_y = _cqear_unpack_bytes(ex_sz, extra), - *dat_y = _cqear_unpack_bytes(dat_sz, dat), - *sat_y = _cqear_unpack_bytes(sat_sz, sat), - *out_y = u3a_malloc(out_sz); + c3_y *key_y = u3r_bytes_alloc(0, wik_w, key), + *ex_y = u3r_bytes_alloc(0, wix_w, extra), + *dat_y = u3r_bytes_alloc(0, wid_w, dat), + *sat_y = u3r_bytes_alloc(0, wis_w, sat), + *out_y = u3a_malloc(out_w); const c3_c* err_c = urcrypt_argon2( typ_u, ver_w, ted_w, mem_w, tim_w, - key_sz, key_y, - ex_sz, ex_y, - dat_sz, dat_y, - sat_sz, sat_y, - out_sz, out_y); + wik_w, key_y, + wix_w, ex_y, + wid_w, dat_y, + wis_w, sat_y, + out_w, out_y); u3a_free(key_y); u3a_free(ex_y); @@ -86,7 +77,7 @@ u3a_free(sat_y); if ( NULL == err_c ) { - ret = u3i_bytes(out_sz, out_y); + ret = u3i_bytes(out_w, out_y); } else { ret = u3_none; diff --git a/pkg/urbit/jets/e/blake.c b/pkg/urbit/jets/e/blake.c index eece09ab5..eb36ba87d 100644 --- a/pkg/urbit/jets/e/blake.c +++ b/pkg/urbit/jets/e/blake.c @@ -2,52 +2,42 @@ ** */ #include "all.h" - -#include -#include +#include /* functions */ - u3_noun - u3qe_blake(u3_atom wid, u3_atom dat, + static u3_atom + _cqe_blake(u3_atom wid, u3_atom dat, u3_atom wik, u3_atom dak, u3_atom out) { - c3_assert(_(u3a_is_cat(wid)) && _(u3a_is_cat(wik)) && _(u3a_is_cat(out))); - - // flip endianness for the internal blake2b function - dat = u3qc_rev(3, wid, dat); - dak = u3qc_rev(3, wik, dak); - - c3_y* dat_y = (c3_y*)u3a_malloc(wid); - u3r_bytes(0, wid, (void*)dat_y, dat); - - c3_y* dak_y = (c3_y*)u3a_malloc(wik); - u3r_bytes(0, wik, (void*)dak_y, dak); - - int ret; - c3_y out_y[64]; - ret = blake2b(out_y, // OUT: output - out, // IN: max output size - dat_y, // IN: msg body - wid, // IN: msg len - dak_y, // IN: key body - wik); // IN: key len - - /* free() BEFORE checking error code; - we don't want to leak memory if we return early - */ - u3a_free(dat_y); - u3a_free(dak_y); - - if ( 0 != ret ) - { - u3l_log("\rblake jet: cryto lib error\n"); - return u3m_bail(c3__exit); + c3_w wid_w; + if ( !u3r_word_fit(&wid_w, wid) ) { + // impossible to represent an atom this large + return u3m_bail(c3__fail); } + else { + // the hoon adjusts these widths to its liking + int err; + u3_atom ret; + c3_y out_y[64], dak_y[64]; + c3_w wik_w = c3_min(wik, 64), + out_w = c3_max(1, c3_min(out, 64)); + c3_y *dat_y = u3r_bytes_alloc(0, wid_w, dat); - return u3kc_rev(3, out, u3i_bytes(out, out_y)); + u3r_bytes(0, wik_w, dak_y, dak); + err = urcrypt_blake2(wid_w, dat_y, wik_w, dak_y, out_w, out_y); + u3a_free(dat_y); + + if ( 0 == err ) { + return u3i_bytes(out_w, out_y); + } + else { + u3l_log("%s\r\n", "blake2-punt: library error"); + return u3_none; + } + } } u3_noun @@ -64,9 +54,8 @@ u3r_cell(key, &wik, &dak) || u3ud(wik) || u3ud(dak) || u3ud(out) ) { - u3l_log("\rblake jet: arguments error\n"); return u3m_bail(c3__exit); } else { - return u3qe_blake(wid, dat, wik, dak, out); + return _cqe_blake(wid, dat, wik, dak, out); } } diff --git a/pkg/urbit/noun/retrieve.c b/pkg/urbit/noun/retrieve.c index 345c3add7..df3802a78 100644 --- a/pkg/urbit/noun/retrieve.c +++ b/pkg/urbit/noun/retrieve.c @@ -1193,40 +1193,6 @@ u3r_word_fit(c3_w *out_w, u3_atom a) } } -/* u3r_size_fit(): -** -** Fill (out) with (a) if it fits, returning success. -*/ -c3_t -u3r_size_fit(size_t *out_p, u3_atom a) -{ - if ( 0 == a ) { - *out_p = 0; - return 1; - } - else { - c3_w met_w = u3r_met(3, a); - if ( met_w > sizeof(size_t) ) { - return 0; - } - else { - u3r_bytes(0, sizeof(size_t), (c3_y*) out_p, a); -#if c3_endian == c3_endian_big - { // reverse those bytes - c3_w i_w, j_w; - c3_y tmp, *s_y = (c3_y*) out_p; - for ( i_w = 0, j_w = sizeof(size_t) - 1; i_w < j_w; ++i_w, --j_w ) { - tmp = s_y[i_w]; - s_y[i_w] = s_y[j_w]; - s_y[j_w] = tmp; - } - } -#endif - return 1; - } - } -} - /* u3r_chub(): ** ** Return double-word (a_w) of (b). diff --git a/pkg/urcrypt/urcrypt.c b/pkg/urcrypt/urcrypt.c index 5f1b12d81..f878f6a9c 100644 --- a/pkg/urcrypt/urcrypt.c +++ b/pkg/urcrypt/urcrypt.c @@ -686,3 +686,36 @@ urcrypt_argon2(urcrypt_argon2_type type, } } } + +int +urcrypt_blake2(size_t message_length, + const uint8_t *message, + size_t key_length, + const uint8_t key[64], + size_t out_length, + uint8_t *out) +{ + int ret; + uint8_t rkey[64]; + uint8_t *rmessage; + + if ( key_length > 64 ) { + return -1; + } + + rmessage = _urcrypt_reverse_alloc(message_length, message); + _urcrypt_reverse_copy(key_length, key, rkey); + ret = blake2b(out, out_length, + rmessage, message_length, + rkey, key_length); + + urcrypt_free(rmessage); + + if ( 0 != ret ) { + return -1; + } + else { + _urcrypt_reverse_inplace(out_length, out); + return 0; + } +} diff --git a/pkg/urcrypt/urcrypt.h b/pkg/urcrypt/urcrypt.h index da0b2beb3..faa474cbf 100644 --- a/pkg/urcrypt/urcrypt.h +++ b/pkg/urcrypt/urcrypt.h @@ -13,6 +13,7 @@ #include #include +#include typedef void *(*urcrypt_malloc_t)(size_t); typedef void *(*urcrypt_realloc_t)(void*, size_t); @@ -129,4 +130,11 @@ const char* urcrypt_argon2(urcrypt_argon2_type type, size_t out_length, uint8_t *out); +int urcrypt_blake2(size_t message_length, + const uint8_t *message, + size_t key_length, + const uint8_t key[64], + size_t out_length, + uint8_t *out); + #endif From ca14af11a7334dc40d25804b78832b55d8285524 Mon Sep 17 00:00:00 2001 From: Paul Driver Date: Tue, 18 Aug 2020 10:31:50 -0700 Subject: [PATCH 025/329] cleaning up a bit, rethinking things --- pkg/urbit/jets/e/aes_siv.c | 2 -- pkg/urcrypt/urcrypt.c | 47 ++++++++++++++++++-------------------- pkg/urcrypt/urcrypt.h | 31 +++++++++++++++++++++++-- 3 files changed, 51 insertions(+), 29 deletions(-) diff --git a/pkg/urbit/jets/e/aes_siv.c b/pkg/urbit/jets/e/aes_siv.c index b31ab84cf..80ad62ab6 100644 --- a/pkg/urbit/jets/e/aes_siv.c +++ b/pkg/urbit/jets/e/aes_siv.c @@ -3,8 +3,6 @@ */ #include "all.h" -#include - #include "aes_siv.h" /* functions diff --git a/pkg/urcrypt/urcrypt.c b/pkg/urcrypt/urcrypt.c index f878f6a9c..d15ad2ae2 100644 --- a/pkg/urcrypt/urcrypt.c +++ b/pkg/urcrypt/urcrypt.c @@ -5,12 +5,12 @@ static urcrypt_malloc_t urcrypt_malloc_ptr; static urcrypt_realloc_t urcrypt_realloc_ptr; static urcrypt_free_t urcrypt_free_ptr; -void* urcrypt_malloc(size_t len) +static void* _urcrypt_malloc(size_t len) { return (*urcrypt_malloc_ptr)(len); } -void* urcrypt_realloc(void *ptr, size_t len) +static void* _urcrypt_realloc(void *ptr, size_t len) { return (*urcrypt_realloc_ptr)(ptr, len); } @@ -21,48 +21,47 @@ void urcrypt_free(void *ptr) } static void* -urcrypt_malloc_ssl(size_t len +_urcrypt_malloc_ssl(size_t len #if OPENSSL_VERSION_NUMBER >= 0x10100000L , const char* file, int line #endif -) { return urcrypt_malloc(len); } +) { return _urcrypt_malloc(len); } static void* -urcrypt_realloc_ssl(void* ptr, size_t len +_urcrypt_realloc_ssl(void* ptr, size_t len #if OPENSSL_VERSION_NUMBER >= 0x10100000L , const char* file, int line #endif -) { return urcrypt_realloc(ptr, len); } +) { return _urcrypt_realloc(ptr, len); } static void -urcrypt_free_ssl(void* ptr +_urcrypt_free_ssl(void* ptr #if OPENSSL_VERSION_NUMBER >= 0x10100000L , const char* file, int line #endif ) { urcrypt_free(ptr); } -/* IMPORTANT: it is an error (undefined behavior) to call functions in - * this library without first calling urcrypt_init() exactly once. - */ int -urcrypt_init(urcrypt_malloc_t m, urcrypt_realloc_t r, urcrypt_free_t f) +urcrypt_init(_urcrypt_malloc_t m, _urcrypt_realloc_t r, urcrypt_free_t f) { if ( initialized ) { return -1; } + else if ( (NULL == m) || (NULL == r) || (NULL == f) ) { + return -2; + } else { initialized = true; - urcrypt_malloc_ptr = ( NULL == m ) ? &malloc : m; - urcrypt_realloc_ptr = ( NULL == r ) ? &realloc : r; - urcrypt_free_ptr = ( NULL == f ) ? &free : f; - - if ( CRYPTO_set_mem_functions(&urcrypt_malloc_ssl, - &urcrypt_realloc_ssl, - &urcrypt_free_ssl) ) { + urcrypt_malloc_ptr = m; + urcrypt_realloc_ptr = r; + urcrypt_free_ptr = f; + if ( CRYPTO_set_mem_functions(&_urcrypt_malloc_ssl, + &_urcrypt_realloc_ssl, + &_urcrypt_free_ssl) ) { return 0; } else { - return -2; + return -3; } } } @@ -252,7 +251,7 @@ _urcrypt_reverse_copy(size_t size, const uint8_t *in, uint8_t *out) { static uint8_t* _urcrypt_reverse_alloc(size_t size, const uint8_t *in) { - uint8_t *out = urcrypt_malloc(size); + uint8_t *out = _urcrypt_malloc(size); _urcrypt_reverse_copy(size, in, out); return out; } @@ -401,7 +400,7 @@ _urcrypt_cbc_pad(size_t *length_ptr, const uint8_t *message) rem = length % 16, padding = rem ? 16 - rem : 0, padded = length + padding; - uint8_t *buf = urcrypt_malloc(padded); + uint8_t *buf = _urcrypt_malloc(padded); memset(buf, 0, padding); _urcrypt_reverse_copy(length, message, buf + padding); @@ -422,7 +421,7 @@ _urcrypt_cbc_help(const uint8_t *message, _urcrypt_reverse_copy(16, ivec, riv); in = _urcrypt_cbc_pad(&length, message); - out = urcrypt_malloc(length); + out = _urcrypt_malloc(length); AES_cbc_encrypt(in, out, length, key, riv, enc); urcrypt_free(in); @@ -584,7 +583,7 @@ urcrypt_aes_cbcc_de(const uint8_t *message, static int _urcrypt_argon2_alloc(uint8_t** output, size_t bytes) { - *output = urcrypt_malloc(bytes); + *output = _urcrypt_malloc(bytes); return (NULL != output); } @@ -598,8 +597,6 @@ _urcrypt_argon2_free(uint8_t* memory, size_t bytes) // in uint32_t, so here's a helper macro for ensuring equivalence. #define SZ_32(s) ( sizeof(size_t) <= sizeof(uint32_t) || s <= 0xFFFFFFFF ) -// returns a constant error message string or NULL for success -// (so user doesn't have to call argon2_error_message) const char* urcrypt_argon2(urcrypt_argon2_type type, uint32_t version, diff --git a/pkg/urcrypt/urcrypt.h b/pkg/urcrypt/urcrypt.h index faa474cbf..a57278f79 100644 --- a/pkg/urcrypt/urcrypt.h +++ b/pkg/urcrypt/urcrypt.h @@ -1,6 +1,8 @@ #ifndef URCRYPT_H #define URCRYPT_H +// XX most of these should be moved to urcrypt.c + #include #include #include @@ -19,10 +21,26 @@ typedef void *(*urcrypt_malloc_t)(size_t); typedef void *(*urcrypt_realloc_t)(void*, size_t); typedef void (*urcrypt_free_t)(void*); +/* We depend on OpenSSL for various reasons, which doesn't promise not to + * allocate memory and has the annoying CRYPTO_set_mem_functions api. We + * are therefore forced to use it, so we adopt a similar approach with + * urcrypt_init(). + * + * This creates an issue for certain link configurations when the client of + * urcrypt also uses the CRYPTO_set_mem_functions() api. The simplest thing + * that is guaranteed to work is to call first CRYPTO_set_mem_functions() and + * then urcrypt_init() with the same arguments during process initialization. + * + * You should call this function once. It will return 0 on success. Calling + * any other library functions without exactly one successful call to + * urcrypt_init() will result in undefined behavior. + */ int urcrypt_init(urcrypt_malloc_t, urcrypt_realloc_t, urcrypt_free_t); -void *urcrypt_malloc(size_t); -void *urcrypt_realloc(void*, size_t); +/* We can transparently deal with padding since we already use memory + * allocation; in cases where we return allocated memory, it should + * be freed with urcrypt_free() by the caller. + */ void urcrypt_free(void*); int urcrypt_ed_point_add(const uint8_t a[32], @@ -57,6 +75,10 @@ bool urcrypt_ed_veri(const uint8_t *message, const uint8_t signature[64], const uint8_t public[32]); +// XX let's de-const the reversed arrays and promise to trash them instead, +// it will save us a malloc in some cases and it's a better API since +// it puts the decision to copy in the caller's hands. + int urcrypt_aes_ecba_en(const uint8_t key[16], const uint8_t block[16], uint8_t out[16]); @@ -76,6 +98,10 @@ int urcrypt_aes_ecbc_de(const uint8_t key[32], const uint8_t block[16], uint8_t out[16]); +/* return an alloc'd output pointer and write its length to out_length + * caller should urcrypt_free() the returned pointer. The return value + * is NULL on an error. */ + uint8_t* urcrypt_aes_cbca_en(const uint8_t *message, size_t length, const uint8_t key[16], @@ -114,6 +140,7 @@ typedef enum urcrypt_argon2_type { urcrypt_argon2_u = 10, } urcrypt_argon2_type; +/* returns a constant error message string or NULL for success */ const char* urcrypt_argon2(urcrypt_argon2_type type, uint32_t version, uint32_t threads, From 2fdffe1e8261405ac7b21f1114e8ce5ec2382849 Mon Sep 17 00:00:00 2001 From: Paul Driver Date: Tue, 18 Aug 2020 12:35:07 -0700 Subject: [PATCH 026/329] overwrite inputs instead of copying in urcrypt --- pkg/urcrypt/urcrypt.c | 495 ++++++++++++++++++------------------------ pkg/urcrypt/urcrypt.h | 137 +++++------- 2 files changed, 272 insertions(+), 360 deletions(-) diff --git a/pkg/urcrypt/urcrypt.c b/pkg/urcrypt/urcrypt.c index d15ad2ae2..be47a99ad 100644 --- a/pkg/urcrypt/urcrypt.c +++ b/pkg/urcrypt/urcrypt.c @@ -1,69 +1,45 @@ #include "urcrypt.h" -static bool initialized = false; -static urcrypt_malloc_t urcrypt_malloc_ptr; -static urcrypt_realloc_t urcrypt_realloc_ptr; -static urcrypt_free_t urcrypt_free_ptr; - -static void* _urcrypt_malloc(size_t len) -{ - return (*urcrypt_malloc_ptr)(len); -} - -static void* _urcrypt_realloc(void *ptr, size_t len) -{ - return (*urcrypt_realloc_ptr)(ptr, len); -} - -void urcrypt_free(void *ptr) -{ - (*urcrypt_free_ptr)(ptr); -} +static urcrypt_malloc_t _urcrypt_ssl_malloc_ptr; +static urcrypt_realloc_t _urcrypt_ssl_realloc_ptr; +static urcrypt_free_t _urcrypt_ssl_free_ptr; static void* _urcrypt_malloc_ssl(size_t len #if OPENSSL_VERSION_NUMBER >= 0x10100000L , const char* file, int line #endif -) { return _urcrypt_malloc(len); } +) { return (*_urcrypt_ssl_malloc_ptr)(len); } static void* _urcrypt_realloc_ssl(void* ptr, size_t len #if OPENSSL_VERSION_NUMBER >= 0x10100000L , const char* file, int line #endif -) { return _urcrypt_realloc(ptr, len); } +) { return (*_urcrypt_ssl_realloc_ptr)(ptr, len); } static void _urcrypt_free_ssl(void* ptr #if OPENSSL_VERSION_NUMBER >= 0x10100000L , const char* file, int line #endif -) { urcrypt_free(ptr); } +) { (*_urcrypt_ssl_free_ptr)(ptr); } int -urcrypt_init(_urcrypt_malloc_t m, _urcrypt_realloc_t r, urcrypt_free_t f) +urcrypt_set_openssl_functions(urcrypt_malloc_t malloc_ptr, + urcrypt_realloc_t realloc_ptr, + urcrypt_free_t free_ptr) { - if ( initialized ) { - return -1; - } - else if ( (NULL == m) || (NULL == r) || (NULL == f) ) { - return -2; - } - else { - initialized = true; - urcrypt_malloc_ptr = m; - urcrypt_realloc_ptr = r; - urcrypt_free_ptr = f; - if ( CRYPTO_set_mem_functions(&_urcrypt_malloc_ssl, - &_urcrypt_realloc_ssl, - &_urcrypt_free_ssl) ) { - return 0; - } - else { - return -3; - } + int ret = CRYPTO_set_mem_functions(&_urcrypt_malloc_ssl, + &_urcrypt_realloc_ssl, + &_urcrypt_free_ssl); + if ( 0 == ret ) { + _urcrypt_ssl_malloc_ptr = malloc_ptr; + _urcrypt_ssl_realloc_ptr = realloc_ptr; + _urcrypt_ssl_free_ptr = free_ptr; } + + return ret; } int @@ -241,23 +217,7 @@ urcrypt_ed_veri(const uint8_t *message, } static void -_urcrypt_reverse_copy(size_t size, const uint8_t *in, uint8_t *out) { - size_t i, j; - for ( i = 0, j = size - 1; i < size; i++, j-- ) { - out[i] = in[j]; - } -} - -static uint8_t* -_urcrypt_reverse_alloc(size_t size, const uint8_t *in) -{ - uint8_t *out = _urcrypt_malloc(size); - _urcrypt_reverse_copy(size, in, out); - return out; -} - -static void -_urcrypt_reverse_inplace(size_t size, uint8_t *ptr) { +_urcrypt_reverse(size_t size, uint8_t *ptr) { size_t i, j; uint8_t tmp; for ( i = 0, j = size - 1; i < j; i++, j-- ) { @@ -268,329 +228,306 @@ _urcrypt_reverse_inplace(size_t size, uint8_t *ptr) { } int -urcrypt_aes_ecba_en(const uint8_t key[16], - const uint8_t block[16], - uint8_t out[16]) +urcrypt_aes_ecba_en(uint8_t key[16], uint8_t block[16], uint8_t out[16]) { AES_KEY aes_key; - uint8_t rkey[16], rblock[16]; - _urcrypt_reverse_copy(16, key, rkey); - _urcrypt_reverse_copy(16, block, rblock); + _urcrypt_reverse(16, key); + _urcrypt_reverse(16, block); - if ( 0 != AES_set_encrypt_key(rkey, 128, &aes_key) ) { + if ( 0 != AES_set_encrypt_key(key, 128, &aes_key) ) { return -1; } else { - AES_ecb_encrypt(rblock, out, &aes_key, AES_ENCRYPT); - _urcrypt_reverse_inplace(16, out); + AES_ecb_encrypt(block, out, &aes_key, AES_ENCRYPT); + _urcrypt_reverse(16, out); return 0; } } int -urcrypt_aes_ecba_de(const uint8_t key[16], - const uint8_t block[16], - uint8_t out[16]) +urcrypt_aes_ecba_de(uint8_t key[16], uint8_t block[16], uint8_t out[16]) { AES_KEY aes_key; - uint8_t rkey[16], rblock[16]; - _urcrypt_reverse_copy(16, key, rkey); - _urcrypt_reverse_copy(16, block, rblock); + _urcrypt_reverse(16, key); + _urcrypt_reverse(16, block); - if ( 0 != AES_set_decrypt_key(rkey, 128, &aes_key) ) { + if ( 0 != AES_set_decrypt_key(key, 128, &aes_key) ) { return -1; } else { - AES_ecb_encrypt(rblock, out, &aes_key, AES_DECRYPT); - _urcrypt_reverse_inplace(16, out); + AES_ecb_encrypt(block, out, &aes_key, AES_DECRYPT); + _urcrypt_reverse(16, out); return 0; } } int -urcrypt_aes_ecbb_en(const uint8_t key[24], - const uint8_t block[16], - uint8_t out[16]) +urcrypt_aes_ecbb_en(uint8_t key[24], uint8_t block[16], uint8_t out[16]) { AES_KEY aes_key; - uint8_t rkey[24], rblock[16]; - _urcrypt_reverse_copy(24, key, rkey); - _urcrypt_reverse_copy(16, block, rblock); + _urcrypt_reverse(24, key); + _urcrypt_reverse(16, block); - if ( 0 != AES_set_encrypt_key(rkey, 192, &aes_key) ) { + if ( 0 != AES_set_encrypt_key(key, 192, &aes_key) ) { return -1; } else { - AES_ecb_encrypt(rblock, out, &aes_key, AES_ENCRYPT); - _urcrypt_reverse_inplace(16, out); + AES_ecb_encrypt(block, out, &aes_key, AES_ENCRYPT); + _urcrypt_reverse(16, out); return 0; } } int -urcrypt_aes_ecbb_de(const uint8_t key[24], - const uint8_t block[16], - uint8_t out[16]) +urcrypt_aes_ecbb_de(uint8_t key[24], uint8_t block[16], uint8_t out[16]) { AES_KEY aes_key; - uint8_t rkey[24], rblock[16]; - _urcrypt_reverse_copy(24, key, rkey); - _urcrypt_reverse_copy(16, block, rblock); + _urcrypt_reverse(24, key); + _urcrypt_reverse(16, block); - if ( 0 != AES_set_decrypt_key(rkey, 192, &aes_key) ) { + if ( 0 != AES_set_decrypt_key(key, 192, &aes_key) ) { return -1; } else { - AES_ecb_encrypt(rblock, out, &aes_key, AES_DECRYPT); - _urcrypt_reverse_inplace(16, out); + AES_ecb_encrypt(block, out, &aes_key, AES_DECRYPT); + _urcrypt_reverse(16, out); return 0; } } int -urcrypt_aes_ecbc_en(const uint8_t key[32], - const uint8_t block[16], - uint8_t out[16]) +urcrypt_aes_ecbc_en(uint8_t key[32], uint8_t block[16], uint8_t out[16]) { AES_KEY aes_key; - uint8_t rkey[32], rblock[16]; - _urcrypt_reverse_copy(32, key, rkey); - _urcrypt_reverse_copy(16, block, rblock); + _urcrypt_reverse(32, key); + _urcrypt_reverse(16, block); - if ( 0 != AES_set_encrypt_key(rkey, 256, &aes_key) ) { + if ( 0 != AES_set_encrypt_key(key, 256, &aes_key) ) { return -1; } else { - AES_ecb_encrypt(rblock, out, &aes_key, AES_ENCRYPT); - _urcrypt_reverse_inplace(16, out); + AES_ecb_encrypt(block, out, &aes_key, AES_ENCRYPT); + _urcrypt_reverse(16, out); return 0; } } int -urcrypt_aes_ecbc_de(const uint8_t key[32], - const uint8_t block[16], - uint8_t out[16]) +urcrypt_aes_ecbc_de(uint8_t key[32], uint8_t block[16], uint8_t out[16]) { AES_KEY aes_key; - uint8_t rkey[32], rblock[16]; - _urcrypt_reverse_copy(32, key, rkey); - _urcrypt_reverse_copy(16, block, rblock); + _urcrypt_reverse(32, key); + _urcrypt_reverse(16, block); - if ( 0 != AES_set_decrypt_key(rkey, 256, &aes_key) ) { + if ( 0 != AES_set_decrypt_key(key, 256, &aes_key) ) { return -1; } else { - AES_ecb_encrypt(rblock, out, &aes_key, AES_DECRYPT); - _urcrypt_reverse_inplace(16, out); + AES_ecb_encrypt(block, out, &aes_key, AES_DECRYPT); + _urcrypt_reverse(16, out); return 0; } } -static uint8_t* -_urcrypt_cbc_pad(size_t *length_ptr, const uint8_t *message) +int +_urcrypt_cbc_pad(uint8_t **message_ptr, + size_t *length_ptr, + urcrypt_realloc_t realloc_ptr) { size_t length = *length_ptr, - rem = length % 16, - padding = rem ? 16 - rem : 0, - padded = length + padding; - uint8_t *buf = _urcrypt_malloc(padded); + rem = length % 16; - memset(buf, 0, padding); - _urcrypt_reverse_copy(length, message, buf + padding); + if ( 0 == rem ) { + // no padding necessary + return 0; + } + else { + size_t padding = 16 - rem, + padded = length + padding; - *length_ptr = padded; - return buf; + if ( padded < length ) { + return -1; + } + else { + uint8_t *out = (*realloc_ptr)(*message_ptr, padded); + if ( NULL == out ) { + return -2; + } + else { + *message_ptr = out; + *length_ptr = padded; + memset(out + length, 0, padding); + _urcrypt_reverse(padded, out); + return 0; + } + } + } } -uint8_t* -_urcrypt_cbc_help(const uint8_t *message, - size_t length, +int +_urcrypt_cbc_help(uint8_t **message_ptr, + size_t *length_ptr, const AES_KEY *key, - const uint8_t ivec[16], + uint8_t ivec[16], const int enc, - size_t *out_length) + urcrypt_realloc_t realloc_ptr) { - uint8_t riv[16], *in, *out; - - _urcrypt_reverse_copy(16, ivec, riv); - in = _urcrypt_cbc_pad(&length, message); - out = _urcrypt_malloc(length); - AES_cbc_encrypt(in, out, length, key, riv, enc); - urcrypt_free(in); - - _urcrypt_reverse_inplace(length, out); - *out_length = length; - return out; -} - -uint8_t* -urcrypt_aes_cbca_en(const uint8_t *message, - size_t length, - const uint8_t key[16], - const uint8_t ivec[16], - size_t *out_length) -{ - AES_KEY aes_key; - uint8_t rkey[16]; - - _urcrypt_reverse_copy(16, key, rkey); - - if ( 0 != AES_set_encrypt_key(rkey, 128, &aes_key) ) { - return NULL; + if ( 0 != _urcrypt_cbc_pad(message_ptr, length_ptr, realloc_ptr) ) { + return -1; } else { - return _urcrypt_cbc_help(message, - length, - &aes_key, - ivec, - AES_ENCRYPT, - out_length); + uint8_t *out = *message_ptr; + size_t length = *length_ptr; + _urcrypt_reverse(16, ivec); + AES_cbc_encrypt(out, out, length, key, ivec, enc); + _urcrypt_reverse(length, out); + return 0; } } -uint8_t* -urcrypt_aes_cbca_de(const uint8_t *message, - size_t length, - const uint8_t key[16], - const uint8_t ivec[16], - size_t *out_length) +int +urcrypt_aes_cbca_en(uint8_t **message_ptr, + size_t *length_ptr, + uint8_t key[16], + uint8_t ivec[16], + urcrypt_realloc_t realloc_ptr) { AES_KEY aes_key; - uint8_t rkey[16]; - _urcrypt_reverse_copy(16, key, rkey); + _urcrypt_reverse(16, key); - if ( 0 != AES_set_decrypt_key(rkey, 128, &aes_key) ) { - return NULL; + if ( 0 != AES_set_encrypt_key(key, 128, &aes_key) ) { + return -1; } else { - return _urcrypt_cbc_help(message, - length, - &aes_key, - ivec, - AES_DECRYPT, - out_length); + return _urcrypt_cbc_help(message_ptr, length_ptr, + &aes_key, ivec, AES_ENCRYPT, realloc_ptr); } } -uint8_t* -urcrypt_aes_cbcb_en(const uint8_t *message, - size_t length, - const uint8_t key[24], - const uint8_t ivec[16], - size_t *out_length) +int +urcrypt_aes_cbca_de(uint8_t **message_ptr, + size_t *length_ptr, + uint8_t key[16], + uint8_t ivec[16], + urcrypt_realloc_t realloc_ptr) { AES_KEY aes_key; - uint8_t rkey[24]; - _urcrypt_reverse_copy(24, key, rkey); + _urcrypt_reverse(16, key); - if ( 0 != AES_set_encrypt_key(rkey, 192, &aes_key) ) { - return NULL; + if ( 0 != AES_set_decrypt_key(key, 128, &aes_key) ) { + return -1; } else { - return _urcrypt_cbc_help(message, - length, - &aes_key, - ivec, - AES_ENCRYPT, - out_length); + return _urcrypt_cbc_help(message_ptr, length_ptr, + &aes_key, ivec, AES_DECRYPT, realloc_ptr); } } -uint8_t* -urcrypt_aes_cbcb_de(const uint8_t *message, - size_t length, - const uint8_t key[24], - const uint8_t ivec[16], - size_t *out_length) +int +urcrypt_aes_cbcb_en(uint8_t **message_ptr, + size_t *length_ptr, + uint8_t key[24], + uint8_t ivec[16], + urcrypt_realloc_t realloc_ptr) { AES_KEY aes_key; - uint8_t rkey[24]; - _urcrypt_reverse_copy(24, key, rkey); + _urcrypt_reverse(24, key); - if ( 0 != AES_set_decrypt_key(rkey, 192, &aes_key) ) { - return NULL; + if ( 0 != AES_set_encrypt_key(key, 192, &aes_key) ) { + return -1; } else { - return _urcrypt_cbc_help(message, - length, - &aes_key, - ivec, - AES_DECRYPT, - out_length); + return _urcrypt_cbc_help(message_ptr, length_ptr, + &aes_key, ivec, AES_ENCRYPT, realloc_ptr); } } -uint8_t* -urcrypt_aes_cbcc_en(const uint8_t *message, - size_t length, - const uint8_t key[32], - const uint8_t ivec[16], - size_t *out_length) +int +urcrypt_aes_cbcb_de(uint8_t **message_ptr, + size_t *length_ptr, + uint8_t key[24], + uint8_t ivec[16], + urcrypt_realloc_t realloc_ptr) { AES_KEY aes_key; - uint8_t rkey[32]; - _urcrypt_reverse_copy(32, key, rkey); + _urcrypt_reverse(24, key); - if ( 0 != AES_set_encrypt_key(rkey, 256, &aes_key) ) { - return NULL; + if ( 0 != AES_set_decrypt_key(key, 192, &aes_key) ) { + return -1; } else { - return _urcrypt_cbc_help(message, - length, - &aes_key, - ivec, - AES_ENCRYPT, - out_length); + return _urcrypt_cbc_help(message_ptr, length_ptr, + &aes_key, ivec, AES_DECRYPT, realloc_ptr); } } -uint8_t* -urcrypt_aes_cbcc_de(const uint8_t *message, - size_t length, - const uint8_t key[32], - const uint8_t ivec[16], - size_t *out_length) +int +urcrypt_aes_cbcc_en(uint8_t **message_ptr, + size_t *length_ptr, + uint8_t key[32], + uint8_t ivec[16], + urcrypt_realloc_t realloc_ptr) { AES_KEY aes_key; - uint8_t rkey[32]; - _urcrypt_reverse_copy(32, key, rkey); + _urcrypt_reverse(32, key); - if ( 0 != AES_set_decrypt_key(rkey, 256, &aes_key) ) { - return NULL; + if ( 0 != AES_set_encrypt_key(key, 256, &aes_key) ) { + return -1; } else { - return _urcrypt_cbc_help(message, - length, - &aes_key, - ivec, - AES_DECRYPT, - out_length); + return _urcrypt_cbc_help(message_ptr, length_ptr, + &aes_key, ivec, AES_ENCRYPT, realloc_ptr); } } +int +urcrypt_aes_cbcc_de(uint8_t **message_ptr, + size_t *length_ptr, + uint8_t key[32], + uint8_t ivec[16], + urcrypt_realloc_t realloc_ptr) +{ + AES_KEY aes_key; + + _urcrypt_reverse(32, key); + + if ( 0 != AES_set_decrypt_key(key, 256, &aes_key) ) { + return -1; + } + else { + return _urcrypt_cbc_help(message_ptr, length_ptr, + &aes_key, ivec, AES_DECRYPT, realloc_ptr); + } +} + +/* argon2 does memory allocation, but takes function pointers in the context. + * the signatures don't match, so we need these wrappers. + */ +static urcrypt_malloc_t _urcrypt_argon2_malloc_ptr; +static urcrypt_free_t _urcrypt_argon2_free_ptr; + static int _urcrypt_argon2_alloc(uint8_t** output, size_t bytes) { - *output = _urcrypt_malloc(bytes); + *output = (*_urcrypt_argon2_malloc_ptr)(bytes); return (NULL != output); } static void _urcrypt_argon2_free(uint8_t* memory, size_t bytes) { - urcrypt_free(memory); + (*_urcrypt_argon2_free_ptr)(memory); } // library convention is to have sizes in size_t, but argon2 wants them @@ -604,15 +541,17 @@ urcrypt_argon2(urcrypt_argon2_type type, uint32_t memory_cost, uint32_t time_cost, size_t secret_length, - const uint8_t *secret, + uint8_t *secret, size_t associated_length, - const uint8_t *associated, + uint8_t *associated, size_t password_length, - const uint8_t *password, + uint8_t *password, size_t salt_length, - const uint8_t *salt, + uint8_t *salt, size_t out_length, - uint8_t *out) + uint8_t *out, + urcrypt_malloc_t malloc_ptr, + urcrypt_free_t free_ptr) { if ( !( SZ_32(secret_length) && SZ_32(associated_length) && @@ -624,7 +563,6 @@ urcrypt_argon2(urcrypt_argon2_type type, else { int (*f)(argon2_context*); int result; - uint8_t *rsecret, *rassoc, *rpassword, *rsalt; switch ( type ) { default: @@ -643,20 +581,21 @@ urcrypt_argon2(urcrypt_argon2_type type, break; } - rsecret = _urcrypt_reverse_alloc(secret_length, secret); - rassoc = _urcrypt_reverse_alloc(associated_length, associated); - rpassword = _urcrypt_reverse_alloc(password_length, password); - rsalt = _urcrypt_reverse_alloc(salt_length, salt); + _urcrypt_reverse(secret_length, secret); + _urcrypt_reverse(associated_length, associated); + _urcrypt_reverse(password_length, password); + _urcrypt_reverse(salt_length, salt); + argon2_context context = { out, // output array, at least [digest length] in size out_length, // digest length - rpassword, // password array + password, // password array password_length, // password length - rsalt, // salt array + salt, // salt array salt_length, // salt length - rsecret, // optional secret data + secret, // optional secret data secret_length, - rassoc, // optional associated data + associated, // optional associated data associated_length, time_cost, // performance cost configuration memory_cost, @@ -668,17 +607,15 @@ urcrypt_argon2(urcrypt_argon2_type type, ARGON2_DEFAULT_FLAGS // by default only internal memory is cleared }; + _urcrypt_argon2_malloc_ptr = malloc_ptr; + _urcrypt_argon2_free_ptr = free_ptr; result = (*f)(&context); - urcrypt_free(rsecret); - urcrypt_free(rassoc); - urcrypt_free(rpassword); - urcrypt_free(rsalt); if ( ARGON2_OK != result ) { return argon2_error_message(result); } else { - _urcrypt_reverse_inplace(out_length, out); + _urcrypt_reverse(out_length, out); return NULL; } } @@ -686,33 +623,27 @@ urcrypt_argon2(urcrypt_argon2_type type, int urcrypt_blake2(size_t message_length, - const uint8_t *message, + uint8_t *message, size_t key_length, - const uint8_t key[64], + uint8_t key[64], size_t out_length, uint8_t *out) { - int ret; - uint8_t rkey[64]; - uint8_t *rmessage; - if ( key_length > 64 ) { return -1; } - - rmessage = _urcrypt_reverse_alloc(message_length, message); - _urcrypt_reverse_copy(key_length, key, rkey); - ret = blake2b(out, out_length, - rmessage, message_length, - rkey, key_length); - - urcrypt_free(rmessage); - - if ( 0 != ret ) { - return -1; - } else { - _urcrypt_reverse_inplace(out_length, out); - return 0; + _urcrypt_reverse(message_length, message); + _urcrypt_reverse(key_length, key); + + if ( 0 != blake2b(out, out_length, + message, message_length, + key, key_length)) { + return -1; + } + else { + _urcrypt_reverse(out_length, out); + return 0; + } } } diff --git a/pkg/urcrypt/urcrypt.h b/pkg/urcrypt/urcrypt.h index a57278f79..130a9b229 100644 --- a/pkg/urcrypt/urcrypt.h +++ b/pkg/urcrypt/urcrypt.h @@ -23,32 +23,28 @@ typedef void (*urcrypt_free_t)(void*); /* We depend on OpenSSL for various reasons, which doesn't promise not to * allocate memory and has the annoying CRYPTO_set_mem_functions api. We - * are therefore forced to use it, so we adopt a similar approach with - * urcrypt_init(). + * are therefore forced to support it in some fashion. * - * This creates an issue for certain link configurations when the client of - * urcrypt also uses the CRYPTO_set_mem_functions() api. The simplest thing - * that is guaranteed to work is to call first CRYPTO_set_mem_functions() and - * then urcrypt_init() with the same arguments during process initialization. + * If you need to control urcrypt's internal OpenSSL allocation, you can call + * this function. It just wraps the OpenSSL function. * - * You should call this function once. It will return 0 on success. Calling - * any other library functions without exactly one successful call to - * urcrypt_init() will result in undefined behavior. + * urcrypt will not use these functions directly. */ -int urcrypt_init(urcrypt_malloc_t, urcrypt_realloc_t, urcrypt_free_t); +int urcrypt_set_openssl_functions(urcrypt_malloc_t malloc_ptr, + urcrypt_realloc_t realloc_ptr, + urcrypt_free_t free_ptr); -/* We can transparently deal with padding since we already use memory - * allocation; in cases where we return allocated memory, it should - * be freed with urcrypt_free() by the caller. - */ -void urcrypt_free(void*); +// const arguments are not written to, non-const arguments may be +// array sizes[64] are purely documentary +// 0 on success, result in out int urcrypt_ed_point_add(const uint8_t a[32], const uint8_t b[32], uint8_t out[32]); int urcrypt_ed_scalarmult(const uint8_t a[32], const uint8_t b[32], uint8_t out[32]); +// void functions have no failure mode void urcrypt_ed_scalarmult_base(const uint8_t a[32], uint8_t out[32]); int urcrypt_ed_add_scalarmult_scalarmult_base(const uint8_t a[32], @@ -70,68 +66,51 @@ void urcrypt_ed_sign(const uint8_t *message, size_t length, const uint8_t seed[32], uint8_t out[64]); +// return value means the signature was (not) verified bool urcrypt_ed_veri(const uint8_t *message, size_t length, const uint8_t signature[64], const uint8_t public[32]); -// XX let's de-const the reversed arrays and promise to trash them instead, -// it will save us a malloc in some cases and it's a better API since -// it puts the decision to copy in the caller's hands. +int urcrypt_aes_ecba_en(uint8_t key[16], uint8_t block[16], uint8_t out[16]); +int urcrypt_aes_ecba_de(uint8_t key[16], uint8_t block[16], uint8_t out[16]); +int urcrypt_aes_ecbb_en(uint8_t key[24], uint8_t block[16], uint8_t out[16]); +int urcrypt_aes_ecbb_de(uint8_t key[24], uint8_t block[16], uint8_t out[16]); +int urcrypt_aes_ecbc_en(uint8_t key[32], uint8_t block[16], uint8_t out[16]); +int urcrypt_aes_ecbc_de(uint8_t key[32], uint8_t block[16], uint8_t out[16]); -int urcrypt_aes_ecba_en(const uint8_t key[16], - const uint8_t block[16], - uint8_t out[16]); -int urcrypt_aes_ecba_de(const uint8_t key[16], - const uint8_t block[16], - uint8_t out[16]); -int urcrypt_aes_ecbb_en(const uint8_t key[24], - const uint8_t block[16], - uint8_t out[16]); -int urcrypt_aes_ecbb_de(const uint8_t key[24], - const uint8_t block[16], - uint8_t out[16]); -int urcrypt_aes_ecbc_en(const uint8_t key[32], - const uint8_t block[16], - uint8_t out[16]); -int urcrypt_aes_ecbc_de(const uint8_t key[32], - const uint8_t block[16], - uint8_t out[16]); - -/* return an alloc'd output pointer and write its length to out_length - * caller should urcrypt_free() the returned pointer. The return value - * is NULL on an error. */ - -uint8_t* urcrypt_aes_cbca_en(const uint8_t *message, - size_t length, - const uint8_t key[16], - const uint8_t ivec[16], - size_t *out_length); -uint8_t* urcrypt_aes_cbca_de(const uint8_t *message, - size_t length, - const uint8_t key[16], - const uint8_t ivec[16], - size_t *out_length); -uint8_t* urcrypt_aes_cbcb_en(const uint8_t *message, - size_t length, - const uint8_t key[24], - const uint8_t ivec[16], - size_t *out_length); -uint8_t* urcrypt_aes_cbcb_de(const uint8_t *message, - size_t length, - const uint8_t key[24], - const uint8_t ivec[16], - size_t *out_length); -uint8_t* urcrypt_aes_cbcc_en(const uint8_t *message, - size_t length, - const uint8_t key[32], - const uint8_t ivec[16], - size_t *out_length); -uint8_t* urcrypt_aes_cbcc_de(const uint8_t *message, - size_t length, - const uint8_t key[32], - const uint8_t ivec[16], - size_t *out_length); +// message and length are read/write so +// realloc_ptr can be used as realloc to pad message +int urcrypt_aes_cbca_en(uint8_t **message_ptr, + size_t *length_ptr, + uint8_t key[16], + uint8_t ivec[16], + urcrypt_realloc_t realloc_ptr); +int urcrypt_aes_cbca_de(uint8_t **message_ptr, + size_t *length_ptr, + uint8_t key[16], + uint8_t ivec[16], + urcrypt_realloc_t realloc_ptr); +int urcrypt_aes_cbcb_en(uint8_t **message_ptr, + size_t *length_ptr, + uint8_t key[24], + uint8_t ivec[16], + urcrypt_realloc_t realloc_ptr); +int urcrypt_aes_cbcb_de(uint8_t **message_ptr, + size_t *length_ptr, + uint8_t key[24], + uint8_t ivec[16], + urcrypt_realloc_t realloc_ptr); +int urcrypt_aes_cbcc_en(uint8_t **message_ptr, + size_t *length_ptr, + uint8_t key[32], + uint8_t ivec[16], + urcrypt_realloc_t realloc_ptr); +int urcrypt_aes_cbcc_de(uint8_t **message_ptr, + size_t *length_ptr, + uint8_t key[32], + uint8_t ivec[16], + urcrypt_realloc_t realloc_ptr); typedef enum urcrypt_argon2_type { urcrypt_argon2_d = 0, @@ -147,20 +126,22 @@ const char* urcrypt_argon2(urcrypt_argon2_type type, uint32_t memory_cost, uint32_t time_cost, size_t secret_length, - const uint8_t *secret, + uint8_t *secret, size_t associated_length, - const uint8_t *associated, + uint8_t *associated, size_t password_length, - const uint8_t *password, + uint8_t *password, size_t salt_length, - const uint8_t *salt, + uint8_t *salt, size_t out_length, - uint8_t *out); + uint8_t *out, + urcrypt_malloc_t malloc_ptr, + urcrypt_free_t free_ptr); int urcrypt_blake2(size_t message_length, - const uint8_t *message, + uint8_t *message, size_t key_length, - const uint8_t key[64], + uint8_t key[64], size_t out_length, uint8_t *out); From bdfa1a4852651d835b28416388af6a09d6f6e418 Mon Sep 17 00:00:00 2001 From: Paul Driver Date: Tue, 18 Aug 2020 12:44:10 -0700 Subject: [PATCH 027/329] cleaning up _cbc_pad a bit --- pkg/urcrypt/urcrypt.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/pkg/urcrypt/urcrypt.c b/pkg/urcrypt/urcrypt.c index be47a99ad..7215dcb59 100644 --- a/pkg/urcrypt/urcrypt.c +++ b/pkg/urcrypt/urcrypt.c @@ -340,18 +340,19 @@ _urcrypt_cbc_pad(uint8_t **message_ptr, size_t *length_ptr, urcrypt_realloc_t realloc_ptr) { - size_t length = *length_ptr, - rem = length % 16; + size_t length = *length_ptr, + remain = length % 16; - if ( 0 == rem ) { - // no padding necessary + if ( 0 == remain ) { + // no padding needed return 0; } else { - size_t padding = 16 - rem, + size_t padding = 16 - remain, padded = length + padding; if ( padded < length ) { + // size_t overflow return -1; } else { @@ -360,10 +361,9 @@ _urcrypt_cbc_pad(uint8_t **message_ptr, return -2; } else { - *message_ptr = out; - *length_ptr = padded; memset(out + length, 0, padding); - _urcrypt_reverse(padded, out); + *message_ptr = out; + *length_ptr = padded; return 0; } } @@ -385,6 +385,7 @@ _urcrypt_cbc_help(uint8_t **message_ptr, uint8_t *out = *message_ptr; size_t length = *length_ptr; _urcrypt_reverse(16, ivec); + _urcrypt_reverse(length, out); AES_cbc_encrypt(out, out, length, key, ivec, enc); _urcrypt_reverse(length, out); return 0; From e846b297542da60463014f9a5001b858c7c7999f Mon Sep 17 00:00:00 2001 From: Paul Driver Date: Tue, 18 Aug 2020 15:42:22 -0700 Subject: [PATCH 028/329] integrate jets with urcrypt changes --- pkg/urbit/jets/e/aes_cbc.c | 34 ++++++++++++++++------------------ pkg/urbit/jets/e/aes_ecb.c | 16 ++++++++-------- pkg/urbit/jets/e/argon2.c | 4 +++- pkg/urbit/noun/manage.c | 20 +++++++++++++++++++- pkg/urcrypt/urcrypt.c | 36 ++++++++++++++++++++---------------- pkg/urcrypt/urcrypt.h | 8 ++++---- 6 files changed, 70 insertions(+), 48 deletions(-) diff --git a/pkg/urbit/jets/e/aes_cbc.c b/pkg/urbit/jets/e/aes_cbc.c index 06d9df381..793304ad4 100644 --- a/pkg/urbit/jets/e/aes_cbc.c +++ b/pkg/urbit/jets/e/aes_cbc.c @@ -8,35 +8,33 @@ * the ECB functions, which truncate them, hence the raw u3r_bytes unpacking. */ -typedef c3_y* (*urcrypt_cbc)(const c3_y*, - size_t, - const c3_y*, - const c3_y*, - size_t*); +typedef int (*urcrypt_cbc)(c3_y**, + size_t*, + c3_y*, + c3_y*, + urcrypt_realloc_t); /* functions */ static u3_atom _cqea_cbc_help(c3_y* key_y, u3_atom iv, u3_atom msg, urcrypt_cbc low_f) { - size_t len; - c3_w met_w; - c3_y iv_y[16], *msg_y, *out_y; + u3_atom ret; + c3_w met_w; + c3_y iv_y[16]; + c3_y* msg_y = u3r_bytes_all(&met_w, msg); + size_t len = met_w; u3r_bytes(0, 16, iv_y, iv); - - msg_y = u3r_bytes_all(&met_w, msg); - out_y = (*low_f)(msg_y, met_w, key_y, iv_y, &len); - u3a_free(msg_y); - - if ( NULL == out_y ) { - return u3_none; + if ( 0 != (*low_f)(&msg_y, &len, key_y, iv_y, &u3a_realloc) ) { + ret = u3_none; } else { - u3_atom ret = u3i_bytes(len, out_y); - urcrypt_free(out_y); - return ret; + ret = u3i_bytes(len, msg_y); } + u3a_free(msg_y); + + return ret; } static u3_atom diff --git a/pkg/urbit/jets/e/aes_ecb.c b/pkg/urbit/jets/e/aes_ecb.c index b95a36a73..9ea9c59ed 100644 --- a/pkg/urbit/jets/e/aes_ecb.c +++ b/pkg/urbit/jets/e/aes_ecb.c @@ -4,7 +4,7 @@ #include "all.h" #include -typedef int (*urcrypt_ecb)(const c3_y*, const c3_y[16], c3_y[16]); +typedef int (*urcrypt_ecb)(c3_y*, c3_y[16], c3_y[16]); /* functions */ @@ -13,7 +13,7 @@ typedef int (*urcrypt_ecb)(const c3_y*, const c3_y[16], c3_y[16]); * jets we unpack with an unconditional u3r_bytes */ static u3_atom - _cqea_ecba_help(c3_y* key_y, u3_atom blk, urcrypt_ecb low_f) + _cqea_ecb_help(c3_y* key_y, u3_atom blk, urcrypt_ecb low_f) { c3_y blk_y[16], out_y[16]; @@ -33,7 +33,7 @@ typedef int (*urcrypt_ecb)(const c3_y*, const c3_y[16], c3_y[16]); { c3_y key_y[16]; u3r_bytes(0, 16, key_y, key); - return _cqea_ecba_help(key_y, blk, &urcrypt_aes_ecba_en); + return _cqea_ecb_help(key_y, blk, &urcrypt_aes_ecba_en); } u3_noun @@ -56,7 +56,7 @@ typedef int (*urcrypt_ecb)(const c3_y*, const c3_y[16], c3_y[16]); { c3_y key_y[16]; u3r_bytes(0, 16, key_y, key); - return _cqea_ecba_help(key_y, blk, &urcrypt_aes_ecba_de); + return _cqea_ecb_help(key_y, blk, &urcrypt_aes_ecba_de); } u3_noun @@ -79,7 +79,7 @@ typedef int (*urcrypt_ecb)(const c3_y*, const c3_y[16], c3_y[16]); { c3_y key_y[24]; u3r_bytes(0, 24, key_y, key); - return _cqea_ecba_help(key_y, blk, &urcrypt_aes_ecbb_en); + return _cqea_ecb_help(key_y, blk, &urcrypt_aes_ecbb_en); } u3_noun @@ -102,7 +102,7 @@ typedef int (*urcrypt_ecb)(const c3_y*, const c3_y[16], c3_y[16]); { c3_y key_y[24]; u3r_bytes(0, 24, key_y, key); - return _cqea_ecba_help(key_y, blk, &urcrypt_aes_ecbb_de); + return _cqea_ecb_help(key_y, blk, &urcrypt_aes_ecbb_de); } u3_noun @@ -125,7 +125,7 @@ typedef int (*urcrypt_ecb)(const c3_y*, const c3_y[16], c3_y[16]); { c3_y key_y[32]; u3r_bytes(0, 32, key_y, key); - return _cqea_ecba_help(key_y, blk, &urcrypt_aes_ecbc_en); + return _cqea_ecb_help(key_y, blk, &urcrypt_aes_ecbc_en); } u3_noun @@ -148,7 +148,7 @@ typedef int (*urcrypt_ecb)(const c3_y*, const c3_y[16], c3_y[16]); { c3_y key_y[32]; u3r_bytes(0, 32, key_y, key); - return _cqea_ecba_help(key_y, blk, &urcrypt_aes_ecbc_de); + return _cqea_ecb_help(key_y, blk, &urcrypt_aes_ecbc_de); } u3_noun diff --git a/pkg/urbit/jets/e/argon2.c b/pkg/urbit/jets/e/argon2.c index 9c145e00f..7b47628d0 100644 --- a/pkg/urbit/jets/e/argon2.c +++ b/pkg/urbit/jets/e/argon2.c @@ -69,7 +69,9 @@ wix_w, ex_y, wid_w, dat_y, wis_w, sat_y, - out_w, out_y); + out_w, out_y, + &u3a_malloc, + &u3a_free); u3a_free(key_y); u3a_free(ex_y); diff --git a/pkg/urbit/noun/manage.c b/pkg/urbit/noun/manage.c index 86601968e..852c2d777 100644 --- a/pkg/urbit/noun/manage.c +++ b/pkg/urbit/noun/manage.c @@ -1656,9 +1656,27 @@ u3m_boot(c3_c* dir_c) */ u3m_init(); + /* Initialize OpenSSL with loom allocation functions. + * IMPORTANT: this should come before the urcrypt_set_openssl [...] + * call, because in usual circumstances that will override the functions + * we set here, but weird linking situations we don't currently encounter + * could mean we need to set both, and it doesn't hurt. + */ + if ( 0 == CRYPTO_set_mem_functions(&u3a_malloc_ssl, + &u3a_realloc_ssl, + &u3a_free_ssl) ) { + u3l_log("%s\r\n", "openssl initialization failed"); + exit(1); + } + /* Initialize cryptography suite with loom allocation functions. */ - urcrypt_init(&u3a_malloc, &u3a_realloc, &u3a_free); + if ( 0 != urcrypt_set_openssl_mem_functions(&u3a_malloc, + &u3a_realloc, + &u3a_free) ) { + u3l_log("%s\r\n", "urcrypt initialization failed"); + exit(1); + } /* Activate the storage system. */ diff --git a/pkg/urcrypt/urcrypt.c b/pkg/urcrypt/urcrypt.c index 7215dcb59..e9810b79e 100644 --- a/pkg/urcrypt/urcrypt.c +++ b/pkg/urcrypt/urcrypt.c @@ -26,20 +26,21 @@ _urcrypt_free_ssl(void* ptr ) { (*_urcrypt_ssl_free_ptr)(ptr); } int -urcrypt_set_openssl_functions(urcrypt_malloc_t malloc_ptr, - urcrypt_realloc_t realloc_ptr, - urcrypt_free_t free_ptr) +urcrypt_set_openssl_mem_functions(urcrypt_malloc_t malloc_ptr, + urcrypt_realloc_t realloc_ptr, + urcrypt_free_t free_ptr) { - int ret = CRYPTO_set_mem_functions(&_urcrypt_malloc_ssl, - &_urcrypt_realloc_ssl, - &_urcrypt_free_ssl); - if ( 0 == ret ) { + if ( CRYPTO_set_mem_functions(&_urcrypt_malloc_ssl, + &_urcrypt_realloc_ssl, + &_urcrypt_free_ssl) ) { _urcrypt_ssl_malloc_ptr = malloc_ptr; _urcrypt_ssl_realloc_ptr = realloc_ptr; _urcrypt_ssl_free_ptr = free_ptr; + return 0; + } + else { + return -1; } - - return ret; } int @@ -218,12 +219,14 @@ urcrypt_ed_veri(const uint8_t *message, static void _urcrypt_reverse(size_t size, uint8_t *ptr) { - size_t i, j; - uint8_t tmp; - for ( i = 0, j = size - 1; i < j; i++, j-- ) { - tmp = ptr[i]; - ptr[i] = ptr[j]; - ptr[j] = tmp; + if ( size > 0 ) { + size_t i, j; + uint8_t tmp; + for ( i = 0, j = size - 1; i < j; i++, j-- ) { + tmp = ptr[i]; + ptr[i] = ptr[j]; + ptr[j] = tmp; + } } } @@ -522,7 +525,7 @@ static int _urcrypt_argon2_alloc(uint8_t** output, size_t bytes) { *output = (*_urcrypt_argon2_malloc_ptr)(bytes); - return (NULL != output); + return (NULL != *output); } static void @@ -565,6 +568,7 @@ urcrypt_argon2(urcrypt_argon2_type type, int (*f)(argon2_context*); int result; + switch ( type ) { default: return "unknown type"; diff --git a/pkg/urcrypt/urcrypt.h b/pkg/urcrypt/urcrypt.h index 130a9b229..a0a26fb7c 100644 --- a/pkg/urcrypt/urcrypt.h +++ b/pkg/urcrypt/urcrypt.h @@ -26,13 +26,13 @@ typedef void (*urcrypt_free_t)(void*); * are therefore forced to support it in some fashion. * * If you need to control urcrypt's internal OpenSSL allocation, you can call - * this function. It just wraps the OpenSSL function. + * this function. It wraps the OpenSSL function, returning 0 on success. * * urcrypt will not use these functions directly. */ -int urcrypt_set_openssl_functions(urcrypt_malloc_t malloc_ptr, - urcrypt_realloc_t realloc_ptr, - urcrypt_free_t free_ptr); +int urcrypt_set_openssl_mem_functions(urcrypt_malloc_t malloc_ptr, + urcrypt_realloc_t realloc_ptr, + urcrypt_free_t free_ptr); // const arguments are not written to, non-const arguments may be // array sizes[64] are purely documentary From e9c400424d351729f3baae5cd89ada6908421632 Mon Sep 17 00:00:00 2001 From: Paul Driver Date: Tue, 18 Aug 2020 15:47:19 -0700 Subject: [PATCH 029/329] move some includes into urcrypt.c --- pkg/urcrypt/urcrypt.c | 10 ++++++++++ pkg/urcrypt/urcrypt.h | 12 ------------ 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/pkg/urcrypt/urcrypt.c b/pkg/urcrypt/urcrypt.c index e9810b79e..4566ff693 100644 --- a/pkg/urcrypt/urcrypt.c +++ b/pkg/urcrypt/urcrypt.c @@ -1,5 +1,15 @@ #include "urcrypt.h" +#include +#include +#include + +#include +#include + +#include +#include + static urcrypt_malloc_t _urcrypt_ssl_malloc_ptr; static urcrypt_realloc_t _urcrypt_ssl_realloc_ptr; static urcrypt_free_t _urcrypt_ssl_free_ptr; diff --git a/pkg/urcrypt/urcrypt.h b/pkg/urcrypt/urcrypt.h index a0a26fb7c..4d326d4a1 100644 --- a/pkg/urcrypt/urcrypt.h +++ b/pkg/urcrypt/urcrypt.h @@ -1,21 +1,9 @@ #ifndef URCRYPT_H #define URCRYPT_H -// XX most of these should be moved to urcrypt.c - #include #include #include -#include - -#include -#include - -#include -#include - -#include -#include typedef void *(*urcrypt_malloc_t)(size_t); typedef void *(*urcrypt_realloc_t)(void*, size_t); From aea45ee03797b5a6514263d52f1f067d37f6e495 Mon Sep 17 00:00:00 2001 From: Paul Driver Date: Thu, 20 Aug 2020 14:43:22 -0700 Subject: [PATCH 030/329] ripemd-160->urcrypt --- pkg/urbit/include/jets/q.h | 10 ------ pkg/urbit/jets/e/argon2.c | 13 ++++--- pkg/urbit/jets/e/ripe.c | 69 +++++++++++--------------------------- pkg/urbit/noun/manage.c | 1 + pkg/urcrypt/urcrypt.c | 17 ++++++++++ pkg/urcrypt/urcrypt.h | 2 ++ 6 files changed, 48 insertions(+), 64 deletions(-) diff --git a/pkg/urbit/include/jets/q.h b/pkg/urbit/include/jets/q.h index 68f946603..de2f95257 100644 --- a/pkg/urbit/include/jets/q.h +++ b/pkg/urbit/include/jets/q.h @@ -138,16 +138,6 @@ u3_atom, u3_atom, u3_atom, u3_atom); - u3_noun u3qe_argon2(u3_atom, u3_atom, u3_atom, - u3_atom, u3_atom, u3_atom, - u3_atom, u3_atom, u3_atom, u3_atom, - u3_atom, u3_atom, u3_atom, u3_atom); - - u3_noun u3qe_blake(u3_atom wid, u3_atom dat, - u3_atom wik, u3_atom dak, u3_atom out); - - u3_noun u3qe_ripe(u3_atom wid, u3_atom dat); - u3_noun u3qe_make(u3_atom has, u3_atom prv); u3_noun u3qe_reco(u3_atom has, u3_atom sig_v, u3_atom sig_r, u3_atom sig_s); u3_noun u3qe_sign(u3_atom has, u3_atom prv); diff --git a/pkg/urbit/jets/e/argon2.c b/pkg/urbit/jets/e/argon2.c index 7b47628d0..b9c9415ac 100644 --- a/pkg/urbit/jets/e/argon2.c +++ b/pkg/urbit/jets/e/argon2.c @@ -43,15 +43,18 @@ c3_w out_w, wik_w, wix_w, wid_w, wis_w, ver_w, ted_w, mem_w, tim_w; if ( !(u3r_word_fit(&out_w, out) && - _cqear_unpack_type(&typ_u, type) && - u3r_word_fit(&ver_w, version) && - u3r_word_fit(&ted_w, threads) && - u3r_word_fit(&mem_w, mem_cost) && - u3r_word_fit(&tim_w, time_cost) && u3r_word_fit(&wik_w, wik) && u3r_word_fit(&wix_w, wix) && u3r_word_fit(&wid_w, wid) && u3r_word_fit(&wis_w, wis)) ) { + // too big to allocate + return u3m_bail(c3__fail); + } + else if ( !(_cqear_unpack_type(&typ_u, type) && + u3r_word_fit(&ver_w, version) && + u3r_word_fit(&ted_w, threads) && + u3r_word_fit(&mem_w, mem_cost) && + u3r_word_fit(&tim_w, time_cost)) ) { u3l_log("%s\r\n", "argon2-punt"); return u3_none; } diff --git a/pkg/urbit/jets/e/ripe.c b/pkg/urbit/jets/e/ripe.c index 908e6aa1c..971a04b2c 100644 --- a/pkg/urbit/jets/e/ripe.c +++ b/pkg/urbit/jets/e/ripe.c @@ -2,62 +2,34 @@ ** */ #include "all.h" -#include +#include /* functions */ - - u3_noun - u3qe_ripe(u3_atom wid, u3_atom dat) + static u3_atom + _cqe_ripe(u3_atom wid, u3_atom dat) { - c3_assert(_(u3a_is_cat(wid))); - dat = u3qc_rev(3, wid, dat); + c3_w len_w; + if ( !u3r_word_fit(&len_w, wid) ) { + return u3m_bail(c3__fail); + } + else { + u3_atom ret; + c3_y out_y[20]; + c3_y *dat_y = u3r_bytes_alloc(0, len_w, dat); - c3_y* dat_y = (c3_y*)u3a_malloc(wid); // msg body - u3r_bytes(0, wid, (void*)dat_y, dat); - - const EVP_MD* rip_u = EVP_ripemd160(); // ripem algorithm - EVP_MD_CTX* con_u = EVP_MD_CTX_create(); - - /* perform signature - */ - - c3_y sib_y[20]; // signature body - c3_w sil_w; // signature length - c3_w ret_w; // return code - - ret_w = EVP_DigestInit_ex(con_u, rip_u, NULL); - if ( 1 != ret_w ) { + if ( 0 == urcrypt_ripemd160(dat_y, len_w, out_y) ) { + ret = u3i_bytes(20, out_y); + } + else { + u3l_log("%s\r\n", "ripemd160-punt"); + ret = u3_none; + } u3a_free(dat_y); - EVP_MD_CTX_destroy(con_u); - u3l_log("\rripe jet: crypto library fail 1\n"); - return u3m_bail(c3__fail); + return ret; } - - ret_w = EVP_DigestUpdate(con_u, (void*)dat_y, wid); - u3a_free(dat_y); - if (1 != ret_w) { - EVP_MD_CTX_destroy(con_u); - u3l_log("\rripe jet: crypto library fail 2\n"); - return u3m_bail(c3__fail); - } - - ret_w = EVP_DigestFinal_ex(con_u, sib_y, &sil_w); - if ( 1 != ret_w ) { - EVP_MD_CTX_destroy(con_u); - u3l_log("\rripe jet: crypto library fail 3\n"); - return u3m_bail(c3__fail); - } - - EVP_MD_CTX_destroy(con_u); - - /* endian conversion; - turn into noun for return - */ - return u3kc_rev(3, sil_w, u3i_bytes(sil_w, sib_y)); } - u3_noun u3we_ripe(u3_noun cor) { @@ -68,10 +40,9 @@ u3ud(wid) || u3ud(dat)) ) { - u3l_log("\rripe jet: argument error\n"); return u3m_bail(c3__exit); } else { - return u3qe_ripe(wid, dat); + return _cqe_ripe(wid, dat); } } diff --git a/pkg/urbit/noun/manage.c b/pkg/urbit/noun/manage.c index 852c2d777..873cc3fee 100644 --- a/pkg/urbit/noun/manage.c +++ b/pkg/urbit/noun/manage.c @@ -7,6 +7,7 @@ #include #include #include +#include #include #include "all.h" diff --git a/pkg/urcrypt/urcrypt.c b/pkg/urcrypt/urcrypt.c index 4566ff693..efdd4ad55 100644 --- a/pkg/urcrypt/urcrypt.c +++ b/pkg/urcrypt/urcrypt.c @@ -6,6 +6,7 @@ #include #include +#include #include #include @@ -525,6 +526,22 @@ urcrypt_aes_cbcc_de(uint8_t **message_ptr, } } +int +urcrypt_ripemd160(uint8_t *message, size_t length, uint8_t out[20]) +{ + unsigned long n = length; + + if ( length != n ) { + return -1; + } + else { + _urcrypt_reverse(length, message); + RIPEMD160(message, n, out); + _urcrypt_reverse(20, out); + return 0; + } +} + /* argon2 does memory allocation, but takes function pointers in the context. * the signatures don't match, so we need these wrappers. */ diff --git a/pkg/urcrypt/urcrypt.h b/pkg/urcrypt/urcrypt.h index 4d326d4a1..397fde87d 100644 --- a/pkg/urcrypt/urcrypt.h +++ b/pkg/urcrypt/urcrypt.h @@ -100,6 +100,8 @@ int urcrypt_aes_cbcc_de(uint8_t **message_ptr, uint8_t ivec[16], urcrypt_realloc_t realloc_ptr); +int urcrypt_ripemd160(uint8_t *message, size_t length, uint8_t out[20]); + typedef enum urcrypt_argon2_type { urcrypt_argon2_d = 0, urcrypt_argon2_i = 1, From 04e8e851453eb193cf92893fafc226e9c042ab63 Mon Sep 17 00:00:00 2001 From: Paul Driver Date: Thu, 20 Aug 2020 15:04:53 -0700 Subject: [PATCH 031/329] sha1->urcrypt --- pkg/urbit/include/jets/q.h | 1 - pkg/urbit/jets/e/sha1.c | 47 ++++++++++++-------------------------- pkg/urcrypt/urcrypt.c | 9 ++++++++ pkg/urcrypt/urcrypt.h | 1 + 4 files changed, 24 insertions(+), 34 deletions(-) diff --git a/pkg/urbit/include/jets/q.h b/pkg/urbit/include/jets/q.h index de2f95257..9be9280b3 100644 --- a/pkg/urbit/include/jets/q.h +++ b/pkg/urbit/include/jets/q.h @@ -132,7 +132,6 @@ u3_noun u3qe_shay(u3_atom, u3_atom); u3_noun u3qe_shas(u3_atom, u3_atom); u3_noun u3qe_shal(u3_atom, u3_atom); - u3_noun u3qe_sha1(u3_atom, u3_atom); u3_noun u3qe_hmac(u3_noun, u3_atom, u3_atom, u3_atom, u3_atom, u3_atom, u3_atom); diff --git a/pkg/urbit/jets/e/sha1.c b/pkg/urbit/jets/e/sha1.c index 049ab0da1..1423e5299 100644 --- a/pkg/urbit/jets/e/sha1.c +++ b/pkg/urbit/jets/e/sha1.c @@ -2,42 +2,24 @@ ** */ #include "all.h" - -#if defined(U3_OS_osx) -#include -#else -#include -#endif +#include /* functions */ - - u3_noun - u3qe_sha1(u3_atom wid, u3_atom dat) + static u3_noun + _cqe_sha1(u3_atom wid, u3_atom dat) { - c3_assert(_(u3a_is_cat(wid))); - dat = u3qc_rev(3, wid, dat); + c3_w len_w; + if ( !u3r_word_fit(&len_w, wid) ) { + return u3m_bail(c3__fail); + } + else { + c3_y out_y[20]; + c3_y *dat_y = u3r_bytes_alloc(0, len_w, dat); - c3_y* fat_y = u3a_malloc(wid + 1); - u3r_bytes(0, wid, fat_y, dat); - { - c3_y dig_y[32]; -#if defined(U3_OS_osx) - CC_SHA1_CTX ctx_h; - - CC_SHA1_Init(&ctx_h); - CC_SHA1_Update(&ctx_h, fat_y, wid); - CC_SHA1_Final(dig_y, &ctx_h); -#else - SHA_CTX ctx_h; - - SHA1_Init(&ctx_h); - SHA1_Update(&ctx_h, fat_y, wid); - SHA1_Final(dig_y, &ctx_h); -#endif - u3a_free(fat_y); - u3z(dat); - return u3kc_rev(3, 20, u3i_bytes(20, dig_y)); + urcrypt_sha1(dat_y, len_w, out_y); + u3a_free(dat_y); + return u3i_bytes(20, out_y); } } @@ -48,12 +30,11 @@ if ( (c3n == u3r_mean(cor, u3x_sam_2, &wid, u3x_sam_3, &dat, 0)) || (c3n == u3ud(wid)) || - (c3n == u3a_is_cat(wid)) || (c3n == u3ud(dat)) ) { return u3m_bail(c3__exit); } else { - return u3qe_sha1(wid, dat); + return _cqe_sha1(wid, dat); } } diff --git a/pkg/urcrypt/urcrypt.c b/pkg/urcrypt/urcrypt.c index efdd4ad55..20d32f8f3 100644 --- a/pkg/urcrypt/urcrypt.c +++ b/pkg/urcrypt/urcrypt.c @@ -7,6 +7,7 @@ #include #include #include +#include #include #include @@ -526,6 +527,14 @@ urcrypt_aes_cbcc_de(uint8_t **message_ptr, } } +void +urcrypt_sha1(uint8_t *message, size_t length, uint8_t out[20]) +{ + _urcrypt_reverse(length, message); + SHA1(message, length, out); + _urcrypt_reverse(20, out); +} + int urcrypt_ripemd160(uint8_t *message, size_t length, uint8_t out[20]) { diff --git a/pkg/urcrypt/urcrypt.h b/pkg/urcrypt/urcrypt.h index 397fde87d..85aa29233 100644 --- a/pkg/urcrypt/urcrypt.h +++ b/pkg/urcrypt/urcrypt.h @@ -100,6 +100,7 @@ int urcrypt_aes_cbcc_de(uint8_t **message_ptr, uint8_t ivec[16], urcrypt_realloc_t realloc_ptr); +void urcrypt_sha1(uint8_t *message, size_t length, uint8_t out[20]); int urcrypt_ripemd160(uint8_t *message, size_t length, uint8_t out[20]); typedef enum urcrypt_argon2_type { From b742eb729fb02d8e026ead08d453120a43a064e4 Mon Sep 17 00:00:00 2001 From: Paul Driver Date: Thu, 20 Aug 2020 15:25:11 -0700 Subject: [PATCH 032/329] shax->urcrypt --- pkg/urbit/include/jets/q.h | 1 - pkg/urbit/jets/e/shax.c | 50 +++++++++----------------------------- pkg/urcrypt/urcrypt.c | 22 +++++++++++------ pkg/urcrypt/urcrypt.h | 4 ++- 4 files changed, 29 insertions(+), 48 deletions(-) diff --git a/pkg/urbit/include/jets/q.h b/pkg/urbit/include/jets/q.h index 9be9280b3..9c6b2e491 100644 --- a/pkg/urbit/include/jets/q.h +++ b/pkg/urbit/include/jets/q.h @@ -128,7 +128,6 @@ u3_noun u3qes_pbk(u3_atom, u3_atom, u3_atom, u3_atom); u3_noun u3qes_pbl(u3_atom, u3_atom, u3_atom, u3_atom, u3_atom, u3_atom); - u3_noun u3qe_shax(u3_atom); u3_noun u3qe_shay(u3_atom, u3_atom); u3_noun u3qe_shas(u3_atom, u3_atom); u3_noun u3qe_shal(u3_atom, u3_atom); diff --git a/pkg/urbit/jets/e/shax.c b/pkg/urbit/jets/e/shax.c index 4df51183b..bd979833c 100644 --- a/pkg/urbit/jets/e/shax.c +++ b/pkg/urbit/jets/e/shax.c @@ -2,7 +2,7 @@ ** */ #include "all.h" - +#include #if defined(U3_OS_osx) #include @@ -41,43 +41,17 @@ } } -// u3_noun -// u3qe_shax( -// u3_atom a) -// { -// c3_w met_w = u3r_met(3, a); -// return u3qe_shay(met_w, a); -// } -// XX preformance -u3_noun - u3qe_shax(u3_atom a) + static u3_atom + _cqe_shax(u3_atom a) { - c3_w met_w = u3r_met(3, a); - c3_y* fat_y = u3a_malloc(met_w + 1); - - u3r_bytes(0, met_w, fat_y, a); - { - c3_y dig_y[32]; -#if defined(U3_OS_osx) - CC_SHA256_CTX ctx_h; - - CC_SHA256_Init(&ctx_h); - CC_SHA256_Update(&ctx_h, fat_y, met_w); - CC_SHA256_Final(dig_y, &ctx_h); -#else - SHA256_CTX ctx_h; - - SHA256_Init(&ctx_h); - SHA256_Update(&ctx_h, fat_y, met_w); - SHA256_Final(dig_y, &ctx_h); -#endif - u3a_free(fat_y); - return u3i_bytes(32, dig_y); - } + c3_w len_w; + c3_y out_y[32]; + c3_y* dat_y = u3r_bytes_all(&len_w, a); + urcrypt_sha256(dat_y, len_w, out_y); + u3a_free(dat_y); + return u3i_bytes(32, out_y); } -// XX end preformance - u3_noun u3qe_shal(u3_atom a, u3_atom b) @@ -110,9 +84,9 @@ u3_noun u3qe_shas(u3_atom sal, u3_atom ruz) { - u3_noun one = u3qe_shax(ruz); + u3_noun one = _cqe_shax(ruz); u3_noun two = u3qc_mix(sal, one); - u3_noun tri = u3qe_shax(two); + u3_noun tri = _cqe_shax(two); u3z(one); u3z(two); return tri; } @@ -127,7 +101,7 @@ u3_noun { return u3m_bail(c3__exit); } else { - return u3qe_shax(a); + return _cqe_shax(a); } } diff --git a/pkg/urcrypt/urcrypt.c b/pkg/urcrypt/urcrypt.c index 20d32f8f3..2fc42dfda 100644 --- a/pkg/urcrypt/urcrypt.c +++ b/pkg/urcrypt/urcrypt.c @@ -527,14 +527,6 @@ urcrypt_aes_cbcc_de(uint8_t **message_ptr, } } -void -urcrypt_sha1(uint8_t *message, size_t length, uint8_t out[20]) -{ - _urcrypt_reverse(length, message); - SHA1(message, length, out); - _urcrypt_reverse(20, out); -} - int urcrypt_ripemd160(uint8_t *message, size_t length, uint8_t out[20]) { @@ -551,6 +543,20 @@ urcrypt_ripemd160(uint8_t *message, size_t length, uint8_t out[20]) } } +void +urcrypt_sha1(uint8_t *message, size_t length, uint8_t out[20]) +{ + _urcrypt_reverse(length, message); + SHA1(message, length, out); + _urcrypt_reverse(20, out); +} + +void +urcrypt_sha256(uint8_t *message, size_t length, uint8_t out[32]) +{ + SHA256(message, length, out); +} + /* argon2 does memory allocation, but takes function pointers in the context. * the signatures don't match, so we need these wrappers. */ diff --git a/pkg/urcrypt/urcrypt.h b/pkg/urcrypt/urcrypt.h index 85aa29233..55df668b0 100644 --- a/pkg/urcrypt/urcrypt.h +++ b/pkg/urcrypt/urcrypt.h @@ -100,9 +100,11 @@ int urcrypt_aes_cbcc_de(uint8_t **message_ptr, uint8_t ivec[16], urcrypt_realloc_t realloc_ptr); -void urcrypt_sha1(uint8_t *message, size_t length, uint8_t out[20]); int urcrypt_ripemd160(uint8_t *message, size_t length, uint8_t out[20]); +void urcrypt_sha1(uint8_t *message, size_t length, uint8_t out[20]); +void urcrypt_sha256(uint8_t *message, size_t length, uint8_t out[32]); + typedef enum urcrypt_argon2_type { urcrypt_argon2_d = 0, urcrypt_argon2_i = 1, From 975672a4f14f9316774ee164e39a90152fe0facf Mon Sep 17 00:00:00 2001 From: Paul Driver Date: Thu, 20 Aug 2020 15:34:01 -0700 Subject: [PATCH 033/329] shay->urcrypt --- pkg/urbit/include/jets/q.h | 1 - pkg/urbit/jets/e/shax.c | 45 ++++++++++++-------------------------- 2 files changed, 14 insertions(+), 32 deletions(-) diff --git a/pkg/urbit/include/jets/q.h b/pkg/urbit/include/jets/q.h index 9c6b2e491..9a7cbe732 100644 --- a/pkg/urbit/include/jets/q.h +++ b/pkg/urbit/include/jets/q.h @@ -128,7 +128,6 @@ u3_noun u3qes_pbk(u3_atom, u3_atom, u3_atom, u3_atom); u3_noun u3qes_pbl(u3_atom, u3_atom, u3_atom, u3_atom, u3_atom, u3_atom); - u3_noun u3qe_shay(u3_atom, u3_atom); u3_noun u3qe_shas(u3_atom, u3_atom); u3_noun u3qe_shal(u3_atom, u3_atom); diff --git a/pkg/urbit/jets/e/shax.c b/pkg/urbit/jets/e/shax.c index bd979833c..fe3cdd81d 100644 --- a/pkg/urbit/jets/e/shax.c +++ b/pkg/urbit/jets/e/shax.c @@ -13,31 +13,20 @@ /* functions */ - u3_noun - u3qe_shay(u3_atom a, - u3_atom b) + static u3_atom + _cqe_shay(u3_atom wid, + u3_atom dat) { - c3_assert(_(u3a_is_cat(a))); - c3_y* fat_y = u3a_malloc(a + 1); - - u3r_bytes(0, a, fat_y, b); - { - c3_y dig_y[32]; -#if defined(U3_OS_osx) - CC_SHA256_CTX ctx_h; - - CC_SHA256_Init(&ctx_h); - CC_SHA256_Update(&ctx_h, fat_y, a); - CC_SHA256_Final(dig_y, &ctx_h); -#else - SHA256_CTX ctx_h; - - SHA256_Init(&ctx_h); - SHA256_Update(&ctx_h, fat_y, a); - SHA256_Final(dig_y, &ctx_h); -#endif - u3a_free(fat_y); - return u3i_bytes(32, dig_y); + c3_w len_w; + if ( !u3r_word_fit(&len_w, wid) ) { + return u3m_bail(c3__fail); + } + else { + c3_y out_y[32]; + c3_y* dat_y = u3r_bytes_alloc(0, len_w, dat); + urcrypt_sha256(dat_y, len_w, out_y); + u3a_free(dat_y); + return u3i_bytes(32, out_y); } } @@ -110,20 +99,14 @@ { u3_noun a, b; -// static int few = 0; -// if(few == 0) printf("foo\r\n"); -// few++; few %= 1000; - - if ( (u3_none == (a = u3r_at(u3x_sam_2, cor))) || (u3_none == (b = u3r_at(u3x_sam_3, cor))) || (c3n == u3ud(a)) || - (c3n == u3a_is_cat(a)) || (c3n == u3ud(b)) ) { return u3m_bail(c3__exit); } else { - return u3qe_shay(a, b); + return _cqe_shay(a, b); } } From a06b087f37bb451f7ac3282629f1dd67672b938a Mon Sep 17 00:00:00 2001 From: Paul Driver Date: Thu, 20 Aug 2020 16:01:16 -0700 Subject: [PATCH 034/329] shas->urcrypt --- pkg/urbit/include/jets/q.h | 1 - pkg/urbit/jets/e/shax.c | 22 +++++++++++++--------- pkg/urcrypt/urcrypt.c | 27 ++++++++++++++++++++++++++- pkg/urcrypt/urcrypt.h | 5 ++++- 4 files changed, 43 insertions(+), 12 deletions(-) diff --git a/pkg/urbit/include/jets/q.h b/pkg/urbit/include/jets/q.h index 9a7cbe732..f78025f73 100644 --- a/pkg/urbit/include/jets/q.h +++ b/pkg/urbit/include/jets/q.h @@ -128,7 +128,6 @@ u3_noun u3qes_pbk(u3_atom, u3_atom, u3_atom, u3_atom); u3_noun u3qes_pbl(u3_atom, u3_atom, u3_atom, u3_atom, u3_atom, u3_atom); - u3_noun u3qe_shas(u3_atom, u3_atom); u3_noun u3qe_shal(u3_atom, u3_atom); u3_noun u3qe_hmac(u3_noun, u3_atom, u3_atom, diff --git a/pkg/urbit/jets/e/shax.c b/pkg/urbit/jets/e/shax.c index fe3cdd81d..5687e6ede 100644 --- a/pkg/urbit/jets/e/shax.c +++ b/pkg/urbit/jets/e/shax.c @@ -69,15 +69,19 @@ } } - u3_noun - u3qe_shas(u3_atom sal, + static u3_atom + _cqe_shas(u3_atom sal, u3_atom ruz) { - u3_noun one = _cqe_shax(ruz); - u3_noun two = u3qc_mix(sal, one); - u3_noun tri = _cqe_shax(two); + c3_w sal_w, ruz_w; + c3_y *sal_y, *ruz_y, out_y[32]; - u3z(one); u3z(two); return tri; + sal_y = u3r_bytes_all(&sal_w, sal); + ruz_y = u3r_bytes_all(&ruz_w, ruz); + urcrypt_shas(sal_y, sal_w, ruz_y, ruz_w, out_y); + u3a_free(sal_y); + u3a_free(ruz_y); + return u3i_bytes(32, out_y); } u3_noun @@ -139,7 +143,7 @@ { return u3m_bail(c3__exit); } else { - return u3qe_shas(sal, ruz); + return _cqe_shas(sal, ruz); } } @@ -156,7 +160,7 @@ while ( 0 != b ) { u3_noun x = u3qc_mix(a, c); u3_noun y = u3qc_mix(b, x); - u3_noun d = u3qe_shas(c3_s4('o','g','-','b'), y); + u3_noun d = _cqe_shas(c3_s4('o','g','-','b'), y); u3_noun m; u3z(x); u3z(y); @@ -183,7 +187,7 @@ u3_atom b) { u3_noun x = u3qc_mix(b, a); - u3_noun c = u3qe_shas(c3_s4('o','g','-','a'), x); + u3_noun c = _cqe_shas(c3_s4('o','g','-','a'), x); u3_noun l = _og_list(a, b, c); u3_noun r = u3qc_can(0, l); diff --git a/pkg/urcrypt/urcrypt.c b/pkg/urcrypt/urcrypt.c index 2fc42dfda..c595e0b6c 100644 --- a/pkg/urcrypt/urcrypt.c +++ b/pkg/urcrypt/urcrypt.c @@ -552,11 +552,36 @@ urcrypt_sha1(uint8_t *message, size_t length, uint8_t out[20]) } void -urcrypt_sha256(uint8_t *message, size_t length, uint8_t out[32]) +urcrypt_sha256(const uint8_t *message, size_t length, uint8_t out[32]) { SHA256(message, length, out); } +void +urcrypt_shas(uint8_t *salt, size_t salt_length, + const uint8_t *message, size_t message_length, + uint8_t out[32]) +{ + size_t i; + uint8_t mid[32]; + + // docs don't say what happens if msg overlaps with out + urcrypt_sha256(message, message_length, mid); + + if ( salt_length > 32 ) { + for ( i = 0; i < 32; i++ ) { + salt[i] ^= mid[i]; + } + urcrypt_sha256(salt, salt_length, out); + } + else { + for ( i = 0; i < salt_length; i++ ) { + mid[i] ^= salt[i]; + } + urcrypt_sha256(mid, 32, out); + } +} + /* argon2 does memory allocation, but takes function pointers in the context. * the signatures don't match, so we need these wrappers. */ diff --git a/pkg/urcrypt/urcrypt.h b/pkg/urcrypt/urcrypt.h index 55df668b0..9c7e1f304 100644 --- a/pkg/urcrypt/urcrypt.h +++ b/pkg/urcrypt/urcrypt.h @@ -103,7 +103,10 @@ int urcrypt_aes_cbcc_de(uint8_t **message_ptr, int urcrypt_ripemd160(uint8_t *message, size_t length, uint8_t out[20]); void urcrypt_sha1(uint8_t *message, size_t length, uint8_t out[20]); -void urcrypt_sha256(uint8_t *message, size_t length, uint8_t out[32]); +void urcrypt_sha256(const uint8_t *message, size_t length, uint8_t out[32]); +void urcrypt_shas(uint8_t *salt, size_t salt_length, + const uint8_t *message, size_t message_length, + uint8_t out[32]); typedef enum urcrypt_argon2_type { urcrypt_argon2_d = 0, From 1277ea7a65a598c94a6863c0759e7e5b30fb3b72 Mon Sep 17 00:00:00 2001 From: Paul Driver Date: Fri, 21 Aug 2020 10:38:48 -0700 Subject: [PATCH 035/329] shal->urcrypt --- pkg/urbit/include/jets/q.h | 2 -- pkg/urbit/jets/e/shax.c | 46 ++++++++++++-------------------------- pkg/urcrypt/urcrypt.c | 6 +++++ pkg/urcrypt/urcrypt.h | 1 + 4 files changed, 21 insertions(+), 34 deletions(-) diff --git a/pkg/urbit/include/jets/q.h b/pkg/urbit/include/jets/q.h index f78025f73..0259f6acd 100644 --- a/pkg/urbit/include/jets/q.h +++ b/pkg/urbit/include/jets/q.h @@ -128,8 +128,6 @@ u3_noun u3qes_pbk(u3_atom, u3_atom, u3_atom, u3_atom); u3_noun u3qes_pbl(u3_atom, u3_atom, u3_atom, u3_atom, u3_atom, u3_atom); - u3_noun u3qe_shal(u3_atom, u3_atom); - u3_noun u3qe_hmac(u3_noun, u3_atom, u3_atom, u3_atom, u3_atom, u3_atom, u3_atom); diff --git a/pkg/urbit/jets/e/shax.c b/pkg/urbit/jets/e/shax.c index 5687e6ede..b4668f9c7 100644 --- a/pkg/urbit/jets/e/shax.c +++ b/pkg/urbit/jets/e/shax.c @@ -4,12 +4,6 @@ #include "all.h" #include -#if defined(U3_OS_osx) -#include -#else -#include -#endif - /* functions */ @@ -41,31 +35,20 @@ return u3i_bytes(32, out_y); } - u3_noun - u3qe_shal(u3_atom a, - u3_atom b) + static u3_atom + _cqe_shal(u3_atom wid, + u3_atom dat) { - c3_assert(_(u3a_is_cat(a))); - c3_y* fat_y = u3a_malloc(a + 1); - - u3r_bytes(0, a, fat_y, b); - { - c3_y dig_y[64]; -#if defined(U3_OS_osx) - CC_SHA512_CTX ctx_h; - - CC_SHA512_Init(&ctx_h); - CC_SHA512_Update(&ctx_h, fat_y, a); - CC_SHA512_Final(dig_y, &ctx_h); -#else - SHA512_CTX ctx_h; - - SHA512_Init(&ctx_h); - SHA512_Update(&ctx_h, fat_y, a); - SHA512_Final(dig_y, &ctx_h); -#endif - u3a_free(fat_y); - return u3i_bytes(64, dig_y); + c3_w len_w; + if ( !u3r_word_fit(&len_w, wid) ) { + return u3m_bail(c3__fail); + } + else { + c3_y out_y[64]; + c3_y* dat_y = u3r_bytes_alloc(0, len_w, dat); + urcrypt_sha512(dat_y, len_w, out_y); + u3a_free(dat_y); + return u3i_bytes(64, out_y); } } @@ -122,12 +105,11 @@ if ( (u3_none == (a = u3r_at(u3x_sam_2, cor))) || (u3_none == (b = u3r_at(u3x_sam_3, cor))) || (c3n == u3ud(a)) || - (c3n == u3a_is_cat(a)) || (c3n == u3ud(b)) ) { return u3m_bail(c3__exit); } else { - return u3qe_shal(a, b); + return _cqe_shal(a, b); } } diff --git a/pkg/urcrypt/urcrypt.c b/pkg/urcrypt/urcrypt.c index c595e0b6c..967c65b86 100644 --- a/pkg/urcrypt/urcrypt.c +++ b/pkg/urcrypt/urcrypt.c @@ -557,6 +557,12 @@ urcrypt_sha256(const uint8_t *message, size_t length, uint8_t out[32]) SHA256(message, length, out); } +void +urcrypt_sha512(const uint8_t *message, size_t length, uint8_t out[64]) +{ + SHA512(message, length, out); +} + void urcrypt_shas(uint8_t *salt, size_t salt_length, const uint8_t *message, size_t message_length, diff --git a/pkg/urcrypt/urcrypt.h b/pkg/urcrypt/urcrypt.h index 9c7e1f304..40dff7cc2 100644 --- a/pkg/urcrypt/urcrypt.h +++ b/pkg/urcrypt/urcrypt.h @@ -104,6 +104,7 @@ int urcrypt_ripemd160(uint8_t *message, size_t length, uint8_t out[20]); void urcrypt_sha1(uint8_t *message, size_t length, uint8_t out[20]); void urcrypt_sha256(const uint8_t *message, size_t length, uint8_t out[32]); +void urcrypt_sha512(const uint8_t *message, size_t length, uint8_t out[64]); void urcrypt_shas(uint8_t *salt, size_t salt_length, const uint8_t *message, size_t message_length, uint8_t out[32]); From 9bd589f6df13f62140fa5528079f21aa4b0e3c05 Mon Sep 17 00:00:00 2001 From: Paul Driver Date: Fri, 21 Aug 2020 10:45:12 -0700 Subject: [PATCH 036/329] remove unused old aes c file --- pkg/urbit/jets/e/aesc.c | 121 ---------------------------------------- 1 file changed, 121 deletions(-) delete mode 100644 pkg/urbit/jets/e/aesc.c diff --git a/pkg/urbit/jets/e/aesc.c b/pkg/urbit/jets/e/aesc.c deleted file mode 100644 index f5f233970..000000000 --- a/pkg/urbit/jets/e/aesc.c +++ /dev/null @@ -1,121 +0,0 @@ -/* j/5/aes.c -** -*/ -#include "all.h" - - -#if defined(U3_OS_osx) -#include -#else -#include -#endif - -/* functions -*/ - u3_noun - u3qea_en(u3_atom a, - u3_atom b) - { - c3_y a_y[32]; - c3_y b_y[16]; -#if defined(U3_OS_osx) - size_t siz_i = 0; -#else - AES_KEY key_u; -#endif - - c3_assert(u3r_met(3, a) <= 32); - c3_assert(u3r_met(3, b) <= 16); - - u3r_bytes(0, 32, a_y, a); - u3r_bytes(0, 16, b_y, b); - -#if defined(U3_OS_osx) - if ( kCCSuccess != CCCrypt(kCCEncrypt, kCCAlgorithmAES128, - kCCOptionECBMode, a_y, kCCKeySizeAES256, 0, b_y, - 16, b_y, 16, &siz_i) ) - { - return u3m_bail(c3__exit); - } - else c3_assert(16 == siz_i); -#else - if ( 0 != AES_set_encrypt_key(a_y, 256, &key_u) ) { - return u3m_bail(c3__exit); - } - else { - AES_encrypt(b_y, b_y, &key_u); - } -#endif - - return u3i_bytes(16, b_y); - } - - u3_noun - u3wea_en(u3_noun cor) - { - u3_noun a, b; - - if ( c3n == u3r_mean(cor, u3x_sam_2, &a, u3x_sam_3, &b, 0) || - c3n == u3ud(a) || - c3n == u3ud(b) ) - { - return u3m_bail(c3__exit); - } - else { - return u3qea_en(a, b); - } - } - - u3_noun - u3qea_de(u3_atom a, - u3_atom b) - { - c3_y a_y[32]; - c3_y b_y[16]; -#if defined(U3_OS_osx) - size_t siz_i = 0; -#else - AES_KEY key_u; -#endif - - c3_assert(u3r_met(3, a) <= 32); - c3_assert(u3r_met(3, b) <= 16); - - u3r_bytes(0, 32, a_y, a); - u3r_bytes(0, 16, b_y, b); - -#if defined(U3_OS_osx) - if ( kCCSuccess != CCCrypt(kCCDecrypt, kCCAlgorithmAES128, - kCCOptionECBMode, a_y, kCCKeySizeAES256, 0, b_y, - 16, b_y, 16, &siz_i) ) - { - return u3m_bail(c3__exit); - } - else c3_assert(16 == siz_i); -#else - if ( 0 != AES_set_decrypt_key(a_y, 256, &key_u) ) { - return u3m_bail(c3__exit); - } - else { - AES_decrypt(b_y, b_y, &key_u); - } -#endif - - return u3i_bytes(16, b_y); - } - - u3_noun - u3wea_de(u3_noun cor) - { - u3_noun a, b; - - if ( c3n == u3r_mean(cor, u3x_sam_2, &a, u3x_sam_3, &b, 0) || - c3n == u3ud(a) || - c3n == u3ud(b) ) - { - return u3m_bail(c3__exit); - } - else { - return u3qea_de(a, b); - } - } From 6f7b5acd205b3b5f6315ccc8ffe363d6acd3ad94 Mon Sep 17 00:00:00 2001 From: Paul Driver Date: Fri, 21 Aug 2020 10:55:32 -0700 Subject: [PATCH 037/329] use urcrypt instead of openssl for bash calculation --- pkg/urbit/noun/jets.c | 21 ++------------------- 1 file changed, 2 insertions(+), 19 deletions(-) diff --git a/pkg/urbit/noun/jets.c b/pkg/urbit/noun/jets.c index 8a8682f61..e490aaac4 100644 --- a/pkg/urbit/noun/jets.c +++ b/pkg/urbit/noun/jets.c @@ -2,12 +2,7 @@ ** */ #include "all.h" - -#if defined(U3_OS_osx) -#include -#else -#include -#endif +#include /** Data structures. **/ @@ -133,19 +128,7 @@ _cj_bash(u3_noun bat) } // assume little-endian fat_y = (c3_y*) wor_w; -#if defined(U3_OS_osx) - CC_SHA256_CTX ctx_h; - - CC_SHA256_Init(&ctx_h); - CC_SHA256_Update(&ctx_h, fat_y, met_w); - CC_SHA256_Final(dig_y, &ctx_h); -#else - SHA256_CTX ctx_h; - - SHA256_Init(&ctx_h); - SHA256_Update(&ctx_h, fat_y, met_w); - SHA256_Final(dig_y, &ctx_h); -#endif + urcrypt_sha256(fat_y, met_w, dig_y); pro = u3i_bytes(32, dig_y); u3h_put(u3R->jed.bas_p, bat, u3k(pro)); u3a_wfree(wor_w); From 856de7e415133c4c68e9e3581eb1ab7a2738363c Mon Sep 17 00:00:00 2001 From: Paul Driver Date: Fri, 21 Aug 2020 12:32:48 -0700 Subject: [PATCH 038/329] name the sha functions consistently --- pkg/urbit/jets/e/shax.c | 6 +++--- pkg/urbit/noun/jets.c | 2 +- pkg/urcrypt/urcrypt.c | 10 +++++----- pkg/urcrypt/urcrypt.h | 4 ++-- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/pkg/urbit/jets/e/shax.c b/pkg/urbit/jets/e/shax.c index b4668f9c7..29945ee82 100644 --- a/pkg/urbit/jets/e/shax.c +++ b/pkg/urbit/jets/e/shax.c @@ -18,7 +18,7 @@ else { c3_y out_y[32]; c3_y* dat_y = u3r_bytes_alloc(0, len_w, dat); - urcrypt_sha256(dat_y, len_w, out_y); + urcrypt_shay(dat_y, len_w, out_y); u3a_free(dat_y); return u3i_bytes(32, out_y); } @@ -30,7 +30,7 @@ c3_w len_w; c3_y out_y[32]; c3_y* dat_y = u3r_bytes_all(&len_w, a); - urcrypt_sha256(dat_y, len_w, out_y); + urcrypt_shay(dat_y, len_w, out_y); u3a_free(dat_y); return u3i_bytes(32, out_y); } @@ -46,7 +46,7 @@ else { c3_y out_y[64]; c3_y* dat_y = u3r_bytes_alloc(0, len_w, dat); - urcrypt_sha512(dat_y, len_w, out_y); + urcrypt_shal(dat_y, len_w, out_y); u3a_free(dat_y); return u3i_bytes(64, out_y); } diff --git a/pkg/urbit/noun/jets.c b/pkg/urbit/noun/jets.c index e490aaac4..56edeeaf0 100644 --- a/pkg/urbit/noun/jets.c +++ b/pkg/urbit/noun/jets.c @@ -128,7 +128,7 @@ _cj_bash(u3_noun bat) } // assume little-endian fat_y = (c3_y*) wor_w; - urcrypt_sha256(fat_y, met_w, dig_y); + urcrypt_shay(fat_y, met_w, dig_y); pro = u3i_bytes(32, dig_y); u3h_put(u3R->jed.bas_p, bat, u3k(pro)); u3a_wfree(wor_w); diff --git a/pkg/urcrypt/urcrypt.c b/pkg/urcrypt/urcrypt.c index 967c65b86..251e5cec1 100644 --- a/pkg/urcrypt/urcrypt.c +++ b/pkg/urcrypt/urcrypt.c @@ -552,13 +552,13 @@ urcrypt_sha1(uint8_t *message, size_t length, uint8_t out[20]) } void -urcrypt_sha256(const uint8_t *message, size_t length, uint8_t out[32]) +urcrypt_shay(const uint8_t *message, size_t length, uint8_t out[32]) { SHA256(message, length, out); } void -urcrypt_sha512(const uint8_t *message, size_t length, uint8_t out[64]) +urcrypt_shal(const uint8_t *message, size_t length, uint8_t out[64]) { SHA512(message, length, out); } @@ -572,19 +572,19 @@ urcrypt_shas(uint8_t *salt, size_t salt_length, uint8_t mid[32]; // docs don't say what happens if msg overlaps with out - urcrypt_sha256(message, message_length, mid); + urcrypt_shay(message, message_length, mid); if ( salt_length > 32 ) { for ( i = 0; i < 32; i++ ) { salt[i] ^= mid[i]; } - urcrypt_sha256(salt, salt_length, out); + urcrypt_shay(salt, salt_length, out); } else { for ( i = 0; i < salt_length; i++ ) { mid[i] ^= salt[i]; } - urcrypt_sha256(mid, 32, out); + urcrypt_shay(mid, 32, out); } } diff --git a/pkg/urcrypt/urcrypt.h b/pkg/urcrypt/urcrypt.h index 40dff7cc2..63e1e50f0 100644 --- a/pkg/urcrypt/urcrypt.h +++ b/pkg/urcrypt/urcrypt.h @@ -103,8 +103,8 @@ int urcrypt_aes_cbcc_de(uint8_t **message_ptr, int urcrypt_ripemd160(uint8_t *message, size_t length, uint8_t out[20]); void urcrypt_sha1(uint8_t *message, size_t length, uint8_t out[20]); -void urcrypt_sha256(const uint8_t *message, size_t length, uint8_t out[32]); -void urcrypt_sha512(const uint8_t *message, size_t length, uint8_t out[64]); +void urcrypt_shay(const uint8_t *message, size_t length, uint8_t out[32]); +void urcrypt_shal(const uint8_t *message, size_t length, uint8_t out[64]); void urcrypt_shas(uint8_t *salt, size_t salt_length, const uint8_t *message, size_t message_length, uint8_t out[32]); From 8d657e12c13e3001505ba67635300b025f43c4a9 Mon Sep 17 00:00:00 2001 From: Paul Driver Date: Mon, 24 Aug 2020 14:33:57 -0700 Subject: [PATCH 039/329] aes-siva-en->urcrypt --- nix/pkgs/default.nix | 10 +-- nix/pkgs/urcrypt/default.nix | 4 +- pkg/urbit/jets/e/aes_siv.c | 141 +++++++++++++++++++++++++++++++---- pkg/urcrypt/Makefile | 2 +- pkg/urcrypt/urcrypt.c | 67 ++++++++++++++++- pkg/urcrypt/urcrypt.h | 13 ++++ 6 files changed, 211 insertions(+), 26 deletions(-) diff --git a/nix/pkgs/default.nix b/nix/pkgs/default.nix index db5120376..3c6d2019b 100644 --- a/nix/pkgs/default.nix +++ b/nix/pkgs/default.nix @@ -14,15 +14,15 @@ let inherit (deps) ed25519; }; - urcrypt = import ./urcrypt { - inherit pkgs ge-additions; - inherit (deps) ed25519 argon2; - }; - libaes_siv = import ./libaes_siv { inherit pkgs; }; + urcrypt = import ./urcrypt { + inherit pkgs ge-additions libaes_siv; + inherit (deps) ed25519 argon2; + }; + mkUrbit = { debug }: import ./urbit { inherit pkgs ent debug ge-additions urcrypt libaes_siv; diff --git a/nix/pkgs/urcrypt/default.nix b/nix/pkgs/urcrypt/default.nix index e81413ca0..4e0cea360 100644 --- a/nix/pkgs/urcrypt/default.nix +++ b/nix/pkgs/urcrypt/default.nix @@ -1,9 +1,9 @@ -{ pkgs, ed25519, ge-additions, argon2 }: +{ pkgs, ed25519, ge-additions, argon2, libaes_siv }: pkgs.stdenv.mkDerivation rec { name = "urcrypt"; builder = ./builder.sh; src = ../../../pkg/urcrypt; - buildInputs = [ pkgs.openssl ed25519 ge-additions argon2 ]; + buildInputs = [ pkgs.openssl ed25519 ge-additions argon2 libaes_siv ]; } diff --git a/pkg/urbit/jets/e/aes_siv.c b/pkg/urbit/jets/e/aes_siv.c index 80ad62ab6..a298e7b00 100644 --- a/pkg/urbit/jets/e/aes_siv.c +++ b/pkg/urbit/jets/e/aes_siv.c @@ -2,11 +2,135 @@ ** */ #include "all.h" +#include #include "aes_siv.h" +typedef int (*urcrypt_siv)(c3_y*, size_t, + urcrypt_aes_siv_data*, size_t, + c3_y*, c3_y[16], c3_y*); + /* functions */ + // soc_w = number of items + // mat_w = size in bytes of assoc array + // dat_w = size of allocation (array + atom storage) + static void + _cqea_measure_ads(u3_noun ads, c3_w* soc_w, c3_w *mat_w, c3_w *dat_w) + { + u3_noun i, t; + c3_w a_w, b_w, tmp_w, met_w; + + for ( a_w = b_w = 0, t = ads; u3_nul != t; ++a_w ) { + u3x_cell(t, &i, &t); + if ( c3n == u3ud(i) ) { + u3m_bail(c3__exit); + return; + } + else { + tmp_w = b_w; + b_w += u3r_met(3, i); + if ( b_w < tmp_w ) { + u3m_bail(c3__fail); + return; + } + } + } + + // check for size overflows + tmp_w = a_w * sizeof(urcrypt_aes_siv_data); + if ( (tmp_w / a_w) != sizeof(urcrypt_aes_siv_data) ) { + u3m_bail(c3__fail); + } + else if ( (*dat_w = tmp_w + b_w) < tmp_w ) { + u3m_bail(c3__fail); + } + else { + *soc_w = a_w; + *mat_w = tmp_w; + } + } + + // assumes ads is a valid (list @) because it's already been measured + static void + _cqea_encode_ads(u3_noun ads, + c3_w mat_w, + urcrypt_aes_siv_data *dat_u) + { + c3_w met_w; + u3_noun i, t; + urcrypt_aes_siv_data *cur_u; + c3_y *dat_y = ((c3_y*) dat_u) + mat_w; + + for ( cur_u = dat_u, t = ads; u3_nul != t; t = u3t(t), ++cur_u ) { + i = u3h(t); + met_w = u3r_met(3, i); + u3r_bytes(0, met_w, dat_y, i); + cur_u->length = met_w; + cur_u->bytes = dat_y; + dat_y += met_w; + } + } + + static u3_noun + _cqea_siv_en(c3_y* key_y, + c3_w key_w, + u3_noun ads, + u3_atom txt, + urcrypt_siv low_f) + { + u3_noun ret; + c3_w txt_w, soc_w; + c3_y *txt_y, *out_y, iv_y[16]; + c3_t ads_t = ( u3_nul != ads ); + urcrypt_aes_siv_data *dat_u; + + if ( !ads_t ) { + soc_w = 0; + dat_u = NULL; + } + else { + c3_w mat_w, dat_w; + + _cqea_measure_ads(ads, &soc_w, &mat_w, &dat_w); + dat_u = u3a_malloc(dat_w); + _cqea_encode_ads(ads, mat_w, dat_u); + } + + txt_y = u3r_bytes_all(&txt_w, txt); + out_y = u3a_malloc(txt_w); + + ret = ( 0 != (*low_f)(txt_y, txt_w, dat_u, soc_w, key_y, iv_y, out_y) ) + ? u3_none + : u3nt(u3i_bytes(16, iv_y), + u3i_words(1, &txt_w), + u3i_bytes(txt_w, out_y)); + + u3a_free(txt_y); + u3a_free(out_y); + if ( ads_t ) { + u3a_free(dat_u); + } + + return ret; + } + + static u3_noun + _cqea_siva_en(u3_atom key, + u3_noun ads, + u3_atom txt) + { + if ( u3r_met(3, key) > 32 ) { + // hoon doesn't explicitly check size, but we need 32. + return u3_none; + } + else { + c3_y key_y[32]; + u3r_bytes(0, 32, key_y, key); + return _cqea_siv_en(key_y, 32, ads, txt, &urcrypt_aes_siva_en); + } + } + static void u3r_bytes_reverse(c3_w a_w, c3_w b_w, c3_y* c_y, /* out */ @@ -152,21 +276,6 @@ static u3_noun _siv_de(c3_y* key_y, return u3nc(0, rev_msg); } - -u3_noun -u3qea_siva_en(u3_atom key, - u3_noun ads, - u3_atom txt) -{ - c3_y key_y[32]; - if (u3r_met(3, key) > 32) { - return u3_none; - } - - u3r_bytes_reverse(0, 32, key_y, key); - return _siv_en(key_y, 32, ads, txt); -} - u3_noun u3wea_siva_en(u3_noun cor) { @@ -179,7 +288,7 @@ u3wea_siva_en(u3_noun cor) c3n == u3ud(txt) ) { return u3m_bail(c3__exit); } else { - return u3qea_siva_en(key, ads, txt); + return _cqea_siva_en(key, ads, txt); } } diff --git a/pkg/urcrypt/Makefile b/pkg/urcrypt/Makefile index 045b85416..2f1a6abb0 100644 --- a/pkg/urcrypt/Makefile +++ b/pkg/urcrypt/Makefile @@ -16,7 +16,7 @@ liburcrypt.a: $(SOURCES) liburcrypt.so: $(SOURCES) $(CC) $(CFLAGS) -fPIC -c urcrypt.c -o urcrypt-shared.o $(CC) -shared urcrypt-shared.o -o liburcrypt.so \ - -led25519 -lge-additions -lssl -largon2 \ + -led25519 -lge-additions -lssl -largon2 -laes_siv \ -Wl,--no-undefined all: liburcrypt.a liburcrypt.so diff --git a/pkg/urcrypt/urcrypt.c b/pkg/urcrypt/urcrypt.c index 251e5cec1..da21b1b74 100644 --- a/pkg/urcrypt/urcrypt.c +++ b/pkg/urcrypt/urcrypt.c @@ -5,9 +5,10 @@ #include #include -#include #include #include +#include +#include #include #include @@ -527,6 +528,69 @@ urcrypt_aes_cbcc_de(uint8_t **message_ptr, } } +static int +_urcrypt_aes_siv_en(uint8_t *key, + size_t key_length, + uint8_t *message, + size_t message_length, + urcrypt_aes_siv_data *data, + size_t data_length, + uint8_t iv[16], + uint8_t *out) +{ + AES_SIV_CTX *ctx = AES_SIV_CTX_new(); + + if ( NULL == ctx ) { + return -1; + } + else { + int code; + _urcrypt_reverse(key_length, key); + if ( 0 == AES_SIV_Init(ctx, key, key_length) ) { + code = -2; + } + else { + uint8_t *bytes; + size_t i, blen; + + for ( i = 0; i < data_length; ++i ) { + blen = data[i].length; + bytes = data[i].bytes; + _urcrypt_reverse(blen, bytes); + if ( 0 == AES_SIV_AssociateData(ctx, bytes, blen) ) { + code = -3; + goto finish; + } + } + + _urcrypt_reverse(message_length, message); + if ( 0 == AES_SIV_EncryptFinal(ctx, iv, out, message, message_length) ) { + code = -4; + } + else { + _urcrypt_reverse(16, iv); + _urcrypt_reverse(message_length, out); + code = 0; + } + } +finish: + AES_SIV_CTX_free(ctx); + return code; + } +} + +int +urcrypt_aes_siva_en(uint8_t *message, + size_t message_length, + urcrypt_aes_siv_data *data, + size_t data_length, + uint8_t key[32], + uint8_t iv[16], + uint8_t *out) +{ + return _urcrypt_aes_siv_en(key, 32, message, message_length, data, data_length, iv, out); +} + int urcrypt_ripemd160(uint8_t *message, size_t length, uint8_t out[20]) { @@ -641,7 +705,6 @@ urcrypt_argon2(urcrypt_argon2_type type, int (*f)(argon2_context*); int result; - switch ( type ) { default: return "unknown type"; diff --git a/pkg/urcrypt/urcrypt.h b/pkg/urcrypt/urcrypt.h index 63e1e50f0..e5d4906d6 100644 --- a/pkg/urcrypt/urcrypt.h +++ b/pkg/urcrypt/urcrypt.h @@ -100,6 +100,19 @@ int urcrypt_aes_cbcc_de(uint8_t **message_ptr, uint8_t ivec[16], urcrypt_realloc_t realloc_ptr); +typedef struct { + size_t length; + uint8_t *bytes; +} urcrypt_aes_siv_data; + +int urcrypt_aes_siva_en(uint8_t *message, + size_t message_length, + urcrypt_aes_siv_data *data, + size_t data_length, + uint8_t key[32], + uint8_t iv[16], + uint8_t *out); + int urcrypt_ripemd160(uint8_t *message, size_t length, uint8_t out[20]); void urcrypt_sha1(uint8_t *message, size_t length, uint8_t out[20]); From 400c5187e696aa7864af25e1b3e2966988ab51e5 Mon Sep 17 00:00:00 2001 From: Paul Driver Date: Tue, 25 Aug 2020 12:14:13 -0700 Subject: [PATCH 040/329] siva_de --- pkg/urbit/jets/e/aes_siv.c | 317 +++++++++++++++++++++---------------- pkg/urcrypt/urcrypt.c | 123 ++++++++++---- pkg/urcrypt/urcrypt.h | 7 + 3 files changed, 284 insertions(+), 163 deletions(-) diff --git a/pkg/urbit/jets/e/aes_siv.c b/pkg/urbit/jets/e/aes_siv.c index a298e7b00..f4b2c796d 100644 --- a/pkg/urbit/jets/e/aes_siv.c +++ b/pkg/urbit/jets/e/aes_siv.c @@ -6,131 +6,7 @@ #include "aes_siv.h" -typedef int (*urcrypt_siv)(c3_y*, size_t, - urcrypt_aes_siv_data*, size_t, - c3_y*, c3_y[16], c3_y*); - -/* functions - */ - // soc_w = number of items - // mat_w = size in bytes of assoc array - // dat_w = size of allocation (array + atom storage) - static void - _cqea_measure_ads(u3_noun ads, c3_w* soc_w, c3_w *mat_w, c3_w *dat_w) - { - u3_noun i, t; - c3_w a_w, b_w, tmp_w, met_w; - - for ( a_w = b_w = 0, t = ads; u3_nul != t; ++a_w ) { - u3x_cell(t, &i, &t); - if ( c3n == u3ud(i) ) { - u3m_bail(c3__exit); - return; - } - else { - tmp_w = b_w; - b_w += u3r_met(3, i); - if ( b_w < tmp_w ) { - u3m_bail(c3__fail); - return; - } - } - } - - // check for size overflows - tmp_w = a_w * sizeof(urcrypt_aes_siv_data); - if ( (tmp_w / a_w) != sizeof(urcrypt_aes_siv_data) ) { - u3m_bail(c3__fail); - } - else if ( (*dat_w = tmp_w + b_w) < tmp_w ) { - u3m_bail(c3__fail); - } - else { - *soc_w = a_w; - *mat_w = tmp_w; - } - } - - // assumes ads is a valid (list @) because it's already been measured - static void - _cqea_encode_ads(u3_noun ads, - c3_w mat_w, - urcrypt_aes_siv_data *dat_u) - { - c3_w met_w; - u3_noun i, t; - urcrypt_aes_siv_data *cur_u; - c3_y *dat_y = ((c3_y*) dat_u) + mat_w; - - for ( cur_u = dat_u, t = ads; u3_nul != t; t = u3t(t), ++cur_u ) { - i = u3h(t); - met_w = u3r_met(3, i); - u3r_bytes(0, met_w, dat_y, i); - cur_u->length = met_w; - cur_u->bytes = dat_y; - dat_y += met_w; - } - } - - static u3_noun - _cqea_siv_en(c3_y* key_y, - c3_w key_w, - u3_noun ads, - u3_atom txt, - urcrypt_siv low_f) - { - u3_noun ret; - c3_w txt_w, soc_w; - c3_y *txt_y, *out_y, iv_y[16]; - c3_t ads_t = ( u3_nul != ads ); - urcrypt_aes_siv_data *dat_u; - - if ( !ads_t ) { - soc_w = 0; - dat_u = NULL; - } - else { - c3_w mat_w, dat_w; - - _cqea_measure_ads(ads, &soc_w, &mat_w, &dat_w); - dat_u = u3a_malloc(dat_w); - _cqea_encode_ads(ads, mat_w, dat_u); - } - - txt_y = u3r_bytes_all(&txt_w, txt); - out_y = u3a_malloc(txt_w); - - ret = ( 0 != (*low_f)(txt_y, txt_w, dat_u, soc_w, key_y, iv_y, out_y) ) - ? u3_none - : u3nt(u3i_bytes(16, iv_y), - u3i_words(1, &txt_w), - u3i_bytes(txt_w, out_y)); - - u3a_free(txt_y); - u3a_free(out_y); - if ( ads_t ) { - u3a_free(dat_u); - } - - return ret; - } - - static u3_noun - _cqea_siva_en(u3_atom key, - u3_noun ads, - u3_atom txt) - { - if ( u3r_met(3, key) > 32 ) { - // hoon doesn't explicitly check size, but we need 32. - return u3_none; - } - else { - c3_y key_y[32]; - u3r_bytes(0, 32, key_y, key); - return _cqea_siv_en(key_y, 32, ads, txt, &urcrypt_aes_siva_en); - } - } - +// REMOVE ONCE WORKING static void u3r_bytes_reverse(c3_w a_w, c3_w b_w, c3_y* c_y, /* out */ @@ -276,6 +152,180 @@ static u3_noun _siv_de(c3_y* key_y, return u3nc(0, rev_msg); } + +// END REMOVE + +typedef int (*urcrypt_siv)(c3_y*, size_t, + urcrypt_aes_siv_data*, size_t, + c3_y*, c3_y[16], c3_y*); + +/* functions +*/ +// soc_w = number of items +// mat_w = size in bytes of assoc array +// dat_w = size of allocation (array + atom storage) +static void +_cqea_measure_ads(u3_noun ads, c3_w* soc_w, c3_w *mat_w, c3_w *dat_w) +{ + u3_noun i, t; + c3_w a_w, b_w, tmp_w, met_w; + + for ( a_w = b_w = 0, t = ads; u3_nul != t; ++a_w ) { + u3x_cell(t, &i, &t); + if ( c3n == u3ud(i) ) { + u3m_bail(c3__exit); + return; + } + else { + tmp_w = b_w; + b_w += u3r_met(3, i); + if ( b_w < tmp_w ) { + u3m_bail(c3__fail); + return; + } + } + } + + // check for size overflows + tmp_w = a_w * sizeof(urcrypt_aes_siv_data); + if ( (tmp_w / a_w) != sizeof(urcrypt_aes_siv_data) ) { + u3m_bail(c3__fail); + } + else if ( (*dat_w = tmp_w + b_w) < tmp_w ) { + u3m_bail(c3__fail); + } + else { + *soc_w = a_w; + *mat_w = tmp_w; + } +} + +// assumes ads is a valid (list @) because it's already been measured +static void +_cqea_encode_ads(u3_noun ads, + c3_w mat_w, + urcrypt_aes_siv_data *dat_u) +{ + c3_w met_w; + u3_noun i, t; + urcrypt_aes_siv_data *cur_u; + c3_y *dat_y = ((c3_y*) dat_u) + mat_w; + + for ( cur_u = dat_u, t = ads; u3_nul != t; t = u3t(t), ++cur_u ) { + i = u3h(t); + met_w = u3r_met(3, i); + u3r_bytes(0, met_w, dat_y, i); + cur_u->length = met_w; + cur_u->bytes = dat_y; + dat_y += met_w; + } +} + +static void +_cqea_ads_free(urcrypt_aes_siv_data *dat_u) +{ + if ( NULL != dat_u ) { + u3a_free(dat_u); + } +} + +static urcrypt_aes_siv_data* +_cqea_ads_alloc(u3_noun ads, c3_w *soc_w) +{ + if ( !ads ) { + *soc_w = 0; + return NULL; + } + else { + c3_w mat_w, dat_w; + urcrypt_aes_siv_data *dat_u; + + _cqea_measure_ads(ads, soc_w, &mat_w, &dat_w); + dat_u = u3a_malloc(dat_w); + _cqea_encode_ads(ads, mat_w, dat_u); + return dat_u; + } +} + +static u3_noun +_cqea_siv_en(c3_y* key_y, + c3_w key_w, + u3_noun ads, + u3_atom txt, + urcrypt_siv low_f) +{ + u3_noun ret; + c3_w txt_w, soc_w; + c3_y *txt_y, *out_y, iv_y[16]; + urcrypt_aes_siv_data *dat_u; + + dat_u = _cqea_ads_alloc(ads, &soc_w); + txt_y = u3r_bytes_all(&txt_w, txt); + out_y = u3a_malloc(txt_w); + + ret = ( 0 != (*low_f)(txt_y, txt_w, dat_u, soc_w, key_y, iv_y, out_y) ) + ? u3_none + : u3nt(u3i_bytes(16, iv_y), + u3i_words(1, &txt_w), + u3i_bytes(txt_w, out_y)); + + u3a_free(txt_y); + u3a_free(out_y); + _cqea_ads_free(dat_u); + return ret; +} + +static u3_noun +_cqea_siv_de(c3_y* key_y, + c3_w key_w, + u3_noun ads, + u3_atom iv, + u3_atom len, + u3_atom txt, + urcrypt_siv low_f) +{ + c3_w txt_w; + if ( !u3r_word_fit(&txt_w, len) ) { + return u3m_bail(c3__fail); + } + else { + u3_noun ret; + c3_w soc_w; + c3_y *txt_y, *out_y, iv_y[16]; + urcrypt_aes_siv_data *dat_u; + + dat_u = _cqea_ads_alloc(ads, &soc_w); + txt_y = u3r_bytes_alloc(0, txt_w, txt); + out_y = u3a_malloc(txt_w); + + ret = ( 0 != (*low_f)(txt_y, txt_w, dat_u, soc_w, key_y, iv_y, out_y) ) + ? u3_none + : u3nc(0, u3i_bytes(txt_w, out_y)); + + u3a_free(txt_y); + u3a_free(out_y); + _cqea_ads_free(dat_u); + + return ret; + } +} + +static u3_noun +_cqea_siva_en(u3_atom key, + u3_noun ads, + u3_atom txt) +{ + if ( u3r_met(3, key) > 32 ) { + // hoon doesn't explicitly check size, but we need 32. + return u3_none; + } + else { + c3_y key_y[32]; + u3r_bytes(0, 32, key_y, key); + return _cqea_siv_en(key_y, 32, ads, txt, &urcrypt_aes_siva_en); + } +} + u3_noun u3wea_siva_en(u3_noun cor) { @@ -292,20 +342,21 @@ u3wea_siva_en(u3_noun cor) } } -u3_noun -u3qea_siva_de(u3_atom key, +static u3_noun +_cqea_siva_de(u3_atom key, u3_noun ads, u3_atom iv, u3_atom len, u3_atom txt) { - c3_y key_y[32]; - if (u3r_met(3, key) > 32) { + if ( u3r_met(3, key) > 32 ) { return u3_none; } - - u3r_bytes_reverse(0, 32, key_y, key); - return _siv_de(key_y, 32, ads, iv, len, txt); + else { + c3_y key_y[32]; + u3r_bytes(0, 32, key_y, key); + return _cqea_siv_de(key_y, 32, ads, iv, len, txt, &urcrypt_aes_siva_de); + } } u3_noun @@ -323,7 +374,7 @@ u3wea_siva_de(u3_noun cor) c3n == u3ud(txt) ) { return u3m_bail(c3__exit); } else { - return u3qea_siva_de(key, ads, iv, len, txt); + return _cqea_siva_de(key, ads, iv, len, txt); } } diff --git a/pkg/urcrypt/urcrypt.c b/pkg/urcrypt/urcrypt.c index da21b1b74..896d5dde3 100644 --- a/pkg/urcrypt/urcrypt.c +++ b/pkg/urcrypt/urcrypt.c @@ -528,6 +528,41 @@ urcrypt_aes_cbcc_de(uint8_t **message_ptr, } } +static AES_SIV_CTX* +_urcrypt_aes_siv_init(uint8_t *key, + size_t key_length, + urcrypt_aes_siv_data *data, + size_t data_length) +{ + AES_SIV_CTX *ctx = AES_SIV_CTX_new(); + if ( NULL == ctx ) { + return NULL; + } + else { + _urcrypt_reverse(key_length, key); + if ( 0 == AES_SIV_Init(ctx, key, key_length) ) { + AES_SIV_CTX_free(ctx); + return NULL; + } + else { + size_t i, len; + uint8_t *dat; + + for ( i = 0; i < data_length; ++i ) { + len = data[i].length; + dat = data[i].bytes; + _urcrypt_reverse(len, dat); + if ( 0 == AES_SIV_AssociateData(ctx, dat, len) ) { + AES_SIV_CTX_free(ctx); + return NULL; + } + } + + return ctx; + } + } +} + static int _urcrypt_aes_siv_en(uint8_t *key, size_t key_length, @@ -538,44 +573,58 @@ _urcrypt_aes_siv_en(uint8_t *key, uint8_t iv[16], uint8_t *out) { - AES_SIV_CTX *ctx = AES_SIV_CTX_new(); + AES_SIV_CTX *ctx = _urcrypt_aes_siv_init(key, key_length, data, data_length); if ( NULL == ctx ) { return -1; } else { - int code; - _urcrypt_reverse(key_length, key); - if ( 0 == AES_SIV_Init(ctx, key, key_length) ) { - code = -2; + int ret; + _urcrypt_reverse(message_length, message); + ret = AES_SIV_EncryptFinal(ctx, iv, out, message, message_length); + AES_SIV_CTX_free(ctx); + + if ( 0 == ret ) { + return -2; } else { - uint8_t *bytes; - size_t i, blen; - - for ( i = 0; i < data_length; ++i ) { - blen = data[i].length; - bytes = data[i].bytes; - _urcrypt_reverse(blen, bytes); - if ( 0 == AES_SIV_AssociateData(ctx, bytes, blen) ) { - code = -3; - goto finish; - } - } - - _urcrypt_reverse(message_length, message); - if ( 0 == AES_SIV_EncryptFinal(ctx, iv, out, message, message_length) ) { - code = -4; - } - else { - _urcrypt_reverse(16, iv); - _urcrypt_reverse(message_length, out); - code = 0; - } + _urcrypt_reverse(16, iv); + _urcrypt_reverse(message_length, out); + return 0; } -finish: + } +} + +int +_urcrypt_aes_siv_de(uint8_t *message, + size_t message_length, + uint8_t *key, + size_t key_length, + urcrypt_aes_siv_data *data, + size_t data_length, + uint8_t iv[16], + uint8_t *out) +{ + AES_SIV_CTX *ctx = _urcrypt_aes_siv_init(key, key_length, data, data_length); + + if ( NULL == ctx ) { + return -1; + } + else { + int ret; + + _urcrypt_reverse(message_length, message); + _urcrypt_reverse(16, iv); + ret = AES_SIV_DecryptFinal(ctx, out, iv, message, message_length); AES_SIV_CTX_free(ctx); - return code; + + if ( 0 == ret ) { + return -2; + } + else { + _urcrypt_reverse(message_length, out); + return 0; + } } } @@ -588,7 +637,21 @@ urcrypt_aes_siva_en(uint8_t *message, uint8_t iv[16], uint8_t *out) { - return _urcrypt_aes_siv_en(key, 32, message, message_length, data, data_length, iv, out); + return _urcrypt_aes_siv_en(key, 32, + message, message_length, data, data_length, iv, out); +} + +int +urcrypt_aes_siva_de(uint8_t *message, + size_t message_length, + urcrypt_aes_siv_data *data, + size_t data_length, + uint8_t key[32], + uint8_t iv[16], + uint8_t *out) +{ + return _urcrypt_aes_siv_de(key, 32, + message, message_length, data, data_length, iv, out); } int diff --git a/pkg/urcrypt/urcrypt.h b/pkg/urcrypt/urcrypt.h index e5d4906d6..9d210ad29 100644 --- a/pkg/urcrypt/urcrypt.h +++ b/pkg/urcrypt/urcrypt.h @@ -112,6 +112,13 @@ int urcrypt_aes_siva_en(uint8_t *message, uint8_t key[32], uint8_t iv[16], uint8_t *out); +int urcrypt_aes_siva_de(uint8_t *message, + size_t message_length, + urcrypt_aes_siv_data *data, + size_t data_length, + uint8_t key[32], + uint8_t iv[16], + uint8_t *out); int urcrypt_ripemd160(uint8_t *message, size_t length, uint8_t out[20]); From fd0eaad162caefa3b5ccbaff8ed13521574c49b8 Mon Sep 17 00:00:00 2001 From: Paul Driver Date: Tue, 25 Aug 2020 15:04:21 -0700 Subject: [PATCH 041/329] aes-siv jets all using urcrypt --- pkg/urbit/jets/e/aes_siv.c | 237 ++++++++----------------------------- pkg/urcrypt/urcrypt.c | 71 ++++++++++- pkg/urcrypt/urcrypt.h | 28 +++++ 3 files changed, 145 insertions(+), 191 deletions(-) diff --git a/pkg/urbit/jets/e/aes_siv.c b/pkg/urbit/jets/e/aes_siv.c index f4b2c796d..97b05414e 100644 --- a/pkg/urbit/jets/e/aes_siv.c +++ b/pkg/urbit/jets/e/aes_siv.c @@ -4,163 +4,13 @@ #include "all.h" #include -#include "aes_siv.h" - -// REMOVE ONCE WORKING -static void u3r_bytes_reverse(c3_w a_w, - c3_w b_w, - c3_y* c_y, /* out */ - u3_atom d) /* in */ -{ - u3r_bytes(a_w, b_w, c_y, d); - c3_w i_w; - for (i_w = 0; i_w < ((b_w - a_w) / 2) ; i_w++) { - c3_y lo = c_y[i_w]; - c3_y hi = c_y[b_w - i_w - 1]; - c_y[i_w] = hi; - c_y[b_w - i_w - 1] = lo; - } - - return; -} - -static u3_noun _siv_en(c3_y* key_y, - c3_w keysize, - u3_noun ads, - u3_atom txt) -{ - AES_SIV_CTX* ctx = AES_SIV_CTX_new(); - if ( 0 == ctx ) { - return u3_none; - } - - if ( 0 == AES_SIV_Init(ctx, key_y, keysize) ) { - AES_SIV_CTX_free(ctx); - return u3_none; - } - - while (u3_nul != ads) { - c3_w ad_w = u3r_met(3, u3h(ads)); - c3_y* ad_y = u3a_malloc(ad_w); - u3r_bytes_reverse(0, ad_w, ad_y, u3h(ads)); - - c3_w ret = AES_SIV_AssociateData(ctx, ad_y, ad_w); - u3a_free(ad_y); - - if ( 0 == ret ) { - AES_SIV_CTX_free(ctx); - return u3_none; - } - - ads = u3t(ads); - } - - c3_w txt_w = u3r_met(3, txt); - c3_y* txt_y = u3a_malloc(txt_w); - u3r_bytes_reverse(0, txt_w, txt_y, txt); - - const c3_w iv_w = 16; - c3_y iv_y[iv_w]; - c3_y* out_y = u3a_malloc(txt_w); - if ( 0 == AES_SIV_EncryptFinal(ctx, iv_y, out_y, txt_y, txt_w) ) { - u3a_free(out_y); - u3a_free(txt_y); - AES_SIV_CTX_free(ctx); - return u3_none; - } - - u3a_free(txt_y); - AES_SIV_CTX_free(ctx); - - // Read the first 16 bytes as the "iv" - u3_noun iv = u3i_bytes(16, iv_y); - u3_noun msg = u3i_bytes(txt_w, out_y); - - // Reverse byte order for output - u3_noun rev_iv = u3kc_rev(3, iv_w, iv); - u3_noun rev_msg = u3kc_rev(3, txt_w, msg); - - u3a_free(out_y); - - return u3nt(rev_iv, u3i_words(1, &txt_w), rev_msg); -} - -static u3_noun _siv_de(c3_y* key_y, - c3_w keysize, - u3_noun ads, - u3_atom iv, - u3_atom len, - u3_atom txt) -{ - AES_SIV_CTX* ctx = AES_SIV_CTX_new(); - if ( 0 == ctx ) { - return u3_none; - } - - if ( 0 == AES_SIV_Init(ctx, key_y, keysize) ) { - AES_SIV_CTX_free(ctx); - return u3_none; - } - - while (u3_nul != ads) { - c3_w ad_w = u3r_met(3, u3h(ads)); - c3_y* ad_y = u3a_malloc(ad_w); - u3r_bytes_reverse(0, ad_w, ad_y, u3h(ads)); - - c3_w ret = AES_SIV_AssociateData(ctx, ad_y, ad_w); - u3a_free(ad_y); - - if ( 0 == ret ) { - AES_SIV_CTX_free(ctx); - return u3_none; - } - - ads = u3t(ads); - } - - c3_w txt_w = u3r_word(0, len); - c3_y* txt_y = u3a_malloc(txt_w); - u3r_bytes_reverse(0, txt_w, txt_y, txt); - - const c3_w iv_w = 16; - c3_y iv_y[iv_w]; - u3r_bytes_reverse(0, 16, iv_y, iv); - - c3_y* out_y = u3a_malloc(txt_w); - if ( 0 == AES_SIV_DecryptFinal(ctx, out_y, iv_y, txt_y, txt_w) ) { - u3a_free(out_y); - u3a_free(txt_y); - AES_SIV_CTX_free(ctx); - - // Either decryption failed or signature bad or there was a memory - // error. Some of these are deterministic and some are not. return u3_none - // to fallback to the Nock implementation. - return u3_none; - } - - u3a_free(txt_y); - AES_SIV_CTX_free(ctx); - - // Read the first 16 bytes as the "iv" - u3_noun msg = u3i_bytes(txt_w, out_y); - - // Reverse byte order for output - u3_noun rev_msg = u3kc_rev(3, txt_w, msg); - - u3a_free(out_y); - - return u3nc(0, rev_msg); -} - - -// END REMOVE - typedef int (*urcrypt_siv)(c3_y*, size_t, urcrypt_aes_siv_data*, size_t, c3_y*, c3_y[16], c3_y*); /* functions */ + // soc_w = number of items // mat_w = size in bytes of assoc array // dat_w = size of allocation (array + atom storage) @@ -294,6 +144,7 @@ _cqea_siv_de(c3_y* key_y, c3_y *txt_y, *out_y, iv_y[16]; urcrypt_aes_siv_data *dat_u; + u3r_bytes(0, 16, iv_y, iv); dat_u = _cqea_ads_alloc(ads, &soc_w); txt_y = u3r_bytes_alloc(0, txt_w, txt); out_y = u3a_malloc(txt_w); @@ -310,13 +161,17 @@ _cqea_siv_de(c3_y* key_y, } } +// the siv* hoon doesn't explicitly check keysizes, but all of these functions +// have fixed maximum keysizes, so we will punt if we get a key that is too +// large. + static u3_noun _cqea_siva_en(u3_atom key, u3_noun ads, u3_atom txt) { if ( u3r_met(3, key) > 32 ) { - // hoon doesn't explicitly check size, but we need 32. + u3l_log("%s\r\n", "siva-en-punt"); return u3_none; } else { @@ -350,6 +205,7 @@ _cqea_siva_de(u3_atom key, u3_atom txt) { if ( u3r_met(3, key) > 32 ) { + u3l_log("%s\r\n", "siva-de-punt"); return u3_none; } else { @@ -378,21 +234,23 @@ u3wea_siva_de(u3_noun cor) } } - -u3_noun -u3qea_sivb_en(u3_atom key, +static u3_noun +_cqea_sivb_en(u3_atom key, u3_noun ads, u3_atom txt) { - c3_y key_y[48]; - if (u3r_met(3, key) > 48) { + if ( u3r_met(3, key) > 48 ) { + u3l_log("%s\r\n", "sivb-en-punt"); return u3_none; } - - u3r_bytes_reverse(0, 48, key_y, key); - return _siv_en(key_y, 48, ads, txt); + else { + c3_y key_y[48]; + u3r_bytes(0, 48, key_y, key); + return _cqea_siv_en(key_y, 48, ads, txt, &urcrypt_aes_sivb_en); + } } + u3_noun u3wea_sivb_en(u3_noun cor) { @@ -405,24 +263,26 @@ u3wea_sivb_en(u3_noun cor) c3n == u3ud(txt) ) { return u3m_bail(c3__exit); } else { - return u3qea_sivb_en(key, ads, txt); + return _cqea_sivb_en(key, ads, txt); } } -u3_noun -u3qea_sivb_de(u3_atom key, +static u3_noun +_cqea_sivb_de(u3_atom key, u3_noun ads, u3_atom iv, u3_atom len, u3_atom txt) { - c3_y key_y[48]; - if (u3r_met(3, key) > 48) { + if ( u3r_met(3, key) > 48 ) { + u3l_log("%s\r\n", "sivb-de-punt"); return u3_none; } - - u3r_bytes_reverse(0, 48, key_y, key); - return _siv_de(key_y, 48, ads, iv, len, txt); + else { + c3_y key_y[48]; + u3r_bytes(0, 48, key_y, key); + return _cqea_siv_de(key_y, 48, ads, iv, len, txt, &urcrypt_aes_sivb_de); + } } u3_noun @@ -440,24 +300,24 @@ u3wea_sivb_de(u3_noun cor) c3n == u3ud(txt) ) { return u3m_bail(c3__exit); } else { - return u3qea_sivb_de(key, ads, iv, len, txt); + return _cqea_sivb_de(key, ads, iv, len, txt); } } - - -u3_noun -u3qea_sivc_en(u3_atom key, +static u3_noun +_cqea_sivc_en(u3_atom key, u3_noun ads, u3_atom txt) { - c3_y key_y[64]; - if (u3r_met(3, key) > 64) { + if ( u3r_met(3, key) > 64 ) { + u3l_log("%s\r\n", "sivc-en-punt"); return u3_none; } - - u3r_bytes_reverse(0, 64, key_y, key); - return _siv_en(key_y, 64, ads, txt); + else { + c3_y key_y[64]; + u3r_bytes(0, 64, key_y, key); + return _cqea_siv_en(key_y, 64, ads, txt, &urcrypt_aes_sivc_en); + } } u3_noun @@ -472,25 +332,26 @@ u3wea_sivc_en(u3_noun cor) c3n == u3ud(txt) ) { return u3m_bail(c3__exit); } else { - return u3qea_sivc_en(key, ads, txt); + return _cqea_sivc_en(key, ads, txt); } } - -u3_noun -u3qea_sivc_de(u3_atom key, +static u3_noun +_cqea_sivc_de(u3_atom key, u3_noun ads, u3_atom iv, u3_atom len, u3_atom txt) { - c3_y key_y[64]; - if (u3r_met(3, key) > 64) { + if ( u3r_met(3, key) > 64 ) { + u3l_log("%s\r\n", "sivc-de-punt"); return u3_none; } - - u3r_bytes_reverse(0, 64, key_y, key); - return _siv_de(key_y, 64, ads, iv, len, txt); + else { + c3_y key_y[64]; + u3r_bytes(0, 64, key_y, key); + return _cqea_siv_de(key_y, 64, ads, iv, len, txt, &urcrypt_aes_sivc_de); + } } u3_noun @@ -508,6 +369,6 @@ u3wea_sivc_de(u3_noun cor) c3n == u3ud(txt) ) { return u3m_bail(c3__exit); } else { - return u3qea_sivc_de(key, ads, iv, len, txt); + return _cqea_sivc_de(key, ads, iv, len, txt); } } diff --git a/pkg/urcrypt/urcrypt.c b/pkg/urcrypt/urcrypt.c index 896d5dde3..dba322396 100644 --- a/pkg/urcrypt/urcrypt.c +++ b/pkg/urcrypt/urcrypt.c @@ -528,6 +528,19 @@ urcrypt_aes_cbcc_de(uint8_t **message_ptr, } } +/* FIXME TODO remove +#include +void dbg(const char* fmt, ...) +{ + va_list ap; + FILE *nukes = fopen("/tmp/urcrypt.txt", "a"); + va_start(ap, fmt); + vfprintf(nukes, fmt, ap); + va_end(ap); + fclose(nukes); +} +*/ + static AES_SIV_CTX* _urcrypt_aes_siv_init(uint8_t *key, size_t key_length, @@ -596,10 +609,10 @@ _urcrypt_aes_siv_en(uint8_t *key, } int -_urcrypt_aes_siv_de(uint8_t *message, - size_t message_length, - uint8_t *key, +_urcrypt_aes_siv_de(uint8_t *key, size_t key_length, + uint8_t *message, + size_t message_length, urcrypt_aes_siv_data *data, size_t data_length, uint8_t iv[16], @@ -654,6 +667,58 @@ urcrypt_aes_siva_de(uint8_t *message, message, message_length, data, data_length, iv, out); } +int +urcrypt_aes_sivb_en(uint8_t *message, + size_t message_length, + urcrypt_aes_siv_data *data, + size_t data_length, + uint8_t key[48], + uint8_t iv[16], + uint8_t *out) +{ + return _urcrypt_aes_siv_en(key, 48, + message, message_length, data, data_length, iv, out); +} + +int +urcrypt_aes_sivb_de(uint8_t *message, + size_t message_length, + urcrypt_aes_siv_data *data, + size_t data_length, + uint8_t key[48], + uint8_t iv[16], + uint8_t *out) +{ + return _urcrypt_aes_siv_de(key, 48, + message, message_length, data, data_length, iv, out); +} + +int +urcrypt_aes_sivc_en(uint8_t *message, + size_t message_length, + urcrypt_aes_siv_data *data, + size_t data_length, + uint8_t key[64], + uint8_t iv[16], + uint8_t *out) +{ + return _urcrypt_aes_siv_en(key, 64, + message, message_length, data, data_length, iv, out); +} + +int +urcrypt_aes_sivc_de(uint8_t *message, + size_t message_length, + urcrypt_aes_siv_data *data, + size_t data_length, + uint8_t key[64], + uint8_t iv[16], + uint8_t *out) +{ + return _urcrypt_aes_siv_de(key, 64, + message, message_length, data, data_length, iv, out); +} + int urcrypt_ripemd160(uint8_t *message, size_t length, uint8_t out[20]) { diff --git a/pkg/urcrypt/urcrypt.h b/pkg/urcrypt/urcrypt.h index 9d210ad29..00e4e615f 100644 --- a/pkg/urcrypt/urcrypt.h +++ b/pkg/urcrypt/urcrypt.h @@ -119,6 +119,34 @@ int urcrypt_aes_siva_de(uint8_t *message, uint8_t key[32], uint8_t iv[16], uint8_t *out); +int urcrypt_aes_sivb_en(uint8_t *message, + size_t message_length, + urcrypt_aes_siv_data *data, + size_t data_length, + uint8_t key[32], + uint8_t iv[16], + uint8_t *out); +int urcrypt_aes_sivb_de(uint8_t *message, + size_t message_length, + urcrypt_aes_siv_data *data, + size_t data_length, + uint8_t key[48], + uint8_t iv[16], + uint8_t *out); +int urcrypt_aes_sivc_en(uint8_t *message, + size_t message_length, + urcrypt_aes_siv_data *data, + size_t data_length, + uint8_t key[64], + uint8_t iv[16], + uint8_t *out); +int urcrypt_aes_sivc_de(uint8_t *message, + size_t message_length, + urcrypt_aes_siv_data *data, + size_t data_length, + uint8_t key[64], + uint8_t iv[16], + uint8_t *out); int urcrypt_ripemd160(uint8_t *message, size_t length, uint8_t out[20]); From 367db569542125bb6ad47e4c73bda86938463fd5 Mon Sep 17 00:00:00 2001 From: Paul Driver Date: Tue, 25 Aug 2020 15:18:43 -0700 Subject: [PATCH 042/329] add punt logging for aes-siv --- pkg/urbit/jets/e/aes_siv.c | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/pkg/urbit/jets/e/aes_siv.c b/pkg/urbit/jets/e/aes_siv.c index 97b05414e..326c2311b 100644 --- a/pkg/urbit/jets/e/aes_siv.c +++ b/pkg/urbit/jets/e/aes_siv.c @@ -161,6 +161,15 @@ _cqea_siv_de(c3_y* key_y, } } +static u3_noun +_cqea_siv_punt(c3_y* nam_y, u3_noun val) +{ + if ( u3_none == val ) { + u3l_log("%s-punt\r\n", nam_y); + } + return val; +} + // the siv* hoon doesn't explicitly check keysizes, but all of these functions // have fixed maximum keysizes, so we will punt if we get a key that is too // large. @@ -171,7 +180,6 @@ _cqea_siva_en(u3_atom key, u3_atom txt) { if ( u3r_met(3, key) > 32 ) { - u3l_log("%s\r\n", "siva-en-punt"); return u3_none; } else { @@ -193,7 +201,7 @@ u3wea_siva_en(u3_noun cor) c3n == u3ud(txt) ) { return u3m_bail(c3__exit); } else { - return _cqea_siva_en(key, ads, txt); + return _cqea_siv_punt("siva-en", _cqea_siva_en(key, ads, txt)); } } @@ -205,7 +213,6 @@ _cqea_siva_de(u3_atom key, u3_atom txt) { if ( u3r_met(3, key) > 32 ) { - u3l_log("%s\r\n", "siva-de-punt"); return u3_none; } else { @@ -230,7 +237,7 @@ u3wea_siva_de(u3_noun cor) c3n == u3ud(txt) ) { return u3m_bail(c3__exit); } else { - return _cqea_siva_de(key, ads, iv, len, txt); + return _cqea_siv_punt("siva-de", _cqea_siva_de(key, ads, iv, len, txt)); } } @@ -240,7 +247,6 @@ _cqea_sivb_en(u3_atom key, u3_atom txt) { if ( u3r_met(3, key) > 48 ) { - u3l_log("%s\r\n", "sivb-en-punt"); return u3_none; } else { @@ -263,7 +269,7 @@ u3wea_sivb_en(u3_noun cor) c3n == u3ud(txt) ) { return u3m_bail(c3__exit); } else { - return _cqea_sivb_en(key, ads, txt); + return _cqea_siv_punt("sivb-en", _cqea_sivb_en(key, ads, txt)); } } @@ -275,7 +281,6 @@ _cqea_sivb_de(u3_atom key, u3_atom txt) { if ( u3r_met(3, key) > 48 ) { - u3l_log("%s\r\n", "sivb-de-punt"); return u3_none; } else { @@ -300,7 +305,7 @@ u3wea_sivb_de(u3_noun cor) c3n == u3ud(txt) ) { return u3m_bail(c3__exit); } else { - return _cqea_sivb_de(key, ads, iv, len, txt); + return _cqea_siv_punt("sivb-de", _cqea_sivb_de(key, ads, iv, len, txt)); } } @@ -310,7 +315,6 @@ _cqea_sivc_en(u3_atom key, u3_atom txt) { if ( u3r_met(3, key) > 64 ) { - u3l_log("%s\r\n", "sivc-en-punt"); return u3_none; } else { @@ -332,7 +336,7 @@ u3wea_sivc_en(u3_noun cor) c3n == u3ud(txt) ) { return u3m_bail(c3__exit); } else { - return _cqea_sivc_en(key, ads, txt); + return _cqea_siv_punt("sivc-en", _cqea_sivc_en(key, ads, txt)); } } @@ -344,7 +348,6 @@ _cqea_sivc_de(u3_atom key, u3_atom txt) { if ( u3r_met(3, key) > 64 ) { - u3l_log("%s\r\n", "sivc-de-punt"); return u3_none; } else { @@ -369,6 +372,6 @@ u3wea_sivc_de(u3_noun cor) c3n == u3ud(txt) ) { return u3m_bail(c3__exit); } else { - return _cqea_sivc_de(key, ads, iv, len, txt); + return _cqea_siv_punt("sivc-de", _cqea_sivc_de(key, ads, iv, len, txt)); } } From 9f251af61d2f90bed92b6d4e0f8d9b316b783f26 Mon Sep 17 00:00:00 2001 From: Paul Driver Date: Wed, 26 Aug 2020 10:51:42 -0700 Subject: [PATCH 043/329] normalize punt logging with u3l_punt --- pkg/urbit/include/noun/log.h | 12 ++++++++++- pkg/urbit/jets/e/aes_cbc.c | 12 +++++------ pkg/urbit/jets/e/aes_ecb.c | 12 +++++------ pkg/urbit/jets/e/aes_siv.c | 21 ++++++------------- pkg/urbit/jets/e/argon2.c | 12 +++++------ pkg/urbit/jets/e/blake.c | 3 +-- pkg/urbit/jets/e/ed_add_double_scalarmult.c | 3 ++- .../e/ed_add_scalarmult_scalarmult_base.c | 3 ++- pkg/urbit/jets/e/ed_point_add.c | 2 +- pkg/urbit/jets/e/ed_scalarmult.c | 2 +- pkg/urbit/jets/e/ed_scalarmult_base.c | 2 +- pkg/urbit/jets/e/ed_shar.c | 2 +- pkg/urbit/jets/e/ed_veri.c | 2 +- pkg/urbit/jets/e/ripe.c | 13 +++++------- pkg/urbit/noun/log.c | 9 ++++++++ 15 files changed, 59 insertions(+), 51 deletions(-) diff --git a/pkg/urbit/include/noun/log.h b/pkg/urbit/include/noun/log.h index 204cb8505..07ab2296c 100644 --- a/pkg/urbit/include/noun/log.h +++ b/pkg/urbit/include/noun/log.h @@ -2,8 +2,18 @@ ** */ -/* u3_log(): logs to stderr or redirects to configured function. +/* u3l_log(): logs to stderr or redirects to configured function. */ void u3l_log(const char* format, ...) __attribute__ ((format (printf, 1, 2))); + +/* u3l_punt(): condtionally logs a named punt + * (e.g. "mint-punt" for the `name` "mint") + * when `pro` is u3_none, and returns pro. + * For use when a jet driver declines to handle + * a core, when the user should be somehow notified + * (e.g. in a cryptographic jet). + */ + u3_weak + u3l_punt(const char* name, u3_weak pro); diff --git a/pkg/urbit/jets/e/aes_cbc.c b/pkg/urbit/jets/e/aes_cbc.c index 793304ad4..b561efa44 100644 --- a/pkg/urbit/jets/e/aes_cbc.c +++ b/pkg/urbit/jets/e/aes_cbc.c @@ -57,7 +57,7 @@ typedef int (*urcrypt_cbc)(c3_y**, c3n == u3ud(b) ) { return u3m_bail(c3__exit); } else { - return _cqea_cbca_en(a, b, c); + return u3l_punt("cbca-en", _cqea_cbca_en(a, b, c)); } } @@ -81,7 +81,7 @@ typedef int (*urcrypt_cbc)(c3_y**, c3n == u3ud(b) ) { return u3m_bail(c3__exit); } else { - return _cqea_cbca_de(a, b, c); + return u3l_punt("cbca-de", _cqea_cbca_de(a, b, c)); } } @@ -105,7 +105,7 @@ typedef int (*urcrypt_cbc)(c3_y**, c3n == u3ud(b) ) { return u3m_bail(c3__exit); } else { - return _cqea_cbcb_en(a, b, c); + return u3l_punt("cbcb-en", _cqea_cbcb_en(a, b, c)); } } @@ -129,7 +129,7 @@ typedef int (*urcrypt_cbc)(c3_y**, c3n == u3ud(b) ) { return u3m_bail(c3__exit); } else { - return _cqea_cbcb_de(a, b, c); + return u3l_punt("cbcb-de", _cqea_cbcb_de(a, b, c)); } } @@ -153,7 +153,7 @@ typedef int (*urcrypt_cbc)(c3_y**, c3n == u3ud(b) ) { return u3m_bail(c3__exit); } else { - return _cqea_cbcc_en(a, b, c); + return u3l_punt("cbcc-en", _cqea_cbcc_en(a, b, c)); } } @@ -177,6 +177,6 @@ typedef int (*urcrypt_cbc)(c3_y**, c3n == u3ud(b) ) { return u3m_bail(c3__exit); } else { - return _cqea_cbcc_de(a, b, c); + return u3l_punt("cbcc-de", _cqea_cbcc_de(a, b, c)); } } diff --git a/pkg/urbit/jets/e/aes_ecb.c b/pkg/urbit/jets/e/aes_ecb.c index 9ea9c59ed..d350bc808 100644 --- a/pkg/urbit/jets/e/aes_ecb.c +++ b/pkg/urbit/jets/e/aes_ecb.c @@ -46,7 +46,7 @@ typedef int (*urcrypt_ecb)(c3_y*, c3_y[16], c3_y[16]); c3n == u3ud(b) ) { return u3m_bail(c3__exit); } else { - return _cqea_ecba_en(a, b); + return u3l_punt("ecba-en", _cqea_ecba_en(a, b)); } } @@ -69,7 +69,7 @@ typedef int (*urcrypt_ecb)(c3_y*, c3_y[16], c3_y[16]); c3n == u3ud(b) ) { return u3m_bail(c3__exit); } else { - return _cqea_ecba_de(a, b); + return u3l_punt("ecba-de", _cqea_ecba_de(a, b)); } } @@ -92,7 +92,7 @@ typedef int (*urcrypt_ecb)(c3_y*, c3_y[16], c3_y[16]); c3n == u3ud(b) ) { return u3m_bail(c3__exit); } else { - return _cqea_ecbb_en(a, b); + return u3l_punt("ecbb-en", _cqea_ecbb_en(a, b)); } } @@ -115,7 +115,7 @@ typedef int (*urcrypt_ecb)(c3_y*, c3_y[16], c3_y[16]); c3n == u3ud(b) ) { return u3m_bail(c3__exit); } else { - return _cqea_ecbb_de(a, b); + return u3l_punt("ecbb-de", _cqea_ecbb_de(a, b)); } } @@ -138,7 +138,7 @@ typedef int (*urcrypt_ecb)(c3_y*, c3_y[16], c3_y[16]); c3n == u3ud(b) ) { return u3m_bail(c3__exit); } else { - return _cqea_ecbc_en(a, b); + return u3l_punt("ecbc-en", _cqea_ecbc_en(a, b)); } } @@ -161,6 +161,6 @@ typedef int (*urcrypt_ecb)(c3_y*, c3_y[16], c3_y[16]); c3n == u3ud(b) ) { return u3m_bail(c3__exit); } else { - return _cqea_ecbc_de(a, b); + return u3l_punt("ecbc-de", _cqea_ecbc_de(a, b)); } } diff --git a/pkg/urbit/jets/e/aes_siv.c b/pkg/urbit/jets/e/aes_siv.c index 326c2311b..a891eb431 100644 --- a/pkg/urbit/jets/e/aes_siv.c +++ b/pkg/urbit/jets/e/aes_siv.c @@ -161,15 +161,6 @@ _cqea_siv_de(c3_y* key_y, } } -static u3_noun -_cqea_siv_punt(c3_y* nam_y, u3_noun val) -{ - if ( u3_none == val ) { - u3l_log("%s-punt\r\n", nam_y); - } - return val; -} - // the siv* hoon doesn't explicitly check keysizes, but all of these functions // have fixed maximum keysizes, so we will punt if we get a key that is too // large. @@ -201,7 +192,7 @@ u3wea_siva_en(u3_noun cor) c3n == u3ud(txt) ) { return u3m_bail(c3__exit); } else { - return _cqea_siv_punt("siva-en", _cqea_siva_en(key, ads, txt)); + return u3l_punt("siva-en", _cqea_siva_en(key, ads, txt)); } } @@ -237,7 +228,7 @@ u3wea_siva_de(u3_noun cor) c3n == u3ud(txt) ) { return u3m_bail(c3__exit); } else { - return _cqea_siv_punt("siva-de", _cqea_siva_de(key, ads, iv, len, txt)); + return u3l_punt("siva-de", _cqea_siva_de(key, ads, iv, len, txt)); } } @@ -269,7 +260,7 @@ u3wea_sivb_en(u3_noun cor) c3n == u3ud(txt) ) { return u3m_bail(c3__exit); } else { - return _cqea_siv_punt("sivb-en", _cqea_sivb_en(key, ads, txt)); + return u3l_punt("sivb-en", _cqea_sivb_en(key, ads, txt)); } } @@ -305,7 +296,7 @@ u3wea_sivb_de(u3_noun cor) c3n == u3ud(txt) ) { return u3m_bail(c3__exit); } else { - return _cqea_siv_punt("sivb-de", _cqea_sivb_de(key, ads, iv, len, txt)); + return u3l_punt("sivb-de", _cqea_sivb_de(key, ads, iv, len, txt)); } } @@ -336,7 +327,7 @@ u3wea_sivc_en(u3_noun cor) c3n == u3ud(txt) ) { return u3m_bail(c3__exit); } else { - return _cqea_siv_punt("sivc-en", _cqea_sivc_en(key, ads, txt)); + return u3l_punt("sivc-en", _cqea_sivc_en(key, ads, txt)); } } @@ -372,6 +363,6 @@ u3wea_sivc_de(u3_noun cor) c3n == u3ud(txt) ) { return u3m_bail(c3__exit); } else { - return _cqea_siv_punt("sivc-de", _cqea_sivc_de(key, ads, iv, len, txt)); + return u3l_punt("sivc-de", _cqea_sivc_de(key, ads, iv, len, txt)); } } diff --git a/pkg/urbit/jets/e/argon2.c b/pkg/urbit/jets/e/argon2.c index b9c9415ac..e2f2e9bf3 100644 --- a/pkg/urbit/jets/e/argon2.c +++ b/pkg/urbit/jets/e/argon2.c @@ -55,7 +55,6 @@ u3r_word_fit(&ted_w, threads) && u3r_word_fit(&mem_w, mem_cost) && u3r_word_fit(&tim_w, time_cost)) ) { - u3l_log("%s\r\n", "argon2-punt"); return u3_none; } else { @@ -86,7 +85,7 @@ } else { ret = u3_none; - u3l_log("argon2-punt: %s\r\n", err_c); + u3l_log("argon2-error: %s\r\n", err_c); } u3a_free(out_y); @@ -130,9 +129,10 @@ return u3m_bail(c3__exit); } else { - return _cqe_argon2(out, type, version, - threads, mem_cost, time_cost, - wik, key, wix, extra, - wid, dat, wis, sat); + return u3l_punt("argon2", + _cqe_argon2(out, type, version, + threads, mem_cost, time_cost, + wik, key, wix, extra, + wid, dat, wis, sat)); } } diff --git a/pkg/urbit/jets/e/blake.c b/pkg/urbit/jets/e/blake.c index eb36ba87d..1770a3f89 100644 --- a/pkg/urbit/jets/e/blake.c +++ b/pkg/urbit/jets/e/blake.c @@ -34,7 +34,6 @@ return u3i_bytes(out_w, out_y); } else { - u3l_log("%s\r\n", "blake2-punt: library error"); return u3_none; } } @@ -56,6 +55,6 @@ { return u3m_bail(c3__exit); } else { - return _cqe_blake(wid, dat, wik, dak, out); + return u3l_punt("blake", _cqe_blake(wid, dat, wik, dak, out)); } } diff --git a/pkg/urbit/jets/e/ed_add_double_scalarmult.c b/pkg/urbit/jets/e/ed_add_double_scalarmult.c index af73d5964..e3f01950d 100644 --- a/pkg/urbit/jets/e/ed_add_double_scalarmult.c +++ b/pkg/urbit/jets/e/ed_add_double_scalarmult.c @@ -41,6 +41,7 @@ { return u3m_bail(c3__exit); } else { - return _cqee_add_double_scalarmult(a, b, c, d); + return u3l_punt("add-double-scalarmult", + _cqee_add_double_scalarmult(a, b, c, d)); } } diff --git a/pkg/urbit/jets/e/ed_add_scalarmult_scalarmult_base.c b/pkg/urbit/jets/e/ed_add_scalarmult_scalarmult_base.c index 2db437aec..26dd69994 100644 --- a/pkg/urbit/jets/e/ed_add_scalarmult_scalarmult_base.c +++ b/pkg/urbit/jets/e/ed_add_scalarmult_scalarmult_base.c @@ -38,6 +38,7 @@ { return u3m_bail(c3__exit); } else { - return _cqee_add_scalarmult_scalarmult_base(a, b, c); + return u3l_punt("add-scalarmult-scalarmult-base", + _cqee_add_scalarmult_scalarmult_base(a, b, c)); } } diff --git a/pkg/urbit/jets/e/ed_point_add.c b/pkg/urbit/jets/e/ed_point_add.c index 2a5da2938..dfa52502e 100644 --- a/pkg/urbit/jets/e/ed_point_add.c +++ b/pkg/urbit/jets/e/ed_point_add.c @@ -35,6 +35,6 @@ { return u3m_bail(c3__exit); } else { - return _cqee_point_add(a, b); + return u3l_punt("point-add", _cqee_point_add(a, b)); } } diff --git a/pkg/urbit/jets/e/ed_scalarmult.c b/pkg/urbit/jets/e/ed_scalarmult.c index 97c88c4f6..136d51af2 100644 --- a/pkg/urbit/jets/e/ed_scalarmult.c +++ b/pkg/urbit/jets/e/ed_scalarmult.c @@ -35,6 +35,6 @@ { return u3m_bail(c3__exit); } else { - return _cqee_scalarmult(a, b); + return u3l_punt("scalarmult", _cqee_scalarmult(a, b)); } } diff --git a/pkg/urbit/jets/e/ed_scalarmult_base.c b/pkg/urbit/jets/e/ed_scalarmult_base.c index 9756e65a5..965ba8b22 100644 --- a/pkg/urbit/jets/e/ed_scalarmult_base.c +++ b/pkg/urbit/jets/e/ed_scalarmult_base.c @@ -30,6 +30,6 @@ return u3m_bail(c3__exit); } else { - return _cqee_scalarmult_base(a); + return u3l_punt("scalarmult-base", _cqee_scalarmult_base(a)); } } diff --git a/pkg/urbit/jets/e/ed_shar.c b/pkg/urbit/jets/e/ed_shar.c index 7db4e6175..e26b0627c 100644 --- a/pkg/urbit/jets/e/ed_shar.c +++ b/pkg/urbit/jets/e/ed_shar.c @@ -35,6 +35,6 @@ { return u3m_bail(c3__exit); } else { - return _cqee_shar(pub, sek); + return u3l_punt("shar", _cqee_shar(pub, sek)); } } diff --git a/pkg/urbit/jets/e/ed_veri.c b/pkg/urbit/jets/e/ed_veri.c index c4a4b6f2d..51ac20c13 100644 --- a/pkg/urbit/jets/e/ed_veri.c +++ b/pkg/urbit/jets/e/ed_veri.c @@ -37,6 +37,6 @@ u3x_sam_7, &c, 0) ) { return u3m_bail(c3__fail); } else { - return _cqee_veri(a, b, c); + return u3l_punt("veri", _cqee_veri(a, b, c)); } } diff --git a/pkg/urbit/jets/e/ripe.c b/pkg/urbit/jets/e/ripe.c index 971a04b2c..457068d47 100644 --- a/pkg/urbit/jets/e/ripe.c +++ b/pkg/urbit/jets/e/ripe.c @@ -18,13 +18,10 @@ c3_y out_y[20]; c3_y *dat_y = u3r_bytes_alloc(0, len_w, dat); - if ( 0 == urcrypt_ripemd160(dat_y, len_w, out_y) ) { - ret = u3i_bytes(20, out_y); - } - else { - u3l_log("%s\r\n", "ripemd160-punt"); - ret = u3_none; - } + ret = ( 0 == urcrypt_ripemd160(dat_y, len_w, out_y) ) + ? u3i_bytes(20, out_y) + : u3_none; + u3a_free(dat_y); return ret; } @@ -43,6 +40,6 @@ return u3m_bail(c3__exit); } else { - return _cqe_ripe(wid, dat); + return u3l_punt("ripe", _cqe_ripe(wid, dat)); } } diff --git a/pkg/urbit/noun/log.c b/pkg/urbit/noun/log.c index 8d58fef29..866a7430e 100644 --- a/pkg/urbit/noun/log.c +++ b/pkg/urbit/noun/log.c @@ -26,3 +26,12 @@ u3l_log(const char* format, ...) va_end(myargs); } + +u3_weak +u3l_punt(const char* name, u3_weak pro) +{ + if ( u3_none == pro ) { + u3l_log("%s-punt\r\n", name); + } + return pro; +} From f5449204e18325c0b448d8f696d313450a15da06 Mon Sep 17 00:00:00 2001 From: Paul Driver Date: Sat, 29 Aug 2020 11:55:58 -0700 Subject: [PATCH 044/329] secp_make->urcrypt --- nix/pkgs/default.nix | 5 +- nix/pkgs/urcrypt/default.nix | 8 ++- pkg/urbit/include/jets/q.h | 1 - pkg/urbit/jets/e/secp.c | 125 +++++++++++++++++++++++------------ pkg/urcrypt/Makefile | 2 +- pkg/urcrypt/urcrypt.c | 24 +++++++ pkg/urcrypt/urcrypt.h | 3 + 7 files changed, 118 insertions(+), 50 deletions(-) diff --git a/nix/pkgs/default.nix b/nix/pkgs/default.nix index 3c6d2019b..7a51f3187 100644 --- a/nix/pkgs/default.nix +++ b/nix/pkgs/default.nix @@ -19,8 +19,9 @@ let }; urcrypt = import ./urcrypt { - inherit pkgs ge-additions libaes_siv; - inherit (deps) ed25519 argon2; + inherit ge-additions libaes_siv; + inherit (pkgs) stdenv openssl gmp; + inherit (deps) ed25519 argon2 secp256k1; }; mkUrbit = { debug }: diff --git a/nix/pkgs/urcrypt/default.nix b/nix/pkgs/urcrypt/default.nix index 4e0cea360..739d05005 100644 --- a/nix/pkgs/urcrypt/default.nix +++ b/nix/pkgs/urcrypt/default.nix @@ -1,9 +1,11 @@ -{ pkgs, ed25519, ge-additions, argon2, libaes_siv }: +{ stdenv, openssl, gmp, ed25519, secp256k1, ge-additions, argon2, libaes_siv }: -pkgs.stdenv.mkDerivation rec { +stdenv.mkDerivation rec { name = "urcrypt"; builder = ./builder.sh; src = ../../../pkg/urcrypt; - buildInputs = [ pkgs.openssl ed25519 ge-additions argon2 libaes_siv ]; + buildInputs = [ + openssl gmp ed25519 secp256k1 argon2 ge-additions libaes_siv + ]; } diff --git a/pkg/urbit/include/jets/q.h b/pkg/urbit/include/jets/q.h index 0259f6acd..cbd673138 100644 --- a/pkg/urbit/include/jets/q.h +++ b/pkg/urbit/include/jets/q.h @@ -132,7 +132,6 @@ u3_atom, u3_atom, u3_atom, u3_atom); - u3_noun u3qe_make(u3_atom has, u3_atom prv); u3_noun u3qe_reco(u3_atom has, u3_atom sig_v, u3_atom sig_r, u3_atom sig_s); u3_noun u3qe_sign(u3_atom has, u3_atom prv); diff --git a/pkg/urbit/jets/e/secp.c b/pkg/urbit/jets/e/secp.c index 746d3b255..b85fcd174 100644 --- a/pkg/urbit/jets/e/secp.c +++ b/pkg/urbit/jets/e/secp.c @@ -4,10 +4,65 @@ #include "all.h" #include "../include/secp256k1.h" #include "../include/secp256k1_recovery.h" +#include "urcrypt.h" /* util funcs */ +static c3_t +_cqe_is_8(const c3_w words[8], u3_noun non) +{ + if ( (c3n == u3ud(non)) || + (8 != u3r_met(5, non)) ) { + return 0; + } + else { + c3_w i; + for ( i = 0; i < 8; ++i ) { + if ( words[i] != u3r_word(i, non) ) { + return 0; + } + } + return 1; + } +} + +/* FIXME!!! + * The hoon contains a generic secp core which is actually jetted, and then + * +secp256k1 passes these constants to it. This should be restructured so + * that the constants are matched as part of the batteries in the core stack + * of the jetted gates. +*/ +static c3_t +_cqe_256k1_veri(u3_noun cor) +{ + static const c3_w pow_w[8] = { + 0xfffffc2f, 0xfffffffe, 0xffffffff, 0xffffffff, + 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff }; + static const c3_w xow_w[8] = { + 0x16f81798, 0x59f2815b, 0x2dce28d9, 0x29bfcdb, + 0xce870b07, 0x55a06295, 0xf9dcbbac, 0x79be667e }; + static const c3_w yow_w[8] = { + 0xfb10d4b8, 0x9c47d08f, 0xa6855419, 0xfd17b448, + 0xe1108a8, 0x5da4fbfc, 0x26a3c465, 0x483ada77 }; + static const c3_w now_w[8] = { + 0xd0364141, 0xbfd25e8c, 0xaf48a03b, 0xbaaedce6, + 0xfffffffe, 0xffffffff, 0xffffffff, 0xffffffff }; + + u3_noun w, p, b, mor, a, g, x, y, n, sam = u3x_at(254, cor); + u3x_qual(sam, &w, &p, &b, &mor); + u3x_trel(mor, &a, &g, &n); + u3x_cell(g, &x, &y); + + return ( 32 == w && + 0 == b && + 7 == a && + _cqe_is_8(pow_w, p) && + _cqe_is_8(xow_w, x) && + _cqe_is_8(yow_w, y) && + _cqe_is_8(now_w, n) ); +} + /* no guarantees if 'in' and 'out' overlap / are the same */ static void byte_reverse(c3_y *i_y, /* in */ c3_y *o_y, /* out */ @@ -257,6 +312,26 @@ u3qe_reco(u3_atom has, return(u3nc(x, y)); } +static u3_atom +_cqe_make(u3_atom has, + u3_atom prv) +{ + c3_y has_y[32], prv_y[32], out_y[32]; + + if ( ( u3r_met(3, has) > 32 ) || + ( u3r_met(3, prv) > 32 ) ) { + // hoon doesn't check size + return u3_none; + } + else { + u3r_bytes(0, 32, has_y, has); + u3r_bytes(0, 32, prv_y, prv); + + return ( 0 == urcrypt_secp_make(has_y, prv_y, out_y) ) + ? u3i_bytes(32, out_y) + : u3_none; + } +} u3_noun u3we_make(u3_noun cor) @@ -267,49 +342,13 @@ u3we_make(u3_noun cor) u3x_sam_3, &prv, 0)) || (c3n == u3ud(has)) || - (c3n == u3ud(prv)) ) - { - u3l_log("\rsecp jet: crypto package error\n"); - return u3m_bail(c3__exit); - } else { - return u3qe_make(has, prv); - } -} - - - -u3_noun -u3qe_make(u3_atom has, - u3_atom prv) -{ - - c3_y hel_y[32]; /* hash, little endian */ - c3_y heb_y[32]; /* hash, big endian */ - u3r_bytes(0, 32, hel_y, has); - byte_reverse(hel_y, heb_y, 32); - - c3_y pel_y[32]; /* priv key, little endian */ - c3_y peb_y[32]; /* priv key, big endian */ - u3r_bytes(0, 32, pel_y, prv); - byte_reverse(pel_y, peb_y, 32); - - - c3_ws ret_ws; - c3_y neb_y[32]; /* nonce */ - ret_ws = secp256k1_nonce_function_rfc6979(neb_y, /* OUT: return arg for nonce */ - (const c3_y *) heb_y, /* IN: message / hash */ - (const c3_y *) peb_y, /* IN: key32 */ - NULL, /* IN: algorithm (NULL == ECDSA) */ - (void *) NULL, /* IN: arbitrary data pointer (unused) */ - 0); /* IN: attempt number (0 == normal) */ - if (1 != ret_ws) { - u3l_log("\rsecp jet: crypto package error\n"); + (c3n == u3ud(prv)) ) { return u3m_bail(c3__exit); } - - c3_y nel_y[32]; - byte_reverse(neb_y, nel_y, 32); - u3_noun non = u3i_words(8, (const c3_w*) nel_y); - return(non); + else { + return u3l_punt("secp-make", + _cqe_256k1_veri(cor) + ? _cqe_make(has, prv) + : u3_none); + } } - diff --git a/pkg/urcrypt/Makefile b/pkg/urcrypt/Makefile index 2f1a6abb0..7c131b0f0 100644 --- a/pkg/urcrypt/Makefile +++ b/pkg/urcrypt/Makefile @@ -16,7 +16,7 @@ liburcrypt.a: $(SOURCES) liburcrypt.so: $(SOURCES) $(CC) $(CFLAGS) -fPIC -c urcrypt.c -o urcrypt-shared.o $(CC) -shared urcrypt-shared.o -o liburcrypt.so \ - -led25519 -lge-additions -lssl -largon2 -laes_siv \ + -led25519 -lge-additions -lssl -largon2 -laes_siv -lgmp -lsecp256k1 \ -Wl,--no-undefined all: liburcrypt.a liburcrypt.so diff --git a/pkg/urcrypt/urcrypt.c b/pkg/urcrypt/urcrypt.c index dba322396..4aa52eafd 100644 --- a/pkg/urcrypt/urcrypt.c +++ b/pkg/urcrypt/urcrypt.c @@ -13,6 +13,9 @@ #include #include +#include +#include + static urcrypt_malloc_t _urcrypt_ssl_malloc_ptr; static urcrypt_realloc_t _urcrypt_ssl_realloc_ptr; static urcrypt_free_t _urcrypt_ssl_free_ptr; @@ -916,3 +919,24 @@ urcrypt_blake2(size_t message_length, } } } + +int +urcrypt_secp_make(uint8_t hash[32], uint8_t key[32], uint8_t out[32]) +{ + _urcrypt_reverse(32, hash); + _urcrypt_reverse(32, key); + + if ( 1 != secp256k1_nonce_function_rfc6979( + out, // OUT: return arg for nonce + hash, // IN: message / hash */ + key, // IN: key32 + NULL, // IN: algorithm (NULL == ECDSA) + NULL, // IN: arbitrary data pointer (unused) + 0) ) { // IN: attempt number (0 == normal) + return -1; + } + else { + _urcrypt_reverse(32, out); + return 0; + } +} diff --git a/pkg/urcrypt/urcrypt.h b/pkg/urcrypt/urcrypt.h index 00e4e615f..324fab73e 100644 --- a/pkg/urcrypt/urcrypt.h +++ b/pkg/urcrypt/urcrypt.h @@ -23,6 +23,7 @@ int urcrypt_set_openssl_mem_functions(urcrypt_malloc_t malloc_ptr, urcrypt_free_t free_ptr); // const arguments are not written to, non-const arguments may be +// all arrays are in little-endian byte order. // array sizes[64] are purely documentary // 0 on success, result in out @@ -190,4 +191,6 @@ int urcrypt_blake2(size_t message_length, size_t out_length, uint8_t *out); +int urcrypt_secp_make(uint8_t hash[32], uint8_t key[32], uint8_t out[32]); + #endif From 7870add409e09d435cdbc4e4ff99799ab8266745 Mon Sep 17 00:00:00 2001 From: Paul Driver Date: Thu, 24 Sep 2020 10:57:04 -0700 Subject: [PATCH 045/329] WIP: returning from secp rectification on master and preparing for rebase and merge. --- pkg/urbit/daemon/main.c | 6 +- pkg/urbit/include/noun/manage.h | 4 ++ pkg/urbit/jets/e/argon2.c | 4 +- pkg/urbit/jets/e/secp.c | 33 +++++++-- pkg/urbit/noun/manage.c | 66 ++++++++++++------ pkg/urbit/vere/king.c | 6 ++ pkg/urbit/worker/main.c | 6 ++ pkg/urcrypt/urcrypt.c | 118 +++++++++++++++++++++++++++++++- pkg/urcrypt/urcrypt.h | 37 ++++++++-- 9 files changed, 241 insertions(+), 39 deletions(-) diff --git a/pkg/urbit/daemon/main.c b/pkg/urbit/daemon/main.c index 95d097b31..e811d4c8b 100644 --- a/pkg/urbit/daemon/main.c +++ b/pkg/urbit/daemon/main.c @@ -619,7 +619,6 @@ main(c3_i argc, if ( c3y == u3_Host.ops_u.tex ) { u3_Host.bot_f = _stop_on_boot_completed_cb; } - #if 0 if ( 0 == getuid() ) { chroot(u3_Host.dir_c); @@ -748,12 +747,17 @@ main(c3_i argc, } } + /* FIXME // Initialize OpenSSL for client and server // { SSL_library_init(); SSL_load_error_strings(); } + */ + + // openssl won't init after this libcurl call, probably because it links + // against openssl and does allocations with it. // initialize curl // diff --git a/pkg/urbit/include/noun/manage.h b/pkg/urbit/include/noun/manage.h index a05ce7871..33a75078d 100644 --- a/pkg/urbit/include/noun/manage.h +++ b/pkg/urbit/include/noun/manage.h @@ -14,6 +14,10 @@ c3_d u3m_boot_lite(void); + /* u3m_stop(): graceful shutdown cleanup. */ + void + u3m_stop(void); + /* u3m_bail(): bail out. Does not return. ** ** Bail motes: diff --git a/pkg/urbit/jets/e/argon2.c b/pkg/urbit/jets/e/argon2.c index e2f2e9bf3..69901baad 100644 --- a/pkg/urbit/jets/e/argon2.c +++ b/pkg/urbit/jets/e/argon2.c @@ -8,7 +8,7 @@ */ static c3_t - _cqear_unpack_type(urcrypt_argon2_type *out, u3_atom in) + _cqear_unpack_type(c3_y* out, u3_atom in) { switch ( in ) { default: @@ -39,7 +39,7 @@ // input params u3_atom wid, u3_atom dat, u3_atom wis, u3_atom sat ) { - urcrypt_argon2_type typ_u; + c3_y typ_u; c3_w out_w, wik_w, wix_w, wid_w, wis_w, ver_w, ted_w, mem_w, tim_w; if ( !(u3r_word_fit(&out_w, out) && diff --git a/pkg/urbit/jets/e/secp.c b/pkg/urbit/jets/e/secp.c index b85fcd174..5052a956a 100644 --- a/pkg/urbit/jets/e/secp.c +++ b/pkg/urbit/jets/e/secp.c @@ -32,6 +32,9 @@ _cqe_is_8(const c3_w words[8], u3_noun non) * +secp256k1 passes these constants to it. This should be restructured so * that the constants are matched as part of the batteries in the core stack * of the jetted gates. + * + * The hoon also doesn't, in general, check the size of any of its arguments; + * we return u3_none when they are mis-sized. */ static c3_t _cqe_256k1_veri(u3_noun cor) @@ -211,6 +214,28 @@ u3we_reco(u3_noun cor) } } +static u3_noun +_cqe_reco(u3_atom has, + u3_atom siv, /* signature: v */ + u3_atom sir, /* signature: r */ + u3_atom sis) /* signature: s */ +{ + c3_y has_y[32], sir_y[32], sis_y[32], x_y[32], y_y[32]; + + if ( !((siv < 4) && + u3r_bytes_fit(32, has_y, has) && + u3r_bytes_fit(32, sir_y, sir) && + u3r_bytes_fit(32, sis_y, sis) && + (0 == urcrypt_secp_reco(has_y, (c3_y) siv, sir_y, sis_y, x_y, y_y))) ) + { + return u3_none; + } + else { + return u3nc(u3i_bytes(32, x_y), + u3i_bytes(32, y_y)); + } +} + u3_noun u3qe_reco(u3_atom has, u3_atom siv, /* signature: v */ @@ -318,15 +343,11 @@ _cqe_make(u3_atom has, { c3_y has_y[32], prv_y[32], out_y[32]; - if ( ( u3r_met(3, has) > 32 ) || - ( u3r_met(3, prv) > 32 ) ) { - // hoon doesn't check size + if ( !(u3r_bytes_fit(32, has_y, has) && + u3r_bytes_fit(32, prv_y, prv)) ) { return u3_none; } else { - u3r_bytes(0, 32, has_y, has); - u3r_bytes(0, 32, prv_y, prv); - return ( 0 == urcrypt_secp_make(has_y, prv_y, out_y) ) ? u3i_bytes(32, out_y) : u3_none; diff --git a/pkg/urbit/noun/manage.c b/pkg/urbit/noun/manage.c index 873cc3fee..83445ab0a 100644 --- a/pkg/urbit/noun/manage.c +++ b/pkg/urbit/noun/manage.c @@ -1,6 +1,7 @@ /* n/m.c ** */ +#include #include #include #include @@ -1601,6 +1602,41 @@ _cm_signals(void) } } +static void +_cm_crypto_init() +{ + /* Initialize OpenSSL with loom allocation functions. + * IMPORTANT: this should come before the urcrypt_set_openssl [...] + * call, because in usual circumstances that will override the functions + * we set here, but weird linking situations we don't currently encounter + * could mean we need to set both, and it doesn't hurt. + */ + if ( 0 == CRYPTO_set_mem_functions(&u3a_malloc_ssl, + &u3a_realloc_ssl, + &u3a_free_ssl) ) { + u3l_log("%s\r\n", "openssl initialization failed"); + exit(1); + } + + /* Initialize cryptography suite */ + if ( 0 != urcrypt_set_openssl_mem_functions(&u3a_malloc, + &u3a_realloc, + &u3a_free) ) { + u3l_log("%s\r\n", "urcrypt-openssl initialization failed"); + exit(1); + } + + { + c3_y ent_y[32]; + ent_getentropy(ent_y, 32); + + if ( 0 != urcrypt_secp_init(ent_y) ) { + u3l_log("%s\r\n", "urcrypt-secp initialization failed"); + exit(1); + } + } +} + /* u3m_init(): start the environment. */ void @@ -1608,6 +1644,7 @@ u3m_init(void) { _cm_limits(); _cm_signals(); + _cm_crypto_init(); /* Make sure GMP uses our malloc. */ @@ -1646,6 +1683,13 @@ u3m_init(void) } } +/* u3m_stop(): graceful shutdown cleanup. */ +void +u3m_stop() +{ + urcrypt_secp_cleanup(); +} + /* u3m_boot(): start the u3 system. return next event, starting from 1. */ c3_d @@ -1657,28 +1701,6 @@ u3m_boot(c3_c* dir_c) */ u3m_init(); - /* Initialize OpenSSL with loom allocation functions. - * IMPORTANT: this should come before the urcrypt_set_openssl [...] - * call, because in usual circumstances that will override the functions - * we set here, but weird linking situations we don't currently encounter - * could mean we need to set both, and it doesn't hurt. - */ - if ( 0 == CRYPTO_set_mem_functions(&u3a_malloc_ssl, - &u3a_realloc_ssl, - &u3a_free_ssl) ) { - u3l_log("%s\r\n", "openssl initialization failed"); - exit(1); - } - - /* Initialize cryptography suite with loom allocation functions. - */ - if ( 0 != urcrypt_set_openssl_mem_functions(&u3a_malloc, - &u3a_realloc, - &u3a_free) ) { - u3l_log("%s\r\n", "urcrypt initialization failed"); - exit(1); - } - /* Activate the storage system. */ nuu_o = u3e_live(c3n, dir_c); diff --git a/pkg/urbit/vere/king.c b/pkg/urbit/vere/king.c index c0df14592..b1fa69de8 100644 --- a/pkg/urbit/vere/king.c +++ b/pkg/urbit/vere/king.c @@ -710,6 +710,11 @@ u3_king_commence() u3C.wag_w |= u3o_hashless; u3m_boot_lite(); + { +#include + SSL_library_init(); + SSL_load_error_strings(); + } // wire up signal controls // @@ -761,6 +766,7 @@ u3_king_commence() _king_loop_init(); uv_run(u3L, UV_RUN_DEFAULT); _king_loop_exit(); + u3m_stop(); } /* u3_king_stub(): get the One Pier for unreconstructed code. diff --git a/pkg/urbit/worker/main.c b/pkg/urbit/worker/main.c index 7bc494e26..9d621a3aa 100644 --- a/pkg/urbit/worker/main.c +++ b/pkg/urbit/worker/main.c @@ -213,6 +213,7 @@ _cw_serf_commence(c3_i argc, c3_c* argv[]) // enter loop // uv_run(lup_u, UV_RUN_DEFAULT); + u3m_stop(); } /* _cw_info(); print pier info @@ -226,6 +227,7 @@ _cw_info(c3_i argc, c3_c* argv[]) c3_d eve_d = u3m_boot(dir_c); fprintf(stderr, "urbit-worker: %s at event %" PRIu64 "\r\n", dir_c, eve_d); + u3m_stop(); } /* _cw_grab(); gc pier. @@ -238,6 +240,7 @@ _cw_grab(c3_i argc, c3_c* argv[]) c3_c* dir_c = argv[2]; u3m_boot(dir_c); u3_serf_grab(); + u3m_stop(); } /* _cw_cram(); jam persistent state (rock), and exit. @@ -258,6 +261,7 @@ _cw_cram(c3_i argc, c3_c* argv[]) } fprintf(stderr, "urbit-worker: cram: rock saved at event %" PRIu64 "\r\n", eve_d); + u3m_stop(); } /* _cw_queu(); cue rock, save, and exit. @@ -285,6 +289,7 @@ _cw_queu(c3_i argc, c3_c* argv[]) u3e_save(); fprintf(stderr, "urbit-worker: queu: rock loaded at event %" PRIu64 "\r\n", eve_d); + u3m_stop(); } } @@ -301,6 +306,7 @@ _cw_pack(c3_i argc, c3_c* argv[]) u3a_print_memory(stderr, "urbit-worker: pack: gained", u3m_pack()); u3e_save(); + u3m_stop(); } /* _cw_usage(): print urbit-worker usage. diff --git a/pkg/urcrypt/urcrypt.c b/pkg/urcrypt/urcrypt.c index 4aa52eafd..a042ebe96 100644 --- a/pkg/urcrypt/urcrypt.c +++ b/pkg/urcrypt/urcrypt.c @@ -807,7 +807,7 @@ _urcrypt_argon2_free(uint8_t* memory, size_t bytes) #define SZ_32(s) ( sizeof(size_t) <= sizeof(uint32_t) || s <= 0xFFFFFFFF ) const char* -urcrypt_argon2(urcrypt_argon2_type type, +urcrypt_argon2(uint8_t type, uint32_t version, uint32_t threads, uint32_t memory_cost, @@ -920,6 +920,37 @@ urcrypt_blake2(size_t message_length, } } +static secp256k1_context* _urcrypt_secp_ctx = NULL; + +int +urcrypt_secp_init(uint8_t entropy[32]) +{ + if ( NULL != _urcrypt_secp_ctx ) { + return -1; + } + else { + _urcrypt_secp_ctx = secp256k1_context_create( + SECP256K1_CONTEXT_VERIFY | SECP256K1_CONTEXT_SIGN); + if ( 1 == secp256k1_context_randomize(_urcrypt_secp_ctx, entropy) ) { + return 0; + } + else { + secp256k1_context_destroy(_urcrypt_secp_ctx); + _urcrypt_secp_ctx = NULL; + return -2; + } + } +} + +void +urcrypt_secp_cleanup(void) +{ + if ( NULL != _urcrypt_secp_ctx) { + secp256k1_context_destroy(_urcrypt_secp_ctx); + _urcrypt_secp_ctx = NULL; + } +} + int urcrypt_secp_make(uint8_t hash[32], uint8_t key[32], uint8_t out[32]) { @@ -940,3 +971,88 @@ urcrypt_secp_make(uint8_t hash[32], uint8_t key[32], uint8_t out[32]) return 0; } } + +int +urcrypt_secp_reco(uint8_t hash[32], + uint8_t key_v, + const uint8_t key_r[32], + const uint8_t key_s[32], + uint8_t out_x[32], + uint8_t out_y[32]) +{ + if ( (NULL == _urcrypt_secp_ctx) || + (NULL == hash) || + (NULL == key_r) || + (NULL == key_s) ) { + return -1; + } + else if ( key_v > 3 ) { + return -2; + } + else { + secp256k1_ecdsa_recoverable_signature signature; + uint8_t private[64]; + size_t i, j; + // make big private key out of two smaller parts, reversing endianness + for ( j = 31, i = 0; i < 32; ++i, --j) { + private[i] = key_r[j]; + } + for ( j = 31; i < 64; ++i, --j ) { + private[i] = key_s[j]; + } + memset(&signature, 0, sizeof(secp256k1_ecdsa_recoverable_signature)); + if ( 1 != secp256k1_ecdsa_recoverable_signature_parse_compact( + _urcrypt_secp_ctx, /* IN: context */ + &signature, /* OUT: sig */ + private, /* IN: r/s */ + key_v) ) { /* IN: v */ + return -3; + } + else { + secp256k1_pubkey public; + memset(&public, 0, sizeof(secp256k1_pubkey)); + // the code we ported from looks like it intended to reverse hash + // at some point, but doesn't actually. + if ( 1 != secp256k1_ecdsa_recover( + _urcrypt_secp_ctx, /* IN: context */ + &public, /* OUT: pub key */ + &signature, /* IN: signature */ + hash) ) { /* IN: message hash */ + return -4; + } + else { + /* convert pub into serialized form that we can get x, y out of */ + uint8_t serialized[65]; + size_t outputlen = 65; + memset(serialized, 0, outputlen); + if ( 1 != secp256k1_ec_pubkey_serialize( + _urcrypt_secp_ctx, /* IN: context */ + serialized, /* OUT: output */ + &outputlen, /* IN/OUT: outputlen */ + &public, /* IN: pubkey*/ + SECP256K1_EC_UNCOMPRESSED) ) { /* IN: flags */ + return -5; + } + else { + /* in file + subprojects/secp256k1/src/eckey_impl.h + func + secp256k1_eckey_pubkey_parse() + we can see + byte 0: signal bits (???) + bytes 1-32: x + bytes 33-64: y + + convert endianness while we're at it */ + for (j = 32, i = 0; i < 32; ++i, --j) { + out_x[i] = serialized[j]; + } + for (j = 64, i = 0; i < 32; ++i, --j) { + out_y[i] = serialized[j]; + } + return 0; + } + } + } + } +} diff --git a/pkg/urcrypt/urcrypt.h b/pkg/urcrypt/urcrypt.h index 324fab73e..65c00a711 100644 --- a/pkg/urcrypt/urcrypt.h +++ b/pkg/urcrypt/urcrypt.h @@ -158,15 +158,13 @@ void urcrypt_shas(uint8_t *salt, size_t salt_length, const uint8_t *message, size_t message_length, uint8_t out[32]); -typedef enum urcrypt_argon2_type { - urcrypt_argon2_d = 0, - urcrypt_argon2_i = 1, - urcrypt_argon2_id = 2, - urcrypt_argon2_u = 10, -} urcrypt_argon2_type; +#define urcrypt_argon2_d 0 +#define urcrypt_argon2_i 1 +#define urcrypt_argon2_id 2 +#define urcrypt_argon2_u 10 /* returns a constant error message string or NULL for success */ -const char* urcrypt_argon2(urcrypt_argon2_type type, +const char* urcrypt_argon2(uint8_t type, // one of the urcrpyt_argon2_* uint32_t version, uint32_t threads, uint32_t memory_cost, @@ -191,6 +189,31 @@ int urcrypt_blake2(size_t message_length, size_t out_length, uint8_t *out); +/* there is some long-term context associated with the secp library + * (precomputed tables, etc). Because the context itself is thread-safe, + * we have opted to manage it statically and present a simple calling + * interface that doesn't mention it. + */ + +/* initialize static secp context (not thread-safe). Recommmendation: + * call this once at main thread startup before calling other secp functions. + * Use a high quality source of entropy. + */ +int urcrypt_secp_init(uint8_t entropy[32]); + +/* restore initial secp context conditons (not thread-safe). Recommendation: + * call this just before that main thread exits to make valgrind etc. happy + */ +void urcrypt_secp_cleanup(void); + +// technically usable without the secp context int urcrypt_secp_make(uint8_t hash[32], uint8_t key[32], uint8_t out[32]); +int urcrypt_secp_reco(uint8_t hash[32], + uint8_t key_v, // 0, 1, 2, 3 + const uint8_t key_r[32], + const uint8_t key_s[32], + uint8_t out_x[32], + uint8_t out_y[32]); + #endif From 58e4915a8d40c5e4254ae663ae8391616f787f69 Mon Sep 17 00:00:00 2001 From: Paul Driver Date: Tue, 29 Sep 2020 11:39:43 -0700 Subject: [PATCH 046/329] stops trying to hide pointer shapes, cleans up secp api, updates secp dependency --- nix/deps/secp256k1/default.nix | 4 +- pkg/urbit/daemon/main.c | 8 +- pkg/urbit/jets/e/argon2.c | 17 +++- pkg/urbit/jets/e/secp.c | 80 ++++++------------ pkg/urbit/noun/manage.c | 37 +++------ pkg/urbit/vere/king.c | 7 -- pkg/urcrypt/Makefile | 4 +- pkg/urcrypt/README.md | 51 ++++++++++++ pkg/urcrypt/urcrypt.c | 143 +++++++++++---------------------- pkg/urcrypt/urcrypt.h | 54 +++++++++---- 10 files changed, 191 insertions(+), 214 deletions(-) create mode 100644 pkg/urcrypt/README.md diff --git a/nix/deps/secp256k1/default.nix b/nix/deps/secp256k1/default.nix index 438b2dc25..828baf7d4 100644 --- a/nix/deps/secp256k1/default.nix +++ b/nix/deps/secp256k1/default.nix @@ -19,7 +19,7 @@ pkgs.stdenv.mkDerivation rec { src = pkgs.fetchFromGitHub { owner = "bitcoin-core"; repo = "secp256k1"; - rev = "e34ceb333b1c0e6f4115ecbb80c632ac1042fa49"; - sha256 = "0as78s179hcr3ysk3fw98k5wzabgnwri7vkkc17wg31lyz6ids6c"; + rev = "63150ab4da1ef13ebfb4396064e1ff501dbd015e"; + sha256 = "0s128jgb5r9v92hk95na44kgpwi0dr3bjkqx8k5yxqpwxlhrmzmx"; }; } diff --git a/pkg/urbit/daemon/main.c b/pkg/urbit/daemon/main.c index e811d4c8b..56ac40189 100644 --- a/pkg/urbit/daemon/main.c +++ b/pkg/urbit/daemon/main.c @@ -619,6 +619,7 @@ main(c3_i argc, if ( c3y == u3_Host.ops_u.tex ) { u3_Host.bot_f = _stop_on_boot_completed_cb; } + #if 0 if ( 0 == getuid() ) { chroot(u3_Host.dir_c); @@ -747,17 +748,16 @@ main(c3_i argc, } } - /* FIXME // Initialize OpenSSL for client and server // { SSL_library_init(); SSL_load_error_strings(); } - */ - // openssl won't init after this libcurl call, probably because it links - // against openssl and does allocations with it. + // must come before curl initialization because curl will use + // openssl malloc and prevent us from installing our custom allocator + u3m_boot_lite(); // initialize curl // diff --git a/pkg/urbit/jets/e/argon2.c b/pkg/urbit/jets/e/argon2.c index 69901baad..c01c46b06 100644 --- a/pkg/urbit/jets/e/argon2.c +++ b/pkg/urbit/jets/e/argon2.c @@ -7,6 +7,19 @@ /* helpers */ + static int + argon2_alloc(uint8_t** output, size_t bytes) + { + *output = u3a_malloc(bytes); + return (NULL != *output); + } + + static void + argon2_free(uint8_t* memory, size_t bytes) + { + u3a_free(memory); + } + static c3_t _cqear_unpack_type(c3_y* out, u3_atom in) { @@ -72,8 +85,8 @@ wid_w, dat_y, wis_w, sat_y, out_w, out_y, - &u3a_malloc, - &u3a_free); + &argon2_alloc, + &argon2_free); u3a_free(key_y); u3a_free(ex_y); diff --git a/pkg/urbit/jets/e/secp.c b/pkg/urbit/jets/e/secp.c index 5052a956a..4f0c70b98 100644 --- a/pkg/urbit/jets/e/secp.c +++ b/pkg/urbit/jets/e/secp.c @@ -5,67 +5,33 @@ #include "../include/secp256k1.h" #include "../include/secp256k1_recovery.h" #include "urcrypt.h" +#include + +static void* pre_u; +static urcrypt_secp_context sec_u; + +void u3e_secp_init() +{ + c3_y ent_y[32]; + ent_getentropy(ent_y, 32); + pre_u = malloc(urcrypt_secp_prealloc_size()); + + if ( 0 != urcrypt_secp_init(&sec_u, pre_u, ent_y) ) { + u3l_log("%s\r\n", "u3e_secp_init failed"); + abort(); + } +} + +void u3e_secp_stop() +{ + urcrypt_secp_destroy(&sec_u); + free(pre_u); + pre_u = NULL; +} /* util funcs */ -static c3_t -_cqe_is_8(const c3_w words[8], u3_noun non) -{ - if ( (c3n == u3ud(non)) || - (8 != u3r_met(5, non)) ) { - return 0; - } - else { - c3_w i; - for ( i = 0; i < 8; ++i ) { - if ( words[i] != u3r_word(i, non) ) { - return 0; - } - } - return 1; - } -} - -/* FIXME!!! - * The hoon contains a generic secp core which is actually jetted, and then - * +secp256k1 passes these constants to it. This should be restructured so - * that the constants are matched as part of the batteries in the core stack - * of the jetted gates. - * - * The hoon also doesn't, in general, check the size of any of its arguments; - * we return u3_none when they are mis-sized. -*/ -static c3_t -_cqe_256k1_veri(u3_noun cor) -{ - static const c3_w pow_w[8] = { - 0xfffffc2f, 0xfffffffe, 0xffffffff, 0xffffffff, - 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff }; - static const c3_w xow_w[8] = { - 0x16f81798, 0x59f2815b, 0x2dce28d9, 0x29bfcdb, - 0xce870b07, 0x55a06295, 0xf9dcbbac, 0x79be667e }; - static const c3_w yow_w[8] = { - 0xfb10d4b8, 0x9c47d08f, 0xa6855419, 0xfd17b448, - 0xe1108a8, 0x5da4fbfc, 0x26a3c465, 0x483ada77 }; - static const c3_w now_w[8] = { - 0xd0364141, 0xbfd25e8c, 0xaf48a03b, 0xbaaedce6, - 0xfffffffe, 0xffffffff, 0xffffffff, 0xffffffff }; - - u3_noun w, p, b, mor, a, g, x, y, n, sam = u3x_at(254, cor); - u3x_qual(sam, &w, &p, &b, &mor); - u3x_trel(mor, &a, &g, &n); - u3x_cell(g, &x, &y); - - return ( 32 == w && - 0 == b && - 7 == a && - _cqe_is_8(pow_w, p) && - _cqe_is_8(xow_w, x) && - _cqe_is_8(yow_w, y) && - _cqe_is_8(now_w, n) ); -} - /* no guarantees if 'in' and 'out' overlap / are the same */ static void byte_reverse(c3_y *i_y, /* in */ c3_y *o_y, /* out */ diff --git a/pkg/urbit/noun/manage.c b/pkg/urbit/noun/manage.c index 83445ab0a..56e292d70 100644 --- a/pkg/urbit/noun/manage.c +++ b/pkg/urbit/noun/manage.c @@ -1,7 +1,6 @@ /* n/m.c ** */ -#include #include #include #include @@ -1602,39 +1601,21 @@ _cm_signals(void) } } +extern void u3e_secp_init(void); +extern void u3e_secp_stop(void); + static void -_cm_crypto_init() +_cm_crypto() { - /* Initialize OpenSSL with loom allocation functions. - * IMPORTANT: this should come before the urcrypt_set_openssl [...] - * call, because in usual circumstances that will override the functions - * we set here, but weird linking situations we don't currently encounter - * could mean we need to set both, and it doesn't hurt. - */ + /* Initialize OpenSSL with loom allocation functions. */ if ( 0 == CRYPTO_set_mem_functions(&u3a_malloc_ssl, &u3a_realloc_ssl, &u3a_free_ssl) ) { u3l_log("%s\r\n", "openssl initialization failed"); - exit(1); + abort(); } - /* Initialize cryptography suite */ - if ( 0 != urcrypt_set_openssl_mem_functions(&u3a_malloc, - &u3a_realloc, - &u3a_free) ) { - u3l_log("%s\r\n", "urcrypt-openssl initialization failed"); - exit(1); - } - - { - c3_y ent_y[32]; - ent_getentropy(ent_y, 32); - - if ( 0 != urcrypt_secp_init(ent_y) ) { - u3l_log("%s\r\n", "urcrypt-secp initialization failed"); - exit(1); - } - } + u3e_secp_init(); } /* u3m_init(): start the environment. @@ -1644,7 +1625,7 @@ u3m_init(void) { _cm_limits(); _cm_signals(); - _cm_crypto_init(); + _cm_crypto(); /* Make sure GMP uses our malloc. */ @@ -1687,7 +1668,7 @@ u3m_init(void) void u3m_stop() { - urcrypt_secp_cleanup(); + u3e_secp_stop(); } /* u3m_boot(): start the u3 system. return next event, starting from 1. diff --git a/pkg/urbit/vere/king.c b/pkg/urbit/vere/king.c index b1fa69de8..12f98f063 100644 --- a/pkg/urbit/vere/king.c +++ b/pkg/urbit/vere/king.c @@ -709,13 +709,6 @@ u3_king_commence() sag_w = u3C.wag_w; u3C.wag_w |= u3o_hashless; - u3m_boot_lite(); - { -#include - SSL_library_init(); - SSL_load_error_strings(); - } - // wire up signal controls // u3C.sign_hold_f = _king_sign_hold; diff --git a/pkg/urcrypt/Makefile b/pkg/urcrypt/Makefile index 7c131b0f0..2c3d294ad 100644 --- a/pkg/urcrypt/Makefile +++ b/pkg/urcrypt/Makefile @@ -6,11 +6,11 @@ PREFIX ?= ./out .PHONY: all install clean -CFLAGS := $(CFLAGS) -O3 -Wall -Werror -pedantic -std=gnu99 +CFLAGS := $(CFLAGS) -g -O3 -Wall -Werror -pedantic -std=gnu99 SOURCES = urcrypt.c urcrypt.h liburcrypt.a: $(SOURCES) - $(CC) $(CFLAGS) -c urcrypt.c -o urcrypt-static.o + $(CC) $(CFLAGS) -D URCRYPT_STATIC -c urcrypt.c -o urcrypt-static.o $(AR) rcs liburcrypt.a urcrypt-static.o liburcrypt.so: $(SOURCES) diff --git a/pkg/urcrypt/README.md b/pkg/urcrypt/README.md new file mode 100644 index 000000000..7b7f5de7d --- /dev/null +++ b/pkg/urcrypt/README.md @@ -0,0 +1,51 @@ +What is urcrypt? +---------------- +urcrypt is a library of cryptography routines used by urbit jets. + +Why is urcrypt? +--------------- +Urbit's C runtime (long the only urbit runtime) has accumulated a collection of +cryptography dependencies, some with custom additions or patches. These +libraries have different conventions and have been managed by u3 in an ad-hoc +manner. Reproducing that arrangement in other runtimes is tricky and +error-prone. The (sometimes inconsistent) logic must be reproduced and suitable +cryptography primitives must be found (or worse, written) for the new +environment. + +To ease these burdens, urcrypt isolates the quirks behind a consistent calling +convention. Everything is a little-endian byte array, and each jetted operation +has a corresponding function in the library. Jets simply unpack their nouns, +call urcrypt, and pack the results. + +What is a cryptography routine? +------------------------------- +This is more of a subjective question than it might appear. Any of the following +conditions are sufficient, but not necessary, for a function to be included in +urcrypt: + + * The routine is sensitive to side-channel attacks (encryption, etc) + * Some property of the routine is cryptographically useful (SHA, RIPE, etc) + * The routine typically lives in a crypto library, for whatever reason. + +Shared or static? +----------------- +Urcrypt has a number of dependencies, and there is something of a matrix of +combinations of static and shared versions of those dependencies. To keep things +simple, two modes are currently supported: + + * A static library archive (urcrypt.a) + * A shared object with internal, statically linked dependencies + (urcrypt.{so, dll, dylib, etc}) + +pkg-config can be used in the normal way to obtain the link parameters. + +A word on OpenSSL +----------------- +Urcrypt depends on OpenSSL's libcrypto, which has custom malloc functions. +Urcrypt tries to avoid dealing with global/static state, and mostly succeeds, +but users who need to control memory management will want to use +`CRYPTO_set_mem_functions` from OpenSSL. This is no problem for a statically +linked urcrypt, but the shared object doesn't expose that symbol to users. +`urcrypt_set_openssl_mem_functions` is a trivial wrapper that is exposed, +and can be used to configure shared urcrypt's internal libcrypto malloc. +The function always fails in statically linked urcrypt. diff --git a/pkg/urcrypt/urcrypt.c b/pkg/urcrypt/urcrypt.c index a042ebe96..beac1f219 100644 --- a/pkg/urcrypt/urcrypt.c +++ b/pkg/urcrypt/urcrypt.c @@ -16,47 +16,16 @@ #include #include -static urcrypt_malloc_t _urcrypt_ssl_malloc_ptr; -static urcrypt_realloc_t _urcrypt_ssl_realloc_ptr; -static urcrypt_free_t _urcrypt_ssl_free_ptr; - -static void* -_urcrypt_malloc_ssl(size_t len -#if OPENSSL_VERSION_NUMBER >= 0x10100000L - , const char* file, int line -#endif -) { return (*_urcrypt_ssl_malloc_ptr)(len); } - -static void* -_urcrypt_realloc_ssl(void* ptr, size_t len -#if OPENSSL_VERSION_NUMBER >= 0x10100000L - , const char* file, int line -#endif -) { return (*_urcrypt_ssl_realloc_ptr)(ptr, len); } - -static void -_urcrypt_free_ssl(void* ptr -#if OPENSSL_VERSION_NUMBER >= 0x10100000L - , const char* file, int line -#endif -) { (*_urcrypt_ssl_free_ptr)(ptr); } - int -urcrypt_set_openssl_mem_functions(urcrypt_malloc_t malloc_ptr, - urcrypt_realloc_t realloc_ptr, - urcrypt_free_t free_ptr) +urcrypt_set_openssl_mem_functions(urcrypt_openssl_malloc_t m, + urcrypt_openssl_realloc_t r, + urcrypt_openssl_free_t f) { - if ( CRYPTO_set_mem_functions(&_urcrypt_malloc_ssl, - &_urcrypt_realloc_ssl, - &_urcrypt_free_ssl) ) { - _urcrypt_ssl_malloc_ptr = malloc_ptr; - _urcrypt_ssl_realloc_ptr = realloc_ptr; - _urcrypt_ssl_free_ptr = free_ptr; - return 0; - } - else { - return -1; - } +#ifdef URCRYPT_STATIC + return -2; +#else + return ( CRYPTO_set_mem_functions(m, r, f) ) ? 0 : -1; +#endif } int @@ -783,25 +752,6 @@ urcrypt_shas(uint8_t *salt, size_t salt_length, } } -/* argon2 does memory allocation, but takes function pointers in the context. - * the signatures don't match, so we need these wrappers. - */ -static urcrypt_malloc_t _urcrypt_argon2_malloc_ptr; -static urcrypt_free_t _urcrypt_argon2_free_ptr; - -static int -_urcrypt_argon2_alloc(uint8_t** output, size_t bytes) -{ - *output = (*_urcrypt_argon2_malloc_ptr)(bytes); - return (NULL != *output); -} - -static void -_urcrypt_argon2_free(uint8_t* memory, size_t bytes) -{ - (*_urcrypt_argon2_free_ptr)(memory); -} - // library convention is to have sizes in size_t, but argon2 wants them // in uint32_t, so here's a helper macro for ensuring equivalence. #define SZ_32(s) ( sizeof(size_t) <= sizeof(uint32_t) || s <= 0xFFFFFFFF ) @@ -822,8 +772,8 @@ urcrypt_argon2(uint8_t type, uint8_t *salt, size_t out_length, uint8_t *out, - urcrypt_malloc_t malloc_ptr, - urcrypt_free_t free_ptr) + urcrypt_argon2_malloc_t malloc_ptr, + urcrypt_argon2_free_t free_ptr) { if ( !( SZ_32(secret_length) && SZ_32(associated_length) && @@ -874,8 +824,8 @@ urcrypt_argon2(uint8_t type, threads, threads, version, // algorithm version - &_urcrypt_argon2_alloc,// custom memory allocation function - &_urcrypt_argon2_free, // custom memory deallocation function + malloc_ptr, // custom memory allocation function + free_ptr, // custom memory deallocation function ARGON2_DEFAULT_FLAGS // by default only internal memory is cleared }; @@ -920,35 +870,39 @@ urcrypt_blake2(size_t message_length, } } -static secp256k1_context* _urcrypt_secp_ctx = NULL; +#define SECP_FLAGS SECP256K1_CONTEXT_VERIFY | SECP256K1_CONTEXT_SIGN; + +struct urcrypt_secp_context_struct { + secp256k1_context* secp; +}; + +size_t +urcrypt_secp_prealloc_size() +{ + return secp256k1_context_preallocated_size(SECP_FLAGS); +} int -urcrypt_secp_init(uint8_t entropy[32]) +urcrypt_secp_init(urcrypt_secp_context *context, + void *prealloc, + uint8_t entropy[32]) { - if ( NULL != _urcrypt_secp_ctx ) { - return -1; + secp256k1_context* secp = + secp256k1_context_preallocated_create(prealloc, SECP_FLAGS); + if ( 1 == secp256k1_context_randomize(secp, entropy) ) { + context->secp = secp; + return 0; } else { - _urcrypt_secp_ctx = secp256k1_context_create( - SECP256K1_CONTEXT_VERIFY | SECP256K1_CONTEXT_SIGN); - if ( 1 == secp256k1_context_randomize(_urcrypt_secp_ctx, entropy) ) { - return 0; - } - else { - secp256k1_context_destroy(_urcrypt_secp_ctx); - _urcrypt_secp_ctx = NULL; - return -2; - } + secp256k1_context_preallocated_destroy(secp); + return -1; } } void -urcrypt_secp_cleanup(void) +urcrypt_secp_destroy(urcrypt_secp_context *context) { - if ( NULL != _urcrypt_secp_ctx) { - secp256k1_context_destroy(_urcrypt_secp_ctx); - _urcrypt_secp_ctx = NULL; - } + secp256k1_context_preallocated_destroy(context->secp); } int @@ -973,15 +927,15 @@ urcrypt_secp_make(uint8_t hash[32], uint8_t key[32], uint8_t out[32]) } int -urcrypt_secp_reco(uint8_t hash[32], +urcrypt_secp_reco(urcrypt_secp_context* context, + uint8_t hash[32], uint8_t key_v, const uint8_t key_r[32], const uint8_t key_s[32], uint8_t out_x[32], uint8_t out_y[32]) { - if ( (NULL == _urcrypt_secp_ctx) || - (NULL == hash) || + if ( (NULL == hash) || (NULL == key_r) || (NULL == key_s) ) { return -1; @@ -1002,22 +956,21 @@ urcrypt_secp_reco(uint8_t hash[32], } memset(&signature, 0, sizeof(secp256k1_ecdsa_recoverable_signature)); if ( 1 != secp256k1_ecdsa_recoverable_signature_parse_compact( - _urcrypt_secp_ctx, /* IN: context */ - &signature, /* OUT: sig */ - private, /* IN: r/s */ - key_v) ) { /* IN: v */ + context->secp, /* IN: context */ + &signature, /* OUT: sig */ + private, /* IN: r/s */ + key_v) ) { /* IN: v */ return -3; } else { secp256k1_pubkey public; memset(&public, 0, sizeof(secp256k1_pubkey)); - // the code we ported from looks like it intended to reverse hash - // at some point, but doesn't actually. + _urcrypt_reverse(32, hash); if ( 1 != secp256k1_ecdsa_recover( - _urcrypt_secp_ctx, /* IN: context */ - &public, /* OUT: pub key */ - &signature, /* IN: signature */ - hash) ) { /* IN: message hash */ + context->secp, /* IN: context */ + &public, /* OUT: pub key */ + &signature, /* IN: signature */ + hash) ) { /* IN: message hash */ return -4; } else { @@ -1026,7 +979,7 @@ urcrypt_secp_reco(uint8_t hash[32], size_t outputlen = 65; memset(serialized, 0, outputlen); if ( 1 != secp256k1_ec_pubkey_serialize( - _urcrypt_secp_ctx, /* IN: context */ + context->secp, /* IN: context */ serialized, /* OUT: output */ &outputlen, /* IN/OUT: outputlen */ &public, /* IN: pubkey*/ diff --git a/pkg/urcrypt/urcrypt.h b/pkg/urcrypt/urcrypt.h index 65c00a711..7c88a0cc3 100644 --- a/pkg/urcrypt/urcrypt.h +++ b/pkg/urcrypt/urcrypt.h @@ -5,10 +5,6 @@ #include #include -typedef void *(*urcrypt_malloc_t)(size_t); -typedef void *(*urcrypt_realloc_t)(void*, size_t); -typedef void (*urcrypt_free_t)(void*); - /* We depend on OpenSSL for various reasons, which doesn't promise not to * allocate memory and has the annoying CRYPTO_set_mem_functions api. We * are therefore forced to support it in some fashion. @@ -18,9 +14,31 @@ typedef void (*urcrypt_free_t)(void*); * * urcrypt will not use these functions directly. */ -int urcrypt_set_openssl_mem_functions(urcrypt_malloc_t malloc_ptr, - urcrypt_realloc_t realloc_ptr, - urcrypt_free_t free_ptr); + +typedef void *(*urcrypt_openssl_malloc_t)(size_t +#if OPENSSL_VERSION_NUMBER >= 0x10100000L + , const char*, int +#endif + ); + +typedef void *(*urcrypt_openssl_realloc_t)(void*, size_t +#if OPENSSL_VERSION_NUMBER >= 0x10100000L + , const char*, int +#endif + ); + +typedef void (*urcrypt_openssl_free_t)(void*, +#if OPENSSL_VERSION_NUMBER >= 0x10100000L + , const char*, int +#endif + ); + +typedef int (*urcrypt_argon2_alloc_t)(uint8_t**, size_t); +typedef void (*urcrypt_argon2_free)(uint8_t*, size_t); + +int urcrypt_set_openssl_mem_functions(urcrypt_openssl_malloc_t, + urcrypt_openssl_realloc_t, + urcrypt_openssl_free_t); // const arguments are not written to, non-const arguments may be // all arrays are in little-endian byte order. @@ -179,8 +197,8 @@ const char* urcrypt_argon2(uint8_t type, // one of the urcrpyt_argon2_* uint8_t *salt, size_t out_length, uint8_t *out, - urcrypt_malloc_t malloc_ptr, - urcrypt_free_t free_ptr); + urcrypt_argon2_malloc_t malloc_ptr, + urcrypt_argon2_free_t free_ptr); int urcrypt_blake2(size_t message_length, uint8_t *message, @@ -190,16 +208,18 @@ int urcrypt_blake2(size_t message_length, uint8_t *out); /* there is some long-term context associated with the secp library - * (precomputed tables, etc). Because the context itself is thread-safe, - * we have opted to manage it statically and present a simple calling - * interface that doesn't mention it. + * (precomputed tables, etc), so secp functions require a context object */ +typedef struct urcrypt_secp_context_struct urcrypt_secp_context; -/* initialize static secp context (not thread-safe). Recommmendation: - * call this once at main thread startup before calling other secp functions. - * Use a high quality source of entropy. - */ -int urcrypt_secp_init(uint8_t entropy[32]); +// malloc a pointer of this size and pass it to init +size_t urcrypt_secp_prealloc_size(void); +// call this once at per context with high quality entropy +int urcrypt_secp_init(urcrypt_secp_context *context, + void* prealloc, + uint8_t entropy[32]); +// call just before freeing prealloc'd pointer +void urcrypt_secp_destroy(urcrypt_secp_context *context); /* restore initial secp context conditons (not thread-safe). Recommendation: * call this just before that main thread exits to make valgrind etc. happy From ecd4b2531ae81ab4f592e4bc985679bf60216e6c Mon Sep 17 00:00:00 2001 From: Paul Driver Date: Wed, 30 Sep 2020 10:14:22 -0700 Subject: [PATCH 047/329] compiles and starts --- pkg/urbit/daemon/main.c | 8 ++++---- pkg/urbit/jets/e/secp.c | 21 +++++++++------------ pkg/urcrypt/urcrypt.c | 16 ++++++++-------- pkg/urcrypt/urcrypt.h | 16 +++++++++------- 4 files changed, 30 insertions(+), 31 deletions(-) diff --git a/pkg/urbit/daemon/main.c b/pkg/urbit/daemon/main.c index 56ac40189..17a959b7c 100644 --- a/pkg/urbit/daemon/main.c +++ b/pkg/urbit/daemon/main.c @@ -748,6 +748,10 @@ main(c3_i argc, } } + // starting u3m configures OpenSSL memory functions, so we must do it + // before any OpenSSL allocations + u3m_boot_lite(); + // Initialize OpenSSL for client and server // { @@ -755,10 +759,6 @@ main(c3_i argc, SSL_load_error_strings(); } - // must come before curl initialization because curl will use - // openssl malloc and prevent us from installing our custom allocator - u3m_boot_lite(); - // initialize curl // if ( 0 != curl_global_init(CURL_GLOBAL_DEFAULT) ) { diff --git a/pkg/urbit/jets/e/secp.c b/pkg/urbit/jets/e/secp.c index 4f0c70b98..11d910ecf 100644 --- a/pkg/urbit/jets/e/secp.c +++ b/pkg/urbit/jets/e/secp.c @@ -7,16 +7,15 @@ #include "urcrypt.h" #include -static void* pre_u; -static urcrypt_secp_context sec_u; +static urcrypt_secp_context* sec_u; void u3e_secp_init() { c3_y ent_y[32]; ent_getentropy(ent_y, 32); - pre_u = malloc(urcrypt_secp_prealloc_size()); + sec_u = malloc(urcrypt_secp_prealloc_size()); - if ( 0 != urcrypt_secp_init(&sec_u, pre_u, ent_y) ) { + if ( 0 != urcrypt_secp_init(sec_u, ent_y) ) { u3l_log("%s\r\n", "u3e_secp_init failed"); abort(); } @@ -24,9 +23,9 @@ void u3e_secp_init() void u3e_secp_stop() { - urcrypt_secp_destroy(&sec_u); - free(pre_u); - pre_u = NULL; + urcrypt_secp_destroy(sec_u); + free(sec_u); + sec_u = NULL; } /* util funcs @@ -192,7 +191,8 @@ _cqe_reco(u3_atom has, u3r_bytes_fit(32, has_y, has) && u3r_bytes_fit(32, sir_y, sir) && u3r_bytes_fit(32, sis_y, sis) && - (0 == urcrypt_secp_reco(has_y, (c3_y) siv, sir_y, sis_y, x_y, y_y))) ) + (0 == urcrypt_secp_reco(sec_u, has_y, + (c3_y) siv, sir_y, sis_y, x_y, y_y))) ) { return u3_none; } @@ -333,9 +333,6 @@ u3we_make(u3_noun cor) return u3m_bail(c3__exit); } else { - return u3l_punt("secp-make", - _cqe_256k1_veri(cor) - ? _cqe_make(has, prv) - : u3_none); + return u3l_punt("secp-make", _cqe_make(has, prv)); } } diff --git a/pkg/urcrypt/urcrypt.c b/pkg/urcrypt/urcrypt.c index beac1f219..a908b5f6c 100644 --- a/pkg/urcrypt/urcrypt.c +++ b/pkg/urcrypt/urcrypt.c @@ -15,6 +15,7 @@ #include #include +#include int urcrypt_set_openssl_mem_functions(urcrypt_openssl_malloc_t m, @@ -772,7 +773,7 @@ urcrypt_argon2(uint8_t type, uint8_t *salt, size_t out_length, uint8_t *out, - urcrypt_argon2_malloc_t malloc_ptr, + urcrypt_argon2_alloc_t alloc_ptr, urcrypt_argon2_free_t free_ptr) { if ( !( SZ_32(secret_length) && @@ -824,13 +825,11 @@ urcrypt_argon2(uint8_t type, threads, threads, version, // algorithm version - malloc_ptr, // custom memory allocation function + alloc_ptr, // custom memory allocation function free_ptr, // custom memory deallocation function ARGON2_DEFAULT_FLAGS // by default only internal memory is cleared }; - _urcrypt_argon2_malloc_ptr = malloc_ptr; - _urcrypt_argon2_free_ptr = free_ptr; result = (*f)(&context); if ( ARGON2_OK != result ) { @@ -870,25 +869,26 @@ urcrypt_blake2(size_t message_length, } } -#define SECP_FLAGS SECP256K1_CONTEXT_VERIFY | SECP256K1_CONTEXT_SIGN; +#define SECP_FLAGS SECP256K1_CONTEXT_VERIFY | SECP256K1_CONTEXT_SIGN struct urcrypt_secp_context_struct { secp256k1_context* secp; + uint8_t prealloc[]; }; size_t urcrypt_secp_prealloc_size() { - return secp256k1_context_preallocated_size(SECP_FLAGS); + return sizeof(urcrypt_secp_context) + + secp256k1_context_preallocated_size(SECP_FLAGS); } int urcrypt_secp_init(urcrypt_secp_context *context, - void *prealloc, uint8_t entropy[32]) { secp256k1_context* secp = - secp256k1_context_preallocated_create(prealloc, SECP_FLAGS); + secp256k1_context_preallocated_create(context->prealloc, SECP_FLAGS); if ( 1 == secp256k1_context_randomize(secp, entropy) ) { context->secp = secp; return 0; diff --git a/pkg/urcrypt/urcrypt.h b/pkg/urcrypt/urcrypt.h index 7c88a0cc3..19ba66bdc 100644 --- a/pkg/urcrypt/urcrypt.h +++ b/pkg/urcrypt/urcrypt.h @@ -27,14 +27,14 @@ typedef void *(*urcrypt_openssl_realloc_t)(void*, size_t #endif ); -typedef void (*urcrypt_openssl_free_t)(void*, +typedef void (*urcrypt_openssl_free_t)(void* #if OPENSSL_VERSION_NUMBER >= 0x10100000L , const char*, int #endif ); typedef int (*urcrypt_argon2_alloc_t)(uint8_t**, size_t); -typedef void (*urcrypt_argon2_free)(uint8_t*, size_t); +typedef void (*urcrypt_argon2_free_t)(uint8_t*, size_t); int urcrypt_set_openssl_mem_functions(urcrypt_openssl_malloc_t, urcrypt_openssl_realloc_t, @@ -86,6 +86,8 @@ int urcrypt_aes_ecbb_de(uint8_t key[24], uint8_t block[16], uint8_t out[16]); int urcrypt_aes_ecbc_en(uint8_t key[32], uint8_t block[16], uint8_t out[16]); int urcrypt_aes_ecbc_de(uint8_t key[32], uint8_t block[16], uint8_t out[16]); +typedef void* (*urcrypt_realloc_t)(void*, size_t); + // message and length are read/write so // realloc_ptr can be used as realloc to pad message int urcrypt_aes_cbca_en(uint8_t **message_ptr, @@ -197,7 +199,7 @@ const char* urcrypt_argon2(uint8_t type, // one of the urcrpyt_argon2_* uint8_t *salt, size_t out_length, uint8_t *out, - urcrypt_argon2_malloc_t malloc_ptr, + urcrypt_argon2_alloc_t alloc_ptr, urcrypt_argon2_free_t free_ptr); int urcrypt_blake2(size_t message_length, @@ -212,13 +214,12 @@ int urcrypt_blake2(size_t message_length, */ typedef struct urcrypt_secp_context_struct urcrypt_secp_context; -// malloc a pointer of this size and pass it to init +// size of opaque secp handle, malloc and pass to init size_t urcrypt_secp_prealloc_size(void); // call this once at per context with high quality entropy int urcrypt_secp_init(urcrypt_secp_context *context, - void* prealloc, uint8_t entropy[32]); -// call just before freeing prealloc'd pointer +// call before freeing opaque secp handle void urcrypt_secp_destroy(urcrypt_secp_context *context); /* restore initial secp context conditons (not thread-safe). Recommendation: @@ -229,7 +230,8 @@ void urcrypt_secp_cleanup(void); // technically usable without the secp context int urcrypt_secp_make(uint8_t hash[32], uint8_t key[32], uint8_t out[32]); -int urcrypt_secp_reco(uint8_t hash[32], +int urcrypt_secp_reco(urcrypt_secp_context* context, + uint8_t hash[32], uint8_t key_v, // 0, 1, 2, 3 const uint8_t key_r[32], const uint8_t key_s[32], From 42e1180b0d93edf8e661e0ed31e29525318747b5 Mon Sep 17 00:00:00 2001 From: Paul Driver Date: Wed, 30 Sep 2020 10:56:20 -0700 Subject: [PATCH 048/329] updating solid pill after merge --- bin/solid.pill | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/solid.pill b/bin/solid.pill index 5add4da3d..30adcdd6c 100644 --- a/bin/solid.pill +++ b/bin/solid.pill @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:6def8b55a977e3ced47d6042dba819450655421623efd4ed5db0852b0bce8723 -size 6229538 +oid sha256:d9343cf6ddb6ecb4277d8ea6026119f74c5cec7e5940eb8949ed3259d2fd31d2 +size 6238109 From 7bca3a86cf294886733847f5411aea0693f8f926 Mon Sep 17 00:00:00 2001 From: Paul Driver Date: Fri, 2 Oct 2020 09:08:56 -0700 Subject: [PATCH 049/329] obliterate ge-additions package, move to urcrypt --- nix/deps-env.nix | 2 +- nix/pkgs/default.nix | 11 +++------- nix/pkgs/ge-additions/builder.sh | 7 ------- nix/pkgs/ge-additions/cross.nix | 12 ----------- nix/pkgs/ge-additions/default.nix | 9 -------- nix/pkgs/ge-additions/release.sh | 13 ------------ nix/pkgs/urbit/default.nix | 4 ++-- nix/pkgs/urbit/release.nix | 3 +-- nix/pkgs/urbit/shell.nix | 2 +- nix/pkgs/urcrypt/default.nix | 4 ++-- nix/release.nix | 5 ----- pkg/ge-additions/Makefile | 20 ------------------ pkg/urbit/configure | 2 +- pkg/urcrypt/Makefile | 21 +++++++++++++------ pkg/{ => urcrypt}/ge-additions/LICENSE | 0 pkg/{ => urcrypt}/ge-additions/README.md | 0 pkg/{ => urcrypt}/ge-additions/ge-additions.c | 0 pkg/{ => urcrypt}/ge-additions/ge-additions.h | 0 pkg/urcrypt/urcrypt.c | 2 +- 19 files changed, 27 insertions(+), 90 deletions(-) delete mode 100644 nix/pkgs/ge-additions/builder.sh delete mode 100644 nix/pkgs/ge-additions/cross.nix delete mode 100644 nix/pkgs/ge-additions/default.nix delete mode 100644 nix/pkgs/ge-additions/release.sh delete mode 100644 pkg/ge-additions/Makefile rename pkg/{ => urcrypt}/ge-additions/LICENSE (100%) rename pkg/{ => urcrypt}/ge-additions/README.md (100%) rename pkg/{ => urcrypt}/ge-additions/ge-additions.c (100%) rename pkg/{ => urcrypt}/ge-additions/ge-additions.h (100%) diff --git a/nix/deps-env.nix b/nix/deps-env.nix index 7935da6ba..12cb9b8f4 100644 --- a/nix/deps-env.nix +++ b/nix/deps-env.nix @@ -20,7 +20,7 @@ let vendor = with deps; - [ argon2 ed25519 h2o murmur3 scrypt secp256k1 softfloat3 uv ent ge-additions urcrypt ivory-header ca-header ]; + [ argon2 ed25519 h2o murmur3 scrypt secp256k1 softfloat3 uv ent urcrypt ivory-header ca-header ]; in diff --git a/nix/pkgs/default.nix b/nix/pkgs/default.nix index 7a51f3187..35b8053d8 100644 --- a/nix/pkgs/default.nix +++ b/nix/pkgs/default.nix @@ -9,24 +9,19 @@ let arvo-ropsten = import ./arvo-ropsten { inherit pkgs; }; herb = import ../../pkg/herb { inherit pkgs; }; - ge-additions = import ./ge-additions { - inherit pkgs; - inherit (deps) ed25519; - }; - libaes_siv = import ./libaes_siv { inherit pkgs; }; urcrypt = import ./urcrypt { - inherit ge-additions libaes_siv; + inherit libaes_siv; inherit (pkgs) stdenv openssl gmp; inherit (deps) ed25519 argon2 secp256k1; }; mkUrbit = { debug }: import ./urbit { - inherit pkgs ent debug ge-additions urcrypt libaes_siv; + inherit pkgs ent debug urcrypt libaes_siv; inherit (deps) argon2 murmur3 uv ed25519 scrypt softfloat3; inherit (deps) secp256k1 h2o ivory-header ca-header; }; @@ -36,4 +31,4 @@ let in -{ inherit ent ge-additions urcrypt libaes_siv arvo arvo-ropsten herb urbit urbit-debug; } +{ inherit ent urcrypt libaes_siv arvo arvo-ropsten herb urbit urbit-debug; } diff --git a/nix/pkgs/ge-additions/builder.sh b/nix/pkgs/ge-additions/builder.sh deleted file mode 100644 index 5a0404377..000000000 --- a/nix/pkgs/ge-additions/builder.sh +++ /dev/null @@ -1,7 +0,0 @@ -source $stdenv/setup - -cp -r $src ./src -chmod -R u+w ./src -cd ./src - -PREFIX=$out make install diff --git a/nix/pkgs/ge-additions/cross.nix b/nix/pkgs/ge-additions/cross.nix deleted file mode 100644 index f16afad0b..000000000 --- a/nix/pkgs/ge-additions/cross.nix +++ /dev/null @@ -1,12 +0,0 @@ -{ env_name, env, deps }: - -env.make_derivation rec { - name = "ge-additions"; - builder = ./release.sh; - src = ../../../pkg/ge-additions; - - cross_inputs = [ deps.ed25519 ]; - - CC = "${env.host}-gcc"; - AR = "${env.host}-ar"; -} diff --git a/nix/pkgs/ge-additions/default.nix b/nix/pkgs/ge-additions/default.nix deleted file mode 100644 index e77098cff..000000000 --- a/nix/pkgs/ge-additions/default.nix +++ /dev/null @@ -1,9 +0,0 @@ -{ pkgs, ed25519 }: - -pkgs.stdenv.mkDerivation rec { - name = "ge-additions"; - builder = ./builder.sh; - src = ../../../pkg/ge-additions; - - nativeBuildInputs = [ ed25519 ]; -} diff --git a/nix/pkgs/ge-additions/release.sh b/nix/pkgs/ge-additions/release.sh deleted file mode 100644 index aaa54b5e1..000000000 --- a/nix/pkgs/ge-additions/release.sh +++ /dev/null @@ -1,13 +0,0 @@ -source $setup - -cp -r $src ./src -chmod -R u+w ./src -cd ./src - -for dep in $cross_inputs; do - export CFLAGS="${CFLAGS-} -I$dep/include" - export LDFLAGS="${LDFLAGS-} -L$dep/lib" -done - -PREFIX=$out make install - diff --git a/nix/pkgs/urbit/default.nix b/nix/pkgs/urbit/default.nix index b808d0afb..2aee0514c 100644 --- a/nix/pkgs/urbit/default.nix +++ b/nix/pkgs/urbit/default.nix @@ -1,7 +1,7 @@ { pkgs, debug, - argon2, ed25519, ent, ge-additions, urcrypt, libaes_siv, h2o, murmur3, scrypt, secp256k1, softfloat3, uv, ivory-header, ca-header + argon2, ed25519, ent, urcrypt, libaes_siv, h2o, murmur3, scrypt, secp256k1, softfloat3, uv, ivory-header, ca-header }: let @@ -26,7 +26,7 @@ let [ curl gmp sigseg openssl zlib lmdb ]; vendor = - [ argon2 softfloat3 ed25519 ent ge-additions urcrypt libaes_siv h2o scrypt uv murmur3 secp256k1 ivory-header ca-header ]; + [ argon2 softfloat3 ed25519 ent urcrypt libaes_siv h2o scrypt uv murmur3 secp256k1 ivory-header ca-header ]; urbit = pkgs.stdenv.mkDerivation { inherit name meta; diff --git a/nix/pkgs/urbit/release.nix b/nix/pkgs/urbit/release.nix index 411be8868..b1b823104 100644 --- a/nix/pkgs/urbit/release.nix +++ b/nix/pkgs/urbit/release.nix @@ -4,7 +4,6 @@ ent, name ? "urbit", debug ? false, - ge-additions, libaes_siv }: @@ -16,7 +15,7 @@ let vendor = with deps; - [ argon2 softfloat3 ed25519 ge-additions urcrypt libaes_siv h2o scrypt uv murmur3 secp256k1 ivory-header ca-header ]; + [ argon2 softfloat3 ed25519 urcrypt libaes_siv h2o scrypt uv murmur3 secp256k1 ivory-header ca-header ]; in diff --git a/nix/pkgs/urbit/shell.nix b/nix/pkgs/urbit/shell.nix index 9e5d781af..81392a9f3 100644 --- a/nix/pkgs/urbit/shell.nix +++ b/nix/pkgs/urbit/shell.nix @@ -10,7 +10,7 @@ import ./default.nix { inherit pkgs; debug = false; inherit (tlon) - ent ge-additions urcrypt libaes_siv; + ent urcrypt libaes_siv; inherit (deps) argon2 ed25519 h2o murmur3 scrypt secp256k1 softfloat3 uv ivory-header ca-header; } diff --git a/nix/pkgs/urcrypt/default.nix b/nix/pkgs/urcrypt/default.nix index 739d05005..f2e390274 100644 --- a/nix/pkgs/urcrypt/default.nix +++ b/nix/pkgs/urcrypt/default.nix @@ -1,4 +1,4 @@ -{ stdenv, openssl, gmp, ed25519, secp256k1, ge-additions, argon2, libaes_siv }: +{ stdenv, openssl, gmp, ed25519, secp256k1, argon2, libaes_siv }: stdenv.mkDerivation rec { name = "urcrypt"; @@ -6,6 +6,6 @@ stdenv.mkDerivation rec { src = ../../../pkg/urcrypt; buildInputs = [ - openssl gmp ed25519 secp256k1 argon2 ge-additions libaes_siv + openssl gmp ed25519 secp256k1 argon2 libaes_siv ]; } diff --git a/nix/release.nix b/nix/release.nix index 2ccd1098b..083e3b2e7 100644 --- a/nix/release.nix +++ b/nix/release.nix @@ -16,9 +16,6 @@ let ent = env: import ./pkgs/ent/cross.nix env; - ge-additions = env: - import ./pkgs/ge-additions/cross.nix env; - libaes_siv = env: import ./pkgs/libaes_siv/cross.nix env; @@ -27,7 +24,6 @@ let inherit debug; name = if debug then "urbit-debug" else "urbit"; ent = ent env; - ge-additions = ge-additions env; libaes_siv = libaes_siv env; }; @@ -36,7 +32,6 @@ let inherit (plat.env) curl libgmp libsigsegv openssl zlib lmdb; inherit (plat.env) cmake_toolchain; ent = ent plat; - ge-additions = ge-additions plat; libaes_siv = libaes_siv plat; urbit = urbit { env = plat; debug = false; }; urbit-debug = urbit { env = plat; debug = true; }; diff --git a/pkg/ge-additions/Makefile b/pkg/ge-additions/Makefile deleted file mode 100644 index 719e76a2c..000000000 --- a/pkg/ge-additions/Makefile +++ /dev/null @@ -1,20 +0,0 @@ -CC ?= cc -AR ?= ar -PREFIX ?= ./out - -################################################################################ - -.PHONY: all test install clean - -all: ge-additions.c ge-additions.h - $(CC) $(CFLAGS) -O3 -Wall -Werror -pedantic -std=gnu99 -c ge-additions.c - $(AR) rcs libge-additions.a ge-additions.o - -install: all - @mkdir -p $(PREFIX)/lib/ - @mkdir -p $(PREFIX)/include/ - cp libge-additions.a $(PREFIX)/lib/ - cp ge-additions.h $(PREFIX)/include/ - -clean: - rm -rf ./out diff --git a/pkg/urbit/configure b/pkg/urbit/configure index d496a86c0..a0758fcf0 100755 --- a/pkg/urbit/configure +++ b/pkg/urbit/configure @@ -6,7 +6,7 @@ URBIT_VERSION="0.10.8" deps=" \ curl gmp sigsegv argon2 ed25519 ent h2o scrypt uv murmur3 secp256k1 \ - softfloat3 ssl crypto z lmdb ge-additions aes_siv urcrypt pthread \ + softfloat3 ssl crypto z lmdb aes_siv urcrypt pthread \ " headers=" \ diff --git a/pkg/urcrypt/Makefile b/pkg/urcrypt/Makefile index 2c3d294ad..c9c9fa2cf 100644 --- a/pkg/urcrypt/Makefile +++ b/pkg/urcrypt/Makefile @@ -9,14 +9,23 @@ PREFIX ?= ./out CFLAGS := $(CFLAGS) -g -O3 -Wall -Werror -pedantic -std=gnu99 SOURCES = urcrypt.c urcrypt.h -liburcrypt.a: $(SOURCES) - $(CC) $(CFLAGS) -D URCRYPT_STATIC -c urcrypt.c -o urcrypt-static.o - $(AR) rcs liburcrypt.a urcrypt-static.o +GEO = ge-additions/ge-additions.o -liburcrypt.so: $(SOURCES) +$(GEO): ge-additions/ge-additions.c ge-additions/ge-additions.h + $(CC) $(CFLAGS) -c ge-additions/ge-additions.c -o $(GEO) + +urcrypt-static.o: $(SOURCES) $(GEO) + $(CC) $(CFLAGS) -D URCRYPT_STATIC -c urcrypt.c -o urcrypt-static.o + +liburcrypt.a: urcrypt-static.o $(GEO) + $(AR) rcs liburcrypt.a urcrypt-static.o $(GEO) + +urcrypt-shared.o: $(SOURCES) $(GEO) $(CC) $(CFLAGS) -fPIC -c urcrypt.c -o urcrypt-shared.o - $(CC) -shared urcrypt-shared.o -o liburcrypt.so \ - -led25519 -lge-additions -lssl -largon2 -laes_siv -lgmp -lsecp256k1 \ + +liburcrypt.so: urcrypt-shared.o + $(CC) -shared urcrypt-shared.o $(GEO) -o liburcrypt.so \ + -led25519 -lssl -largon2 -laes_siv -lgmp -lsecp256k1 \ -Wl,--no-undefined all: liburcrypt.a liburcrypt.so diff --git a/pkg/ge-additions/LICENSE b/pkg/urcrypt/ge-additions/LICENSE similarity index 100% rename from pkg/ge-additions/LICENSE rename to pkg/urcrypt/ge-additions/LICENSE diff --git a/pkg/ge-additions/README.md b/pkg/urcrypt/ge-additions/README.md similarity index 100% rename from pkg/ge-additions/README.md rename to pkg/urcrypt/ge-additions/README.md diff --git a/pkg/ge-additions/ge-additions.c b/pkg/urcrypt/ge-additions/ge-additions.c similarity index 100% rename from pkg/ge-additions/ge-additions.c rename to pkg/urcrypt/ge-additions/ge-additions.c diff --git a/pkg/ge-additions/ge-additions.h b/pkg/urcrypt/ge-additions/ge-additions.h similarity index 100% rename from pkg/ge-additions/ge-additions.h rename to pkg/urcrypt/ge-additions/ge-additions.h diff --git a/pkg/urcrypt/urcrypt.c b/pkg/urcrypt/urcrypt.c index a908b5f6c..bae6239cc 100644 --- a/pkg/urcrypt/urcrypt.c +++ b/pkg/urcrypt/urcrypt.c @@ -1,8 +1,8 @@ #include "urcrypt.h" +#include "ge-additions/ge-additions.h" #include #include -#include #include #include From 9ccdead8d8cdd30d2229bd11ed8d4a40861b4c96 Mon Sep 17 00:00:00 2001 From: Paul Driver Date: Fri, 2 Oct 2020 15:41:21 -0700 Subject: [PATCH 050/329] Squashed 'pkg/urcrypt/ed25519/' content from commit 7fa6712ef git-subtree-dir: pkg/urcrypt/ed25519 git-subtree-split: 7fa6712ef5d581a6981ec2b08ee623314cd1d1c4 --- ed25519_32.dll | Bin 0 -> 167526 bytes ed25519_64.dll | Bin 0 -> 174710 bytes license.txt | 16 + readme.md | 166 +++++ src/add_scalar.c | 69 ++ src/ed25519.h | 38 ++ src/fe.c | 1491 ++++++++++++++++++++++++++++++++++++++++++++ src/fe.h | 41 ++ src/fixedint.h | 72 +++ src/ge.c | 467 ++++++++++++++ src/ge.h | 74 +++ src/key_exchange.c | 79 +++ src/keypair.c | 16 + src/precomp_data.h | 1391 +++++++++++++++++++++++++++++++++++++++++ src/sc.c | 809 ++++++++++++++++++++++++ src/sc.h | 12 + src/seed.c | 40 ++ src/sha512.c | 275 ++++++++ src/sha512.h | 21 + src/sign.c | 31 + src/verify.c | 77 +++ test.c | 150 +++++ 22 files changed, 5335 insertions(+) create mode 100644 ed25519_32.dll create mode 100644 ed25519_64.dll create mode 100644 license.txt create mode 100644 readme.md create mode 100644 src/add_scalar.c create mode 100644 src/ed25519.h create mode 100644 src/fe.c create mode 100644 src/fe.h create mode 100644 src/fixedint.h create mode 100644 src/ge.c create mode 100644 src/ge.h create mode 100644 src/key_exchange.c create mode 100644 src/keypair.c create mode 100644 src/precomp_data.h create mode 100644 src/sc.c create mode 100644 src/sc.h create mode 100644 src/seed.c create mode 100644 src/sha512.c create mode 100644 src/sha512.h create mode 100644 src/sign.c create mode 100644 src/verify.c create mode 100644 test.c diff --git a/ed25519_32.dll b/ed25519_32.dll new file mode 100644 index 0000000000000000000000000000000000000000..80a61c3048747a72fbfc2973fc567056a7dacb60 GIT binary patch literal 167526 zcmeFadwg8ib>E92hU7pRX@=s^8c?t`j87aOLTtc9VkkvxSOTTF3~0jCg(v>t4>O~onXmVYrb@Wo8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fs?n6)V%_{+YueL3QbSYXl@eRi1A7ILls5<}g`+ZYFf<*fR$=Gz!G+c<&doPl z^Vom@2k8)CeA@JwaO7unS#{DO=X9M#6ZR&RbppSmy2L9t6~LuiFca`bOgnblDckC^ zvTW?efYdRhsNpJ9p`S=XYpV}bZe9@VLvJ2}n9C}ezAiR#rR^N7-DD=~Vy@>}|Mz;7 M&eb_$*k^J72PG=`*8l(j literal 0 HcmV?d00001 diff --git a/ed25519_64.dll b/ed25519_64.dll new file mode 100644 index 0000000000000000000000000000000000000000..6964679294e2facb0f28993d37f45996545cfaa7 GIT binary patch literal 174710 zcmeFadwdi{)<4{x>kI@YKq3JHBsywF5Hnm>P>?jtXg73Y5K!>8U{Hxyz(j%dk{F_C z$6oQay6WzO>upzE*RXyI(4e*)Tyd&?T)2FtRM(+_*s@9ti+T4<*>j1`=25t_Z;+XPvJ}FkC`h) z^~cO*am?Fe1~sh#i-q?3GxUW}JK{#x&7hFJa*9zmr49?xOFf;ZgD@ZL+sBNs$3 zvGEy{|H%`L%NvxdY041flGPb^R;;AP z=RwyXL7Fa2n|}LkL^i9mPSH1LdS&6_K>X|DM4>e3`u!kamzbg)7*L)f3SLW(UyPJh zj7H#^L$gJpDe)T<k= z%|X_k_x$#5=`QK+iu;GU1}#A{%4!!`a^c?lRegqUt zgR)*(aI+e?=AR6%3FZ!h>s4~eafdwm^pkz$Kmrwaf&f+xKu;W#^+t0hrV6FnkMijm z=ccDOSj{Fo`Gwg3l%i`;4sV&p_$WVU{1;*y-O)G{BcIi<$E|o&ljH<*5K3x17Pc(j zMrjn?gD8;GIdVK6X6w@ea*#k8*CUnHH>y1ua$w}kn21X2WPOvqS=B4`OA2QP;wOzI zMJgC));)@9=%yFxZRSXjlJwQ3y9(k<&cznGk)ZFSgd`+HB0wZA_Zv6WL2pREzK*gGNlfLotmPY@vv84FuUojndgQ{Mk8a{WfT)R+giYiKhoJc^XKot;0*NT)_sVoIW21U7~bx`4P*NO>)N*bP(OV5<~+>g1I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uB}#=3vGI&P>XK($%-T_prv4VsZd9&_9(KB zpf76k)cC>$irN(csv|1OYXU!t zMT^zOtg2-v@ar#)XbcoC!TP2bIXk9@CGE~nHKSx1V5-1UTY)01)XyOhA%%7-YPG<5 z6_+g0!s22Wmpr18^Q3*wpmyl~+T@79h6&w5uj$aWauM+`Zlq!%6$}FCemcE?jH5V7 zV=RV=bY=(2V`AYn^GM{8TR?TXT!$E8s2K&*QG#HNIHfP69PBht*`rIpQ~ex$oq9pZm_;q_vo%& z-LbF3%2Bd6=P^s7IZi1(V%wVQ90n#G3*!coCqqt|i;)inMz3>KO0{Ia>pTyVeW6)L zg4ZP`P9C4OjimPIFL!Pvo}+#k;0&#%X?#MHWCYipQ8Gg>%?Oe1=WVukBLVe@Q?+8V z98Jh{g<>EvUX|#1x~+^#eUY3-X4UpsEELL!I_P+EUTC~p(1mrXzx9DBLl1`OQKzG8 zrLi#tMN1Cf+>5`MP&;@R9#t<=6MoBO9Xeb z!5~-(s|Ao8DUltg^@5dB)!zaNL3ufky? z)o7OhASp~PYSsLIt;LnV8)ZDq`vJC&EDyQdn@!NfgNJavs%RvK3?>MADd zJhzCUU)$DIPkt$qI;HO*JEw`tik*hSeTR1*#b7pAMA1hx&6z~U+f=8QTXM+kl+`xu RFlp0DGve6UOB?rt{{;i+ocaI& literal 0 HcmV?d00001 diff --git a/license.txt b/license.txt new file mode 100644 index 000000000..c1503f912 --- /dev/null +++ b/license.txt @@ -0,0 +1,16 @@ +Copyright (c) 2015 Orson Peters + +This software is provided 'as-is', without any express or implied warranty. In no event will the +authors be held liable for any damages arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, including commercial +applications, and to alter it and redistribute it freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the + original software. If you use this software in a product, an acknowledgment in the product + documentation would be appreciated but is not required. + +2. Altered source versions must be plainly marked as such, and must not be misrepresented as + being the original software. + +3. This notice may not be removed or altered from any source distribution. diff --git a/readme.md b/readme.md new file mode 100644 index 000000000..89329bbe4 --- /dev/null +++ b/readme.md @@ -0,0 +1,166 @@ +Ed25519 +======= + +This is a portable implementation of [Ed25519](http://ed25519.cr.yp.to/) based +on the SUPERCOP "ref10" implementation. Additionally there is key exchanging +and scalar addition included to further aid building a PKI using Ed25519. All +code is licensed under the permissive zlib license. + +All code is pure ANSI C without any dependencies, except for the random seed +generation which uses standard OS cryptography APIs (`CryptGenRandom` on +Windows, `/dev/urandom` on nix). If you wish to be entirely portable define +`ED25519_NO_SEED`. This disables the `ed25519_create_seed` function, so if your +application requires key generation you must supply your own seeding function +(which is simply a 256 bit (32 byte) cryptographic random number generator). + + +Performance +----------- + +On a Windows machine with an Intel Pentium B970 @ 2.3GHz I got the following +speeds (running on only one a single core): + + Seed generation: 64us (15625 per second) + Key generation: 88us (11364 per second) + Message signing (short message): 87us (11494 per second) + Message verifying (short message): 228us (4386 per second) + Scalar addition: 100us (10000 per second) + Key exchange: 220us (4545 per second) + +The speeds on other machines may vary. Sign/verify times will be higher with +longer messages. The implementation significantly benefits from 64 bit +architectures, if possible compile as 64 bit. + + +Usage +----- + +Simply add all .c and .h files in the `src/` folder to your project and include +`ed25519.h` in any file you want to use the API. If you prefer to use a shared +library, only copy `ed25519.h` and define `ED25519_DLL` before importing. A +windows DLL is pre-built. + +There are no defined types for seeds, private keys, public keys, shared secrets +or signatures. Instead simple `unsigned char` buffers are used with the +following sizes: + +```c +unsigned char seed[32]; +unsigned char signature[64]; +unsigned char public_key[32]; +unsigned char private_key[64]; +unsigned char scalar[32]; +unsigned char shared_secret[32]; +``` + +API +--- + +```c +int ed25519_create_seed(unsigned char *seed); +``` + +Creates a 32 byte random seed in `seed` for key generation. `seed` must be a +writable 32 byte buffer. Returns 0 on success, and nonzero on failure. + +```c +void ed25519_create_keypair(unsigned char *public_key, unsigned char *private_key, + const unsigned char *seed); +``` + +Creates a new key pair from the given seed. `public_key` must be a writable 32 +byte buffer, `private_key` must be a writable 64 byte buffer and `seed` must be +a 32 byte buffer. + +```c +void ed25519_sign(unsigned char *signature, + const unsigned char *message, size_t message_len, + const unsigned char *public_key, const unsigned char *private_key); +``` + +Creates a signature of the given message with the given key pair. `signature` +must be a writable 64 byte buffer. `message` must have at least `message_len` +bytes to be read. + +```c +int ed25519_verify(const unsigned char *signature, + const unsigned char *message, size_t message_len, + const unsigned char *public_key); +``` + +Verifies the signature on the given message using `public_key`. `signature` +must be a readable 64 byte buffer. `message` must have at least `message_len` +bytes to be read. Returns 1 if the signature matches, 0 otherwise. + +```c +void ed25519_add_scalar(unsigned char *public_key, unsigned char *private_key, + const unsigned char *scalar); +``` + +Adds `scalar` to the given key pair where scalar is a 32 byte buffer (possibly +generated with `ed25519_create_seed`), generating a new key pair. You can +calculate the public key sum without knowing the private key and vice versa by +passing in `NULL` for the key you don't know. This is useful for enforcing +randomness on a key pair by a third party while only knowing the public key, +among other things. Warning: the last bit of the scalar is ignored - if +comparing scalars make sure to clear it with `scalar[31] &= 127`. + + +```c +void ed25519_key_exchange(unsigned char *shared_secret, + const unsigned char *public_key, const unsigned char *private_key); +``` + +Performs a key exchange on the given public key and private key, producing a +shared secret. It is recommended to hash the shared secret before using it. +`shared_secret` must be a 32 byte writable buffer where the shared secret will +be stored. + +Example +------- + +```c +unsigned char seed[32], public_key[32], private_key[64], signature[64]; +unsigned char other_public_key[32], other_private_key[64], shared_secret[32]; +const unsigned char message[] = "TEST MESSAGE"; + +/* create a random seed, and a key pair out of that seed */ +if (ed25519_create_seed(seed)) { + printf("error while generating seed\n"); + exit(1); +} + +ed25519_create_keypair(public_key, private_key, seed); + +/* create signature on the message with the key pair */ +ed25519_sign(signature, message, strlen(message), public_key, private_key); + +/* verify the signature */ +if (ed25519_verify(signature, message, strlen(message), public_key)) { + printf("valid signature\n"); +} else { + printf("invalid signature\n"); +} + +/* create a dummy keypair to use for a key exchange, normally you'd only have +the public key and receive it through some communication channel */ +if (ed25519_create_seed(seed)) { + printf("error while generating seed\n"); + exit(1); +} + +ed25519_create_keypair(other_public_key, other_private_key, seed); + +/* do a key exchange with other_public_key */ +ed25519_key_exchange(shared_secret, other_public_key, private_key); + +/* + the magic here is that ed25519_key_exchange(shared_secret, public_key, + other_private_key); would result in the same shared_secret +*/ + +``` + +License +------- +All code is released under the zlib license. See license.txt for details. diff --git a/src/add_scalar.c b/src/add_scalar.c new file mode 100644 index 000000000..7528a7a4a --- /dev/null +++ b/src/add_scalar.c @@ -0,0 +1,69 @@ +#include "ed25519.h" +#include "ge.h" +#include "sc.h" +#include "sha512.h" + + +/* see http://crypto.stackexchange.com/a/6215/4697 */ +void ed25519_add_scalar(unsigned char *public_key, unsigned char *private_key, const unsigned char *scalar) { + const unsigned char SC_1[32] = {1}; /* scalar with value 1 */ + + unsigned char n[32]; + ge_p3 nB; + ge_p1p1 A_p1p1; + ge_p3 A; + ge_p3 public_key_unpacked; + ge_cached T; + + sha512_context hash; + unsigned char hashbuf[64]; + + int i; + + /* copy the scalar and clear highest bit */ + for (i = 0; i < 31; ++i) { + n[i] = scalar[i]; + } + n[31] = scalar[31] & 127; + + /* private key: a = n + t */ + if (private_key) { + sc_muladd(private_key, SC_1, n, private_key); + + // https://github.com/orlp/ed25519/issues/3 + sha512_init(&hash); + sha512_update(&hash, private_key + 32, 32); + sha512_update(&hash, scalar, 32); + sha512_final(&hash, hashbuf); + for (i = 0; i < 32; ++i) { + private_key[32 + i] = hashbuf[i]; + } + } + + /* public key: A = nB + T */ + if (public_key) { + /* if we know the private key we don't need a point addition, which is faster */ + /* using a "timing attack" you could find out wether or not we know the private + key, but this information seems rather useless - if this is important pass + public_key and private_key seperately in 2 function calls */ + if (private_key) { + ge_scalarmult_base(&A, private_key); + } else { + /* unpack public key into T */ + ge_frombytes_negate_vartime(&public_key_unpacked, public_key); + fe_neg(public_key_unpacked.X, public_key_unpacked.X); /* undo negate */ + fe_neg(public_key_unpacked.T, public_key_unpacked.T); /* undo negate */ + ge_p3_to_cached(&T, &public_key_unpacked); + + /* calculate n*B */ + ge_scalarmult_base(&nB, n); + + /* A = n*B + T */ + ge_add(&A_p1p1, &nB, &T); + ge_p1p1_to_p3(&A, &A_p1p1); + } + + /* pack public key */ + ge_p3_tobytes(public_key, &A); + } +} diff --git a/src/ed25519.h b/src/ed25519.h new file mode 100644 index 000000000..8924659fa --- /dev/null +++ b/src/ed25519.h @@ -0,0 +1,38 @@ +#ifndef ED25519_H +#define ED25519_H + +#include + +#if defined(_WIN32) + #if defined(ED25519_BUILD_DLL) + #define ED25519_DECLSPEC __declspec(dllexport) + #elif defined(ED25519_DLL) + #define ED25519_DECLSPEC __declspec(dllimport) + #else + #define ED25519_DECLSPEC + #endif +#else + #define ED25519_DECLSPEC +#endif + + +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef ED25519_NO_SEED +int ED25519_DECLSPEC ed25519_create_seed(unsigned char *seed); +#endif + +void ED25519_DECLSPEC ed25519_create_keypair(unsigned char *public_key, unsigned char *private_key, const unsigned char *seed); +void ED25519_DECLSPEC ed25519_sign(unsigned char *signature, const unsigned char *message, size_t message_len, const unsigned char *public_key, const unsigned char *private_key); +int ED25519_DECLSPEC ed25519_verify(const unsigned char *signature, const unsigned char *message, size_t message_len, const unsigned char *public_key); +void ED25519_DECLSPEC ed25519_add_scalar(unsigned char *public_key, unsigned char *private_key, const unsigned char *scalar); +void ED25519_DECLSPEC ed25519_key_exchange(unsigned char *shared_secret, const unsigned char *public_key, const unsigned char *private_key); + + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/src/fe.c b/src/fe.c new file mode 100644 index 000000000..2105eb7b2 --- /dev/null +++ b/src/fe.c @@ -0,0 +1,1491 @@ +#include "fixedint.h" +#include "fe.h" + + +/* + helper functions +*/ +static uint64_t load_3(const unsigned char *in) { + uint64_t result; + + result = (uint64_t) in[0]; + result |= ((uint64_t) in[1]) << 8; + result |= ((uint64_t) in[2]) << 16; + + return result; +} + +static uint64_t load_4(const unsigned char *in) { + uint64_t result; + + result = (uint64_t) in[0]; + result |= ((uint64_t) in[1]) << 8; + result |= ((uint64_t) in[2]) << 16; + result |= ((uint64_t) in[3]) << 24; + + return result; +} + + + +/* + h = 0 +*/ + +void fe_0(fe h) { + h[0] = 0; + h[1] = 0; + h[2] = 0; + h[3] = 0; + h[4] = 0; + h[5] = 0; + h[6] = 0; + h[7] = 0; + h[8] = 0; + h[9] = 0; +} + + + +/* + h = 1 +*/ + +void fe_1(fe h) { + h[0] = 1; + h[1] = 0; + h[2] = 0; + h[3] = 0; + h[4] = 0; + h[5] = 0; + h[6] = 0; + h[7] = 0; + h[8] = 0; + h[9] = 0; +} + + + +/* + h = f + g + Can overlap h with f or g. + + Preconditions: + |f| bounded by 1.1*2^25,1.1*2^24,1.1*2^25,1.1*2^24,etc. + |g| bounded by 1.1*2^25,1.1*2^24,1.1*2^25,1.1*2^24,etc. + + Postconditions: + |h| bounded by 1.1*2^26,1.1*2^25,1.1*2^26,1.1*2^25,etc. +*/ + +void fe_add(fe h, const fe f, const fe g) { + int32_t f0 = f[0]; + int32_t f1 = f[1]; + int32_t f2 = f[2]; + int32_t f3 = f[3]; + int32_t f4 = f[4]; + int32_t f5 = f[5]; + int32_t f6 = f[6]; + int32_t f7 = f[7]; + int32_t f8 = f[8]; + int32_t f9 = f[9]; + int32_t g0 = g[0]; + int32_t g1 = g[1]; + int32_t g2 = g[2]; + int32_t g3 = g[3]; + int32_t g4 = g[4]; + int32_t g5 = g[5]; + int32_t g6 = g[6]; + int32_t g7 = g[7]; + int32_t g8 = g[8]; + int32_t g9 = g[9]; + int32_t h0 = f0 + g0; + int32_t h1 = f1 + g1; + int32_t h2 = f2 + g2; + int32_t h3 = f3 + g3; + int32_t h4 = f4 + g4; + int32_t h5 = f5 + g5; + int32_t h6 = f6 + g6; + int32_t h7 = f7 + g7; + int32_t h8 = f8 + g8; + int32_t h9 = f9 + g9; + + h[0] = h0; + h[1] = h1; + h[2] = h2; + h[3] = h3; + h[4] = h4; + h[5] = h5; + h[6] = h6; + h[7] = h7; + h[8] = h8; + h[9] = h9; +} + + + +/* + Replace (f,g) with (g,g) if b == 1; + replace (f,g) with (f,g) if b == 0. + + Preconditions: b in {0,1}. +*/ + +void fe_cmov(fe f, const fe g, unsigned int b) { + int32_t f0 = f[0]; + int32_t f1 = f[1]; + int32_t f2 = f[2]; + int32_t f3 = f[3]; + int32_t f4 = f[4]; + int32_t f5 = f[5]; + int32_t f6 = f[6]; + int32_t f7 = f[7]; + int32_t f8 = f[8]; + int32_t f9 = f[9]; + int32_t g0 = g[0]; + int32_t g1 = g[1]; + int32_t g2 = g[2]; + int32_t g3 = g[3]; + int32_t g4 = g[4]; + int32_t g5 = g[5]; + int32_t g6 = g[6]; + int32_t g7 = g[7]; + int32_t g8 = g[8]; + int32_t g9 = g[9]; + int32_t x0 = f0 ^ g0; + int32_t x1 = f1 ^ g1; + int32_t x2 = f2 ^ g2; + int32_t x3 = f3 ^ g3; + int32_t x4 = f4 ^ g4; + int32_t x5 = f5 ^ g5; + int32_t x6 = f6 ^ g6; + int32_t x7 = f7 ^ g7; + int32_t x8 = f8 ^ g8; + int32_t x9 = f9 ^ g9; + + b = (unsigned int) (- (int) b); /* silence warning */ + x0 &= b; + x1 &= b; + x2 &= b; + x3 &= b; + x4 &= b; + x5 &= b; + x6 &= b; + x7 &= b; + x8 &= b; + x9 &= b; + + f[0] = f0 ^ x0; + f[1] = f1 ^ x1; + f[2] = f2 ^ x2; + f[3] = f3 ^ x3; + f[4] = f4 ^ x4; + f[5] = f5 ^ x5; + f[6] = f6 ^ x6; + f[7] = f7 ^ x7; + f[8] = f8 ^ x8; + f[9] = f9 ^ x9; +} + +/* + Replace (f,g) with (g,f) if b == 1; + replace (f,g) with (f,g) if b == 0. + + Preconditions: b in {0,1}. +*/ + +void fe_cswap(fe f,fe g,unsigned int b) { + int32_t f0 = f[0]; + int32_t f1 = f[1]; + int32_t f2 = f[2]; + int32_t f3 = f[3]; + int32_t f4 = f[4]; + int32_t f5 = f[5]; + int32_t f6 = f[6]; + int32_t f7 = f[7]; + int32_t f8 = f[8]; + int32_t f9 = f[9]; + int32_t g0 = g[0]; + int32_t g1 = g[1]; + int32_t g2 = g[2]; + int32_t g3 = g[3]; + int32_t g4 = g[4]; + int32_t g5 = g[5]; + int32_t g6 = g[6]; + int32_t g7 = g[7]; + int32_t g8 = g[8]; + int32_t g9 = g[9]; + int32_t x0 = f0 ^ g0; + int32_t x1 = f1 ^ g1; + int32_t x2 = f2 ^ g2; + int32_t x3 = f3 ^ g3; + int32_t x4 = f4 ^ g4; + int32_t x5 = f5 ^ g5; + int32_t x6 = f6 ^ g6; + int32_t x7 = f7 ^ g7; + int32_t x8 = f8 ^ g8; + int32_t x9 = f9 ^ g9; + b = (unsigned int) (- (int) b); /* silence warning */ + x0 &= b; + x1 &= b; + x2 &= b; + x3 &= b; + x4 &= b; + x5 &= b; + x6 &= b; + x7 &= b; + x8 &= b; + x9 &= b; + f[0] = f0 ^ x0; + f[1] = f1 ^ x1; + f[2] = f2 ^ x2; + f[3] = f3 ^ x3; + f[4] = f4 ^ x4; + f[5] = f5 ^ x5; + f[6] = f6 ^ x6; + f[7] = f7 ^ x7; + f[8] = f8 ^ x8; + f[9] = f9 ^ x9; + g[0] = g0 ^ x0; + g[1] = g1 ^ x1; + g[2] = g2 ^ x2; + g[3] = g3 ^ x3; + g[4] = g4 ^ x4; + g[5] = g5 ^ x5; + g[6] = g6 ^ x6; + g[7] = g7 ^ x7; + g[8] = g8 ^ x8; + g[9] = g9 ^ x9; +} + + + +/* + h = f +*/ + +void fe_copy(fe h, const fe f) { + int32_t f0 = f[0]; + int32_t f1 = f[1]; + int32_t f2 = f[2]; + int32_t f3 = f[3]; + int32_t f4 = f[4]; + int32_t f5 = f[5]; + int32_t f6 = f[6]; + int32_t f7 = f[7]; + int32_t f8 = f[8]; + int32_t f9 = f[9]; + + h[0] = f0; + h[1] = f1; + h[2] = f2; + h[3] = f3; + h[4] = f4; + h[5] = f5; + h[6] = f6; + h[7] = f7; + h[8] = f8; + h[9] = f9; +} + + + +/* + Ignores top bit of h. +*/ + +void fe_frombytes(fe h, const unsigned char *s) { + int64_t h0 = load_4(s); + int64_t h1 = load_3(s + 4) << 6; + int64_t h2 = load_3(s + 7) << 5; + int64_t h3 = load_3(s + 10) << 3; + int64_t h4 = load_3(s + 13) << 2; + int64_t h5 = load_4(s + 16); + int64_t h6 = load_3(s + 20) << 7; + int64_t h7 = load_3(s + 23) << 5; + int64_t h8 = load_3(s + 26) << 4; + int64_t h9 = (load_3(s + 29) & 8388607) << 2; + int64_t carry0; + int64_t carry1; + int64_t carry2; + int64_t carry3; + int64_t carry4; + int64_t carry5; + int64_t carry6; + int64_t carry7; + int64_t carry8; + int64_t carry9; + + carry9 = (h9 + (int64_t) (1 << 24)) >> 25; + h0 += carry9 * 19; + h9 -= carry9 << 25; + carry1 = (h1 + (int64_t) (1 << 24)) >> 25; + h2 += carry1; + h1 -= carry1 << 25; + carry3 = (h3 + (int64_t) (1 << 24)) >> 25; + h4 += carry3; + h3 -= carry3 << 25; + carry5 = (h5 + (int64_t) (1 << 24)) >> 25; + h6 += carry5; + h5 -= carry5 << 25; + carry7 = (h7 + (int64_t) (1 << 24)) >> 25; + h8 += carry7; + h7 -= carry7 << 25; + carry0 = (h0 + (int64_t) (1 << 25)) >> 26; + h1 += carry0; + h0 -= carry0 << 26; + carry2 = (h2 + (int64_t) (1 << 25)) >> 26; + h3 += carry2; + h2 -= carry2 << 26; + carry4 = (h4 + (int64_t) (1 << 25)) >> 26; + h5 += carry4; + h4 -= carry4 << 26; + carry6 = (h6 + (int64_t) (1 << 25)) >> 26; + h7 += carry6; + h6 -= carry6 << 26; + carry8 = (h8 + (int64_t) (1 << 25)) >> 26; + h9 += carry8; + h8 -= carry8 << 26; + + h[0] = (int32_t) h0; + h[1] = (int32_t) h1; + h[2] = (int32_t) h2; + h[3] = (int32_t) h3; + h[4] = (int32_t) h4; + h[5] = (int32_t) h5; + h[6] = (int32_t) h6; + h[7] = (int32_t) h7; + h[8] = (int32_t) h8; + h[9] = (int32_t) h9; +} + + + +void fe_invert(fe out, const fe z) { + fe t0; + fe t1; + fe t2; + fe t3; + int i; + + fe_sq(t0, z); + + for (i = 1; i < 1; ++i) { + fe_sq(t0, t0); + } + + fe_sq(t1, t0); + + for (i = 1; i < 2; ++i) { + fe_sq(t1, t1); + } + + fe_mul(t1, z, t1); + fe_mul(t0, t0, t1); + fe_sq(t2, t0); + + for (i = 1; i < 1; ++i) { + fe_sq(t2, t2); + } + + fe_mul(t1, t1, t2); + fe_sq(t2, t1); + + for (i = 1; i < 5; ++i) { + fe_sq(t2, t2); + } + + fe_mul(t1, t2, t1); + fe_sq(t2, t1); + + for (i = 1; i < 10; ++i) { + fe_sq(t2, t2); + } + + fe_mul(t2, t2, t1); + fe_sq(t3, t2); + + for (i = 1; i < 20; ++i) { + fe_sq(t3, t3); + } + + fe_mul(t2, t3, t2); + fe_sq(t2, t2); + + for (i = 1; i < 10; ++i) { + fe_sq(t2, t2); + } + + fe_mul(t1, t2, t1); + fe_sq(t2, t1); + + for (i = 1; i < 50; ++i) { + fe_sq(t2, t2); + } + + fe_mul(t2, t2, t1); + fe_sq(t3, t2); + + for (i = 1; i < 100; ++i) { + fe_sq(t3, t3); + } + + fe_mul(t2, t3, t2); + fe_sq(t2, t2); + + for (i = 1; i < 50; ++i) { + fe_sq(t2, t2); + } + + fe_mul(t1, t2, t1); + fe_sq(t1, t1); + + for (i = 1; i < 5; ++i) { + fe_sq(t1, t1); + } + + fe_mul(out, t1, t0); +} + + + +/* + return 1 if f is in {1,3,5,...,q-2} + return 0 if f is in {0,2,4,...,q-1} + + Preconditions: + |f| bounded by 1.1*2^26,1.1*2^25,1.1*2^26,1.1*2^25,etc. +*/ + +int fe_isnegative(const fe f) { + unsigned char s[32]; + + fe_tobytes(s, f); + + return s[0] & 1; +} + + + +/* + return 1 if f == 0 + return 0 if f != 0 + + Preconditions: + |f| bounded by 1.1*2^26,1.1*2^25,1.1*2^26,1.1*2^25,etc. +*/ + +int fe_isnonzero(const fe f) { + unsigned char s[32]; + unsigned char r; + + fe_tobytes(s, f); + + r = s[0]; + #define F(i) r |= s[i] + F(1); + F(2); + F(3); + F(4); + F(5); + F(6); + F(7); + F(8); + F(9); + F(10); + F(11); + F(12); + F(13); + F(14); + F(15); + F(16); + F(17); + F(18); + F(19); + F(20); + F(21); + F(22); + F(23); + F(24); + F(25); + F(26); + F(27); + F(28); + F(29); + F(30); + F(31); + #undef F + + return r != 0; +} + + + +/* + h = f * g + Can overlap h with f or g. + + Preconditions: + |f| bounded by 1.65*2^26,1.65*2^25,1.65*2^26,1.65*2^25,etc. + |g| bounded by 1.65*2^26,1.65*2^25,1.65*2^26,1.65*2^25,etc. + + Postconditions: + |h| bounded by 1.01*2^25,1.01*2^24,1.01*2^25,1.01*2^24,etc. + */ + + /* + Notes on implementation strategy: + + Using schoolbook multiplication. + Karatsuba would save a little in some cost models. + + Most multiplications by 2 and 19 are 32-bit precomputations; + cheaper than 64-bit postcomputations. + + There is one remaining multiplication by 19 in the carry chain; + one *19 precomputation can be merged into this, + but the resulting data flow is considerably less clean. + + There are 12 carries below. + 10 of them are 2-way parallelizable and vectorizable. + Can get away with 11 carries, but then data flow is much deeper. + + With tighter constraints on inputs can squeeze carries into int32. +*/ + +void fe_mul(fe h, const fe f, const fe g) { + int32_t f0 = f[0]; + int32_t f1 = f[1]; + int32_t f2 = f[2]; + int32_t f3 = f[3]; + int32_t f4 = f[4]; + int32_t f5 = f[5]; + int32_t f6 = f[6]; + int32_t f7 = f[7]; + int32_t f8 = f[8]; + int32_t f9 = f[9]; + int32_t g0 = g[0]; + int32_t g1 = g[1]; + int32_t g2 = g[2]; + int32_t g3 = g[3]; + int32_t g4 = g[4]; + int32_t g5 = g[5]; + int32_t g6 = g[6]; + int32_t g7 = g[7]; + int32_t g8 = g[8]; + int32_t g9 = g[9]; + int32_t g1_19 = 19 * g1; /* 1.959375*2^29 */ + int32_t g2_19 = 19 * g2; /* 1.959375*2^30; still ok */ + int32_t g3_19 = 19 * g3; + int32_t g4_19 = 19 * g4; + int32_t g5_19 = 19 * g5; + int32_t g6_19 = 19 * g6; + int32_t g7_19 = 19 * g7; + int32_t g8_19 = 19 * g8; + int32_t g9_19 = 19 * g9; + int32_t f1_2 = 2 * f1; + int32_t f3_2 = 2 * f3; + int32_t f5_2 = 2 * f5; + int32_t f7_2 = 2 * f7; + int32_t f9_2 = 2 * f9; + int64_t f0g0 = f0 * (int64_t) g0; + int64_t f0g1 = f0 * (int64_t) g1; + int64_t f0g2 = f0 * (int64_t) g2; + int64_t f0g3 = f0 * (int64_t) g3; + int64_t f0g4 = f0 * (int64_t) g4; + int64_t f0g5 = f0 * (int64_t) g5; + int64_t f0g6 = f0 * (int64_t) g6; + int64_t f0g7 = f0 * (int64_t) g7; + int64_t f0g8 = f0 * (int64_t) g8; + int64_t f0g9 = f0 * (int64_t) g9; + int64_t f1g0 = f1 * (int64_t) g0; + int64_t f1g1_2 = f1_2 * (int64_t) g1; + int64_t f1g2 = f1 * (int64_t) g2; + int64_t f1g3_2 = f1_2 * (int64_t) g3; + int64_t f1g4 = f1 * (int64_t) g4; + int64_t f1g5_2 = f1_2 * (int64_t) g5; + int64_t f1g6 = f1 * (int64_t) g6; + int64_t f1g7_2 = f1_2 * (int64_t) g7; + int64_t f1g8 = f1 * (int64_t) g8; + int64_t f1g9_38 = f1_2 * (int64_t) g9_19; + int64_t f2g0 = f2 * (int64_t) g0; + int64_t f2g1 = f2 * (int64_t) g1; + int64_t f2g2 = f2 * (int64_t) g2; + int64_t f2g3 = f2 * (int64_t) g3; + int64_t f2g4 = f2 * (int64_t) g4; + int64_t f2g5 = f2 * (int64_t) g5; + int64_t f2g6 = f2 * (int64_t) g6; + int64_t f2g7 = f2 * (int64_t) g7; + int64_t f2g8_19 = f2 * (int64_t) g8_19; + int64_t f2g9_19 = f2 * (int64_t) g9_19; + int64_t f3g0 = f3 * (int64_t) g0; + int64_t f3g1_2 = f3_2 * (int64_t) g1; + int64_t f3g2 = f3 * (int64_t) g2; + int64_t f3g3_2 = f3_2 * (int64_t) g3; + int64_t f3g4 = f3 * (int64_t) g4; + int64_t f3g5_2 = f3_2 * (int64_t) g5; + int64_t f3g6 = f3 * (int64_t) g6; + int64_t f3g7_38 = f3_2 * (int64_t) g7_19; + int64_t f3g8_19 = f3 * (int64_t) g8_19; + int64_t f3g9_38 = f3_2 * (int64_t) g9_19; + int64_t f4g0 = f4 * (int64_t) g0; + int64_t f4g1 = f4 * (int64_t) g1; + int64_t f4g2 = f4 * (int64_t) g2; + int64_t f4g3 = f4 * (int64_t) g3; + int64_t f4g4 = f4 * (int64_t) g4; + int64_t f4g5 = f4 * (int64_t) g5; + int64_t f4g6_19 = f4 * (int64_t) g6_19; + int64_t f4g7_19 = f4 * (int64_t) g7_19; + int64_t f4g8_19 = f4 * (int64_t) g8_19; + int64_t f4g9_19 = f4 * (int64_t) g9_19; + int64_t f5g0 = f5 * (int64_t) g0; + int64_t f5g1_2 = f5_2 * (int64_t) g1; + int64_t f5g2 = f5 * (int64_t) g2; + int64_t f5g3_2 = f5_2 * (int64_t) g3; + int64_t f5g4 = f5 * (int64_t) g4; + int64_t f5g5_38 = f5_2 * (int64_t) g5_19; + int64_t f5g6_19 = f5 * (int64_t) g6_19; + int64_t f5g7_38 = f5_2 * (int64_t) g7_19; + int64_t f5g8_19 = f5 * (int64_t) g8_19; + int64_t f5g9_38 = f5_2 * (int64_t) g9_19; + int64_t f6g0 = f6 * (int64_t) g0; + int64_t f6g1 = f6 * (int64_t) g1; + int64_t f6g2 = f6 * (int64_t) g2; + int64_t f6g3 = f6 * (int64_t) g3; + int64_t f6g4_19 = f6 * (int64_t) g4_19; + int64_t f6g5_19 = f6 * (int64_t) g5_19; + int64_t f6g6_19 = f6 * (int64_t) g6_19; + int64_t f6g7_19 = f6 * (int64_t) g7_19; + int64_t f6g8_19 = f6 * (int64_t) g8_19; + int64_t f6g9_19 = f6 * (int64_t) g9_19; + int64_t f7g0 = f7 * (int64_t) g0; + int64_t f7g1_2 = f7_2 * (int64_t) g1; + int64_t f7g2 = f7 * (int64_t) g2; + int64_t f7g3_38 = f7_2 * (int64_t) g3_19; + int64_t f7g4_19 = f7 * (int64_t) g4_19; + int64_t f7g5_38 = f7_2 * (int64_t) g5_19; + int64_t f7g6_19 = f7 * (int64_t) g6_19; + int64_t f7g7_38 = f7_2 * (int64_t) g7_19; + int64_t f7g8_19 = f7 * (int64_t) g8_19; + int64_t f7g9_38 = f7_2 * (int64_t) g9_19; + int64_t f8g0 = f8 * (int64_t) g0; + int64_t f8g1 = f8 * (int64_t) g1; + int64_t f8g2_19 = f8 * (int64_t) g2_19; + int64_t f8g3_19 = f8 * (int64_t) g3_19; + int64_t f8g4_19 = f8 * (int64_t) g4_19; + int64_t f8g5_19 = f8 * (int64_t) g5_19; + int64_t f8g6_19 = f8 * (int64_t) g6_19; + int64_t f8g7_19 = f8 * (int64_t) g7_19; + int64_t f8g8_19 = f8 * (int64_t) g8_19; + int64_t f8g9_19 = f8 * (int64_t) g9_19; + int64_t f9g0 = f9 * (int64_t) g0; + int64_t f9g1_38 = f9_2 * (int64_t) g1_19; + int64_t f9g2_19 = f9 * (int64_t) g2_19; + int64_t f9g3_38 = f9_2 * (int64_t) g3_19; + int64_t f9g4_19 = f9 * (int64_t) g4_19; + int64_t f9g5_38 = f9_2 * (int64_t) g5_19; + int64_t f9g6_19 = f9 * (int64_t) g6_19; + int64_t f9g7_38 = f9_2 * (int64_t) g7_19; + int64_t f9g8_19 = f9 * (int64_t) g8_19; + int64_t f9g9_38 = f9_2 * (int64_t) g9_19; + int64_t h0 = f0g0 + f1g9_38 + f2g8_19 + f3g7_38 + f4g6_19 + f5g5_38 + f6g4_19 + f7g3_38 + f8g2_19 + f9g1_38; + int64_t h1 = f0g1 + f1g0 + f2g9_19 + f3g8_19 + f4g7_19 + f5g6_19 + f6g5_19 + f7g4_19 + f8g3_19 + f9g2_19; + int64_t h2 = f0g2 + f1g1_2 + f2g0 + f3g9_38 + f4g8_19 + f5g7_38 + f6g6_19 + f7g5_38 + f8g4_19 + f9g3_38; + int64_t h3 = f0g3 + f1g2 + f2g1 + f3g0 + f4g9_19 + f5g8_19 + f6g7_19 + f7g6_19 + f8g5_19 + f9g4_19; + int64_t h4 = f0g4 + f1g3_2 + f2g2 + f3g1_2 + f4g0 + f5g9_38 + f6g8_19 + f7g7_38 + f8g6_19 + f9g5_38; + int64_t h5 = f0g5 + f1g4 + f2g3 + f3g2 + f4g1 + f5g0 + f6g9_19 + f7g8_19 + f8g7_19 + f9g6_19; + int64_t h6 = f0g6 + f1g5_2 + f2g4 + f3g3_2 + f4g2 + f5g1_2 + f6g0 + f7g9_38 + f8g8_19 + f9g7_38; + int64_t h7 = f0g7 + f1g6 + f2g5 + f3g4 + f4g3 + f5g2 + f6g1 + f7g0 + f8g9_19 + f9g8_19; + int64_t h8 = f0g8 + f1g7_2 + f2g6 + f3g5_2 + f4g4 + f5g3_2 + f6g2 + f7g1_2 + f8g0 + f9g9_38; + int64_t h9 = f0g9 + f1g8 + f2g7 + f3g6 + f4g5 + f5g4 + f6g3 + f7g2 + f8g1 + f9g0 ; + int64_t carry0; + int64_t carry1; + int64_t carry2; + int64_t carry3; + int64_t carry4; + int64_t carry5; + int64_t carry6; + int64_t carry7; + int64_t carry8; + int64_t carry9; + + carry0 = (h0 + (int64_t) (1 << 25)) >> 26; + h1 += carry0; + h0 -= carry0 << 26; + carry4 = (h4 + (int64_t) (1 << 25)) >> 26; + h5 += carry4; + h4 -= carry4 << 26; + + carry1 = (h1 + (int64_t) (1 << 24)) >> 25; + h2 += carry1; + h1 -= carry1 << 25; + carry5 = (h5 + (int64_t) (1 << 24)) >> 25; + h6 += carry5; + h5 -= carry5 << 25; + + carry2 = (h2 + (int64_t) (1 << 25)) >> 26; + h3 += carry2; + h2 -= carry2 << 26; + carry6 = (h6 + (int64_t) (1 << 25)) >> 26; + h7 += carry6; + h6 -= carry6 << 26; + + carry3 = (h3 + (int64_t) (1 << 24)) >> 25; + h4 += carry3; + h3 -= carry3 << 25; + carry7 = (h7 + (int64_t) (1 << 24)) >> 25; + h8 += carry7; + h7 -= carry7 << 25; + + carry4 = (h4 + (int64_t) (1 << 25)) >> 26; + h5 += carry4; + h4 -= carry4 << 26; + carry8 = (h8 + (int64_t) (1 << 25)) >> 26; + h9 += carry8; + h8 -= carry8 << 26; + + carry9 = (h9 + (int64_t) (1 << 24)) >> 25; + h0 += carry9 * 19; + h9 -= carry9 << 25; + + carry0 = (h0 + (int64_t) (1 << 25)) >> 26; + h1 += carry0; + h0 -= carry0 << 26; + + h[0] = (int32_t) h0; + h[1] = (int32_t) h1; + h[2] = (int32_t) h2; + h[3] = (int32_t) h3; + h[4] = (int32_t) h4; + h[5] = (int32_t) h5; + h[6] = (int32_t) h6; + h[7] = (int32_t) h7; + h[8] = (int32_t) h8; + h[9] = (int32_t) h9; +} + + +/* +h = f * 121666 +Can overlap h with f. + +Preconditions: + |f| bounded by 1.1*2^26,1.1*2^25,1.1*2^26,1.1*2^25,etc. + +Postconditions: + |h| bounded by 1.1*2^25,1.1*2^24,1.1*2^25,1.1*2^24,etc. +*/ + +void fe_mul121666(fe h, fe f) { + int32_t f0 = f[0]; + int32_t f1 = f[1]; + int32_t f2 = f[2]; + int32_t f3 = f[3]; + int32_t f4 = f[4]; + int32_t f5 = f[5]; + int32_t f6 = f[6]; + int32_t f7 = f[7]; + int32_t f8 = f[8]; + int32_t f9 = f[9]; + int64_t h0 = f0 * (int64_t) 121666; + int64_t h1 = f1 * (int64_t) 121666; + int64_t h2 = f2 * (int64_t) 121666; + int64_t h3 = f3 * (int64_t) 121666; + int64_t h4 = f4 * (int64_t) 121666; + int64_t h5 = f5 * (int64_t) 121666; + int64_t h6 = f6 * (int64_t) 121666; + int64_t h7 = f7 * (int64_t) 121666; + int64_t h8 = f8 * (int64_t) 121666; + int64_t h9 = f9 * (int64_t) 121666; + int64_t carry0; + int64_t carry1; + int64_t carry2; + int64_t carry3; + int64_t carry4; + int64_t carry5; + int64_t carry6; + int64_t carry7; + int64_t carry8; + int64_t carry9; + + carry9 = (h9 + (int64_t) (1<<24)) >> 25; h0 += carry9 * 19; h9 -= carry9 << 25; + carry1 = (h1 + (int64_t) (1<<24)) >> 25; h2 += carry1; h1 -= carry1 << 25; + carry3 = (h3 + (int64_t) (1<<24)) >> 25; h4 += carry3; h3 -= carry3 << 25; + carry5 = (h5 + (int64_t) (1<<24)) >> 25; h6 += carry5; h5 -= carry5 << 25; + carry7 = (h7 + (int64_t) (1<<24)) >> 25; h8 += carry7; h7 -= carry7 << 25; + + carry0 = (h0 + (int64_t) (1<<25)) >> 26; h1 += carry0; h0 -= carry0 << 26; + carry2 = (h2 + (int64_t) (1<<25)) >> 26; h3 += carry2; h2 -= carry2 << 26; + carry4 = (h4 + (int64_t) (1<<25)) >> 26; h5 += carry4; h4 -= carry4 << 26; + carry6 = (h6 + (int64_t) (1<<25)) >> 26; h7 += carry6; h6 -= carry6 << 26; + carry8 = (h8 + (int64_t) (1<<25)) >> 26; h9 += carry8; h8 -= carry8 << 26; + + h[0] = (int32_t) h0; + h[1] = (int32_t) h1; + h[2] = (int32_t) h2; + h[3] = (int32_t) h3; + h[4] = (int32_t) h4; + h[5] = (int32_t) h5; + h[6] = (int32_t) h6; + h[7] = (int32_t) h7; + h[8] = (int32_t) h8; + h[9] = (int32_t) h9; +} + + +/* +h = -f + +Preconditions: + |f| bounded by 1.1*2^25,1.1*2^24,1.1*2^25,1.1*2^24,etc. + +Postconditions: + |h| bounded by 1.1*2^25,1.1*2^24,1.1*2^25,1.1*2^24,etc. +*/ + +void fe_neg(fe h, const fe f) { + int32_t f0 = f[0]; + int32_t f1 = f[1]; + int32_t f2 = f[2]; + int32_t f3 = f[3]; + int32_t f4 = f[4]; + int32_t f5 = f[5]; + int32_t f6 = f[6]; + int32_t f7 = f[7]; + int32_t f8 = f[8]; + int32_t f9 = f[9]; + int32_t h0 = -f0; + int32_t h1 = -f1; + int32_t h2 = -f2; + int32_t h3 = -f3; + int32_t h4 = -f4; + int32_t h5 = -f5; + int32_t h6 = -f6; + int32_t h7 = -f7; + int32_t h8 = -f8; + int32_t h9 = -f9; + + h[0] = h0; + h[1] = h1; + h[2] = h2; + h[3] = h3; + h[4] = h4; + h[5] = h5; + h[6] = h6; + h[7] = h7; + h[8] = h8; + h[9] = h9; +} + + +void fe_pow22523(fe out, const fe z) { + fe t0; + fe t1; + fe t2; + int i; + fe_sq(t0, z); + + for (i = 1; i < 1; ++i) { + fe_sq(t0, t0); + } + + fe_sq(t1, t0); + + for (i = 1; i < 2; ++i) { + fe_sq(t1, t1); + } + + fe_mul(t1, z, t1); + fe_mul(t0, t0, t1); + fe_sq(t0, t0); + + for (i = 1; i < 1; ++i) { + fe_sq(t0, t0); + } + + fe_mul(t0, t1, t0); + fe_sq(t1, t0); + + for (i = 1; i < 5; ++i) { + fe_sq(t1, t1); + } + + fe_mul(t0, t1, t0); + fe_sq(t1, t0); + + for (i = 1; i < 10; ++i) { + fe_sq(t1, t1); + } + + fe_mul(t1, t1, t0); + fe_sq(t2, t1); + + for (i = 1; i < 20; ++i) { + fe_sq(t2, t2); + } + + fe_mul(t1, t2, t1); + fe_sq(t1, t1); + + for (i = 1; i < 10; ++i) { + fe_sq(t1, t1); + } + + fe_mul(t0, t1, t0); + fe_sq(t1, t0); + + for (i = 1; i < 50; ++i) { + fe_sq(t1, t1); + } + + fe_mul(t1, t1, t0); + fe_sq(t2, t1); + + for (i = 1; i < 100; ++i) { + fe_sq(t2, t2); + } + + fe_mul(t1, t2, t1); + fe_sq(t1, t1); + + for (i = 1; i < 50; ++i) { + fe_sq(t1, t1); + } + + fe_mul(t0, t1, t0); + fe_sq(t0, t0); + + for (i = 1; i < 2; ++i) { + fe_sq(t0, t0); + } + + fe_mul(out, t0, z); + return; +} + + +/* +h = f * f +Can overlap h with f. + +Preconditions: + |f| bounded by 1.65*2^26,1.65*2^25,1.65*2^26,1.65*2^25,etc. + +Postconditions: + |h| bounded by 1.01*2^25,1.01*2^24,1.01*2^25,1.01*2^24,etc. +*/ + +/* +See fe_mul.c for discussion of implementation strategy. +*/ + +void fe_sq(fe h, const fe f) { + int32_t f0 = f[0]; + int32_t f1 = f[1]; + int32_t f2 = f[2]; + int32_t f3 = f[3]; + int32_t f4 = f[4]; + int32_t f5 = f[5]; + int32_t f6 = f[6]; + int32_t f7 = f[7]; + int32_t f8 = f[8]; + int32_t f9 = f[9]; + int32_t f0_2 = 2 * f0; + int32_t f1_2 = 2 * f1; + int32_t f2_2 = 2 * f2; + int32_t f3_2 = 2 * f3; + int32_t f4_2 = 2 * f4; + int32_t f5_2 = 2 * f5; + int32_t f6_2 = 2 * f6; + int32_t f7_2 = 2 * f7; + int32_t f5_38 = 38 * f5; /* 1.959375*2^30 */ + int32_t f6_19 = 19 * f6; /* 1.959375*2^30 */ + int32_t f7_38 = 38 * f7; /* 1.959375*2^30 */ + int32_t f8_19 = 19 * f8; /* 1.959375*2^30 */ + int32_t f9_38 = 38 * f9; /* 1.959375*2^30 */ + int64_t f0f0 = f0 * (int64_t) f0; + int64_t f0f1_2 = f0_2 * (int64_t) f1; + int64_t f0f2_2 = f0_2 * (int64_t) f2; + int64_t f0f3_2 = f0_2 * (int64_t) f3; + int64_t f0f4_2 = f0_2 * (int64_t) f4; + int64_t f0f5_2 = f0_2 * (int64_t) f5; + int64_t f0f6_2 = f0_2 * (int64_t) f6; + int64_t f0f7_2 = f0_2 * (int64_t) f7; + int64_t f0f8_2 = f0_2 * (int64_t) f8; + int64_t f0f9_2 = f0_2 * (int64_t) f9; + int64_t f1f1_2 = f1_2 * (int64_t) f1; + int64_t f1f2_2 = f1_2 * (int64_t) f2; + int64_t f1f3_4 = f1_2 * (int64_t) f3_2; + int64_t f1f4_2 = f1_2 * (int64_t) f4; + int64_t f1f5_4 = f1_2 * (int64_t) f5_2; + int64_t f1f6_2 = f1_2 * (int64_t) f6; + int64_t f1f7_4 = f1_2 * (int64_t) f7_2; + int64_t f1f8_2 = f1_2 * (int64_t) f8; + int64_t f1f9_76 = f1_2 * (int64_t) f9_38; + int64_t f2f2 = f2 * (int64_t) f2; + int64_t f2f3_2 = f2_2 * (int64_t) f3; + int64_t f2f4_2 = f2_2 * (int64_t) f4; + int64_t f2f5_2 = f2_2 * (int64_t) f5; + int64_t f2f6_2 = f2_2 * (int64_t) f6; + int64_t f2f7_2 = f2_2 * (int64_t) f7; + int64_t f2f8_38 = f2_2 * (int64_t) f8_19; + int64_t f2f9_38 = f2 * (int64_t) f9_38; + int64_t f3f3_2 = f3_2 * (int64_t) f3; + int64_t f3f4_2 = f3_2 * (int64_t) f4; + int64_t f3f5_4 = f3_2 * (int64_t) f5_2; + int64_t f3f6_2 = f3_2 * (int64_t) f6; + int64_t f3f7_76 = f3_2 * (int64_t) f7_38; + int64_t f3f8_38 = f3_2 * (int64_t) f8_19; + int64_t f3f9_76 = f3_2 * (int64_t) f9_38; + int64_t f4f4 = f4 * (int64_t) f4; + int64_t f4f5_2 = f4_2 * (int64_t) f5; + int64_t f4f6_38 = f4_2 * (int64_t) f6_19; + int64_t f4f7_38 = f4 * (int64_t) f7_38; + int64_t f4f8_38 = f4_2 * (int64_t) f8_19; + int64_t f4f9_38 = f4 * (int64_t) f9_38; + int64_t f5f5_38 = f5 * (int64_t) f5_38; + int64_t f5f6_38 = f5_2 * (int64_t) f6_19; + int64_t f5f7_76 = f5_2 * (int64_t) f7_38; + int64_t f5f8_38 = f5_2 * (int64_t) f8_19; + int64_t f5f9_76 = f5_2 * (int64_t) f9_38; + int64_t f6f6_19 = f6 * (int64_t) f6_19; + int64_t f6f7_38 = f6 * (int64_t) f7_38; + int64_t f6f8_38 = f6_2 * (int64_t) f8_19; + int64_t f6f9_38 = f6 * (int64_t) f9_38; + int64_t f7f7_38 = f7 * (int64_t) f7_38; + int64_t f7f8_38 = f7_2 * (int64_t) f8_19; + int64_t f7f9_76 = f7_2 * (int64_t) f9_38; + int64_t f8f8_19 = f8 * (int64_t) f8_19; + int64_t f8f9_38 = f8 * (int64_t) f9_38; + int64_t f9f9_38 = f9 * (int64_t) f9_38; + int64_t h0 = f0f0 + f1f9_76 + f2f8_38 + f3f7_76 + f4f6_38 + f5f5_38; + int64_t h1 = f0f1_2 + f2f9_38 + f3f8_38 + f4f7_38 + f5f6_38; + int64_t h2 = f0f2_2 + f1f1_2 + f3f9_76 + f4f8_38 + f5f7_76 + f6f6_19; + int64_t h3 = f0f3_2 + f1f2_2 + f4f9_38 + f5f8_38 + f6f7_38; + int64_t h4 = f0f4_2 + f1f3_4 + f2f2 + f5f9_76 + f6f8_38 + f7f7_38; + int64_t h5 = f0f5_2 + f1f4_2 + f2f3_2 + f6f9_38 + f7f8_38; + int64_t h6 = f0f6_2 + f1f5_4 + f2f4_2 + f3f3_2 + f7f9_76 + f8f8_19; + int64_t h7 = f0f7_2 + f1f6_2 + f2f5_2 + f3f4_2 + f8f9_38; + int64_t h8 = f0f8_2 + f1f7_4 + f2f6_2 + f3f5_4 + f4f4 + f9f9_38; + int64_t h9 = f0f9_2 + f1f8_2 + f2f7_2 + f3f6_2 + f4f5_2; + int64_t carry0; + int64_t carry1; + int64_t carry2; + int64_t carry3; + int64_t carry4; + int64_t carry5; + int64_t carry6; + int64_t carry7; + int64_t carry8; + int64_t carry9; + carry0 = (h0 + (int64_t) (1 << 25)) >> 26; + h1 += carry0; + h0 -= carry0 << 26; + carry4 = (h4 + (int64_t) (1 << 25)) >> 26; + h5 += carry4; + h4 -= carry4 << 26; + carry1 = (h1 + (int64_t) (1 << 24)) >> 25; + h2 += carry1; + h1 -= carry1 << 25; + carry5 = (h5 + (int64_t) (1 << 24)) >> 25; + h6 += carry5; + h5 -= carry5 << 25; + carry2 = (h2 + (int64_t) (1 << 25)) >> 26; + h3 += carry2; + h2 -= carry2 << 26; + carry6 = (h6 + (int64_t) (1 << 25)) >> 26; + h7 += carry6; + h6 -= carry6 << 26; + carry3 = (h3 + (int64_t) (1 << 24)) >> 25; + h4 += carry3; + h3 -= carry3 << 25; + carry7 = (h7 + (int64_t) (1 << 24)) >> 25; + h8 += carry7; + h7 -= carry7 << 25; + carry4 = (h4 + (int64_t) (1 << 25)) >> 26; + h5 += carry4; + h4 -= carry4 << 26; + carry8 = (h8 + (int64_t) (1 << 25)) >> 26; + h9 += carry8; + h8 -= carry8 << 26; + carry9 = (h9 + (int64_t) (1 << 24)) >> 25; + h0 += carry9 * 19; + h9 -= carry9 << 25; + carry0 = (h0 + (int64_t) (1 << 25)) >> 26; + h1 += carry0; + h0 -= carry0 << 26; + h[0] = (int32_t) h0; + h[1] = (int32_t) h1; + h[2] = (int32_t) h2; + h[3] = (int32_t) h3; + h[4] = (int32_t) h4; + h[5] = (int32_t) h5; + h[6] = (int32_t) h6; + h[7] = (int32_t) h7; + h[8] = (int32_t) h8; + h[9] = (int32_t) h9; +} + + +/* +h = 2 * f * f +Can overlap h with f. + +Preconditions: + |f| bounded by 1.65*2^26,1.65*2^25,1.65*2^26,1.65*2^25,etc. + +Postconditions: + |h| bounded by 1.01*2^25,1.01*2^24,1.01*2^25,1.01*2^24,etc. +*/ + +/* +See fe_mul.c for discussion of implementation strategy. +*/ + +void fe_sq2(fe h, const fe f) { + int32_t f0 = f[0]; + int32_t f1 = f[1]; + int32_t f2 = f[2]; + int32_t f3 = f[3]; + int32_t f4 = f[4]; + int32_t f5 = f[5]; + int32_t f6 = f[6]; + int32_t f7 = f[7]; + int32_t f8 = f[8]; + int32_t f9 = f[9]; + int32_t f0_2 = 2 * f0; + int32_t f1_2 = 2 * f1; + int32_t f2_2 = 2 * f2; + int32_t f3_2 = 2 * f3; + int32_t f4_2 = 2 * f4; + int32_t f5_2 = 2 * f5; + int32_t f6_2 = 2 * f6; + int32_t f7_2 = 2 * f7; + int32_t f5_38 = 38 * f5; /* 1.959375*2^30 */ + int32_t f6_19 = 19 * f6; /* 1.959375*2^30 */ + int32_t f7_38 = 38 * f7; /* 1.959375*2^30 */ + int32_t f8_19 = 19 * f8; /* 1.959375*2^30 */ + int32_t f9_38 = 38 * f9; /* 1.959375*2^30 */ + int64_t f0f0 = f0 * (int64_t) f0; + int64_t f0f1_2 = f0_2 * (int64_t) f1; + int64_t f0f2_2 = f0_2 * (int64_t) f2; + int64_t f0f3_2 = f0_2 * (int64_t) f3; + int64_t f0f4_2 = f0_2 * (int64_t) f4; + int64_t f0f5_2 = f0_2 * (int64_t) f5; + int64_t f0f6_2 = f0_2 * (int64_t) f6; + int64_t f0f7_2 = f0_2 * (int64_t) f7; + int64_t f0f8_2 = f0_2 * (int64_t) f8; + int64_t f0f9_2 = f0_2 * (int64_t) f9; + int64_t f1f1_2 = f1_2 * (int64_t) f1; + int64_t f1f2_2 = f1_2 * (int64_t) f2; + int64_t f1f3_4 = f1_2 * (int64_t) f3_2; + int64_t f1f4_2 = f1_2 * (int64_t) f4; + int64_t f1f5_4 = f1_2 * (int64_t) f5_2; + int64_t f1f6_2 = f1_2 * (int64_t) f6; + int64_t f1f7_4 = f1_2 * (int64_t) f7_2; + int64_t f1f8_2 = f1_2 * (int64_t) f8; + int64_t f1f9_76 = f1_2 * (int64_t) f9_38; + int64_t f2f2 = f2 * (int64_t) f2; + int64_t f2f3_2 = f2_2 * (int64_t) f3; + int64_t f2f4_2 = f2_2 * (int64_t) f4; + int64_t f2f5_2 = f2_2 * (int64_t) f5; + int64_t f2f6_2 = f2_2 * (int64_t) f6; + int64_t f2f7_2 = f2_2 * (int64_t) f7; + int64_t f2f8_38 = f2_2 * (int64_t) f8_19; + int64_t f2f9_38 = f2 * (int64_t) f9_38; + int64_t f3f3_2 = f3_2 * (int64_t) f3; + int64_t f3f4_2 = f3_2 * (int64_t) f4; + int64_t f3f5_4 = f3_2 * (int64_t) f5_2; + int64_t f3f6_2 = f3_2 * (int64_t) f6; + int64_t f3f7_76 = f3_2 * (int64_t) f7_38; + int64_t f3f8_38 = f3_2 * (int64_t) f8_19; + int64_t f3f9_76 = f3_2 * (int64_t) f9_38; + int64_t f4f4 = f4 * (int64_t) f4; + int64_t f4f5_2 = f4_2 * (int64_t) f5; + int64_t f4f6_38 = f4_2 * (int64_t) f6_19; + int64_t f4f7_38 = f4 * (int64_t) f7_38; + int64_t f4f8_38 = f4_2 * (int64_t) f8_19; + int64_t f4f9_38 = f4 * (int64_t) f9_38; + int64_t f5f5_38 = f5 * (int64_t) f5_38; + int64_t f5f6_38 = f5_2 * (int64_t) f6_19; + int64_t f5f7_76 = f5_2 * (int64_t) f7_38; + int64_t f5f8_38 = f5_2 * (int64_t) f8_19; + int64_t f5f9_76 = f5_2 * (int64_t) f9_38; + int64_t f6f6_19 = f6 * (int64_t) f6_19; + int64_t f6f7_38 = f6 * (int64_t) f7_38; + int64_t f6f8_38 = f6_2 * (int64_t) f8_19; + int64_t f6f9_38 = f6 * (int64_t) f9_38; + int64_t f7f7_38 = f7 * (int64_t) f7_38; + int64_t f7f8_38 = f7_2 * (int64_t) f8_19; + int64_t f7f9_76 = f7_2 * (int64_t) f9_38; + int64_t f8f8_19 = f8 * (int64_t) f8_19; + int64_t f8f9_38 = f8 * (int64_t) f9_38; + int64_t f9f9_38 = f9 * (int64_t) f9_38; + int64_t h0 = f0f0 + f1f9_76 + f2f8_38 + f3f7_76 + f4f6_38 + f5f5_38; + int64_t h1 = f0f1_2 + f2f9_38 + f3f8_38 + f4f7_38 + f5f6_38; + int64_t h2 = f0f2_2 + f1f1_2 + f3f9_76 + f4f8_38 + f5f7_76 + f6f6_19; + int64_t h3 = f0f3_2 + f1f2_2 + f4f9_38 + f5f8_38 + f6f7_38; + int64_t h4 = f0f4_2 + f1f3_4 + f2f2 + f5f9_76 + f6f8_38 + f7f7_38; + int64_t h5 = f0f5_2 + f1f4_2 + f2f3_2 + f6f9_38 + f7f8_38; + int64_t h6 = f0f6_2 + f1f5_4 + f2f4_2 + f3f3_2 + f7f9_76 + f8f8_19; + int64_t h7 = f0f7_2 + f1f6_2 + f2f5_2 + f3f4_2 + f8f9_38; + int64_t h8 = f0f8_2 + f1f7_4 + f2f6_2 + f3f5_4 + f4f4 + f9f9_38; + int64_t h9 = f0f9_2 + f1f8_2 + f2f7_2 + f3f6_2 + f4f5_2; + int64_t carry0; + int64_t carry1; + int64_t carry2; + int64_t carry3; + int64_t carry4; + int64_t carry5; + int64_t carry6; + int64_t carry7; + int64_t carry8; + int64_t carry9; + h0 += h0; + h1 += h1; + h2 += h2; + h3 += h3; + h4 += h4; + h5 += h5; + h6 += h6; + h7 += h7; + h8 += h8; + h9 += h9; + carry0 = (h0 + (int64_t) (1 << 25)) >> 26; + h1 += carry0; + h0 -= carry0 << 26; + carry4 = (h4 + (int64_t) (1 << 25)) >> 26; + h5 += carry4; + h4 -= carry4 << 26; + carry1 = (h1 + (int64_t) (1 << 24)) >> 25; + h2 += carry1; + h1 -= carry1 << 25; + carry5 = (h5 + (int64_t) (1 << 24)) >> 25; + h6 += carry5; + h5 -= carry5 << 25; + carry2 = (h2 + (int64_t) (1 << 25)) >> 26; + h3 += carry2; + h2 -= carry2 << 26; + carry6 = (h6 + (int64_t) (1 << 25)) >> 26; + h7 += carry6; + h6 -= carry6 << 26; + carry3 = (h3 + (int64_t) (1 << 24)) >> 25; + h4 += carry3; + h3 -= carry3 << 25; + carry7 = (h7 + (int64_t) (1 << 24)) >> 25; + h8 += carry7; + h7 -= carry7 << 25; + carry4 = (h4 + (int64_t) (1 << 25)) >> 26; + h5 += carry4; + h4 -= carry4 << 26; + carry8 = (h8 + (int64_t) (1 << 25)) >> 26; + h9 += carry8; + h8 -= carry8 << 26; + carry9 = (h9 + (int64_t) (1 << 24)) >> 25; + h0 += carry9 * 19; + h9 -= carry9 << 25; + carry0 = (h0 + (int64_t) (1 << 25)) >> 26; + h1 += carry0; + h0 -= carry0 << 26; + h[0] = (int32_t) h0; + h[1] = (int32_t) h1; + h[2] = (int32_t) h2; + h[3] = (int32_t) h3; + h[4] = (int32_t) h4; + h[5] = (int32_t) h5; + h[6] = (int32_t) h6; + h[7] = (int32_t) h7; + h[8] = (int32_t) h8; + h[9] = (int32_t) h9; +} + + +/* +h = f - g +Can overlap h with f or g. + +Preconditions: + |f| bounded by 1.1*2^25,1.1*2^24,1.1*2^25,1.1*2^24,etc. + |g| bounded by 1.1*2^25,1.1*2^24,1.1*2^25,1.1*2^24,etc. + +Postconditions: + |h| bounded by 1.1*2^26,1.1*2^25,1.1*2^26,1.1*2^25,etc. +*/ + +void fe_sub(fe h, const fe f, const fe g) { + int32_t f0 = f[0]; + int32_t f1 = f[1]; + int32_t f2 = f[2]; + int32_t f3 = f[3]; + int32_t f4 = f[4]; + int32_t f5 = f[5]; + int32_t f6 = f[6]; + int32_t f7 = f[7]; + int32_t f8 = f[8]; + int32_t f9 = f[9]; + int32_t g0 = g[0]; + int32_t g1 = g[1]; + int32_t g2 = g[2]; + int32_t g3 = g[3]; + int32_t g4 = g[4]; + int32_t g5 = g[5]; + int32_t g6 = g[6]; + int32_t g7 = g[7]; + int32_t g8 = g[8]; + int32_t g9 = g[9]; + int32_t h0 = f0 - g0; + int32_t h1 = f1 - g1; + int32_t h2 = f2 - g2; + int32_t h3 = f3 - g3; + int32_t h4 = f4 - g4; + int32_t h5 = f5 - g5; + int32_t h6 = f6 - g6; + int32_t h7 = f7 - g7; + int32_t h8 = f8 - g8; + int32_t h9 = f9 - g9; + + h[0] = h0; + h[1] = h1; + h[2] = h2; + h[3] = h3; + h[4] = h4; + h[5] = h5; + h[6] = h6; + h[7] = h7; + h[8] = h8; + h[9] = h9; +} + + + +/* +Preconditions: + |h| bounded by 1.1*2^26,1.1*2^25,1.1*2^26,1.1*2^25,etc. + +Write p=2^255-19; q=floor(h/p). +Basic claim: q = floor(2^(-255)(h + 19 2^(-25)h9 + 2^(-1))). + +Proof: + Have |h|<=p so |q|<=1 so |19^2 2^(-255) q|<1/4. + Also have |h-2^230 h9|<2^231 so |19 2^(-255)(h-2^230 h9)|<1/4. + + Write y=2^(-1)-19^2 2^(-255)q-19 2^(-255)(h-2^230 h9). + Then 0> 25; + q = (h0 + q) >> 26; + q = (h1 + q) >> 25; + q = (h2 + q) >> 26; + q = (h3 + q) >> 25; + q = (h4 + q) >> 26; + q = (h5 + q) >> 25; + q = (h6 + q) >> 26; + q = (h7 + q) >> 25; + q = (h8 + q) >> 26; + q = (h9 + q) >> 25; + /* Goal: Output h-(2^255-19)q, which is between 0 and 2^255-20. */ + h0 += 19 * q; + /* Goal: Output h-2^255 q, which is between 0 and 2^255-20. */ + carry0 = h0 >> 26; + h1 += carry0; + h0 -= carry0 << 26; + carry1 = h1 >> 25; + h2 += carry1; + h1 -= carry1 << 25; + carry2 = h2 >> 26; + h3 += carry2; + h2 -= carry2 << 26; + carry3 = h3 >> 25; + h4 += carry3; + h3 -= carry3 << 25; + carry4 = h4 >> 26; + h5 += carry4; + h4 -= carry4 << 26; + carry5 = h5 >> 25; + h6 += carry5; + h5 -= carry5 << 25; + carry6 = h6 >> 26; + h7 += carry6; + h6 -= carry6 << 26; + carry7 = h7 >> 25; + h8 += carry7; + h7 -= carry7 << 25; + carry8 = h8 >> 26; + h9 += carry8; + h8 -= carry8 << 26; + carry9 = h9 >> 25; + h9 -= carry9 << 25; + + /* h10 = carry9 */ + /* + Goal: Output h0+...+2^255 h10-2^255 q, which is between 0 and 2^255-20. + Have h0+...+2^230 h9 between 0 and 2^255-1; + evidently 2^255 h10-2^255 q = 0. + Goal: Output h0+...+2^230 h9. + */ + s[0] = (unsigned char) (h0 >> 0); + s[1] = (unsigned char) (h0 >> 8); + s[2] = (unsigned char) (h0 >> 16); + s[3] = (unsigned char) ((h0 >> 24) | (h1 << 2)); + s[4] = (unsigned char) (h1 >> 6); + s[5] = (unsigned char) (h1 >> 14); + s[6] = (unsigned char) ((h1 >> 22) | (h2 << 3)); + s[7] = (unsigned char) (h2 >> 5); + s[8] = (unsigned char) (h2 >> 13); + s[9] = (unsigned char) ((h2 >> 21) | (h3 << 5)); + s[10] = (unsigned char) (h3 >> 3); + s[11] = (unsigned char) (h3 >> 11); + s[12] = (unsigned char) ((h3 >> 19) | (h4 << 6)); + s[13] = (unsigned char) (h4 >> 2); + s[14] = (unsigned char) (h4 >> 10); + s[15] = (unsigned char) (h4 >> 18); + s[16] = (unsigned char) (h5 >> 0); + s[17] = (unsigned char) (h5 >> 8); + s[18] = (unsigned char) (h5 >> 16); + s[19] = (unsigned char) ((h5 >> 24) | (h6 << 1)); + s[20] = (unsigned char) (h6 >> 7); + s[21] = (unsigned char) (h6 >> 15); + s[22] = (unsigned char) ((h6 >> 23) | (h7 << 3)); + s[23] = (unsigned char) (h7 >> 5); + s[24] = (unsigned char) (h7 >> 13); + s[25] = (unsigned char) ((h7 >> 21) | (h8 << 4)); + s[26] = (unsigned char) (h8 >> 4); + s[27] = (unsigned char) (h8 >> 12); + s[28] = (unsigned char) ((h8 >> 20) | (h9 << 6)); + s[29] = (unsigned char) (h9 >> 2); + s[30] = (unsigned char) (h9 >> 10); + s[31] = (unsigned char) (h9 >> 18); +} diff --git a/src/fe.h b/src/fe.h new file mode 100644 index 000000000..b4b62d282 --- /dev/null +++ b/src/fe.h @@ -0,0 +1,41 @@ +#ifndef FE_H +#define FE_H + +#include "fixedint.h" + + +/* + fe means field element. + Here the field is \Z/(2^255-19). + An element t, entries t[0]...t[9], represents the integer + t[0]+2^26 t[1]+2^51 t[2]+2^77 t[3]+2^102 t[4]+...+2^230 t[9]. + Bounds on each t[i] vary depending on context. +*/ + + +typedef int32_t fe[10]; + + +void fe_0(fe h); +void fe_1(fe h); + +void fe_frombytes(fe h, const unsigned char *s); +void fe_tobytes(unsigned char *s, const fe h); + +void fe_copy(fe h, const fe f); +int fe_isnegative(const fe f); +int fe_isnonzero(const fe f); +void fe_cmov(fe f, const fe g, unsigned int b); +void fe_cswap(fe f, fe g, unsigned int b); + +void fe_neg(fe h, const fe f); +void fe_add(fe h, const fe f, const fe g); +void fe_invert(fe out, const fe z); +void fe_sq(fe h, const fe f); +void fe_sq2(fe h, const fe f); +void fe_mul(fe h, const fe f, const fe g); +void fe_mul121666(fe h, fe f); +void fe_pow22523(fe out, const fe z); +void fe_sub(fe h, const fe f, const fe g); + +#endif diff --git a/src/fixedint.h b/src/fixedint.h new file mode 100644 index 000000000..1a8745b1e --- /dev/null +++ b/src/fixedint.h @@ -0,0 +1,72 @@ +/* + Portable header to provide the 32 and 64 bits type. + + Not a compatible replacement for , do not blindly use it as such. +*/ + +#if ((defined(__STDC__) && __STDC__ && __STDC_VERSION__ >= 199901L) || (defined(__WATCOMC__) && (defined(_STDINT_H_INCLUDED) || __WATCOMC__ >= 1250)) || (defined(__GNUC__) && (defined(_STDINT_H) || defined(_STDINT_H_) || defined(__UINT_FAST64_TYPE__)) )) && !defined(FIXEDINT_H_INCLUDED) + #include + #define FIXEDINT_H_INCLUDED + + #if defined(__WATCOMC__) && __WATCOMC__ >= 1250 && !defined(UINT64_C) + #include + #define UINT64_C(x) (x + (UINT64_MAX - UINT64_MAX)) + #endif +#endif + + +#ifndef FIXEDINT_H_INCLUDED + #define FIXEDINT_H_INCLUDED + + #include + + /* (u)int32_t */ + #ifndef uint32_t + #if (ULONG_MAX == 0xffffffffUL) + typedef unsigned long uint32_t; + #elif (UINT_MAX == 0xffffffffUL) + typedef unsigned int uint32_t; + #elif (USHRT_MAX == 0xffffffffUL) + typedef unsigned short uint32_t; + #endif + #endif + + + #ifndef int32_t + #if (LONG_MAX == 0x7fffffffL) + typedef signed long int32_t; + #elif (INT_MAX == 0x7fffffffL) + typedef signed int int32_t; + #elif (SHRT_MAX == 0x7fffffffL) + typedef signed short int32_t; + #endif + #endif + + + /* (u)int64_t */ + #if (defined(__STDC__) && defined(__STDC_VERSION__) && __STDC__ && __STDC_VERSION__ >= 199901L) + typedef long long int64_t; + typedef unsigned long long uint64_t; + + #define UINT64_C(v) v ##ULL + #define INT64_C(v) v ##LL + #elif defined(__GNUC__) + __extension__ typedef long long int64_t; + __extension__ typedef unsigned long long uint64_t; + + #define UINT64_C(v) v ##ULL + #define INT64_C(v) v ##LL + #elif defined(__MWERKS__) || defined(__SUNPRO_C) || defined(__SUNPRO_CC) || defined(__APPLE_CC__) || defined(_LONG_LONG) || defined(_CRAYC) + typedef long long int64_t; + typedef unsigned long long uint64_t; + + #define UINT64_C(v) v ##ULL + #define INT64_C(v) v ##LL + #elif (defined(__WATCOMC__) && defined(__WATCOM_INT64__)) || (defined(_MSC_VER) && _INTEGRAL_MAX_BITS >= 64) || (defined(__BORLANDC__) && __BORLANDC__ > 0x460) || defined(__alpha) || defined(__DECC) + typedef __int64 int64_t; + typedef unsigned __int64 uint64_t; + + #define UINT64_C(v) v ##UI64 + #define INT64_C(v) v ##I64 + #endif +#endif diff --git a/src/ge.c b/src/ge.c new file mode 100644 index 000000000..87c691bff --- /dev/null +++ b/src/ge.c @@ -0,0 +1,467 @@ +#include "ge.h" +#include "precomp_data.h" + + +/* +r = p + q +*/ + +void ge_add(ge_p1p1 *r, const ge_p3 *p, const ge_cached *q) { + fe t0; + fe_add(r->X, p->Y, p->X); + fe_sub(r->Y, p->Y, p->X); + fe_mul(r->Z, r->X, q->YplusX); + fe_mul(r->Y, r->Y, q->YminusX); + fe_mul(r->T, q->T2d, p->T); + fe_mul(r->X, p->Z, q->Z); + fe_add(t0, r->X, r->X); + fe_sub(r->X, r->Z, r->Y); + fe_add(r->Y, r->Z, r->Y); + fe_add(r->Z, t0, r->T); + fe_sub(r->T, t0, r->T); +} + + +static void slide(signed char *r, const unsigned char *a) { + int i; + int b; + int k; + + for (i = 0; i < 256; ++i) { + r[i] = 1 & (a[i >> 3] >> (i & 7)); + } + + for (i = 0; i < 256; ++i) + if (r[i]) { + for (b = 1; b <= 6 && i + b < 256; ++b) { + if (r[i + b]) { + if (r[i] + (r[i + b] << b) <= 15) { + r[i] += r[i + b] << b; + r[i + b] = 0; + } else if (r[i] - (r[i + b] << b) >= -15) { + r[i] -= r[i + b] << b; + + for (k = i + b; k < 256; ++k) { + if (!r[k]) { + r[k] = 1; + break; + } + + r[k] = 0; + } + } else { + break; + } + } + } + } +} + +/* +r = a * A + b * B +where a = a[0]+256*a[1]+...+256^31 a[31]. +and b = b[0]+256*b[1]+...+256^31 b[31]. +B is the Ed25519 base point (x,4/5) with x positive. +*/ + +void ge_double_scalarmult_vartime(ge_p2 *r, const unsigned char *a, const ge_p3 *A, const unsigned char *b) { + signed char aslide[256]; + signed char bslide[256]; + ge_cached Ai[8]; /* A,3A,5A,7A,9A,11A,13A,15A */ + ge_p1p1 t; + ge_p3 u; + ge_p3 A2; + int i; + slide(aslide, a); + slide(bslide, b); + ge_p3_to_cached(&Ai[0], A); + ge_p3_dbl(&t, A); + ge_p1p1_to_p3(&A2, &t); + ge_add(&t, &A2, &Ai[0]); + ge_p1p1_to_p3(&u, &t); + ge_p3_to_cached(&Ai[1], &u); + ge_add(&t, &A2, &Ai[1]); + ge_p1p1_to_p3(&u, &t); + ge_p3_to_cached(&Ai[2], &u); + ge_add(&t, &A2, &Ai[2]); + ge_p1p1_to_p3(&u, &t); + ge_p3_to_cached(&Ai[3], &u); + ge_add(&t, &A2, &Ai[3]); + ge_p1p1_to_p3(&u, &t); + ge_p3_to_cached(&Ai[4], &u); + ge_add(&t, &A2, &Ai[4]); + ge_p1p1_to_p3(&u, &t); + ge_p3_to_cached(&Ai[5], &u); + ge_add(&t, &A2, &Ai[5]); + ge_p1p1_to_p3(&u, &t); + ge_p3_to_cached(&Ai[6], &u); + ge_add(&t, &A2, &Ai[6]); + ge_p1p1_to_p3(&u, &t); + ge_p3_to_cached(&Ai[7], &u); + ge_p2_0(r); + + for (i = 255; i >= 0; --i) { + if (aslide[i] || bslide[i]) { + break; + } + } + + for (; i >= 0; --i) { + ge_p2_dbl(&t, r); + + if (aslide[i] > 0) { + ge_p1p1_to_p3(&u, &t); + ge_add(&t, &u, &Ai[aslide[i] / 2]); + } else if (aslide[i] < 0) { + ge_p1p1_to_p3(&u, &t); + ge_sub(&t, &u, &Ai[(-aslide[i]) / 2]); + } + + if (bslide[i] > 0) { + ge_p1p1_to_p3(&u, &t); + ge_madd(&t, &u, &Bi[bslide[i] / 2]); + } else if (bslide[i] < 0) { + ge_p1p1_to_p3(&u, &t); + ge_msub(&t, &u, &Bi[(-bslide[i]) / 2]); + } + + ge_p1p1_to_p2(r, &t); + } +} + + +static const fe d = { + -10913610, 13857413, -15372611, 6949391, 114729, -8787816, -6275908, -3247719, -18696448, -12055116 +}; + +static const fe sqrtm1 = { + -32595792, -7943725, 9377950, 3500415, 12389472, -272473, -25146209, -2005654, 326686, 11406482 +}; + +int ge_frombytes_negate_vartime(ge_p3 *h, const unsigned char *s) { + fe u; + fe v; + fe v3; + fe vxx; + fe check; + fe_frombytes(h->Y, s); + fe_1(h->Z); + fe_sq(u, h->Y); + fe_mul(v, u, d); + fe_sub(u, u, h->Z); /* u = y^2-1 */ + fe_add(v, v, h->Z); /* v = dy^2+1 */ + fe_sq(v3, v); + fe_mul(v3, v3, v); /* v3 = v^3 */ + fe_sq(h->X, v3); + fe_mul(h->X, h->X, v); + fe_mul(h->X, h->X, u); /* x = uv^7 */ + fe_pow22523(h->X, h->X); /* x = (uv^7)^((q-5)/8) */ + fe_mul(h->X, h->X, v3); + fe_mul(h->X, h->X, u); /* x = uv^3(uv^7)^((q-5)/8) */ + fe_sq(vxx, h->X); + fe_mul(vxx, vxx, v); + fe_sub(check, vxx, u); /* vx^2-u */ + + if (fe_isnonzero(check)) { + fe_add(check, vxx, u); /* vx^2+u */ + + if (fe_isnonzero(check)) { + return -1; + } + + fe_mul(h->X, h->X, sqrtm1); + } + + if (fe_isnegative(h->X) == (s[31] >> 7)) { + fe_neg(h->X, h->X); + } + + fe_mul(h->T, h->X, h->Y); + return 0; +} + + +/* +r = p + q +*/ + +void ge_madd(ge_p1p1 *r, const ge_p3 *p, const ge_precomp *q) { + fe t0; + fe_add(r->X, p->Y, p->X); + fe_sub(r->Y, p->Y, p->X); + fe_mul(r->Z, r->X, q->yplusx); + fe_mul(r->Y, r->Y, q->yminusx); + fe_mul(r->T, q->xy2d, p->T); + fe_add(t0, p->Z, p->Z); + fe_sub(r->X, r->Z, r->Y); + fe_add(r->Y, r->Z, r->Y); + fe_add(r->Z, t0, r->T); + fe_sub(r->T, t0, r->T); +} + + +/* +r = p - q +*/ + +void ge_msub(ge_p1p1 *r, const ge_p3 *p, const ge_precomp *q) { + fe t0; + + fe_add(r->X, p->Y, p->X); + fe_sub(r->Y, p->Y, p->X); + fe_mul(r->Z, r->X, q->yminusx); + fe_mul(r->Y, r->Y, q->yplusx); + fe_mul(r->T, q->xy2d, p->T); + fe_add(t0, p->Z, p->Z); + fe_sub(r->X, r->Z, r->Y); + fe_add(r->Y, r->Z, r->Y); + fe_sub(r->Z, t0, r->T); + fe_add(r->T, t0, r->T); +} + + +/* +r = p +*/ + +void ge_p1p1_to_p2(ge_p2 *r, const ge_p1p1 *p) { + fe_mul(r->X, p->X, p->T); + fe_mul(r->Y, p->Y, p->Z); + fe_mul(r->Z, p->Z, p->T); +} + + + +/* +r = p +*/ + +void ge_p1p1_to_p3(ge_p3 *r, const ge_p1p1 *p) { + fe_mul(r->X, p->X, p->T); + fe_mul(r->Y, p->Y, p->Z); + fe_mul(r->Z, p->Z, p->T); + fe_mul(r->T, p->X, p->Y); +} + + +void ge_p2_0(ge_p2 *h) { + fe_0(h->X); + fe_1(h->Y); + fe_1(h->Z); +} + + + +/* +r = 2 * p +*/ + +void ge_p2_dbl(ge_p1p1 *r, const ge_p2 *p) { + fe t0; + + fe_sq(r->X, p->X); + fe_sq(r->Z, p->Y); + fe_sq2(r->T, p->Z); + fe_add(r->Y, p->X, p->Y); + fe_sq(t0, r->Y); + fe_add(r->Y, r->Z, r->X); + fe_sub(r->Z, r->Z, r->X); + fe_sub(r->X, t0, r->Y); + fe_sub(r->T, r->T, r->Z); +} + + +void ge_p3_0(ge_p3 *h) { + fe_0(h->X); + fe_1(h->Y); + fe_1(h->Z); + fe_0(h->T); +} + + +/* +r = 2 * p +*/ + +void ge_p3_dbl(ge_p1p1 *r, const ge_p3 *p) { + ge_p2 q; + ge_p3_to_p2(&q, p); + ge_p2_dbl(r, &q); +} + + + +/* +r = p +*/ + +static const fe d2 = { + -21827239, -5839606, -30745221, 13898782, 229458, 15978800, -12551817, -6495438, 29715968, 9444199 +}; + +void ge_p3_to_cached(ge_cached *r, const ge_p3 *p) { + fe_add(r->YplusX, p->Y, p->X); + fe_sub(r->YminusX, p->Y, p->X); + fe_copy(r->Z, p->Z); + fe_mul(r->T2d, p->T, d2); +} + + +/* +r = p +*/ + +void ge_p3_to_p2(ge_p2 *r, const ge_p3 *p) { + fe_copy(r->X, p->X); + fe_copy(r->Y, p->Y); + fe_copy(r->Z, p->Z); +} + + +void ge_p3_tobytes(unsigned char *s, const ge_p3 *h) { + fe recip; + fe x; + fe y; + fe_invert(recip, h->Z); + fe_mul(x, h->X, recip); + fe_mul(y, h->Y, recip); + fe_tobytes(s, y); + s[31] ^= fe_isnegative(x) << 7; +} + + +static unsigned char equal(signed char b, signed char c) { + unsigned char ub = b; + unsigned char uc = c; + unsigned char x = ub ^ uc; /* 0: yes; 1..255: no */ + uint64_t y = x; /* 0: yes; 1..255: no */ + y -= 1; /* large: yes; 0..254: no */ + y >>= 63; /* 1: yes; 0: no */ + return (unsigned char) y; +} + +static unsigned char negative(signed char b) { + uint64_t x = b; /* 18446744073709551361..18446744073709551615: yes; 0..255: no */ + x >>= 63; /* 1: yes; 0: no */ + return (unsigned char) x; +} + +static void cmov(ge_precomp *t, const ge_precomp *u, unsigned char b) { + fe_cmov(t->yplusx, u->yplusx, b); + fe_cmov(t->yminusx, u->yminusx, b); + fe_cmov(t->xy2d, u->xy2d, b); +} + + +static void select(ge_precomp *t, int pos, signed char b) { + ge_precomp minust; + unsigned char bnegative = negative(b); + unsigned char babs = b - (((-bnegative) & b) << 1); + fe_1(t->yplusx); + fe_1(t->yminusx); + fe_0(t->xy2d); + cmov(t, &base[pos][0], equal(babs, 1)); + cmov(t, &base[pos][1], equal(babs, 2)); + cmov(t, &base[pos][2], equal(babs, 3)); + cmov(t, &base[pos][3], equal(babs, 4)); + cmov(t, &base[pos][4], equal(babs, 5)); + cmov(t, &base[pos][5], equal(babs, 6)); + cmov(t, &base[pos][6], equal(babs, 7)); + cmov(t, &base[pos][7], equal(babs, 8)); + fe_copy(minust.yplusx, t->yminusx); + fe_copy(minust.yminusx, t->yplusx); + fe_neg(minust.xy2d, t->xy2d); + cmov(t, &minust, bnegative); +} + +/* +h = a * B +where a = a[0]+256*a[1]+...+256^31 a[31] +B is the Ed25519 base point (x,4/5) with x positive. + +Preconditions: + a[31] <= 127 +*/ + +void ge_scalarmult_base(ge_p3 *h, const unsigned char *a) { + signed char e[64]; + signed char carry; + ge_p1p1 r; + ge_p2 s; + ge_precomp t; + int i; + + for (i = 0; i < 32; ++i) { + e[2 * i + 0] = (a[i] >> 0) & 15; + e[2 * i + 1] = (a[i] >> 4) & 15; + } + + /* each e[i] is between 0 and 15 */ + /* e[63] is between 0 and 7 */ + carry = 0; + + for (i = 0; i < 63; ++i) { + e[i] += carry; + carry = e[i] + 8; + carry >>= 4; + e[i] -= carry << 4; + } + + e[63] += carry; + /* each e[i] is between -8 and 8 */ + ge_p3_0(h); + + for (i = 1; i < 64; i += 2) { + select(&t, i / 2, e[i]); + ge_madd(&r, h, &t); + ge_p1p1_to_p3(h, &r); + } + + ge_p3_dbl(&r, h); + ge_p1p1_to_p2(&s, &r); + ge_p2_dbl(&r, &s); + ge_p1p1_to_p2(&s, &r); + ge_p2_dbl(&r, &s); + ge_p1p1_to_p2(&s, &r); + ge_p2_dbl(&r, &s); + ge_p1p1_to_p3(h, &r); + + for (i = 0; i < 64; i += 2) { + select(&t, i / 2, e[i]); + ge_madd(&r, h, &t); + ge_p1p1_to_p3(h, &r); + } +} + + +/* +r = p - q +*/ + +void ge_sub(ge_p1p1 *r, const ge_p3 *p, const ge_cached *q) { + fe t0; + + fe_add(r->X, p->Y, p->X); + fe_sub(r->Y, p->Y, p->X); + fe_mul(r->Z, r->X, q->YminusX); + fe_mul(r->Y, r->Y, q->YplusX); + fe_mul(r->T, q->T2d, p->T); + fe_mul(r->X, p->Z, q->Z); + fe_add(t0, r->X, r->X); + fe_sub(r->X, r->Z, r->Y); + fe_add(r->Y, r->Z, r->Y); + fe_sub(r->Z, t0, r->T); + fe_add(r->T, t0, r->T); +} + + +void ge_tobytes(unsigned char *s, const ge_p2 *h) { + fe recip; + fe x; + fe y; + fe_invert(recip, h->Z); + fe_mul(x, h->X, recip); + fe_mul(y, h->Y, recip); + fe_tobytes(s, y); + s[31] ^= fe_isnegative(x) << 7; +} diff --git a/src/ge.h b/src/ge.h new file mode 100644 index 000000000..17fde2df1 --- /dev/null +++ b/src/ge.h @@ -0,0 +1,74 @@ +#ifndef GE_H +#define GE_H + +#include "fe.h" + + +/* +ge means group element. + +Here the group is the set of pairs (x,y) of field elements (see fe.h) +satisfying -x^2 + y^2 = 1 + d x^2y^2 +where d = -121665/121666. + +Representations: + ge_p2 (projective): (X:Y:Z) satisfying x=X/Z, y=Y/Z + ge_p3 (extended): (X:Y:Z:T) satisfying x=X/Z, y=Y/Z, XY=ZT + ge_p1p1 (completed): ((X:Z),(Y:T)) satisfying x=X/Z, y=Y/T + ge_precomp (Duif): (y+x,y-x,2dxy) +*/ + +typedef struct { + fe X; + fe Y; + fe Z; +} ge_p2; + +typedef struct { + fe X; + fe Y; + fe Z; + fe T; +} ge_p3; + +typedef struct { + fe X; + fe Y; + fe Z; + fe T; +} ge_p1p1; + +typedef struct { + fe yplusx; + fe yminusx; + fe xy2d; +} ge_precomp; + +typedef struct { + fe YplusX; + fe YminusX; + fe Z; + fe T2d; +} ge_cached; + +void ge_p3_tobytes(unsigned char *s, const ge_p3 *h); +void ge_tobytes(unsigned char *s, const ge_p2 *h); +int ge_frombytes_negate_vartime(ge_p3 *h, const unsigned char *s); + +void ge_add(ge_p1p1 *r, const ge_p3 *p, const ge_cached *q); +void ge_sub(ge_p1p1 *r, const ge_p3 *p, const ge_cached *q); +void ge_double_scalarmult_vartime(ge_p2 *r, const unsigned char *a, const ge_p3 *A, const unsigned char *b); +void ge_madd(ge_p1p1 *r, const ge_p3 *p, const ge_precomp *q); +void ge_msub(ge_p1p1 *r, const ge_p3 *p, const ge_precomp *q); +void ge_scalarmult_base(ge_p3 *h, const unsigned char *a); + +void ge_p1p1_to_p2(ge_p2 *r, const ge_p1p1 *p); +void ge_p1p1_to_p3(ge_p3 *r, const ge_p1p1 *p); +void ge_p2_0(ge_p2 *h); +void ge_p2_dbl(ge_p1p1 *r, const ge_p2 *p); +void ge_p3_0(ge_p3 *h); +void ge_p3_dbl(ge_p1p1 *r, const ge_p3 *p); +void ge_p3_to_cached(ge_cached *r, const ge_p3 *p); +void ge_p3_to_p2(ge_p2 *r, const ge_p3 *p); + +#endif diff --git a/src/key_exchange.c b/src/key_exchange.c new file mode 100644 index 000000000..abd75da2c --- /dev/null +++ b/src/key_exchange.c @@ -0,0 +1,79 @@ +#include "ed25519.h" +#include "fe.h" + +void ed25519_key_exchange(unsigned char *shared_secret, const unsigned char *public_key, const unsigned char *private_key) { + unsigned char e[32]; + unsigned int i; + + fe x1; + fe x2; + fe z2; + fe x3; + fe z3; + fe tmp0; + fe tmp1; + + int pos; + unsigned int swap; + unsigned int b; + + /* copy the private key and make sure it's valid */ + for (i = 0; i < 32; ++i) { + e[i] = private_key[i]; + } + + e[0] &= 248; + e[31] &= 63; + e[31] |= 64; + + /* unpack the public key and convert edwards to montgomery */ + /* due to CodesInChaos: montgomeryX = (edwardsY + 1)*inverse(1 - edwardsY) mod p */ + fe_frombytes(x1, public_key); + fe_1(tmp1); + fe_add(tmp0, x1, tmp1); + fe_sub(tmp1, tmp1, x1); + fe_invert(tmp1, tmp1); + fe_mul(x1, tmp0, tmp1); + + fe_1(x2); + fe_0(z2); + fe_copy(x3, x1); + fe_1(z3); + + swap = 0; + for (pos = 254; pos >= 0; --pos) { + b = e[pos / 8] >> (pos & 7); + b &= 1; + swap ^= b; + fe_cswap(x2, x3, swap); + fe_cswap(z2, z3, swap); + swap = b; + + /* from montgomery.h */ + fe_sub(tmp0, x3, z3); + fe_sub(tmp1, x2, z2); + fe_add(x2, x2, z2); + fe_add(z2, x3, z3); + fe_mul(z3, tmp0, x2); + fe_mul(z2, z2, tmp1); + fe_sq(tmp0, tmp1); + fe_sq(tmp1, x2); + fe_add(x3, z3, z2); + fe_sub(z2, z3, z2); + fe_mul(x2, tmp1, tmp0); + fe_sub(tmp1, tmp1, tmp0); + fe_sq(z2, z2); + fe_mul121666(z3, tmp1); + fe_sq(x3, x3); + fe_add(tmp0, tmp0, z3); + fe_mul(z3, x1, z2); + fe_mul(z2, tmp1, tmp0); + } + + fe_cswap(x2, x3, swap); + fe_cswap(z2, z3, swap); + + fe_invert(z2, z2); + fe_mul(x2, x2, z2); + fe_tobytes(shared_secret, x2); +} diff --git a/src/keypair.c b/src/keypair.c new file mode 100644 index 000000000..dc1b8eccc --- /dev/null +++ b/src/keypair.c @@ -0,0 +1,16 @@ +#include "ed25519.h" +#include "sha512.h" +#include "ge.h" + + +void ed25519_create_keypair(unsigned char *public_key, unsigned char *private_key, const unsigned char *seed) { + ge_p3 A; + + sha512(seed, 32, private_key); + private_key[0] &= 248; + private_key[31] &= 63; + private_key[31] |= 64; + + ge_scalarmult_base(&A, private_key); + ge_p3_tobytes(public_key, &A); +} diff --git a/src/precomp_data.h b/src/precomp_data.h new file mode 100644 index 000000000..ff23986c3 --- /dev/null +++ b/src/precomp_data.h @@ -0,0 +1,1391 @@ +static const ge_precomp Bi[8] = { + { + { 25967493, -14356035, 29566456, 3660896, -12694345, 4014787, 27544626, -11754271, -6079156, 2047605 }, + { -12545711, 934262, -2722910, 3049990, -727428, 9406986, 12720692, 5043384, 19500929, -15469378 }, + { -8738181, 4489570, 9688441, -14785194, 10184609, -12363380, 29287919, 11864899, -24514362, -4438546 }, + }, + { + { 15636291, -9688557, 24204773, -7912398, 616977, -16685262, 27787600, -14772189, 28944400, -1550024 }, + { 16568933, 4717097, -11556148, -1102322, 15682896, -11807043, 16354577, -11775962, 7689662, 11199574 }, + { 30464156, -5976125, -11779434, -15670865, 23220365, 15915852, 7512774, 10017326, -17749093, -9920357 }, + }, + { + { 10861363, 11473154, 27284546, 1981175, -30064349, 12577861, 32867885, 14515107, -15438304, 10819380 }, + { 4708026, 6336745, 20377586, 9066809, -11272109, 6594696, -25653668, 12483688, -12668491, 5581306 }, + { 19563160, 16186464, -29386857, 4097519, 10237984, -4348115, 28542350, 13850243, -23678021, -15815942 }, + }, + { + { 5153746, 9909285, 1723747, -2777874, 30523605, 5516873, 19480852, 5230134, -23952439, -15175766 }, + { -30269007, -3463509, 7665486, 10083793, 28475525, 1649722, 20654025, 16520125, 30598449, 7715701 }, + { 28881845, 14381568, 9657904, 3680757, -20181635, 7843316, -31400660, 1370708, 29794553, -1409300 }, + }, + { + { -22518993, -6692182, 14201702, -8745502, -23510406, 8844726, 18474211, -1361450, -13062696, 13821877 }, + { -6455177, -7839871, 3374702, -4740862, -27098617, -10571707, 31655028, -7212327, 18853322, -14220951 }, + { 4566830, -12963868, -28974889, -12240689, -7602672, -2830569, -8514358, -10431137, 2207753, -3209784 }, + }, + { + { -25154831, -4185821, 29681144, 7868801, -6854661, -9423865, -12437364, -663000, -31111463, -16132436 }, + { 25576264, -2703214, 7349804, -11814844, 16472782, 9300885, 3844789, 15725684, 171356, 6466918 }, + { 23103977, 13316479, 9739013, -16149481, 817875, -15038942, 8965339, -14088058, -30714912, 16193877 }, + }, + { + { -33521811, 3180713, -2394130, 14003687, -16903474, -16270840, 17238398, 4729455, -18074513, 9256800 }, + { -25182317, -4174131, 32336398, 5036987, -21236817, 11360617, 22616405, 9761698, -19827198, 630305 }, + { -13720693, 2639453, -24237460, -7406481, 9494427, -5774029, -6554551, -15960994, -2449256, -14291300 }, + }, + { + { -3151181, -5046075, 9282714, 6866145, -31907062, -863023, -18940575, 15033784, 25105118, -7894876 }, + { -24326370, 15950226, -31801215, -14592823, -11662737, -5090925, 1573892, -2625887, 2198790, -15804619 }, + { -3099351, 10324967, -2241613, 7453183, -5446979, -2735503, -13812022, -16236442, -32461234, -12290683 }, + }, +}; + + +/* base[i][j] = (j+1)*256^i*B */ +static const ge_precomp base[32][8] = { + { + { + { 25967493, -14356035, 29566456, 3660896, -12694345, 4014787, 27544626, -11754271, -6079156, 2047605 }, + { -12545711, 934262, -2722910, 3049990, -727428, 9406986, 12720692, 5043384, 19500929, -15469378 }, + { -8738181, 4489570, 9688441, -14785194, 10184609, -12363380, 29287919, 11864899, -24514362, -4438546 }, + }, + { + { -12815894, -12976347, -21581243, 11784320, -25355658, -2750717, -11717903, -3814571, -358445, -10211303 }, + { -21703237, 6903825, 27185491, 6451973, -29577724, -9554005, -15616551, 11189268, -26829678, -5319081 }, + { 26966642, 11152617, 32442495, 15396054, 14353839, -12752335, -3128826, -9541118, -15472047, -4166697 }, + }, + { + { 15636291, -9688557, 24204773, -7912398, 616977, -16685262, 27787600, -14772189, 28944400, -1550024 }, + { 16568933, 4717097, -11556148, -1102322, 15682896, -11807043, 16354577, -11775962, 7689662, 11199574 }, + { 30464156, -5976125, -11779434, -15670865, 23220365, 15915852, 7512774, 10017326, -17749093, -9920357 }, + }, + { + { -17036878, 13921892, 10945806, -6033431, 27105052, -16084379, -28926210, 15006023, 3284568, -6276540 }, + { 23599295, -8306047, -11193664, -7687416, 13236774, 10506355, 7464579, 9656445, 13059162, 10374397 }, + { 7798556, 16710257, 3033922, 2874086, 28997861, 2835604, 32406664, -3839045, -641708, -101325 }, + }, + { + { 10861363, 11473154, 27284546, 1981175, -30064349, 12577861, 32867885, 14515107, -15438304, 10819380 }, + { 4708026, 6336745, 20377586, 9066809, -11272109, 6594696, -25653668, 12483688, -12668491, 5581306 }, + { 19563160, 16186464, -29386857, 4097519, 10237984, -4348115, 28542350, 13850243, -23678021, -15815942 }, + }, + { + { -15371964, -12862754, 32573250, 4720197, -26436522, 5875511, -19188627, -15224819, -9818940, -12085777 }, + { -8549212, 109983, 15149363, 2178705, 22900618, 4543417, 3044240, -15689887, 1762328, 14866737 }, + { -18199695, -15951423, -10473290, 1707278, -17185920, 3916101, -28236412, 3959421, 27914454, 4383652 }, + }, + { + { 5153746, 9909285, 1723747, -2777874, 30523605, 5516873, 19480852, 5230134, -23952439, -15175766 }, + { -30269007, -3463509, 7665486, 10083793, 28475525, 1649722, 20654025, 16520125, 30598449, 7715701 }, + { 28881845, 14381568, 9657904, 3680757, -20181635, 7843316, -31400660, 1370708, 29794553, -1409300 }, + }, + { + { 14499471, -2729599, -33191113, -4254652, 28494862, 14271267, 30290735, 10876454, -33154098, 2381726 }, + { -7195431, -2655363, -14730155, 462251, -27724326, 3941372, -6236617, 3696005, -32300832, 15351955 }, + { 27431194, 8222322, 16448760, -3907995, -18707002, 11938355, -32961401, -2970515, 29551813, 10109425 }, + }, + }, + { + { + { -13657040, -13155431, -31283750, 11777098, 21447386, 6519384, -2378284, -1627556, 10092783, -4764171 }, + { 27939166, 14210322, 4677035, 16277044, -22964462, -12398139, -32508754, 12005538, -17810127, 12803510 }, + { 17228999, -15661624, -1233527, 300140, -1224870, -11714777, 30364213, -9038194, 18016357, 4397660 }, + }, + { + { -10958843, -7690207, 4776341, -14954238, 27850028, -15602212, -26619106, 14544525, -17477504, 982639 }, + { 29253598, 15796703, -2863982, -9908884, 10057023, 3163536, 7332899, -4120128, -21047696, 9934963 }, + { 5793303, 16271923, -24131614, -10116404, 29188560, 1206517, -14747930, 4559895, -30123922, -10897950 }, + }, + { + { -27643952, -11493006, 16282657, -11036493, 28414021, -15012264, 24191034, 4541697, -13338309, 5500568 }, + { 12650548, -1497113, 9052871, 11355358, -17680037, -8400164, -17430592, 12264343, 10874051, 13524335 }, + { 25556948, -3045990, 714651, 2510400, 23394682, -10415330, 33119038, 5080568, -22528059, 5376628 }, + }, + { + { -26088264, -4011052, -17013699, -3537628, -6726793, 1920897, -22321305, -9447443, 4535768, 1569007 }, + { -2255422, 14606630, -21692440, -8039818, 28430649, 8775819, -30494562, 3044290, 31848280, 12543772 }, + { -22028579, 2943893, -31857513, 6777306, 13784462, -4292203, -27377195, -2062731, 7718482, 14474653 }, + }, + { + { 2385315, 2454213, -22631320, 46603, -4437935, -15680415, 656965, -7236665, 24316168, -5253567 }, + { 13741529, 10911568, -33233417, -8603737, -20177830, -1033297, 33040651, -13424532, -20729456, 8321686 }, + { 21060490, -2212744, 15712757, -4336099, 1639040, 10656336, 23845965, -11874838, -9984458, 608372 }, + }, + { + { -13672732, -15087586, -10889693, -7557059, -6036909, 11305547, 1123968, -6780577, 27229399, 23887 }, + { -23244140, -294205, -11744728, 14712571, -29465699, -2029617, 12797024, -6440308, -1633405, 16678954 }, + { -29500620, 4770662, -16054387, 14001338, 7830047, 9564805, -1508144, -4795045, -17169265, 4904953 }, + }, + { + { 24059557, 14617003, 19037157, -15039908, 19766093, -14906429, 5169211, 16191880, 2128236, -4326833 }, + { -16981152, 4124966, -8540610, -10653797, 30336522, -14105247, -29806336, 916033, -6882542, -2986532 }, + { -22630907, 12419372, -7134229, -7473371, -16478904, 16739175, 285431, 2763829, 15736322, 4143876 }, + }, + { + { 2379352, 11839345, -4110402, -5988665, 11274298, 794957, 212801, -14594663, 23527084, -16458268 }, + { 33431127, -11130478, -17838966, -15626900, 8909499, 8376530, -32625340, 4087881, -15188911, -14416214 }, + { 1767683, 7197987, -13205226, -2022635, -13091350, 448826, 5799055, 4357868, -4774191, -16323038 }, + }, + }, + { + { + { 6721966, 13833823, -23523388, -1551314, 26354293, -11863321, 23365147, -3949732, 7390890, 2759800 }, + { 4409041, 2052381, 23373853, 10530217, 7676779, -12885954, 21302353, -4264057, 1244380, -12919645 }, + { -4421239, 7169619, 4982368, -2957590, 30256825, -2777540, 14086413, 9208236, 15886429, 16489664 }, + }, + { + { 1996075, 10375649, 14346367, 13311202, -6874135, -16438411, -13693198, 398369, -30606455, -712933 }, + { -25307465, 9795880, -2777414, 14878809, -33531835, 14780363, 13348553, 12076947, -30836462, 5113182 }, + { -17770784, 11797796, 31950843, 13929123, -25888302, 12288344, -30341101, -7336386, 13847711, 5387222 }, + }, + { + { -18582163, -3416217, 17824843, -2340966, 22744343, -10442611, 8763061, 3617786, -19600662, 10370991 }, + { 20246567, -14369378, 22358229, -543712, 18507283, -10413996, 14554437, -8746092, 32232924, 16763880 }, + { 9648505, 10094563, 26416693, 14745928, -30374318, -6472621, 11094161, 15689506, 3140038, -16510092 }, + }, + { + { -16160072, 5472695, 31895588, 4744994, 8823515, 10365685, -27224800, 9448613, -28774454, 366295 }, + { 19153450, 11523972, -11096490, -6503142, -24647631, 5420647, 28344573, 8041113, 719605, 11671788 }, + { 8678025, 2694440, -6808014, 2517372, 4964326, 11152271, -15432916, -15266516, 27000813, -10195553 }, + }, + { + { -15157904, 7134312, 8639287, -2814877, -7235688, 10421742, 564065, 5336097, 6750977, -14521026 }, + { 11836410, -3979488, 26297894, 16080799, 23455045, 15735944, 1695823, -8819122, 8169720, 16220347 }, + { -18115838, 8653647, 17578566, -6092619, -8025777, -16012763, -11144307, -2627664, -5990708, -14166033 }, + }, + { + { -23308498, -10968312, 15213228, -10081214, -30853605, -11050004, 27884329, 2847284, 2655861, 1738395 }, + { -27537433, -14253021, -25336301, -8002780, -9370762, 8129821, 21651608, -3239336, -19087449, -11005278 }, + { 1533110, 3437855, 23735889, 459276, 29970501, 11335377, 26030092, 5821408, 10478196, 8544890 }, + }, + { + { 32173121, -16129311, 24896207, 3921497, 22579056, -3410854, 19270449, 12217473, 17789017, -3395995 }, + { -30552961, -2228401, -15578829, -10147201, 13243889, 517024, 15479401, -3853233, 30460520, 1052596 }, + { -11614875, 13323618, 32618793, 8175907, -15230173, 12596687, 27491595, -4612359, 3179268, -9478891 }, + }, + { + { 31947069, -14366651, -4640583, -15339921, -15125977, -6039709, -14756777, -16411740, 19072640, -9511060 }, + { 11685058, 11822410, 3158003, -13952594, 33402194, -4165066, 5977896, -5215017, 473099, 5040608 }, + { -20290863, 8198642, -27410132, 11602123, 1290375, -2799760, 28326862, 1721092, -19558642, -3131606 }, + }, + }, + { + { + { 7881532, 10687937, 7578723, 7738378, -18951012, -2553952, 21820786, 8076149, -27868496, 11538389 }, + { -19935666, 3899861, 18283497, -6801568, -15728660, -11249211, 8754525, 7446702, -5676054, 5797016 }, + { -11295600, -3793569, -15782110, -7964573, 12708869, -8456199, 2014099, -9050574, -2369172, -5877341 }, + }, + { + { -22472376, -11568741, -27682020, 1146375, 18956691, 16640559, 1192730, -3714199, 15123619, 10811505 }, + { 14352098, -3419715, -18942044, 10822655, 32750596, 4699007, -70363, 15776356, -28886779, -11974553 }, + { -28241164, -8072475, -4978962, -5315317, 29416931, 1847569, -20654173, -16484855, 4714547, -9600655 }, + }, + { + { 15200332, 8368572, 19679101, 15970074, -31872674, 1959451, 24611599, -4543832, -11745876, 12340220 }, + { 12876937, -10480056, 33134381, 6590940, -6307776, 14872440, 9613953, 8241152, 15370987, 9608631 }, + { -4143277, -12014408, 8446281, -391603, 4407738, 13629032, -7724868, 15866074, -28210621, -8814099 }, + }, + { + { 26660628, -15677655, 8393734, 358047, -7401291, 992988, -23904233, 858697, 20571223, 8420556 }, + { 14620715, 13067227, -15447274, 8264467, 14106269, 15080814, 33531827, 12516406, -21574435, -12476749 }, + { 236881, 10476226, 57258, -14677024, 6472998, 2466984, 17258519, 7256740, 8791136, 15069930 }, + }, + { + { 1276410, -9371918, 22949635, -16322807, -23493039, -5702186, 14711875, 4874229, -30663140, -2331391 }, + { 5855666, 4990204, -13711848, 7294284, -7804282, 1924647, -1423175, -7912378, -33069337, 9234253 }, + { 20590503, -9018988, 31529744, -7352666, -2706834, 10650548, 31559055, -11609587, 18979186, 13396066 }, + }, + { + { 24474287, 4968103, 22267082, 4407354, 24063882, -8325180, -18816887, 13594782, 33514650, 7021958 }, + { -11566906, -6565505, -21365085, 15928892, -26158305, 4315421, -25948728, -3916677, -21480480, 12868082 }, + { -28635013, 13504661, 19988037, -2132761, 21078225, 6443208, -21446107, 2244500, -12455797, -8089383 }, + }, + { + { -30595528, 13793479, -5852820, 319136, -25723172, -6263899, 33086546, 8957937, -15233648, 5540521 }, + { -11630176, -11503902, -8119500, -7643073, 2620056, 1022908, -23710744, -1568984, -16128528, -14962807 }, + { 23152971, 775386, 27395463, 14006635, -9701118, 4649512, 1689819, 892185, -11513277, -15205948 }, + }, + { + { 9770129, 9586738, 26496094, 4324120, 1556511, -3550024, 27453819, 4763127, -19179614, 5867134 }, + { -32765025, 1927590, 31726409, -4753295, 23962434, -16019500, 27846559, 5931263, -29749703, -16108455 }, + { 27461885, -2977536, 22380810, 1815854, -23033753, -3031938, 7283490, -15148073, -19526700, 7734629 }, + }, + }, + { + { + { -8010264, -9590817, -11120403, 6196038, 29344158, -13430885, 7585295, -3176626, 18549497, 15302069 }, + { -32658337, -6171222, -7672793, -11051681, 6258878, 13504381, 10458790, -6418461, -8872242, 8424746 }, + { 24687205, 8613276, -30667046, -3233545, 1863892, -1830544, 19206234, 7134917, -11284482, -828919 }, + }, + { + { 11334899, -9218022, 8025293, 12707519, 17523892, -10476071, 10243738, -14685461, -5066034, 16498837 }, + { 8911542, 6887158, -9584260, -6958590, 11145641, -9543680, 17303925, -14124238, 6536641, 10543906 }, + { -28946384, 15479763, -17466835, 568876, -1497683, 11223454, -2669190, -16625574, -27235709, 8876771 }, + }, + { + { -25742899, -12566864, -15649966, -846607, -33026686, -796288, -33481822, 15824474, -604426, -9039817 }, + { 10330056, 70051, 7957388, -9002667, 9764902, 15609756, 27698697, -4890037, 1657394, 3084098 }, + { 10477963, -7470260, 12119566, -13250805, 29016247, -5365589, 31280319, 14396151, -30233575, 15272409 }, + }, + { + { -12288309, 3169463, 28813183, 16658753, 25116432, -5630466, -25173957, -12636138, -25014757, 1950504 }, + { -26180358, 9489187, 11053416, -14746161, -31053720, 5825630, -8384306, -8767532, 15341279, 8373727 }, + { 28685821, 7759505, -14378516, -12002860, -31971820, 4079242, 298136, -10232602, -2878207, 15190420 }, + }, + { + { -32932876, 13806336, -14337485, -15794431, -24004620, 10940928, 8669718, 2742393, -26033313, -6875003 }, + { -1580388, -11729417, -25979658, -11445023, -17411874, -10912854, 9291594, -16247779, -12154742, 6048605 }, + { -30305315, 14843444, 1539301, 11864366, 20201677, 1900163, 13934231, 5128323, 11213262, 9168384 }, + }, + { + { -26280513, 11007847, 19408960, -940758, -18592965, -4328580, -5088060, -11105150, 20470157, -16398701 }, + { -23136053, 9282192, 14855179, -15390078, -7362815, -14408560, -22783952, 14461608, 14042978, 5230683 }, + { 29969567, -2741594, -16711867, -8552442, 9175486, -2468974, 21556951, 3506042, -5933891, -12449708 }, + }, + { + { -3144746, 8744661, 19704003, 4581278, -20430686, 6830683, -21284170, 8971513, -28539189, 15326563 }, + { -19464629, 10110288, -17262528, -3503892, -23500387, 1355669, -15523050, 15300988, -20514118, 9168260 }, + { -5353335, 4488613, -23803248, 16314347, 7780487, -15638939, -28948358, 9601605, 33087103, -9011387 }, + }, + { + { -19443170, -15512900, -20797467, -12445323, -29824447, 10229461, -27444329, -15000531, -5996870, 15664672 }, + { 23294591, -16632613, -22650781, -8470978, 27844204, 11461195, 13099750, -2460356, 18151676, 13417686 }, + { -24722913, -4176517, -31150679, 5988919, -26858785, 6685065, 1661597, -12551441, 15271676, -15452665 }, + }, + }, + { + { + { 11433042, -13228665, 8239631, -5279517, -1985436, -725718, -18698764, 2167544, -6921301, -13440182 }, + { -31436171, 15575146, 30436815, 12192228, -22463353, 9395379, -9917708, -8638997, 12215110, 12028277 }, + { 14098400, 6555944, 23007258, 5757252, -15427832, -12950502, 30123440, 4617780, -16900089, -655628 }, + }, + { + { -4026201, -15240835, 11893168, 13718664, -14809462, 1847385, -15819999, 10154009, 23973261, -12684474 }, + { -26531820, -3695990, -1908898, 2534301, -31870557, -16550355, 18341390, -11419951, 32013174, -10103539 }, + { -25479301, 10876443, -11771086, -14625140, -12369567, 1838104, 21911214, 6354752, 4425632, -837822 }, + }, + { + { -10433389, -14612966, 22229858, -3091047, -13191166, 776729, -17415375, -12020462, 4725005, 14044970 }, + { 19268650, -7304421, 1555349, 8692754, -21474059, -9910664, 6347390, -1411784, -19522291, -16109756 }, + { -24864089, 12986008, -10898878, -5558584, -11312371, -148526, 19541418, 8180106, 9282262, 10282508 }, + }, + { + { -26205082, 4428547, -8661196, -13194263, 4098402, -14165257, 15522535, 8372215, 5542595, -10702683 }, + { -10562541, 14895633, 26814552, -16673850, -17480754, -2489360, -2781891, 6993761, -18093885, 10114655 }, + { -20107055, -929418, 31422704, 10427861, -7110749, 6150669, -29091755, -11529146, 25953725, -106158 }, + }, + { + { -4234397, -8039292, -9119125, 3046000, 2101609, -12607294, 19390020, 6094296, -3315279, 12831125 }, + { -15998678, 7578152, 5310217, 14408357, -33548620, -224739, 31575954, 6326196, 7381791, -2421839 }, + { -20902779, 3296811, 24736065, -16328389, 18374254, 7318640, 6295303, 8082724, -15362489, 12339664 }, + }, + { + { 27724736, 2291157, 6088201, -14184798, 1792727, 5857634, 13848414, 15768922, 25091167, 14856294 }, + { -18866652, 8331043, 24373479, 8541013, -701998, -9269457, 12927300, -12695493, -22182473, -9012899 }, + { -11423429, -5421590, 11632845, 3405020, 30536730, -11674039, -27260765, 13866390, 30146206, 9142070 }, + }, + { + { 3924129, -15307516, -13817122, -10054960, 12291820, -668366, -27702774, 9326384, -8237858, 4171294 }, + { -15921940, 16037937, 6713787, 16606682, -21612135, 2790944, 26396185, 3731949, 345228, -5462949 }, + { -21327538, 13448259, 25284571, 1143661, 20614966, -8849387, 2031539, -12391231, -16253183, -13582083 }, + }, + { + { 31016211, -16722429, 26371392, -14451233, -5027349, 14854137, 17477601, 3842657, 28012650, -16405420 }, + { -5075835, 9368966, -8562079, -4600902, -15249953, 6970560, -9189873, 16292057, -8867157, 3507940 }, + { 29439664, 3537914, 23333589, 6997794, -17555561, -11018068, -15209202, -15051267, -9164929, 6580396 }, + }, + }, + { + { + { -12185861, -7679788, 16438269, 10826160, -8696817, -6235611, 17860444, -9273846, -2095802, 9304567 }, + { 20714564, -4336911, 29088195, 7406487, 11426967, -5095705, 14792667, -14608617, 5289421, -477127 }, + { -16665533, -10650790, -6160345, -13305760, 9192020, -1802462, 17271490, 12349094, 26939669, -3752294 }, + }, + { + { -12889898, 9373458, 31595848, 16374215, 21471720, 13221525, -27283495, -12348559, -3698806, 117887 }, + { 22263325, -6560050, 3984570, -11174646, -15114008, -566785, 28311253, 5358056, -23319780, 541964 }, + { 16259219, 3261970, 2309254, -15534474, -16885711, -4581916, 24134070, -16705829, -13337066, -13552195 }, + }, + { + { 9378160, -13140186, -22845982, -12745264, 28198281, -7244098, -2399684, -717351, 690426, 14876244 }, + { 24977353, -314384, -8223969, -13465086, 28432343, -1176353, -13068804, -12297348, -22380984, 6618999 }, + { -1538174, 11685646, 12944378, 13682314, -24389511, -14413193, 8044829, -13817328, 32239829, -5652762 }, + }, + { + { -18603066, 4762990, -926250, 8885304, -28412480, -3187315, 9781647, -10350059, 32779359, 5095274 }, + { -33008130, -5214506, -32264887, -3685216, 9460461, -9327423, -24601656, 14506724, 21639561, -2630236 }, + { -16400943, -13112215, 25239338, 15531969, 3987758, -4499318, -1289502, -6863535, 17874574, 558605 }, + }, + { + { -13600129, 10240081, 9171883, 16131053, -20869254, 9599700, 33499487, 5080151, 2085892, 5119761 }, + { -22205145, -2519528, -16381601, 414691, -25019550, 2170430, 30634760, -8363614, -31999993, -5759884 }, + { -6845704, 15791202, 8550074, -1312654, 29928809, -12092256, 27534430, -7192145, -22351378, 12961482 }, + }, + { + { -24492060, -9570771, 10368194, 11582341, -23397293, -2245287, 16533930, 8206996, -30194652, -5159638 }, + { -11121496, -3382234, 2307366, 6362031, -135455, 8868177, -16835630, 7031275, 7589640, 8945490 }, + { -32152748, 8917967, 6661220, -11677616, -1192060, -15793393, 7251489, -11182180, 24099109, -14456170 }, + }, + { + { 5019558, -7907470, 4244127, -14714356, -26933272, 6453165, -19118182, -13289025, -6231896, -10280736 }, + { 10853594, 10721687, 26480089, 5861829, -22995819, 1972175, -1866647, -10557898, -3363451, -6441124 }, + { -17002408, 5906790, 221599, -6563147, 7828208, -13248918, 24362661, -2008168, -13866408, 7421392 }, + }, + { + { 8139927, -6546497, 32257646, -5890546, 30375719, 1886181, -21175108, 15441252, 28826358, -4123029 }, + { 6267086, 9695052, 7709135, -16603597, -32869068, -1886135, 14795160, -7840124, 13746021, -1742048 }, + { 28584902, 7787108, -6732942, -15050729, 22846041, -7571236, -3181936, -363524, 4771362, -8419958 }, + }, + }, + { + { + { 24949256, 6376279, -27466481, -8174608, -18646154, -9930606, 33543569, -12141695, 3569627, 11342593 }, + { 26514989, 4740088, 27912651, 3697550, 19331575, -11472339, 6809886, 4608608, 7325975, -14801071 }, + { -11618399, -14554430, -24321212, 7655128, -1369274, 5214312, -27400540, 10258390, -17646694, -8186692 }, + }, + { + { 11431204, 15823007, 26570245, 14329124, 18029990, 4796082, -31446179, 15580664, 9280358, -3973687 }, + { -160783, -10326257, -22855316, -4304997, -20861367, -13621002, -32810901, -11181622, -15545091, 4387441 }, + { -20799378, 12194512, 3937617, -5805892, -27154820, 9340370, -24513992, 8548137, 20617071, -7482001 }, + }, + { + { -938825, -3930586, -8714311, 16124718, 24603125, -6225393, -13775352, -11875822, 24345683, 10325460 }, + { -19855277, -1568885, -22202708, 8714034, 14007766, 6928528, 16318175, -1010689, 4766743, 3552007 }, + { -21751364, -16730916, 1351763, -803421, -4009670, 3950935, 3217514, 14481909, 10988822, -3994762 }, + }, + { + { 15564307, -14311570, 3101243, 5684148, 30446780, -8051356, 12677127, -6505343, -8295852, 13296005 }, + { -9442290, 6624296, -30298964, -11913677, -4670981, -2057379, 31521204, 9614054, -30000824, 12074674 }, + { 4771191, -135239, 14290749, -13089852, 27992298, 14998318, -1413936, -1556716, 29832613, -16391035 }, + }, + { + { 7064884, -7541174, -19161962, -5067537, -18891269, -2912736, 25825242, 5293297, -27122660, 13101590 }, + { -2298563, 2439670, -7466610, 1719965, -27267541, -16328445, 32512469, -5317593, -30356070, -4190957 }, + { -30006540, 10162316, -33180176, 3981723, -16482138, -13070044, 14413974, 9515896, 19568978, 9628812 }, + }, + { + { 33053803, 199357, 15894591, 1583059, 27380243, -4580435, -17838894, -6106839, -6291786, 3437740 }, + { -18978877, 3884493, 19469877, 12726490, 15913552, 13614290, -22961733, 70104, 7463304, 4176122 }, + { -27124001, 10659917, 11482427, -16070381, 12771467, -6635117, -32719404, -5322751, 24216882, 5944158 }, + }, + { + { 8894125, 7450974, -2664149, -9765752, -28080517, -12389115, 19345746, 14680796, 11632993, 5847885 }, + { 26942781, -2315317, 9129564, -4906607, 26024105, 11769399, -11518837, 6367194, -9727230, 4782140 }, + { 19916461, -4828410, -22910704, -11414391, 25606324, -5972441, 33253853, 8220911, 6358847, -1873857 }, + }, + { + { 801428, -2081702, 16569428, 11065167, 29875704, 96627, 7908388, -4480480, -13538503, 1387155 }, + { 19646058, 5720633, -11416706, 12814209, 11607948, 12749789, 14147075, 15156355, -21866831, 11835260 }, + { 19299512, 1155910, 28703737, 14890794, 2925026, 7269399, 26121523, 15467869, -26560550, 5052483 }, + }, + }, + { + { + { -3017432, 10058206, 1980837, 3964243, 22160966, 12322533, -6431123, -12618185, 12228557, -7003677 }, + { 32944382, 14922211, -22844894, 5188528, 21913450, -8719943, 4001465, 13238564, -6114803, 8653815 }, + { 22865569, -4652735, 27603668, -12545395, 14348958, 8234005, 24808405, 5719875, 28483275, 2841751 }, + }, + { + { -16420968, -1113305, -327719, -12107856, 21886282, -15552774, -1887966, -315658, 19932058, -12739203 }, + { -11656086, 10087521, -8864888, -5536143, -19278573, -3055912, 3999228, 13239134, -4777469, -13910208 }, + { 1382174, -11694719, 17266790, 9194690, -13324356, 9720081, 20403944, 11284705, -14013818, 3093230 }, + }, + { + { 16650921, -11037932, -1064178, 1570629, -8329746, 7352753, -302424, 16271225, -24049421, -6691850 }, + { -21911077, -5927941, -4611316, -5560156, -31744103, -10785293, 24123614, 15193618, -21652117, -16739389 }, + { -9935934, -4289447, -25279823, 4372842, 2087473, 10399484, 31870908, 14690798, 17361620, 11864968 }, + }, + { + { -11307610, 6210372, 13206574, 5806320, -29017692, -13967200, -12331205, -7486601, -25578460, -16240689 }, + { 14668462, -12270235, 26039039, 15305210, 25515617, 4542480, 10453892, 6577524, 9145645, -6443880 }, + { 5974874, 3053895, -9433049, -10385191, -31865124, 3225009, -7972642, 3936128, -5652273, -3050304 }, + }, + { + { 30625386, -4729400, -25555961, -12792866, -20484575, 7695099, 17097188, -16303496, -27999779, 1803632 }, + { -3553091, 9865099, -5228566, 4272701, -5673832, -16689700, 14911344, 12196514, -21405489, 7047412 }, + { 20093277, 9920966, -11138194, -5343857, 13161587, 12044805, -32856851, 4124601, -32343828, -10257566 }, + }, + { + { -20788824, 14084654, -13531713, 7842147, 19119038, -13822605, 4752377, -8714640, -21679658, 2288038 }, + { -26819236, -3283715, 29965059, 3039786, -14473765, 2540457, 29457502, 14625692, -24819617, 12570232 }, + { -1063558, -11551823, 16920318, 12494842, 1278292, -5869109, -21159943, -3498680, -11974704, 4724943 }, + }, + { + { 17960970, -11775534, -4140968, -9702530, -8876562, -1410617, -12907383, -8659932, -29576300, 1903856 }, + { 23134274, -14279132, -10681997, -1611936, 20684485, 15770816, -12989750, 3190296, 26955097, 14109738 }, + { 15308788, 5320727, -30113809, -14318877, 22902008, 7767164, 29425325, -11277562, 31960942, 11934971 }, + }, + { + { -27395711, 8435796, 4109644, 12222639, -24627868, 14818669, 20638173, 4875028, 10491392, 1379718 }, + { -13159415, 9197841, 3875503, -8936108, -1383712, -5879801, 33518459, 16176658, 21432314, 12180697 }, + { -11787308, 11500838, 13787581, -13832590, -22430679, 10140205, 1465425, 12689540, -10301319, -13872883 }, + }, + }, + { + { + { 5414091, -15386041, -21007664, 9643570, 12834970, 1186149, -2622916, -1342231, 26128231, 6032912 }, + { -26337395, -13766162, 32496025, -13653919, 17847801, -12669156, 3604025, 8316894, -25875034, -10437358 }, + { 3296484, 6223048, 24680646, -12246460, -23052020, 5903205, -8862297, -4639164, 12376617, 3188849 }, + }, + { + { 29190488, -14659046, 27549113, -1183516, 3520066, -10697301, 32049515, -7309113, -16109234, -9852307 }, + { -14744486, -9309156, 735818, -598978, -20407687, -5057904, 25246078, -15795669, 18640741, -960977 }, + { -6928835, -16430795, 10361374, 5642961, 4910474, 12345252, -31638386, -494430, 10530747, 1053335 }, + }, + { + { -29265967, -14186805, -13538216, -12117373, -19457059, -10655384, -31462369, -2948985, 24018831, 15026644 }, + { -22592535, -3145277, -2289276, 5953843, -13440189, 9425631, 25310643, 13003497, -2314791, -15145616 }, + { -27419985, -603321, -8043984, -1669117, -26092265, 13987819, -27297622, 187899, -23166419, -2531735 }, + }, + { + { -21744398, -13810475, 1844840, 5021428, -10434399, -15911473, 9716667, 16266922, -5070217, 726099 }, + { 29370922, -6053998, 7334071, -15342259, 9385287, 2247707, -13661962, -4839461, 30007388, -15823341 }, + { -936379, 16086691, 23751945, -543318, -1167538, -5189036, 9137109, 730663, 9835848, 4555336 }, + }, + { + { -23376435, 1410446, -22253753, -12899614, 30867635, 15826977, 17693930, 544696, -11985298, 12422646 }, + { 31117226, -12215734, -13502838, 6561947, -9876867, -12757670, -5118685, -4096706, 29120153, 13924425 }, + { -17400879, -14233209, 19675799, -2734756, -11006962, -5858820, -9383939, -11317700, 7240931, -237388 }, + }, + { + { -31361739, -11346780, -15007447, -5856218, -22453340, -12152771, 1222336, 4389483, 3293637, -15551743 }, + { -16684801, -14444245, 11038544, 11054958, -13801175, -3338533, -24319580, 7733547, 12796905, -6335822 }, + { -8759414, -10817836, -25418864, 10783769, -30615557, -9746811, -28253339, 3647836, 3222231, -11160462 }, + }, + { + { 18606113, 1693100, -25448386, -15170272, 4112353, 10045021, 23603893, -2048234, -7550776, 2484985 }, + { 9255317, -3131197, -12156162, -1004256, 13098013, -9214866, 16377220, -2102812, -19802075, -3034702 }, + { -22729289, 7496160, -5742199, 11329249, 19991973, -3347502, -31718148, 9936966, -30097688, -10618797 }, + }, + { + { 21878590, -5001297, 4338336, 13643897, -3036865, 13160960, 19708896, 5415497, -7360503, -4109293 }, + { 27736861, 10103576, 12500508, 8502413, -3413016, -9633558, 10436918, -1550276, -23659143, -8132100 }, + { 19492550, -12104365, -29681976, -852630, -3208171, 12403437, 30066266, 8367329, 13243957, 8709688 }, + }, + }, + { + { + { 12015105, 2801261, 28198131, 10151021, 24818120, -4743133, -11194191, -5645734, 5150968, 7274186 }, + { 2831366, -12492146, 1478975, 6122054, 23825128, -12733586, 31097299, 6083058, 31021603, -9793610 }, + { -2529932, -2229646, 445613, 10720828, -13849527, -11505937, -23507731, 16354465, 15067285, -14147707 }, + }, + { + { 7840942, 14037873, -33364863, 15934016, -728213, -3642706, 21403988, 1057586, -19379462, -12403220 }, + { 915865, -16469274, 15608285, -8789130, -24357026, 6060030, -17371319, 8410997, -7220461, 16527025 }, + { 32922597, -556987, 20336074, -16184568, 10903705, -5384487, 16957574, 52992, 23834301, 6588044 }, + }, + { + { 32752030, 11232950, 3381995, -8714866, 22652988, -10744103, 17159699, 16689107, -20314580, -1305992 }, + { -4689649, 9166776, -25710296, -10847306, 11576752, 12733943, 7924251, -2752281, 1976123, -7249027 }, + { 21251222, 16309901, -2983015, -6783122, 30810597, 12967303, 156041, -3371252, 12331345, -8237197 }, + }, + { + { 8651614, -4477032, -16085636, -4996994, 13002507, 2950805, 29054427, -5106970, 10008136, -4667901 }, + { 31486080, 15114593, -14261250, 12951354, 14369431, -7387845, 16347321, -13662089, 8684155, -10532952 }, + { 19443825, 11385320, 24468943, -9659068, -23919258, 2187569, -26263207, -6086921, 31316348, 14219878 }, + }, + { + { -28594490, 1193785, 32245219, 11392485, 31092169, 15722801, 27146014, 6992409, 29126555, 9207390 }, + { 32382935, 1110093, 18477781, 11028262, -27411763, -7548111, -4980517, 10843782, -7957600, -14435730 }, + { 2814918, 7836403, 27519878, -7868156, -20894015, -11553689, -21494559, 8550130, 28346258, 1994730 }, + }, + { + { -19578299, 8085545, -14000519, -3948622, 2785838, -16231307, -19516951, 7174894, 22628102, 8115180 }, + { -30405132, 955511, -11133838, -15078069, -32447087, -13278079, -25651578, 3317160, -9943017, 930272 }, + { -15303681, -6833769, 28856490, 1357446, 23421993, 1057177, 24091212, -1388970, -22765376, -10650715 }, + }, + { + { -22751231, -5303997, -12907607, -12768866, -15811511, -7797053, -14839018, -16554220, -1867018, 8398970 }, + { -31969310, 2106403, -4736360, 1362501, 12813763, 16200670, 22981545, -6291273, 18009408, -15772772 }, + { -17220923, -9545221, -27784654, 14166835, 29815394, 7444469, 29551787, -3727419, 19288549, 1325865 }, + }, + { + { 15100157, -15835752, -23923978, -1005098, -26450192, 15509408, 12376730, -3479146, 33166107, -8042750 }, + { 20909231, 13023121, -9209752, 16251778, -5778415, -8094914, 12412151, 10018715, 2213263, -13878373 }, + { 32529814, -11074689, 30361439, -16689753, -9135940, 1513226, 22922121, 6382134, -5766928, 8371348 }, + }, + }, + { + { + { 9923462, 11271500, 12616794, 3544722, -29998368, -1721626, 12891687, -8193132, -26442943, 10486144 }, + { -22597207, -7012665, 8587003, -8257861, 4084309, -12970062, 361726, 2610596, -23921530, -11455195 }, + { 5408411, -1136691, -4969122, 10561668, 24145918, 14240566, 31319731, -4235541, 19985175, -3436086 }, + }, + { + { -13994457, 16616821, 14549246, 3341099, 32155958, 13648976, -17577068, 8849297, 65030, 8370684 }, + { -8320926, -12049626, 31204563, 5839400, -20627288, -1057277, -19442942, 6922164, 12743482, -9800518 }, + { -2361371, 12678785, 28815050, 4759974, -23893047, 4884717, 23783145, 11038569, 18800704, 255233 }, + }, + { + { -5269658, -1773886, 13957886, 7990715, 23132995, 728773, 13393847, 9066957, 19258688, -14753793 }, + { -2936654, -10827535, -10432089, 14516793, -3640786, 4372541, -31934921, 2209390, -1524053, 2055794 }, + { 580882, 16705327, 5468415, -2683018, -30926419, -14696000, -7203346, -8994389, -30021019, 7394435 }, + }, + { + { 23838809, 1822728, -15738443, 15242727, 8318092, -3733104, -21672180, -3492205, -4821741, 14799921 }, + { 13345610, 9759151, 3371034, -16137791, 16353039, 8577942, 31129804, 13496856, -9056018, 7402518 }, + { 2286874, -4435931, -20042458, -2008336, -13696227, 5038122, 11006906, -15760352, 8205061, 1607563 }, + }, + { + { 14414086, -8002132, 3331830, -3208217, 22249151, -5594188, 18364661, -2906958, 30019587, -9029278 }, + { -27688051, 1585953, -10775053, 931069, -29120221, -11002319, -14410829, 12029093, 9944378, 8024 }, + { 4368715, -3709630, 29874200, -15022983, -20230386, -11410704, -16114594, -999085, -8142388, 5640030 }, + }, + { + { 10299610, 13746483, 11661824, 16234854, 7630238, 5998374, 9809887, -16694564, 15219798, -14327783 }, + { 27425505, -5719081, 3055006, 10660664, 23458024, 595578, -15398605, -1173195, -18342183, 9742717 }, + { 6744077, 2427284, 26042789, 2720740, -847906, 1118974, 32324614, 7406442, 12420155, 1994844 }, + }, + { + { 14012521, -5024720, -18384453, -9578469, -26485342, -3936439, -13033478, -10909803, 24319929, -6446333 }, + { 16412690, -4507367, 10772641, 15929391, -17068788, -4658621, 10555945, -10484049, -30102368, -4739048 }, + { 22397382, -7767684, -9293161, -12792868, 17166287, -9755136, -27333065, 6199366, 21880021, -12250760 }, + }, + { + { -4283307, 5368523, -31117018, 8163389, -30323063, 3209128, 16557151, 8890729, 8840445, 4957760 }, + { -15447727, 709327, -6919446, -10870178, -29777922, 6522332, -21720181, 12130072, -14796503, 5005757 }, + { -2114751, -14308128, 23019042, 15765735, -25269683, 6002752, 10183197, -13239326, -16395286, -2176112 }, + }, + }, + { + { + { -19025756, 1632005, 13466291, -7995100, -23640451, 16573537, -32013908, -3057104, 22208662, 2000468 }, + { 3065073, -1412761, -25598674, -361432, -17683065, -5703415, -8164212, 11248527, -3691214, -7414184 }, + { 10379208, -6045554, 8877319, 1473647, -29291284, -12507580, 16690915, 2553332, -3132688, 16400289 }, + }, + { + { 15716668, 1254266, -18472690, 7446274, -8448918, 6344164, -22097271, -7285580, 26894937, 9132066 }, + { 24158887, 12938817, 11085297, -8177598, -28063478, -4457083, -30576463, 64452, -6817084, -2692882 }, + { 13488534, 7794716, 22236231, 5989356, 25426474, -12578208, 2350710, -3418511, -4688006, 2364226 }, + }, + { + { 16335052, 9132434, 25640582, 6678888, 1725628, 8517937, -11807024, -11697457, 15445875, -7798101 }, + { 29004207, -7867081, 28661402, -640412, -12794003, -7943086, 31863255, -4135540, -278050, -15759279 }, + { -6122061, -14866665, -28614905, 14569919, -10857999, -3591829, 10343412, -6976290, -29828287, -10815811 }, + }, + { + { 27081650, 3463984, 14099042, -4517604, 1616303, -6205604, 29542636, 15372179, 17293797, 960709 }, + { 20263915, 11434237, -5765435, 11236810, 13505955, -10857102, -16111345, 6493122, -19384511, 7639714 }, + { -2830798, -14839232, 25403038, -8215196, -8317012, -16173699, 18006287, -16043750, 29994677, -15808121 }, + }, + { + { 9769828, 5202651, -24157398, -13631392, -28051003, -11561624, -24613141, -13860782, -31184575, 709464 }, + { 12286395, 13076066, -21775189, -1176622, -25003198, 4057652, -32018128, -8890874, 16102007, 13205847 }, + { 13733362, 5599946, 10557076, 3195751, -5557991, 8536970, -25540170, 8525972, 10151379, 10394400 }, + }, + { + { 4024660, -16137551, 22436262, 12276534, -9099015, -2686099, 19698229, 11743039, -33302334, 8934414 }, + { -15879800, -4525240, -8580747, -2934061, 14634845, -698278, -9449077, 3137094, -11536886, 11721158 }, + { 17555939, -5013938, 8268606, 2331751, -22738815, 9761013, 9319229, 8835153, -9205489, -1280045 }, + }, + { + { -461409, -7830014, 20614118, 16688288, -7514766, -4807119, 22300304, 505429, 6108462, -6183415 }, + { -5070281, 12367917, -30663534, 3234473, 32617080, -8422642, 29880583, -13483331, -26898490, -7867459 }, + { -31975283, 5726539, 26934134, 10237677, -3173717, -605053, 24199304, 3795095, 7592688, -14992079 }, + }, + { + { 21594432, -14964228, 17466408, -4077222, 32537084, 2739898, 6407723, 12018833, -28256052, 4298412 }, + { -20650503, -11961496, -27236275, 570498, 3767144, -1717540, 13891942, -1569194, 13717174, 10805743 }, + { -14676630, -15644296, 15287174, 11927123, 24177847, -8175568, -796431, 14860609, -26938930, -5863836 }, + }, + }, + { + { + { 12962541, 5311799, -10060768, 11658280, 18855286, -7954201, 13286263, -12808704, -4381056, 9882022 }, + { 18512079, 11319350, -20123124, 15090309, 18818594, 5271736, -22727904, 3666879, -23967430, -3299429 }, + { -6789020, -3146043, 16192429, 13241070, 15898607, -14206114, -10084880, -6661110, -2403099, 5276065 }, + }, + { + { 30169808, -5317648, 26306206, -11750859, 27814964, 7069267, 7152851, 3684982, 1449224, 13082861 }, + { 10342826, 3098505, 2119311, 193222, 25702612, 12233820, 23697382, 15056736, -21016438, -8202000 }, + { -33150110, 3261608, 22745853, 7948688, 19370557, -15177665, -26171976, 6482814, -10300080, -11060101 }, + }, + { + { 32869458, -5408545, 25609743, 15678670, -10687769, -15471071, 26112421, 2521008, -22664288, 6904815 }, + { 29506923, 4457497, 3377935, -9796444, -30510046, 12935080, 1561737, 3841096, -29003639, -6657642 }, + { 10340844, -6630377, -18656632, -2278430, 12621151, -13339055, 30878497, -11824370, -25584551, 5181966 }, + }, + { + { 25940115, -12658025, 17324188, -10307374, -8671468, 15029094, 24396252, -16450922, -2322852, -12388574 }, + { -21765684, 9916823, -1300409, 4079498, -1028346, 11909559, 1782390, 12641087, 20603771, -6561742 }, + { -18882287, -11673380, 24849422, 11501709, 13161720, -4768874, 1925523, 11914390, 4662781, 7820689 }, + }, + { + { 12241050, -425982, 8132691, 9393934, 32846760, -1599620, 29749456, 12172924, 16136752, 15264020 }, + { -10349955, -14680563, -8211979, 2330220, -17662549, -14545780, 10658213, 6671822, 19012087, 3772772 }, + { 3753511, -3421066, 10617074, 2028709, 14841030, -6721664, 28718732, -15762884, 20527771, 12988982 }, + }, + { + { -14822485, -5797269, -3707987, 12689773, -898983, -10914866, -24183046, -10564943, 3299665, -12424953 }, + { -16777703, -15253301, -9642417, 4978983, 3308785, 8755439, 6943197, 6461331, -25583147, 8991218 }, + { -17226263, 1816362, -1673288, -6086439, 31783888, -8175991, -32948145, 7417950, -30242287, 1507265 }, + }, + { + { 29692663, 6829891, -10498800, 4334896, 20945975, -11906496, -28887608, 8209391, 14606362, -10647073 }, + { -3481570, 8707081, 32188102, 5672294, 22096700, 1711240, -33020695, 9761487, 4170404, -2085325 }, + { -11587470, 14855945, -4127778, -1531857, -26649089, 15084046, 22186522, 16002000, -14276837, -8400798 }, + }, + { + { -4811456, 13761029, -31703877, -2483919, -3312471, 7869047, -7113572, -9620092, 13240845, 10965870 }, + { -7742563, -8256762, -14768334, -13656260, -23232383, 12387166, 4498947, 14147411, 29514390, 4302863 }, + { -13413405, -12407859, 20757302, -13801832, 14785143, 8976368, -5061276, -2144373, 17846988, -13971927 }, + }, + }, + { + { + { -2244452, -754728, -4597030, -1066309, -6247172, 1455299, -21647728, -9214789, -5222701, 12650267 }, + { -9906797, -16070310, 21134160, 12198166, -27064575, 708126, 387813, 13770293, -19134326, 10958663 }, + { 22470984, 12369526, 23446014, -5441109, -21520802, -9698723, -11772496, -11574455, -25083830, 4271862 }, + }, + { + { -25169565, -10053642, -19909332, 15361595, -5984358, 2159192, 75375, -4278529, -32526221, 8469673 }, + { 15854970, 4148314, -8893890, 7259002, 11666551, 13824734, -30531198, 2697372, 24154791, -9460943 }, + { 15446137, -15806644, 29759747, 14019369, 30811221, -9610191, -31582008, 12840104, 24913809, 9815020 }, + }, + { + { -4709286, -5614269, -31841498, -12288893, -14443537, 10799414, -9103676, 13438769, 18735128, 9466238 }, + { 11933045, 9281483, 5081055, -5183824, -2628162, -4905629, -7727821, -10896103, -22728655, 16199064 }, + { 14576810, 379472, -26786533, -8317236, -29426508, -10812974, -102766, 1876699, 30801119, 2164795 }, + }, + { + { 15995086, 3199873, 13672555, 13712240, -19378835, -4647646, -13081610, -15496269, -13492807, 1268052 }, + { -10290614, -3659039, -3286592, 10948818, 23037027, 3794475, -3470338, -12600221, -17055369, 3565904 }, + { 29210088, -9419337, -5919792, -4952785, 10834811, -13327726, -16512102, -10820713, -27162222, -14030531 }, + }, + { + { -13161890, 15508588, 16663704, -8156150, -28349942, 9019123, -29183421, -3769423, 2244111, -14001979 }, + { -5152875, -3800936, -9306475, -6071583, 16243069, 14684434, -25673088, -16180800, 13491506, 4641841 }, + { 10813417, 643330, -19188515, -728916, 30292062, -16600078, 27548447, -7721242, 14476989, -12767431 }, + }, + { + { 10292079, 9984945, 6481436, 8279905, -7251514, 7032743, 27282937, -1644259, -27912810, 12651324 }, + { -31185513, -813383, 22271204, 11835308, 10201545, 15351028, 17099662, 3988035, 21721536, -3148940 }, + { 10202177, -6545839, -31373232, -9574638, -32150642, -8119683, -12906320, 3852694, 13216206, 14842320 }, + }, + { + { -15815640, -10601066, -6538952, -7258995, -6984659, -6581778, -31500847, 13765824, -27434397, 9900184 }, + { 14465505, -13833331, -32133984, -14738873, -27443187, 12990492, 33046193, 15796406, -7051866, -8040114 }, + { 30924417, -8279620, 6359016, -12816335, 16508377, 9071735, -25488601, 15413635, 9524356, -7018878 }, + }, + { + { 12274201, -13175547, 32627641, -1785326, 6736625, 13267305, 5237659, -5109483, 15663516, 4035784 }, + { -2951309, 8903985, 17349946, 601635, -16432815, -4612556, -13732739, -15889334, -22258478, 4659091 }, + { -16916263, -4952973, -30393711, -15158821, 20774812, 15897498, 5736189, 15026997, -2178256, -13455585 }, + }, + }, + { + { + { -8858980, -2219056, 28571666, -10155518, -474467, -10105698, -3801496, 278095, 23440562, -290208 }, + { 10226241, -5928702, 15139956, 120818, -14867693, 5218603, 32937275, 11551483, -16571960, -7442864 }, + { 17932739, -12437276, -24039557, 10749060, 11316803, 7535897, 22503767, 5561594, -3646624, 3898661 }, + }, + { + { 7749907, -969567, -16339731, -16464, -25018111, 15122143, -1573531, 7152530, 21831162, 1245233 }, + { 26958459, -14658026, 4314586, 8346991, -5677764, 11960072, -32589295, -620035, -30402091, -16716212 }, + { -12165896, 9166947, 33491384, 13673479, 29787085, 13096535, 6280834, 14587357, -22338025, 13987525 }, + }, + { + { -24349909, 7778775, 21116000, 15572597, -4833266, -5357778, -4300898, -5124639, -7469781, -2858068 }, + { 9681908, -6737123, -31951644, 13591838, -6883821, 386950, 31622781, 6439245, -14581012, 4091397 }, + { -8426427, 1470727, -28109679, -1596990, 3978627, -5123623, -19622683, 12092163, 29077877, -14741988 }, + }, + { + { 5269168, -6859726, -13230211, -8020715, 25932563, 1763552, -5606110, -5505881, -20017847, 2357889 }, + { 32264008, -15407652, -5387735, -1160093, -2091322, -3946900, 23104804, -12869908, 5727338, 189038 }, + { 14609123, -8954470, -6000566, -16622781, -14577387, -7743898, -26745169, 10942115, -25888931, -14884697 }, + }, + { + { 20513500, 5557931, -15604613, 7829531, 26413943, -2019404, -21378968, 7471781, 13913677, -5137875 }, + { -25574376, 11967826, 29233242, 12948236, -6754465, 4713227, -8940970, 14059180, 12878652, 8511905 }, + { -25656801, 3393631, -2955415, -7075526, -2250709, 9366908, -30223418, 6812974, 5568676, -3127656 }, + }, + { + { 11630004, 12144454, 2116339, 13606037, 27378885, 15676917, -17408753, -13504373, -14395196, 8070818 }, + { 27117696, -10007378, -31282771, -5570088, 1127282, 12772488, -29845906, 10483306, -11552749, -1028714 }, + { 10637467, -5688064, 5674781, 1072708, -26343588, -6982302, -1683975, 9177853, -27493162, 15431203 }, + }, + { + { 20525145, 10892566, -12742472, 12779443, -29493034, 16150075, -28240519, 14943142, -15056790, -7935931 }, + { -30024462, 5626926, -551567, -9981087, 753598, 11981191, 25244767, -3239766, -3356550, 9594024 }, + { -23752644, 2636870, -5163910, -10103818, 585134, 7877383, 11345683, -6492290, 13352335, -10977084 }, + }, + { + { -1931799, -5407458, 3304649, -12884869, 17015806, -4877091, -29783850, -7752482, -13215537, -319204 }, + { 20239939, 6607058, 6203985, 3483793, -18386976, -779229, -20723742, 15077870, -22750759, 14523817 }, + { 27406042, -6041657, 27423596, -4497394, 4996214, 10002360, -28842031, -4545494, -30172742, -4805667 }, + }, + }, + { + { + { 11374242, 12660715, 17861383, -12540833, 10935568, 1099227, -13886076, -9091740, -27727044, 11358504 }, + { -12730809, 10311867, 1510375, 10778093, -2119455, -9145702, 32676003, 11149336, -26123651, 4985768 }, + { -19096303, 341147, -6197485, -239033, 15756973, -8796662, -983043, 13794114, -19414307, -15621255 }, + }, + { + { 6490081, 11940286, 25495923, -7726360, 8668373, -8751316, 3367603, 6970005, -1691065, -9004790 }, + { 1656497, 13457317, 15370807, 6364910, 13605745, 8362338, -19174622, -5475723, -16796596, -5031438 }, + { -22273315, -13524424, -64685, -4334223, -18605636, -10921968, -20571065, -7007978, -99853, -10237333 }, + }, + { + { 17747465, 10039260, 19368299, -4050591, -20630635, -16041286, 31992683, -15857976, -29260363, -5511971 }, + { 31932027, -4986141, -19612382, 16366580, 22023614, 88450, 11371999, -3744247, 4882242, -10626905 }, + { 29796507, 37186, 19818052, 10115756, -11829032, 3352736, 18551198, 3272828, -5190932, -4162409 }, + }, + { + { 12501286, 4044383, -8612957, -13392385, -32430052, 5136599, -19230378, -3529697, 330070, -3659409 }, + { 6384877, 2899513, 17807477, 7663917, -2358888, 12363165, 25366522, -8573892, -271295, 12071499 }, + { -8365515, -4042521, 25133448, -4517355, -6211027, 2265927, -32769618, 1936675, -5159697, 3829363 }, + }, + { + { 28425966, -5835433, -577090, -4697198, -14217555, 6870930, 7921550, -6567787, 26333140, 14267664 }, + { -11067219, 11871231, 27385719, -10559544, -4585914, -11189312, 10004786, -8709488, -21761224, 8930324 }, + { -21197785, -16396035, 25654216, -1725397, 12282012, 11008919, 1541940, 4757911, -26491501, -16408940 }, + }, + { + { 13537262, -7759490, -20604840, 10961927, -5922820, -13218065, -13156584, 6217254, -15943699, 13814990 }, + { -17422573, 15157790, 18705543, 29619, 24409717, -260476, 27361681, 9257833, -1956526, -1776914 }, + { -25045300, -10191966, 15366585, 15166509, -13105086, 8423556, -29171540, 12361135, -18685978, 4578290 }, + }, + { + { 24579768, 3711570, 1342322, -11180126, -27005135, 14124956, -22544529, 14074919, 21964432, 8235257 }, + { -6528613, -2411497, 9442966, -5925588, 12025640, -1487420, -2981514, -1669206, 13006806, 2355433 }, + { -16304899, -13605259, -6632427, -5142349, 16974359, -10911083, 27202044, 1719366, 1141648, -12796236 }, + }, + { + { -12863944, -13219986, -8318266, -11018091, -6810145, -4843894, 13475066, -3133972, 32674895, 13715045 }, + { 11423335, -5468059, 32344216, 8962751, 24989809, 9241752, -13265253, 16086212, -28740881, -15642093 }, + { -1409668, 12530728, -6368726, 10847387, 19531186, -14132160, -11709148, 7791794, -27245943, 4383347 }, + }, + }, + { + { + { -28970898, 5271447, -1266009, -9736989, -12455236, 16732599, -4862407, -4906449, 27193557, 6245191 }, + { -15193956, 5362278, -1783893, 2695834, 4960227, 12840725, 23061898, 3260492, 22510453, 8577507 }, + { -12632451, 11257346, -32692994, 13548177, -721004, 10879011, 31168030, 13952092, -29571492, -3635906 }, + }, + { + { 3877321, -9572739, 32416692, 5405324, -11004407, -13656635, 3759769, 11935320, 5611860, 8164018 }, + { -16275802, 14667797, 15906460, 12155291, -22111149, -9039718, 32003002, -8832289, 5773085, -8422109 }, + { -23788118, -8254300, 1950875, 8937633, 18686727, 16459170, -905725, 12376320, 31632953, 190926 }, + }, + { + { -24593607, -16138885, -8423991, 13378746, 14162407, 6901328, -8288749, 4508564, -25341555, -3627528 }, + { 8884438, -5884009, 6023974, 10104341, -6881569, -4941533, 18722941, -14786005, -1672488, 827625 }, + { -32720583, -16289296, -32503547, 7101210, 13354605, 2659080, -1800575, -14108036, -24878478, 1541286 }, + }, + { + { 2901347, -1117687, 3880376, -10059388, -17620940, -3612781, -21802117, -3567481, 20456845, -1885033 }, + { 27019610, 12299467, -13658288, -1603234, -12861660, -4861471, -19540150, -5016058, 29439641, 15138866 }, + { 21536104, -6626420, -32447818, -10690208, -22408077, 5175814, -5420040, -16361163, 7779328, 109896 }, + }, + { + { 30279744, 14648750, -8044871, 6425558, 13639621, -743509, 28698390, 12180118, 23177719, -554075 }, + { 26572847, 3405927, -31701700, 12890905, -19265668, 5335866, -6493768, 2378492, 4439158, -13279347 }, + { -22716706, 3489070, -9225266, -332753, 18875722, -1140095, 14819434, -12731527, -17717757, -5461437 }, + }, + { + { -5056483, 16566551, 15953661, 3767752, -10436499, 15627060, -820954, 2177225, 8550082, -15114165 }, + { -18473302, 16596775, -381660, 15663611, 22860960, 15585581, -27844109, -3582739, -23260460, -8428588 }, + { -32480551, 15707275, -8205912, -5652081, 29464558, 2713815, -22725137, 15860482, -21902570, 1494193 }, + }, + { + { -19562091, -14087393, -25583872, -9299552, 13127842, 759709, 21923482, 16529112, 8742704, 12967017 }, + { -28464899, 1553205, 32536856, -10473729, -24691605, -406174, -8914625, -2933896, -29903758, 15553883 }, + { 21877909, 3230008, 9881174, 10539357, -4797115, 2841332, 11543572, 14513274, 19375923, -12647961 }, + }, + { + { 8832269, -14495485, 13253511, 5137575, 5037871, 4078777, 24880818, -6222716, 2862653, 9455043 }, + { 29306751, 5123106, 20245049, -14149889, 9592566, 8447059, -2077124, -2990080, 15511449, 4789663 }, + { -20679756, 7004547, 8824831, -9434977, -4045704, -3750736, -5754762, 108893, 23513200, 16652362 }, + }, + }, + { + { + { -33256173, 4144782, -4476029, -6579123, 10770039, -7155542, -6650416, -12936300, -18319198, 10212860 }, + { 2756081, 8598110, 7383731, -6859892, 22312759, -1105012, 21179801, 2600940, -9988298, -12506466 }, + { -24645692, 13317462, -30449259, -15653928, 21365574, -10869657, 11344424, 864440, -2499677, -16710063 }, + }, + { + { -26432803, 6148329, -17184412, -14474154, 18782929, -275997, -22561534, 211300, 2719757, 4940997 }, + { -1323882, 3911313, -6948744, 14759765, -30027150, 7851207, 21690126, 8518463, 26699843, 5276295 }, + { -13149873, -6429067, 9396249, 365013, 24703301, -10488939, 1321586, 149635, -15452774, 7159369 }, + }, + { + { 9987780, -3404759, 17507962, 9505530, 9731535, -2165514, 22356009, 8312176, 22477218, -8403385 }, + { 18155857, -16504990, 19744716, 9006923, 15154154, -10538976, 24256460, -4864995, -22548173, 9334109 }, + { 2986088, -4911893, 10776628, -3473844, 10620590, -7083203, -21413845, 14253545, -22587149, 536906 }, + }, + { + { 4377756, 8115836, 24567078, 15495314, 11625074, 13064599, 7390551, 10589625, 10838060, -15420424 }, + { -19342404, 867880, 9277171, -3218459, -14431572, -1986443, 19295826, -15796950, 6378260, 699185 }, + { 7895026, 4057113, -7081772, -13077756, -17886831, -323126, -716039, 15693155, -5045064, -13373962 }, + }, + { + { -7737563, -5869402, -14566319, -7406919, 11385654, 13201616, 31730678, -10962840, -3918636, -9669325 }, + { 10188286, -15770834, -7336361, 13427543, 22223443, 14896287, 30743455, 7116568, -21786507, 5427593 }, + { 696102, 13206899, 27047647, -10632082, 15285305, -9853179, 10798490, -4578720, 19236243, 12477404 }, + }, + { + { -11229439, 11243796, -17054270, -8040865, -788228, -8167967, -3897669, 11180504, -23169516, 7733644 }, + { 17800790, -14036179, -27000429, -11766671, 23887827, 3149671, 23466177, -10538171, 10322027, 15313801 }, + { 26246234, 11968874, 32263343, -5468728, 6830755, -13323031, -15794704, -101982, -24449242, 10890804 }, + }, + { + { -31365647, 10271363, -12660625, -6267268, 16690207, -13062544, -14982212, 16484931, 25180797, -5334884 }, + { -586574, 10376444, -32586414, -11286356, 19801893, 10997610, 2276632, 9482883, 316878, 13820577 }, + { -9882808, -4510367, -2115506, 16457136, -11100081, 11674996, 30756178, -7515054, 30696930, -3712849 }, + }, + { + { 32988917, -9603412, 12499366, 7910787, -10617257, -11931514, -7342816, -9985397, -32349517, 7392473 }, + { -8855661, 15927861, 9866406, -3649411, -2396914, -16655781, -30409476, -9134995, 25112947, -2926644 }, + { -2504044, -436966, 25621774, -5678772, 15085042, -5479877, -24884878, -13526194, 5537438, -13914319 }, + }, + }, + { + { + { -11225584, 2320285, -9584280, 10149187, -33444663, 5808648, -14876251, -1729667, 31234590, 6090599 }, + { -9633316, 116426, 26083934, 2897444, -6364437, -2688086, 609721, 15878753, -6970405, -9034768 }, + { -27757857, 247744, -15194774, -9002551, 23288161, -10011936, -23869595, 6503646, 20650474, 1804084 }, + }, + { + { -27589786, 15456424, 8972517, 8469608, 15640622, 4439847, 3121995, -10329713, 27842616, -202328 }, + { -15306973, 2839644, 22530074, 10026331, 4602058, 5048462, 28248656, 5031932, -11375082, 12714369 }, + { 20807691, -7270825, 29286141, 11421711, -27876523, -13868230, -21227475, 1035546, -19733229, 12796920 }, + }, + { + { 12076899, -14301286, -8785001, -11848922, -25012791, 16400684, -17591495, -12899438, 3480665, -15182815 }, + { -32361549, 5457597, 28548107, 7833186, 7303070, -11953545, -24363064, -15921875, -33374054, 2771025 }, + { -21389266, 421932, 26597266, 6860826, 22486084, -6737172, -17137485, -4210226, -24552282, 15673397 }, + }, + { + { -20184622, 2338216, 19788685, -9620956, -4001265, -8740893, -20271184, 4733254, 3727144, -12934448 }, + { 6120119, 814863, -11794402, -622716, 6812205, -15747771, 2019594, 7975683, 31123697, -10958981 }, + { 30069250, -11435332, 30434654, 2958439, 18399564, -976289, 12296869, 9204260, -16432438, 9648165 }, + }, + { + { 32705432, -1550977, 30705658, 7451065, -11805606, 9631813, 3305266, 5248604, -26008332, -11377501 }, + { 17219865, 2375039, -31570947, -5575615, -19459679, 9219903, 294711, 15298639, 2662509, -16297073 }, + { -1172927, -7558695, -4366770, -4287744, -21346413, -8434326, 32087529, -1222777, 32247248, -14389861 }, + }, + { + { 14312628, 1221556, 17395390, -8700143, -4945741, -8684635, -28197744, -9637817, -16027623, -13378845 }, + { -1428825, -9678990, -9235681, 6549687, -7383069, -468664, 23046502, 9803137, 17597934, 2346211 }, + { 18510800, 15337574, 26171504, 981392, -22241552, 7827556, -23491134, -11323352, 3059833, -11782870 }, + }, + { + { 10141598, 6082907, 17829293, -1947643, 9830092, 13613136, -25556636, -5544586, -33502212, 3592096 }, + { 33114168, -15889352, -26525686, -13343397, 33076705, 8716171, 1151462, 1521897, -982665, -6837803 }, + { -32939165, -4255815, 23947181, -324178, -33072974, -12305637, -16637686, 3891704, 26353178, 693168 }, + }, + { + { 30374239, 1595580, -16884039, 13186931, 4600344, 406904, 9585294, -400668, 31375464, 14369965 }, + { -14370654, -7772529, 1510301, 6434173, -18784789, -6262728, 32732230, -13108839, 17901441, 16011505 }, + { 18171223, -11934626, -12500402, 15197122, -11038147, -15230035, -19172240, -16046376, 8764035, 12309598 }, + }, + }, + { + { + { 5975908, -5243188, -19459362, -9681747, -11541277, 14015782, -23665757, 1228319, 17544096, -10593782 }, + { 5811932, -1715293, 3442887, -2269310, -18367348, -8359541, -18044043, -15410127, -5565381, 12348900 }, + { -31399660, 11407555, 25755363, 6891399, -3256938, 14872274, -24849353, 8141295, -10632534, -585479 }, + }, + { + { -12675304, 694026, -5076145, 13300344, 14015258, -14451394, -9698672, -11329050, 30944593, 1130208 }, + { 8247766, -6710942, -26562381, -7709309, -14401939, -14648910, 4652152, 2488540, 23550156, -271232 }, + { 17294316, -3788438, 7026748, 15626851, 22990044, 113481, 2267737, -5908146, -408818, -137719 }, + }, + { + { 16091085, -16253926, 18599252, 7340678, 2137637, -1221657, -3364161, 14550936, 3260525, -7166271 }, + { -4910104, -13332887, 18550887, 10864893, -16459325, -7291596, -23028869, -13204905, -12748722, 2701326 }, + { -8574695, 16099415, 4629974, -16340524, -20786213, -6005432, -10018363, 9276971, 11329923, 1862132 }, + }, + { + { 14763076, -15903608, -30918270, 3689867, 3511892, 10313526, -21951088, 12219231, -9037963, -940300 }, + { 8894987, -3446094, 6150753, 3013931, 301220, 15693451, -31981216, -2909717, -15438168, 11595570 }, + { 15214962, 3537601, -26238722, -14058872, 4418657, -15230761, 13947276, 10730794, -13489462, -4363670 }, + }, + { + { -2538306, 7682793, 32759013, 263109, -29984731, -7955452, -22332124, -10188635, 977108, 699994 }, + { -12466472, 4195084, -9211532, 550904, -15565337, 12917920, 19118110, -439841, -30534533, -14337913 }, + { 31788461, -14507657, 4799989, 7372237, 8808585, -14747943, 9408237, -10051775, 12493932, -5409317 }, + }, + { + { -25680606, 5260744, -19235809, -6284470, -3695942, 16566087, 27218280, 2607121, 29375955, 6024730 }, + { 842132, -2794693, -4763381, -8722815, 26332018, -12405641, 11831880, 6985184, -9940361, 2854096 }, + { -4847262, -7969331, 2516242, -5847713, 9695691, -7221186, 16512645, 960770, 12121869, 16648078 }, + }, + { + { -15218652, 14667096, -13336229, 2013717, 30598287, -464137, -31504922, -7882064, 20237806, 2838411 }, + { -19288047, 4453152, 15298546, -16178388, 22115043, -15972604, 12544294, -13470457, 1068881, -12499905 }, + { -9558883, -16518835, 33238498, 13506958, 30505848, -1114596, -8486907, -2630053, 12521378, 4845654 }, + }, + { + { -28198521, 10744108, -2958380, 10199664, 7759311, -13088600, 3409348, -873400, -6482306, -12885870 }, + { -23561822, 6230156, -20382013, 10655314, -24040585, -11621172, 10477734, -1240216, -3113227, 13974498 }, + { 12966261, 15550616, -32038948, -1615346, 21025980, -629444, 5642325, 7188737, 18895762, 12629579 }, + }, + }, + { + { + { 14741879, -14946887, 22177208, -11721237, 1279741, 8058600, 11758140, 789443, 32195181, 3895677 }, + { 10758205, 15755439, -4509950, 9243698, -4879422, 6879879, -2204575, -3566119, -8982069, 4429647 }, + { -2453894, 15725973, -20436342, -10410672, -5803908, -11040220, -7135870, -11642895, 18047436, -15281743 }, + }, + { + { -25173001, -11307165, 29759956, 11776784, -22262383, -15820455, 10993114, -12850837, -17620701, -9408468 }, + { 21987233, 700364, -24505048, 14972008, -7774265, -5718395, 32155026, 2581431, -29958985, 8773375 }, + { -25568350, 454463, -13211935, 16126715, 25240068, 8594567, 20656846, 12017935, -7874389, -13920155 }, + }, + { + { 6028182, 6263078, -31011806, -11301710, -818919, 2461772, -31841174, -5468042, -1721788, -2776725 }, + { -12278994, 16624277, 987579, -5922598, 32908203, 1248608, 7719845, -4166698, 28408820, 6816612 }, + { -10358094, -8237829, 19549651, -12169222, 22082623, 16147817, 20613181, 13982702, -10339570, 5067943 }, + }, + { + { -30505967, -3821767, 12074681, 13582412, -19877972, 2443951, -19719286, 12746132, 5331210, -10105944 }, + { 30528811, 3601899, -1957090, 4619785, -27361822, -15436388, 24180793, -12570394, 27679908, -1648928 }, + { 9402404, -13957065, 32834043, 10838634, -26580150, -13237195, 26653274, -8685565, 22611444, -12715406 }, + }, + { + { 22190590, 1118029, 22736441, 15130463, -30460692, -5991321, 19189625, -4648942, 4854859, 6622139 }, + { -8310738, -2953450, -8262579, -3388049, -10401731, -271929, 13424426, -3567227, 26404409, 13001963 }, + { -31241838, -15415700, -2994250, 8939346, 11562230, -12840670, -26064365, -11621720, -15405155, 11020693 }, + }, + { + { 1866042, -7949489, -7898649, -10301010, 12483315, 13477547, 3175636, -12424163, 28761762, 1406734 }, + { -448555, -1777666, 13018551, 3194501, -9580420, -11161737, 24760585, -4347088, 25577411, -13378680 }, + { -24290378, 4759345, -690653, -1852816, 2066747, 10693769, -29595790, 9884936, -9368926, 4745410 }, + }, + { + { -9141284, 6049714, -19531061, -4341411, -31260798, 9944276, -15462008, -11311852, 10931924, -11931931 }, + { -16561513, 14112680, -8012645, 4817318, -8040464, -11414606, -22853429, 10856641, -20470770, 13434654 }, + { 22759489, -10073434, -16766264, -1871422, 13637442, -10168091, 1765144, -12654326, 28445307, -5364710 }, + }, + { + { 29875063, 12493613, 2795536, -3786330, 1710620, 15181182, -10195717, -8788675, 9074234, 1167180 }, + { -26205683, 11014233, -9842651, -2635485, -26908120, 7532294, -18716888, -9535498, 3843903, 9367684 }, + { -10969595, -6403711, 9591134, 9582310, 11349256, 108879, 16235123, 8601684, -139197, 4242895 }, + }, + }, + { + { + { 22092954, -13191123, -2042793, -11968512, 32186753, -11517388, -6574341, 2470660, -27417366, 16625501 }, + { -11057722, 3042016, 13770083, -9257922, 584236, -544855, -7770857, 2602725, -27351616, 14247413 }, + { 6314175, -10264892, -32772502, 15957557, -10157730, 168750, -8618807, 14290061, 27108877, -1180880 }, + }, + { + { -8586597, -7170966, 13241782, 10960156, -32991015, -13794596, 33547976, -11058889, -27148451, 981874 }, + { 22833440, 9293594, -32649448, -13618667, -9136966, 14756819, -22928859, -13970780, -10479804, -16197962 }, + { -7768587, 3326786, -28111797, 10783824, 19178761, 14905060, 22680049, 13906969, -15933690, 3797899 }, + }, + { + { 21721356, -4212746, -12206123, 9310182, -3882239, -13653110, 23740224, -2709232, 20491983, -8042152 }, + { 9209270, -15135055, -13256557, -6167798, -731016, 15289673, 25947805, 15286587, 30997318, -6703063 }, + { 7392032, 16618386, 23946583, -8039892, -13265164, -1533858, -14197445, -2321576, 17649998, -250080 }, + }, + { + { -9301088, -14193827, 30609526, -3049543, -25175069, -1283752, -15241566, -9525724, -2233253, 7662146 }, + { -17558673, 1763594, -33114336, 15908610, -30040870, -12174295, 7335080, -8472199, -3174674, 3440183 }, + { -19889700, -5977008, -24111293, -9688870, 10799743, -16571957, 40450, -4431835, 4862400, 1133 }, + }, + { + { -32856209, -7873957, -5422389, 14860950, -16319031, 7956142, 7258061, 311861, -30594991, -7379421 }, + { -3773428, -1565936, 28985340, 7499440, 24445838, 9325937, 29727763, 16527196, 18278453, 15405622 }, + { -4381906, 8508652, -19898366, -3674424, -5984453, 15149970, -13313598, 843523, -21875062, 13626197 }, + }, + { + { 2281448, -13487055, -10915418, -2609910, 1879358, 16164207, -10783882, 3953792, 13340839, 15928663 }, + { 31727126, -7179855, -18437503, -8283652, 2875793, -16390330, -25269894, -7014826, -23452306, 5964753 }, + { 4100420, -5959452, -17179337, 6017714, -18705837, 12227141, -26684835, 11344144, 2538215, -7570755 }, + }, + { + { -9433605, 6123113, 11159803, -2156608, 30016280, 14966241, -20474983, 1485421, -629256, -15958862 }, + { -26804558, 4260919, 11851389, 9658551, -32017107, 16367492, -20205425, -13191288, 11659922, -11115118 }, + { 26180396, 10015009, -30844224, -8581293, 5418197, 9480663, 2231568, -10170080, 33100372, -1306171 }, + }, + { + { 15121113, -5201871, -10389905, 15427821, -27509937, -15992507, 21670947, 4486675, -5931810, -14466380 }, + { 16166486, -9483733, -11104130, 6023908, -31926798, -1364923, 2340060, -16254968, -10735770, -10039824 }, + { 28042865, -3557089, -12126526, 12259706, -3717498, -6945899, 6766453, -8689599, 18036436, 5803270 }, + }, + }, + { + { + { -817581, 6763912, 11803561, 1585585, 10958447, -2671165, 23855391, 4598332, -6159431, -14117438 }, + { -31031306, -14256194, 17332029, -2383520, 31312682, -5967183, 696309, 50292, -20095739, 11763584 }, + { -594563, -2514283, -32234153, 12643980, 12650761, 14811489, 665117, -12613632, -19773211, -10713562 }, + }, + { + { 30464590, -11262872, -4127476, -12734478, 19835327, -7105613, -24396175, 2075773, -17020157, 992471 }, + { 18357185, -6994433, 7766382, 16342475, -29324918, 411174, 14578841, 8080033, -11574335, -10601610 }, + { 19598397, 10334610, 12555054, 2555664, 18821899, -10339780, 21873263, 16014234, 26224780, 16452269 }, + }, + { + { -30223925, 5145196, 5944548, 16385966, 3976735, 2009897, -11377804, -7618186, -20533829, 3698650 }, + { 14187449, 3448569, -10636236, -10810935, -22663880, -3433596, 7268410, -10890444, 27394301, 12015369 }, + { 19695761, 16087646, 28032085, 12999827, 6817792, 11427614, 20244189, -1312777, -13259127, -3402461 }, + }, + { + { 30860103, 12735208, -1888245, -4699734, -16974906, 2256940, -8166013, 12298312, -8550524, -10393462 }, + { -5719826, -11245325, -1910649, 15569035, 26642876, -7587760, -5789354, -15118654, -4976164, 12651793 }, + { -2848395, 9953421, 11531313, -5282879, 26895123, -12697089, -13118820, -16517902, 9768698, -2533218 }, + }, + { + { -24719459, 1894651, -287698, -4704085, 15348719, -8156530, 32767513, 12765450, 4940095, 10678226 }, + { 18860224, 15980149, -18987240, -1562570, -26233012, -11071856, -7843882, 13944024, -24372348, 16582019 }, + { -15504260, 4970268, -29893044, 4175593, -20993212, -2199756, -11704054, 15444560, -11003761, 7989037 }, + }, + { + { 31490452, 5568061, -2412803, 2182383, -32336847, 4531686, -32078269, 6200206, -19686113, -14800171 }, + { -17308668, -15879940, -31522777, -2831, -32887382, 16375549, 8680158, -16371713, 28550068, -6857132 }, + { -28126887, -5688091, 16837845, -1820458, -6850681, 12700016, -30039981, 4364038, 1155602, 5988841 }, + }, + { + { 21890435, -13272907, -12624011, 12154349, -7831873, 15300496, 23148983, -4470481, 24618407, 8283181 }, + { -33136107, -10512751, 9975416, 6841041, -31559793, 16356536, 3070187, -7025928, 1466169, 10740210 }, + { -1509399, -15488185, -13503385, -10655916, 32799044, 909394, -13938903, -5779719, -32164649, -15327040 }, + }, + { + { 3960823, -14267803, -28026090, -15918051, -19404858, 13146868, 15567327, 951507, -3260321, -573935 }, + { 24740841, 5052253, -30094131, 8961361, 25877428, 6165135, -24368180, 14397372, -7380369, -6144105 }, + { -28888365, 3510803, -28103278, -1158478, -11238128, -10631454, -15441463, -14453128, -1625486, -6494814 }, + }, + }, + { + { + { 793299, -9230478, 8836302, -6235707, -27360908, -2369593, 33152843, -4885251, -9906200, -621852 }, + { 5666233, 525582, 20782575, -8038419, -24538499, 14657740, 16099374, 1468826, -6171428, -15186581 }, + { -4859255, -3779343, -2917758, -6748019, 7778750, 11688288, -30404353, -9871238, -1558923, -9863646 }, + }, + { + { 10896332, -7719704, 824275, 472601, -19460308, 3009587, 25248958, 14783338, -30581476, -15757844 }, + { 10566929, 12612572, -31944212, 11118703, -12633376, 12362879, 21752402, 8822496, 24003793, 14264025 }, + { 27713862, -7355973, -11008240, 9227530, 27050101, 2504721, 23886875, -13117525, 13958495, -5732453 }, + }, + { + { -23481610, 4867226, -27247128, 3900521, 29838369, -8212291, -31889399, -10041781, 7340521, -15410068 }, + { 4646514, -8011124, -22766023, -11532654, 23184553, 8566613, 31366726, -1381061, -15066784, -10375192 }, + { -17270517, 12723032, -16993061, 14878794, 21619651, -6197576, 27584817, 3093888, -8843694, 3849921 }, + }, + { + { -9064912, 2103172, 25561640, -15125738, -5239824, 9582958, 32477045, -9017955, 5002294, -15550259 }, + { -12057553, -11177906, 21115585, -13365155, 8808712, -12030708, 16489530, 13378448, -25845716, 12741426 }, + { -5946367, 10645103, -30911586, 15390284, -3286982, -7118677, 24306472, 15852464, 28834118, -7646072 }, + }, + { + { -17335748, -9107057, -24531279, 9434953, -8472084, -583362, -13090771, 455841, 20461858, 5491305 }, + { 13669248, -16095482, -12481974, -10203039, -14569770, -11893198, -24995986, 11293807, -28588204, -9421832 }, + { 28497928, 6272777, -33022994, 14470570, 8906179, -1225630, 18504674, -14165166, 29867745, -8795943 }, + }, + { + { -16207023, 13517196, -27799630, -13697798, 24009064, -6373891, -6367600, -13175392, 22853429, -4012011 }, + { 24191378, 16712145, -13931797, 15217831, 14542237, 1646131, 18603514, -11037887, 12876623, -2112447 }, + { 17902668, 4518229, -411702, -2829247, 26878217, 5258055, -12860753, 608397, 16031844, 3723494 }, + }, + { + { -28632773, 12763728, -20446446, 7577504, 33001348, -13017745, 17558842, -7872890, 23896954, -4314245 }, + { -20005381, -12011952, 31520464, 605201, 2543521, 5991821, -2945064, 7229064, -9919646, -8826859 }, + { 28816045, 298879, -28165016, -15920938, 19000928, -1665890, -12680833, -2949325, -18051778, -2082915 }, + }, + { + { 16000882, -344896, 3493092, -11447198, -29504595, -13159789, 12577740, 16041268, -19715240, 7847707 }, + { 10151868, 10572098, 27312476, 7922682, 14825339, 4723128, -32855931, -6519018, -10020567, 3852848 }, + { -11430470, 15697596, -21121557, -4420647, 5386314, 15063598, 16514493, -15932110, 29330899, -15076224 }, + }, + }, + { + { + { -25499735, -4378794, -15222908, -6901211, 16615731, 2051784, 3303702, 15490, -27548796, 12314391 }, + { 15683520, -6003043, 18109120, -9980648, 15337968, -5997823, -16717435, 15921866, 16103996, -3731215 }, + { -23169824, -10781249, 13588192, -1628807, -3798557, -1074929, -19273607, 5402699, -29815713, -9841101 }, + }, + { + { 23190676, 2384583, -32714340, 3462154, -29903655, -1529132, -11266856, 8911517, -25205859, 2739713 }, + { 21374101, -3554250, -33524649, 9874411, 15377179, 11831242, -33529904, 6134907, 4931255, 11987849 }, + { -7732, -2978858, -16223486, 7277597, 105524, -322051, -31480539, 13861388, -30076310, 10117930 }, + }, + { + { -29501170, -10744872, -26163768, 13051539, -25625564, 5089643, -6325503, 6704079, 12890019, 15728940 }, + { -21972360, -11771379, -951059, -4418840, 14704840, 2695116, 903376, -10428139, 12885167, 8311031 }, + { -17516482, 5352194, 10384213, -13811658, 7506451, 13453191, 26423267, 4384730, 1888765, -5435404 }, + }, + { + { -25817338, -3107312, -13494599, -3182506, 30896459, -13921729, -32251644, -12707869, -19464434, -3340243 }, + { -23607977, -2665774, -526091, 4651136, 5765089, 4618330, 6092245, 14845197, 17151279, -9854116 }, + { -24830458, -12733720, -15165978, 10367250, -29530908, -265356, 22825805, -7087279, -16866484, 16176525 }, + }, + { + { -23583256, 6564961, 20063689, 3798228, -4740178, 7359225, 2006182, -10363426, -28746253, -10197509 }, + { -10626600, -4486402, -13320562, -5125317, 3432136, -6393229, 23632037, -1940610, 32808310, 1099883 }, + { 15030977, 5768825, -27451236, -2887299, -6427378, -15361371, -15277896, -6809350, 2051441, -15225865 }, + }, + { + { -3362323, -7239372, 7517890, 9824992, 23555850, 295369, 5148398, -14154188, -22686354, 16633660 }, + { 4577086, -16752288, 13249841, -15304328, 19958763, -14537274, 18559670, -10759549, 8402478, -9864273 }, + { -28406330, -1051581, -26790155, -907698, -17212414, -11030789, 9453451, -14980072, 17983010, 9967138 }, + }, + { + { -25762494, 6524722, 26585488, 9969270, 24709298, 1220360, -1677990, 7806337, 17507396, 3651560 }, + { -10420457, -4118111, 14584639, 15971087, -15768321, 8861010, 26556809, -5574557, -18553322, -11357135 }, + { 2839101, 14284142, 4029895, 3472686, 14402957, 12689363, -26642121, 8459447, -5605463, -7621941 }, + }, + { + { -4839289, -3535444, 9744961, 2871048, 25113978, 3187018, -25110813, -849066, 17258084, -7977739 }, + { 18164541, -10595176, -17154882, -1542417, 19237078, -9745295, 23357533, -15217008, 26908270, 12150756 }, + { -30264870, -7647865, 5112249, -7036672, -1499807, -6974257, 43168, -5537701, -32302074, 16215819 }, + }, + }, + { + { + { -6898905, 9824394, -12304779, -4401089, -31397141, -6276835, 32574489, 12532905, -7503072, -8675347 }, + { -27343522, -16515468, -27151524, -10722951, 946346, 16291093, 254968, 7168080, 21676107, -1943028 }, + { 21260961, -8424752, -16831886, -11920822, -23677961, 3968121, -3651949, -6215466, -3556191, -7913075 }, + }, + { + { 16544754, 13250366, -16804428, 15546242, -4583003, 12757258, -2462308, -8680336, -18907032, -9662799 }, + { -2415239, -15577728, 18312303, 4964443, -15272530, -12653564, 26820651, 16690659, 25459437, -4564609 }, + { -25144690, 11425020, 28423002, -11020557, -6144921, -15826224, 9142795, -2391602, -6432418, -1644817 }, + }, + { + { -23104652, 6253476, 16964147, -3768872, -25113972, -12296437, -27457225, -16344658, 6335692, 7249989 }, + { -30333227, 13979675, 7503222, -12368314, -11956721, -4621693, -30272269, 2682242, 25993170, -12478523 }, + { 4364628, 5930691, 32304656, -10044554, -8054781, 15091131, 22857016, -10598955, 31820368, 15075278 }, + }, + { + { 31879134, -8918693, 17258761, 90626, -8041836, -4917709, 24162788, -9650886, -17970238, 12833045 }, + { 19073683, 14851414, -24403169, -11860168, 7625278, 11091125, -19619190, 2074449, -9413939, 14905377 }, + { 24483667, -11935567, -2518866, -11547418, -1553130, 15355506, -25282080, 9253129, 27628530, -7555480 }, + }, + { + { 17597607, 8340603, 19355617, 552187, 26198470, -3176583, 4593324, -9157582, -14110875, 15297016 }, + { 510886, 14337390, -31785257, 16638632, 6328095, 2713355, -20217417, -11864220, 8683221, 2921426 }, + { 18606791, 11874196, 27155355, -5281482, -24031742, 6265446, -25178240, -1278924, 4674690, 13890525 }, + }, + { + { 13609624, 13069022, -27372361, -13055908, 24360586, 9592974, 14977157, 9835105, 4389687, 288396 }, + { 9922506, -519394, 13613107, 5883594, -18758345, -434263, -12304062, 8317628, 23388070, 16052080 }, + { 12720016, 11937594, -31970060, -5028689, 26900120, 8561328, -20155687, -11632979, -14754271, -10812892 }, + }, + { + { 15961858, 14150409, 26716931, -665832, -22794328, 13603569, 11829573, 7467844, -28822128, 929275 }, + { 11038231, -11582396, -27310482, -7316562, -10498527, -16307831, -23479533, -9371869, -21393143, 2465074 }, + { 20017163, -4323226, 27915242, 1529148, 12396362, 15675764, 13817261, -9658066, 2463391, -4622140 }, + }, + { + { -16358878, -12663911, -12065183, 4996454, -1256422, 1073572, 9583558, 12851107, 4003896, 12673717 }, + { -1731589, -15155870, -3262930, 16143082, 19294135, 13385325, 14741514, -9103726, 7903886, 2348101 }, + { 24536016, -16515207, 12715592, -3862155, 1511293, 10047386, -3842346, -7129159, -28377538, 10048127 }, + }, + }, + { + { + { -12622226, -6204820, 30718825, 2591312, -10617028, 12192840, 18873298, -7297090, -32297756, 15221632 }, + { -26478122, -11103864, 11546244, -1852483, 9180880, 7656409, -21343950, 2095755, 29769758, 6593415 }, + { -31994208, -2907461, 4176912, 3264766, 12538965, -868111, 26312345, -6118678, 30958054, 8292160 }, + }, + { + { 31429822, -13959116, 29173532, 15632448, 12174511, -2760094, 32808831, 3977186, 26143136, -3148876 }, + { 22648901, 1402143, -22799984, 13746059, 7936347, 365344, -8668633, -1674433, -3758243, -2304625 }, + { -15491917, 8012313, -2514730, -12702462, -23965846, -10254029, -1612713, -1535569, -16664475, 8194478 }, + }, + { + { 27338066, -7507420, -7414224, 10140405, -19026427, -6589889, 27277191, 8855376, 28572286, 3005164 }, + { 26287124, 4821776, 25476601, -4145903, -3764513, -15788984, -18008582, 1182479, -26094821, -13079595 }, + { -7171154, 3178080, 23970071, 6201893, -17195577, -4489192, -21876275, -13982627, 32208683, -1198248 }, + }, + { + { -16657702, 2817643, -10286362, 14811298, 6024667, 13349505, -27315504, -10497842, -27672585, -11539858 }, + { 15941029, -9405932, -21367050, 8062055, 31876073, -238629, -15278393, -1444429, 15397331, -4130193 }, + { 8934485, -13485467, -23286397, -13423241, -32446090, 14047986, 31170398, -1441021, -27505566, 15087184 }, + }, + { + { -18357243, -2156491, 24524913, -16677868, 15520427, -6360776, -15502406, 11461896, 16788528, -5868942 }, + { -1947386, 16013773, 21750665, 3714552, -17401782, -16055433, -3770287, -10323320, 31322514, -11615635 }, + { 21426655, -5650218, -13648287, -5347537, -28812189, -4920970, -18275391, -14621414, 13040862, -12112948 }, + }, + { + { 11293895, 12478086, -27136401, 15083750, -29307421, 14748872, 14555558, -13417103, 1613711, 4896935 }, + { -25894883, 15323294, -8489791, -8057900, 25967126, -13425460, 2825960, -4897045, -23971776, -11267415 }, + { -15924766, -5229880, -17443532, 6410664, 3622847, 10243618, 20615400, 12405433, -23753030, -8436416 }, + }, + { + { -7091295, 12556208, -20191352, 9025187, -17072479, 4333801, 4378436, 2432030, 23097949, -566018 }, + { 4565804, -16025654, 20084412, -7842817, 1724999, 189254, 24767264, 10103221, -18512313, 2424778 }, + { 366633, -11976806, 8173090, -6890119, 30788634, 5745705, -7168678, 1344109, -3642553, 12412659 }, + }, + { + { -24001791, 7690286, 14929416, -168257, -32210835, -13412986, 24162697, -15326504, -3141501, 11179385 }, + { 18289522, -14724954, 8056945, 16430056, -21729724, 7842514, -6001441, -1486897, -18684645, -11443503 }, + { 476239, 6601091, -6152790, -9723375, 17503545, -4863900, 27672959, 13403813, 11052904, 5219329 }, + }, + }, + { + { + { 20678546, -8375738, -32671898, 8849123, -5009758, 14574752, 31186971, -3973730, 9014762, -8579056 }, + { -13644050, -10350239, -15962508, 5075808, -1514661, -11534600, -33102500, 9160280, 8473550, -3256838 }, + { 24900749, 14435722, 17209120, -15292541, -22592275, 9878983, -7689309, -16335821, -24568481, 11788948 }, + }, + { + { -3118155, -11395194, -13802089, 14797441, 9652448, -6845904, -20037437, 10410733, -24568470, -1458691 }, + { -15659161, 16736706, -22467150, 10215878, -9097177, 7563911, 11871841, -12505194, -18513325, 8464118 }, + { -23400612, 8348507, -14585951, -861714, -3950205, -6373419, 14325289, 8628612, 33313881, -8370517 }, + }, + { + { -20186973, -4967935, 22367356, 5271547, -1097117, -4788838, -24805667, -10236854, -8940735, -5818269 }, + { -6948785, -1795212, -32625683, -16021179, 32635414, -7374245, 15989197, -12838188, 28358192, -4253904 }, + { -23561781, -2799059, -32351682, -1661963, -9147719, 10429267, -16637684, 4072016, -5351664, 5596589 }, + }, + { + { -28236598, -3390048, 12312896, 6213178, 3117142, 16078565, 29266239, 2557221, 1768301, 15373193 }, + { -7243358, -3246960, -4593467, -7553353, -127927, -912245, -1090902, -4504991, -24660491, 3442910 }, + { -30210571, 5124043, 14181784, 8197961, 18964734, -11939093, 22597931, 7176455, -18585478, 13365930 }, + }, + { + { -7877390, -1499958, 8324673, 4690079, 6261860, 890446, 24538107, -8570186, -9689599, -3031667 }, + { 25008904, -10771599, -4305031, -9638010, 16265036, 15721635, 683793, -11823784, 15723479, -15163481 }, + { -9660625, 12374379, -27006999, -7026148, -7724114, -12314514, 11879682, 5400171, 519526, -1235876 }, + }, + { + { 22258397, -16332233, -7869817, 14613016, -22520255, -2950923, -20353881, 7315967, 16648397, 7605640 }, + { -8081308, -8464597, -8223311, 9719710, 19259459, -15348212, 23994942, -5281555, -9468848, 4763278 }, + { -21699244, 9220969, -15730624, 1084137, -25476107, -2852390, 31088447, -7764523, -11356529, 728112 }, + }, + { + { 26047220, -11751471, -6900323, -16521798, 24092068, 9158119, -4273545, -12555558, -29365436, -5498272 }, + { 17510331, -322857, 5854289, 8403524, 17133918, -3112612, -28111007, 12327945, 10750447, 10014012 }, + { -10312768, 3936952, 9156313, -8897683, 16498692, -994647, -27481051, -666732, 3424691, 7540221 }, + }, + { + { 30322361, -6964110, 11361005, -4143317, 7433304, 4989748, -7071422, -16317219, -9244265, 15258046 }, + { 13054562, -2779497, 19155474, 469045, -12482797, 4566042, 5631406, 2711395, 1062915, -5136345 }, + { -19240248, -11254599, -29509029, -7499965, -5835763, 13005411, -6066489, 12194497, 32960380, 1459310 }, + }, + }, + { + { + { 19852034, 7027924, 23669353, 10020366, 8586503, -6657907, 394197, -6101885, 18638003, -11174937 }, + { 31395534, 15098109, 26581030, 8030562, -16527914, -5007134, 9012486, -7584354, -6643087, -5442636 }, + { -9192165, -2347377, -1997099, 4529534, 25766844, 607986, -13222, 9677543, -32294889, -6456008 }, + }, + { + { -2444496, -149937, 29348902, 8186665, 1873760, 12489863, -30934579, -7839692, -7852844, -8138429 }, + { -15236356, -15433509, 7766470, 746860, 26346930, -10221762, -27333451, 10754588, -9431476, 5203576 }, + { 31834314, 14135496, -770007, 5159118, 20917671, -16768096, -7467973, -7337524, 31809243, 7347066 }, + }, + { + { -9606723, -11874240, 20414459, 13033986, 13716524, -11691881, 19797970, -12211255, 15192876, -2087490 }, + { -12663563, -2181719, 1168162, -3804809, 26747877, -14138091, 10609330, 12694420, 33473243, -13382104 }, + { 33184999, 11180355, 15832085, -11385430, -1633671, 225884, 15089336, -11023903, -6135662, 14480053 }, + }, + { + { 31308717, -5619998, 31030840, -1897099, 15674547, -6582883, 5496208, 13685227, 27595050, 8737275 }, + { -20318852, -15150239, 10933843, -16178022, 8335352, -7546022, -31008351, -12610604, 26498114, 66511 }, + { 22644454, -8761729, -16671776, 4884562, -3105614, -13559366, 30540766, -4286747, -13327787, -7515095 }, + }, + { + { -28017847, 9834845, 18617207, -2681312, -3401956, -13307506, 8205540, 13585437, -17127465, 15115439 }, + { 23711543, -672915, 31206561, -8362711, 6164647, -9709987, -33535882, -1426096, 8236921, 16492939 }, + { -23910559, -13515526, -26299483, -4503841, 25005590, -7687270, 19574902, 10071562, 6708380, -6222424 }, + }, + { + { 2101391, -4930054, 19702731, 2367575, -15427167, 1047675, 5301017, 9328700, 29955601, -11678310 }, + { 3096359, 9271816, -21620864, -15521844, -14847996, -7592937, -25892142, -12635595, -9917575, 6216608 }, + { -32615849, 338663, -25195611, 2510422, -29213566, -13820213, 24822830, -6146567, -26767480, 7525079 }, + }, + { + { -23066649, -13985623, 16133487, -7896178, -3389565, 778788, -910336, -2782495, -19386633, 11994101 }, + { 21691500, -13624626, -641331, -14367021, 3285881, -3483596, -25064666, 9718258, -7477437, 13381418 }, + { 18445390, -4202236, 14979846, 11622458, -1727110, -3582980, 23111648, -6375247, 28535282, 15779576 }, + }, + { + { 30098053, 3089662, -9234387, 16662135, -21306940, 11308411, -14068454, 12021730, 9955285, -16303356 }, + { 9734894, -14576830, -7473633, -9138735, 2060392, 11313496, -18426029, 9924399, 20194861, 13380996 }, + { -26378102, -7965207, -22167821, 15789297, -18055342, -6168792, -1984914, 15707771, 26342023, 10146099 }, + }, + }, + { + { + { -26016874, -219943, 21339191, -41388, 19745256, -2878700, -29637280, 2227040, 21612326, -545728 }, + { -13077387, 1184228, 23562814, -5970442, -20351244, -6348714, 25764461, 12243797, -20856566, 11649658 }, + { -10031494, 11262626, 27384172, 2271902, 26947504, -15997771, 39944, 6114064, 33514190, 2333242 }, + }, + { + { -21433588, -12421821, 8119782, 7219913, -21830522, -9016134, -6679750, -12670638, 24350578, -13450001 }, + { -4116307, -11271533, -23886186, 4843615, -30088339, 690623, -31536088, -10406836, 8317860, 12352766 }, + { 18200138, -14475911, -33087759, -2696619, -23702521, -9102511, -23552096, -2287550, 20712163, 6719373 }, + }, + { + { 26656208, 6075253, -7858556, 1886072, -28344043, 4262326, 11117530, -3763210, 26224235, -3297458 }, + { -17168938, -14854097, -3395676, -16369877, -19954045, 14050420, 21728352, 9493610, 18620611, -16428628 }, + { -13323321, 13325349, 11432106, 5964811, 18609221, 6062965, -5269471, -9725556, -30701573, -16479657 }, + }, + { + { -23860538, -11233159, 26961357, 1640861, -32413112, -16737940, 12248509, -5240639, 13735342, 1934062 }, + { 25089769, 6742589, 17081145, -13406266, 21909293, -16067981, -15136294, -3765346, -21277997, 5473616 }, + { 31883677, -7961101, 1083432, -11572403, 22828471, 13290673, -7125085, 12469656, 29111212, -5451014 }, + }, + { + { 24244947, -15050407, -26262976, 2791540, -14997599, 16666678, 24367466, 6388839, -10295587, 452383 }, + { -25640782, -3417841, 5217916, 16224624, 19987036, -4082269, -24236251, -5915248, 15766062, 8407814 }, + { -20406999, 13990231, 15495425, 16395525, 5377168, 15166495, -8917023, -4388953, -8067909, 2276718 }, + }, + { + { 30157918, 12924066, -17712050, 9245753, 19895028, 3368142, -23827587, 5096219, 22740376, -7303417 }, + { 2041139, -14256350, 7783687, 13876377, -25946985, -13352459, 24051124, 13742383, -15637599, 13295222 }, + { 33338237, -8505733, 12532113, 7977527, 9106186, -1715251, -17720195, -4612972, -4451357, -14669444 }, + }, + { + { -20045281, 5454097, -14346548, 6447146, 28862071, 1883651, -2469266, -4141880, 7770569, 9620597 }, + { 23208068, 7979712, 33071466, 8149229, 1758231, -10834995, 30945528, -1694323, -33502340, -14767970 }, + { 1439958, -16270480, -1079989, -793782, 4625402, 10647766, -5043801, 1220118, 30494170, -11440799 }, + }, + { + { -5037580, -13028295, -2970559, -3061767, 15640974, -6701666, -26739026, 926050, -1684339, -13333647 }, + { 13908495, -3549272, 30919928, -6273825, -21521863, 7989039, 9021034, 9078865, 3353509, 4033511 }, + { -29663431, -15113610, 32259991, -344482, 24295849, -12912123, 23161163, 8839127, 27485041, 7356032 }, + }, + }, + { + { + { 9661027, 705443, 11980065, -5370154, -1628543, 14661173, -6346142, 2625015, 28431036, -16771834 }, + { -23839233, -8311415, -25945511, 7480958, -17681669, -8354183, -22545972, 14150565, 15970762, 4099461 }, + { 29262576, 16756590, 26350592, -8793563, 8529671, -11208050, 13617293, -9937143, 11465739, 8317062 }, + }, + { + { -25493081, -6962928, 32500200, -9419051, -23038724, -2302222, 14898637, 3848455, 20969334, -5157516 }, + { -20384450, -14347713, -18336405, 13884722, -33039454, 2842114, -21610826, -3649888, 11177095, 14989547 }, + { -24496721, -11716016, 16959896, 2278463, 12066309, 10137771, 13515641, 2581286, -28487508, 9930240 }, + }, + { + { -17751622, -2097826, 16544300, -13009300, -15914807, -14949081, 18345767, -13403753, 16291481, -5314038 }, + { -33229194, 2553288, 32678213, 9875984, 8534129, 6889387, -9676774, 6957617, 4368891, 9788741 }, + { 16660756, 7281060, -10830758, 12911820, 20108584, -8101676, -21722536, -8613148, 16250552, -11111103 }, + }, + { + { -19765507, 2390526, -16551031, 14161980, 1905286, 6414907, 4689584, 10604807, -30190403, 4782747 }, + { -1354539, 14736941, -7367442, -13292886, 7710542, -14155590, -9981571, 4383045, 22546403, 437323 }, + { 31665577, -12180464, -16186830, 1491339, -18368625, 3294682, 27343084, 2786261, -30633590, -14097016 }, + }, + { + { -14467279, -683715, -33374107, 7448552, 19294360, 14334329, -19690631, 2355319, -19284671, -6114373 }, + { 15121312, -15796162, 6377020, -6031361, -10798111, -12957845, 18952177, 15496498, -29380133, 11754228 }, + { -2637277, -13483075, 8488727, -14303896, 12728761, -1622493, 7141596, 11724556, 22761615, -10134141 }, + }, + { + { 16918416, 11729663, -18083579, 3022987, -31015732, -13339659, -28741185, -12227393, 32851222, 11717399 }, + { 11166634, 7338049, -6722523, 4531520, -29468672, -7302055, 31474879, 3483633, -1193175, -4030831 }, + { -185635, 9921305, 31456609, -13536438, -12013818, 13348923, 33142652, 6546660, -19985279, -3948376 }, + }, + { + { -32460596, 11266712, -11197107, -7899103, 31703694, 3855903, -8537131, -12833048, -30772034, -15486313 }, + { -18006477, 12709068, 3991746, -6479188, -21491523, -10550425, -31135347, -16049879, 10928917, 3011958 }, + { -6957757, -15594337, 31696059, 334240, 29576716, 14796075, -30831056, -12805180, 18008031, 10258577 }, + }, + { + { -22448644, 15655569, 7018479, -4410003, -30314266, -1201591, -1853465, 1367120, 25127874, 6671743 }, + { 29701166, -14373934, -10878120, 9279288, -17568, 13127210, 21382910, 11042292, 25838796, 4642684 }, + { -20430234, 14955537, -24126347, 8124619, -5369288, -5990470, 30468147, -13900640, 18423289, 4177476 }, + }, + }, +}; diff --git a/src/sc.c b/src/sc.c new file mode 100644 index 000000000..ca5bad2ca --- /dev/null +++ b/src/sc.c @@ -0,0 +1,809 @@ +#include "fixedint.h" +#include "sc.h" + +static uint64_t load_3(const unsigned char *in) { + uint64_t result; + + result = (uint64_t) in[0]; + result |= ((uint64_t) in[1]) << 8; + result |= ((uint64_t) in[2]) << 16; + + return result; +} + +static uint64_t load_4(const unsigned char *in) { + uint64_t result; + + result = (uint64_t) in[0]; + result |= ((uint64_t) in[1]) << 8; + result |= ((uint64_t) in[2]) << 16; + result |= ((uint64_t) in[3]) << 24; + + return result; +} + +/* +Input: + s[0]+256*s[1]+...+256^63*s[63] = s + +Output: + s[0]+256*s[1]+...+256^31*s[31] = s mod l + where l = 2^252 + 27742317777372353535851937790883648493. + Overwrites s in place. +*/ + +void sc_reduce(unsigned char *s) { + int64_t s0 = 2097151 & load_3(s); + int64_t s1 = 2097151 & (load_4(s + 2) >> 5); + int64_t s2 = 2097151 & (load_3(s + 5) >> 2); + int64_t s3 = 2097151 & (load_4(s + 7) >> 7); + int64_t s4 = 2097151 & (load_4(s + 10) >> 4); + int64_t s5 = 2097151 & (load_3(s + 13) >> 1); + int64_t s6 = 2097151 & (load_4(s + 15) >> 6); + int64_t s7 = 2097151 & (load_3(s + 18) >> 3); + int64_t s8 = 2097151 & load_3(s + 21); + int64_t s9 = 2097151 & (load_4(s + 23) >> 5); + int64_t s10 = 2097151 & (load_3(s + 26) >> 2); + int64_t s11 = 2097151 & (load_4(s + 28) >> 7); + int64_t s12 = 2097151 & (load_4(s + 31) >> 4); + int64_t s13 = 2097151 & (load_3(s + 34) >> 1); + int64_t s14 = 2097151 & (load_4(s + 36) >> 6); + int64_t s15 = 2097151 & (load_3(s + 39) >> 3); + int64_t s16 = 2097151 & load_3(s + 42); + int64_t s17 = 2097151 & (load_4(s + 44) >> 5); + int64_t s18 = 2097151 & (load_3(s + 47) >> 2); + int64_t s19 = 2097151 & (load_4(s + 49) >> 7); + int64_t s20 = 2097151 & (load_4(s + 52) >> 4); + int64_t s21 = 2097151 & (load_3(s + 55) >> 1); + int64_t s22 = 2097151 & (load_4(s + 57) >> 6); + int64_t s23 = (load_4(s + 60) >> 3); + int64_t carry0; + int64_t carry1; + int64_t carry2; + int64_t carry3; + int64_t carry4; + int64_t carry5; + int64_t carry6; + int64_t carry7; + int64_t carry8; + int64_t carry9; + int64_t carry10; + int64_t carry11; + int64_t carry12; + int64_t carry13; + int64_t carry14; + int64_t carry15; + int64_t carry16; + + s11 += s23 * 666643; + s12 += s23 * 470296; + s13 += s23 * 654183; + s14 -= s23 * 997805; + s15 += s23 * 136657; + s16 -= s23 * 683901; + s23 = 0; + s10 += s22 * 666643; + s11 += s22 * 470296; + s12 += s22 * 654183; + s13 -= s22 * 997805; + s14 += s22 * 136657; + s15 -= s22 * 683901; + s22 = 0; + s9 += s21 * 666643; + s10 += s21 * 470296; + s11 += s21 * 654183; + s12 -= s21 * 997805; + s13 += s21 * 136657; + s14 -= s21 * 683901; + s21 = 0; + s8 += s20 * 666643; + s9 += s20 * 470296; + s10 += s20 * 654183; + s11 -= s20 * 997805; + s12 += s20 * 136657; + s13 -= s20 * 683901; + s20 = 0; + s7 += s19 * 666643; + s8 += s19 * 470296; + s9 += s19 * 654183; + s10 -= s19 * 997805; + s11 += s19 * 136657; + s12 -= s19 * 683901; + s19 = 0; + s6 += s18 * 666643; + s7 += s18 * 470296; + s8 += s18 * 654183; + s9 -= s18 * 997805; + s10 += s18 * 136657; + s11 -= s18 * 683901; + s18 = 0; + carry6 = (s6 + (1 << 20)) >> 21; + s7 += carry6; + s6 -= carry6 << 21; + carry8 = (s8 + (1 << 20)) >> 21; + s9 += carry8; + s8 -= carry8 << 21; + carry10 = (s10 + (1 << 20)) >> 21; + s11 += carry10; + s10 -= carry10 << 21; + carry12 = (s12 + (1 << 20)) >> 21; + s13 += carry12; + s12 -= carry12 << 21; + carry14 = (s14 + (1 << 20)) >> 21; + s15 += carry14; + s14 -= carry14 << 21; + carry16 = (s16 + (1 << 20)) >> 21; + s17 += carry16; + s16 -= carry16 << 21; + carry7 = (s7 + (1 << 20)) >> 21; + s8 += carry7; + s7 -= carry7 << 21; + carry9 = (s9 + (1 << 20)) >> 21; + s10 += carry9; + s9 -= carry9 << 21; + carry11 = (s11 + (1 << 20)) >> 21; + s12 += carry11; + s11 -= carry11 << 21; + carry13 = (s13 + (1 << 20)) >> 21; + s14 += carry13; + s13 -= carry13 << 21; + carry15 = (s15 + (1 << 20)) >> 21; + s16 += carry15; + s15 -= carry15 << 21; + s5 += s17 * 666643; + s6 += s17 * 470296; + s7 += s17 * 654183; + s8 -= s17 * 997805; + s9 += s17 * 136657; + s10 -= s17 * 683901; + s17 = 0; + s4 += s16 * 666643; + s5 += s16 * 470296; + s6 += s16 * 654183; + s7 -= s16 * 997805; + s8 += s16 * 136657; + s9 -= s16 * 683901; + s16 = 0; + s3 += s15 * 666643; + s4 += s15 * 470296; + s5 += s15 * 654183; + s6 -= s15 * 997805; + s7 += s15 * 136657; + s8 -= s15 * 683901; + s15 = 0; + s2 += s14 * 666643; + s3 += s14 * 470296; + s4 += s14 * 654183; + s5 -= s14 * 997805; + s6 += s14 * 136657; + s7 -= s14 * 683901; + s14 = 0; + s1 += s13 * 666643; + s2 += s13 * 470296; + s3 += s13 * 654183; + s4 -= s13 * 997805; + s5 += s13 * 136657; + s6 -= s13 * 683901; + s13 = 0; + s0 += s12 * 666643; + s1 += s12 * 470296; + s2 += s12 * 654183; + s3 -= s12 * 997805; + s4 += s12 * 136657; + s5 -= s12 * 683901; + s12 = 0; + carry0 = (s0 + (1 << 20)) >> 21; + s1 += carry0; + s0 -= carry0 << 21; + carry2 = (s2 + (1 << 20)) >> 21; + s3 += carry2; + s2 -= carry2 << 21; + carry4 = (s4 + (1 << 20)) >> 21; + s5 += carry4; + s4 -= carry4 << 21; + carry6 = (s6 + (1 << 20)) >> 21; + s7 += carry6; + s6 -= carry6 << 21; + carry8 = (s8 + (1 << 20)) >> 21; + s9 += carry8; + s8 -= carry8 << 21; + carry10 = (s10 + (1 << 20)) >> 21; + s11 += carry10; + s10 -= carry10 << 21; + carry1 = (s1 + (1 << 20)) >> 21; + s2 += carry1; + s1 -= carry1 << 21; + carry3 = (s3 + (1 << 20)) >> 21; + s4 += carry3; + s3 -= carry3 << 21; + carry5 = (s5 + (1 << 20)) >> 21; + s6 += carry5; + s5 -= carry5 << 21; + carry7 = (s7 + (1 << 20)) >> 21; + s8 += carry7; + s7 -= carry7 << 21; + carry9 = (s9 + (1 << 20)) >> 21; + s10 += carry9; + s9 -= carry9 << 21; + carry11 = (s11 + (1 << 20)) >> 21; + s12 += carry11; + s11 -= carry11 << 21; + s0 += s12 * 666643; + s1 += s12 * 470296; + s2 += s12 * 654183; + s3 -= s12 * 997805; + s4 += s12 * 136657; + s5 -= s12 * 683901; + s12 = 0; + carry0 = s0 >> 21; + s1 += carry0; + s0 -= carry0 << 21; + carry1 = s1 >> 21; + s2 += carry1; + s1 -= carry1 << 21; + carry2 = s2 >> 21; + s3 += carry2; + s2 -= carry2 << 21; + carry3 = s3 >> 21; + s4 += carry3; + s3 -= carry3 << 21; + carry4 = s4 >> 21; + s5 += carry4; + s4 -= carry4 << 21; + carry5 = s5 >> 21; + s6 += carry5; + s5 -= carry5 << 21; + carry6 = s6 >> 21; + s7 += carry6; + s6 -= carry6 << 21; + carry7 = s7 >> 21; + s8 += carry7; + s7 -= carry7 << 21; + carry8 = s8 >> 21; + s9 += carry8; + s8 -= carry8 << 21; + carry9 = s9 >> 21; + s10 += carry9; + s9 -= carry9 << 21; + carry10 = s10 >> 21; + s11 += carry10; + s10 -= carry10 << 21; + carry11 = s11 >> 21; + s12 += carry11; + s11 -= carry11 << 21; + s0 += s12 * 666643; + s1 += s12 * 470296; + s2 += s12 * 654183; + s3 -= s12 * 997805; + s4 += s12 * 136657; + s5 -= s12 * 683901; + s12 = 0; + carry0 = s0 >> 21; + s1 += carry0; + s0 -= carry0 << 21; + carry1 = s1 >> 21; + s2 += carry1; + s1 -= carry1 << 21; + carry2 = s2 >> 21; + s3 += carry2; + s2 -= carry2 << 21; + carry3 = s3 >> 21; + s4 += carry3; + s3 -= carry3 << 21; + carry4 = s4 >> 21; + s5 += carry4; + s4 -= carry4 << 21; + carry5 = s5 >> 21; + s6 += carry5; + s5 -= carry5 << 21; + carry6 = s6 >> 21; + s7 += carry6; + s6 -= carry6 << 21; + carry7 = s7 >> 21; + s8 += carry7; + s7 -= carry7 << 21; + carry8 = s8 >> 21; + s9 += carry8; + s8 -= carry8 << 21; + carry9 = s9 >> 21; + s10 += carry9; + s9 -= carry9 << 21; + carry10 = s10 >> 21; + s11 += carry10; + s10 -= carry10 << 21; + + s[0] = (unsigned char) (s0 >> 0); + s[1] = (unsigned char) (s0 >> 8); + s[2] = (unsigned char) ((s0 >> 16) | (s1 << 5)); + s[3] = (unsigned char) (s1 >> 3); + s[4] = (unsigned char) (s1 >> 11); + s[5] = (unsigned char) ((s1 >> 19) | (s2 << 2)); + s[6] = (unsigned char) (s2 >> 6); + s[7] = (unsigned char) ((s2 >> 14) | (s3 << 7)); + s[8] = (unsigned char) (s3 >> 1); + s[9] = (unsigned char) (s3 >> 9); + s[10] = (unsigned char) ((s3 >> 17) | (s4 << 4)); + s[11] = (unsigned char) (s4 >> 4); + s[12] = (unsigned char) (s4 >> 12); + s[13] = (unsigned char) ((s4 >> 20) | (s5 << 1)); + s[14] = (unsigned char) (s5 >> 7); + s[15] = (unsigned char) ((s5 >> 15) | (s6 << 6)); + s[16] = (unsigned char) (s6 >> 2); + s[17] = (unsigned char) (s6 >> 10); + s[18] = (unsigned char) ((s6 >> 18) | (s7 << 3)); + s[19] = (unsigned char) (s7 >> 5); + s[20] = (unsigned char) (s7 >> 13); + s[21] = (unsigned char) (s8 >> 0); + s[22] = (unsigned char) (s8 >> 8); + s[23] = (unsigned char) ((s8 >> 16) | (s9 << 5)); + s[24] = (unsigned char) (s9 >> 3); + s[25] = (unsigned char) (s9 >> 11); + s[26] = (unsigned char) ((s9 >> 19) | (s10 << 2)); + s[27] = (unsigned char) (s10 >> 6); + s[28] = (unsigned char) ((s10 >> 14) | (s11 << 7)); + s[29] = (unsigned char) (s11 >> 1); + s[30] = (unsigned char) (s11 >> 9); + s[31] = (unsigned char) (s11 >> 17); +} + + + +/* +Input: + a[0]+256*a[1]+...+256^31*a[31] = a + b[0]+256*b[1]+...+256^31*b[31] = b + c[0]+256*c[1]+...+256^31*c[31] = c + +Output: + s[0]+256*s[1]+...+256^31*s[31] = (ab+c) mod l + where l = 2^252 + 27742317777372353535851937790883648493. +*/ + +void sc_muladd(unsigned char *s, const unsigned char *a, const unsigned char *b, const unsigned char *c) { + int64_t a0 = 2097151 & load_3(a); + int64_t a1 = 2097151 & (load_4(a + 2) >> 5); + int64_t a2 = 2097151 & (load_3(a + 5) >> 2); + int64_t a3 = 2097151 & (load_4(a + 7) >> 7); + int64_t a4 = 2097151 & (load_4(a + 10) >> 4); + int64_t a5 = 2097151 & (load_3(a + 13) >> 1); + int64_t a6 = 2097151 & (load_4(a + 15) >> 6); + int64_t a7 = 2097151 & (load_3(a + 18) >> 3); + int64_t a8 = 2097151 & load_3(a + 21); + int64_t a9 = 2097151 & (load_4(a + 23) >> 5); + int64_t a10 = 2097151 & (load_3(a + 26) >> 2); + int64_t a11 = (load_4(a + 28) >> 7); + int64_t b0 = 2097151 & load_3(b); + int64_t b1 = 2097151 & (load_4(b + 2) >> 5); + int64_t b2 = 2097151 & (load_3(b + 5) >> 2); + int64_t b3 = 2097151 & (load_4(b + 7) >> 7); + int64_t b4 = 2097151 & (load_4(b + 10) >> 4); + int64_t b5 = 2097151 & (load_3(b + 13) >> 1); + int64_t b6 = 2097151 & (load_4(b + 15) >> 6); + int64_t b7 = 2097151 & (load_3(b + 18) >> 3); + int64_t b8 = 2097151 & load_3(b + 21); + int64_t b9 = 2097151 & (load_4(b + 23) >> 5); + int64_t b10 = 2097151 & (load_3(b + 26) >> 2); + int64_t b11 = (load_4(b + 28) >> 7); + int64_t c0 = 2097151 & load_3(c); + int64_t c1 = 2097151 & (load_4(c + 2) >> 5); + int64_t c2 = 2097151 & (load_3(c + 5) >> 2); + int64_t c3 = 2097151 & (load_4(c + 7) >> 7); + int64_t c4 = 2097151 & (load_4(c + 10) >> 4); + int64_t c5 = 2097151 & (load_3(c + 13) >> 1); + int64_t c6 = 2097151 & (load_4(c + 15) >> 6); + int64_t c7 = 2097151 & (load_3(c + 18) >> 3); + int64_t c8 = 2097151 & load_3(c + 21); + int64_t c9 = 2097151 & (load_4(c + 23) >> 5); + int64_t c10 = 2097151 & (load_3(c + 26) >> 2); + int64_t c11 = (load_4(c + 28) >> 7); + int64_t s0; + int64_t s1; + int64_t s2; + int64_t s3; + int64_t s4; + int64_t s5; + int64_t s6; + int64_t s7; + int64_t s8; + int64_t s9; + int64_t s10; + int64_t s11; + int64_t s12; + int64_t s13; + int64_t s14; + int64_t s15; + int64_t s16; + int64_t s17; + int64_t s18; + int64_t s19; + int64_t s20; + int64_t s21; + int64_t s22; + int64_t s23; + int64_t carry0; + int64_t carry1; + int64_t carry2; + int64_t carry3; + int64_t carry4; + int64_t carry5; + int64_t carry6; + int64_t carry7; + int64_t carry8; + int64_t carry9; + int64_t carry10; + int64_t carry11; + int64_t carry12; + int64_t carry13; + int64_t carry14; + int64_t carry15; + int64_t carry16; + int64_t carry17; + int64_t carry18; + int64_t carry19; + int64_t carry20; + int64_t carry21; + int64_t carry22; + + s0 = c0 + a0 * b0; + s1 = c1 + a0 * b1 + a1 * b0; + s2 = c2 + a0 * b2 + a1 * b1 + a2 * b0; + s3 = c3 + a0 * b3 + a1 * b2 + a2 * b1 + a3 * b0; + s4 = c4 + a0 * b4 + a1 * b3 + a2 * b2 + a3 * b1 + a4 * b0; + s5 = c5 + a0 * b5 + a1 * b4 + a2 * b3 + a3 * b2 + a4 * b1 + a5 * b0; + s6 = c6 + a0 * b6 + a1 * b5 + a2 * b4 + a3 * b3 + a4 * b2 + a5 * b1 + a6 * b0; + s7 = c7 + a0 * b7 + a1 * b6 + a2 * b5 + a3 * b4 + a4 * b3 + a5 * b2 + a6 * b1 + a7 * b0; + s8 = c8 + a0 * b8 + a1 * b7 + a2 * b6 + a3 * b5 + a4 * b4 + a5 * b3 + a6 * b2 + a7 * b1 + a8 * b0; + s9 = c9 + a0 * b9 + a1 * b8 + a2 * b7 + a3 * b6 + a4 * b5 + a5 * b4 + a6 * b3 + a7 * b2 + a8 * b1 + a9 * b0; + s10 = c10 + a0 * b10 + a1 * b9 + a2 * b8 + a3 * b7 + a4 * b6 + a5 * b5 + a6 * b4 + a7 * b3 + a8 * b2 + a9 * b1 + a10 * b0; + s11 = c11 + a0 * b11 + a1 * b10 + a2 * b9 + a3 * b8 + a4 * b7 + a5 * b6 + a6 * b5 + a7 * b4 + a8 * b3 + a9 * b2 + a10 * b1 + a11 * b0; + s12 = a1 * b11 + a2 * b10 + a3 * b9 + a4 * b8 + a5 * b7 + a6 * b6 + a7 * b5 + a8 * b4 + a9 * b3 + a10 * b2 + a11 * b1; + s13 = a2 * b11 + a3 * b10 + a4 * b9 + a5 * b8 + a6 * b7 + a7 * b6 + a8 * b5 + a9 * b4 + a10 * b3 + a11 * b2; + s14 = a3 * b11 + a4 * b10 + a5 * b9 + a6 * b8 + a7 * b7 + a8 * b6 + a9 * b5 + a10 * b4 + a11 * b3; + s15 = a4 * b11 + a5 * b10 + a6 * b9 + a7 * b8 + a8 * b7 + a9 * b6 + a10 * b5 + a11 * b4; + s16 = a5 * b11 + a6 * b10 + a7 * b9 + a8 * b8 + a9 * b7 + a10 * b6 + a11 * b5; + s17 = a6 * b11 + a7 * b10 + a8 * b9 + a9 * b8 + a10 * b7 + a11 * b6; + s18 = a7 * b11 + a8 * b10 + a9 * b9 + a10 * b8 + a11 * b7; + s19 = a8 * b11 + a9 * b10 + a10 * b9 + a11 * b8; + s20 = a9 * b11 + a10 * b10 + a11 * b9; + s21 = a10 * b11 + a11 * b10; + s22 = a11 * b11; + s23 = 0; + carry0 = (s0 + (1 << 20)) >> 21; + s1 += carry0; + s0 -= carry0 << 21; + carry2 = (s2 + (1 << 20)) >> 21; + s3 += carry2; + s2 -= carry2 << 21; + carry4 = (s4 + (1 << 20)) >> 21; + s5 += carry4; + s4 -= carry4 << 21; + carry6 = (s6 + (1 << 20)) >> 21; + s7 += carry6; + s6 -= carry6 << 21; + carry8 = (s8 + (1 << 20)) >> 21; + s9 += carry8; + s8 -= carry8 << 21; + carry10 = (s10 + (1 << 20)) >> 21; + s11 += carry10; + s10 -= carry10 << 21; + carry12 = (s12 + (1 << 20)) >> 21; + s13 += carry12; + s12 -= carry12 << 21; + carry14 = (s14 + (1 << 20)) >> 21; + s15 += carry14; + s14 -= carry14 << 21; + carry16 = (s16 + (1 << 20)) >> 21; + s17 += carry16; + s16 -= carry16 << 21; + carry18 = (s18 + (1 << 20)) >> 21; + s19 += carry18; + s18 -= carry18 << 21; + carry20 = (s20 + (1 << 20)) >> 21; + s21 += carry20; + s20 -= carry20 << 21; + carry22 = (s22 + (1 << 20)) >> 21; + s23 += carry22; + s22 -= carry22 << 21; + carry1 = (s1 + (1 << 20)) >> 21; + s2 += carry1; + s1 -= carry1 << 21; + carry3 = (s3 + (1 << 20)) >> 21; + s4 += carry3; + s3 -= carry3 << 21; + carry5 = (s5 + (1 << 20)) >> 21; + s6 += carry5; + s5 -= carry5 << 21; + carry7 = (s7 + (1 << 20)) >> 21; + s8 += carry7; + s7 -= carry7 << 21; + carry9 = (s9 + (1 << 20)) >> 21; + s10 += carry9; + s9 -= carry9 << 21; + carry11 = (s11 + (1 << 20)) >> 21; + s12 += carry11; + s11 -= carry11 << 21; + carry13 = (s13 + (1 << 20)) >> 21; + s14 += carry13; + s13 -= carry13 << 21; + carry15 = (s15 + (1 << 20)) >> 21; + s16 += carry15; + s15 -= carry15 << 21; + carry17 = (s17 + (1 << 20)) >> 21; + s18 += carry17; + s17 -= carry17 << 21; + carry19 = (s19 + (1 << 20)) >> 21; + s20 += carry19; + s19 -= carry19 << 21; + carry21 = (s21 + (1 << 20)) >> 21; + s22 += carry21; + s21 -= carry21 << 21; + s11 += s23 * 666643; + s12 += s23 * 470296; + s13 += s23 * 654183; + s14 -= s23 * 997805; + s15 += s23 * 136657; + s16 -= s23 * 683901; + s23 = 0; + s10 += s22 * 666643; + s11 += s22 * 470296; + s12 += s22 * 654183; + s13 -= s22 * 997805; + s14 += s22 * 136657; + s15 -= s22 * 683901; + s22 = 0; + s9 += s21 * 666643; + s10 += s21 * 470296; + s11 += s21 * 654183; + s12 -= s21 * 997805; + s13 += s21 * 136657; + s14 -= s21 * 683901; + s21 = 0; + s8 += s20 * 666643; + s9 += s20 * 470296; + s10 += s20 * 654183; + s11 -= s20 * 997805; + s12 += s20 * 136657; + s13 -= s20 * 683901; + s20 = 0; + s7 += s19 * 666643; + s8 += s19 * 470296; + s9 += s19 * 654183; + s10 -= s19 * 997805; + s11 += s19 * 136657; + s12 -= s19 * 683901; + s19 = 0; + s6 += s18 * 666643; + s7 += s18 * 470296; + s8 += s18 * 654183; + s9 -= s18 * 997805; + s10 += s18 * 136657; + s11 -= s18 * 683901; + s18 = 0; + carry6 = (s6 + (1 << 20)) >> 21; + s7 += carry6; + s6 -= carry6 << 21; + carry8 = (s8 + (1 << 20)) >> 21; + s9 += carry8; + s8 -= carry8 << 21; + carry10 = (s10 + (1 << 20)) >> 21; + s11 += carry10; + s10 -= carry10 << 21; + carry12 = (s12 + (1 << 20)) >> 21; + s13 += carry12; + s12 -= carry12 << 21; + carry14 = (s14 + (1 << 20)) >> 21; + s15 += carry14; + s14 -= carry14 << 21; + carry16 = (s16 + (1 << 20)) >> 21; + s17 += carry16; + s16 -= carry16 << 21; + carry7 = (s7 + (1 << 20)) >> 21; + s8 += carry7; + s7 -= carry7 << 21; + carry9 = (s9 + (1 << 20)) >> 21; + s10 += carry9; + s9 -= carry9 << 21; + carry11 = (s11 + (1 << 20)) >> 21; + s12 += carry11; + s11 -= carry11 << 21; + carry13 = (s13 + (1 << 20)) >> 21; + s14 += carry13; + s13 -= carry13 << 21; + carry15 = (s15 + (1 << 20)) >> 21; + s16 += carry15; + s15 -= carry15 << 21; + s5 += s17 * 666643; + s6 += s17 * 470296; + s7 += s17 * 654183; + s8 -= s17 * 997805; + s9 += s17 * 136657; + s10 -= s17 * 683901; + s17 = 0; + s4 += s16 * 666643; + s5 += s16 * 470296; + s6 += s16 * 654183; + s7 -= s16 * 997805; + s8 += s16 * 136657; + s9 -= s16 * 683901; + s16 = 0; + s3 += s15 * 666643; + s4 += s15 * 470296; + s5 += s15 * 654183; + s6 -= s15 * 997805; + s7 += s15 * 136657; + s8 -= s15 * 683901; + s15 = 0; + s2 += s14 * 666643; + s3 += s14 * 470296; + s4 += s14 * 654183; + s5 -= s14 * 997805; + s6 += s14 * 136657; + s7 -= s14 * 683901; + s14 = 0; + s1 += s13 * 666643; + s2 += s13 * 470296; + s3 += s13 * 654183; + s4 -= s13 * 997805; + s5 += s13 * 136657; + s6 -= s13 * 683901; + s13 = 0; + s0 += s12 * 666643; + s1 += s12 * 470296; + s2 += s12 * 654183; + s3 -= s12 * 997805; + s4 += s12 * 136657; + s5 -= s12 * 683901; + s12 = 0; + carry0 = (s0 + (1 << 20)) >> 21; + s1 += carry0; + s0 -= carry0 << 21; + carry2 = (s2 + (1 << 20)) >> 21; + s3 += carry2; + s2 -= carry2 << 21; + carry4 = (s4 + (1 << 20)) >> 21; + s5 += carry4; + s4 -= carry4 << 21; + carry6 = (s6 + (1 << 20)) >> 21; + s7 += carry6; + s6 -= carry6 << 21; + carry8 = (s8 + (1 << 20)) >> 21; + s9 += carry8; + s8 -= carry8 << 21; + carry10 = (s10 + (1 << 20)) >> 21; + s11 += carry10; + s10 -= carry10 << 21; + carry1 = (s1 + (1 << 20)) >> 21; + s2 += carry1; + s1 -= carry1 << 21; + carry3 = (s3 + (1 << 20)) >> 21; + s4 += carry3; + s3 -= carry3 << 21; + carry5 = (s5 + (1 << 20)) >> 21; + s6 += carry5; + s5 -= carry5 << 21; + carry7 = (s7 + (1 << 20)) >> 21; + s8 += carry7; + s7 -= carry7 << 21; + carry9 = (s9 + (1 << 20)) >> 21; + s10 += carry9; + s9 -= carry9 << 21; + carry11 = (s11 + (1 << 20)) >> 21; + s12 += carry11; + s11 -= carry11 << 21; + s0 += s12 * 666643; + s1 += s12 * 470296; + s2 += s12 * 654183; + s3 -= s12 * 997805; + s4 += s12 * 136657; + s5 -= s12 * 683901; + s12 = 0; + carry0 = s0 >> 21; + s1 += carry0; + s0 -= carry0 << 21; + carry1 = s1 >> 21; + s2 += carry1; + s1 -= carry1 << 21; + carry2 = s2 >> 21; + s3 += carry2; + s2 -= carry2 << 21; + carry3 = s3 >> 21; + s4 += carry3; + s3 -= carry3 << 21; + carry4 = s4 >> 21; + s5 += carry4; + s4 -= carry4 << 21; + carry5 = s5 >> 21; + s6 += carry5; + s5 -= carry5 << 21; + carry6 = s6 >> 21; + s7 += carry6; + s6 -= carry6 << 21; + carry7 = s7 >> 21; + s8 += carry7; + s7 -= carry7 << 21; + carry8 = s8 >> 21; + s9 += carry8; + s8 -= carry8 << 21; + carry9 = s9 >> 21; + s10 += carry9; + s9 -= carry9 << 21; + carry10 = s10 >> 21; + s11 += carry10; + s10 -= carry10 << 21; + carry11 = s11 >> 21; + s12 += carry11; + s11 -= carry11 << 21; + s0 += s12 * 666643; + s1 += s12 * 470296; + s2 += s12 * 654183; + s3 -= s12 * 997805; + s4 += s12 * 136657; + s5 -= s12 * 683901; + s12 = 0; + carry0 = s0 >> 21; + s1 += carry0; + s0 -= carry0 << 21; + carry1 = s1 >> 21; + s2 += carry1; + s1 -= carry1 << 21; + carry2 = s2 >> 21; + s3 += carry2; + s2 -= carry2 << 21; + carry3 = s3 >> 21; + s4 += carry3; + s3 -= carry3 << 21; + carry4 = s4 >> 21; + s5 += carry4; + s4 -= carry4 << 21; + carry5 = s5 >> 21; + s6 += carry5; + s5 -= carry5 << 21; + carry6 = s6 >> 21; + s7 += carry6; + s6 -= carry6 << 21; + carry7 = s7 >> 21; + s8 += carry7; + s7 -= carry7 << 21; + carry8 = s8 >> 21; + s9 += carry8; + s8 -= carry8 << 21; + carry9 = s9 >> 21; + s10 += carry9; + s9 -= carry9 << 21; + carry10 = s10 >> 21; + s11 += carry10; + s10 -= carry10 << 21; + + s[0] = (unsigned char) (s0 >> 0); + s[1] = (unsigned char) (s0 >> 8); + s[2] = (unsigned char) ((s0 >> 16) | (s1 << 5)); + s[3] = (unsigned char) (s1 >> 3); + s[4] = (unsigned char) (s1 >> 11); + s[5] = (unsigned char) ((s1 >> 19) | (s2 << 2)); + s[6] = (unsigned char) (s2 >> 6); + s[7] = (unsigned char) ((s2 >> 14) | (s3 << 7)); + s[8] = (unsigned char) (s3 >> 1); + s[9] = (unsigned char) (s3 >> 9); + s[10] = (unsigned char) ((s3 >> 17) | (s4 << 4)); + s[11] = (unsigned char) (s4 >> 4); + s[12] = (unsigned char) (s4 >> 12); + s[13] = (unsigned char) ((s4 >> 20) | (s5 << 1)); + s[14] = (unsigned char) (s5 >> 7); + s[15] = (unsigned char) ((s5 >> 15) | (s6 << 6)); + s[16] = (unsigned char) (s6 >> 2); + s[17] = (unsigned char) (s6 >> 10); + s[18] = (unsigned char) ((s6 >> 18) | (s7 << 3)); + s[19] = (unsigned char) (s7 >> 5); + s[20] = (unsigned char) (s7 >> 13); + s[21] = (unsigned char) (s8 >> 0); + s[22] = (unsigned char) (s8 >> 8); + s[23] = (unsigned char) ((s8 >> 16) | (s9 << 5)); + s[24] = (unsigned char) (s9 >> 3); + s[25] = (unsigned char) (s9 >> 11); + s[26] = (unsigned char) ((s9 >> 19) | (s10 << 2)); + s[27] = (unsigned char) (s10 >> 6); + s[28] = (unsigned char) ((s10 >> 14) | (s11 << 7)); + s[29] = (unsigned char) (s11 >> 1); + s[30] = (unsigned char) (s11 >> 9); + s[31] = (unsigned char) (s11 >> 17); +} diff --git a/src/sc.h b/src/sc.h new file mode 100644 index 000000000..e29e7fa5a --- /dev/null +++ b/src/sc.h @@ -0,0 +1,12 @@ +#ifndef SC_H +#define SC_H + +/* +The set of scalars is \Z/l +where l = 2^252 + 27742317777372353535851937790883648493. +*/ + +void sc_reduce(unsigned char *s); +void sc_muladd(unsigned char *s, const unsigned char *a, const unsigned char *b, const unsigned char *c); + +#endif diff --git a/src/seed.c b/src/seed.c new file mode 100644 index 000000000..11a2e3ec4 --- /dev/null +++ b/src/seed.c @@ -0,0 +1,40 @@ +#include "ed25519.h" + +#ifndef ED25519_NO_SEED + +#ifdef _WIN32 +#include +#include +#else +#include +#endif + +int ed25519_create_seed(unsigned char *seed) { +#ifdef _WIN32 + HCRYPTPROV prov; + + if (!CryptAcquireContext(&prov, NULL, NULL, PROV_RSA_FULL, CRYPT_VERIFYCONTEXT)) { + return 1; + } + + if (!CryptGenRandom(prov, 32, seed)) { + CryptReleaseContext(prov, 0); + return 1; + } + + CryptReleaseContext(prov, 0); +#else + FILE *f = fopen("/dev/urandom", "rb"); + + if (f == NULL) { + return 1; + } + + fread(seed, 1, 32, f); + fclose(f); +#endif + + return 0; +} + +#endif diff --git a/src/sha512.c b/src/sha512.c new file mode 100644 index 000000000..cb8ae7175 --- /dev/null +++ b/src/sha512.c @@ -0,0 +1,275 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ + +#include "fixedint.h" +#include "sha512.h" + +/* the K array */ +static const uint64_t K[80] = { + UINT64_C(0x428a2f98d728ae22), UINT64_C(0x7137449123ef65cd), + UINT64_C(0xb5c0fbcfec4d3b2f), UINT64_C(0xe9b5dba58189dbbc), + UINT64_C(0x3956c25bf348b538), UINT64_C(0x59f111f1b605d019), + UINT64_C(0x923f82a4af194f9b), UINT64_C(0xab1c5ed5da6d8118), + UINT64_C(0xd807aa98a3030242), UINT64_C(0x12835b0145706fbe), + UINT64_C(0x243185be4ee4b28c), UINT64_C(0x550c7dc3d5ffb4e2), + UINT64_C(0x72be5d74f27b896f), UINT64_C(0x80deb1fe3b1696b1), + UINT64_C(0x9bdc06a725c71235), UINT64_C(0xc19bf174cf692694), + UINT64_C(0xe49b69c19ef14ad2), UINT64_C(0xefbe4786384f25e3), + UINT64_C(0x0fc19dc68b8cd5b5), UINT64_C(0x240ca1cc77ac9c65), + UINT64_C(0x2de92c6f592b0275), UINT64_C(0x4a7484aa6ea6e483), + UINT64_C(0x5cb0a9dcbd41fbd4), UINT64_C(0x76f988da831153b5), + UINT64_C(0x983e5152ee66dfab), UINT64_C(0xa831c66d2db43210), + UINT64_C(0xb00327c898fb213f), UINT64_C(0xbf597fc7beef0ee4), + UINT64_C(0xc6e00bf33da88fc2), UINT64_C(0xd5a79147930aa725), + UINT64_C(0x06ca6351e003826f), UINT64_C(0x142929670a0e6e70), + UINT64_C(0x27b70a8546d22ffc), UINT64_C(0x2e1b21385c26c926), + UINT64_C(0x4d2c6dfc5ac42aed), UINT64_C(0x53380d139d95b3df), + UINT64_C(0x650a73548baf63de), UINT64_C(0x766a0abb3c77b2a8), + UINT64_C(0x81c2c92e47edaee6), UINT64_C(0x92722c851482353b), + UINT64_C(0xa2bfe8a14cf10364), UINT64_C(0xa81a664bbc423001), + UINT64_C(0xc24b8b70d0f89791), UINT64_C(0xc76c51a30654be30), + UINT64_C(0xd192e819d6ef5218), UINT64_C(0xd69906245565a910), + UINT64_C(0xf40e35855771202a), UINT64_C(0x106aa07032bbd1b8), + UINT64_C(0x19a4c116b8d2d0c8), UINT64_C(0x1e376c085141ab53), + UINT64_C(0x2748774cdf8eeb99), UINT64_C(0x34b0bcb5e19b48a8), + UINT64_C(0x391c0cb3c5c95a63), UINT64_C(0x4ed8aa4ae3418acb), + UINT64_C(0x5b9cca4f7763e373), UINT64_C(0x682e6ff3d6b2b8a3), + UINT64_C(0x748f82ee5defb2fc), UINT64_C(0x78a5636f43172f60), + UINT64_C(0x84c87814a1f0ab72), UINT64_C(0x8cc702081a6439ec), + UINT64_C(0x90befffa23631e28), UINT64_C(0xa4506cebde82bde9), + UINT64_C(0xbef9a3f7b2c67915), UINT64_C(0xc67178f2e372532b), + UINT64_C(0xca273eceea26619c), UINT64_C(0xd186b8c721c0c207), + UINT64_C(0xeada7dd6cde0eb1e), UINT64_C(0xf57d4f7fee6ed178), + UINT64_C(0x06f067aa72176fba), UINT64_C(0x0a637dc5a2c898a6), + UINT64_C(0x113f9804bef90dae), UINT64_C(0x1b710b35131c471b), + UINT64_C(0x28db77f523047d84), UINT64_C(0x32caab7b40c72493), + UINT64_C(0x3c9ebe0a15c9bebc), UINT64_C(0x431d67c49c100d4c), + UINT64_C(0x4cc5d4becb3e42b6), UINT64_C(0x597f299cfc657e2a), + UINT64_C(0x5fcb6fab3ad6faec), UINT64_C(0x6c44198c4a475817) +}; + +/* Various logical functions */ + +#define ROR64c(x, y) \ + ( ((((x)&UINT64_C(0xFFFFFFFFFFFFFFFF))>>((uint64_t)(y)&UINT64_C(63))) | \ + ((x)<<((uint64_t)(64-((y)&UINT64_C(63)))))) & UINT64_C(0xFFFFFFFFFFFFFFFF)) + +#define STORE64H(x, y) \ + { (y)[0] = (unsigned char)(((x)>>56)&255); (y)[1] = (unsigned char)(((x)>>48)&255); \ + (y)[2] = (unsigned char)(((x)>>40)&255); (y)[3] = (unsigned char)(((x)>>32)&255); \ + (y)[4] = (unsigned char)(((x)>>24)&255); (y)[5] = (unsigned char)(((x)>>16)&255); \ + (y)[6] = (unsigned char)(((x)>>8)&255); (y)[7] = (unsigned char)((x)&255); } + +#define LOAD64H(x, y) \ + { x = (((uint64_t)((y)[0] & 255))<<56)|(((uint64_t)((y)[1] & 255))<<48) | \ + (((uint64_t)((y)[2] & 255))<<40)|(((uint64_t)((y)[3] & 255))<<32) | \ + (((uint64_t)((y)[4] & 255))<<24)|(((uint64_t)((y)[5] & 255))<<16) | \ + (((uint64_t)((y)[6] & 255))<<8)|(((uint64_t)((y)[7] & 255))); } + + +#define Ch(x,y,z) (z ^ (x & (y ^ z))) +#define Maj(x,y,z) (((x | y) & z) | (x & y)) +#define S(x, n) ROR64c(x, n) +#define R(x, n) (((x) &UINT64_C(0xFFFFFFFFFFFFFFFF))>>((uint64_t)n)) +#define Sigma0(x) (S(x, 28) ^ S(x, 34) ^ S(x, 39)) +#define Sigma1(x) (S(x, 14) ^ S(x, 18) ^ S(x, 41)) +#define Gamma0(x) (S(x, 1) ^ S(x, 8) ^ R(x, 7)) +#define Gamma1(x) (S(x, 19) ^ S(x, 61) ^ R(x, 6)) +#ifndef MIN + #define MIN(x, y) ( ((x)<(y))?(x):(y) ) +#endif + +/* compress 1024-bits */ +static int sha512_compress(sha512_context *md, unsigned char *buf) +{ + uint64_t S[8], W[80], t0, t1; + int i; + + /* copy state into S */ + for (i = 0; i < 8; i++) { + S[i] = md->state[i]; + } + + /* copy the state into 1024-bits into W[0..15] */ + for (i = 0; i < 16; i++) { + LOAD64H(W[i], buf + (8*i)); + } + + /* fill W[16..79] */ + for (i = 16; i < 80; i++) { + W[i] = Gamma1(W[i - 2]) + W[i - 7] + Gamma0(W[i - 15]) + W[i - 16]; + } + +/* Compress */ + #define RND(a,b,c,d,e,f,g,h,i) \ + t0 = h + Sigma1(e) + Ch(e, f, g) + K[i] + W[i]; \ + t1 = Sigma0(a) + Maj(a, b, c);\ + d += t0; \ + h = t0 + t1; + + for (i = 0; i < 80; i += 8) { + RND(S[0],S[1],S[2],S[3],S[4],S[5],S[6],S[7],i+0); + RND(S[7],S[0],S[1],S[2],S[3],S[4],S[5],S[6],i+1); + RND(S[6],S[7],S[0],S[1],S[2],S[3],S[4],S[5],i+2); + RND(S[5],S[6],S[7],S[0],S[1],S[2],S[3],S[4],i+3); + RND(S[4],S[5],S[6],S[7],S[0],S[1],S[2],S[3],i+4); + RND(S[3],S[4],S[5],S[6],S[7],S[0],S[1],S[2],i+5); + RND(S[2],S[3],S[4],S[5],S[6],S[7],S[0],S[1],i+6); + RND(S[1],S[2],S[3],S[4],S[5],S[6],S[7],S[0],i+7); + } + + #undef RND + + + + /* feedback */ + for (i = 0; i < 8; i++) { + md->state[i] = md->state[i] + S[i]; + } + + return 0; +} + + +/** + Initialize the hash state + @param md The hash state you wish to initialize + @return 0 if successful +*/ +int sha512_init(sha512_context * md) { + if (md == NULL) return 1; + + md->curlen = 0; + md->length = 0; + md->state[0] = UINT64_C(0x6a09e667f3bcc908); + md->state[1] = UINT64_C(0xbb67ae8584caa73b); + md->state[2] = UINT64_C(0x3c6ef372fe94f82b); + md->state[3] = UINT64_C(0xa54ff53a5f1d36f1); + md->state[4] = UINT64_C(0x510e527fade682d1); + md->state[5] = UINT64_C(0x9b05688c2b3e6c1f); + md->state[6] = UINT64_C(0x1f83d9abfb41bd6b); + md->state[7] = UINT64_C(0x5be0cd19137e2179); + + return 0; +} + +/** + Process a block of memory though the hash + @param md The hash state + @param in The data to hash + @param inlen The length of the data (octets) + @return 0 if successful +*/ +int sha512_update (sha512_context * md, const unsigned char *in, size_t inlen) +{ + size_t n; + size_t i; + int err; + if (md == NULL) return 1; + if (in == NULL) return 1; + if (md->curlen > sizeof(md->buf)) { + return 1; + } + while (inlen > 0) { + if (md->curlen == 0 && inlen >= 128) { + if ((err = sha512_compress (md, (unsigned char *)in)) != 0) { + return err; + } + md->length += 128 * 8; + in += 128; + inlen -= 128; + } else { + n = MIN(inlen, (128 - md->curlen)); + + for (i = 0; i < n; i++) { + md->buf[i + md->curlen] = in[i]; + } + + + md->curlen += n; + in += n; + inlen -= n; + if (md->curlen == 128) { + if ((err = sha512_compress (md, md->buf)) != 0) { + return err; + } + md->length += 8*128; + md->curlen = 0; + } + } + } + return 0; +} + +/** + Terminate the hash to get the digest + @param md The hash state + @param out [out] The destination of the hash (64 bytes) + @return 0 if successful +*/ + int sha512_final(sha512_context * md, unsigned char *out) + { + int i; + + if (md == NULL) return 1; + if (out == NULL) return 1; + + if (md->curlen >= sizeof(md->buf)) { + return 1; + } + + /* increase the length of the message */ + md->length += md->curlen * UINT64_C(8); + + /* append the '1' bit */ + md->buf[md->curlen++] = (unsigned char)0x80; + + /* if the length is currently above 112 bytes we append zeros + * then compress. Then we can fall back to padding zeros and length + * encoding like normal. + */ + if (md->curlen > 112) { + while (md->curlen < 128) { + md->buf[md->curlen++] = (unsigned char)0; + } + sha512_compress(md, md->buf); + md->curlen = 0; + } + + /* pad upto 120 bytes of zeroes + * note: that from 112 to 120 is the 64 MSB of the length. We assume that you won't hash + * > 2^64 bits of data... :-) + */ +while (md->curlen < 120) { + md->buf[md->curlen++] = (unsigned char)0; +} + + /* store length */ +STORE64H(md->length, md->buf+120); +sha512_compress(md, md->buf); + + /* copy output */ +for (i = 0; i < 8; i++) { + STORE64H(md->state[i], out+(8*i)); +} + +return 0; +} + +int sha512(const unsigned char *message, size_t message_len, unsigned char *out) +{ + sha512_context ctx; + int ret; + if ((ret = sha512_init(&ctx))) return ret; + if ((ret = sha512_update(&ctx, message, message_len))) return ret; + if ((ret = sha512_final(&ctx, out))) return ret; + return 0; +} diff --git a/src/sha512.h b/src/sha512.h new file mode 100644 index 000000000..a34dd5e42 --- /dev/null +++ b/src/sha512.h @@ -0,0 +1,21 @@ +#ifndef SHA512_H +#define SHA512_H + +#include + +#include "fixedint.h" + +/* state */ +typedef struct sha512_context_ { + uint64_t length, state[8]; + size_t curlen; + unsigned char buf[128]; +} sha512_context; + + +int sha512_init(sha512_context * md); +int sha512_final(sha512_context * md, unsigned char *out); +int sha512_update(sha512_context * md, const unsigned char *in, size_t inlen); +int sha512(const unsigned char *message, size_t message_len, unsigned char *out); + +#endif diff --git a/src/sign.c b/src/sign.c new file mode 100644 index 000000000..199a8393b --- /dev/null +++ b/src/sign.c @@ -0,0 +1,31 @@ +#include "ed25519.h" +#include "sha512.h" +#include "ge.h" +#include "sc.h" + + +void ed25519_sign(unsigned char *signature, const unsigned char *message, size_t message_len, const unsigned char *public_key, const unsigned char *private_key) { + sha512_context hash; + unsigned char hram[64]; + unsigned char r[64]; + ge_p3 R; + + + sha512_init(&hash); + sha512_update(&hash, private_key + 32, 32); + sha512_update(&hash, message, message_len); + sha512_final(&hash, r); + + sc_reduce(r); + ge_scalarmult_base(&R, r); + ge_p3_tobytes(signature, &R); + + sha512_init(&hash); + sha512_update(&hash, signature, 32); + sha512_update(&hash, public_key, 32); + sha512_update(&hash, message, message_len); + sha512_final(&hash, hram); + + sc_reduce(hram); + sc_muladd(signature + 32, hram, private_key, r); +} diff --git a/src/verify.c b/src/verify.c new file mode 100644 index 000000000..32f988edc --- /dev/null +++ b/src/verify.c @@ -0,0 +1,77 @@ +#include "ed25519.h" +#include "sha512.h" +#include "ge.h" +#include "sc.h" + +static int consttime_equal(const unsigned char *x, const unsigned char *y) { + unsigned char r = 0; + + r = x[0] ^ y[0]; + #define F(i) r |= x[i] ^ y[i] + F(1); + F(2); + F(3); + F(4); + F(5); + F(6); + F(7); + F(8); + F(9); + F(10); + F(11); + F(12); + F(13); + F(14); + F(15); + F(16); + F(17); + F(18); + F(19); + F(20); + F(21); + F(22); + F(23); + F(24); + F(25); + F(26); + F(27); + F(28); + F(29); + F(30); + F(31); + #undef F + + return !r; +} + +int ed25519_verify(const unsigned char *signature, const unsigned char *message, size_t message_len, const unsigned char *public_key) { + unsigned char h[64]; + unsigned char checker[32]; + sha512_context hash; + ge_p3 A; + ge_p2 R; + + if (signature[63] & 224) { + return 0; + } + + if (ge_frombytes_negate_vartime(&A, public_key) != 0) { + return 0; + } + + sha512_init(&hash); + sha512_update(&hash, signature, 32); + sha512_update(&hash, public_key, 32); + sha512_update(&hash, message, message_len); + sha512_final(&hash, h); + + sc_reduce(h); + ge_double_scalarmult_vartime(&R, h, &A, signature + 32); + ge_tobytes(checker, &R); + + if (!consttime_equal(checker, signature)) { + return 0; + } + + return 1; +} diff --git a/test.c b/test.c new file mode 100644 index 000000000..e2159a9af --- /dev/null +++ b/test.c @@ -0,0 +1,150 @@ +#include +#include +#include +#include + +/* #define ED25519_DLL */ +#include "src/ed25519.h" + +#include "src/ge.h" +#include "src/sc.h" + + +int main() { + unsigned char public_key[32], private_key[64], seed[32], scalar[32]; + unsigned char other_public_key[32], other_private_key[64]; + unsigned char shared_secret[32], other_shared_secret[32]; + unsigned char signature[64]; + + clock_t start; + clock_t end; + int i; + + const unsigned char message[] = "Hello, world!"; + const int message_len = strlen((char*) message); + + /* create a random seed, and a keypair out of that seed */ + ed25519_create_seed(seed); + ed25519_create_keypair(public_key, private_key, seed); + + /* create signature on the message with the keypair */ + ed25519_sign(signature, message, message_len, public_key, private_key); + + /* verify the signature */ + if (ed25519_verify(signature, message, message_len, public_key)) { + printf("valid signature\n"); + } else { + printf("invalid signature\n"); + } + + /* create scalar and add it to the keypair */ + ed25519_create_seed(scalar); + ed25519_add_scalar(public_key, private_key, scalar); + + /* create signature with the new keypair */ + ed25519_sign(signature, message, message_len, public_key, private_key); + + /* verify the signature with the new keypair */ + if (ed25519_verify(signature, message, message_len, public_key)) { + printf("valid signature\n"); + } else { + printf("invalid signature\n"); + } + + /* make a slight adjustment and verify again */ + signature[44] ^= 0x10; + if (ed25519_verify(signature, message, message_len, public_key)) { + printf("did not detect signature change\n"); + } else { + printf("correctly detected signature change\n"); + } + + /* generate two keypairs for testing key exchange */ + ed25519_create_seed(seed); + ed25519_create_keypair(public_key, private_key, seed); + ed25519_create_seed(seed); + ed25519_create_keypair(other_public_key, other_private_key, seed); + + /* create two shared secrets - from both perspectives - and check if they're equal */ + ed25519_key_exchange(shared_secret, other_public_key, private_key); + ed25519_key_exchange(other_shared_secret, public_key, other_private_key); + + for (i = 0; i < 32; ++i) { + if (shared_secret[i] != other_shared_secret[i]) { + printf("key exchange was incorrect\n"); + break; + } + } + + if (i == 32) { + printf("key exchange was correct\n"); + } + + /* test performance */ + printf("testing seed generation performance: "); + start = clock(); + for (i = 0; i < 10000; ++i) { + ed25519_create_seed(seed); + } + end = clock(); + + printf("%fus per seed\n", ((double) ((end - start) * 1000)) / CLOCKS_PER_SEC / i * 1000); + + + printf("testing key generation performance: "); + start = clock(); + for (i = 0; i < 10000; ++i) { + ed25519_create_keypair(public_key, private_key, seed); + } + end = clock(); + + printf("%fus per keypair\n", ((double) ((end - start) * 1000)) / CLOCKS_PER_SEC / i * 1000); + + printf("testing sign performance: "); + start = clock(); + for (i = 0; i < 10000; ++i) { + ed25519_sign(signature, message, message_len, public_key, private_key); + } + end = clock(); + + printf("%fus per signature\n", ((double) ((end - start) * 1000)) / CLOCKS_PER_SEC / i * 1000); + + printf("testing verify performance: "); + start = clock(); + for (i = 0; i < 10000; ++i) { + ed25519_verify(signature, message, message_len, public_key); + } + end = clock(); + + printf("%fus per signature\n", ((double) ((end - start) * 1000)) / CLOCKS_PER_SEC / i * 1000); + + + printf("testing keypair scalar addition performance: "); + start = clock(); + for (i = 0; i < 10000; ++i) { + ed25519_add_scalar(public_key, private_key, scalar); + } + end = clock(); + + printf("%fus per keypair\n", ((double) ((end - start) * 1000)) / CLOCKS_PER_SEC / i * 1000); + + printf("testing public key scalar addition performance: "); + start = clock(); + for (i = 0; i < 10000; ++i) { + ed25519_add_scalar(public_key, NULL, scalar); + } + end = clock(); + + printf("%fus per key\n", ((double) ((end - start) * 1000)) / CLOCKS_PER_SEC / i * 1000); + + printf("testing key exchange performance: "); + start = clock(); + for (i = 0; i < 10000; ++i) { + ed25519_key_exchange(shared_secret, other_public_key, private_key); + } + end = clock(); + + printf("%fus per shared secret\n", ((double) ((end - start) * 1000)) / CLOCKS_PER_SEC / i * 1000); + + return 0; +} From 5fbd0b2a90f7adb60c98b9187ccc794928daea87 Mon Sep 17 00:00:00 2001 From: Paul Driver Date: Sat, 3 Oct 2020 15:15:14 -0700 Subject: [PATCH 051/329] mid-autoconfiscation of urcrypt --- nix/deps/default.nix | 1 + nix/deps/libaes_siv/builder.sh | 10 ++++++ nix/deps/libaes_siv/default.nix | 13 ++++++++ nix/pkgs/urcrypt/default.nix | 4 +-- nix/pkgs/urcrypt/shell.nix | 11 +++++++ pkg/urcrypt/.gitignore | 6 ++++ pkg/urcrypt/Makefile.am | 22 +++++++++++++ pkg/urcrypt/{Makefile => Makefile.old} | 0 pkg/urcrypt/build-aux/m4/.gitkeep | 0 pkg/urcrypt/configure.ac | 45 ++++++++++++++++++++++++++ pkg/urcrypt/shell.nix | 1 + pkg/urcrypt/urcrypt.c | 4 +-- 12 files changed, 113 insertions(+), 4 deletions(-) create mode 100644 nix/deps/libaes_siv/builder.sh create mode 100644 nix/deps/libaes_siv/default.nix create mode 100644 nix/pkgs/urcrypt/shell.nix create mode 100644 pkg/urcrypt/.gitignore create mode 100644 pkg/urcrypt/Makefile.am rename pkg/urcrypt/{Makefile => Makefile.old} (100%) create mode 100644 pkg/urcrypt/build-aux/m4/.gitkeep create mode 100644 pkg/urcrypt/configure.ac create mode 100644 pkg/urcrypt/shell.nix diff --git a/nix/deps/default.nix b/nix/deps/default.nix index 8f44e7501..6a07a8b79 100644 --- a/nix/deps/default.nix +++ b/nix/deps/default.nix @@ -4,6 +4,7 @@ rec { argon2 = import ./argon2 { inherit pkgs; }; murmur3 = import ./murmur3 { inherit pkgs; }; uv = import ./uv { inherit pkgs; }; + libaes_siv = import ./libaes_siv { inherit pkgs; }; ed25519 = import ./ed25519 { inherit pkgs; }; scrypt = import ./scrypt { inherit pkgs; }; softfloat3 = import ./softfloat3 { inherit pkgs; }; diff --git a/nix/deps/libaes_siv/builder.sh b/nix/deps/libaes_siv/builder.sh new file mode 100644 index 000000000..4fc6381a4 --- /dev/null +++ b/nix/deps/libaes_siv/builder.sh @@ -0,0 +1,10 @@ +source $stdenv/setup + +cp -r $src ./src +chmod -R u+w ./src +cd ./src + +cmake -DCMAKE_INSTALL_PREFIX=$out . && \ +make && \ +make test && \ +make install diff --git a/nix/deps/libaes_siv/default.nix b/nix/deps/libaes_siv/default.nix new file mode 100644 index 000000000..576bd64e4 --- /dev/null +++ b/nix/deps/libaes_siv/default.nix @@ -0,0 +1,13 @@ +{ pkgs }: + +pkgs.stdenv.mkDerivation rec { + name = "libaes_siv-50955"; + buildInputs = [ pkgs.cmake pkgs.openssl ]; + builder = ./builder.sh; + src = pkgs.fetchFromGitHub { + owner = "frodwith"; + repo = "libaes_siv"; + rev = "509550e92a416172b9b8255e275f3a04d5fd4545"; + sha256 = "11clbvasyyc7ml2x9g5z3il6hs9gzsa10fcnj4grmijzm7gkb3qq"; + }; +} diff --git a/nix/pkgs/urcrypt/default.nix b/nix/pkgs/urcrypt/default.nix index f2e390274..73aac0e56 100644 --- a/nix/pkgs/urcrypt/default.nix +++ b/nix/pkgs/urcrypt/default.nix @@ -1,4 +1,4 @@ -{ stdenv, openssl, gmp, ed25519, secp256k1, argon2, libaes_siv }: +{ stdenv, openssl, gmp, secp256k1, argon2, scrypt, libaes_siv }: stdenv.mkDerivation rec { name = "urcrypt"; @@ -6,6 +6,6 @@ stdenv.mkDerivation rec { src = ../../../pkg/urcrypt; buildInputs = [ - openssl gmp ed25519 secp256k1 argon2 libaes_siv + openssl gmp secp256k1 argon2 scrypt libaes_siv ]; } diff --git a/nix/pkgs/urcrypt/shell.nix b/nix/pkgs/urcrypt/shell.nix new file mode 100644 index 000000000..00a40f405 --- /dev/null +++ b/nix/pkgs/urcrypt/shell.nix @@ -0,0 +1,11 @@ +let + pkgs = import ../../nixpkgs.nix; + deps = import ../../deps { inherit pkgs; }; +in + +import ./default.nix { + inherit (pkgs) + stdenv openssl gmp; + inherit (deps) + libaes_siv argon2 scrypt secp256k1; +} diff --git a/pkg/urcrypt/.gitignore b/pkg/urcrypt/.gitignore new file mode 100644 index 000000000..509a0c428 --- /dev/null +++ b/pkg/urcrypt/.gitignore @@ -0,0 +1,6 @@ +build-aux +Makefile.in +aclocal.m4 +config.h.* +configure +.deps diff --git a/pkg/urcrypt/Makefile.am b/pkg/urcrypt/Makefile.am new file mode 100644 index 000000000..a401e816f --- /dev/null +++ b/pkg/urcrypt/Makefile.am @@ -0,0 +1,22 @@ +ACLOCAL_AMFLAGS = -I build-aux/m4 + +lib_LTLIBRARIES = liburcrypt.la +include_HEADERS = urcrypt.h +noinst_HEADERS = $(ed25519_includes) $(ge_additions_includes) +liburcrypt_la_SOURCES = urcrypt.c $(ed25519_sources) $(ge_additions_sources) +liburcrypt_la_CPPFLAGS = -Ied25519/src -Ige-additions + +### ed25519 +ed25519_sources = ed25519/src/add_scalar.c ed25519/src/keypair.c \ + ed25519/src/sc.c ed25519/src/seed.c \ + ed25519/src/verify.c ed25519/src/ge.c \ + ed25519/src/key_exchange.c ed25519/src/sha512.c \ + ed25519/src/sign.c +ed25519_includes = ed25519/src/fixedint.h ed25519/src/ge.h \ + ed25519/src/sha512.h ed25519/src/ed25519.h \ + ed25519/src/fe.h ed25519/src/precomp_data.h \ + ed25519/src/sc.h + +### ge-additions +ge_additions_sources = ge-additions/ge-additions.c +ge_additions_includes = ge-additions/ge-additions.h diff --git a/pkg/urcrypt/Makefile b/pkg/urcrypt/Makefile.old similarity index 100% rename from pkg/urcrypt/Makefile rename to pkg/urcrypt/Makefile.old diff --git a/pkg/urcrypt/build-aux/m4/.gitkeep b/pkg/urcrypt/build-aux/m4/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/urcrypt/configure.ac b/pkg/urcrypt/configure.ac new file mode 100644 index 000000000..20b2c09ae --- /dev/null +++ b/pkg/urcrypt/configure.ac @@ -0,0 +1,45 @@ +# -*- Autoconf -*- +# Process this file with autoconf to produce a configure script. + +AC_PREREQ([2.69]) +AC_INIT([urcrypt], [1.0]) +AC_CONFIG_SRCDIR([urcrypt.c]) +AC_CONFIG_HEADERS([config.h]) +AC_CONFIG_AUX_DIR([build-aux]) +AC_CONFIG_MACRO_DIR([build-aux/m4]) +AM_INIT_AUTOMAKE([foreign subdir-objects -Wall -Werror]) +AM_PROG_AR +LT_INIT +AC_PROG_CC +AC_CHECK_LIB([aes_siv], [AES_SIV_CTX_new]) + +## Checks for libraries. +## FIXME: Replace `main' with a function in `-laes_siv': +## FIXME: Replace `main' with a function in `-largon2': +#AC_CHECK_LIB([argon2], [main]) +## FIXME: Replace `main' with a function in `-led25519': +#AC_CHECK_LIB([ed25519], [main]) +## FIXME: Replace `main' with a function in `-lgmp': +#AC_CHECK_LIB([gmp], [main]) +## FIXME: Replace `main' with a function in `-lsecp256k1': +#AC_CHECK_LIB([secp256k1], [main]) +## FIXME: Replace `main' with a function in `-lssl': +#AC_CHECK_LIB([ssl], [main]) + +# Checks for header files. +AC_CHECK_HEADERS([limits.h stddef.h stdint.h stdlib.h string.h]) + +# Checks for typedefs, structures, and compiler characteristics. +AC_CHECK_HEADER_STDBOOL +AC_TYPE_INT32_T +AC_TYPE_INT64_T +AC_TYPE_SIZE_T +AC_TYPE_UINT32_T +AC_TYPE_UINT64_T +AC_TYPE_UINT8_T + +# Checks for library functions. +AC_CHECK_FUNCS([memset]) + +AC_CONFIG_FILES([Makefile]) +AC_OUTPUT diff --git a/pkg/urcrypt/shell.nix b/pkg/urcrypt/shell.nix new file mode 100644 index 000000000..17cea416e --- /dev/null +++ b/pkg/urcrypt/shell.nix @@ -0,0 +1 @@ +import ../../nix/pkgs/urcrypt/shell.nix diff --git a/pkg/urcrypt/urcrypt.c b/pkg/urcrypt/urcrypt.c index bae6239cc..5238c4c83 100644 --- a/pkg/urcrypt/urcrypt.c +++ b/pkg/urcrypt/urcrypt.c @@ -1,8 +1,8 @@ #include "urcrypt.h" -#include "ge-additions/ge-additions.h" - #include + #include +#include #include #include From aa02d49a228c62fe13299a3e2bd38b4f7316f927 Mon Sep 17 00:00:00 2001 From: Paul Driver Date: Sat, 3 Oct 2020 15:18:53 -0700 Subject: [PATCH 052/329] Squashed 'pkg/urcrypt/argon2/' content from commit 4da94a611 git-subtree-dir: pkg/urcrypt/argon2 git-subtree-split: 4da94a611ee62bad87ab2b131ffda3bcc0723d9c --- .gitattributes | 10 + .gitignore | 21 + .travis.yml | 25 + Argon2.sln | 160 + CHANGELOG.md | 32 + LICENSE | 314 + Makefile | 187 + README.md | 30 + appveyor.yml | 25 + argon2-specs.pdf | Bin 0 -> 459608 bytes export.sh | 7 + include/argon2.h | 475 + kats/argon2d | 12304 ++++++++++++++++ kats/argon2d.shasum | 1 + kats/argon2d_v16 | 12304 ++++++++++++++++ kats/argon2d_v16.shasum | 1 + kats/argon2i | 12304 ++++++++++++++++ kats/argon2i.shasum | 1 + kats/argon2i_v16 | 12304 ++++++++++++++++ kats/argon2i_v16.shasum | 1 + kats/argon2id | 12304 ++++++++++++++++ kats/argon2id.shasum | 1 + kats/argon2id_v16 | 12304 ++++++++++++++++ kats/argon2id_v16.shasum | 1 + kats/check-sums.ps1 | 42 + kats/check-sums.sh | 13 + kats/test.ps1 | 50 + kats/test.sh | 49 + latex/IEEEtran.cls | 6347 ++++++++ latex/Makefile | 18 + latex/argon2-specs.tex | 920 ++ latex/pics/argon2-par.pdf | Bin 0 -> 76165 bytes latex/pics/compression.pdf | Bin 0 -> 40828 bytes latex/pics/generic.pdf | Bin 0 -> 30736 bytes latex/pics/power-distribution.jpg | Bin 0 -> 25673 bytes latex/tradeoff.bib | 822 ++ libargon2.pc | 16 + man/argon2.1 | 60 + meson.build | 33 + src/argon2.c | 490 + src/bench.c | 111 + src/blake2/blake2-impl.h | 156 + src/blake2/blake2.h | 89 + src/blake2/blake2b.c | 390 + src/blake2/blamka-round-opt.h | 471 + src/blake2/blamka-round-ref.h | 56 + src/core.c | 670 + src/core.h | 228 + src/encoding.c | 493 + src/encoding.h | 57 + src/genkat.c | 209 + src/genkat.h | 51 + src/opt.c | 285 + src/ref.c | 196 + src/run.c | 341 + src/test.c | 253 + src/thread.c | 57 + src/thread.h | 67 + vs2015/Argon2Opt/Argon2Opt.vcxproj | 226 + vs2015/Argon2Opt/Argon2Opt.vcxproj.filters | 69 + vs2015/Argon2OptBench/Argon2OptBench.vcxproj | 226 + .../Argon2OptBench.vcxproj.filters | 69 + vs2015/Argon2OptDll/Argon2OptDll.vcxproj | 225 + .../Argon2OptDll/Argon2OptDll.vcxproj.filters | 66 + .../Argon2OptGenKAT/Argon2OptGenKAT.vcxproj | 239 + .../Argon2OptGenKAT.vcxproj.filters | 72 + .../Argon2OptTestCI/Argon2OptTestCI.vcxproj | 227 + .../Argon2OptTestCI.vcxproj.filters | 69 + vs2015/Argon2Ref/Argon2Ref.vcxproj | 226 + vs2015/Argon2Ref/Argon2Ref.vcxproj.filters | 69 + vs2015/Argon2RefBench/Argon2RefBench.vcxproj | 226 + .../Argon2RefBench.vcxproj.filters | 69 + vs2015/Argon2RefDll/Argon2RefDll.vcxproj | 225 + .../Argon2RefDll/Argon2RefDll.vcxproj.filters | 66 + .../Argon2RefGenKAT/Argon2RefGenKAT.vcxproj | 227 + .../Argon2RefGenKAT.vcxproj.filters | 72 + .../Argon2RefTestCI/Argon2RefTestCI.vcxproj | 226 + .../Argon2RefTestCI.vcxproj.filters | 69 + 78 files changed, 91119 insertions(+) create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 .travis.yml create mode 100644 Argon2.sln create mode 100644 CHANGELOG.md create mode 100644 LICENSE create mode 100644 Makefile create mode 100644 README.md create mode 100644 appveyor.yml create mode 100644 argon2-specs.pdf create mode 100755 export.sh create mode 100644 include/argon2.h create mode 100644 kats/argon2d create mode 100644 kats/argon2d.shasum create mode 100644 kats/argon2d_v16 create mode 100644 kats/argon2d_v16.shasum create mode 100644 kats/argon2i create mode 100644 kats/argon2i.shasum create mode 100644 kats/argon2i_v16 create mode 100644 kats/argon2i_v16.shasum create mode 100644 kats/argon2id create mode 100644 kats/argon2id.shasum create mode 100644 kats/argon2id_v16 create mode 100644 kats/argon2id_v16.shasum create mode 100644 kats/check-sums.ps1 create mode 100755 kats/check-sums.sh create mode 100644 kats/test.ps1 create mode 100755 kats/test.sh create mode 100644 latex/IEEEtran.cls create mode 100644 latex/Makefile create mode 100644 latex/argon2-specs.tex create mode 100644 latex/pics/argon2-par.pdf create mode 100644 latex/pics/compression.pdf create mode 100644 latex/pics/generic.pdf create mode 100644 latex/pics/power-distribution.jpg create mode 100644 latex/tradeoff.bib create mode 100644 libargon2.pc create mode 100644 man/argon2.1 create mode 100644 meson.build create mode 100644 src/argon2.c create mode 100644 src/bench.c create mode 100644 src/blake2/blake2-impl.h create mode 100644 src/blake2/blake2.h create mode 100644 src/blake2/blake2b.c create mode 100644 src/blake2/blamka-round-opt.h create mode 100644 src/blake2/blamka-round-ref.h create mode 100644 src/core.c create mode 100644 src/core.h create mode 100644 src/encoding.c create mode 100644 src/encoding.h create mode 100644 src/genkat.c create mode 100644 src/genkat.h create mode 100644 src/opt.c create mode 100644 src/ref.c create mode 100644 src/run.c create mode 100644 src/test.c create mode 100644 src/thread.c create mode 100644 src/thread.h create mode 100644 vs2015/Argon2Opt/Argon2Opt.vcxproj create mode 100644 vs2015/Argon2Opt/Argon2Opt.vcxproj.filters create mode 100644 vs2015/Argon2OptBench/Argon2OptBench.vcxproj create mode 100644 vs2015/Argon2OptBench/Argon2OptBench.vcxproj.filters create mode 100644 vs2015/Argon2OptDll/Argon2OptDll.vcxproj create mode 100644 vs2015/Argon2OptDll/Argon2OptDll.vcxproj.filters create mode 100644 vs2015/Argon2OptGenKAT/Argon2OptGenKAT.vcxproj create mode 100644 vs2015/Argon2OptGenKAT/Argon2OptGenKAT.vcxproj.filters create mode 100644 vs2015/Argon2OptTestCI/Argon2OptTestCI.vcxproj create mode 100644 vs2015/Argon2OptTestCI/Argon2OptTestCI.vcxproj.filters create mode 100644 vs2015/Argon2Ref/Argon2Ref.vcxproj create mode 100644 vs2015/Argon2Ref/Argon2Ref.vcxproj.filters create mode 100644 vs2015/Argon2RefBench/Argon2RefBench.vcxproj create mode 100644 vs2015/Argon2RefBench/Argon2RefBench.vcxproj.filters create mode 100644 vs2015/Argon2RefDll/Argon2RefDll.vcxproj create mode 100644 vs2015/Argon2RefDll/Argon2RefDll.vcxproj.filters create mode 100644 vs2015/Argon2RefGenKAT/Argon2RefGenKAT.vcxproj create mode 100644 vs2015/Argon2RefGenKAT/Argon2RefGenKAT.vcxproj.filters create mode 100644 vs2015/Argon2RefTestCI/Argon2RefTestCI.vcxproj create mode 100644 vs2015/Argon2RefTestCI/Argon2RefTestCI.vcxproj.filters diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 000000000..177bed95d --- /dev/null +++ b/.gitattributes @@ -0,0 +1,10 @@ +# Export ignore +.gitattributes export-ignore +.gitignore export-ignore +.travis.yml export-ignore +appveyor.yml export-ignore +export.sh export-ignore +latex/* export-ignore + +# Linguist documentation +latex/* linguist-documentation diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000..4cfff979b --- /dev/null +++ b/.gitignore @@ -0,0 +1,21 @@ +argon2 +libargon2.a +libargon2.so* +libargon2.dylib +.DS_Store +src/*.o +src/blake2/*.o +genkat +.idea +*.pyc +testcase +*.gcda +*.gcno +*.gcov +bench +vs2015/build +Argon2.sdf +Argon2.VC.opendb +*.zip +*.tar.gz +tags diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 000000000..265fc48c0 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,25 @@ +language: c + +compiler: + - clang + - gcc + +os: + - linux + - osx + +# Clang on Linux needs to run in a VM to use ASAN. +# See: https://github.com/travis-ci/travis-ci/issues/9033 +matrix: + exclude: + - compiler: clang + os: linux + include: + - compiler: clang + os: linux + sudo: true + +script: make && make testci + +after_success: + - bash <(curl -s https://codecov.io/bash) diff --git a/Argon2.sln b/Argon2.sln new file mode 100644 index 000000000..8c23fdc58 --- /dev/null +++ b/Argon2.sln @@ -0,0 +1,160 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 14 +VisualStudioVersion = 14.0.25420.1 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Argon2OptTestCI", "vs2015\Argon2OptTestCI\Argon2OptTestCI.vcxproj", "{12956597-5E42-433A-93F3-D4EFF50AA207}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Argon2RefTestCI", "vs2015\Argon2RefTestCI\Argon2RefTestCI.vcxproj", "{8A1F7F84-34AF-4DB2-9D58-D4823DFE79E9}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Argon2OptGenKAT", "vs2015\Argon2OptGenKAT\Argon2OptGenKAT.vcxproj", "{DBBAAAE6-4560-4D11-8280-30A6650A82EF}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Argon2RefGenKAT", "vs2015\Argon2RefGenKAT\Argon2RefGenKAT.vcxproj", "{71921B4C-A795-4A37-95A3-99D600E01211}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Argon2Opt", "vs2015\Argon2Opt\Argon2Opt.vcxproj", "{CAA75C57-998C-494E-B8A5-5894EF0FC528}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Argon2Ref", "vs2015\Argon2Ref\Argon2Ref.vcxproj", "{B9CAC9CE-9F0D-4F52-8D67-FDBBAFCD0DE2}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Argon2OptBench", "vs2015\Argon2OptBench\Argon2OptBench.vcxproj", "{B3A0FB44-0C1C-4EC3-B155-8B39371F8EE4}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Argon2RefBench", "vs2015\Argon2RefBench\Argon2RefBench.vcxproj", "{99203F6A-6E8C-42FC-8C7C-C07E8913D539}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Argon2OptDll", "vs2015\Argon2OptDll\Argon2OptDll.vcxproj", "{3A898DD8-ACAE-4269-ADFE-EB7260D71583}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Argon2RefDll", "vs2015\Argon2RefDll\Argon2RefDll.vcxproj", "{19D911A1-533C-4475-B313-F372481A35D4}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + Release|x64 = Release|x64 + Release|x86 = Release|x86 + ReleaseStatic|x64 = ReleaseStatic|x64 + ReleaseStatic|x86 = ReleaseStatic|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {12956597-5E42-433A-93F3-D4EFF50AA207}.Debug|x64.ActiveCfg = Debug|x64 + {12956597-5E42-433A-93F3-D4EFF50AA207}.Debug|x64.Build.0 = Debug|x64 + {12956597-5E42-433A-93F3-D4EFF50AA207}.Debug|x86.ActiveCfg = Debug|Win32 + {12956597-5E42-433A-93F3-D4EFF50AA207}.Debug|x86.Build.0 = Debug|Win32 + {12956597-5E42-433A-93F3-D4EFF50AA207}.Release|x64.ActiveCfg = Release|x64 + {12956597-5E42-433A-93F3-D4EFF50AA207}.Release|x64.Build.0 = Release|x64 + {12956597-5E42-433A-93F3-D4EFF50AA207}.Release|x86.ActiveCfg = Release|Win32 + {12956597-5E42-433A-93F3-D4EFF50AA207}.Release|x86.Build.0 = Release|Win32 + {12956597-5E42-433A-93F3-D4EFF50AA207}.ReleaseStatic|x64.ActiveCfg = ReleaseStatic|x64 + {12956597-5E42-433A-93F3-D4EFF50AA207}.ReleaseStatic|x64.Build.0 = ReleaseStatic|x64 + {12956597-5E42-433A-93F3-D4EFF50AA207}.ReleaseStatic|x86.ActiveCfg = ReleaseStatic|Win32 + {12956597-5E42-433A-93F3-D4EFF50AA207}.ReleaseStatic|x86.Build.0 = ReleaseStatic|Win32 + {8A1F7F84-34AF-4DB2-9D58-D4823DFE79E9}.Debug|x64.ActiveCfg = Debug|x64 + {8A1F7F84-34AF-4DB2-9D58-D4823DFE79E9}.Debug|x64.Build.0 = Debug|x64 + {8A1F7F84-34AF-4DB2-9D58-D4823DFE79E9}.Debug|x86.ActiveCfg = Debug|Win32 + {8A1F7F84-34AF-4DB2-9D58-D4823DFE79E9}.Debug|x86.Build.0 = Debug|Win32 + {8A1F7F84-34AF-4DB2-9D58-D4823DFE79E9}.Release|x64.ActiveCfg = Release|x64 + {8A1F7F84-34AF-4DB2-9D58-D4823DFE79E9}.Release|x64.Build.0 = Release|x64 + {8A1F7F84-34AF-4DB2-9D58-D4823DFE79E9}.Release|x86.ActiveCfg = Release|Win32 + {8A1F7F84-34AF-4DB2-9D58-D4823DFE79E9}.Release|x86.Build.0 = Release|Win32 + {8A1F7F84-34AF-4DB2-9D58-D4823DFE79E9}.ReleaseStatic|x64.ActiveCfg = ReleaseStatic|x64 + {8A1F7F84-34AF-4DB2-9D58-D4823DFE79E9}.ReleaseStatic|x64.Build.0 = ReleaseStatic|x64 + {8A1F7F84-34AF-4DB2-9D58-D4823DFE79E9}.ReleaseStatic|x86.ActiveCfg = ReleaseStatic|Win32 + {8A1F7F84-34AF-4DB2-9D58-D4823DFE79E9}.ReleaseStatic|x86.Build.0 = ReleaseStatic|Win32 + {DBBAAAE6-4560-4D11-8280-30A6650A82EF}.Debug|x64.ActiveCfg = Debug|x64 + {DBBAAAE6-4560-4D11-8280-30A6650A82EF}.Debug|x64.Build.0 = Debug|x64 + {DBBAAAE6-4560-4D11-8280-30A6650A82EF}.Debug|x86.ActiveCfg = Debug|Win32 + {DBBAAAE6-4560-4D11-8280-30A6650A82EF}.Debug|x86.Build.0 = Debug|Win32 + {DBBAAAE6-4560-4D11-8280-30A6650A82EF}.Release|x64.ActiveCfg = Release|x64 + {DBBAAAE6-4560-4D11-8280-30A6650A82EF}.Release|x64.Build.0 = Release|x64 + {DBBAAAE6-4560-4D11-8280-30A6650A82EF}.Release|x86.ActiveCfg = Release|Win32 + {DBBAAAE6-4560-4D11-8280-30A6650A82EF}.Release|x86.Build.0 = Release|Win32 + {DBBAAAE6-4560-4D11-8280-30A6650A82EF}.ReleaseStatic|x64.ActiveCfg = ReleaseStatic|x64 + {DBBAAAE6-4560-4D11-8280-30A6650A82EF}.ReleaseStatic|x64.Build.0 = ReleaseStatic|x64 + {DBBAAAE6-4560-4D11-8280-30A6650A82EF}.ReleaseStatic|x86.ActiveCfg = ReleaseStatic|Win32 + {DBBAAAE6-4560-4D11-8280-30A6650A82EF}.ReleaseStatic|x86.Build.0 = ReleaseStatic|Win32 + {71921B4C-A795-4A37-95A3-99D600E01211}.Debug|x64.ActiveCfg = Debug|x64 + {71921B4C-A795-4A37-95A3-99D600E01211}.Debug|x64.Build.0 = Debug|x64 + {71921B4C-A795-4A37-95A3-99D600E01211}.Debug|x86.ActiveCfg = Debug|Win32 + {71921B4C-A795-4A37-95A3-99D600E01211}.Debug|x86.Build.0 = Debug|Win32 + {71921B4C-A795-4A37-95A3-99D600E01211}.Release|x64.ActiveCfg = Release|x64 + {71921B4C-A795-4A37-95A3-99D600E01211}.Release|x64.Build.0 = Release|x64 + {71921B4C-A795-4A37-95A3-99D600E01211}.Release|x86.ActiveCfg = Release|Win32 + {71921B4C-A795-4A37-95A3-99D600E01211}.Release|x86.Build.0 = Release|Win32 + {71921B4C-A795-4A37-95A3-99D600E01211}.ReleaseStatic|x64.ActiveCfg = ReleaseStatic|x64 + {71921B4C-A795-4A37-95A3-99D600E01211}.ReleaseStatic|x64.Build.0 = ReleaseStatic|x64 + {71921B4C-A795-4A37-95A3-99D600E01211}.ReleaseStatic|x86.ActiveCfg = ReleaseStatic|Win32 + {71921B4C-A795-4A37-95A3-99D600E01211}.ReleaseStatic|x86.Build.0 = ReleaseStatic|Win32 + {CAA75C57-998C-494E-B8A5-5894EF0FC528}.Debug|x64.ActiveCfg = Debug|x64 + {CAA75C57-998C-494E-B8A5-5894EF0FC528}.Debug|x64.Build.0 = Debug|x64 + {CAA75C57-998C-494E-B8A5-5894EF0FC528}.Debug|x86.ActiveCfg = Debug|Win32 + {CAA75C57-998C-494E-B8A5-5894EF0FC528}.Debug|x86.Build.0 = Debug|Win32 + {CAA75C57-998C-494E-B8A5-5894EF0FC528}.Release|x64.ActiveCfg = Release|x64 + {CAA75C57-998C-494E-B8A5-5894EF0FC528}.Release|x64.Build.0 = Release|x64 + {CAA75C57-998C-494E-B8A5-5894EF0FC528}.Release|x86.ActiveCfg = Release|Win32 + {CAA75C57-998C-494E-B8A5-5894EF0FC528}.Release|x86.Build.0 = Release|Win32 + {CAA75C57-998C-494E-B8A5-5894EF0FC528}.ReleaseStatic|x64.ActiveCfg = ReleaseStatic|x64 + {CAA75C57-998C-494E-B8A5-5894EF0FC528}.ReleaseStatic|x64.Build.0 = ReleaseStatic|x64 + {CAA75C57-998C-494E-B8A5-5894EF0FC528}.ReleaseStatic|x86.ActiveCfg = ReleaseStatic|Win32 + {CAA75C57-998C-494E-B8A5-5894EF0FC528}.ReleaseStatic|x86.Build.0 = ReleaseStatic|Win32 + {B9CAC9CE-9F0D-4F52-8D67-FDBBAFCD0DE2}.Debug|x64.ActiveCfg = Debug|x64 + {B9CAC9CE-9F0D-4F52-8D67-FDBBAFCD0DE2}.Debug|x64.Build.0 = Debug|x64 + {B9CAC9CE-9F0D-4F52-8D67-FDBBAFCD0DE2}.Debug|x86.ActiveCfg = Debug|Win32 + {B9CAC9CE-9F0D-4F52-8D67-FDBBAFCD0DE2}.Debug|x86.Build.0 = Debug|Win32 + {B9CAC9CE-9F0D-4F52-8D67-FDBBAFCD0DE2}.Release|x64.ActiveCfg = Release|x64 + {B9CAC9CE-9F0D-4F52-8D67-FDBBAFCD0DE2}.Release|x64.Build.0 = Release|x64 + {B9CAC9CE-9F0D-4F52-8D67-FDBBAFCD0DE2}.Release|x86.ActiveCfg = Release|Win32 + {B9CAC9CE-9F0D-4F52-8D67-FDBBAFCD0DE2}.Release|x86.Build.0 = Release|Win32 + {B9CAC9CE-9F0D-4F52-8D67-FDBBAFCD0DE2}.ReleaseStatic|x64.ActiveCfg = ReleaseStatic|x64 + {B9CAC9CE-9F0D-4F52-8D67-FDBBAFCD0DE2}.ReleaseStatic|x64.Build.0 = ReleaseStatic|x64 + {B9CAC9CE-9F0D-4F52-8D67-FDBBAFCD0DE2}.ReleaseStatic|x86.ActiveCfg = ReleaseStatic|Win32 + {B9CAC9CE-9F0D-4F52-8D67-FDBBAFCD0DE2}.ReleaseStatic|x86.Build.0 = ReleaseStatic|Win32 + {B3A0FB44-0C1C-4EC3-B155-8B39371F8EE4}.Debug|x64.ActiveCfg = Debug|x64 + {B3A0FB44-0C1C-4EC3-B155-8B39371F8EE4}.Debug|x64.Build.0 = Debug|x64 + {B3A0FB44-0C1C-4EC3-B155-8B39371F8EE4}.Debug|x86.ActiveCfg = Debug|Win32 + {B3A0FB44-0C1C-4EC3-B155-8B39371F8EE4}.Debug|x86.Build.0 = Debug|Win32 + {B3A0FB44-0C1C-4EC3-B155-8B39371F8EE4}.Release|x64.ActiveCfg = Release|x64 + {B3A0FB44-0C1C-4EC3-B155-8B39371F8EE4}.Release|x64.Build.0 = Release|x64 + {B3A0FB44-0C1C-4EC3-B155-8B39371F8EE4}.Release|x86.ActiveCfg = Release|Win32 + {B3A0FB44-0C1C-4EC3-B155-8B39371F8EE4}.Release|x86.Build.0 = Release|Win32 + {B3A0FB44-0C1C-4EC3-B155-8B39371F8EE4}.ReleaseStatic|x64.ActiveCfg = ReleaseStatic|x64 + {B3A0FB44-0C1C-4EC3-B155-8B39371F8EE4}.ReleaseStatic|x64.Build.0 = ReleaseStatic|x64 + {B3A0FB44-0C1C-4EC3-B155-8B39371F8EE4}.ReleaseStatic|x86.ActiveCfg = ReleaseStatic|Win32 + {B3A0FB44-0C1C-4EC3-B155-8B39371F8EE4}.ReleaseStatic|x86.Build.0 = ReleaseStatic|Win32 + {99203F6A-6E8C-42FC-8C7C-C07E8913D539}.Debug|x64.ActiveCfg = Debug|x64 + {99203F6A-6E8C-42FC-8C7C-C07E8913D539}.Debug|x64.Build.0 = Debug|x64 + {99203F6A-6E8C-42FC-8C7C-C07E8913D539}.Debug|x86.ActiveCfg = Debug|Win32 + {99203F6A-6E8C-42FC-8C7C-C07E8913D539}.Debug|x86.Build.0 = Debug|Win32 + {99203F6A-6E8C-42FC-8C7C-C07E8913D539}.Release|x64.ActiveCfg = Release|x64 + {99203F6A-6E8C-42FC-8C7C-C07E8913D539}.Release|x64.Build.0 = Release|x64 + {99203F6A-6E8C-42FC-8C7C-C07E8913D539}.Release|x86.ActiveCfg = Release|Win32 + {99203F6A-6E8C-42FC-8C7C-C07E8913D539}.Release|x86.Build.0 = Release|Win32 + {99203F6A-6E8C-42FC-8C7C-C07E8913D539}.ReleaseStatic|x64.ActiveCfg = ReleaseStatic|x64 + {99203F6A-6E8C-42FC-8C7C-C07E8913D539}.ReleaseStatic|x64.Build.0 = ReleaseStatic|x64 + {99203F6A-6E8C-42FC-8C7C-C07E8913D539}.ReleaseStatic|x86.ActiveCfg = ReleaseStatic|Win32 + {99203F6A-6E8C-42FC-8C7C-C07E8913D539}.ReleaseStatic|x86.Build.0 = ReleaseStatic|Win32 + {3A898DD8-ACAE-4269-ADFE-EB7260D71583}.Debug|x64.ActiveCfg = Debug|x64 + {3A898DD8-ACAE-4269-ADFE-EB7260D71583}.Debug|x64.Build.0 = Debug|x64 + {3A898DD8-ACAE-4269-ADFE-EB7260D71583}.Debug|x86.ActiveCfg = Debug|Win32 + {3A898DD8-ACAE-4269-ADFE-EB7260D71583}.Debug|x86.Build.0 = Debug|Win32 + {3A898DD8-ACAE-4269-ADFE-EB7260D71583}.Release|x64.ActiveCfg = Release|x64 + {3A898DD8-ACAE-4269-ADFE-EB7260D71583}.Release|x64.Build.0 = Release|x64 + {3A898DD8-ACAE-4269-ADFE-EB7260D71583}.Release|x86.ActiveCfg = Release|Win32 + {3A898DD8-ACAE-4269-ADFE-EB7260D71583}.Release|x86.Build.0 = Release|Win32 + {3A898DD8-ACAE-4269-ADFE-EB7260D71583}.ReleaseStatic|x64.ActiveCfg = ReleaseStatic|x64 + {3A898DD8-ACAE-4269-ADFE-EB7260D71583}.ReleaseStatic|x64.Build.0 = ReleaseStatic|x64 + {3A898DD8-ACAE-4269-ADFE-EB7260D71583}.ReleaseStatic|x86.ActiveCfg = ReleaseStatic|Win32 + {3A898DD8-ACAE-4269-ADFE-EB7260D71583}.ReleaseStatic|x86.Build.0 = ReleaseStatic|Win32 + {19D911A1-533C-4475-B313-F372481A35D4}.Debug|x64.ActiveCfg = Debug|x64 + {19D911A1-533C-4475-B313-F372481A35D4}.Debug|x64.Build.0 = Debug|x64 + {19D911A1-533C-4475-B313-F372481A35D4}.Debug|x86.ActiveCfg = Debug|Win32 + {19D911A1-533C-4475-B313-F372481A35D4}.Debug|x86.Build.0 = Debug|Win32 + {19D911A1-533C-4475-B313-F372481A35D4}.Release|x64.ActiveCfg = Release|x64 + {19D911A1-533C-4475-B313-F372481A35D4}.Release|x64.Build.0 = Release|x64 + {19D911A1-533C-4475-B313-F372481A35D4}.Release|x86.ActiveCfg = Release|Win32 + {19D911A1-533C-4475-B313-F372481A35D4}.Release|x86.Build.0 = Release|Win32 + {19D911A1-533C-4475-B313-F372481A35D4}.ReleaseStatic|x64.ActiveCfg = ReleaseStatic|x64 + {19D911A1-533C-4475-B313-F372481A35D4}.ReleaseStatic|x64.Build.0 = ReleaseStatic|x64 + {19D911A1-533C-4475-B313-F372481A35D4}.ReleaseStatic|x86.ActiveCfg = ReleaseStatic|Win32 + {19D911A1-533C-4475-B313-F372481A35D4}.ReleaseStatic|x86.Build.0 = ReleaseStatic|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 000000000..0578fde27 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,32 @@ +# 20171227 +* Added ABI version number +* AVX2/AVX-512F optimizations of BLAMKA +* Set Argon2 version number from the command line +* New bindings +* Minor bug and warning fixes (no security issue) + +# 20161029 + +* Argon2id added +* Better documentation +* Dual licensing CC0 / Apache 2.0 +* Minor bug fixes (no security issue) + +# 20160406 + +* Version 1.3 of Argon2 +* Version number in encoded hash +* Refactored low-level API +* Visibility control for library symbols +* Microsoft Visual Studio solution +* New bindings +* Minor bug and warning fixes (no security issue) + + +# 20151206 + +* Python bindings +* Password read from stdin, instead of being an argument +* Compatibility FreeBSD, NetBSD, OpenBSD +* Constant-time verification +* Minor bug and warning fixes (no security issue) diff --git a/LICENSE b/LICENSE new file mode 100644 index 000000000..fa611f7ac --- /dev/null +++ b/LICENSE @@ -0,0 +1,314 @@ +Argon2 reference source code package - reference C implementations + +Copyright 2015 +Daniel Dinu, Dmitry Khovratovich, Jean-Philippe Aumasson, and Samuel Neves + +You may use this work under the terms of a Creative Commons CC0 1.0 +License/Waiver or the Apache Public License 2.0, at your option. The terms of +these licenses can be found at: + +- CC0 1.0 Universal : http://creativecommons.org/publicdomain/zero/1.0 +- Apache 2.0 : http://www.apache.org/licenses/LICENSE-2.0 + +The terms of the licenses are reproduced below. + +-------------------------------------------------------------------------------- + +Creative Commons Legal Code + +CC0 1.0 Universal + + CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE + LEGAL SERVICES. DISTRIBUTION OF THIS DOCUMENT DOES NOT CREATE AN + ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS + INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES + REGARDING THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS + PROVIDED HEREUNDER, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM + THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS PROVIDED + HEREUNDER. + +Statement of Purpose + +The laws of most jurisdictions throughout the world automatically confer +exclusive Copyright and Related Rights (defined below) upon the creator +and subsequent owner(s) (each and all, an "owner") of an original work of +authorship and/or a database (each, a "Work"). + +Certain owners wish to permanently relinquish those rights to a Work for +the purpose of contributing to a commons of creative, cultural and +scientific works ("Commons") that the public can reliably and without fear +of later claims of infringement build upon, modify, incorporate in other +works, reuse and redistribute as freely as possible in any form whatsoever +and for any purposes, including without limitation commercial purposes. +These owners may contribute to the Commons to promote the ideal of a free +culture and the further production of creative, cultural and scientific +works, or to gain reputation or greater distribution for their Work in +part through the use and efforts of others. + +For these and/or other purposes and motivations, and without any +expectation of additional consideration or compensation, the person +associating CC0 with a Work (the "Affirmer"), to the extent that he or she +is an owner of Copyright and Related Rights in the Work, voluntarily +elects to apply CC0 to the Work and publicly distribute the Work under its +terms, with knowledge of his or her Copyright and Related Rights in the +Work and the meaning and intended legal effect of CC0 on those rights. + +1. Copyright and Related Rights. A Work made available under CC0 may be +protected by copyright and related or neighboring rights ("Copyright and +Related Rights"). Copyright and Related Rights include, but are not +limited to, the following: + + i. the right to reproduce, adapt, distribute, perform, display, + communicate, and translate a Work; + ii. moral rights retained by the original author(s) and/or performer(s); +iii. publicity and privacy rights pertaining to a person's image or + likeness depicted in a Work; + iv. rights protecting against unfair competition in regards to a Work, + subject to the limitations in paragraph 4(a), below; + v. rights protecting the extraction, dissemination, use and reuse of data + in a Work; + vi. database rights (such as those arising under Directive 96/9/EC of the + European Parliament and of the Council of 11 March 1996 on the legal + protection of databases, and under any national implementation + thereof, including any amended or successor version of such + directive); and +vii. other similar, equivalent or corresponding rights throughout the + world based on applicable law or treaty, and any national + implementations thereof. + +2. Waiver. To the greatest extent permitted by, but not in contravention +of, applicable law, Affirmer hereby overtly, fully, permanently, +irrevocably and unconditionally waives, abandons, and surrenders all of +Affirmer's Copyright and Related Rights and associated claims and causes +of action, whether now known or unknown (including existing as well as +future claims and causes of action), in the Work (i) in all territories +worldwide, (ii) for the maximum duration provided by applicable law or +treaty (including future time extensions), (iii) in any current or future +medium and for any number of copies, and (iv) for any purpose whatsoever, +including without limitation commercial, advertising or promotional +purposes (the "Waiver"). Affirmer makes the Waiver for the benefit of each +member of the public at large and to the detriment of Affirmer's heirs and +successors, fully intending that such Waiver shall not be subject to +revocation, rescission, cancellation, termination, or any other legal or +equitable action to disrupt the quiet enjoyment of the Work by the public +as contemplated by Affirmer's express Statement of Purpose. + +3. Public License Fallback. Should any part of the Waiver for any reason +be judged legally invalid or ineffective under applicable law, then the +Waiver shall be preserved to the maximum extent permitted taking into +account Affirmer's express Statement of Purpose. In addition, to the +extent the Waiver is so judged Affirmer hereby grants to each affected +person a royalty-free, non transferable, non sublicensable, non exclusive, +irrevocable and unconditional license to exercise Affirmer's Copyright and +Related Rights in the Work (i) in all territories worldwide, (ii) for the +maximum duration provided by applicable law or treaty (including future +time extensions), (iii) in any current or future medium and for any number +of copies, and (iv) for any purpose whatsoever, including without +limitation commercial, advertising or promotional purposes (the +"License"). The License shall be deemed effective as of the date CC0 was +applied by Affirmer to the Work. Should any part of the License for any +reason be judged legally invalid or ineffective under applicable law, such +partial invalidity or ineffectiveness shall not invalidate the remainder +of the License, and in such case Affirmer hereby affirms that he or she +will not (i) exercise any of his or her remaining Copyright and Related +Rights in the Work or (ii) assert any associated claims and causes of +action with respect to the Work, in either case contrary to Affirmer's +express Statement of Purpose. + +4. Limitations and Disclaimers. + + a. No trademark or patent rights held by Affirmer are waived, abandoned, + surrendered, licensed or otherwise affected by this document. + b. Affirmer offers the Work as-is and makes no representations or + warranties of any kind concerning the Work, express, implied, + statutory or otherwise, including without limitation warranties of + title, merchantability, fitness for a particular purpose, non + infringement, or the absence of latent or other defects, accuracy, or + the present or absence of errors, whether or not discoverable, all to + the greatest extent permissible under applicable law. + c. Affirmer disclaims responsibility for clearing rights of other persons + that may apply to the Work or any use thereof, including without + limitation any person's Copyright and Related Rights in the Work. + Further, Affirmer disclaims responsibility for obtaining any necessary + consents, permissions or other rights required for any use of the + Work. + d. Affirmer understands and acknowledges that Creative Commons is not a + party to this document and has no duty or obligation with respect to + this CC0 or use of the Work. + +-------------------------------------------------------------------------------- + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. diff --git a/Makefile b/Makefile new file mode 100644 index 000000000..1e1129fd6 --- /dev/null +++ b/Makefile @@ -0,0 +1,187 @@ +# +# Argon2 reference source code package - reference C implementations +# +# Copyright 2015 +# Daniel Dinu, Dmitry Khovratovich, Jean-Philippe Aumasson, and Samuel Neves +# +# You may use this work under the terms of a Creative Commons CC0 1.0 +# License/Waiver or the Apache Public License 2.0, at your option. The terms of +# these licenses can be found at: +# +# - CC0 1.0 Universal : http://creativecommons.org/publicdomain/zero/1.0 +# - Apache 2.0 : http://www.apache.org/licenses/LICENSE-2.0 +# +# You should have received a copy of both of these licenses along with this +# software. If not, they may be obtained at the above URLs. +# + +RUN = argon2 +BENCH = bench +GENKAT = genkat + +# Increment on an ABI breaking change +ABI_VERSION = 1 + +DIST = phc-winner-argon2 + +SRC = src/argon2.c src/core.c src/blake2/blake2b.c src/thread.c src/encoding.c +SRC_RUN = src/run.c +SRC_BENCH = src/bench.c +SRC_GENKAT = src/genkat.c +OBJ = $(SRC:.c=.o) + +CFLAGS += -std=c89 -O3 -Wall -g -Iinclude -Isrc + +ifeq ($(NO_THREADS), 1) +CFLAGS += -DARGON2_NO_THREADS +else +CFLAGS += -pthread +endif + +CI_CFLAGS := $(CFLAGS) -Werror=declaration-after-statement -D_FORTIFY_SOURCE=2 \ + -Wextra -Wno-type-limits -Werror -coverage -DTEST_LARGE_RAM + +OPTTARGET ?= native +OPTTEST := $(shell $(CC) -Iinclude -Isrc -march=$(OPTTARGET) src/opt.c -c \ + -o /dev/null 2>/dev/null; echo $$?) +# Detect compatible platform +ifneq ($(OPTTEST), 0) +$(info Building without optimizations) + SRC += src/ref.c +else +$(info Building with optimizations for $(OPTTARGET)) + CFLAGS += -march=$(OPTTARGET) + SRC += src/opt.c +endif + +BUILD_PATH := $(shell pwd) +KERNEL_NAME := $(shell uname -s) + +LIB_NAME=argon2 +ifeq ($(KERNEL_NAME), Linux) + LIB_EXT := so.$(ABI_VERSION) + LIB_CFLAGS := -shared -fPIC -fvisibility=hidden -DA2_VISCTL=1 + SO_LDFLAGS := -Wl,-soname,lib$(LIB_NAME).$(LIB_EXT) + LINKED_LIB_EXT := so +endif +ifeq ($(KERNEL_NAME), $(filter $(KERNEL_NAME),FreeBSD NetBSD OpenBSD)) + LIB_EXT := so + LIB_CFLAGS := -shared -fPIC +endif +ifeq ($(KERNEL_NAME), Darwin) + LIB_EXT := $(ABI_VERSION).dylib + LIB_CFLAGS := -dynamiclib -install_name @rpath/lib$(LIB_NAME).$(LIB_EXT) + LINKED_LIB_EXT := dylib +endif +ifeq ($(findstring CYGWIN, $(KERNEL_NAME)), CYGWIN) + LIB_EXT := dll + LIB_CFLAGS := -shared -Wl,--out-implib,lib$(LIB_NAME).$(LIB_EXT).a +endif +ifeq ($(findstring MINGW, $(KERNEL_NAME)), MINGW) + LIB_EXT := dll + LIB_CFLAGS := -shared -Wl,--out-implib,lib$(LIB_NAME).$(LIB_EXT).a +endif +ifeq ($(findstring MSYS, $(KERNEL_NAME)), MSYS) + LIB_EXT := dll + LIB_CFLAGS := -shared -Wl,--out-implib,lib$(LIB_NAME).$(LIB_EXT).a +endif +ifeq ($(KERNEL_NAME), SunOS) + CC := gcc + CFLAGS += -D_REENTRANT + LIB_EXT := so + LIB_CFLAGS := -shared -fPIC +endif + +ifeq ($(KERNEL_NAME), Linux) +ifeq ($(CC), clang) + CI_CFLAGS += -fsanitize=address -fsanitize=undefined +endif +endif + +LIB_SH := lib$(LIB_NAME).$(LIB_EXT) +LIB_ST := lib$(LIB_NAME).a + +ifdef LINKED_LIB_EXT +LINKED_LIB_SH := lib$(LIB_NAME).$(LINKED_LIB_EXT) +endif + + +LIBRARIES = $(LIB_SH) $(LIB_ST) +HEADERS = include/argon2.h + +INSTALL = install + +DESTDIR = +PREFIX = /usr +INCLUDE_REL = include +LIBRARY_REL = lib +BINARY_REL = bin + +INST_INCLUDE = $(DESTDIR)$(PREFIX)/$(INCLUDE_REL) +INST_LIBRARY = $(DESTDIR)$(PREFIX)/$(LIBRARY_REL) +INST_BINARY = $(DESTDIR)$(PREFIX)/$(BINARY_REL) + +.PHONY: clean dist format $(GENKAT) all install + +all: $(RUN) libs +libs: $(LIBRARIES) + +$(RUN): $(SRC) $(SRC_RUN) + $(CC) $(CFLAGS) $(LDFLAGS) $^ -o $@ + +$(BENCH): $(SRC) $(SRC_BENCH) + $(CC) $(CFLAGS) $^ -o $@ + +$(GENKAT): $(SRC) $(SRC_GENKAT) + $(CC) $(CFLAGS) $^ -o $@ -DGENKAT + +$(LIB_SH): $(SRC) + $(CC) $(CFLAGS) $(LIB_CFLAGS) $(LDFLAGS) $(SO_LDFLAGS) $^ -o $@ + +$(LIB_ST): $(OBJ) + ar rcs $@ $^ + +clean: + rm -f $(RUN) $(BENCH) $(GENKAT) + rm -f $(LIB_SH) $(LIB_ST) kat-argon2* + rm -f testcase + rm -rf *.dSYM + cd src/ && rm -f *.o + cd src/blake2/ && rm -f *.o + cd kats/ && rm -f kat-* diff* run_* make_* + +dist: + cd ..; \ + tar -c --exclude='.??*' -z -f $(DIST)-`date "+%Y%m%d"`.tgz $(DIST)/* + +test: $(SRC) src/test.c + $(CC) $(CFLAGS) -Wextra -Wno-type-limits $^ -o testcase + @sh kats/test.sh + ./testcase + +testci: $(SRC) src/test.c + $(CC) $(CI_CFLAGS) $^ -o testcase + @sh kats/test.sh + ./testcase + +.PHONY: test + +format: + clang-format -style="{BasedOnStyle: llvm, IndentWidth: 4}" \ + -i include/*.h src/*.c src/*.h src/blake2/*.c src/blake2/*.h + +install: $(RUN) libs + $(INSTALL) -d $(INST_INCLUDE) + $(INSTALL) -m 0644 $(HEADERS) $(INST_INCLUDE) + $(INSTALL) -d $(INST_LIBRARY) + $(INSTALL) $(LIBRARIES) $(INST_LIBRARY) +ifdef LINKED_LIB_SH + cd $(INST_LIBRARY) && ln -s $(notdir $(LIB_SH) $(LINKED_LIB_SH)) +endif + $(INSTALL) -d $(INST_BINARY) + $(INSTALL) $(RUN) $(INST_BINARY) + +uninstall: + cd $(INST_INCLUDE) && rm -f $(notdir $(HEADERS)) + cd $(INST_LIBRARY) && rm -f $(notdir $(LIBRARIES) $(LINKED_LIB_SH)) + cd $(INST_BINARY) && rm -f $(notdir $(RUN)) diff --git a/README.md b/README.md new file mode 100644 index 000000000..74cf17086 --- /dev/null +++ b/README.md @@ -0,0 +1,30 @@ +# Argon2 + +This is a fork of [the reference C implementation of Argon2](https://github.com/P-H-C/phc-winner-argon2), the password-hashing function that won the [Password Hashing Competition (PHC)](https://password-hashing.net). + +## About Argon2u + +In addition to the official three variants (Argon2i, Argon2d, and Argon2id), this fork also implements a fourth variant, Argon2u. It operates similarly to Argon2id, in that it is a hybrid of Argon2i and Argon2d. Where Argon2id uses Argon2i's algorithm for the first two processed segments, Argon2u does this for the first three. + +## More about Argon2 + +Please see the [original repository](https://github.com/P-H-C/phc-winner-argon2) for information about Argon2. + +## Intellectual property + +Except for the components listed below, the Argon2 code in this +repository is copyright (c) 2015 Daniel Dinu, Dmitry Khovratovich (main +authors), Jean-Philippe Aumasson and Samuel Neves, and dual licensed under the +[CC0 License](https://creativecommons.org/about/cc0) and the +[Apache 2.0 License](http://www.apache.org/licenses/LICENSE-2.0). For more info +see the LICENSE file. + +The string encoding routines in [`src/encoding.c`](src/encoding.c) are +copyright (c) 2015 Thomas Pornin, and under +[CC0 License](https://creativecommons.org/about/cc0). + +The BLAKE2 code in [`src/blake2/`](src/blake2) is copyright (c) Samuel +Neves, 2013-2015, and under +[CC0 License](https://creativecommons.org/about/cc0). + +All licenses are therefore GPL-compatible. diff --git a/appveyor.yml b/appveyor.yml new file mode 100644 index 000000000..fb1f048ef --- /dev/null +++ b/appveyor.yml @@ -0,0 +1,25 @@ +os: Visual Studio 2015 + +environment: + matrix: + - platform: x86 + configuration: Debug + - platform: x86 + configuration: Release + - platform: x64 + configuration: Debug + - platform: x64 + configuration: Release + +matrix: + fast_finish: false + +build: + parallel: true + project: Argon2.sln + verbosity: minimal + +test_script: + - ps: kats\test.ps1 + - ps: if ("Release" -eq $env:configuration) { vs2015\build\Argon2OptTestCI.exe } + - ps: if ("Release" -eq $env:configuration) { vs2015\build\Argon2RefTestCI.exe } diff --git a/argon2-specs.pdf b/argon2-specs.pdf new file mode 100644 index 0000000000000000000000000000000000000000..d916af6415c93ade373b61c9179f9928b2b1daa9 GIT binary patch literal 459608 zcmb5VLy#~)w`E(lZQHhO+phY`wr$(CZQHhOoBel3M|8jFJGd`LCvudt6>FcJqzWQp zw2XADP^9zABkNF%oU8;41a?N21Ux)Y^fIQl=FS!bjI2zY1pn(m(Tn}Fb~be+pck_? zbT$<+HMTP`h2rCba&mSwHMD_p-@MV1cG_Y?=si&Ez7Lk8J5Ac_Npe+Gzg}5JXL;?^k@b=5P_JyvWx8mg=9j;j!NIQmq`Gp}%^*L} zH6*vTTs(PP-)*vRR@D3*VC@v@>AOkip)m`?98tmeC=) zJ0tDwld7hLddl}WTe`fI^6y6f5Iej2LhZ6v_uxmKQ_Err&d!<5v>|P)Wjq`NlD&yI z!e07A;{tmLv9yGH$t7gA>+aYt5(2{lfs-XkbW}hQa{gjW5U$7lo20 zM`u%YjlJ$mDru008sz+}M^o-@?&fepNBze(?5ewUDyZb74&Ag8I&q~$*I>}UYB=UN zbh4{fvo~|b*3M3HwKlVs?vq=oEh?k-lmWWGWg-jnGo$4YoJ6uXh;p-~ab9;*e z0Gbr%0t;dX1f_ld1HNp%Mm0n#ZE}{$gaks!N(~~yb+63EtbKL?0(llvLx6aUOGXxf zj-(L|Rs^iS(|`nW+fv?8E!#6^Fe(ZcPaY{zf@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