Skip to main content

Crate airbender_crypto

Crate airbender_crypto 

Source
Expand description

§airbender-crypto Build status License: MIT OR Apache-2.0 rust nightly required host and guest

Documentation: API docs | Crypto guide

[!WARNING] airbender-platform project is under active development and is in alpha state. Use at your own risk.

[!NOTE] Support crate. For guest programs, enable the crypto feature on airbender-sdk to access crypto through airbender::crypto. For host programs, this crate can be used directly.

airbender-crypto provides shared crypto primitives for Airbender host and guest programs. The same Rust API can be used on both sides, while guest builds can opt into delegated backends for proving-oriented workloads.

§What It Provides

  • Hashing modules such as sha256, sha3, ripemd160, and blake2s.
  • Curve and field modules including secp256k1, secp256r1, bn254, and bls12_381.
  • Re-exports of supporting crates such as k256, p256, and arkworks types used by the Airbender integrations.

§Features

  • proving: enables delegation-oriented features used on riscv32 Airbender guests.
  • Default features keep host usage available and enable the secp256k1 static context.

§Usage

[dependencies]
airbender-crypto = { git = "https://github.com/matter-labs/airbender-platform", branch = "main" }

Use features = ["proving"] for guest builds, or enable the crypto feature on airbender-sdk if you want the same API through the SDK re-export.

§License

Licensed under either Apache License, Version 2.0 or MIT license at your option.

Re-exports§

pub use k256 as rust_k256;
pub use blake2 as blake2_ext;
pub use ark_ec;
pub use ark_ff;
pub use ark_serialize;

Modules§

blake2s
bls12_381
bn254
k256
p256
ripemd160
secp256k1
secp256r1
sha3
sha256

Macros§

BigInt
Construct a BigInt<N> element from a literal string.

Structs§

BigInt
Fp
Represents an element of the prime field F_p, where p == P::MODULUS. This type can represent elements in any field of size at most N * 64 bits.

Enums§

BigIntOps

Traits§

BigInteger
This defines a BigInteger, a smart wrapper around a sequence of u64 limbs, least-significant limb first.
MiniDigest

Functions§

init_lib
parse_u256_be
Parse the byte array as a BE 32-byte BigInt. If length is less than 32 bytes, it will be left-padded (most significant bytes) with zeroes.