Top Fields Constructors Methods
org.bouncycastle.crypto.hpke

pack-priv Class DHKEM

extends Object
Class Inheritance
Imports
java.math.BigInteger, java.security.SecureRandom, org.bouncycastle.crypto.AsymmetricCipherKeyPair, .AsymmetricCipherKeyPairGenerator, .BasicAgreement, org.bouncycastle.crypto.agreement.ECDHCBasicAgreement, .XDHBasicAgreement, org.bouncycastle.crypto.generators.ECKeyPairGenerator, .X25519KeyPairGenerator, .X448KeyPairGenerator, org.bouncycastle.crypto.params.AsymmetricKeyParameter, .ECDomainParameters, .ECKeyGenerationParameters, .ECPrivateKeyParameters, .ECPublicKeyParameters, .X25519KeyGenerationParameters, .X25519PrivateKeyParameters, .X25519PublicKeyParameters, .X448KeyGenerationParameters, .X448PrivateKeyParameters, .X448PublicKeyParameters, org.bouncycastle.math.ec.ECCurve, .ECPoint, .FixedPointCombMultiplier, .WNafUtil, org.bouncycastle.math.ec.custom.sec.SecP256R1Curve, .SecP384R1Curve, .SecP521R1Curve, org.bouncycastle.util.Arrays, .Pack, .Strings, org.bouncycastle.util.encoders.Hex

Field Summary

Modifier and TypeField and Description
private BasicAgreement
private byte
pack-priv ECDomainParameters
private HKDF
private final short
private AsymmetricCipherKeyPairGenerator
private int
private int

Constructor Summary

AccessConstructor and Description
protected
DHKEM(short kemid)

Method Summary

Modifier and TypeMethod and Description
protected byte[]
protected byte[][]
protected byte[]
Decap(byte[] enc, AsymmetricCipherKeyPair kpR)

public AsymmetricCipherKeyPair
DeriveKeyPair(byte[] ikm)

public AsymmetricCipherKeyPair
DeserializePrivateKey(byte[] skEncoded, byte[] pkEncoded)

public AsymmetricKeyParameter
DeserializePublicKey(byte[] encoded)

protected byte[][]
protected byte[][]
private byte[]
ExtractAndExpand(byte[] dh, byte[] kemContext)

private byte[]
formatBigIntegerBytes(byte[] bigIntBytes, int outputSize)

public AsymmetricCipherKeyPair
public byte[]
public byte[]
private boolean
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

agreementback to summary
private BasicAgreement agreement
bitmaskback to summary
private byte bitmask
domainParamsback to summary
pack-priv ECDomainParameters domainParams
hkdfback to summary
private HKDF hkdf
kemIdback to summary
private final short kemId
kpGenback to summary
private AsymmetricCipherKeyPairGenerator kpGen
Nsecretback to summary
private int Nsecret
Nskback to summary
private int Nsk

Constructor Detail

DHKEMback to summary
protected DHKEM(short kemid)

Method Detail

AuthDecapback to summary
protected byte[] AuthDecap(byte[] enc, AsymmetricCipherKeyPair kpR, AsymmetricKeyParameter pkS)
AuthEncapback to summary
protected byte[][] AuthEncap(AsymmetricKeyParameter pkR, AsymmetricCipherKeyPair kpS)
Decapback to summary
protected byte[] Decap(byte[] enc, AsymmetricCipherKeyPair kpR)
DeriveKeyPairback to summary
public AsymmetricCipherKeyPair DeriveKeyPair(byte[] ikm)
DeserializePrivateKeyback to summary
public AsymmetricCipherKeyPair DeserializePrivateKey(byte[] skEncoded, byte[] pkEncoded)
DeserializePublicKeyback to summary
public AsymmetricKeyParameter DeserializePublicKey(byte[] encoded)
Encapback to summary
protected byte[][] Encap(AsymmetricKeyParameter pkR)
Encapback to summary
protected byte[][] Encap(AsymmetricKeyParameter pkR, AsymmetricCipherKeyPair kpE)
ExtractAndExpandback to summary
private byte[] ExtractAndExpand(byte[] dh, byte[] kemContext)
formatBigIntegerBytesback to summary
private byte[] formatBigIntegerBytes(byte[] bigIntBytes, int outputSize)
GeneratePrivateKeyback to summary
public AsymmetricCipherKeyPair GeneratePrivateKey()
SerializePrivateKeyback to summary
public byte[] SerializePrivateKey(AsymmetricKeyParameter key)
SerializePublicKeyback to summary
public byte[] SerializePublicKey(AsymmetricKeyParameter key)
ValidateSkback to summary
private boolean ValidateSk(BigInteger d)