From 8a6b476a8b0b4e56f237d2651f75757a0b7f73de Mon Sep 17 00:00:00 2001 From: Henrik Hautakoski Date: Thu, 16 Mar 2023 11:07:42 +0100 Subject: [PATCH] include/libeosio/ec.hpp: Adding signature type. --- include/libeosio/ec.hpp | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/include/libeosio/ec.hpp b/include/libeosio/ec.hpp index b7e7110..07249ca 100644 --- a/include/libeosio/ec.hpp +++ b/include/libeosio/ec.hpp @@ -57,6 +57,29 @@ struct ec_keypair { ec_pubkey_t pub; }; + +/** + * Elliptic curve recoverable signature + * + * The signature consist of 2 integers r,s and v where + * r: x cordinate of the random point + * s: signature proof + * v: recovery id (0, 1, 2 or 3), eg. what EC point is the public key. + * + * The memory layout is as follows: + * r(32), s(32), v(1) = 65 bytes. + */ + +/** + * Elliptic curve signature key size (in bytes) + */ +#define EC_SIGNATURE_SIZE (32 + 32 + 1) + +/** + * Elliptic curve signature datastructure. + */ +typedef std::array ec_signature_t; + /** * Initialize the ec library. */