Class KemContext.KemResult
java.lang.Object
zeroecho.core.context.KemContext.KemResult
- Enclosing interface:
KemContext
Encapsulation result holding both ciphertext and shared secret.
The array references are final, but their contents are mutable. Construction and access do not copy either array: the producer and recipient share the same buffers. The recipient must arrange exclusive access and clear the shared secret after use; clearing it also changes this result. This object provides no synchronization or automatic destruction.
- Since:
- 1.0
-
Constructor Summary
ConstructorsConstructorDescriptionKemResult(byte[] ciphertext, byte[] sharedSecret) Retains the provided arrays without copying or validating them. -
Method Summary
Modifier and TypeMethodDescriptionbyte[]Returns the encapsulation ciphertext.byte[]Returns the derived shared secret.
-
Constructor Details
-
KemResult
public KemResult(byte[] ciphertext, byte[] sharedSecret) Retains the provided arrays without copying or validating them.- Parameters:
ciphertext- the encapsulation ciphertext to be transmittedsharedSecret- the derived shared secret (sensitive material)
-
-
Method Details
-
ciphertext
public byte[] ciphertext()Returns the encapsulation ciphertext.- Returns:
- the retained ciphertext array, not a defensive copy
-