Skip to content

Added CipherCodec for pipeline encryption. - #824

Closed
ghost wants to merge 3 commits into
masterfrom
unknown repository
Closed

ghost wants to merge 3 commits into
masterfrom
unknown repository

Conversation

@ghost

@ghost ghost commented Dec 16, 2012

Copy link
Copy Markdown

What do you think about that?

@normanmaurer

Copy link
Copy Markdown
Member

@macer1 sorry but I have quite some back-log.. Will try review tomorrow

@ghost

ghost commented Dec 17, 2012

Copy link
Copy Markdown
Author

Memory usage improvement is significant with resetting buffer to 0 👍

@md-5

md-5 commented Dec 19, 2012

Copy link
Copy Markdown
Contributor

But shrinking the entire buffer every encode D:

@ghost

ghost commented Dec 19, 2012

Copy link
Copy Markdown
Author

but less memory usage D:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Instead of doing this, you can just keep heapOut as a local variable and allocate it every time and free it:

ByteBuf heapOut = ctx.alloc().heapBuffer(cap);
try {
    process(...);
    ...
} finally {
    heapOut.free();
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

You could use cipher.getOutputSize(readable) to determine the best capacity at the beginning for even more savings.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

good idea
done

@trustin

trustin commented Dec 19, 2012

Copy link
Copy Markdown
Member

@ghost

ghost commented Dec 19, 2012

Copy link
Copy Markdown
Author

also, how about making this.encrypt/decrypt protected so user can do like

public class AESCipherCodec extends CipherCodec {
    public AESCipherCodec(Key encryptionKey) throws Exception {
        IvParameterSpec ivSpec = new IvParameterSpec(encryptionKey.getEncoded());
        this.encrypt = getAESCipher(true, encryptionKey, ivSpec);
        this.decrypt = getAESCipher(false, encryptionKey, ivSpec);
    }

@ghost

ghost commented Dec 19, 2012

Copy link
Copy Markdown
Author

please tell me when you think it is all done, I will squash the commits

@md-5

md-5 commented Dec 19, 2012

Copy link
Copy Markdown
Contributor

You can't license it under that and expect it to get pulled.

@ghost

ghost commented Dec 19, 2012

Copy link
Copy Markdown
Author

whatever, signed that CLA instead

@ghost ghost closed this Dec 24, 2012
normanmaurer added a commit that referenced this pull request Sep 15, 2025
Motivation:

The used version of BoringSSL is ASL2

Modifications:

Update and so fix license informations for BoringSSL

Result:

Include correct license for BoringSSL
This pull request was closed.
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