mirror of
https://codeberg.org/scip/pcp.git
synced 2025-12-17 20:00:58 +01:00
added signature support (doesn't work yet)
This commit is contained in:
@@ -40,6 +40,9 @@ typedef unsigned int qbyte; // Quad byte = 32 bits
|
||||
#define PCP_ZFILE_HEADER "----- BEGIN Z85 ENCODED FILE -----"
|
||||
#define PCP_ZFILE_FOOTER "------ END Z85 ENCODED FILE ------"
|
||||
|
||||
#define PCP_SIG_HEADER "----- BEGIN PCP SIGNATURE FILE -----"
|
||||
#define PCP_SIG_FOOTER "------ END PCP SIGNATURE FILE ------"
|
||||
|
||||
#define PCP_ME "Pretty Curved Privacy"
|
||||
|
||||
#define PCP_KEY_VERSION 0x00000001U
|
||||
@@ -59,6 +62,9 @@ typedef unsigned int qbyte; // Quad byte = 32 bits
|
||||
#define PCP_VAULT_ID 0xC4
|
||||
#define PCP_VAULT_VERSION 0x01
|
||||
|
||||
// sigs
|
||||
#define PCP_SIG_VERSION 0x01
|
||||
|
||||
char *PCP_ERR;
|
||||
byte PCP_ERRSET;
|
||||
int PCP_EXIT;
|
||||
|
||||
62
include/pcp/ed.h
Normal file
62
include/pcp/ed.h
Normal file
@@ -0,0 +1,62 @@
|
||||
/*
|
||||
This file is part of Pretty Curved Privacy (pcp1).
|
||||
|
||||
Copyright (C) 2013 T.Linden.
|
||||
|
||||
This program 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.
|
||||
|
||||
This program 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 this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
You can contact me by mail: <tlinden AT cpan DOT org>.
|
||||
*/
|
||||
|
||||
#ifndef _HAVE_PCP_ED_H
|
||||
#define _HAVE_PCP_ED_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <sodium.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include <time.h>
|
||||
|
||||
#include "defines.h"
|
||||
#include "platform.h"
|
||||
#include "mem.h"
|
||||
#include "key.h"
|
||||
|
||||
struct _pcp_sig_t {
|
||||
char id[17];
|
||||
long ctime;
|
||||
uint32_t version;
|
||||
byte edsig[crypto_hash_sha256_BYTES + crypto_sign_BYTES];
|
||||
};
|
||||
|
||||
typedef struct _pcp_sig_t pcp_sig_t;
|
||||
|
||||
int pcp_ed_verify(unsigned char *input, size_t inputlen, pcp_sig_t *sig, pcp_pubkey_t *p);
|
||||
|
||||
pcp_sig_t *pcp_ed_sign(unsigned char *message,
|
||||
size_t messagesize, pcp_key_t *s);
|
||||
|
||||
pcp_sig_t *sig2native(pcp_sig_t *k);
|
||||
pcp_sig_t *sig2be(pcp_sig_t *k);
|
||||
|
||||
pcp_sig_t *pcp_ed_newsig(unsigned char *hash, char *id);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // _HAVE_PCP_ED_H
|
||||
Reference in New Issue
Block a user