![JAR search and dependency download from the Maven repository](/logo.png)
net.sourceforge.plantuml.argon2.algorithm.Finalize Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of plantuml-mit Show documentation
Show all versions of plantuml-mit Show documentation
PlantUML is a component that allows to quickly write diagrams from text.
// THIS FILE HAS BEEN GENERATED BY A PREPROCESSOR.
package net.sourceforge.plantuml.argon2.algorithm;
import net.sourceforge.plantuml.argon2.Argon2;
import net.sourceforge.plantuml.argon2.model.Block;
import net.sourceforge.plantuml.argon2.model.Instance;
public class Finalize {
public static void finalize(Instance instance, Argon2 argon2) {
Block finalBlock = instance.memory[instance.getLaneLength() - 1];
/* XOR the last blocks */
for (int i = 1; i < instance.getLanes(); i++) {
int lastBlockInLane = i * instance.getLaneLength() + (instance.getLaneLength() - 1);
finalBlock.xorWith(instance.memory[lastBlockInLane]);
}
byte[] finalBlockBytes = finalBlock.toBytes();
byte[] finalResult = Functions.blake2bLong(finalBlockBytes, argon2.getOutputLength());
argon2.setOutput(finalResult);
if (argon2.isClearMemory()) {
instance.clear();
argon2.clear();
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy