IronCoreLabs / recrypt-rs

A set of cryptographic primitives for building a multi-hop Proxy Re-encryption scheme, known as Transform Encryption.
https://crates.io/crates/recrypt
GNU Affero General Public License v3.0
144 stars 23 forks source link

Need more regression tests with fixed inputs to verify expected outputs #96

Open BobWall23 opened 4 years ago

BobWall23 commented 4 years ago

Should have more tests that run hard-coded values through the recrypt algorithms to verify that the expected outputs are produced. For example:

Similar checks for encrypt operations and transform operations.

BobWall23 commented 4 years ago

Step 1: Identify all the known value tests that are required, and indicate which of them are already in place. Should include tests for edge cases (particularly for private key values > r).

+ indicates tests complete already - indicates tests partially complete

+ CryptoOps.derive_symmetric_key
+ CryptoOps.decrypt
  CryptoOps.encrypt
  CryptoOps.gen_plaintext
  CryptoOps.transform
+ Ed25519Ops.generate_ed25519_key_pair
+ Ed25519.sign
  KeyGenOps.compute_public_key  (partial - might need a test for private key > r)
+ KeyGenOps.generate_key_pair
  KeyGenOps.generate_transform_key
  KeyGenOps.random_private_key  (maybe not needed, but wouldn't hurt)
  Pairing.pair
- PrivateKey.add  (partially complete - the addition that produces result > p seems off)
- PrivateKey.subtract   (partially complete - the addition that produces result > p seems off)
  PublicKey.augment  (maybe not needed, but wouldn't hurt)
+ SchnorrOps.schnorr_sign
  SchnorrOps.schnorr_verify

[ In progress - still analyzing code ]