Files
icicle/wrappers/golang/internal/generator/curves/templates/curve.h.tmpl
2024-07-04 11:03:58 +02:00

28 lines
1.5 KiB
Cheetah

#include <cuda_runtime.h>
#include <stdbool.h>
#ifndef _{{toUpper .Curve}}_{{.CurvePrefix}}CURVE_H
#define _{{toUpper .Curve}}_{{.CurvePrefix}}CURVE_H
#ifdef __cplusplus
extern "C" {
#endif
typedef struct {{toCName .CurvePrefix}}projective_t {{toCName .CurvePrefix}}projective_t;
typedef struct {{toCName .CurvePrefix}}affine_t {{toCName .CurvePrefix}}affine_t;
typedef struct DeviceContext DeviceContext;
bool {{.Curve}}{{toCNameBackwards .CurvePrefix}}_eq({{toCName .CurvePrefix}}projective_t* point1, {{toCName .CurvePrefix}}projective_t* point2);
void {{.Curve}}{{toCNameBackwards .CurvePrefix}}_to_affine({{toCName .CurvePrefix}}projective_t* point, {{toCName .CurvePrefix}}affine_t* point_out);
void {{.Curve}}{{toCNameBackwards .CurvePrefix}}_from_affine({{toCName .CurvePrefix}}affine_t* point, {{toCName .CurvePrefix}}projective_t* point_out);
void {{.Curve}}{{toCNameBackwards .CurvePrefix}}_generate_projective_points({{toCName .CurvePrefix}}projective_t* points, int size);
void {{.Curve}}{{toCNameBackwards .CurvePrefix}}_generate_affine_points({{toCName .CurvePrefix}}affine_t* points, int size);
cudaError_t {{.Curve}}{{toCNameBackwards .CurvePrefix}}_affine_convert_montgomery({{toCName .CurvePrefix}}affine_t* points, size_t n, bool is_into, DeviceContext* ctx);
cudaError_t {{.Curve}}{{toCNameBackwards .CurvePrefix}}_projective_convert_montgomery({{toCName .CurvePrefix}}projective_t* points, size_t n, bool is_into, DeviceContext* ctx);
#ifdef __cplusplus
}
#endif
#endif