public int getHeight() { return keyParams.getParameters().getHeight(); }
public int getHeight() { return keyParams.getParameters().getHeight(); }
public long getUsagesRemaining() { return (1L << this.getParameters().getHeight()) - this.getIndex(); }
int indexSize = (int)Math.ceil(params.getHeight() / (double)8); int randomSize = n; int reducedSignatureSizeSingle = ((params.getHeight() / params.getLayers()) + len) * n; int reducedSignaturesSizeTotal = reducedSignatureSizeSingle * params.getLayers(); int totalSize = indexSize + randomSize + reducedSignaturesSizeTotal; if (!XMSSUtil.isIndexValid(params.getHeight(), index))
public byte[] toByteArray() { /* index || random || reduced signatures */ int n = params.getDigestSize(); int len = params.getWOTSPlus().getParams().getLen(); int indexSize = (int)Math.ceil(params.getHeight() / (double)8); int randomSize = n; int reducedSignatureSizeSingle = ((params.getHeight() / params.getLayers()) + len) * n; int reducedSignaturesSizeTotal = reducedSignatureSizeSingle * params.getLayers(); int totalSize = indexSize + randomSize + reducedSignaturesSizeTotal; byte[] out = new byte[totalSize]; int position = 0; /* copy index */ byte[] indexBytes = XMSSUtil.toBytesBigEndian(index, indexSize); XMSSUtil.copyBytesAtOffset(out, indexBytes, position); position += indexSize; /* copy random */ XMSSUtil.copyBytesAtOffset(out, random, position); position += randomSize; /* copy reduced signatures */ for (XMSSReducedSignature reducedSignature : reducedSignatures) { byte[] signature = reducedSignature.toByteArray(); XMSSUtil.copyBytesAtOffset(out, signature, position); position += reducedSignatureSizeSingle; } return out; }
int indexSize = (params.getHeight() + 7) / 8; int secretKeySize = n; int secretKeyPRFSize = n;
/** * XMSSMT constructor... * * @param height Height of tree. * @param layers Amount of layers. * @param digest Digest to use. */ public XMSSMTParameters(int height, int layers, Digest digest) { super(); this.height = height; this.layers = layers; this.xmssParams = new XMSSParameters(xmssTreeHeight(height, layers), digest); oid = DefaultXMSSMTOid.lookup(getDigest().getAlgorithmName(), getDigestSize(), getWinternitzParameter(), getLen(), getHeight(), layers); /* * if (oid == null) { throw new InvalidParameterException(); } */ }
int totalHeight = keyParams.getParameters().getHeight(); int indexSize = (totalHeight + 7) / 8; int secretKeySize = n;
final int totalHeight = params.getHeight(); final int xmssHeight = xmssParams.getHeight(); if (!XMSSUtil.isIndexValid(totalHeight, globalIndex))
AlgorithmIdentifier algorithmIdentifier = new AlgorithmIdentifier(PQCObjectIdentifiers.xmss_mt, new XMSSMTKeyParams(keyParams.getParameters().getHeight(), keyParams.getParameters().getLayers(), Utils.xmssLookupTreeAlgID(keyParams.getTreeDigest()))); return new SubjectPublicKeyInfo(algorithmIdentifier, new XMSSMTPublicKey(keyParams.getPublicSeed(), keyParams.getRoot()));
new XMSSMTKeyParams(keyParams.getParameters().getHeight(), keyParams.getParameters().getLayers(), Utils.xmssLookupTreeAlgID(keyParams.getTreeDigest())));