Skip to content
Snippets Groups Projects
Commit ad92190d authored by Dmitriy A. Gerasimov's avatar Dmitriy A. Gerasimov
Browse files

[-] Moved files to libdap-chain-crypto

parent 4831d2d5
No related branches found
No related tags found
No related merge requests found
......@@ -21,8 +21,7 @@ set(DAP_CHAIN_HEADERS
dap_chain_datum_tx_out.h
dap_chain_datum_tx_pkey.h
dap_chain_datum_tx_sig.h
dap_chain_pkey.h
dap_chain_sign.h
)
add_library(${PROJECT_NAME} STATIC ${DAP_CHAIN_SRCS} ${DAP_CHAIN_HEADERS})
......
/*
* Authors:
* Dmitriy A. Gearasimov <gerasimov.dmitriy@demlabs.net>
* DeM Labs Inc. https://demlabs.net https:/gitlab.com/demlabs
* Kelvin Project https://github.com/kelvinblockchain
* Copyright (c) 2017-2018
* All rights reserved.
This file is part of DAP (Deus Applications Prototypes) the open source project
DAP (Deus Applicaions Prototypes) is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
DAP is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with any DAP based project. If not, see <http://www.gnu.org/licenses/>.
*/
#include "dap_common.h"
#include "dap_chain_pkey.h"
#define LOG_TAG "chain_key"
/*
* Authors:
* Dmitriy A. Gearasimov <gerasimov.dmitriy@demlabs.net>
* DeM Labs Inc. https://demlabs.net https:/gitlab.com/demlabs
* Kelvin Project https://github.com/kelvinblockchain
* Copyright (c) 2017-2018
* All rights reserved.
This file is part of DAP (Deus Applications Prototypes) the open source project
DAP (Deus Applicaions Prototypes) is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
DAP is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with any DAP based project. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#include <stdint.h>
#include "dap_common.h"
typedef union dap_chain_pkey_type{
enum {
PKEY_TYPE_NEWHOPE = 0x0000,
PKEY_TYPE_MULTI = 0xffff /// @brief Has inside subset of different keys
} type: 16;
uint16_t raw;
} dap_chain_pkey_type_t;
/**
* @struct dap_chain_pkey
* @brief Public keys
*/
typedef struct dap_chain_pkey{
struct {
dap_chain_pkey_type_t type; /// Pkey type
uint32_t size; /// Pkey size
} header; /// Only header's hash is used for verification
uint8_t pkey[]; /// @param pkey @brief raw pkey dat
} DAP_ALIGN_PACKED dap_chain_pkey_t;
/*
* Authors:
* Dmitriy A. Gearasimov <gerasimov.dmitriy@demlabs.net>
* DeM Labs Inc. https://demlabs.net https:/gitlab.com/demlabs
* Kelvin Project https://github.com/kelvinblockchain
* Copyright (c) 2017-2018
* All rights reserved.
This file is part of DAP (Deus Applications Prototypes) the open source project
DAP (Deus Applicaions Prototypes) is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
DAP is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with any DAP based project. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#include <stdint.h>
#include "dap_common.h"
typedef union dap_chain_sign_type{
enum {
SIG_TYPE_PICNIC = 0x0000,
SIG_TYPE_DEFO = 0x0001, /// @brief key image for anonymous transaction
SIG_TYPE_MULTI = 0xffff /// @brief Has inside subset of different signatures and sign composed with all of them
} type: 16;
uint16_t raw;
} dap_chain_sign_type_t;
/**
* @struct dap_chain_sign
* @brief Chain storage format for digital signature
*/
typedef struct dap_chain_sign{
struct {
dap_chain_sign_type_t type; /// Signature type
uint16_t sign_size; /// Signature size
uint32_t sign_pkey_size; /// Signature public key size
} header; /// Only header's hash is used for verification
uint8_t pkey_n_sign[]; /// @param sig @brief raw signature data
} DAP_ALIGN_PACKED dap_chain_sign_t;
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment