37 lines
988 B
C++
37 lines
988 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
|
||
|
{
|
||
|
class PrivateCurve25519Impl : public IECCPrivate
|
||
|
{
|
||
|
public:
|
||
|
PrivateCurve25519Impl(bool isX25519, curve25519_key &&key);
|
||
|
~PrivateCurve25519Impl();
|
||
|
|
||
|
bool Sign(const Memory::MemoryViewRead &plainText,
|
||
|
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 isX25519_;
|
||
|
};
|
||
|
}
|