AuroraRuntime/Source/Crypto/ECC/ECCX25519Private.hpp

37 lines
989 B
C++

/***
Copyright (C) 2022 J Reece Wilson (a/k/a "Reece"). All rights reserved.
File: ECCX25519Private.hpp
Date: 2022-2-15
Author: Reece
***/
#pragma once
namespace Aurora::Crypto::ECC
{
struct PrivateCurve25519Impl : IECCPrivate
{
PrivateCurve25519Impl(bool isX25519, curve25519_key &&key);
~PrivateCurve25519Impl();
bool Sign(const Memory::MemoryViewRead &plainText,
Aurora::Hashing::EHashType method,
Memory::ByteBuffer &out) override;
bool Sign(const Memory::MemoryViewRead &hash,
Memory::ByteBuffer &out) override;
bool ECDH(const AuSPtr<IECCPublic> &partnerPublic,
Memory::ByteBuffer &sharedKey) override;
bool AsPublicECC(Memory::ByteBuffer &out) override;
bool AsPrivateECC(Memory::ByteBuffer &out) override;
EECCCurve GetType() override;
private:
curve25519_key key_;
bool bIsX25519_;
};
}