35 lines
885 B
C++
35 lines
885 B
C++
|
/***
|
||
|
Copyright (C) 2021 J Reece Wilson (a/k/a "Reece"). All rights reserved.
|
||
|
|
||
|
File: ECCx25519Public.hpp
|
||
|
Date: 2021-9-17
|
||
|
Author: Reece
|
||
|
***/
|
||
|
#pragma once
|
||
|
|
||
|
namespace Aurora::Crypto::ECC
|
||
|
{
|
||
|
class PublicCurve25519Impl : public IECCPublic
|
||
|
{
|
||
|
public:
|
||
|
PublicCurve25519Impl(bool isX25519, curve25519_key &&key);
|
||
|
~PublicCurve25519Impl();
|
||
|
|
||
|
bool Verify(const Memory::MemoryViewRead &hash,
|
||
|
const Memory::MemoryViewRead &signature) override;
|
||
|
|
||
|
bool Verify(const Memory::MemoryViewRead &plaintext,
|
||
|
const Memory::MemoryViewRead &signature,
|
||
|
EHashType method) override;
|
||
|
|
||
|
bool AsPublicECC(Memory::ByteBuffer &out) override;
|
||
|
|
||
|
EECCCurve GetType() override;
|
||
|
|
||
|
const curve25519_key &GetKey();
|
||
|
|
||
|
private:
|
||
|
curve25519_key key_;
|
||
|
bool isX25519_;
|
||
|
};
|
||
|
}
|