private BDS(BDS last, Digest digest) { this.wotsPlus = new WOTSPlus(new WOTSPlusParameters(digest)); this.treeHeight = last.treeHeight; this.k = last.k; this.root = last.root; this.authenticationPath = new ArrayList<XMSSNode>(); // note use of addAll to avoid serialization issues this.authenticationPath.addAll(last.authenticationPath); this.retain = last.retain; this.stack = new Stack<XMSSNode>(); // note use of addAll to avoid serialization issues this.stack.addAll(last.stack); this.treeHashInstances = last.treeHashInstances; this.keep = new TreeMap<Integer, XMSSNode>(last.keep); this.index = last.index; this.used = last.used; this.validate(); }
/** * XMSS Constructor... * * @param height Height of tree. * @param digest Digest to use. */ public XMSSParameters(int height, Digest digest) { super(); if (height < 2) { throw new IllegalArgumentException("height must be >= 2"); } if (digest == null) { throw new NullPointerException("digest == null"); } wotsPlus = new WOTSPlus(new WOTSPlusParameters(digest)); this.height = height; this.k = determineMinK(); oid = DefaultXMSSOid.lookup(getDigest().getAlgorithmName(), getDigestSize(), getWinternitzParameter(), wotsPlus.getParams().getLen(), height); /* * if (oid == null) { throw new InvalidParameterException(); } */ }
public void init(boolean forSigning, CipherParameters param) { if (forSigning) { initSign = true; hasGenerated = false; privateKey = (XMSSMTPrivateKeyParameters)param; nextKeyGenerator = privateKey; params = privateKey.getParameters(); xmssParams = params.getXMSSParameters(); } else { initSign = false; publicKey = (XMSSMTPublicKeyParameters)param; params = publicKey.getParameters(); xmssParams = params.getXMSSParameters(); } wotsPlus = new WOTSPlus(new WOTSPlusParameters(params.getDigest())); }