Top Description Inners Fields Constructors Methods
org.bouncycastle.pqc.addon

public Class NHSecretKeyProcessor

extends Object
implements SecretKeyProcessor
Class Inheritance
All Implemented Interfaces
org.bouncycastle.pqc.addon.SecretKeyProcessor
Imports
java.io.IOException, .OutputStream, java.security.SecureRandom, javax.crypto.SecretKey, javax.crypto.spec.SecretKeySpec, org.bouncycastle.crypto.fips.FipsOutputXOFCalculator, .FipsSHS, .FipsXOFOperatorFactory, org.bouncycastle.util.Arrays

A processor with associated builders for doing secret key transformation using the New Hope algorithm.

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
NHSecretKeyProcessor.PartyUBuilder

Party U (initiator) processor builder.

public static class
NHSecretKeyProcessor.PartyVBuilder

Party V (responder) processor builder.

Field Summary

Modifier and TypeField and Description
private final FipsOutputXOFCalculator<T extends FipsParameters>

Constructor Summary

AccessConstructor and Description
private
NHSecretKeyProcessor(byte[] secret, byte[] shared)

Method Summary

Modifier and TypeMethod and Description
public SecretKey
processKey(SecretKey
the key to be processed.
initialKey
)

Implements org.bouncycastle.pqc.addon.SecretKeyProcessor.processKey.

Transform the passed in secret key returning the result.
private static void
xor(byte[] a, byte[] b)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

xofOperatorback to summary
private final FipsOutputXOFCalculator<T extends FipsParameters> xofOperator

Constructor Detail

NHSecretKeyProcessorback to summary
private NHSecretKeyProcessor(byte[] secret, byte[] shared)

Method Detail

processKeyback to summary
public SecretKey processKey(SecretKey initialKey)

Implements org.bouncycastle.pqc.addon.SecretKeyProcessor.processKey.

Doc from org.bouncycastle.pqc.addon.SecretKeyProcessor.processKey.

Transform the passed in secret key returning the result.

Parameters
initialKey:SecretKey

the key to be processed.

Returns:SecretKey

a new secret key.

Annotations
@Override
xorback to summary
private static void xor(byte[] a, byte[] b)
org.bouncycastle.pqc.addon back to summary

public Class NHSecretKeyProcessor.PartyUBuilder

extends Object
Class Inheritance
  • java.lang.Object
  • org.bouncycastle.pqc.addon.NHSecretKeyProcessor.PartyUBuilder

Party U (initiator) processor builder.

Field Summary

Modifier and TypeField and Description
private final NHAgreement
private final AsymmetricCipherKeyPair
private byte[]
private boolean

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public SecretKeyProcessor
build(byte[] partB)

public byte[]
public NHSecretKeyProcessor.PartyUBuilder
withSharedInfo(byte[] sharedInfo)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

agreementback to summary
private final NHAgreement agreement
aKpback to summary
private final AsymmetricCipherKeyPair aKp
sharedInfoback to summary
private byte[] sharedInfo
usedback to summary
private boolean used

Constructor Detail

PartyUBuilderback to summary
public PartyUBuilder(SecureRandom random)

Method Detail

buildback to summary
public SecretKeyProcessor build(byte[] partB)
getPartAback to summary
public byte[] getPartA()
withSharedInfoback to summary
public NHSecretKeyProcessor.PartyUBuilder withSharedInfo(byte[] sharedInfo)
org.bouncycastle.pqc.addon back to summary

public Class NHSecretKeyProcessor.PartyVBuilder

extends Object
Class Inheritance
  • java.lang.Object
  • org.bouncycastle.pqc.addon.NHSecretKeyProcessor.PartyVBuilder

Party V (responder) processor builder.

Field Summary

Modifier and TypeField and Description
protected final SecureRandom
private byte[]
private byte[]
private boolean

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public SecretKeyProcessor
public byte[]
getPartB(byte[] partUContribution)

public NHSecretKeyProcessor.PartyVBuilder
withSharedInfo(byte[] sharedInfo)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

randomback to summary
protected final SecureRandom random
sharedInfoback to summary
private byte[] sharedInfo
sharedSecretback to summary
private byte[] sharedSecret
usedback to summary
private boolean used

Constructor Detail

PartyVBuilderback to summary
public PartyVBuilder(SecureRandom random)

Method Detail

buildback to summary
public SecretKeyProcessor build()
getPartBback to summary
public byte[] getPartB(byte[] partUContribution)
withSharedInfoback to summary
public NHSecretKeyProcessor.PartyVBuilder withSharedInfo(byte[] sharedInfo)