From 57987af8056c109f7c2d520c58aedf2cbd6826db Mon Sep 17 00:00:00 2001 From: Daniel Hugenroth Date: Thu, 29 Feb 2024 15:58:17 +0000 Subject: [PATCH] Android: fix the :bench instrumentation test target --- .github/workflows/android.yaml | 4 ++-- .../com/lambdapioneer/sloth/bench/HiddenSlothBenchTest.kt | 8 ++++---- .../com/lambdapioneer/sloth/bench/LongSlothBenchTest.kt | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/android.yaml b/.github/workflows/android.yaml index 0f193ab..6659325 100644 --- a/.github/workflows/android.yaml +++ b/.github/workflows/android.yaml @@ -30,9 +30,9 @@ jobs: - name: Install dependencies run: sudo apt-get install -y tree - - name: Build app (debug) with Gradle + - name: Build all targets (debug) with Gradle working-directory: android - run: ./gradlew :app:assembleDebug + run: ./gradlew assembleDebug assembleAndroidTest - name: Build lib release and publish locally working-directory: android diff --git a/android/bench/src/androidTest/java/com/lambdapioneer/sloth/bench/HiddenSlothBenchTest.kt b/android/bench/src/androidTest/java/com/lambdapioneer/sloth/bench/HiddenSlothBenchTest.kt index 4663095..12ac1ff 100644 --- a/android/bench/src/androidTest/java/com/lambdapioneer/sloth/bench/HiddenSlothBenchTest.kt +++ b/android/bench/src/androidTest/java/com/lambdapioneer/sloth/bench/HiddenSlothBenchTest.kt @@ -126,7 +126,7 @@ class HiddenSlothBenchTest { if (operationUnderTest == HiddenSlothOperationUnderTest.DECRYPT || operationUnderTest == HiddenSlothOperationUnderTest.DECRYPT_WITH_CACHED_KEY) { hiddenSloth.encrypt( storage = storage, - pw = DEFAULT_PASSWORD, + pw = DEFAULT_PASSWORD.toCharArray(), data = maxSizeEncryptionPayload, tracer = NoopTracer(), ) @@ -137,7 +137,7 @@ class HiddenSlothBenchTest { if (operationUnderTest == HiddenSlothOperationUnderTest.DECRYPT_WITH_CACHED_KEY) { hiddenSloth.computeCachedSecrets( storage = storage, - pw = DEFAULT_PASSWORD, + pw = DEFAULT_PASSWORD.toCharArray(), ) } else { null @@ -160,7 +160,7 @@ class HiddenSlothBenchTest { HiddenSlothOperationUnderTest.DECRYPT -> hiddenSloth.decrypt( storage = storage, - pw = DEFAULT_PASSWORD, + pw = DEFAULT_PASSWORD.toCharArray(), tracer = tracer ) @@ -177,7 +177,7 @@ class HiddenSlothBenchTest { HiddenSlothOperationUnderTest.ENCRYPT -> hiddenSloth.encrypt( storage = storage, - pw = DEFAULT_PASSWORD, + pw = DEFAULT_PASSWORD.toCharArray(), data = maxSizeEncryptionPayload, tracer = tracer ) diff --git a/android/bench/src/androidTest/java/com/lambdapioneer/sloth/bench/LongSlothBenchTest.kt b/android/bench/src/androidTest/java/com/lambdapioneer/sloth/bench/LongSlothBenchTest.kt index 3ee2e69..9405229 100644 --- a/android/bench/src/androidTest/java/com/lambdapioneer/sloth/bench/LongSlothBenchTest.kt +++ b/android/bench/src/androidTest/java/com/lambdapioneer/sloth/bench/LongSlothBenchTest.kt @@ -73,7 +73,7 @@ class LongSlothBenchTest { ) keyGenInstance.keyGen( storage = storage, - pw = defaultPassword, + pw = defaultPassword.toCharArray(), h = defaultKeyHandle, outputLengthBytes = defaultOutputKeyLength ) @@ -91,7 +91,7 @@ class LongSlothBenchTest { ) deriveInstance.derive( storage = storage, - pw = defaultPassword, + pw = defaultPassword.toCharArray(), outputLengthBytes = defaultOutputKeyLength ) }