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

public Class NHSecretKeyProcessor

extends Object
Class Inheritance
Imports
java.security.SecureRandom, org.bouncycastle.crypto.AsymmetricCipherKeyPair, .KeyGenerationParameters, .Xof, org.bouncycastle.crypto.digests.SHAKEDigest, org.bouncycastle.pqc.crypto.ExchangePair, 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 Xof

Constructor Summary

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

Method Summary

Modifier and TypeMethod and Description
public byte[]
processKey(byte[] initialKey)

private static void
xor(byte[] a, byte[] b)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

xofback to summary
private final Xof xof

Constructor Detail

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

Method Detail

processKeyback to summary
public byte[] processKey(byte[] initialKey)
xorback to summary
private static void xor(byte[] a, byte[] b)
org.bouncycastle.pqc.crypto.newhope back to summary

public Class NHSecretKeyProcessor.PartyUBuilder

extends Object
Class Inheritance
  • java.lang.Object
  • org.bouncycastle.pqc.crypto.newhope.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 NHSecretKeyProcessor
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 NHSecretKeyProcessor build(byte[] partB)
getPartAback to summary
public byte[] getPartA()
withSharedInfoback to summary
public NHSecretKeyProcessor.PartyUBuilder withSharedInfo(byte[] sharedInfo)
org.bouncycastle.pqc.crypto.newhope back to summary

public Class NHSecretKeyProcessor.PartyVBuilder

extends Object
Class Inheritance
  • java.lang.Object
  • org.bouncycastle.pqc.crypto.newhope.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 NHSecretKeyProcessor
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 NHSecretKeyProcessor build()
getPartBback to summary
public byte[] getPartB(byte[] partUContribution)
withSharedInfoback to summary
public NHSecretKeyProcessor.PartyVBuilder withSharedInfo(byte[] sharedInfo)