Top Description Inners Fields Constructors Methods
org.bouncycastle.pqc.crypto.newhope

public Class NHOtherInfoGenerator

extends Object
Class Inheritance
Known Direct Subclasses
org.bouncycastle.pqc.crypto.newhope.NHOtherInfoGenerator.PartyU, org.bouncycastle.pqc.crypto.newhope.NHOtherInfoGenerator.PartyV
Imports
java.io.IOException, java.security.SecureRandom, org.bouncycastle.asn1.x509.AlgorithmIdentifier, .SubjectPublicKeyInfo, org.bouncycastle.crypto.AsymmetricCipherKeyPair, .KeyGenerationParameters, org.bouncycastle.crypto.util.DEROtherInfo, org.bouncycastle.pqc.asn1.PQCObjectIdentifiers, org.bouncycastle.pqc.crypto.ExchangePair

OtherInfo Generator for which can be used for populating the SuppPrivInfo field used to provide shared secret data used with NIST SP 800-56A agreement algorithms.

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
NHOtherInfoGenerator.PartyU

Party U (initiator) generation.

public static class
NHOtherInfoGenerator.PartyV

Party V (responder) generation.

Field Summary

Modifier and TypeField and Description
protected final DEROtherInfo.Builder
protected final SecureRandom
protected boolean

Constructor Summary

AccessConstructor and Description
public
NHOtherInfoGenerator(AlgorithmIdentifier
the algorithm associated with this invocation of the KDF.
algorithmID
,
byte[]
sender party info.
partyUInfo
,
byte[]
receiver party info.
partyVInfo
,
SecureRandom
a source of randomness.
random
)

Create a basic builder with just the compulsory fields.

Method Summary

Modifier and TypeMethod and Description
private static byte[]
private static NHPublicKeyParameters
getPublicKey(byte[] enc)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

otherInfoBuilderback to summary
protected final DEROtherInfo.Builder otherInfoBuilder
randomback to summary
protected final SecureRandom random
usedback to summary
protected boolean used

Constructor Detail

NHOtherInfoGeneratorback to summary
public NHOtherInfoGenerator(AlgorithmIdentifier algorithmID, byte[] partyUInfo, byte[] partyVInfo, SecureRandom random)

Create a basic builder with just the compulsory fields.

Parameters
algorithmID:AlgorithmIdentifier

the algorithm associated with this invocation of the KDF.

partyUInfo:byte[]

sender party info.

partyVInfo:byte[]

receiver party info.

random:SecureRandom

a source of randomness.

Method Detail

getEncodedback to summary
private static byte[] getEncoded(NHPublicKeyParameters pubKey)
getPublicKeyback to summary
private static NHPublicKeyParameters getPublicKey(byte[] enc)
org.bouncycastle.pqc.crypto.newhope back to summary

public Class NHOtherInfoGenerator.PartyU

extends NHOtherInfoGenerator
Class Inheritance

Party U (initiator) generation.

Field Summary

Modifier and TypeField and Description
private NHAgreement
private AsymmetricCipherKeyPair
Inherited from org.bouncycastle.pqc.crypto.newhope.NHOtherInfoGenerator:
otherInfoBuilderrandomused

Constructor Summary

AccessConstructor and Description
public
PartyU(AlgorithmIdentifier algorithmID, byte[] partyUInfo, byte[] partyVInfo, SecureRandom random)

Method Summary

Modifier and TypeMethod and Description
public DEROtherInfo
generate(byte[] suppPrivInfoPartB)

public byte[]
public NHOtherInfoGenerator

Returns:

the current builder instance.
withSuppPubInfo
(byte[]
supplementary public info.
suppPubInfo
)

Add optional supplementary public info (DER tagged, implicit, 0).

Field Detail

agreementback to summary
private NHAgreement agreement
aKpback to summary
private AsymmetricCipherKeyPair aKp

Constructor Detail

PartyUback to summary
public PartyU(AlgorithmIdentifier algorithmID, byte[] partyUInfo, byte[] partyVInfo, SecureRandom random)

Method Detail

generateback to summary
public DEROtherInfo generate(byte[] suppPrivInfoPartB)
getSuppPrivInfoPartAback to summary
public byte[] getSuppPrivInfoPartA()
withSuppPubInfoback to summary
public NHOtherInfoGenerator withSuppPubInfo(byte[] suppPubInfo)

Add optional supplementary public info (DER tagged, implicit, 0).

Parameters
suppPubInfo:byte[]

supplementary public info.

Returns:NHOtherInfoGenerator

the current builder instance.

org.bouncycastle.pqc.crypto.newhope back to summary

public Class NHOtherInfoGenerator.PartyV

extends NHOtherInfoGenerator
Class Inheritance

Party V (responder) generation.

Field Summary

Inherited from org.bouncycastle.pqc.crypto.newhope.NHOtherInfoGenerator:
otherInfoBuilderrandomused

Constructor Summary

AccessConstructor and Description
public
PartyV(AlgorithmIdentifier algorithmID, byte[] partyUInfo, byte[] partyVInfo, SecureRandom random)

Method Summary

Modifier and TypeMethod and Description
public DEROtherInfo
public byte[]
getSuppPrivInfoPartB(byte[] suppPrivInfoPartA)

public NHOtherInfoGenerator

Returns:

the current builder instance.
withSuppPubInfo
(byte[]
supplementary public info.
suppPubInfo
)

Add optional supplementary public info (DER tagged, implicit, 0).

Constructor Detail

PartyVback to summary
public PartyV(AlgorithmIdentifier algorithmID, byte[] partyUInfo, byte[] partyVInfo, SecureRandom random)

Method Detail

generateback to summary
public DEROtherInfo generate()
getSuppPrivInfoPartBback to summary
public byte[] getSuppPrivInfoPartB(byte[] suppPrivInfoPartA)
withSuppPubInfoback to summary
public NHOtherInfoGenerator withSuppPubInfo(byte[] suppPubInfo)

Add optional supplementary public info (DER tagged, implicit, 0).

Parameters
suppPubInfo:byte[]

supplementary public info.

Returns:NHOtherInfoGenerator

the current builder instance.