Skip to main content

Module crypto

Module crypto 

Source
Expand description

Implementations of Crypto Cheatcodes.

Re-exportsΒ§

use crate::Cheatcode; πŸ”’
use crate::CheatcodesCore; πŸ”’
use crate::Result; πŸ”’
use alloy_primitives::Address; πŸ”’
use alloy_primitives::B256; πŸ”’
use alloy_primitives::U256; πŸ”’
use alloy_primitives::keccak256; πŸ”’
use alloy_signer::Signer; πŸ”’
use alloy_signer::SignerSync; πŸ”’
use alloy_signer_local::MnemonicBuilder; πŸ”’
use alloy_signer_local::PrivateKeySigner; πŸ”’
use alloy_signer_local::coins_bip39::ChineseSimplified; πŸ”’
use alloy_signer_local::coins_bip39::ChineseTraditional; πŸ”’
use alloy_signer_local::coins_bip39::Czech; πŸ”’
use alloy_signer_local::coins_bip39::English; πŸ”’
use alloy_signer_local::coins_bip39::French; πŸ”’
use alloy_signer_local::coins_bip39::Italian; πŸ”’
use alloy_signer_local::coins_bip39::Japanese; πŸ”’
use alloy_signer_local::coins_bip39::Korean; πŸ”’
use alloy_signer_local::coins_bip39::Portuguese; πŸ”’
use alloy_signer_local::coins_bip39::Spanish; πŸ”’
use alloy_signer_local::coins_bip39::Wordlist; πŸ”’
use alloy_sol_types::SolValue; πŸ”’
use foundry_common::wallet::derive_private_key; πŸ”’
use foundry_common::wallet::derive_private_key_with_language; πŸ”’
use k256::AffinePoint; πŸ”’
use k256::EncodedPoint; πŸ”’
use k256::FieldBytes; πŸ”’
use k256::FieldElement; πŸ”’
use k256::ProjectivePoint; πŸ”’
use k256::Scalar; πŸ”’
use k256::ecdsa::SigningKey; πŸ”’
use k256::ecdsa::hazmat; πŸ”’
use k256::elliptic_curve::bigint::ArrayEncoding; πŸ”’
use k256::elliptic_curve::bigint::U256 as K256U256; πŸ”’
use k256::elliptic_curve::group::Group; πŸ”’
use k256::elliptic_curve::ops::Reduce; πŸ”’
use k256::elliptic_curve::sec1::FromEncodedPoint; πŸ”’
use k256::elliptic_curve::sec1::ToEncodedPoint; πŸ”’
use p256::ecdsa::Signature as P256Signature; πŸ”’
use p256::ecdsa::SigningKey as P256SigningKey; πŸ”’
use p256::ecdsa::signature::hazmat::PrehashSigner; πŸ”’
use ed25519_consensus::Signature as Ed25519Signature; πŸ”’
use ed25519_consensus::SigningKey as Ed25519SigningKey; πŸ”’
use ed25519_consensus::VerificationKey as Ed25519VerificationKey; πŸ”’
use tempo_primitives::transaction::KeychainSignature; πŸ”’
use tempo_primitives::transaction::PrimitiveSignature; πŸ”’
use tempo_primitives::transaction::TempoSignature; πŸ”’
use crate::Vm::*; πŸ”’

ConstantsΒ§

DEFAULT_DERIVATION_PATH_PREFIX πŸ”’
The BIP32 default derivation path prefix.
PRIVATE_KEY_SIGNER_CACHE_LIMIT πŸ”’

FunctionsΒ§

create_ed25519_key πŸ”’
create_wallet πŸ”’
Using a given private key, return its public ETH address, its public key affine x and y coordinates, and its private key (see the β€˜Wallet’ struct)
derive_key πŸ”’
derive_key_str πŸ”’
derive_wallets πŸ”’
derive_wallets_str πŸ”’
encode_affine_point πŸ”’
encode_compact_sig πŸ”’
encode_full_sig πŸ”’
encode_projective_point πŸ”’
inject_wallet πŸ”’
parse_affine_point πŸ”’
parse_field_element πŸ”’
parse_private_key πŸ”’
parse_private_key_p256 πŸ”’
parse_projective_point πŸ”’
parse_signing_key_ed25519 πŸ”’
parse_wallet πŸ”’
public_key_ed25519 πŸ”’
reduce_ec_scalar πŸ”’
sign πŸ”’
sign_cached πŸ”’
sign_ed25519 πŸ”’
sign_keychain πŸ”’
sign_p256 πŸ”’
sign_with_nonce πŸ”’
Signs digest on secp256k1 using a user-supplied ephemeral nonce k (no RFC6979).
sign_with_wallet πŸ”’
validate_private_key πŸ”’
verify_ed25519 πŸ”’
with_private_key_signer πŸ”’