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

Results from recrypt.transform cannot be serialized #168

Closed
gkarc opened this issue May 30, 2022 · 1 comment
Closed

Results from recrypt.transform cannot be serialized #168

gkarc opened this issue May 30, 2022 · 1 comment
Labels
wontfix This will not be worked on

Comments

@gkarc
Copy link

gkarc commented May 30, 2022

I want to serialise this

let transformed_val = recrypt.transform(
    encrypted_val,
    initial_to_target_transform_key,
    &signing_keypair).unwrap();

Core implementation does not support Serialization

#[derive(Debug, Clone, PartialEq, Eq, Hash)] //cannot derive Copy because of NonEmptyVec
pub enum EncryptedValue {
    /// Value which has been encrypted, but not transformed
    /// `ephemeral_public_key`  - public key of the ephemeral private key that was used to encrypt
    /// `encrypted_message`     - encrypted symmetric key
    /// `auth_hash`             - authentication hash for the Plaintext
    /// `public_signing_key`    - public portion of Ed25519 signing key
    /// `signature`             - Ed25519-produced signature
    EncryptedOnceValue {
        ephemeral_public_key: PublicKey,
        encrypted_message: EncryptedMessage,
        auth_hash: AuthHash,
        public_signing_key: PublicSigningKey,
        signature: Ed25519Signature,
    },
    /// Value which has been encrypted and then transformed n times for n > 0.
    /// `ephemeral_public_key`  - public key of the ephemeral private key that was used to encrypt
    /// `encrypted_message`     - encrypted symmetric key
    /// `auth_hash`             - authentication hash for the Plaintext
    /// `transform_blocks`      - information used in transformation process. One entry for each transform.
    /// `public_signing_key`    - public portion of Ed25519 signing key
    /// `signature`             - Ed25519-produced signature
    TransformedValue {
        ephemeral_public_key: PublicKey,
        encrypted_message: EncryptedMessage,
        auth_hash: AuthHash,
        transform_blocks: NonEmptyVec<TransformBlock>,
        public_signing_key: PublicSigningKey,
        signature: Ed25519Signature,
    },
}

and I want to construct this object from a remote client
I found that it was not implement serialization

How to accomplish this ?

@coltfred
Copy link
Member

coltfred commented Jun 2, 2022

@gkarc Sorry for the delay. I lost track of the question in my backlog.

At the time that we wrote this we didn't implement serde on any of our public types. We might change that if we were to take another look, but don't have plans to do it right now. If you'd like to add support we'd certainly consider a serde implementation PR.

When we need to serialize EncryptedValue in IronOxide we take each field and put them into a protobuf object.

@skeet70 skeet70 added the wontfix This will not be worked on label Oct 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

4 participants