diff --git a/Makefile b/Makefile index 885b5f2..934ca4d 100644 --- a/Makefile +++ b/Makefile @@ -1,10 +1,10 @@ .PHONY: build build: build-tfhe-rs-capi - cd packages/fhevm && go build . + cd pkg/fhevm && go build . .PHONY: test test: build-tfhe-rs-capi - cd packages/fhevm && go test -v . \ + cd pkg/fhevm && go test -v . \ && cd ../tfhe && go test -v . .PHONY: build-tfhe-rs-capi diff --git a/packages/go.mod b/go.mod similarity index 100% rename from packages/go.mod rename to go.mod diff --git a/packages/go.sum b/go.sum similarity index 100% rename from packages/go.sum rename to go.sum diff --git a/packages/crypto/crypto.go b/pkg/crypto/crypto.go similarity index 100% rename from packages/crypto/crypto.go rename to pkg/crypto/crypto.go diff --git a/packages/fhevm/contract.go b/pkg/fhevm/contract.go similarity index 100% rename from packages/fhevm/contract.go rename to pkg/fhevm/contract.go diff --git a/packages/fhevm/contracts_test.go b/pkg/fhevm/contracts_test.go similarity index 99% rename from packages/fhevm/contracts_test.go rename to pkg/fhevm/contracts_test.go index 6a0d6a5..31c2ca3 100644 --- a/packages/fhevm/contracts_test.go +++ b/pkg/fhevm/contracts_test.go @@ -15,7 +15,7 @@ import ( "github.com/ethereum/go-ethereum/core/vm" "github.com/ethereum/go-ethereum/crypto" "github.com/holiman/uint256" - "github.com/zama-ai/fhevm-go/tfhe" + "github.com/zama-ai/fhevm-go/pkg/tfhe" ) // generate keys if not present diff --git a/packages/fhevm/errors.go b/pkg/fhevm/errors.go similarity index 100% rename from packages/fhevm/errors.go rename to pkg/fhevm/errors.go diff --git a/packages/fhevm/evm.go b/pkg/fhevm/evm.go similarity index 97% rename from packages/fhevm/evm.go rename to pkg/fhevm/evm.go index dc0f1a9..b2901f2 100644 --- a/packages/fhevm/evm.go +++ b/pkg/fhevm/evm.go @@ -7,8 +7,8 @@ import ( "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/crypto" "github.com/holiman/uint256" - fhevm_crypto "github.com/zama-ai/fhevm-go/crypto" - "github.com/zama-ai/fhevm-go/tfhe" + fhevm_crypto "github.com/zama-ai/fhevm-go/pkg/crypto" + "github.com/zama-ai/fhevm-go/pkg/tfhe" ) var protectedStorageAddrCallerAddr common.Address diff --git a/packages/fhevm/fhelib.go b/pkg/fhevm/fhelib.go similarity index 100% rename from packages/fhevm/fhelib.go rename to pkg/fhevm/fhelib.go diff --git a/packages/fhevm/instructions.go b/pkg/fhevm/instructions.go similarity index 98% rename from packages/fhevm/instructions.go rename to pkg/fhevm/instructions.go index 2ea94b1..0bc9281 100644 --- a/packages/fhevm/instructions.go +++ b/pkg/fhevm/instructions.go @@ -8,8 +8,8 @@ import ( "github.com/ethereum/go-ethereum/common" crypto "github.com/ethereum/go-ethereum/crypto" "github.com/holiman/uint256" - fhevm_crypto "github.com/zama-ai/fhevm-go/crypto" - "github.com/zama-ai/fhevm-go/tfhe" + fhevm_crypto "github.com/zama-ai/fhevm-go/pkg/crypto" + "github.com/zama-ai/fhevm-go/pkg/tfhe" "go.opentelemetry.io/otel" ) diff --git a/packages/fhevm/instructions_test.go b/pkg/fhevm/instructions_test.go similarity index 99% rename from packages/fhevm/instructions_test.go rename to pkg/fhevm/instructions_test.go index 3a35155..fcf323c 100644 --- a/packages/fhevm/instructions_test.go +++ b/pkg/fhevm/instructions_test.go @@ -13,8 +13,8 @@ import ( "github.com/ethereum/go-ethereum/core/vm" "github.com/ethereum/go-ethereum/crypto" "github.com/holiman/uint256" - fhevm_crypto "github.com/zama-ai/fhevm-go/crypto" - "github.com/zama-ai/fhevm-go/tfhe" + fhevm_crypto "github.com/zama-ai/fhevm-go/pkg/crypto" + "github.com/zama-ai/fhevm-go/pkg/tfhe" ) func init() { diff --git a/packages/fhevm/interface.go b/pkg/fhevm/interface.go similarity index 98% rename from packages/fhevm/interface.go rename to pkg/fhevm/interface.go index 1698576..9d9522c 100644 --- a/packages/fhevm/interface.go +++ b/pkg/fhevm/interface.go @@ -6,7 +6,7 @@ import ( "github.com/ethereum/go-ethereum/common" "github.com/holiman/uint256" - "github.com/zama-ai/fhevm-go/tfhe" + "github.com/zama-ai/fhevm-go/pkg/tfhe" ) type EVMEnvironment interface { diff --git a/packages/fhevm/interpreter.go b/pkg/fhevm/interpreter.go similarity index 98% rename from packages/fhevm/interpreter.go rename to pkg/fhevm/interpreter.go index ae7a6bf..dfb7c7c 100644 --- a/packages/fhevm/interpreter.go +++ b/pkg/fhevm/interpreter.go @@ -2,7 +2,7 @@ package fhevm import ( "github.com/ethereum/go-ethereum/common" - "github.com/zama-ai/fhevm-go/tfhe" + "github.com/zama-ai/fhevm-go/pkg/tfhe" ) type ScopeContext interface { diff --git a/packages/fhevm/memory.go b/pkg/fhevm/memory.go similarity index 100% rename from packages/fhevm/memory.go rename to pkg/fhevm/memory.go diff --git a/packages/fhevm/operators_arithmetic.go b/pkg/fhevm/operators_arithmetic.go similarity index 100% rename from packages/fhevm/operators_arithmetic.go rename to pkg/fhevm/operators_arithmetic.go diff --git a/packages/fhevm/operators_arithmetic_gas.go b/pkg/fhevm/operators_arithmetic_gas.go similarity index 100% rename from packages/fhevm/operators_arithmetic_gas.go rename to pkg/fhevm/operators_arithmetic_gas.go diff --git a/packages/fhevm/operators_bit.go b/pkg/fhevm/operators_bit.go similarity index 100% rename from packages/fhevm/operators_bit.go rename to pkg/fhevm/operators_bit.go diff --git a/packages/fhevm/operators_bit_gas.go b/pkg/fhevm/operators_bit_gas.go similarity index 100% rename from packages/fhevm/operators_bit_gas.go rename to pkg/fhevm/operators_bit_gas.go diff --git a/packages/fhevm/operators_comparison.go b/pkg/fhevm/operators_comparison.go similarity index 99% rename from packages/fhevm/operators_comparison.go rename to pkg/fhevm/operators_comparison.go index e3a67c8..22a6b24 100644 --- a/packages/fhevm/operators_comparison.go +++ b/pkg/fhevm/operators_comparison.go @@ -5,7 +5,7 @@ import ( "errors" "github.com/ethereum/go-ethereum/common" - "github.com/zama-ai/fhevm-go/tfhe" + "github.com/zama-ai/fhevm-go/pkg/tfhe" "go.opentelemetry.io/otel/trace" ) diff --git a/packages/fhevm/operators_comparison_gas.go b/pkg/fhevm/operators_comparison_gas.go similarity index 99% rename from packages/fhevm/operators_comparison_gas.go rename to pkg/fhevm/operators_comparison_gas.go index cd9f320..33076b6 100644 --- a/packages/fhevm/operators_comparison_gas.go +++ b/pkg/fhevm/operators_comparison_gas.go @@ -3,7 +3,7 @@ package fhevm import ( "encoding/hex" - "github.com/zama-ai/fhevm-go/tfhe" + "github.com/zama-ai/fhevm-go/pkg/tfhe" ) func fheLeRequiredGas(environment EVMEnvironment, input []byte) uint64 { diff --git a/packages/fhevm/operators_crypto.go b/pkg/fhevm/operators_crypto.go similarity index 99% rename from packages/fhevm/operators_crypto.go rename to pkg/fhevm/operators_crypto.go index f5717af..34b287f 100644 --- a/packages/fhevm/operators_crypto.go +++ b/pkg/fhevm/operators_crypto.go @@ -10,8 +10,8 @@ import ( "time" "github.com/ethereum/go-ethereum/common" - "github.com/zama-ai/fhevm-go/kms" - "github.com/zama-ai/fhevm-go/tfhe" + "github.com/zama-ai/fhevm-go/pkg/kms" + "github.com/zama-ai/fhevm-go/pkg/tfhe" "go.opentelemetry.io/otel/trace" "google.golang.org/grpc" "google.golang.org/grpc/credentials/insecure" diff --git a/packages/fhevm/operators_crypto_gas.go b/pkg/fhevm/operators_crypto_gas.go similarity index 99% rename from packages/fhevm/operators_crypto_gas.go rename to pkg/fhevm/operators_crypto_gas.go index d38adb6..e02ac53 100644 --- a/packages/fhevm/operators_crypto_gas.go +++ b/pkg/fhevm/operators_crypto_gas.go @@ -4,7 +4,7 @@ import ( "encoding/hex" "github.com/ethereum/go-ethereum/common" - "github.com/zama-ai/fhevm-go/tfhe" + "github.com/zama-ai/fhevm-go/pkg/tfhe" ) func verifyCiphertextRequiredGas(environment EVMEnvironment, input []byte) uint64 { diff --git a/packages/fhevm/operators_rand.go b/pkg/fhevm/operators_rand.go similarity index 98% rename from packages/fhevm/operators_rand.go rename to pkg/fhevm/operators_rand.go index 7620e9b..9795983 100644 --- a/packages/fhevm/operators_rand.go +++ b/pkg/fhevm/operators_rand.go @@ -11,8 +11,8 @@ import ( "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/crypto" "github.com/holiman/uint256" - fhevm_crypto "github.com/zama-ai/fhevm-go/crypto" - "github.com/zama-ai/fhevm-go/tfhe" + fhevm_crypto "github.com/zama-ai/fhevm-go/pkg/crypto" + "github.com/zama-ai/fhevm-go/pkg/tfhe" "go.opentelemetry.io/otel/trace" "golang.org/x/crypto/chacha20" ) diff --git a/packages/fhevm/operators_rand_gas.go b/pkg/fhevm/operators_rand_gas.go similarity index 97% rename from packages/fhevm/operators_rand_gas.go rename to pkg/fhevm/operators_rand_gas.go index 455a012..fc921fc 100644 --- a/packages/fhevm/operators_rand_gas.go +++ b/pkg/fhevm/operators_rand_gas.go @@ -6,7 +6,7 @@ import ( "math/bits" "github.com/holiman/uint256" - "github.com/zama-ai/fhevm-go/tfhe" + "github.com/zama-ai/fhevm-go/pkg/tfhe" ) func fheRandRequiredGas(environment EVMEnvironment, input []byte) uint64 { diff --git a/packages/fhevm/otel.go b/pkg/fhevm/otel.go similarity index 96% rename from packages/fhevm/otel.go rename to pkg/fhevm/otel.go index 147122d..73f21c0 100644 --- a/packages/fhevm/otel.go +++ b/pkg/fhevm/otel.go @@ -3,7 +3,7 @@ package fhevm import ( "math/big" - "github.com/zama-ai/fhevm-go/tfhe" + "github.com/zama-ai/fhevm-go/pkg/tfhe" "go.opentelemetry.io/otel/attribute" "go.opentelemetry.io/otel/trace" ) diff --git a/packages/fhevm/params.go b/pkg/fhevm/params.go similarity index 99% rename from packages/fhevm/params.go rename to pkg/fhevm/params.go index d0ec2a4..45a6b40 100644 --- a/packages/fhevm/params.go +++ b/pkg/fhevm/params.go @@ -1,6 +1,6 @@ package fhevm -import "github.com/zama-ai/fhevm-go/tfhe" +import "github.com/zama-ai/fhevm-go/pkg/tfhe" // This file contains default gas costs of fhEVM-related operations. // Users can change the values based on specific requirements in their blockchain. diff --git a/packages/fhevm/precompiles.go b/pkg/fhevm/precompiles.go similarity index 100% rename from packages/fhevm/precompiles.go rename to pkg/fhevm/precompiles.go diff --git a/packages/fhevm/protected_storage.go b/pkg/fhevm/protected_storage.go similarity index 98% rename from packages/fhevm/protected_storage.go rename to pkg/fhevm/protected_storage.go index a709122..b0f3f0d 100644 --- a/packages/fhevm/protected_storage.go +++ b/pkg/fhevm/protected_storage.go @@ -7,8 +7,8 @@ import ( "github.com/ethereum/go-ethereum/common" crypto "github.com/ethereum/go-ethereum/crypto" "github.com/holiman/uint256" - fhevm_crypto "github.com/zama-ai/fhevm-go/crypto" - "github.com/zama-ai/fhevm-go/tfhe" + fhevm_crypto "github.com/zama-ai/fhevm-go/pkg/crypto" + "github.com/zama-ai/fhevm-go/pkg/tfhe" ) // An arbitrary constant value to flag locations in protected storage. diff --git a/packages/fhevm/stack.go b/pkg/fhevm/stack.go similarity index 100% rename from packages/fhevm/stack.go rename to pkg/fhevm/stack.go diff --git a/packages/kms/constants.go b/pkg/kms/constants.go similarity index 100% rename from packages/kms/constants.go rename to pkg/kms/constants.go diff --git a/packages/kms/kms.pb.go b/pkg/kms/kms.pb.go similarity index 100% rename from packages/kms/kms.pb.go rename to pkg/kms/kms.pb.go diff --git a/packages/kms/kms_grpc.pb.go b/pkg/kms/kms_grpc.pb.go similarity index 100% rename from packages/kms/kms_grpc.pb.go rename to pkg/kms/kms_grpc.pb.go diff --git a/packages/tfhe/tfhe_ciphertext.go b/pkg/tfhe/tfhe_ciphertext.go similarity index 100% rename from packages/tfhe/tfhe_ciphertext.go rename to pkg/tfhe/tfhe_ciphertext.go diff --git a/packages/tfhe/tfhe_key_management.go b/pkg/tfhe/tfhe_key_management.go similarity index 100% rename from packages/tfhe/tfhe_key_management.go rename to pkg/tfhe/tfhe_key_management.go diff --git a/packages/tfhe/tfhe_test.go b/pkg/tfhe/tfhe_test.go similarity index 100% rename from packages/tfhe/tfhe_test.go rename to pkg/tfhe/tfhe_test.go diff --git a/packages/tfhe/tfhe_wrappers.c b/pkg/tfhe/tfhe_wrappers.c similarity index 100% rename from packages/tfhe/tfhe_wrappers.c rename to pkg/tfhe/tfhe_wrappers.c diff --git a/packages/tfhe/tfhe_wrappers.go b/pkg/tfhe/tfhe_wrappers.go similarity index 100% rename from packages/tfhe/tfhe_wrappers.go rename to pkg/tfhe/tfhe_wrappers.go diff --git a/packages/tfhe/tfhe_wrappers.h b/pkg/tfhe/tfhe_wrappers.h similarity index 100% rename from packages/tfhe/tfhe_wrappers.h rename to pkg/tfhe/tfhe_wrappers.h diff --git a/proto/kms.proto b/proto/kms.proto index dff572e..2cd6a98 100644 --- a/proto/kms.proto +++ b/proto/kms.proto @@ -1,6 +1,6 @@ syntax = "proto3"; package kms; -option go_package = "github.com/zama-ai/fhevm-go/kms"; +option go_package = "github.com/zama-ai/fhevm-go/pkg/kms"; service KmsEndpoint { rpc Validate_and_decrypt(DecryptionRequest) returns (DecryptionResponse);