recrypt-rs icon indicating copy to clipboard operation
recrypt-rs copied to clipboard

Need more regression tests with fixed inputs to verify expected outputs

Open BobWall23 opened this issue 6 years ago • 1 comments

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

  • For a fixed RNG (all zeroes, all ones, or a known sequence of some kind), make sure we get the expected value from GeneratePlaintext
  • For a fixed RNG, make sure we get the expected output from GenerateKeyPair
  • For a fixed RNG and fixed input, make sure we get the expected TransformKey

Similar checks for encrypt operations and transform operations.

BobWall23 avatar Oct 28 '19 22:10 BobWall23

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 ]

BobWall23 avatar Oct 30 '19 19:10 BobWall23