AuroraRuntime/Source/Crypto/ECC/ECCX25519Private.hpp
Reece Wilson 0ded2ec77c [*] potential bug in x25519 sign: was using the linear base ptr instead of write after alloc or validate
[*] old copy/pasted ecdh function clearly wasnt tested in its now form :(
[*] clean up
2022-09-25 09:28:48 +01:00

37 lines
972 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,
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_;
};
}