Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

golang v3 wrappers #564

Closed
wants to merge 48 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
f08b5bb
fixed fromAffine and toProj in golang
vladfdp Jul 3, 2024
9e057c8
fixed to_projective in rust
vladfdp Jul 3, 2024
17732ea
use zero method of projective in fromAffine
vladfdp Jul 3, 2024
81644fc
use zero method of projective in toProjective
vladfdp Jul 3, 2024
279cdc6
generated go files
vladfdp Jul 3, 2024
6336e74
refactor from_affine with C link
vladfdp Jul 4, 2024
fb707d5
Merge branch 'main' into feat/vlad/refactor-from-affine
vladfdp Jul 5, 2024
e4eda89
go fmt
vladfdp Jul 5, 2024
46e6c20
go fmt
vladfdp Jul 5, 2024
91ac666
Merge branch 'feat/vlad/refactor-from-affine' of github.com:ingonyama…
vladfdp Jul 15, 2024
877018c
more go fmt
vladfdp Jul 15, 2024
53f34aa
Fix typos (#558)
omahs Jul 18, 2024
8411ed1
Feat/vlad/refactor from affine (#554)
vladfdp Jul 22, 2024
3ac9811
Fix typos (#558)
omahs Jul 18, 2024
1eb6a7e
fixed fromAffine and toProj in golang
vladfdp Jul 3, 2024
d2f8c30
use zero method of projective in fromAffine
vladfdp Jul 3, 2024
0d22e9b
use zero method of projective in toProjective
vladfdp Jul 3, 2024
a7ca5dd
generated go files
vladfdp Jul 3, 2024
c7863d4
refactor from_affine with C link
vladfdp Jul 4, 2024
01b1dde
babybear v3 bindings
nonam3e Jul 16, 2024
fb971bb
msm golang wrappers
nonam3e Jul 20, 2024
7476f6f
msm tests
nonam3e Jul 23, 2024
572aa23
bn254 tests pass
nonam3e Jul 25, 2024
43dc99d
test generators
nonam3e Jul 25, 2024
0cb0b49
Add Sha3 (#560)
ChickenLover Jul 28, 2024
65d6671
ci and build script
nonam3e Jul 28, 2024
8852c9b
rust fmt
nonam3e Jul 28, 2024
88cfe1b
ci
nonam3e Jul 29, 2024
10f472c
Merge remote-tracking branch 'origin' into nonam3e/V3
nonam3e Jul 29, 2024
8d17a9b
Merge branch 'yshekel/V3' into nonam3e/V3
nonam3e Jul 29, 2024
957c79d
ci without cuda
nonam3e Jul 29, 2024
ce7ca31
ci fix
nonam3e Jul 31, 2024
7da5d76
clang-format
nonam3e Jul 31, 2024
3c9a0ea
cuda backend pull attempt
nonam3e Jul 31, 2024
454dbd0
ci cuda checkout step
nonam3e Jul 31, 2024
b9f3e12
Merge remote-tracking branch 'origin/yshekel/V3' into nonam3e/V3
nonam3e Jul 31, 2024
a73c150
smaller batch size
nonam3e Aug 1, 2024
3a5c2d9
tests
nonam3e Aug 1, 2024
9854bb2
tests
nonam3e Aug 1, 2024
96898de
Merge remote-tracking branch 'origin/yshekel/V3' into nonam3e/V3
nonam3e Aug 19, 2024
47bf7c6
update poseidon.md
nonam3e Aug 19, 2024
2f59425
skip cpu precompute test
nonam3e Aug 19, 2024
674c37f
Merge remote-tracking branch 'origin/yshekel/V3' into nonam3e/V3
nonam3e Aug 19, 2024
9b00697
fix typos
nonam3e Aug 19, 2024
9f08507
cargo fmt
nonam3e Aug 19, 2024
e5dc550
Merge remote-tracking branch 'origin/yshekel/V3' into nonam3e/V3
nonam3e Aug 19, 2024
a044618
change constant name
nonam3e Aug 19, 2024
a61df72
Merge branch 'yshekel/V3' into nonam3e/V3
nonam3e Aug 22, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
205 changes: 205 additions & 0 deletions .github/workflows/v3_golang.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,205 @@
name: GoLang
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rename to golang without v3_golang


on:
pull_request:
branches:
- V3
- yshekel/V3 # TODO remove when merged to V3
push:
branches:
- V3

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
check-changed-files:
uses: ./.github/workflows/check-changed-files.yml

check-format:
name: Check Code Format
runs-on: ubuntu-22.04
needs: check-changed-files
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup go
uses: actions/setup-go@v5
with:
go-version: '1.20.0'
- name: Check gofmt
if: needs.check-changed-files.outputs.golang == 'true'
run: if [[ $(go list ./... | xargs go fmt) ]]; then echo "Please run go fmt"; exit 1; fi

extract-cuda-backend-branch:
name: Extract cuda branch name
runs-on: ubuntu-22.04
outputs:
cuda-backend-branch: ${{ steps.extract.outputs.cuda-backend-branch }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Extract Private Branch from PR Description
id: extract
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
DESCRIPTION=$(gh pr view ${{ github.event.pull_request.number }} --json body -q '.body')
echo "PR Description: $DESCRIPTION"
CUDA_BE_BRANCH=$(echo "$DESCRIPTION" | grep -oP 'cuda-backend-branch:\s*\K[^\s]+') || true
if [ -z "$CUDA_BE_BRANCH" ]; then
CUDA_BE_BRANCH="main" # Default branch if not specified
fi
echo "Extracted CUDA Backend Branch: $CUDA_BE_BRANCH"
echo "::set-output name=cuda-backend-branch::$CUDA_BE_BRANCH"

build-curves-linux:
name: Build and test curves on Linux
runs-on: [self-hosted, Linux, X64, icicle]
needs: [check-changed-files, check-format, extract-cuda-backend-branch]
strategy:
matrix:
curve:
- name: bn254
build_args: -g2 -ecntt
- name: bls12_381
build_args: -g2 -ecntt
- name: bls12_377
build_args: -g2 -ecntt
- name: bw6_761
build_args: -g2 -ecntt
- name: grumpkin
build_args:
steps:
- name: Checkout Repo
uses: actions/checkout@v4
- name: Checkout CUDA Backend
uses: actions/checkout@v4
with:
repository: ingonyama-zk/icicle-cuda-backend
path: ./icicle_v3/backend/cuda
token: ${{ secrets.GITHUB_TOKEN }}
ssh-key: ${{ secrets.CUDA_PULL_KEY }}
ref: ${{ needs.extract-branch.outputs.cuda-backend-branch }}
- name: Setup go
uses: actions/setup-go@v5
with:
go-version: '1.20.0'
- name: Build
working-directory: ./wrappers/golang_v3
if: needs.check-changed-files.outputs.golang == 'true' || needs.check-changed-files.outputs.cpp_cuda == 'true'
# builds a single curve with the curve's specified build args
run: |
export DEFAULT_BACKEND_INSTALL_DIR=$PWD/../../build/
./build.sh -curve=${{ matrix.curve.name }} ${{ matrix.curve.build_args }} -cuda_backend=local
- name: Test
working-directory: ./wrappers/golang_v3/curves
if: needs.check-changed-files.outputs.golang == 'true' || needs.check-changed-files.outputs.cpp_cuda == 'true'
run: |
CURVE=$(echo ${{ matrix.curve.name }} | sed -e 's/_//g')
export CPATH=$CPATH:/usr/local/cuda/include
export DEFAULT_BACKEND_INSTALL_DIR=$PWD/../../../build/
go test ./$CURVE/tests -count=1 -failfast -p 2 -timeout 60m -v

build-fields-linux:
name: Build and test fields on Linux
runs-on: [self-hosted, Linux, X64, icicle]
needs: [check-changed-files, check-format, extract-cuda-backend-branch]
strategy:
matrix:
field:
- name: babybear
build_args: -field-ext
steps:
- name: Checkout Repo
uses: actions/checkout@v4
- name: Checkout CUDA Backend
uses: actions/checkout@v4
with:
repository: ingonyama-zk/icicle-cuda-backend
path: ./icicle_v3/backend/cuda
token: ${{ secrets.GITHUB_TOKEN }}
ssh-key: ${{ secrets.CUDA_PULL_KEY }}
ref: ${{ needs.extract-branch.outputs.cuda-backend-branch }}
- name: Setup go
uses: actions/setup-go@v5
with:
go-version: '1.20.0'
- name: Build
working-directory: ./wrappers/golang_v3
if: needs.check-changed-files.outputs.golang == 'true' || needs.check-changed-files.outputs.cpp_cuda == 'true'
# builds a single field with the fields specified build args
run: |
export DEFAULT_BACKEND_INSTALL_DIR=$PWD/../../build/
./build.sh -field=${{ matrix.field.name }} ${{ matrix.field.build_args }} -cuda_backend=local
- name: Test
working-directory: ./wrappers/golang_v3/fields
if: needs.check-changed-files.outputs.golang == 'true' || needs.check-changed-files.outputs.cpp_cuda == 'true'
run: |
FIELD=$(echo ${{ matrix.field.name }} | sed -e 's/_//g')
export CPATH=$CPATH:/usr/local/cuda/include
export DEFAULT_BACKEND_INSTALL_DIR=$PWD/../../../build/
go test ./$FIELD/tests -count=1 -failfast -p 2 -timeout 60m -v

# build-hashes-linux:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are hashes not supported in v3 rn? This specific check only runs keccak

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we don't have hashes in v3 for now

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lets remove this for now then

# name: Build and test hashes on Linux
# runs-on: [self-hosted, Linux, X64, icicle]
# needs: [check-changed-files, check-format]
# strategy:
# matrix:
# hash:
# - name: keccak
# build_args:
# steps:
# - name: Checkout Repo
# uses: actions/checkout@v4
# - name: Setup go
# uses: actions/setup-go@v5
# with:
# go-version: '1.20.0'
# - name: Build
# working-directory: ./wrappers/golang_v3
# if: needs.check-changed-files.outputs.golang == 'true' || needs.check-changed-files.outputs.cpp_cuda == 'true'
# # builds a single hash algorithm with the hash's specified build args
# run: ./build.sh -hash=${{ matrix.hash.name }} ${{ matrix.hash.build_args }}
# - name: Test
# working-directory: ./wrappers/golang_v3/hash
# if: needs.check-changed-files.outputs.golang == 'true' || needs.check-changed-files.outputs.cpp_cuda == 'true'
# run: |
# HASH=$(echo ${{ matrix.hash.name }} | sed -e 's/_//g')
# export CPATH=$CPATH:/usr/local/cuda/include
# go test ./$HASH/tests -count=1 -failfast -p 2 -timeout 60m -v

# TODO: bw6 on windows requires more memory than the standard runner has
# Add a large runner and then enable this job
# build-windows:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about the Windows build? Should'nt we just remove this at this point?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

➕ for removing

# name: Build on Windows
# runs-on: windows-2022
# needs: [check-changed-files, check-format]
# strategy:
# matrix:
# curve: [bn254, bls12_381, bls12_377, bw6_761]
# steps:
# - name: Checkout Repo
# uses: actions/checkout@v4
# - name: Setup go
# uses: actions/setup-go@v5
# with:
# go-version: '1.20.0'
# - name: Download and Install Cuda
# if: needs.check-changed-files.outputs.golang == 'true' || needs.check-changed-files.outputs.cpp_cuda == 'true'
# id: cuda-toolkit
# uses: Jimver/[email protected]
# with:
# cuda: '12.0.0'
# method: 'network'
# # https://docs.nvidia.com/cuda/archive/12.0.0/cuda-installation-guide-microsoft-windows/index.html
# sub-packages: '["cudart", "nvcc", "thrust", "visual_studio_integration"]'
# - name: Build libs
# if: needs.check-changed-files.outputs.golang == 'true' || needs.check-changed-files.outputs.cpp_cuda == 'true'
# working-directory: ./wrappers/golang
# env:
# CUDA_PATH: ${{ steps.cuda-toolkit.outputs.CUDA_PATH }}
# shell: pwsh
# run: ./build.ps1 ${{ matrix.curve }} ON # builds a single curve with G2 enabled
2 changes: 1 addition & 1 deletion .github/workflows/v3_rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
uses: actions/checkout@v4
- name: Check rustfmt
if: needs.check-changed-files.outputs.rust == 'true' || needs.check-changed-files.outputs.cpp_cuda == 'true'
working-directory: ./wrappers/rust
working-directory: ./wrappers/rust_v3
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove

# "-name target -prune" removes searching in any directory named "target"
# Formatting by single file is necessary due to generated files not being present
# before building the project.
Expand Down
6 changes: 3 additions & 3 deletions docs/docs/contributor-guide.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Contributor's Guide

We welcome all contributions with open arms. At Ingonyama we take a village approach, believing it takes many hands and minds to build a ecosystem.
We welcome all contributions with open arms. At Ingonyama we take a village approach, believing it takes many hands and minds to build an ecosystem.

## Contributing to ICICLE

Expand All @@ -14,9 +14,9 @@ We welcome all contributions with open arms. At Ingonyama we take a village appr
When opening a [pull request](https://github.com/ingonyama-zk/icicle/pulls) please keep the following in mind.

- `Clear Purpose` - The pull request should solve a single issue and be clean of any unrelated changes.
- `Clear description` - If the pull request is for a new feature describe what you built, why you added it and how its best that we test it. For bug fixes please describe the issue and the solution.
- `Clear description` - If the pull request is for a new feature describe what you built, why you added it and how it's best that we test it. For bug fixes please describe the issue and the solution.
- `Consistent style` - Rust and Golang code should be linted by the official linters (golang fmt and rust fmt) and maintain a proper style. For CUDA and C++ code we use [`clang-format`](https://github.com/ingonyama-zk/icicle/blob/main/.clang-format), [here](https://github.com/ingonyama-zk/icicle/blob/605c25f9d22135c54ac49683b710fe2ce06e2300/.github/workflows/main-format.yml#L46) you can see how we run it.
- `Minimal Tests` - please add test which cover basic usage of your changes .
- `Minimal Tests` - please add test which cover basic usage of your changes.

## Questions?

Expand Down
2 changes: 1 addition & 1 deletion docs/docs/icicle/golang-bindings/ecntt.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ type NTTConfig[T any] struct {
- **`areInputsOnDevice`**: Indicates if input scalars are located on the device.
- **`areOutputsOnDevice`**: Indicates if results are stored on the device.
- **`IsAsync`**: Controls whether the NTT operation runs asynchronously.
- **`NttAlgorithm`**: Explicitly select the NTT algorithm. ECNTT supports running on `Radix2` algoruithm.
- **`NttAlgorithm`**: Explicitly select the NTT algorithm. ECNTT supports running on `Radix2` algorithm.

### Default Configuration

Expand Down
4 changes: 2 additions & 2 deletions docs/docs/icicle/golang-bindings/msm.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ cfg.Ctx.IsBigTriangle = true

Toggling between MSM modes occurs automatically based on the number of results you are expecting from the `MSM` function.

The number of results is interpreted from the size of `var out core.DeviceSlice`. Thus its important when allocating memory for `var out core.DeviceSlice` to make sure that you are allocating `<number of results> X <size of a single point>`.
The number of results is interpreted from the size of `var out core.DeviceSlice`. Thus it's important when allocating memory for `var out core.DeviceSlice` to make sure that you are allocating `<number of results> X <size of a single point>`.

```go
...
Expand Down Expand Up @@ -170,7 +170,7 @@ import (
)
```

This package include `G2Projective` and `G2Affine` points as well as a `G2Msm` method.
This package includes `G2Projective` and `G2Affine` points as well as a `G2Msm` method.

```go
package main
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/icicle/polynomials/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ Polynomial& add_monomial_inplace(Coeff monomial_coeff, uint64_t monomial = 0);
Polynomial& sub_monomial_inplace(Coeff monomial_coeff, uint64_t monomial = 0);
```

The ability to add or subtract monomials directly and in-place is an efficient way to manipualte polynomials.
The ability to add or subtract monomials directly and in-place is an efficient way to manipulate polynomials.

Example:

Expand Down
6 changes: 5 additions & 1 deletion docs/docs/icicle/primitives/keccak.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ At its core, Keccak consists of a permutation function operating on a state arra
- **Chi:** This step applies a nonlinear mixing operation to each lane of the state array.
- **Iota:** This step introduces a round constant to the state array.

## Keccak vs Sha3

There exists a [confusion](https://www.cybertest.com/blog/keccak-vs-sha3) between what is called `Keccak` and `Sha3`. In ICICLE we support both. `Keccak256` relates to the old hash function used in Ethereum, and `Sha3-256` relates to the modern hash function.

## Using Keccak

ICICLE Keccak supports batch hashing, which can be utilized for constructing a merkle tree or running multiple hashes in parallel.
Expand All @@ -37,7 +41,7 @@ let input_block_len = 136;
let number_of_hashes = 1024;

let preimages = vec![1u8; number_of_hashes * input_block_len];
let mut digests = vec![0u8; number_of_hashes * 64];
let mut digests = vec![0u8; number_of_hashes * 32];

let preimages_slice = HostSlice::from_slice(&preimages);
let digests_slice = HostSlice::from_mut_slice(&mut digests);
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/icicle/primitives/msm.md
Original file line number Diff line number Diff line change
Expand Up @@ -200,4 +200,4 @@ Here are the parameters and the results for the different cases:
| 24 | 1 | 1 | 18 | 6.58 | 6.61 | 232 |
| 24 | 1 | 7 | 21 | 12.4 | 13.4 | 199 |

The optimal values can vary per GPU and per curve. It is best to try a few combinations until you get the best results for your specific case.
The optimal values can vary per GPU and per curve. It is best to try a few combinations until you get the best results for your specific case.
2 changes: 1 addition & 1 deletion docs/docs/icicle/primitives/poseidon.md
Original file line number Diff line number Diff line change
Expand Up @@ -215,4 +215,4 @@ The benchmarks include copying data from and to the device.
| ----------- | ----------- | -----------
| 10 | 9.4 seconds | 13.6 seconds
| 20 | 9.5 seconds | 13.6 seconds
| 29 | 13.7 seconds | 13.6 seconds
| 29 | 13.7 seconds | 13.6 seconds
1 change: 1 addition & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ golang.org/x/sys v0.9.0 h1:KS/R3tvhPqvJvwcKfnBHJwwthS11LRhmM5D59eEXa0s=
golang.org/x/sys v0.9.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
Expand Down
34 changes: 33 additions & 1 deletion icicle/include/hash/keccak/keccak.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,14 @@ namespace keccak {
// Number of state elements in u64
const int KECCAK_STATE_SIZE = 25;

const int KECCAK_PADDING_CONST = 1;
const int SHA3_PADDING_CONST = 6;

class Keccak : public Hasher<uint8_t, uint64_t>
{
public:
const int PADDING_CONST;

cudaError_t run_hash_many_kernel(
const uint8_t* input,
uint64_t* output,
Expand All @@ -33,7 +38,34 @@ namespace keccak {
unsigned int output_len,
const device_context::DeviceContext& ctx) const override;

Keccak(unsigned int rate) : Hasher<uint8_t, uint64_t>(KECCAK_STATE_SIZE, KECCAK_STATE_SIZE, rate, 0) {}
Keccak(unsigned int rate, unsigned int padding_const)
: Hasher<uint8_t, uint64_t>(KECCAK_STATE_SIZE, KECCAK_STATE_SIZE, rate, 0), PADDING_CONST(padding_const)
{
}
};

class Keccak256 : public Keccak
{
public:
Keccak256() : Keccak(KECCAK_256_RATE, KECCAK_PADDING_CONST) {}
};

class Keccak512 : public Keccak
{
public:
Keccak512() : Keccak(KECCAK_512_RATE, KECCAK_PADDING_CONST) {}
};

class Sha3_256 : public Keccak
{
public:
Sha3_256() : Keccak(KECCAK_256_RATE, SHA3_PADDING_CONST) {}
};

class Sha3_512 : public Keccak
{
public:
Sha3_512() : Keccak(KECCAK_512_RATE, SHA3_PADDING_CONST) {}
};
} // namespace keccak

Expand Down
5 changes: 5 additions & 0 deletions icicle/src/curves/extern.cu
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ extern "C" void CONCAT_EXPAND(CURVE, to_affine)(projective_t* point, affine_t* p
*point_out = projective_t::to_affine(*point);
}

extern "C" void CONCAT_EXPAND(CURVE, from_affine)(affine_t* point, projective_t* point_out)
{
*point_out = projective_t::from_affine(*point);
}

extern "C" void CONCAT_EXPAND(CURVE, generate_projective_points)(projective_t* points, int size)
{
projective_t::rand_host_many(points, size);
Expand Down
5 changes: 5 additions & 0 deletions icicle/src/curves/extern_g2.cu
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ extern "C" void CONCAT_EXPAND(CURVE, g2_to_affine)(g2_projective_t* point, g2_af
*point_out = g2_projective_t::to_affine(*point);
}

extern "C" void CONCAT_EXPAND(CURVE, g2_from_affine)(g2_affine_t* point, g2_projective_t* point_out)
{
*point_out = g2_projective_t::from_affine(*point);
}

extern "C" void CONCAT_EXPAND(CURVE, g2_generate_projective_points)(g2_projective_t* points, int size)
{
g2_projective_t::rand_host_many(points, size);
Expand Down
Loading
Loading