diff --git a/src/main/java/com/google/crypto/tink/internal/BUILD.bazel b/src/main/java/com/google/crypto/tink/internal/BUILD.bazel index 0b0f6d452..70c79399f 100644 --- a/src/main/java/com/google/crypto/tink/internal/BUILD.bazel +++ b/src/main/java/com/google/crypto/tink/internal/BUILD.bazel @@ -799,13 +799,13 @@ java_library( ) android_library( - name = "stuttering_input_stream-android", + name = "slow_input_stream-android", testonly = 1, - srcs = ["StutteringInputStream.java"], + srcs = ["SlowInputStream.java"], ) java_library( - name = "stuttering_input_stream", + name = "slow_input_stream", testonly = 1, - srcs = ["StutteringInputStream.java"], + srcs = ["SlowInputStream.java"], ) diff --git a/src/main/java/com/google/crypto/tink/internal/StutteringInputStream.java b/src/main/java/com/google/crypto/tink/internal/SlowInputStream.java similarity index 86% rename from src/main/java/com/google/crypto/tink/internal/StutteringInputStream.java rename to src/main/java/com/google/crypto/tink/internal/SlowInputStream.java index 39acd4d30..a3366e18d 100644 --- a/src/main/java/com/google/crypto/tink/internal/StutteringInputStream.java +++ b/src/main/java/com/google/crypto/tink/internal/SlowInputStream.java @@ -24,16 +24,16 @@ * An implementation of ByteArrayInputStream which returns each element separately. Used for testing * only. */ -public final class StutteringInputStream extends InputStream { +public final class SlowInputStream extends InputStream { private final byte[] result; private int pos = 0; - private StutteringInputStream(byte[] b) { + private SlowInputStream(byte[] b) { result = b; } - public static StutteringInputStream copyFrom(byte[] b) { - return new StutteringInputStream(Arrays.copyOf(b, b.length)); + public static SlowInputStream copyFrom(byte[] b) { + return new SlowInputStream(Arrays.copyOf(b, b.length)); } @Override diff --git a/src/test/java/com/google/crypto/tink/aead/AesGcmSivKeyManagerTest.java b/src/test/java/com/google/crypto/tink/aead/AesGcmSivKeyManagerTest.java index e889471ab..64ae2584e 100644 --- a/src/test/java/com/google/crypto/tink/aead/AesGcmSivKeyManagerTest.java +++ b/src/test/java/com/google/crypto/tink/aead/AesGcmSivKeyManagerTest.java @@ -30,7 +30,7 @@ import com.google.crypto.tink.Parameters; import com.google.crypto.tink.aead.subtle.AesGcmSiv; import com.google.crypto.tink.internal.KeyTypeManager; -import com.google.crypto.tink.internal.StutteringInputStream; +import com.google.crypto.tink.internal.SlowInputStream; import com.google.crypto.tink.proto.AesGcmSivKey; import com.google.crypto.tink.proto.AesGcmSivKeyFormat; import com.google.crypto.tink.proto.KeyData.KeyMaterialType; @@ -374,7 +374,7 @@ public void testCreateKeyFromRandomness_stuttering() throws Exception { com.google.crypto.tink.aead.AesGcmSivKey key = AesGcmSivKeyManager.createAesGcmSivKeyFromRandomness( parameters, - StutteringInputStream.copyFrom(keyMaterial), + SlowInputStream.copyFrom(keyMaterial), parameters.hasIdRequirement() ? 123 : null, InsecureSecretKeyAccess.get()); byte[] truncatedKeyMaterial = Arrays.copyOf(keyMaterial, parameters.getKeySizeBytes()); diff --git a/src/test/java/com/google/crypto/tink/internal/BUILD.bazel b/src/test/java/com/google/crypto/tink/internal/BUILD.bazel index ec88555c7..f93226b09 100644 --- a/src/test/java/com/google/crypto/tink/internal/BUILD.bazel +++ b/src/test/java/com/google/crypto/tink/internal/BUILD.bazel @@ -570,11 +570,11 @@ java_test( ) java_test( - name = "StutteringInputStreamTest", + name = "SlowInputStreamTest", size = "small", - srcs = ["StutteringInputStreamTest.java"], + srcs = ["SlowInputStreamTest.java"], deps = [ - "//src/main/java/com/google/crypto/tink/internal:stuttering_input_stream", + "//src/main/java/com/google/crypto/tink/internal:slow_input_stream", "@maven//:com_google_truth_truth", "@maven//:junit_junit", ], diff --git a/src/test/java/com/google/crypto/tink/internal/StutteringInputStreamTest.java b/src/test/java/com/google/crypto/tink/internal/SlowInputStreamTest.java similarity index 89% rename from src/test/java/com/google/crypto/tink/internal/StutteringInputStreamTest.java rename to src/test/java/com/google/crypto/tink/internal/SlowInputStreamTest.java index eb8999ad5..b48b3603c 100644 --- a/src/test/java/com/google/crypto/tink/internal/StutteringInputStreamTest.java +++ b/src/test/java/com/google/crypto/tink/internal/SlowInputStreamTest.java @@ -23,11 +23,11 @@ import org.junit.runners.JUnit4; @RunWith(JUnit4.class) -public final class StutteringInputStreamTest { +public final class SlowInputStreamTest { @Test public void testNoArgsRead_works() throws Exception { byte[] b = new byte[] {(byte) 254, 0, (byte) 255}; - StutteringInputStream s = StutteringInputStream.copyFrom(b); + SlowInputStream s = SlowInputStream.copyFrom(b); assertThat(s.read()).isEqualTo(254); assertThat(s.read()).isEqualTo(0); assertThat(s.read()).isEqualTo(255); @@ -37,7 +37,7 @@ public void testNoArgsRead_works() throws Exception { @Test public void testWithBuffer_works() throws Exception { byte[] b = new byte[] {(byte) 254, 0, (byte) 255}; - StutteringInputStream s = StutteringInputStream.copyFrom(b); + SlowInputStream s = SlowInputStream.copyFrom(b); byte[] buffer = new byte[10]; assertThat(s.read(buffer, 0, 10)).isEqualTo(1); @@ -52,7 +52,7 @@ public void testWithBuffer_works() throws Exception { @Test public void testWithBuffer_len0() throws Exception { byte[] b = new byte[] {(byte) 254, 0, (byte) 255}; - StutteringInputStream s = StutteringInputStream.copyFrom(b); + SlowInputStream s = SlowInputStream.copyFrom(b); assertThat(s.read(b, 0, 0)).isEqualTo(0); } }