Skip to content

Commit

Permalink
no std
Browse files Browse the repository at this point in the history
  • Loading branch information
Dr. Capybara committed Apr 5, 2024
1 parent 726ed48 commit 27be4f5
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/curve/extended_edwards.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use crypto_bigint::subtle::{
Choice, ConditionallyNegatable, ConditionallySelectable, ConstantTimeEq,
};
use fiat_crypto::p448_solinas_64::*;
use std::ops::{Add, Mul, Neg};
use core::ops::{Add, Mul, Neg};

/// Extends projective coordinates by adding an additional
/// auxiliary coordinate to speed up certain calculations.
Expand Down
6 changes: 3 additions & 3 deletions src/curve/field/field_element.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ use crypto_bigint::subtle::{
Choice, ConditionallyNegatable, ConditionallySelectable, ConstantTimeEq,
};
use fiat_crypto::p448_solinas_64::*;
use std::ops::{Add, Mul, Sub};
use core::ops::{Add, Mul, Sub};

#[derive(Copy, Clone)]
pub struct FieldElement(pub(crate) fiat_p448_tight_field_element);

impl std::fmt::Debug for FieldElement {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
impl core::fmt::Debug for FieldElement {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
f.debug_tuple("FieldElement").field(&self.0 .0).finish()
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/curve/field/field_element_serde.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use base64::Engine;
use serde::de::{self, Visitor};
use serde::{Deserialize, Deserializer, Serialize, Serializer};
use std::fmt;
use core::fmt;

use super::field_element::FieldElement;

Expand Down
2 changes: 1 addition & 1 deletion src/curve/field/scalar.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use std::ops::{Mul, Sub};
use core::ops::{Mul, Sub};

use crypto_bigint::{
const_residue, impl_modulus,
Expand Down
2 changes: 2 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#![no_std]

#![warn(clippy::just_underscores_and_digits)]
/// Module for all EC operations.
pub mod curve {
Expand Down

0 comments on commit 27be4f5

Please sign in to comment.