Example usage for org.bouncycastle.pqc.crypto ExchangePair ExchangePair

List of usage examples for org.bouncycastle.pqc.crypto ExchangePair ExchangePair

Introduction

In this page you can find the example usage for org.bouncycastle.pqc.crypto ExchangePair ExchangePair.

Prototype

public ExchangePair(AsymmetricKeyParameter publicKey, byte[] shared) 

Source Link

Document

Base constructor.

Usage

From source file:com.distrimind.util.crypto.NewHopeKeyAgreementServer.java

License:Open Source License

public void setDataPhase1(byte[] data) {
    valid = false;/*from  w w w .ja v  a  2 s.c  o m*/
    byte[] sharedValue = new byte[agreementSize];
    byte[] publicKeyValue = new byte[SENDB_BYTES];

    AbstractNewHopeKeyAgreement.sharedB(randomForKeys, sharedValue, publicKeyValue, data);

    exchangePair = new ExchangePair(new NHPublicKeyParameters(publicKeyValue), sharedValue);
    shared = exchangePair.getSharedValue();
    valid = true;
}