public GMSSPrivateKeyParameters nextKey() { GMSSPrivateKeyParameters nKey = new GMSSPrivateKeyParameters(this); nKey.nextKey(gmssPS.getNumOfLayers() - 1); return nKey; }
public AsymmetricCipherKeyPair generateKeyPair() { return genKeyPair(); } }
public BCGMSSPublicKey( GMSSPublicKeyParameters params) { this(params.getPublicKey(), params.getParameters()); }
/** * This method is called by generateKeyPair() in case that no other * initialization method has been called by the user */ private void initializeDefault() { int[] defh = {10, 10, 10, 10}; int[] defw = {3, 3, 3, 3}; int[] defk = {2, 2, 2, 2}; KeyGenerationParameters kgp = new GMSSKeyGenerationParameters(new SecureRandom(), new GMSSParameters(defh.length, defh, defw, defk)); this.initialize(kgp); }
/** * Initializes the signature algorithm for verifying a signature. */ private void initVerify() { messDigestTrees.reset(); GMSSPublicKeyParameters gmssPublicKey = (GMSSPublicKeyParameters)key; pubKeyBytes = gmssPublicKey.getPublicKey(); gmssPS = gmssPublicKey.getParameters(); // get numLayer this.numLayer = gmssPS.getNumOfLayers(); }
GMSSLeaf nextLeaf() { GMSSLeaf nextLeaf = new GMSSLeaf(this); nextLeaf.updateLeafCalc(); return nextLeaf; }
public byte[] generateSignature(byte[] message) { if (key == null) { throw new IllegalStateException("signing key no longer usable"); } byte[] sig = gmssSigner.generateSignature(message); key = key.nextKey(); return sig; }
/** * returns the retain stacks storing all right nodes near to the root * * @return the retain stacks storing all right nodes near to the root */ public Vector[] getRetain() { return GMSSUtils.clone(retain); }
/** * initializes the seeds for the treehashs of the tree precomputed by this * class * * @param seed the initial seed for treehash: seedNext * @param index the height of the treehash */ public void initializeTreehashSeed(byte[] seed, int index) { treehash[index].initializeSeed(seed); }
public void init(KeyGenerationParameters param) { this.initialize(param); }
public boolean verifySignature(byte[] message, byte[] signature) { return gmssSigner.verifySignature(message, signature); }
public GMSSPrivateKeyParameters nextKey() { GMSSPrivateKeyParameters nKey = new GMSSPrivateKeyParameters(this); nKey.nextKey(gmssPS.getNumOfLayers() - 1); return nKey; }
/** * This method is called by generateKeyPair() in case that no other * initialization method has been called by the user */ private void initializeDefault() { int[] defh = {10, 10, 10, 10}; int[] defw = {3, 3, 3, 3}; int[] defk = {2, 2, 2, 2}; KeyGenerationParameters kgp = new GMSSKeyGenerationParameters(CryptoServicesRegistrar.getSecureRandom(), new GMSSParameters(defh.length, defh, defw, defk)); this.initialize(kgp); }
/** * Initializes the signature algorithm for verifying a signature. */ private void initVerify() { messDigestTrees.reset(); GMSSPublicKeyParameters gmssPublicKey = (GMSSPublicKeyParameters)key; pubKeyBytes = gmssPublicKey.getPublicKey(); gmssPS = gmssPublicKey.getParameters(); // get numLayer this.numLayer = gmssPS.getNumOfLayers(); }
GMSSLeaf nextLeaf() { GMSSLeaf nextLeaf = new GMSSLeaf(this); nextLeaf.updateLeafCalc(); return nextLeaf; }
/** * returns the initial treehash instances, storing value y_3(i) * * @return the initial treehash instances, storing value y_3(i) */ public Treehash[] getTreehash() { return GMSSUtils.clone(treehash); }
/** * returns the retain stacks storing all right nodes near to the root * * @return the retain stacks storing all right nodes near to the root */ public Vector[] getRetain() { return GMSSUtils.clone(retain); }
static Treehash[][] clone(Treehash[][] data) { if (data == null) { return null; } Treehash[][] copy = new Treehash[data.length][]; for (int i = 0; i != data.length; i++) { copy[i] = clone(data[i]); } return copy; }
/** * returns the authentication path of the first leaf of the tree * * @return the authentication path of the first leaf of the tree */ public byte[][] getAuthPath() { return GMSSUtils.clone(AuthPath); }
static Treehash[][] clone(Treehash[][] data) { if (data == null) { return null; } Treehash[][] copy = new Treehash[data.length][]; for (int i = 0; i != data.length; i++) { copy[i] = clone(data[i]); } return copy; }