Skip to content
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

fix: update message and signature key types #5064

Merged

Conversation

AaronFeickert
Copy link
Collaborator

@AaronFeickert AaronFeickert commented Dec 16, 2022

Description

Updates communications message and signature keys to use the new Hidden and SafeArray designs. Minor refactoring for clarity of design intent.

Motivation and Context

Communications messages are encrypted using the ChaCha20 unauthenticated stream cipher, and signatures are encrypted using the ChaCha20-Poly1305 authenticated stream cipher. However, the keys used for these purposes are defined using zeroize-on-drop GenericArray types; further, the hash derivation of the keys results in copies left in memory.

This work updates the key types to use the new Hidden and SafeArray designs. They are renamed to reflect their specific purposes, instantiated in place to reduce in-memory copies, and associated functions are also renamed to make their intent more clear.

How Has This Been Tested?

Existing tests pass.

Copy link
Collaborator

@SWvheerden SWvheerden left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utACK

@stringhandler stringhandler merged commit a94189d into tari-project:development Jan 3, 2023
@AaronFeickert AaronFeickert deleted the comms-keys-update branch January 3, 2023 15:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants