2021-06-27 21:25:29 +00:00
|
|
|
/***
|
|
|
|
Copyright (C) 2021 J Reece Wilson (a/k/a "Reece"). All rights reserved.
|
|
|
|
|
2021-07-01 09:18:42 +00:00
|
|
|
File: ECC.hpp
|
|
|
|
Date: 2021-7-1
|
2021-06-27 21:25:29 +00:00
|
|
|
Author: Reece
|
|
|
|
***/
|
|
|
|
#pragma once
|
|
|
|
|
2021-09-14 23:56:26 +00:00
|
|
|
namespace Aurora::Crypto::ECC
|
|
|
|
{
|
|
|
|
#if 0
|
|
|
|
class IECCPublic
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
|
|
|
virtual bool Verify(const void *hash, AuUInt hashLength,
|
|
|
|
const void *sigBuffer, AuUInt sigLength) = 0;
|
|
|
|
|
|
|
|
virtual bool Verify(const void *buffer, AuUInt length,
|
|
|
|
const void *sigBuffer, AuUInt sigLength,
|
|
|
|
EHashType method) = 0;
|
|
|
|
|
|
|
|
virtual bool Verify(const AuList<AuUInt8> &buffer, const AuList<AuUInt8> &sig,
|
|
|
|
EHashType method) = 0;
|
|
|
|
|
|
|
|
|
|
|
|
virtual bool AsPublicECC(PublicECCKey &out) = 0;
|
|
|
|
};
|
|
|
|
|
|
|
|
class IECCPrivate
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
virtual bool Sign(const void *buffer, AuUInt length,
|
|
|
|
EHashType method,
|
|
|
|
AuList<AuUInt8> &out) = 0;
|
|
|
|
|
|
|
|
virtual bool Sign(const AuList<AuUInt8> &in,
|
|
|
|
EHashType method,
|
|
|
|
AuList<AuUInt8> &out) = 0;
|
|
|
|
|
|
|
|
|
|
|
|
virtual bool Sign(const void *hash, AuUInt hashLength, AuList<AuUInt8> &out) = 0;
|
|
|
|
|
|
|
|
virtual bool ECDH(IECCPublic *partnerPublic, AuList<AuUInt8> &sharedKey) = 0;
|
|
|
|
|
|
|
|
|
|
|
|
virtual bool AsPublicECC(PublicECCKey &out) = 0;
|
|
|
|
virtual bool AsPrivateECC(PrivateECCKey &out) = 0;
|
|
|
|
};
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
2021-07-01 09:18:42 +00:00
|
|
|
#include "25519/25519.hpp"
|
|
|
|
#include "NIST/NIST.hpp"
|