fabric
fabric copied to clipboard
[CRYPTO CLEANUP] A dedicated primitives (sub-)package for AES-CBC
Description
Focusing on the core/crypto/primitives
(package) and our extensive use of AES-CBC, we want to add more unit tests to lock/document and verify their correct/expected/standard/compliant behavior.
In particular, this issue is about having our "own" AESCBC
family of functions that clearly separate the IV
generation, the padding
(that is focused on the AES blocksize) and the underlying Golang stardard crypto
implementation.
The requirements leading to this item actually stemmed from needing/wanting to perform some crypto 'sanity checks' regularly (e.g., 2167 Add some standard/recommended NIST tests for AES256), but much more than this: Such a dedicated sub-package and functions (e.g., separating and calling the crypto/rand
OUTSIDE the encrypt/decrypt) calls will better serve a broader set of use-cases in fabric.
To make it easier for me to track these, I am associating this task with #2127 Add a family of AES-CBC related tests, which made/makes this task a lot easier as we can compare numbers/results against the Golang-based baseline.
Describe How to Reproduce
N/A (test refactoring/restructuring + new code).
The tests will be covered in the future by make unit-test
step.