Skip to content
This repository has been archived by the owner on Dec 23, 2024. It is now read-only.

Commit

Permalink
chore: format
Browse files Browse the repository at this point in the history
  • Loading branch information
immortal-tofu committed Mar 5, 2024
1 parent 1b958f6 commit 3af30de
Show file tree
Hide file tree
Showing 12 changed files with 126 additions and 136 deletions.
1 change: 0 additions & 1 deletion pkg/fhevm/operators_arithmetic.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import (
"go.opentelemetry.io/otel/trace"
)


func fheAddRun(environment EVMEnvironment, caller common.Address, addr common.Address, input []byte, readOnly bool, runSpan trace.Span) ([]byte, error) {
input = input[:minInt(65, len(input))]

Expand Down
2 changes: 1 addition & 1 deletion pkg/fhevm/operators_arithmetic_gas.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,4 +108,4 @@ func fheRemRequiredGas(environment EVMEnvironment, input []byte) uint64 {
}
return environment.FhevmParams().GasCosts.FheScalarRem[lhs.fheUintType()]
}
}
}
2 changes: 0 additions & 2 deletions pkg/fhevm/operators_bit.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,6 @@ func fheShrRun(environment EVMEnvironment, caller common.Address, addr common.Ad
}
}


func fheNegRun(environment EVMEnvironment, caller common.Address, addr common.Address, input []byte, readOnly bool, runSpan trace.Span) ([]byte, error) {
input = input[:minInt(32, len(input))]

Expand Down Expand Up @@ -215,7 +214,6 @@ func fheNotRun(environment EVMEnvironment, caller common.Address, addr common.Ad
return resultHash[:], nil
}


func fheBitAndRun(environment EVMEnvironment, caller common.Address, addr common.Address, input []byte, readOnly bool, runSpan trace.Span) ([]byte, error) {
input = input[:minInt(65, len(input))]

Expand Down
1 change: 0 additions & 1 deletion pkg/fhevm/operators_bit_gas.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ func fheShrRequiredGas(environment EVMEnvironment, input []byte) uint64 {
return fheShlRequiredGas(environment, input)
}


func fheNegRequiredGas(environment EVMEnvironment, input []byte) uint64 {
input = input[:minInt(32, len(input))]

Expand Down
3 changes: 0 additions & 3 deletions pkg/fhevm/operators_comparison.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import (
"go.opentelemetry.io/otel/trace"
)


func fheLeRun(environment EVMEnvironment, caller common.Address, addr common.Address, input []byte, readOnly bool, runSpan trace.Span) ([]byte, error) {
input = input[:minInt(65, len(input))]

Expand Down Expand Up @@ -406,7 +405,6 @@ func fheNeRun(environment EVMEnvironment, caller common.Address, addr common.Add
}
}


func fheMinRun(environment EVMEnvironment, caller common.Address, addr common.Address, input []byte, readOnly bool, runSpan trace.Span) ([]byte, error) {
input = input[:minInt(65, len(input))]

Expand Down Expand Up @@ -539,7 +537,6 @@ func fheMaxRun(environment EVMEnvironment, caller common.Address, addr common.Ad
}
}


func fheIfThenElseRun(environment EVMEnvironment, caller common.Address, addr common.Address, input []byte, readOnly bool, runSpan trace.Span) ([]byte, error) {
input = input[:minInt(96, len(input))]

Expand Down
2 changes: 0 additions & 2 deletions pkg/fhevm/operators_comparison_gas.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ func fheNeRequiredGas(environment EVMEnvironment, input []byte) uint64 {
return fheEqRequiredGas(environment, input)
}


func fheMinRequiredGas(environment EVMEnvironment, input []byte) uint64 {
input = input[:minInt(65, len(input))]

Expand Down Expand Up @@ -123,7 +122,6 @@ func fheMaxRequiredGas(environment EVMEnvironment, input []byte) uint64 {
return fheMinRequiredGas(environment, input)
}


func fheIfThenElseRequiredGas(environment EVMEnvironment, input []byte) uint64 {
input = input[:minInt(96, len(input))]

Expand Down
1 change: 0 additions & 1 deletion pkg/fhevm/operators_crypto.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import (
"google.golang.org/grpc/credentials/insecure"
)


func verifyCiphertextRun(environment EVMEnvironment, caller common.Address, addr common.Address, input []byte, readOnly bool, runSpan trace.Span) ([]byte, error) {
logger := environment.GetLogger()
// first 32 bytes of the payload is offset, then 32 bytes are size of byte array
Expand Down
8 changes: 4 additions & 4 deletions pkg/fhevm/params.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ func DefaultGasCosts() GasCosts {
tfhe.FheUint64: 500000,
},
FheBitwiseOp: map[tfhe.FheUintType]uint64{
tfhe.FheBool: 16000 + AdjustFHEGas,
tfhe.FheBool: 16000 + AdjustFHEGas,
tfhe.FheUint4: 22000 + AdjustFHEGas,
tfhe.FheUint8: 24000 + AdjustFHEGas,
tfhe.FheUint16: 24000 + AdjustFHEGas,
Expand Down Expand Up @@ -177,23 +177,23 @@ func DefaultGasCosts() GasCosts {
},
// TODO: Costs will depend on the complexity of doing reencryption/decryption by the oracle.
FheReencrypt: map[tfhe.FheUintType]uint64{
tfhe.FheBool: 1000,
tfhe.FheBool: 1000,
tfhe.FheUint4: 1000,
tfhe.FheUint8: 1000,
tfhe.FheUint16: 1100,
tfhe.FheUint32: 1200,
},
// As of now, verification costs only cover ciphertext deserialization and assume there is no ZKPoK to verify.
FheVerify: map[tfhe.FheUintType]uint64{
tfhe.FheBool: 200,
tfhe.FheBool: 200,
tfhe.FheUint4: 200,
tfhe.FheUint8: 200,
tfhe.FheUint16: 300,
tfhe.FheUint32: 400,
tfhe.FheUint64: 800,
},
FheTrivialEncrypt: map[tfhe.FheUintType]uint64{
tfhe.FheBool: 100,
tfhe.FheBool: 100,
tfhe.FheUint4: 100,
tfhe.FheUint8: 100,
tfhe.FheUint16: 200,
Expand Down
2 changes: 1 addition & 1 deletion pkg/kms/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ package kms
import "os"

// URL of the KMS gRPC endpoint
var KmsEndpointAddr = os.Getenv("KMS_ENDPOINT_ADDR")
var KmsEndpointAddr = os.Getenv("KMS_ENDPOINT_ADDR")
Loading

0 comments on commit 3af30de

Please sign in to comment.