github.com/consensys/gnark@v0.11.0/internal/generator/backend/template/imports.go.tmpl (about)

     1  {{- define "import_fr" }}
     2  	{{- if eq .Curve "tinyfield"}}
     3  	fr "github.com/consensys/gnark/internal/tinyfield"	
     4  	{{- else}}
     5  	"github.com/consensys/gnark-crypto/ecc/{{toLower .Curve}}/fr"
     6  	{{- end}}
     7  {{- end }}
     8  
     9  {{- define "import_fp" }}
    10  	{{- if eq .Curve "tinyfield"}}
    11  	fr "github.com/consensys/gnark/internal/tinyfield"
    12  	{{- else}}
    13  	"github.com/consensys/gnark-crypto/ecc/{{toLower .Curve}}/fp"
    14  	{{- end}}
    15  {{- end }}
    16  
    17  
    18  {{- define "import_fri" }}
    19  	"github.com/consensys/gnark-crypto/ecc/{{toLower .Curve}}/fr/fri"
    20  {{- end}}
    21  
    22  {{- define "import_curve" }}
    23  	{{- if ne .Curve "tinyfield"}}
    24  	curve "github.com/consensys/gnark-crypto/ecc/{{toLower .Curve}}"
    25  	{{- else }}
    26  	"github.com/consensys/gnark-crypto/ecc"
    27  	{{- end}}
    28  {{- end }}
    29  
    30  {{- define "import_backend_cs" }}
    31  	{{- if eq .Curve "tinyfield"}}
    32  	"github.com/consensys/gnark/constraint/tinyfield"
    33  	{{- else}}
    34  	cs "github.com/consensys/gnark/constraint/{{toLower .Curve}}"
    35  	{{- end}}
    36  {{- end }}
    37  
    38  {{- define "import_fft" }}
    39  	"github.com/consensys/gnark-crypto/ecc/{{toLower .Curve}}/fr/fft"
    40  {{- end }}
    41  
    42  {{- define "import_witness" }}
    43  	{{- if eq .Curve "tinyfield"}}
    44  	{{toLower .CurveID}}witness "github.com/consensys/gnark/internal/tinyfield/witness"
    45  	{{- else}}
    46  	{{toLower .CurveID}}witness "github.com/consensys/gnark/internal/backend/{{toLower .Curve}}/witness"
    47  	{{- end}}
    48  {{- end }}
    49  
    50  {{- define "import_groth16" }}
    51  	{{toLower .CurveID}}groth16 "github.com/consensys/gnark/internal/backend/{{toLower .Curve}}/groth16"
    52  {{- end }}
    53  
    54  {{- define "import_plonk" }}
    55  	{{toLower .CurveID}}plonk "github.com/consensys/gnark/internal/backend/{{toLower .Curve}}/plonk"
    56  {{- end }}
    57  
    58  {{- define "import_polynomial" }}
    59  	"github.com/consensys/gnark-crypto/ecc/{{ toLower .Curve }}/fr/polynomial"
    60  {{- end }}
    61  
    62  {{- define "import_kzg" }}
    63  	"github.com/consensys/gnark-crypto/ecc/{{ toLower .Curve }}/kzg"
    64  {{- end }}
    65  
    66  {{- define "import_pedersen"}}
    67  	"github.com/consensys/gnark-crypto/ecc/{{ toLower .Curve }}/fr/pedersen"
    68  {{- end}}
    69  
    70  {{- define "import_gkr"}}
    71  	"github.com/consensys/gnark-crypto/ecc/{{ toLower .Curve }}/fr/gkr"
    72  {{- end}}
    73  
    74  {{- define "import_hash_to_field" }}
    75  	"github.com/consensys/gnark-crypto/ecc/{{ toLower .Curve}}/fr/hash_to_field"
    76  {{- end}}