public BCRainbowPublicKey( RainbowPublicKeyParameters params) { this(params.getDocLength(), params.getCoeffQuadratic(), params.getCoeffSingular(), params.getCoeffScalar()); }
short[][] coeff_quadratic = ((RainbowPublicKeyParameters)this.key).getCoeffQuadratic(); short[][] coeff_singular = ((RainbowPublicKeyParameters)this.key).getCoeffSingular(); short[] coeff_scalar = ((RainbowPublicKeyParameters)this.key).getCoeffScalar();
static public AsymmetricKeyParameter generatePublicKeyParameter( PublicKey key) throws InvalidKeyException { if (key instanceof BCRainbowPublicKey) { BCRainbowPublicKey k = (BCRainbowPublicKey)key; return new RainbowPublicKeyParameters(k.getDocLength(), k.getCoeffQuadratic(), k.getCoeffSingular(), k.getCoeffScalar()); } throw new InvalidKeyException("can't identify Rainbow public key: " + key.getClass().getName()); }
short[][] coeff_quadratic = ((RainbowPublicKeyParameters)this.key).getCoeffQuadratic(); short[][] coeff_singular = ((RainbowPublicKeyParameters)this.key).getCoeffSingular(); short[] coeff_scalar = ((RainbowPublicKeyParameters)this.key).getCoeffScalar();
/** * This function generates a Rainbow key pair. * * @return the generated key pair */ public AsymmetricCipherKeyPair genKeyPair() { RainbowPrivateKeyParameters privKey; RainbowPublicKeyParameters pubKey; if (!initialized) { initializeDefault(); } /* choose all coefficients at random */ keygen(); /* now marshall them to PrivateKey */ privKey = new RainbowPrivateKeyParameters(A1inv, b1, A2inv, b2, vi, layers); /* marshall to PublicKey */ pubKey = new RainbowPublicKeyParameters(vi[vi.length - 1] - vi[0], pub_quadratic, pub_singular, pub_scalar); return new AsymmetricCipherKeyPair(pubKey, privKey); }
/** * This function generates a Rainbow key pair. * * @return the generated key pair */ public AsymmetricCipherKeyPair genKeyPair() { RainbowPrivateKeyParameters privKey; RainbowPublicKeyParameters pubKey; if (!initialized) { initializeDefault(); } /* choose all coefficients at random */ keygen(); /* now marshall them to PrivateKey */ privKey = new RainbowPrivateKeyParameters(A1inv, b1, A2inv, b2, vi, layers); /* marshall to PublicKey */ pubKey = new RainbowPublicKeyParameters(vi[vi.length - 1] - vi[0], pub_quadratic, pub_singular, pub_scalar); return new AsymmetricCipherKeyPair(pubKey, privKey); }