Using streams instead of channels for streaming encryption.
Structure of the streaming encryption: StreamingAead.java the interface for the streaming primitive. Instances of this contain a key and can construct streams for encryption and decryption. NonceBasedStreamingAead an abstract implementation of StreamAead based on the paper https://eprint.iacr.org/2015/189.pdf This class is abstract since it defines for example no cipher. StreamingAeadSegmentEncrypter.java An interface for a class that encrypts segments in NonceBasedStreamingAead. StreamingAeadSegmentDecrypter.java The same for decrypting segments. AesCtrHmacStreaming.java A subclass of NonceBasedStreamingAead that uses Aes in CTR mode with HMAC to implement the cipher. AesGcmHkdfStreaming.java Another subclass of NonceBasedStreamingAead that uses Aes-Gcm as underlying cipher. StreamingAeadDecryptingChannel.java A ReadableByteChannel based on NonceBasedStreamingAead State of this CL: - Encryption and Decryption with Streams did pass all tests. - Tests with files and streams are still missing. - Tests with writers and streams are still missing. - thread safety. This CL is the result of merging Daniel's cr/169684739. Change-Id: Id64336a2f538fee2b15a2a9f01e9e24dfa6c35b3 ORIGINAL_AUTHOR=Thai Duong <thaidn@google.com> GitOrigin-RevId: 9802e0ee9bae44f4247975873ee1143e8a34b620
Showing
- java/src/main/java/com/google/crypto/tink/StreamingAead.java 39 additions, 13 deletionsjava/src/main/java/com/google/crypto/tink/StreamingAead.java
- java/src/main/java/com/google/crypto/tink/streamingaead/StreamingAeadFactory.java 3 additions, 7 deletions...oogle/crypto/tink/streamingaead/StreamingAeadFactory.java
- java/src/main/java/com/google/crypto/tink/streamingaead/StreamingAeadHelper.java 17 additions, 0 deletions...google/crypto/tink/streamingaead/StreamingAeadHelper.java
- java/src/main/java/com/google/crypto/tink/subtle/AesCtrHmacStreaming.java 41 additions, 80 deletions...va/com/google/crypto/tink/subtle/AesCtrHmacStreaming.java
- java/src/main/java/com/google/crypto/tink/subtle/AesGcmHkdfStreaming.java 40 additions, 78 deletions...va/com/google/crypto/tink/subtle/AesGcmHkdfStreaming.java
- java/src/main/java/com/google/crypto/tink/subtle/BUILD 3 additions, 0 deletionsjava/src/main/java/com/google/crypto/tink/subtle/BUILD
- java/src/main/java/com/google/crypto/tink/subtle/NonceBasedStreamingAead.java 86 additions, 0 deletions...om/google/crypto/tink/subtle/NonceBasedStreamingAead.java
- java/src/main/java/com/google/crypto/tink/subtle/StreamingAeadDecryptingChannel.java 14 additions, 15 deletions...le/crypto/tink/subtle/StreamingAeadDecryptingChannel.java
- java/src/main/java/com/google/crypto/tink/subtle/StreamingAeadDecryptingStream.java 276 additions, 0 deletions...gle/crypto/tink/subtle/StreamingAeadDecryptingStream.java
- java/src/main/java/com/google/crypto/tink/subtle/StreamingAeadEncryptingChannel.java 14 additions, 10 deletions...le/crypto/tink/subtle/StreamingAeadEncryptingChannel.java
- java/src/main/java/com/google/crypto/tink/subtle/StreamingAeadEncryptingStream.java 115 additions, 0 deletions...gle/crypto/tink/subtle/StreamingAeadEncryptingStream.java
- java/src/main/java/com/google/crypto/tink/subtle/StreamingAeadSeekableDecryptingChannel.java 38 additions, 27 deletions...o/tink/subtle/StreamingAeadSeekableDecryptingChannel.java
- java/src/test/java/com/google/crypto/tink/StreamingTestUtil.java 1 addition, 1 deletion...c/test/java/com/google/crypto/tink/StreamingTestUtil.java
- java/src/test/java/com/google/crypto/tink/subtle/AesCtrHmacStreamingTest.java 3 additions, 3 deletions...om/google/crypto/tink/subtle/AesCtrHmacStreamingTest.java
- java/src/test/java/com/google/crypto/tink/subtle/AesGcmHkdfStreamingTest.java 2 additions, 2 deletions...om/google/crypto/tink/subtle/AesGcmHkdfStreamingTest.java
- java/src/test/java/com/google/crypto/tink/subtle/StreamingAeadThreadSafetyTest.java 7 additions, 2 deletions...gle/crypto/tink/subtle/StreamingAeadThreadSafetyTest.java
Loading
Please register or sign in to comment