Library for NIST P256 signatures, for when you really need them.
This library completely decouples entropy from key generation and signatures, and offers a similar API as salty.
In particular, all signatures are deterministic, similar to RFC 6979.
The flip side of this is that we need to pull in a CSRNG, for the ultra-rare case where a 32-byte seed does not directly give rise to a valid keypair; we use ChaCha20.
let seed = [1u8; 32]; // use an actually entropic seed let keypair = nisty::Keypair::from(&seed); let message = b"hello, nisty"; let signature = keypair.sign(message); assert!(keypair.public.verify(message, &signature));
no_std and Rust's limited feature tree handling don't play nice
together, on microcontrollers the bindings to
micro-ecc need to be pre-generated.
For Cortex-M4 and Cortex-M33 microcontrollers, they are packaged, and it is sufficient
nisty as follows:
[dependencies.nisty] default-features = false
When compiled as release build, these platforms automatically pick up UMAAL assembly optimizations.
On an NXP LPC55S69, signature generation takes around 6.9M cycles, signature verification around 7.6M.
Either there is an error, or there is not - no reasons given.
Create keys, generate signatures.
Public part of a keypair, a point on the curve.
Secret part of a keypair, a scalar.
32 entropic bytes, input for key generation.
Pair of two curve scalars.
the length of a public key when serialized in compressed format
the length of a public key when serialized
the length of a secret key when serialized
the length of a secret key seed when serialized
the length of a SHA256 digest
the length of a signature when serialized
How many hash digests were calculated for signatures so far.