@Override protected XMSSAddress build() { return new HashTreeAddress(this); }
.withLayerAddress(hashTreeAddress.getLayerAddress()) .withTreeAddress(hashTreeAddress.getTreeAddress()).withTreeHeight(k) .withTreeIndex(hashTreeAddress.getTreeIndex()).withKeyAndMask(hashTreeAddress.getKeyAndMask()) .build(); if (Math.floor(indexLeaf / (1 << k)) % 2 == 0) .withLayerAddress(hashTreeAddress.getLayerAddress()) .withTreeAddress(hashTreeAddress.getTreeAddress()) .withTreeHeight(hashTreeAddress.getTreeHeight()) .withTreeIndex(hashTreeAddress.getTreeIndex() / 2) .withKeyAndMask(hashTreeAddress.getKeyAndMask()).build(); node[1] = XMSSNodeUtil.randomizeHash(wotsPlus, node[0], signature.getAuthPath().get(k), hashTreeAddress); node[1] = new XMSSNode(node[1].getHeight() + 1, node[1].getValue()); .withLayerAddress(hashTreeAddress.getLayerAddress()) .withTreeAddress(hashTreeAddress.getTreeAddress()) .withTreeHeight(hashTreeAddress.getTreeHeight()) .withTreeIndex((hashTreeAddress.getTreeIndex() - 1) / 2) .withKeyAndMask(hashTreeAddress.getKeyAndMask()).build(); node[1] = XMSSNodeUtil.randomizeHash(wotsPlus, signature.getAuthPath().get(k), node[0], hashTreeAddress); node[1] = new XMSSNode(node[1].getHeight() + 1, node[1].getValue());
.withLayerAddress(hashTreeAddress.getLayerAddress()) .withTreeAddress(hashTreeAddress.getTreeAddress()).withTreeHeight(tau - 1) .withTreeIndex(index >> tau).withKeyAndMask(hashTreeAddress.getKeyAndMask()).build();
.withLayerAddress(hashTreeAddress.getLayerAddress()) .withTreeAddress(hashTreeAddress.getTreeAddress()) .withTreeHeight(hashTreeAddress.getTreeHeight()) .withTreeIndex((hashTreeAddress.getTreeIndex() - 1) / 2) .withKeyAndMask(hashTreeAddress.getKeyAndMask()).build(); node = XMSSNodeUtil.randomizeHash(wotsPlus, stack.pop(), node, hashTreeAddress); node = new XMSSNode(node.getHeight() + 1, node.getValue()); hashTreeAddress = (HashTreeAddress)new HashTreeAddress.Builder() .withLayerAddress(hashTreeAddress.getLayerAddress()) .withTreeAddress(hashTreeAddress.getTreeAddress()) .withTreeHeight(hashTreeAddress.getTreeHeight() + 1) .withTreeIndex(hashTreeAddress.getTreeIndex()).withKeyAndMask(hashTreeAddress.getKeyAndMask()) .build(); .withLayerAddress(hashTreeAddress.getLayerAddress()) .withTreeAddress(hashTreeAddress.getTreeAddress()) .withTreeHeight(hashTreeAddress.getTreeHeight()) .withTreeIndex((hashTreeAddress.getTreeIndex() - 1) / 2) .withKeyAndMask(hashTreeAddress.getKeyAndMask()).build(); node = XMSSNodeUtil.randomizeHash(wotsPlus, tailNode, node, hashTreeAddress); node = new XMSSNode(tailNode.getHeight() + 1, node.getValue()); tailNode = node; hashTreeAddress = (HashTreeAddress)new HashTreeAddress.Builder() .withLayerAddress(hashTreeAddress.getLayerAddress()) .withTreeAddress(hashTreeAddress.getTreeAddress()) .withTreeHeight(hashTreeAddress.getTreeHeight() + 1) .withTreeIndex(hashTreeAddress.getTreeIndex()) .withKeyAndMask(hashTreeAddress.getKeyAndMask()).build();
.withLayerAddress(hashTreeAddress.getLayerAddress()) .withTreeAddress(hashTreeAddress.getTreeAddress()).withTreeIndex(indexLeaf) .withKeyAndMask(hashTreeAddress.getKeyAndMask()).build(); while (!stack.isEmpty() && stack.peek().getHeight() == node.getHeight()) .withLayerAddress(hashTreeAddress.getLayerAddress()) .withTreeAddress(hashTreeAddress.getTreeAddress()) .withTreeHeight(hashTreeAddress.getTreeHeight()) .withTreeIndex((hashTreeAddress.getTreeIndex() - 1) / 2) .withKeyAndMask(hashTreeAddress.getKeyAndMask()).build(); node = XMSSNodeUtil.randomizeHash(wotsPlus, stack.pop(), node, hashTreeAddress); node = new XMSSNode(node.getHeight() + 1, node.getValue()); hashTreeAddress = (HashTreeAddress)new HashTreeAddress.Builder() .withLayerAddress(hashTreeAddress.getLayerAddress()) .withTreeAddress(hashTreeAddress.getTreeAddress()) .withTreeHeight(hashTreeAddress.getTreeHeight() + 1) .withTreeIndex(hashTreeAddress.getTreeIndex()).withKeyAndMask(hashTreeAddress.getKeyAndMask()) .build();
address = (HashTreeAddress)new HashTreeAddress.Builder().withLayerAddress(tmpAddress.getLayerAddress()) .withTreeAddress(tmpAddress.getTreeAddress()).withTreeHeight(tmpAddress.getTreeHeight()) .withTreeIndex(tmpAddress.getTreeIndex()).withKeyAndMask(0).build(); address = (HashTreeAddress)new HashTreeAddress.Builder().withLayerAddress(tmpAddress.getLayerAddress()) .withTreeAddress(tmpAddress.getTreeAddress()).withTreeHeight(tmpAddress.getTreeHeight()) .withTreeIndex(tmpAddress.getTreeIndex()).withKeyAndMask(1).build(); address = (HashTreeAddress)new HashTreeAddress.Builder().withLayerAddress(tmpAddress.getLayerAddress()) .withTreeAddress(tmpAddress.getTreeAddress()).withTreeHeight(tmpAddress.getTreeHeight()) .withTreeIndex(tmpAddress.getTreeIndex()).withKeyAndMask(2).build();