what-the-bank/sources/org/bouncycastle/pqc/crypto/gmss/GMSSUtils.java

111 lines
3.5 KiB
Java

package org.bouncycastle.pqc.crypto.gmss;
import java.util.Enumeration;
import java.util.Vector;
import org.bouncycastle.util.Arrays;
/* JADX INFO: Access modifiers changed from: package-private */
/* loaded from: classes6.dex */
public class GMSSUtils {
static byte[][][] clone(byte[][][] bArr) {
if (bArr == null) {
return null;
}
byte[][][] bArr2 = new byte[bArr.length][];
for (int i = 0; i != bArr.length; i++) {
bArr2[i] = clone(bArr[i]);
}
return bArr2;
}
static Treehash[][] clone(Treehash[][] treehashArr) {
if (treehashArr == null) {
return null;
}
Treehash[][] treehashArr2 = new Treehash[treehashArr.length];
for (int i = 0; i != treehashArr.length; i++) {
treehashArr2[i] = clone(treehashArr[i]);
}
return treehashArr2;
}
static Vector[][] clone(Vector[][] vectorArr) {
if (vectorArr == null) {
return null;
}
Vector[][] vectorArr2 = new Vector[vectorArr.length];
for (int i = 0; i != vectorArr.length; i++) {
vectorArr2[i] = clone(vectorArr[i]);
}
return vectorArr2;
}
/* JADX INFO: Access modifiers changed from: package-private */
public static byte[][] clone(byte[][] bArr) {
if (bArr == null) {
return null;
}
byte[][] bArr2 = new byte[bArr.length];
for (int i = 0; i != bArr.length; i++) {
bArr2[i] = Arrays.clone(bArr[i]);
}
return bArr2;
}
/* JADX INFO: Access modifiers changed from: package-private */
public static Treehash[] clone(Treehash[] treehashArr) {
if (treehashArr == null) {
return null;
}
Treehash[] treehashArr2 = new Treehash[treehashArr.length];
System.arraycopy(treehashArr, 0, treehashArr2, 0, treehashArr.length);
return treehashArr2;
}
static GMSSRootSig[] clone(GMSSRootSig[] gMSSRootSigArr) {
if (gMSSRootSigArr == null) {
return null;
}
GMSSRootSig[] gMSSRootSigArr2 = new GMSSRootSig[gMSSRootSigArr.length];
System.arraycopy(gMSSRootSigArr, 0, gMSSRootSigArr2, 0, gMSSRootSigArr.length);
return gMSSRootSigArr2;
}
static GMSSRootCalc[] clone(GMSSRootCalc[] gMSSRootCalcArr) {
if (gMSSRootCalcArr == null) {
return null;
}
GMSSRootCalc[] gMSSRootCalcArr2 = new GMSSRootCalc[gMSSRootCalcArr.length];
System.arraycopy(gMSSRootCalcArr, 0, gMSSRootCalcArr2, 0, gMSSRootCalcArr.length);
return gMSSRootCalcArr2;
}
static GMSSLeaf[] clone(GMSSLeaf[] gMSSLeafArr) {
if (gMSSLeafArr == null) {
return null;
}
GMSSLeaf[] gMSSLeafArr2 = new GMSSLeaf[gMSSLeafArr.length];
System.arraycopy(gMSSLeafArr, 0, gMSSLeafArr2, 0, gMSSLeafArr.length);
return gMSSLeafArr2;
}
/* JADX INFO: Access modifiers changed from: package-private */
public static Vector[] clone(Vector[] vectorArr) {
if (vectorArr == null) {
return null;
}
Vector[] vectorArr2 = new Vector[vectorArr.length];
for (int i = 0; i != vectorArr.length; i++) {
vectorArr2[i] = new Vector();
Enumeration elements = vectorArr[i].elements();
while (elements.hasMoreElements()) {
vectorArr2[i].addElement(elements.nextElement());
}
}
return vectorArr2;
}
GMSSUtils() {
}
}