Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
[package]
name = "ff"
version = "0.5.1"
version = "0.6.3"
authors = ["Sean Bowe <ewillbefull@gmail.com>"]
description = "Library for building and interfacing with finite fields"
readme = "README.md"
documentation = "https://docs.rs/ff/"
homepage = "https://github.com/ebfull/ff"
documentation = "https://docs.rs/ff-zeroize/"
homepage = "https://github.com/algorand/ff-zeroize"
license = "MIT/Apache-2.0"
repository = "https://github.com/ebfull/ff"
repository = "https://github.com/algorand/ff-zeroize"
edition = "2018"

[dependencies]
byteorder = "1"
ff_derive = { version = "0.4.0", path = "ff_derive", optional = true }
ff_derive = { version = "0.6.2", path = "ff_derive", optional = true }
rand_core = "0.5"
zeroize = {version = "1.1", features = ["zeroize_derive"]}

[features]
default = []
Expand Down
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# ff
# ff-zeroize

`ff` is a finite field library written in pure Rust, with no `unsafe{}` code.
* `ff-zeroize` is a temporary crate that enables `zeroize` features for `ff`crate
* `ff` is a finite field library written in pure Rust, with no `unsafe{}` code.

## Disclaimers

Expand All @@ -12,7 +13,7 @@ Add the `ff` crate to your `Cargo.toml`:

```toml
[dependencies]
ff = "0.5"
ff_zeroize = "0.6.1"
```

The `ff` crate contains `Field`, `PrimeField`, `PrimeFieldRepr` and `SqrtField` traits.
Expand All @@ -29,7 +30,7 @@ First, enable the `derive` crate feature:

```toml
[dependencies]
ff = { version = "0.4", features = ["derive"] }
ff_zeroize = { version = "0.6.1", features = ["derive"] }
```

And then use the macro like so:
Expand Down
2 changes: 1 addition & 1 deletion ff_derive/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "ff_derive"
version = "0.4.0"
version = "0.6.2"
authors = ["Sean Bowe <ewillbefull@gmail.com>"]
description = "Procedural macro library used to build custom prime field implementations"
documentation = "https://docs.rs/ff/"
Expand Down
2 changes: 1 addition & 1 deletion ff_derive/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ fn fetch_attr(name: &str, attrs: &[syn::Attribute]) -> Option<String> {
// Implement PrimeFieldRepr for the wrapped ident `repr` with `limbs` limbs.
fn prime_field_repr_impl(repr: &syn::Ident, limbs: usize) -> proc_macro2::TokenStream {
quote! {
#[derive(Copy, Clone, PartialEq, Eq, Default)]
#[derive(Copy, Clone, PartialEq, Eq, Default, Zeroize)]
pub struct #repr(pub [u64; #limbs]);

impl ::std::fmt::Debug for #repr
Expand Down
4 changes: 4 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ extern crate ff_derive;
#[cfg(feature = "derive")]
pub use ff_derive::*;

#[macro_use]
extern crate zeroize;

use rand_core::RngCore;
use std::error::Error;
use std::fmt;
Expand Down Expand Up @@ -108,6 +111,7 @@ pub trait PrimeFieldRepr:
+ AsRef<[u64]>
+ AsMut<[u64]>
+ From<u64>
+ zeroize::Zeroize
{
/// Subtract another represetation from this one.
fn sub_noborrow(&mut self, other: &Self);
Expand Down