Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added type for clearing temporary values. #30

Merged
merged 1 commit into from
Sep 14, 2018

Conversation

DrPeterVanNostrand
Copy link
Contributor

@DrPeterVanNostrand DrPeterVanNostrand commented Sep 10, 2018

  • Moved everything memory related to the secret module.
  • Added type Safe<T> for clearing, locking, and unlocking temporary values that should be kept secret.
  • Added temporary value clearing to polynomial multiplication.
  • Removed Poly::extend_mlock(&mut self) and Poly::truncate_ mlock(&mut self) (locking on instantiation and destruction of Poly is enough).

Closes issue #24

Copy link
Contributor

@vkomenda vkomenda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are a few typos in the docs + a rustfmt error.

src/poly.rs Outdated
@@ -42,8 +42,8 @@ pub struct Poly {
///
/// # Panics
///
/// Panics if we have hit the system's locked memory limit when `mlock`ing the new instance of
/// `Poly`.
/// Panics if we have reach the system's locked memory limit when locking the polynomial's
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

have

src/secret.rs Outdated
@@ -0,0 +1,187 @@
//! Utilities for working with secret values. This module includes functionality for locking (and
//! unlocking) memory into RAM, overwriting memory with zeros
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The trailing period is missing.

src/secret.rs Outdated
/// # Errors
///
/// An `Error::MlockFailed` is returned if we reach the system's locked memory limit or if we
/// attemt to lock an invalid region of memory.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

attempt

src/secret.rs Outdated
}
}

/// Unlocks the memory-lock for a region of memory marked as secret. If the secret region of
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"memory lock" doesn't need a dash.

Copy link
Contributor

@c0gent c0gent left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. I'll approve as soon as I can test :)

Copy link
Contributor

@c0gent c0gent left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good

@DrPeterVanNostrand DrPeterVanNostrand merged commit 5f09f96 into master Sep 14, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants