-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
tiny functions added/implemented ( #139 ) #146
Conversation
Hi @lvntky this looks great! There's actually no need to implement a We can continue to use this function, but replace the We should then remove the parameter from the |
hi @chester-leung thank you for this great and informative explanation. So as I understand I make only changes on |
@lvntky yes that's correct. You should only have to make a change in the |
@chester-leung thank you very much! I'm on to it then |
hi @chester-leung I made a new contribution and small changes. I deleted the |
python-package/mc2client/core.py
Outdated
@@ -603,7 +604,7 @@ def generate_symmetric_key(num_bytes=32): | |||
) | |||
return | |||
|
|||
key = AESGCM.generate_key(bit_length=num_bytes * 8) | |||
key = AESGCM.generate_key(bit_length= _LIB.cipher_key_size() * 8) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please create a variable num_bytes
and set it to _LIB.cipher_key_size()
for clarity? This will add one more line but should make things easier to read.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
of course I'm doing it right now
hi @chester-leung I add |
Thanks! Please update us once you've fixed the build and reformatted. |
hi @chester-leung thank you for your patience and friendly instructions. i added a semicolon to cpp function and I run the |
python-package/mc2client/core.py
Outdated
@@ -591,6 +591,16 @@ def generate_symmetric_key(num_bytes=32): | |||
num_bytes : int | |||
Number of bytes for key | |||
""" | |||
|
|||
""" | |||
Due the issue #139, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove these comments
src/c_api.cpp
Outdated
@@ -142,3 +142,7 @@ extern "C" void opaque_decrypt_data(char **encrypted_files, | |||
plaintext_file, key_file); | |||
*result = status; | |||
} | |||
|
|||
// function created for to not to allow user specifies cipher key |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please remove this comment
Pre-commit essentially installs some git "hooks" that will reformat your code before you commit. I'm not sure if the code has been formatted correctly - in particular, there likely shouldn't be a space between Here are some instructions
Then, after you make a change to the code and By build, I meant these checks It looks like you're passing them now, great! Eventually we'll want to also add a linter check to enforce formatting (and to ensure that all contributors have run the pre-commit formatting hooks. |
hi @chester-leung i deleted the comments and run pre-commit. here is the screenshot: |
This looks good! Just FYI, when you run pre-commit and it modifies some files, you'll have to readd the modified files to the git staging area. Formatting looks good for now though! Once the checks pass, we can merge this in. Thanks for your contribution @lvntky ! |
thank you very much for your friendly and informative information @chester-leung i am really glad to my first contribution is for mc2. I will hunting the issues again 😄 |
yup I am totally interested friend, i have small work into job after that i dive to them 😄 |
Hi, I added 2 tiny functions due the issue #139 . I did not implement the
generate_symmetric_key
function because I'm not sure that I'm on the right track, and I don't want to affect the project badly. And sorry if I do something silly :) this is my first ever PR. Anyway, if the implementation goes right I can start the implementinggenerate_symmetric_key
function similar to this function.