Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

use ark_scale #13954

Merged

Conversation

achimcc
Copy link
Contributor

@achimcc achimcc commented Apr 19, 2023

Use ark-scale by @burdges for (de-)serialization.

base: Vec<u8>,
scalar: Vec<u8>,
) -> Result<Vec<u8>, ()> {
let base = <ArkScale<twisted_edwards::Projective<Group>> as Decode>::decode(
Copy link

Choose a reason for hiding this comment

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

ark_scale::hazmat::ArkScaleProjective<twisted_edwards::Projective<..>>

@achimcc achimcc merged commit 70bcea0 into achimcc/arkworks-integration Apr 20, 2023
@achimcc achimcc deleted the achimcc/arkworks-integration-ark-scale branch April 20, 2023 07:57
)
.map_err(|_| ())?;
let scalar =
<ArkScale<Vec<u64>> as Decode>::decode(&mut scalar.clone().as_slice()).map_err(|_| ())?;
Copy link

Choose a reason for hiding this comment

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

We'll remove this and make mul_affine just call mul_projective in ark-substrate, but I guess that's a later PR.

@paritytech-cicd-pr
Copy link

The CI pipeline was cancelled due to failure one of the required jobs.
Job name: cargo-check-each-crate
Logs: https://gitlab.parity.io/parity/mirrors/substrate/-/jobs/2706763

paritytech-processbot bot pushed a commit that referenced this pull request Jun 6, 2023
* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix compression

* fix compression

* fix compression

* fix compression

* fix compression

* fix std leak

* fix std leak

* fix std leak

* merge master

* merge master

* cargo update

* cargo update

* cargo update

* cargo update

* cargo update

* use serialize_result

* cargo update

* cargo update

* cargo update

* cargo update

* reduce boilerplate code

* remove host function muls

* reduce boilerplate code

* remove patches

* uuse correct ark-substrate branch

* reduce boilerplate code

* cleanup

* cleanup

* proper error handling

* derive serialize for error

* proper error handling

* proper error handling

* proper error handling

* derive Debug for PairingError

* sp-arkworks path

* cargo update

* adopt tests to error handling

* fix tests

* cargo update

* remove results

* deserialize as G2Affine

* cargo update

* add codex index to PairingError

* replace Vec<Vec<u8>>

* replace Vec<Vec<u8>>

* use into_iter for chunks

* use chunks for scalars

* fix ersialized_size

* use into

* collect as vec

* collect as vec

* no collect Vec

* use into_iter

* import AffineRepr

* fix typo

* cargo update

* new serialization

* fix typo

* unwrap results

* unwrap results

* use correct deserialization

* fix bugs, cleanup

* correct len

* vec without capacity

* Revert "vec without capacity"

This reverts commit 2b1cd00.

* Revert "correct len"

This reverts commit b85de86.

* Revert "fix bugs, cleanup"

This reverts commit eef4c77.

* Revert "use correct deserialization"

This reverts commit 9eacba9.

* Revert "unwrap results"

This reverts commit b0df1e1.

* Revert "unwrap results"

This reverts commit de3cfbd.

* Revert "fix typo"

This reverts commit c12045d.

* Revert "new serialization"

This reverts commit e56a088.

* Revert "cargo update"

This reverts commit 15898da.

* Revert "fix typo"

This reverts commit c89e963.

* Revert "import AffineRepr"

This reverts commit 5a103ac.

* Revert "use into_iter"

This reverts commit 2e31d91.

* Revert "no collect Vec"

This reverts commit db18dca.

* Revert "collect as vec"

This reverts commit dd3f809.

* Revert "collect as vec"

This reverts commit 9167d59.

* Revert "use into"

This reverts commit 344cfff.

* Revert "fix ersialized_size"

This reverts commit c6a7609.

* Revert "use chunks for scalars"

This reverts commit 67987ae.

* Revert "use into_iter for chunks"

This reverts commit 1ddd6b8.

* Revert "replace Vec<Vec<u8>>"

This reverts commit 4d3b13c.

* cargo update

* cargo update

* Revert "replace Vec<Vec<u8>>"

This reverts commit 4389714.

* cargo update

* add error

* add error

* add error

* fix typo

* fix imports

* import coded

* import codec

* import PairingError

* fix patches

* sp-arkworks

* sp-arkworks

* use random values for multiplications

* cargo update

* fix imports

* fix imports

* add host functions

* re-add mul impls

* cargo update

* cargo update

* cargo update

* cargo update

* cargo update

* cargo update

* cargo update

* PairingError -> ()

* remove PairingError

* cargo update

* cargo update

* cargo update

* reduce boilerplate code

* cargo update

* update comments

* cargo update

* optimize code quality

* use ark_scale (#13954)

* use ark_scale

* fix tests

* fix tests

* cleanup & comments

* use correct PR branch

* hazmat

* ed curves, use ArkScaleProjective

* Achimcc/arkworks integration remove affine hostcalls (#13971)

* remove affine host-calls

* remove affine host-call impls, also in tests

* cargo update

* ark-substrate: use main branch

* cargo update

* Achimcc/arkworks integration bandersnatch (#13977)

* use bandersnatch

* bandersnatch

* add abndersnatch sw msm

* use correct PR branch

* cargo update

* cargo update

* fix tests

* cleanup

* cleanup

* fix tests

* refactor tests

* cargo update

* cargo update

* cargo update

* refactor tests

* cleanup & update tests

* upgrade arkworks/algebra

* cargo update

* adopt tests

* versioning ark-substrate

* cargo update

* remove patched deps

* bump ark-scale

* use crates-io deps

* fix doc comments

* Cargo.toml, linebreaks at end

* reorgainze tests

* sp-arkworks -> sp-crypto-ec-utils

* move host functions to crypto-ec-utils

* fmt

* remove sp-ec-crypto-utils from io

* remove unwrap from te msm

* remove elliptic_curves references in test

* elliptic_curves references in test

* update doc comments

* remove warn missing docs

* fmt

* cargo update

* update doc comments

* cargo update

* cargo update, bump arkworks, codec versions

* bump runtime version in sp-crypto-ec-utils

* remove feature flag ec-utils-experimental

* crypto-ec-utils -> crypto/ec-utils

* tests/ -> test-data/

* update doc comments for signatures

* update comments

* update doc comments for signatures

* fix doc comments

* fix doc comments

* fix doc comments

* fix doc comments

* fix doc comments

* cleanup

* fix doc comments

* cargo update

* fix doc comments

* cargo update
agryaznov pushed a commit that referenced this pull request Jun 9, 2023
* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix compression

* fix compression

* fix compression

* fix compression

* fix compression

* fix std leak

* fix std leak

* fix std leak

* merge master

* merge master

* cargo update

* cargo update

* cargo update

* cargo update

* cargo update

* use serialize_result

* cargo update

* cargo update

* cargo update

* cargo update

* reduce boilerplate code

* remove host function muls

* reduce boilerplate code

* remove patches

* uuse correct ark-substrate branch

* reduce boilerplate code

* cleanup

* cleanup

* proper error handling

* derive serialize for error

* proper error handling

* proper error handling

* proper error handling

* derive Debug for PairingError

* sp-arkworks path

* cargo update

* adopt tests to error handling

* fix tests

* cargo update

* remove results

* deserialize as G2Affine

* cargo update

* add codex index to PairingError

* replace Vec<Vec<u8>>

* replace Vec<Vec<u8>>

* use into_iter for chunks

* use chunks for scalars

* fix ersialized_size

* use into

* collect as vec

* collect as vec

* no collect Vec

* use into_iter

* import AffineRepr

* fix typo

* cargo update

* new serialization

* fix typo

* unwrap results

* unwrap results

* use correct deserialization

* fix bugs, cleanup

* correct len

* vec without capacity

* Revert "vec without capacity"

This reverts commit 2b1cd00.

* Revert "correct len"

This reverts commit b85de86.

* Revert "fix bugs, cleanup"

This reverts commit eef4c77.

* Revert "use correct deserialization"

This reverts commit 9eacba9.

* Revert "unwrap results"

This reverts commit b0df1e1.

* Revert "unwrap results"

This reverts commit de3cfbd.

* Revert "fix typo"

This reverts commit c12045d.

* Revert "new serialization"

This reverts commit e56a088.

* Revert "cargo update"

This reverts commit 15898da.

* Revert "fix typo"

This reverts commit c89e963.

* Revert "import AffineRepr"

This reverts commit 5a103ac.

* Revert "use into_iter"

This reverts commit 2e31d91.

* Revert "no collect Vec"

This reverts commit db18dca.

* Revert "collect as vec"

This reverts commit dd3f809.

* Revert "collect as vec"

This reverts commit 9167d59.

* Revert "use into"

This reverts commit 344cfff.

* Revert "fix ersialized_size"

This reverts commit c6a7609.

* Revert "use chunks for scalars"

This reverts commit 67987ae.

* Revert "use into_iter for chunks"

This reverts commit 1ddd6b8.

* Revert "replace Vec<Vec<u8>>"

This reverts commit 4d3b13c.

* cargo update

* cargo update

* Revert "replace Vec<Vec<u8>>"

This reverts commit 4389714.

* cargo update

* add error

* add error

* add error

* fix typo

* fix imports

* import coded

* import codec

* import PairingError

* fix patches

* sp-arkworks

* sp-arkworks

* use random values for multiplications

* cargo update

* fix imports

* fix imports

* add host functions

* re-add mul impls

* cargo update

* cargo update

* cargo update

* cargo update

* cargo update

* cargo update

* cargo update

* PairingError -> ()

* remove PairingError

* cargo update

* cargo update

* cargo update

* reduce boilerplate code

* cargo update

* update comments

* cargo update

* optimize code quality

* use ark_scale (#13954)

* use ark_scale

* fix tests

* fix tests

* cleanup & comments

* use correct PR branch

* hazmat

* ed curves, use ArkScaleProjective

* Achimcc/arkworks integration remove affine hostcalls (#13971)

* remove affine host-calls

* remove affine host-call impls, also in tests

* cargo update

* ark-substrate: use main branch

* cargo update

* Achimcc/arkworks integration bandersnatch (#13977)

* use bandersnatch

* bandersnatch

* add abndersnatch sw msm

* use correct PR branch

* cargo update

* cargo update

* fix tests

* cleanup

* cleanup

* fix tests

* refactor tests

* cargo update

* cargo update

* cargo update

* refactor tests

* cleanup & update tests

* upgrade arkworks/algebra

* cargo update

* adopt tests

* versioning ark-substrate

* cargo update

* remove patched deps

* bump ark-scale

* use crates-io deps

* fix doc comments

* Cargo.toml, linebreaks at end

* reorgainze tests

* sp-arkworks -> sp-crypto-ec-utils

* move host functions to crypto-ec-utils

* fmt

* remove sp-ec-crypto-utils from io

* remove unwrap from te msm

* remove elliptic_curves references in test

* elliptic_curves references in test

* update doc comments

* remove warn missing docs

* fmt

* cargo update

* update doc comments

* cargo update

* cargo update, bump arkworks, codec versions

* bump runtime version in sp-crypto-ec-utils

* remove feature flag ec-utils-experimental

* crypto-ec-utils -> crypto/ec-utils

* tests/ -> test-data/

* update doc comments for signatures

* update comments

* update doc comments for signatures

* fix doc comments

* fix doc comments

* fix doc comments

* fix doc comments

* fix doc comments

* cleanup

* fix doc comments

* cargo update

* fix doc comments

* cargo update
nathanwhit pushed a commit to nathanwhit/substrate that referenced this pull request Jul 19, 2023
* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix compression

* fix compression

* fix compression

* fix compression

* fix compression

* fix std leak

* fix std leak

* fix std leak

* merge master

* merge master

* cargo update

* cargo update

* cargo update

* cargo update

* cargo update

* use serialize_result

* cargo update

* cargo update

* cargo update

* cargo update

* reduce boilerplate code

* remove host function muls

* reduce boilerplate code

* remove patches

* uuse correct ark-substrate branch

* reduce boilerplate code

* cleanup

* cleanup

* proper error handling

* derive serialize for error

* proper error handling

* proper error handling

* proper error handling

* derive Debug for PairingError

* sp-arkworks path

* cargo update

* adopt tests to error handling

* fix tests

* cargo update

* remove results

* deserialize as G2Affine

* cargo update

* add codex index to PairingError

* replace Vec<Vec<u8>>

* replace Vec<Vec<u8>>

* use into_iter for chunks

* use chunks for scalars

* fix ersialized_size

* use into

* collect as vec

* collect as vec

* no collect Vec

* use into_iter

* import AffineRepr

* fix typo

* cargo update

* new serialization

* fix typo

* unwrap results

* unwrap results

* use correct deserialization

* fix bugs, cleanup

* correct len

* vec without capacity

* Revert "vec without capacity"

This reverts commit 2b1cd00.

* Revert "correct len"

This reverts commit b85de86.

* Revert "fix bugs, cleanup"

This reverts commit eef4c77.

* Revert "use correct deserialization"

This reverts commit 9eacba9.

* Revert "unwrap results"

This reverts commit b0df1e1.

* Revert "unwrap results"

This reverts commit de3cfbd.

* Revert "fix typo"

This reverts commit c12045d.

* Revert "new serialization"

This reverts commit e56a088.

* Revert "cargo update"

This reverts commit 15898da.

* Revert "fix typo"

This reverts commit c89e963.

* Revert "import AffineRepr"

This reverts commit 5a103ac.

* Revert "use into_iter"

This reverts commit 2e31d91.

* Revert "no collect Vec"

This reverts commit db18dca.

* Revert "collect as vec"

This reverts commit dd3f809.

* Revert "collect as vec"

This reverts commit 9167d59.

* Revert "use into"

This reverts commit 344cfff.

* Revert "fix ersialized_size"

This reverts commit c6a7609.

* Revert "use chunks for scalars"

This reverts commit 67987ae.

* Revert "use into_iter for chunks"

This reverts commit 1ddd6b8.

* Revert "replace Vec<Vec<u8>>"

This reverts commit 4d3b13c.

* cargo update

* cargo update

* Revert "replace Vec<Vec<u8>>"

This reverts commit 4389714.

* cargo update

* add error

* add error

* add error

* fix typo

* fix imports

* import coded

* import codec

* import PairingError

* fix patches

* sp-arkworks

* sp-arkworks

* use random values for multiplications

* cargo update

* fix imports

* fix imports

* add host functions

* re-add mul impls

* cargo update

* cargo update

* cargo update

* cargo update

* cargo update

* cargo update

* cargo update

* PairingError -> ()

* remove PairingError

* cargo update

* cargo update

* cargo update

* reduce boilerplate code

* cargo update

* update comments

* cargo update

* optimize code quality

* use ark_scale (paritytech#13954)

* use ark_scale

* fix tests

* fix tests

* cleanup & comments

* use correct PR branch

* hazmat

* ed curves, use ArkScaleProjective

* Achimcc/arkworks integration remove affine hostcalls (paritytech#13971)

* remove affine host-calls

* remove affine host-call impls, also in tests

* cargo update

* ark-substrate: use main branch

* cargo update

* Achimcc/arkworks integration bandersnatch (paritytech#13977)

* use bandersnatch

* bandersnatch

* add abndersnatch sw msm

* use correct PR branch

* cargo update

* cargo update

* fix tests

* cleanup

* cleanup

* fix tests

* refactor tests

* cargo update

* cargo update

* cargo update

* refactor tests

* cleanup & update tests

* upgrade arkworks/algebra

* cargo update

* adopt tests

* versioning ark-substrate

* cargo update

* remove patched deps

* bump ark-scale

* use crates-io deps

* fix doc comments

* Cargo.toml, linebreaks at end

* reorgainze tests

* sp-arkworks -> sp-crypto-ec-utils

* move host functions to crypto-ec-utils

* fmt

* remove sp-ec-crypto-utils from io

* remove unwrap from te msm

* remove elliptic_curves references in test

* elliptic_curves references in test

* update doc comments

* remove warn missing docs

* fmt

* cargo update

* update doc comments

* cargo update

* cargo update, bump arkworks, codec versions

* bump runtime version in sp-crypto-ec-utils

* remove feature flag ec-utils-experimental

* crypto-ec-utils -> crypto/ec-utils

* tests/ -> test-data/

* update doc comments for signatures

* update comments

* update doc comments for signatures

* fix doc comments

* fix doc comments

* fix doc comments

* fix doc comments

* fix doc comments

* cleanup

* fix doc comments

* cargo update

* fix doc comments

* cargo update
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants