From 11cf84dedc517bcdfbfbeef5f8b5fb9997f399a0 Mon Sep 17 00:00:00 2001 From: akwizgran <akwizgran@users.sourceforge.net> Date: Mon, 19 Sep 2011 14:53:12 +0100 Subject: [PATCH] Arrays.copyOfRange() is not available in Java 5. --- components/net/sf/briar/crypto/SharedSecret.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/components/net/sf/briar/crypto/SharedSecret.java b/components/net/sf/briar/crypto/SharedSecret.java index 2240164517..111e544f72 100644 --- a/components/net/sf/briar/crypto/SharedSecret.java +++ b/components/net/sf/briar/crypto/SharedSecret.java @@ -1,7 +1,5 @@ package net.sf.briar.crypto; -import java.util.Arrays; - import javax.crypto.spec.IvParameterSpec; /** @@ -35,7 +33,9 @@ class SharedSecret { default: throw new IllegalArgumentException(); } - ciphertext = Arrays.copyOfRange(secret, IV_BYTES + 1, secret.length); + ciphertext = new byte[secret.length - IV_BYTES - 1]; + System.arraycopy(secret, IV_BYTES + 1, ciphertext, 0, + ciphertext.length); } SharedSecret(IvParameterSpec iv, boolean alice, byte[] ciphertext) { -- GitLab