Thanks to visit codestin.com
Credit goes to github.com

Skip to content

nicstange/cmpa-rs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cryptographic MultiPrecision Arithmetic (cmpa)

Pure Rust implementation of multiprecision arithmetic primitives commonly needed for asymmetric cryptography.

rustdoc comments are WIP.

Features

  • [no_std]
  • Rigorously constant-time throughout.
  • Complete user control over buffers: cmpa does not allocate any own its own or places any on the stack. Whenever scratch space is needed for some computation, a buffer is provided as an additional argument to the API.

Functionality overview

  • Operates on multiprecision integers in big or little endian format (stored as byte slices) or more effeciently on native format multiprecision integers (stored as a slice of machine words).
  • "Standard" airhtmetic: addition, subtraction, multiplication, division, shifts, comparisons etc.
  • Modular arithmetic: Montogomery multiplication and related functionality, modular inversions etc.
  • Primality testing.

Cargo features

  • zeroize - implement traits from the zeroize crate.
  • enable_arch_math_asm - Use (rather trivial) assembly implementations for certain basic sinlge-word arithmetic primitives. You most likely want to enable it for performance reason, but it does introduce some unsafe{} blocks.

About

Multiprecision Arithmetic for Cryptography in Rust

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages