-
Notifications
You must be signed in to change notification settings - Fork 4
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
make JamtisDestinationV1 serializable #11
make JamtisDestinationV1 serializable #11
Conversation
@@ -71,6 +77,21 @@ struct jamtis_mock_keys | |||
rct::key K_1_base; //jamtis spend base = k_vb X + k_m U | |||
crypto::x25519_pubkey xK_ua; //unlock-amounts pubkey = xk_ua xG | |||
crypto::x25519_pubkey xK_fr; //find-received pubkey = xk_fr xk_ua xG | |||
|
|||
crypto::chacha_iv m_encryption_iv; |
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.
I would prefer that you implement a password-protected wrapper class instead of embedding encryption details inside the struct.
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.
I think you could write a template for password-protected keys.
A) static assert that the template type is POD
B) encrypt/decrypt the entire data struct as raw data (cast to void* and encrypt/decrypt in-place)
C) use RAII somehow to ensure the struct is re-encrypted as needed
D) be sure to safely handle multithreaded access to the protected container
Thanks for the detailed comments. I will let ghostway make the changes (if he did not do it yet) related to the key_container (jamtis_mock_keys.*) as he is working on it. So I removed this part from the PR. |
serializable_dest_out.addr_K1 = dest.addr_K1; | ||
serializable_dest_out.addr_K2 = dest.addr_K2; | ||
serializable_dest_out.addr_K3 = dest.addr_K3; |
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.
serializable_dest_out.addr_K1 = dest.addr_K1; | |
serializable_dest_out.addr_K2 = dest.addr_K2; | |
serializable_dest_out.addr_K3 = dest.addr_K3; | |
serializable_dest_out.addr_K1 = dest.addr_K1; | |
serializable_dest_out.addr_K2 = dest.addr_K2; | |
serializable_dest_out.addr_K3 = dest.addr_K3; |
dest_out.addr_K1 = serializable_destination.addr_K1; | ||
dest_out.addr_K2 = serializable_destination.addr_K2; | ||
dest_out.addr_K3 = serializable_destination.addr_K3; |
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.
dest_out.addr_K1 = serializable_destination.addr_K1; | |
dest_out.addr_K2 = serializable_destination.addr_K2; | |
dest_out.addr_K3 = serializable_destination.addr_K3; | |
dest_out.addr_K1 = serializable_destination.addr_K1; | |
dest_out.addr_K2 = serializable_destination.addr_K2; | |
dest_out.addr_K3 = serializable_destination.addr_K3; |
make JamtisDestinationV1 serializable --------- Co-authored-by: DangerousFreedom <[email protected]>
make JamtisDestinationV1 serializable --------- Co-authored-by: DangerousFreedom <[email protected]>
make JamtisDestinationV1 serializable --------- Co-authored-by: DangerousFreedom <[email protected]>
make JamtisDestinationV1 serializable --------- Co-authored-by: DangerousFreedom <[email protected]>
make JamtisDestinationV1 serializable --------- Co-authored-by: DangerousFreedom <[email protected]>
Could you please add these changes? I need to work with a serialized JamtisDestinationV1.