Enum HpkeSuite.KEM
- All Implemented Interfaces:
Serializable, Comparable<HpkeSuite.KEM>, java.lang.constant.Constable
- Enclosing class:
HpkeSuite
Key Encapsulation Mechanisms (KEMs)
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class Enum
Enum.EnumDesc<E> -
Enum Constant Summary
Enum Constants -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic HpkeSuite.KEMforId(int id) Returns the KEM value for a given id.intintgetId()KEM idintgetnEnc()Deprecated.intReturns The length in bytes of an encoded private key for this KEM.intReturns the length in bytes of an encoded public key for this KEM.intReturns the length in bytes of a KEM shared secret produced by this KEM.static HpkeSuite.KEMReturns the enum constant of this type with the specified name.static HpkeSuite.KEM[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
DHKEM_X25519_HKDF_SHA256
-
MLKEM_768
-
MLKEM_1024
-
XWING
-
-
Field Details
-
id
private final int id -
nSecret
private final int nSecret -
nEnc
private final int nEnc -
nPk
private final int nPk -
nSk
private final int nSk
-
-
Constructor Details
-
KEM
private KEM(int id, int nSecret, int nEnc, int nPk, int nSk)
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum type has no constant with the specified nameNullPointerException- if the argument is null
-
getId
public int getId()KEM id- Returns:
- kem id
- See Also:
-
getnEnc
Deprecated.Returns the length in bytes of an encapsulated key produced by this KEM. -
getEncapsulatedLength
public int getEncapsulatedLength() -
getSecretLength
public int getSecretLength()Returns the length in bytes of a KEM shared secret produced by this KEM. -
getPublicKeyLength
public int getPublicKeyLength()Returns the length in bytes of an encoded public key for this KEM. -
getPrivateKeyLength
public int getPrivateKeyLength()Returns The length in bytes of an encoded private key for this KEM. -
forId
Returns the KEM value for a given id.
-