Class BikeAlgorithm
Integration of BIKE (Bit Flipping Key Encapsulation) algorithm
Declares BIKE as aAbstractCryptoAlgorithm and
registers its supported roles, contexts, and key builders within the ZeroEcho
framework.
Capabilities
- KEM - encapsulation and decapsulation of shared secrets using public and private keys.
- Agreement - initiator and responder flows for
MessageAgreementContextbuilt on top of BIKE KEM. - Asymmetric key builders - generation and import of BIKE keys from
BikeKeyGenSpec,BikePublicKeySpec, andBikePrivateKeySpec.
Provider
Uses the BouncyCastle Post-Quantum provider (BCPQC). The provider must be registered in the JCA Security
before use.
Example
BikeAlgorithm bike = new BikeAlgorithm();
// Generate a key pair
KeyPair kp = bike.asymmetricKeyPairGenerator(BikeKeyGenSpec.class)
.generateKeyPair(BikeKeyGenSpec.bike256());
// Encapsulation using recipient's public key
KemContext kemEnc = bike.createContext(KeyUsage.ENCAPSULATE, kp.getPublic(), VoidSpec.INSTANCE);
// Decapsulation using private key
KemContext kemDec = bike.createContext(KeyUsage.DECAPSULATE, kp.getPrivate(), VoidSpec.INSTANCE);
- Since:
- 1.0
-
Constructor Summary
ConstructorsConstructorDescriptionConstructs and registers the BIKE algorithm with all its roles and key builders. -
Method Summary
Modifier and TypeMethodDescriptionList<ParameterSetDescriptor<? extends AlgorithmKeySpec>> Returns the discoverable parameter sets (or parameterized templates) supported by this algorithm.Methods inherited from class AbstractCryptoAlgorithm
capabilityMethods inherited from class CryptoAlgorithm
addCapability, asymmetricKeyPairGenerator, bindContext, createContext, displayName, id, keyOperations, listCapabilities, priority, privateKeyImporter, providerName, publicKeyImporter, registerAsymmetricKeyPairGenerator, registerPrivateKeyImporter, registerPublicKeyImporter, registerSymmetricKeyGenerator, registerSymmetricKeyImporter, requiresStatefulSigning, roles, supports, symmetricKeyGenerator, symmetricKeyImporter
-
Constructor Details
-
BikeAlgorithm
public BikeAlgorithm()Constructs and registers the BIKE algorithm with all its roles and key builders.Registers:
- KEM (encapsulate/decapsulate)
- Agreement (initiator/responder)
- Asymmetric key builders for BIKE key specifications
-
-
Method Details
-
parameterSets
Description copied from class:CryptoAlgorithmReturns the discoverable parameter sets (or parameterized templates) supported by this algorithm.Callers (UIs, provisioning tools, policy engines) use this list to present users with valid, named key-generation options without prior knowledge of the concrete algorithm. Each entry is either a pre-built
ParameterSetDescriptor.Concrete(ready spec) or aParameterSetDescriptor.Template(user-supplied arguments produce the spec).The default implementation returns an empty list. Algorithms with finite, enumerable parameter sets should override this method. Overrides must return immutable lists in stable order, with unique nonblank descriptor identifiers. Registry loading validates a snapshot; external providers remain responsible for maintaining the contract on subsequent calls. Implementations may use
ParameterSetDescriptor.snapshot(List)to validate and copy their list.- Overrides:
parameterSetsin classCryptoAlgorithm- Returns:
- immutable list of parameter set descriptors; never
null
-