[ https://issues.apache.org/jira/browse/ORC-251?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16542238#comment-16542238 ]
ASF GitHub Bot commented on ORC-251: ------------------------------------ Github user prasanthj commented on a diff in the pull request: https://github.com/apache/orc/pull/278#discussion_r202188844 --- Diff: java/core/src/java/org/apache/orc/impl/InStream.java --- @@ -173,33 +203,208 @@ private static ByteBuffer allocateBuffer(int size, boolean isDirect) { } } + /** + * Manage the state of the decryption, including the ability to seek. + */ + static class EncryptionState { + private final String name; + private final EncryptionAlgorithm algorithm; + private final Key key; + private final byte[] iv; + private final Cipher cipher; + private ByteBuffer decrypted; + + EncryptionState(String name, StreamOptions options) { + this.name = name; + algorithm = options.algorithm; + key = options.key; + iv = options.iv; + cipher = algorithm.createCipher(); + } + + /** + * We are seeking to a new range, so update the cipher to change the IV + * to match. This code assumes that we only support encryption in CTR mode. --- End diff -- Comment about how the bottom 8 bytes of IV will be filled (block counter) will be helpful. > Modify InStream and OutStream to optionally encrypt data > -------------------------------------------------------- > > Key: ORC-251 > URL: https://issues.apache.org/jira/browse/ORC-251 > Project: ORC > Issue Type: Sub-task > Reporter: Owen O'Malley > Assignee: Owen O'Malley > Priority: Major > -- This message was sent by Atlassian JIRA (v7.6.3#76005)