Skip to content

Commit a125d12

Browse files
committed
mina-signer: make it no-std compatible
The previous commit makes also the repository compatible with Rust before 1.81. Without the bump up to thiserror = 2, the feature error_in_core must be activated, and it has been stabilized in 1.81 only. See rust-lang/rust#103765
1 parent 22c686c commit a125d12

File tree

5 files changed

+12
-0
lines changed

5 files changed

+12
-0
lines changed

signer/src/keypair.rs

+2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22
//!
33
//! Definition of secret key, keypairs and related helpers
44
5+
extern crate alloc;
56
use crate::{pubkey::PubKeyError, seckey::SecKeyError, CurvePoint, PubKey, ScalarField, SecKey};
7+
use alloc::{string::String, vec::Vec};
68
use core::fmt;
79
use rand::{self, CryptoRng, RngCore};
810
use thiserror::Error;

signer/src/lib.rs

+3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
#![deny(missing_docs)]
22
#![doc = include_str!("../README.md")]
3+
#![no_std]
34

5+
extern crate alloc;
6+
use alloc::{vec, vec::Vec};
47
use ark_ec::AffineRepr;
58
pub use keypair::Keypair;
69
pub use mina_curves::pasta::Pallas as CurvePoint;

signer/src/pubkey.rs

+2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22
//!
33
//! Definition of public key structure and helpers
44
5+
extern crate alloc;
56
use crate::{BaseField, CurvePoint, ScalarField, SecKey};
7+
use alloc::{string::String, vec, vec::Vec};
68
use ark_ec::{short_weierstrass::Affine, AffineRepr, CurveGroup};
79
use ark_ff::{BigInteger, PrimeField, Zero};
810
use bs58;

signer/src/schnorr.rs

+3
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
//!
55
//! Details: <https://github.com/MinaProtocol/mina/blob/develop/docs/specs/signatures/description.md>
66
7+
extern crate alloc;
8+
use alloc::{boxed::Box, string::String};
9+
710
use crate::{BaseField, CurvePoint, Hashable, Keypair, PubKey, ScalarField, Signature, Signer};
811
use ark_ec::{
912
AffineRepr, // for generator()

signer/src/seckey.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
//! Secret key structures and helpers
22
3+
extern crate alloc;
34
use crate::ScalarField;
5+
use alloc::{string::String, vec, vec::Vec};
46
use ark_ff::UniformRand;
57
use o1_utils::FieldHelpers;
68
use rand::{self, CryptoRng, RngCore};

0 commit comments

Comments
 (0)