sp_crypto_ec_utils/lib.rs
1// This file is part of Substrate.
2
3// Copyright (C) Parity Technologies (UK) Ltd.
4// SPDX-License-Identifier: Apache-2.0
5
6// Licensed under the Apache License, Version 2.0 (the "License");
7// you may not use this file except in compliance with the License.
8// You may obtain a copy of the License at
9//
10// http://www.apache.org/licenses/LICENSE-2.0
11//
12// Unless required by applicable law or agreed to in writing, software
13// distributed under the License is distributed on an "AS IS" BASIS,
14// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15// See the License for the specific language governing permissions and
16// limitations under the License.
17
18//! This crate offers elliptic curves types which are compatible with the
19//! [Arkworks](https://github.com/arkworks-rs) library functionalities.
20//!
21//! The implementation has been primarily designed to be used in slow hosted
22//! targets (e.g. wasm32) and offloads the most computationally expensive
23//! operations to the host by leveraging the
24//! [arkworks-extensions](https://github.com/paritytech/arkworks-extensions)
25//! library and Substrate's host functions.
26//!
27//! The exported types are organized and named in a way that mirrors the structure
28//! of the types in the original Arkworks library. This design choice aims to make
29//! it easier for users already familiar with the library to understand and utilize
30//! the exported types effectively.
31
32#![warn(missing_docs)]
33#![cfg_attr(not(feature = "std"), no_std)]
34
35extern crate alloc;
36
37#[cfg(feature = "bls12-377")]
38pub mod bls12_377;
39#[cfg(feature = "bls12-381")]
40pub mod bls12_381;
41#[cfg(feature = "bw6-761")]
42pub mod bw6_761;
43#[cfg(feature = "ed-on-bls12-377")]
44pub mod ed_on_bls12_377;
45#[cfg(feature = "ed-on-bls12-381-bandersnatch")]
46pub mod ed_on_bls12_381_bandersnatch;
47
48#[cfg(any(
49 feature = "bls12-377",
50 feature = "bls12-381",
51 feature = "bw6-761",
52 feature = "ed-on-bls12-377",
53 feature = "ed-on-bls12-381-bandersnatch",
54))]
55mod utils;