aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/app/src/main/java/com/wireguard/crypto/KeyEncoding.java
diff options
context:
space:
mode:
authorSamuel Holland <samuel@sholland.org>2018-01-08 20:42:58 -0600
committerSamuel Holland <samuel@sholland.org>2018-01-08 23:39:26 -0600
commit4f02817ef0a7f0383468805f8e9a976a85d43e3e (patch)
treefb26bd712c81c6730d92e61ccec574c002ed4ab1 /app/src/main/java/com/wireguard/crypto/KeyEncoding.java
parentproject: Remove currently-unused library (diff)
downloadwireguard-android-4f02817ef0a7f0383468805f8e9a976a85d43e3e.tar.xz
wireguard-android-4f02817ef0a7f0383468805f8e9a976a85d43e3e.zip
global: Fix or suppress most lints/warnings
Signed-off-by: Samuel Holland <samuel@sholland.org>
Diffstat (limited to 'app/src/main/java/com/wireguard/crypto/KeyEncoding.java')
-rw-r--r--app/src/main/java/com/wireguard/crypto/KeyEncoding.java7
1 files changed, 6 insertions, 1 deletions
diff --git a/app/src/main/java/com/wireguard/crypto/KeyEncoding.java b/app/src/main/java/com/wireguard/crypto/KeyEncoding.java
index f83fd0b1..99ff0ee9 100644
--- a/app/src/main/java/com/wireguard/crypto/KeyEncoding.java
+++ b/app/src/main/java/com/wireguard/crypto/KeyEncoding.java
@@ -6,12 +6,17 @@ package com.wireguard.crypto;
* This is a specialized constant-time base64 implementation that resists side-channel attacks.
*/
-public class KeyEncoding {
+@SuppressWarnings("MagicNumber")
+public final class KeyEncoding {
public static final int KEY_LENGTH = 32;
public static final int KEY_LENGTH_BASE64 = 44;
private static final String KEY_LENGTH_BASE64_EXCEPTION_MESSAGE =
"WireGuard base64 keys must be 44 characters encoding 32 bytes";
+ private KeyEncoding() {
+ // Prevent instantiation.
+ }
+
private static int decodeBase64(final char[] src, final int src_offset) {
int val = 0;
for (int i = 0; i < 4; ++i) {