public void init(boolean forSigning, CipherParameters param) { if (forSigning) { initSign = true; hasGenerated = false; privateKey = (XMSSPrivateKeyParameters)param; nextKeyGenerator = privateKey; params = privateKey.getParameters(); khf = params.getWOTSPlus().getKhf(); } else { initSign = false; publicKey = (XMSSPublicKeyParameters)param; params = publicKey.getParameters(); khf = params.getWOTSPlus().getKhf(); } }
byte[] messageDigest = wotsPlus.getKhf().HMsg(concatenated, message);
byte[] random = wotsPlus.getKhf().PRF(privateKey.getSecretKeyPRF(), XMSSUtil.toBytesBigEndian(globalIndex, 32)); byte[] concatenated = Arrays.concatenate(random, privateKey.getRoot(), XMSSUtil.toBytesBigEndian(globalIndex, params.getDigestSize())); byte[] messageDigest = wotsPlus.getKhf().HMsg(concatenated, message);
byte[] key = wotsPlus.getKhf().PRF(publicSeed, address.toByteArray()); byte[] bitmask0 = wotsPlus.getKhf().PRF(publicSeed, address.toByteArray()); byte[] bitmask1 = wotsPlus.getKhf().PRF(publicSeed, address.toByteArray()); int n = wotsPlus.getParams().getDigestSize(); byte[] tmpMask = new byte[2 * n]; byte[] out = wotsPlus.getKhf().H(key, tmpMask); return new XMSSNode(left.getHeight(), out);