mirror of
https://github.com/pezkuwichain/bizinikiwi-bn.git
synced 2026-07-22 13:16:17 +00:00
remove rustc-serialize feature and bump version (#22)
* remove rustc-serialize * bump version to 0.6.0 * remove bincode
This commit is contained in:
+1
-20
@@ -4,9 +4,6 @@ use rand::Rng;
|
||||
use crate::fields::FieldElement;
|
||||
use crate::arith::{U256, U512};
|
||||
|
||||
#[cfg(feature = "rustc-serialize")]
|
||||
use rustc_serialize::{Decodable, Decoder, Encodable, Encoder};
|
||||
|
||||
macro_rules! field_impl {
|
||||
($name:ident, $modulus:expr, $rsquared:expr, $rcubed:expr, $one:expr, $inv:expr) => {
|
||||
#[derive(Copy, Clone, PartialEq, Eq, Debug)]
|
||||
@@ -22,22 +19,6 @@ macro_rules! field_impl {
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "rustc-serialize")]
|
||||
impl Encodable for $name {
|
||||
fn encode<S: Encoder>(&self, s: &mut S) -> Result<(), S::Error> {
|
||||
let normalized = U256::from(*self);
|
||||
|
||||
normalized.encode(s)
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "rustc-serialize")]
|
||||
impl Decodable for $name {
|
||||
fn decode<S: Decoder>(s: &mut S) -> Result<$name, S::Error> {
|
||||
$name::new(U256::decode(s)?).ok_or_else(|| s.error("integer is not less than modulus"))
|
||||
}
|
||||
}
|
||||
|
||||
impl $name {
|
||||
pub fn from_str(s: &str) -> Option<Self> {
|
||||
let ints: Vec<_> = {
|
||||
@@ -240,7 +221,7 @@ field_impl!(
|
||||
0x9ede7d651eca6ac987d20782e4866389
|
||||
);
|
||||
|
||||
lazy_static! {
|
||||
lazy_static::lazy_static! {
|
||||
|
||||
static ref FQ: U256 = U256::from([
|
||||
0x3c208c16d87cfd47,
|
||||
|
||||
Reference in New Issue
Block a user