Loading...
Searching...
No Matches
ed448.hxx
Go to the documentation of this file.
#ifndef __DECAF_ED448_HXX__
#define __DECAF_ED448_HXX__ 1
/*
* Example Decaf cyrpto routines, C++ wrapper.
* @warning These are merely examples, though they ought to be secure. But real
* protocols will decide differently on magic numbers, formats, which items to
* hash, etc.
* @warning Experimental! The names, parameter orders etc are likely to change.
*/
#include <decaf/eddsa.hxx>
#include <decaf/point_448.hxx>
#include <decaf/ed448.h>
#include <decaf/shake.hxx>
#include <decaf/sha512.hxx>
#if __cplusplus >= 201103L
#define DECAF_NOEXCEPT noexcept
#else
#define DECAF_NOEXCEPT throw()
#endif
namespace decaf {
template <typename Group> struct EdDSA;
template<> struct EdDSA<Ed448Goldilocks> {
template<class CRTP, Prehashed> class Signing;
template<class CRTP, Prehashed> class Verification;
class PublicKeyBase;
class PrivateKeyBase;
typedef class PrivateKeyBase PrivateKey, PrivateKeyPure, PrivateKeyPh;
typedef class PublicKeyBase PublicKey, PublicKeyPure, PublicKeyPh;
#if DECAF_EDDSA_448_SUPPORTS_CONTEXTLESS_SIGS
static inline const Block NO_CONTEXT() { return Block(DECAF_ED448_NO_CONTEXT,0); }
#else
static inline const Block NO_CONTEXT() { return Block(NULL,0); }
#endif
class Prehash : public SHAKE<256> {
private:
typedef SHAKE<256> Super;
SecureBuffer context_;
template<class T, Prehashed Ph> friend class Signing;
template<class T, Prehashed Ph> friend class Verification;
void init() /*throw(LengthException)*/ {
Super::reset();
if (context_.size() > 255) {
throw LengthException();
}
decaf_ed448_prehash_init((decaf_shake256_ctx_s *)wrapped);
}
public:
static const size_t OUTPUT_BYTES = Super::DEFAULT_OUTPUT_BYTES;
Prehash(const Block &context = NO_CONTEXT()) /*throw(LengthException)*/ {
context_ = context;
init();
}
void reset() DECAF_NOEXCEPT { init(); }
SecureBuffer final() /*throw(std::bad_alloc)*/ {
SecureBuffer ret = Super::final(OUTPUT_BYTES);
reset();
return ret;
}
void final(Buffer &b) /*throw(LengthException)*/ {
if (b.size() != OUTPUT_BYTES) throw LengthException();
Super::final(b);
reset();
}
};
template<class CRTP, Prehashed ph> class Signing;
template<class CRTP> class Signing<CRTP,PURE> {
public:
inline SecureBuffer sign (
const Block &message,
const Block &context = NO_CONTEXT()
) const /* throw(LengthException, std::bad_alloc) */ {
if (context.size() > 255) {
throw LengthException();
}
SecureBuffer out(CRTP::SIG_BYTES);
decaf_ed448_keypair_sign (
out.data(),
((const CRTP*)this)->keypair_,
message.data(),
message.size(),
0,
context.data(),
static_cast<uint8_t>(context.size())
);
return out;
}
};
template<class CRTP> class Signing<CRTP,PREHASHED> {
public:
inline SecureBuffer sign_prehashed ( const Prehash &ph ) const /*throw(std::bad_alloc)*/ {
SecureBuffer out(CRTP::SIG_BYTES);
decaf_ed448_keypair_sign_prehash (
out.data(),
((const CRTP*)this)->keypair_,
(const decaf_ed448_prehash_ctx_s*)ph.wrapped,
ph.context_.data(),
static_cast<uint8_t>(ph.context_.size())
);
return out;
}
inline SecureBuffer sign_with_prehash (
const Block &message,
const Block &context = NO_CONTEXT()
) const /*throw(LengthException,CryptoException)*/ {
Prehash ph(context);
ph += message;
return sign_prehashed(ph);
}
};
class PrivateKeyBase
: public Serializable<PrivateKeyBase>
, public Signing<PrivateKeyBase,PURE>
, public Signing<PrivateKeyBase,PREHASHED> {
public:
typedef class PublicKeyBase PublicKey;
private:
friend class PublicKeyBase;
friend class Signing<PrivateKey,PURE>;
friend class Signing<PrivateKey,PREHASHED>;
decaf_eddsa_448_keypair_t keypair_;
public:
typedef Ed448Goldilocks Group;
static const size_t SIG_BYTES = DECAF_EDDSA_448_SIGNATURE_BYTES;
static const size_t SER_BYTES = DECAF_EDDSA_448_PRIVATE_BYTES;
inline explicit PrivateKeyBase(const NOINIT&) DECAF_NOEXCEPT { }
inline explicit PrivateKeyBase(const FixedBlock<SER_BYTES> &b) DECAF_NOEXCEPT { *this = b; }
inline PrivateKeyBase(const PrivateKeyBase &k) DECAF_NOEXCEPT { *this = k; }
inline explicit PrivateKeyBase(Rng &r) DECAF_NOEXCEPT {
FixedArrayBuffer<DECAF_EDDSA_448_PRIVATE_BYTES> priv(r);
decaf_ed448_derive_keypair(keypair_, priv.data());
}
inline PrivateKeyBase &operator=(const PrivateKey &k) DECAF_NOEXCEPT {
memcpy(keypair_,k.keypair_,sizeof(keypair_));
return *this;
}
inline ~PrivateKeyBase() { decaf_ed448_keypair_destroy(keypair_); }
inline PrivateKeyBase &operator=(const FixedBlock<SER_BYTES> &b) DECAF_NOEXCEPT {
decaf_ed448_derive_keypair(keypair_, b.data());
return *this;
}
inline size_t ser_size() const DECAF_NOEXCEPT { return SER_BYTES; }
inline void serialize_into(unsigned char *x) const DECAF_NOEXCEPT {
decaf_ed448_keypair_extract_private_key(x, keypair_);
}
inline SecureBuffer convert_to_x() const {
SecureBuffer out(DECAF_X448_PRIVATE_BYTES);
FixedArrayBuffer<DECAF_EDDSA_448_PRIVATE_BYTES> priv;
serialize_into(priv.data());
decaf_ed448_convert_private_key_to_x448(out.data(), priv.data());
return out;
}
inline PublicKey pub() const DECAF_NOEXCEPT {
PublicKey pub(*this);
return pub;
}
}; /* class PrivateKey */
template<class CRTP> class Verification<CRTP,PURE> {
public:
inline decaf_error_t DECAF_WARN_UNUSED verify_noexcept (
const FixedBlock<DECAF_EDDSA_448_SIGNATURE_BYTES> &sig,
const Block &message,
const Block &context = NO_CONTEXT()
) const /*DECAF_NOEXCEPT*/ {
if (context.size() > 255) {
return DECAF_FAILURE;
}
return decaf_ed448_verify (
sig.data(),
((const CRTP*)this)->pub_.data(),
message.data(),
message.size(),
0,
context.data(),
static_cast<uint8_t>(context.size())
);
}
inline void verify (
const FixedBlock<DECAF_EDDSA_448_SIGNATURE_BYTES> &sig,
const Block &message,
const Block &context = NO_CONTEXT()
) const /*throw(LengthException,CryptoException)*/ {
if (context.size() > 255) {
throw LengthException();
}
if (DECAF_SUCCESS != verify_noexcept( sig, message, context )) {
throw CryptoException();
}
}
};
template<class CRTP> class Verification<CRTP,PREHASHED> {
public:
inline decaf_error_t DECAF_WARN_UNUSED verify_prehashed_noexcept (
const FixedBlock<DECAF_EDDSA_448_SIGNATURE_BYTES> &sig,
const Prehash &ph
) const /*DECAF_NOEXCEPT*/ {
return decaf_ed448_verify_prehash (
sig.data(),
((const CRTP*)this)->pub_.data(),
(const decaf_ed448_prehash_ctx_s*)ph.wrapped,
ph.context_.data(),
ph.context_.size()
);
}
inline void verify_prehashed (
const FixedBlock<DECAF_EDDSA_448_SIGNATURE_BYTES> &sig,
const Prehash &ph
) const /*throw(CryptoException)*/ {
if (DECAF_SUCCESS != decaf_ed448_verify_prehash (
sig.data(),
((const CRTP*)this)->pub_.data(),
(const decaf_ed448_prehash_ctx_s*)ph.wrapped,
ph.context_.data(),
static_cast<uint8_t>(ph.context_.size())
)) {
throw CryptoException();
}
}
inline void verify_with_prehash (
const FixedBlock<DECAF_EDDSA_448_SIGNATURE_BYTES> &sig,
const Block &message,
const Block &context = NO_CONTEXT()
) const /*throw(LengthException,CryptoException)*/ {
Prehash ph(context);
ph += message;
verify_prehashed(sig,ph);
}
};
class PublicKeyBase
: public Serializable<PublicKeyBase>
, public Verification<PublicKeyBase,PURE>
, public Verification<PublicKeyBase,PREHASHED> {
public:
typedef class PrivateKeyBase PrivateKey;
private:
friend class PrivateKeyBase;
friend class Verification<PublicKey,PURE>;
friend class Verification<PublicKey,PREHASHED>;
private:
FixedArrayBuffer<DECAF_EDDSA_448_PUBLIC_BYTES> pub_;
public:
/* PERF FUTURE: Pre-cached decoding? Precomputed table?? */
typedef Ed448Goldilocks Group;
static const size_t SIG_BYTES = DECAF_EDDSA_448_SIGNATURE_BYTES;
static const size_t SER_BYTES = DECAF_EDDSA_448_PRIVATE_BYTES;
inline explicit PublicKeyBase(const NOINIT&) DECAF_NOEXCEPT : pub_((NOINIT())) { }
inline explicit PublicKeyBase(const FixedBlock<SER_BYTES> &b) DECAF_NOEXCEPT { *this = b; }
inline PublicKeyBase(const PublicKeyBase &k) DECAF_NOEXCEPT { *this = k; }
inline explicit PublicKeyBase(const PrivateKey &k) DECAF_NOEXCEPT { *this = k; }
inline PublicKey &operator=(const FixedBlock<SER_BYTES> &b) DECAF_NOEXCEPT {
memcpy(pub_.data(),b.data(),b.size());
return *this;
}
inline PublicKey &operator=(const PublicKey &p) DECAF_NOEXCEPT {
return *this = p.pub_;
}
inline PublicKey &operator=(const PrivateKey &p) DECAF_NOEXCEPT {
decaf_ed448_keypair_extract_public_key(pub_.data(), p.keypair_);
return *this;
}
inline size_t ser_size() const DECAF_NOEXCEPT { return SER_BYTES; }
inline void serialize_into(unsigned char *x) const DECAF_NOEXCEPT {
memcpy(x,pub_.data(), pub_.size());
}
inline SecureBuffer convert_to_x() const {
SecureBuffer out(DECAF_X448_PRIVATE_BYTES);
decaf_ed448_convert_public_key_to_x448(out.data(), pub_.data());
return out;
}
}; /* class PublicKey */
}; /* template<> struct EdDSA<Ed448Goldilocks> */
#undef DECAF_NOEXCEPT
} /* namespace decaf */
#endif /* __DECAF_ED448_HXX__ */
decaf::Block
A reference to a block of data, which (when accessed through this base class) is const.
Definition secure_buffer.hxx:159
decaf::Block::data
const unsigned char * data() const DECAF_NOEXCEPT
Get const data.
Definition secure_buffer.hxx:199
decaf::Block::size
size_t size() const DECAF_NOEXCEPT
Get the size.
Definition secure_buffer.hxx:208
decaf::Buffer
A reference to a writable block of data.
Definition secure_buffer.hxx:270
decaf::Buffer::data
const unsigned char * data() const DECAF_NOEXCEPT
Get const data.
Definition secure_buffer.hxx:282
decaf::CryptoException
An exception for when crypto (ie point decode) has failed.
Definition secure_buffer.hxx:119
decaf::EdDSA< Ed448Goldilocks >::Prehash::reset
void reset() DECAF_NOEXCEPT
Reset this hash.
Definition ed448.hxx:103
decaf::EdDSA< Ed448Goldilocks >::Prehash::Prehash
Prehash(const Block &context=NO_CONTEXT())
Create the prehash.
Definition ed448.hxx:97
decaf::EdDSA< Ed448Goldilocks >::PrivateKeyBase::serialize_into
void serialize_into(unsigned char *x) const DECAF_NOEXCEPT
Serialize into a buffer.
Definition ed448.hxx:245
decaf::EdDSA< Ed448Goldilocks >::PrivateKeyBase::operator=
PrivateKeyBase & operator=(const FixedBlock< SER_BYTES > &b) DECAF_NOEXCEPT
Assignment from string.
Definition ed448.hxx:236
decaf::EdDSA< Ed448Goldilocks >::PrivateKeyBase::~PrivateKeyBase
~PrivateKeyBase()
Create at random.
Definition ed448.hxx:233
decaf::EdDSA< Ed448Goldilocks >::PrivateKeyBase::PrivateKeyBase
PrivateKeyBase(const FixedBlock< SER_BYTES > &b) DECAF_NOEXCEPT
Read a private key from a string.
Definition ed448.hxx:215
decaf::EdDSA< Ed448Goldilocks >::PrivateKeyBase::PrivateKeyBase
PrivateKeyBase(const PrivateKeyBase &k) DECAF_NOEXCEPT
Copy constructor.
Definition ed448.hxx:218
decaf::EdDSA< Ed448Goldilocks >::PrivateKeyBase::ser_size
size_t ser_size() const DECAF_NOEXCEPT
Serialization size.
Definition ed448.hxx:242
decaf::EdDSA< Ed448Goldilocks >::PrivateKeyBase::PublicKey
class PublicKeyBase PublicKey
Type of public key corresponding to this private key.
Definition ed448.hxx:189
decaf::EdDSA< Ed448Goldilocks >::PrivateKeyBase::PrivateKeyBase
PrivateKeyBase(Rng &r) DECAF_NOEXCEPT
Create at random.
Definition ed448.hxx:221
decaf::EdDSA< Ed448Goldilocks >::PrivateKeyBase::operator=
PrivateKeyBase & operator=(const PrivateKey &k) DECAF_NOEXCEPT
Copy assignment.
Definition ed448.hxx:227
decaf::EdDSA< Ed448Goldilocks >::PrivateKeyBase::pub
PublicKey pub() const DECAF_NOEXCEPT
Return the corresponding public key.
Definition ed448.hxx:259
decaf::EdDSA< Ed448Goldilocks >::PrivateKeyBase::PrivateKeyBase
PrivateKeyBase(const NOINIT &) DECAF_NOEXCEPT
Create but don't initialize.
Definition ed448.hxx:212
decaf::EdDSA< Ed448Goldilocks >::PrivateKeyBase::Group
Ed448Goldilocks Group
Underlying group.
Definition ed448.hxx:202
decaf::EdDSA< Ed448Goldilocks >::PrivateKeyBase::convert_to_x
SecureBuffer convert_to_x() const
Convert to X format (to be used for key exchange)
Definition ed448.hxx:250
decaf::EdDSA< Ed448Goldilocks >::PublicKeyBase::PublicKeyBase
PublicKeyBase(const NOINIT &) DECAF_NOEXCEPT
Create but don't initialize.
Definition ed448.hxx:389
decaf::EdDSA< Ed448Goldilocks >::PublicKeyBase::convert_to_x
SecureBuffer convert_to_x() const
Convert to X format (to be used for key exchange)
Definition ed448.hxx:426
decaf::EdDSA< Ed448Goldilocks >::PublicKeyBase::operator=
PublicKey & operator=(const FixedBlock< SER_BYTES > &b) DECAF_NOEXCEPT
Assignment from string.
Definition ed448.hxx:401
decaf::EdDSA< Ed448Goldilocks >::PublicKeyBase::PublicKeyBase
PublicKeyBase(const PublicKeyBase &k) DECAF_NOEXCEPT
Copy constructor.
Definition ed448.hxx:395
decaf::EdDSA< Ed448Goldilocks >::PublicKeyBase::PrivateKey
class PrivateKeyBase PrivateKey
Private key corresponding to this type of public key.
Definition ed448.hxx:363
decaf::EdDSA< Ed448Goldilocks >::PublicKeyBase::operator=
PublicKey & operator=(const PrivateKey &p) DECAF_NOEXCEPT
Assignment from private key.
Definition ed448.hxx:412
decaf::EdDSA< Ed448Goldilocks >::PublicKeyBase::PublicKeyBase
PublicKeyBase(const FixedBlock< SER_BYTES > &b) DECAF_NOEXCEPT
Read a private key from a string.
Definition ed448.hxx:392
decaf::EdDSA< Ed448Goldilocks >::PublicKeyBase::PublicKeyBase
PublicKeyBase(const PrivateKey &k) DECAF_NOEXCEPT
Copy constructor.
Definition ed448.hxx:398
decaf::EdDSA< Ed448Goldilocks >::PublicKeyBase::Group
Ed448Goldilocks Group
Underlying group.
Definition ed448.hxx:380
decaf::EdDSA< Ed448Goldilocks >::PublicKeyBase::serialize_into
void serialize_into(unsigned char *x) const DECAF_NOEXCEPT
Serialize into a buffer.
Definition ed448.hxx:421
decaf::EdDSA< Ed448Goldilocks >::PublicKeyBase::ser_size
size_t ser_size() const DECAF_NOEXCEPT
Serialization size.
Definition ed448.hxx:418
decaf::EdDSA< Ed448Goldilocks >::PublicKeyBase::operator=
PublicKey & operator=(const PublicKey &p) DECAF_NOEXCEPT
Assignment from public key.
Definition ed448.hxx:407
decaf::EdDSA< Ed448Goldilocks >::Signing< CRTP, PREHASHED >::sign_prehashed
SecureBuffer sign_prehashed(const Prehash &ph) const
Sign a prehash context, and reset the context.
Definition ed448.hxx:159
decaf::EdDSA< Ed448Goldilocks >::Signing< CRTP, PREHASHED >::sign_with_prehash
SecureBuffer sign_with_prehash(const Block &message, const Block &context=NO_CONTEXT()) const
Sign a message using the prehasher.
Definition ed448.hxx:172
decaf::EdDSA< Ed448Goldilocks >::Signing< CRTP, PURE >::sign
SecureBuffer sign(const Block &message, const Block &context=NO_CONTEXT()) const
Sign a message.
Definition ed448.hxx:133
decaf::EdDSA< Ed448Goldilocks >::Verification< CRTP, PREHASHED >::verify_with_prehash
void verify_with_prehash(const FixedBlock< DECAF_EDDSA_448_SIGNATURE_BYTES > &sig, const Block &message, const Block &context=NO_CONTEXT()) const
Hash and verify a message, using the prehashed verification mode.
Definition ed448.hxx:345
decaf::EdDSA< Ed448Goldilocks >::Verification< CRTP, PREHASHED >::verify_prehashed_noexcept
decaf_error_t DECAF_WARN_UNUSED verify_prehashed_noexcept(const FixedBlock< DECAF_EDDSA_448_SIGNATURE_BYTES > &sig, const Prehash &ph) const
Verify that a signature is valid for a given prehashed message, given the context.
Definition ed448.hxx:315
decaf::EdDSA< Ed448Goldilocks >::Verification< CRTP, PREHASHED >::verify_prehashed
void verify_prehashed(const FixedBlock< DECAF_EDDSA_448_SIGNATURE_BYTES > &sig, const Prehash &ph) const
Verify that a signature is valid for a given prehashed message, given the context.
Definition ed448.hxx:329
decaf::EdDSA< Ed448Goldilocks >::Verification< CRTP, PURE >::verify_noexcept
decaf_error_t DECAF_WARN_UNUSED verify_noexcept(const FixedBlock< DECAF_EDDSA_448_SIGNATURE_BYTES > &sig, const Block &message, const Block &context=NO_CONTEXT()) const
Verify a signature, returning DECAF_FAILURE if verification fails.
Definition ed448.hxx:269
decaf::EdDSA< Ed448Goldilocks >::Verification< CRTP, PURE >::verify
void verify(const FixedBlock< DECAF_EDDSA_448_SIGNATURE_BYTES > &sig, const Block &message, const Block &context=NO_CONTEXT()) const
Verify a signature, throwing an exception if verification fails.
Definition ed448.hxx:296
decaf::FixedArrayBuffer
A fixed-size stack-allocated buffer (for DECAF_NOEXCEPT semantics)
Definition secure_buffer.hxx:337
decaf::FixedBlock
A fixed-size block.
Definition secure_buffer.hxx:253
decaf::LengthException
An exception for when crypto (ie point decode) has failed.
Definition secure_buffer.hxx:126
decaf::Rng
Prototype of a random number generator.
Definition secure_buffer.hxx:138
decaf::SHAKE
Variable-output-length SHAKE.
Definition shake.hxx:151
decaf::Serializable
Base class of objects which support serialization.
Definition secure_buffer.hxx:89
decaf_error_t
decaf_error_t
Another boolean type used to indicate success or failure.
Definition common.h:120
DECAF_FAILURE
@ DECAF_FAILURE
The operation failed.
Definition common.h:122
DECAF_SUCCESS
@ DECAF_SUCCESS
The operation succeeded.
Definition common.h:121
ed448.h
A group of prime order p, based on Ed448-Goldilocks.
decaf_ed448_keypair_extract_public_key
void DECAF_API_VIS decaf_ed448_keypair_extract_public_key(uint8_t pubkey[DECAF_EDDSA_448_PUBLIC_BYTES], const decaf_eddsa_448_keypair_t keypair) DECAF_NONNULL DECAF_NOINLINE
Extract the public key from an EdDSA keypair.
decaf_ed448_verify_prehash
decaf_error_t DECAF_API_VIS decaf_ed448_verify_prehash(const uint8_t signature[DECAF_EDDSA_448_SIGNATURE_BYTES], const uint8_t pubkey[DECAF_EDDSA_448_PUBLIC_BYTES], const decaf_ed448_prehash_ctx_t hash, const uint8_t *context, uint8_t context_len) DECAF_NOINLINE
EdDSA signature verification.
decaf_ed448_keypair_sign
void DECAF_API_VIS decaf_ed448_keypair_sign(uint8_t signature[DECAF_EDDSA_448_SIGNATURE_BYTES], const decaf_eddsa_448_keypair_t keypair, const uint8_t *message, size_t message_len, uint8_t prehashed, const uint8_t *context, uint8_t context_len) DECAF_NOINLINE
EdDSA signing.
decaf_ed448_prehash_ctx_s
#define decaf_ed448_prehash_ctx_s
Prehash context (raw), because each EdDSA instance has a different prehash.
Definition ed448.h:45
DECAF_EDDSA_448_SIGNATURE_BYTES
#define DECAF_EDDSA_448_SIGNATURE_BYTES
Number of bytes in an EdDSA private key.
Definition ed448.h:33
DECAF_EDDSA_448_PRIVATE_BYTES
#define DECAF_EDDSA_448_PRIVATE_BYTES
Number of bytes in an EdDSA private key.
Definition ed448.h:30
decaf_ed448_keypair_extract_private_key
void DECAF_API_VIS decaf_ed448_keypair_extract_private_key(uint8_t privkey[DECAF_EDDSA_448_PRIVATE_BYTES], const decaf_eddsa_448_keypair_t keypair) DECAF_NONNULL DECAF_NOINLINE
Extract the private key from an EdDSA keypair.
decaf_ed448_keypair_destroy
void DECAF_API_VIS decaf_ed448_keypair_destroy(decaf_eddsa_448_keypair_t keypair) DECAF_NONNULL DECAF_NOINLINE
EdDSA keypair destructor.
decaf_ed448_verify
decaf_error_t DECAF_API_VIS decaf_ed448_verify(const uint8_t signature[DECAF_EDDSA_448_SIGNATURE_BYTES], const uint8_t pubkey[DECAF_EDDSA_448_PUBLIC_BYTES], const uint8_t *message, size_t message_len, uint8_t prehashed, const uint8_t *context, uint8_t context_len) DECAF_NOINLINE
EdDSA signature verification.
decaf_ed448_derive_keypair
void DECAF_API_VIS decaf_ed448_derive_keypair(decaf_eddsa_448_keypair_t keypair, const uint8_t privkey[DECAF_EDDSA_448_PRIVATE_BYTES]) DECAF_NONNULL DECAF_NOINLINE
EdDSA keypair scheduling.
decaf_ed448_convert_private_key_to_x448
void DECAF_API_VIS decaf_ed448_convert_private_key_to_x448(uint8_t x[DECAF_X448_PRIVATE_BYTES], const uint8_t ed[DECAF_EDDSA_448_PRIVATE_BYTES]) DECAF_NONNULL DECAF_NOINLINE
EdDSA to ECDH private key conversion Using the appropriate hash function, hash the EdDSA private key ...
decaf_ed448_prehash_init
void DECAF_API_VIS decaf_ed448_prehash_init(decaf_ed448_prehash_ctx_t hash) DECAF_NOINLINE
Prehash initialization, with contexts if supported.
decaf_ed448_keypair_sign_prehash
void DECAF_API_VIS decaf_ed448_keypair_sign_prehash(uint8_t signature[DECAF_EDDSA_448_SIGNATURE_BYTES], const decaf_eddsa_448_keypair_t keypair, const decaf_ed448_prehash_ctx_t hash, const uint8_t *context, uint8_t context_len) DECAF_NOINLINE
EdDSA signing with prehash.
decaf_ed448_convert_public_key_to_x448
void decaf_ed448_convert_public_key_to_x448(uint8_t x[DECAF_X448_PUBLIC_BYTES], const uint8_t ed[DECAF_EDDSA_448_PUBLIC_BYTES])
EdDSA to ECDH public key conversion Deserialize the point to get y on Edwards curve,...
Definition decaf.c:1335
eddsa.hxx
decaf
Namespace for all C++ decaf objects.
Definition decaf.hxx:22
decaf::SecureBuffer
std::vector< unsigned char, SanitizingAllocator< unsigned char, 0 > > SecureBuffer
A variant of std::vector which securely zerozes its state when destructed.
Definition secure_buffer.hxx:79
decaf::PURE
@ PURE
Sign the message itself.
Definition eddsa.hxx:22
decaf::PREHASHED
@ PREHASHED
Sign the hash of the message.
Definition eddsa.hxx:23
DECAF_X448_PRIVATE_BYTES
#define DECAF_X448_PRIVATE_BYTES
Number of bytes in an x448 private key.
Definition point_448.h:65
point_448.hxx
sha512.hxx
SHA512 instance, C++ wrapper.
shake.hxx
SHA-3-n and SHAKE-n instances, C++ wrapper.
decaf::Ed448Goldilocks
Ed448-Goldilocks/Decaf instantiation of group.
Definition point_448.hxx:55
decaf::EdDSA< Ed448Goldilocks >::NO_CONTEXT
static const Block NO_CONTEXT()
Signatures support a "context" block, which allows you to domain separate them if (for some reason) i...
Definition ed448.hxx:69
decaf::EdDSA
A public key for crypto over some Group.
Definition ed255.hxx:44
decaf::NOINIT
Passed to constructors to avoid (conservative) initialization.
Definition secure_buffer.hxx:133