Record Class ModuleLatticeKemResult
java.lang.Object
java.lang.Record
net.jrodolfo.java_evolution.java24.quantum_resistant_crypto.ModuleLatticeKemResult
- Record Components:
senderSecretBytes- the shared secret bytes created by the senderreceiverSecretBytes- the shared secret bytes recovered by the receiverencapsulation- the message sent from sender to receiveralgorithm- the KEM algorithm used by the example
public record ModuleLatticeKemResult(byte[] senderSecretBytes, byte[] receiverSecretBytes, byte[] encapsulation, String algorithm)
extends Record
Captures the observable pieces of a module-lattice KEM exchange.
The result keeps the example readable without printing key material. The sender and receiver secrets are included only so tests can prove that both sides derived the same shared secret.
-
Constructor Summary
ConstructorsConstructorDescriptionModuleLatticeKemResult(byte[] senderSecretBytes, byte[] receiverSecretBytes, byte[] encapsulation, String algorithm) Creates an immutable KEM result. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thealgorithmrecord component.byte[]Returns the value of theencapsulationrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.byte[]Returns the value of thereceiverSecretBytesrecord component.booleanShows whether encapsulation and decapsulation reached the same secret.byte[]Returns the value of thesenderSecretBytesrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
ModuleLatticeKemResult
public ModuleLatticeKemResult(byte[] senderSecretBytes, byte[] receiverSecretBytes, byte[] encapsulation, String algorithm) Creates an immutable KEM result.
-
-
Method Details
-
senderSecretBytes
public byte[] senderSecretBytes()Returns the value of thesenderSecretBytesrecord component.- Returns:
- the value of the
senderSecretBytesrecord component
-
receiverSecretBytes
public byte[] receiverSecretBytes()Returns the value of thereceiverSecretBytesrecord component.- Returns:
- the value of the
receiverSecretBytesrecord component
-
encapsulation
public byte[] encapsulation()Returns the value of theencapsulationrecord component.- Returns:
- the value of the
encapsulationrecord component
-
secretsMatch
public boolean secretsMatch()Shows whether encapsulation and decapsulation reached the same secret.- Returns:
truewhen both sides derived matching key material
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
algorithm
-