Record Class HybridKexProfile
java.lang.Object
java.lang.Record
zeroecho.sdk.hybrid.kex.HybridKexProfile
- Record Components:
hkdfSalt- optional HKDF salt (defensively copied), may benullhkdfInfo- optional HKDF info/label (defensively copied), may benulloutLenBytes- length of derived keying material in bytes (1..8160)
Profile for a hybrid key exchange (KEX) composition.
A hybrid KEX combines two independently derived secrets:
- a classic (pre-quantum) agreement secret produced by an
AgreementContext(e.g. X25519, ECDH, DH), and - a post-quantum agreement secret produced by a
MessageAgreementContext(typically a KEM-style agreement such as ML-KEM).
The two secrets are combined using HKDF-SHA256 (RFC 5869) to produce a final keying material byte array of a caller-selected length. The default label is intended to make cross-protocol misuse harder by providing an explicit domain separator.
Notes
- This profile does not store algorithm identifiers on purpose; it focuses on KDF binding and output size. Algorithm selection happens in higher layers when constructing the two underlying contexts.
saltis optional; if null/empty, HKDF uses a zero-filled salt as per RFC 5869 andKdf.
- Since:
- 1.0
-
Constructor Summary
ConstructorsConstructorDescriptionHybridKexProfile(byte[] hkdfSalt, byte[] hkdfInfo, int outLenBytes) Canonical constructor with validation and defensive copies. -
Method Summary
Modifier and TypeMethodDescriptionstatic HybridKexProfiledefaultProfile(int outLenBytes) Constructs a profile with a default HKDF info label.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.byte[]hkdfInfo()Returns an owned copy of the optional HKDF information.byte[]hkdfSalt()Returns an owned copy of the optional HKDF salt.intReturns the value of theoutLenBytesrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
HybridKexProfile
public HybridKexProfile(byte[] hkdfSalt, byte[] hkdfInfo, int outLenBytes) Canonical constructor with validation and defensive copies.- Parameters:
hkdfSalt- optional HKDF salthkdfInfo- optional HKDF info/labeloutLenBytes- output length in bytes
-
-
Method Details
-
defaultProfile
Constructs a profile with a default HKDF info label.- Parameters:
outLenBytes- output length in bytes- Returns:
- profile with default HKDF info label and no explicit salt
-
hkdfSalt
public byte[] hkdfSalt()Returns an owned copy of the optional HKDF salt.- Returns:
- salt copy, or
null
-
hkdfInfo
public byte[] hkdfInfo()Returns an owned copy of the optional HKDF information.- Returns:
- information copy, or
null
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
outLenBytes
public int outLenBytes()Returns the value of theoutLenBytesrecord component.- Returns:
- the value of the
outLenBytesrecord component
-