Search in sources :

Example 1 with PublicKey

use of com.github.rosklyar.crypto.PublicKey in project nem-library by rosklyar.

the class Ed25519KeyGenerator method derivePublicKey.

@Override
public PublicKey derivePublicKey(final PrivateKey privateKey) {
    final Ed25519EncodedFieldElement a = Ed25519Utils.prepareForScalarMultiply(privateKey);
    final Ed25519GroupElement pubKey = BASE_POINT.scalarMultiply(a);
    return new PublicKey(pubKey.encode().getRaw());
}
Also used : PublicKey(com.github.rosklyar.crypto.PublicKey) Ed25519EncodedFieldElement(com.github.rosklyar.crypto.ed25519.arithmetic.Ed25519EncodedFieldElement) Ed25519GroupElement(com.github.rosklyar.crypto.ed25519.arithmetic.Ed25519GroupElement)

Aggregations

PublicKey (com.github.rosklyar.crypto.PublicKey)1 Ed25519EncodedFieldElement (com.github.rosklyar.crypto.ed25519.arithmetic.Ed25519EncodedFieldElement)1 Ed25519GroupElement (com.github.rosklyar.crypto.ed25519.arithmetic.Ed25519GroupElement)1