remove rustc-serialize feature and bump version (#22)

* remove rustc-serialize

* bump version to 0.6.0

* remove bincode
This commit is contained in:
Andronik Ordian
2021-04-21 17:06:02 +02:00
committed by GitHub
parent 47d6e4f919
commit 63f8c58735
8 changed files with 8 additions and 30366 deletions
+1 -20
View File
@@ -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,