mc2-project / mc2

A Platform for Secure Analytics and Machine Learning
Apache License 2.0
297 stars 44 forks source link

Use C++ CIPHER_KEY_SIZE as key size in `generate_symmetric_key` #139

Closed chester-leung closed 3 years ago

chester-leung commented 3 years ago

To prevent inconsistent key sizes across the MC2 ecosystem, we should not allow users to specify a key size in generate_symmetric_key(). Instead, we should retrieve the CIPHER_KEY_SIZE from C++, similar to this, and use the CIPHER_KEY_SIZE as the number of bytes for our generated key.

To do so, we'll need to add a function in src/c_api.cpp, similar to the cipher_iv_size() function that gets the CIPHER_KEY_SIZE from C++.

lvntky commented 3 years ago

hello @chester-leung i can fork and take a look if you don't start the issue.

chester-leung commented 3 years ago

Hi @lvntky, that would be great!

lvntky commented 3 years ago

@chester-leung sorry for the delay I've been busy for few days at my job and can't log in to GitHub. now I'm forked the project, I'm working on it. I hope I can figure it out, Best wishes!