/** * @return the coeffquadratic */ public short[][] getCoeffQuadratic() { return RainbowUtil.convertArray(coeffQuadratic); }
/** * Returns the array of vi-s * * @return the vi */ public int[] getVi() { return RainbowUtil.convertArraytoInt(vi); }
public RainbowPrivateKey(short[][] invA1, short[] b1, short[][] invA2, short[] b2, int[] vi, Layer[] layers) { this.version = new ASN1Integer(1); this.invA1 = RainbowUtil.convertArray(invA1); this.b1 = RainbowUtil.convertArray(b1); this.invA2 = RainbowUtil.convertArray(invA2); this.b2 = RainbowUtil.convertArray(b2); this.vi = RainbowUtil.convertIntArray(vi); this.layers = layers; }
/** * Compare two two-dimensional short arrays. No null checks are performed. * * @param left the first short array * @param right the second short array * @return the result of the comparison */ public static boolean equals(short[][] left, short[][] right) { if (left.length != right.length) { return false; } boolean result = true; for (int i = left.length - 1; i >= 0; i--) { result &= equals(left[i], right[i]); } return result; }
/** * Compare two two-dimensional short arrays. No null checks are performed. * * @param left the first short array * @param right the second short array * @return the result of the comparison */ public static boolean equals(short[][] left, short[][] right) { if (left.length != right.length) { return false; } boolean result = true; for (int i = left.length - 1; i >= 0; i--) { result &= equals(left[i], right[i]); } return result; }
/** * Getter for the translation part of the private quadratic map L2. * * @return b2 the translation part of L2 */ public short[] getB2() { return RainbowUtil.convertArray(b2); }
public RainbowPrivateKey(short[][] invA1, short[] b1, short[][] invA2, short[] b2, int[] vi, Layer[] layers) { this.version = new ASN1Integer(1); this.invA1 = RainbowUtil.convertArray(invA1); this.b1 = RainbowUtil.convertArray(b1); this.invA2 = RainbowUtil.convertArray(invA2); this.b2 = RainbowUtil.convertArray(b2); this.vi = RainbowUtil.convertIntArray(vi); this.layers = layers; }
/** * Compare two three-dimensional short arrays. No null checks are performed. * * @param left the first short array * @param right the second short array * @return the result of the comparison */ public static boolean equals(short[][][] left, short[][][] right) { if (left.length != right.length) { return false; } boolean result = true; for (int i = left.length - 1; i >= 0; i--) { result &= equals(left[i], right[i]); } return result; }
/** * Returns the array of vi-s * * @return the vi */ public int[] getVi() { return RainbowUtil.convertArraytoInt(vi); }
/** * @return the coeffscalar */ public short[] getCoeffScalar() { return RainbowUtil.convertArray(coeffScalar); }
/** * Compare two three-dimensional short arrays. No null checks are performed. * * @param left the first short array * @param right the second short array * @return the result of the comparison */ public static boolean equals(short[][][] left, short[][][] right) { if (left.length != right.length) { return false; } boolean result = true; for (int i = left.length - 1; i >= 0; i--) { result &= equals(left[i], right[i]); } return result; }
/** * Getter for the translation part of the private quadratic map L2. * * @return b2 the translation part of L2 */ public short[] getB2() { return RainbowUtil.convertArray(b2); }
/** * Compare this Rainbow public key with another object. * * @param other the other object * @return the result of the comparison */ public boolean equals(Object other) { if (other == null || !(other instanceof BCRainbowPublicKey)) { return false; } BCRainbowPublicKey otherKey = (BCRainbowPublicKey)other; return docLength == otherKey.getDocLength() && RainbowUtil.equals(coeffquadratic, otherKey.getCoeffQuadratic()) && RainbowUtil.equals(coeffsingular, otherKey.getCoeffSingular()) && RainbowUtil.equals(coeffscalar, otherKey.getCoeffScalar()); }
/** * Getter for the inverse matrix of A2 * * @return the A2inv */ public short[][] getInvA2() { return RainbowUtil.convertArray(invA2); }
/** * This function compares this Layer with another object. * * @param other the other object * @return the result of the comparison */ public boolean equals(Object other) { if (other == null || !(other instanceof Layer)) { return false; } Layer otherLayer = (Layer)other; return vi == otherLayer.getVi() && viNext == otherLayer.getViNext() && oi == otherLayer.getOi() && RainbowUtil.equals(coeff_alpha, otherLayer.getCoeffAlpha()) && RainbowUtil.equals(coeff_beta, otherLayer.getCoeffBeta()) && RainbowUtil.equals(coeff_gamma, otherLayer.getCoeffGamma()) && RainbowUtil.equals(coeff_eta, otherLayer.getCoeffEta()); }
/** * @return the coeffquadratic */ public short[][] getCoeffQuadratic() { return RainbowUtil.convertArray(coeffQuadratic); }
/** * This function compares this Layer with another object. * * @param other the other object * @return the result of the comparison */ public boolean equals(Object other) { if (other == null || !(other instanceof Layer)) { return false; } Layer otherLayer = (Layer)other; return vi == otherLayer.getVi() && viNext == otherLayer.getViNext() && oi == otherLayer.getOi() && RainbowUtil.equals(coeff_alpha, otherLayer.getCoeffAlpha()) && RainbowUtil.equals(coeff_beta, otherLayer.getCoeffBeta()) && RainbowUtil.equals(coeff_gamma, otherLayer.getCoeffGamma()) && RainbowUtil.equals(coeff_eta, otherLayer.getCoeffEta()); }
/** * @return the coeffsingular */ public short[][] getCoeffSingular() { return RainbowUtil.convertArray(coeffSingular); }
/** * Compare this Rainbow private key with another object. * * @param other the other object * @return the result of the comparison */ public boolean equals(Object other) { if (other == null || !(other instanceof BCRainbowPrivateKey)) { return false; } BCRainbowPrivateKey otherKey = (BCRainbowPrivateKey)other; boolean eq = true; // compare using shortcut rule ( && instead of &) eq = eq && RainbowUtil.equals(A1inv, otherKey.getInvA1()); eq = eq && RainbowUtil.equals(A2inv, otherKey.getInvA2()); eq = eq && RainbowUtil.equals(b1, otherKey.getB1()); eq = eq && RainbowUtil.equals(b2, otherKey.getB2()); eq = eq && Arrays.equals(vi, otherKey.getVi()); if (layers.length != otherKey.getLayers().length) { return false; } for (int i = layers.length - 1; i >= 0; i--) { eq &= layers[i].equals(otherKey.getLayers()[i]); } return eq; }
/** * Getter for the inverse matrix of A2 * * @return the A2inv */ public short[][] getInvA2() { return RainbowUtil.convertArray(invA2); }