diff --git a/TODO b/TODO index f2c4f5a..3ac5b59 100644 --- a/TODO +++ b/TODO @@ -17,6 +17,10 @@ vault checksum: add keysigs as well enable formats for secret key exports as well +PCPSTREAM changes: +- enable determine armor mode of input, parse headers, comments + and newlines away, decode and return the binary result with ps_read() + as before. Python binding, e.g.: diff --git a/include/pcp.h b/include/pcp.h index 8b16eae..fb0d6c6 100644 --- a/include/pcp.h +++ b/include/pcp.h @@ -8,6 +8,7 @@ extern "C" { #include "pcp/config.h" #include "pcp/base85.h" #include "pcp/buffer.h" +#include "pcp/config.h" #include "pcp/crypto.h" #include "pcp/defines.h" #include "pcp/digital_crc32.h" diff --git a/include/pcp/pcpstream.h b/include/pcp/pcpstream.h index 59b2d8a..221a9e8 100644 --- a/include/pcp/pcpstream.h +++ b/include/pcp/pcpstream.h @@ -28,6 +28,7 @@ #include "util.h" #include "defines.h" #include "buffer.h" +#include "z85.h" /** * \defgroup Pcpstream PCPSTREAMS @@ -58,9 +59,15 @@ struct _pcp_stream_t { FILE *fd; /**< The backend FILE stream */ Buffer *b; /**< The backend Buffer object */ + Buffer *z; /**< Buffer Cache for Z85 en/de-coding */ + Buffer *t; /**< Temporary Buffer */ uint8_t is_buffer; /**< Set to 1 if the backend is a Buffer */ uint8_t eof; /**< Set to 1 if EOF reached */ uint8_t err; /**< Set to 1 if an error occured */ + uint8_t armor; /**< Set to 1 if Z85 en/de-coding is requested */ + uint8_t determine; /**< Set to 1 to automatically determine armor mode */ + uint8_t firstread; /**< Internal flag, will be set after first read() */ + size_t linewr; /**< Used for Z85 writing, remember how many chars we lastly wrote on the current line */ }; /** The name used everywhere */ diff --git a/libpcp/pcpstream.c b/libpcp/pcpstream.c index 436919a..8a29ba1 100644 --- a/libpcp/pcpstream.c +++ b/libpcp/pcpstream.c @@ -23,11 +23,14 @@ Pcpstream *ps_init(void) { Pcpstream *stream = ucmalloc(sizeof(Pcpstream)); + stream->z = buffer_new(32, "Z85stream"); stream->b = NULL; stream->fd = NULL; stream->is_buffer = 0; stream->eof = 0; stream->err = 0; + stream->armor = 0; + stream->determine = 0; return stream; } @@ -51,15 +54,47 @@ Pcpstream *ps_new_outbuffer() { return stream; } +void ps_armor(Pcpstream *stream) { + stream->armor = 1; +} + +void ps_determine(Pcpstream *stream) { + stream->determine = 1; +} + +int ps_end(Pcpstream *stream) { + return stream->eof; +} + +int ps_err(Pcpstream *stream) { + return stream->err; +} + size_t ps_read(Pcpstream *stream, void *buf, size_t readbytes) { size_t gotbytes = 0; if(stream->is_buffer) { - /* check if there's enough space in our buffer */ + /* a buffer stream */ if(buffer_left(stream->b) < readbytes) readbytes = buffer_left(stream->b); - gotbytes = buffer_get_chunk(stream->b, buf, readbytes); + if(stream->armor == 1) { + size_t i = 0; + uint8_t c; + while (i < readbytes) { + c = buffer_get8(stream->b); + if(c != '\r' && c != '\n') { + buffer_add8(stream->z, c); + i++; + } + } + memcpy(buf, buffer_get(stream->z), buffer_size(stream->z)); + gotbytes = buffer_size(stream->z); + buffer_clear(stream->z); + } + else + gotbytes = buffer_get_chunk(stream->b, buf, readbytes); + if(gotbytes == 0) { /* this should not happen with buffers */ stream->eof = 1; @@ -67,7 +102,27 @@ size_t ps_read(Pcpstream *stream, void *buf, size_t readbytes) { } } else { - gotbytes = fread(buf, 1, readbytes, stream->fd); + /* a FILE stream */ + if(stream->armor == 1) { + size_t i = 0; + uint8_t c; + while (i < readbytes) { + gotbytes = fread(&c, 1, 1, stream->fd); + if(gotbytes == 0) + break; + if(c != '\r' && c != '\n') { + buffer_add8(stream->z, c); + i++; + } + } + memcpy(buf, buffer_get(stream->z), buffer_size(stream->z)); + gotbytes = buffer_size(stream->z); + _dump("buf", buf, gotbytes); + buffer_clear(stream->z); + } + else + gotbytes = fread(buf, 1, readbytes, stream->fd); + if(gotbytes == 0) { if(feof(stream->fd) != 0) stream->eof = 1; @@ -76,22 +131,82 @@ size_t ps_read(Pcpstream *stream, void *buf, size_t readbytes) { } } + if(gotbytes > 0 && stream->determine && stream->firstread == 0) { + /* check if we need to decode input */ + fprintf(stderr, "determine\n"); + if(_buffer_is_binary(buf, gotbytes) == 0) { + fprintf(stderr, "is armored\n"); + stream->armor = 1; + } + } + + stream->firstread = 1; + + if(gotbytes > 0 && stream->armor == 1) { + /* z85 decode buf */ + size_t binlen; + unsigned char *bin = pcp_z85_decode(buf, &binlen); + if(bin == NULL) { + return 0; + } + + memcpy(buf, bin, binlen); + + _dump("decoded", buf, binlen); + + free(bin); + return binlen; + } + return gotbytes; } size_t ps_write(Pcpstream *stream, void *buf, size_t writebytes) { size_t donebytes = 0; - if(stream->is_buffer) { - buffer_add(stream->b, buf, writebytes); - donebytes = writebytes; + if(stream->armor == 1) { + /* z85 encode buf */ + size_t padlen, zlen, i, pos; + unsigned char *padded = pcp_padfour(buf, writebytes, &padlen); + + zlen = (padlen * 5 / 4); + char *z85 = ucmalloc(zlen); + + zmq_z85_encode(z85, padded, padlen); + + _dump(" orig", buf, writebytes); + _dump(" z85", z85, zlen); + + pos = stream->linewr; + for(i=0; i= 71) { + buffer_add8(stream->z, '\r'); + buffer_add8(stream->z, '\n'); + pos = 1; + } + else + pos++; + buffer_add8(stream->z, z85[i]); + } + stream->linewr = pos; + _dump("n added", buffer_get(stream->z), buffer_size(stream->z)); } else { - donebytes = fwrite(buf, 1, writebytes, stream->fd); - if(ferror(stream->fd) != 0 || donebytes < writebytes) + buffer_add(stream->z, buf, writebytes); + } + + if(stream->is_buffer) { + buffer_add(stream->b, buffer_get(stream->z), buffer_size(stream->z)); + donebytes = buffer_size(stream->z); + } + else { + donebytes = fwrite(buffer_get(stream->z), 1, buffer_size(stream->z), stream->fd); + if(ferror(stream->fd) != 0 || donebytes < buffer_size(stream->z)) stream->err = 1; } + writebytes = buffer_size(stream->z); + buffer_clear(stream->z); return writebytes; } @@ -125,14 +240,6 @@ void ps_close(Pcpstream *stream) { } } -int ps_end(Pcpstream *stream) { - return stream->eof; -} - -int ps_err(Pcpstream *stream) { - return stream->err; -} - size_t ps_tell(Pcpstream *stream) { if(stream->is_buffer) { if(stream->b->end > stream->b->offset) @@ -148,3 +255,4 @@ size_t ps_tell(Pcpstream *stream) { Buffer *ps_buffer(Pcpstream *stream) { return stream->b; } + diff --git a/man/html/README.md b/man/html/README.md index 38cf6e9..f882617 100644 --- a/man/html/README.md +++ b/man/html/README.md @@ -2,5 +2,15 @@ API Documentation for libpcp ============================ The API docs are generated using doxygen from the -header files. You can read them locally after downloading -or "git clone' or read them [online](http://www.daemon.de/libpcp/). \ No newline at end of file +header files. + +You can read them [online](http://www.daemon.de/libpcp/). + +You can also generate the docs yourself: + +``` +git clone https://github.com/TLINDEN/pcp.git +doxygen man/.doxygen +``` + +You can access them afterwards from man/html/index.html. diff --git a/man/html/annotated.html b/man/html/annotated.html deleted file mode 100644 index 1c5b565..0000000 --- a/man/html/annotated.html +++ /dev/null @@ -1,69 +0,0 @@ - - - - - -libpcp: Class List - - - - - - -
-
- - - - - - -
-
libpcp -  0.2.1 -
-
-
- - - - -
-
-
-
Class List
-
-
-
Here are the classes, structs, unions and interfaces with brief descriptions:
- - - - - - - - - -
oC_pcp_bufferA flexible buffer object wich automatically resizes, if neccessary
oC_pcp_key_tPCP private key structure
oC_pcp_pubkey_tPCP public key structure
oC_pcp_rec_tEncrypted recipient list
oC_pcp_stream_tAn I/O wrapper object backed by a file or a buffer
oC_vault_header_tDefines the vault header
oC_vault_item_header_tAn item header
\C_vault_tThis structure represents a vault
-
-
- - - - diff --git a/man/html/bc_s.png b/man/html/bc_s.png deleted file mode 100644 index 224b29a..0000000 Binary files a/man/html/bc_s.png and /dev/null differ diff --git a/man/html/bdwn.png b/man/html/bdwn.png deleted file mode 100644 index 940a0b9..0000000 Binary files a/man/html/bdwn.png and /dev/null differ diff --git a/man/html/buffer_8h_source.html b/man/html/buffer_8h_source.html deleted file mode 100644 index 5437699..0000000 --- a/man/html/buffer_8h_source.html +++ /dev/null @@ -1,191 +0,0 @@ - - - - - -libpcp: buffer.h Source File - - - - - - -
-
- - - - - - -
-
libpcp -  0.2.1 -
-
-
- - - - - -
-
-
-
buffer.h
-
-
-
1 /*
-
2  This file is part of Pretty Curved Privacy (pcp1).
-
3 
-
4  Copyright (C) 2013-2014 T.v.Dein.
-
5 
-
6  This program is free software: you can redistribute it and/or modify
-
7  it under the terms of the GNU General Public License as published by
-
8  the Free Software Foundation, either version 3 of the License, or
-
9  (at your option) any later version.
-
10 
-
11  This program is distributed in the hope that it will be useful,
-
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
-
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-
14  GNU General Public License for more details.
-
15 
-
16  You should have received a copy of the GNU General Public License
-
17  along with this program. If not, see <http://www.gnu.org/licenses/>.
-
18 
-
19  You can contact me by mail: <tom AT vondein DOT org>.
-
20 */
-
21 
-
22 #ifndef HAVE_PCP_BUFFER_H
-
23 #define HAVE_PCP_BUFFER_H
-
24 
-
25 #include <stdio.h>
-
26 #include <stdarg.h>
-
27 #include "mem.h"
-
28 #include "util.h"
-
29 #include "defines.h"
-
30 
-
50 struct _pcp_buffer {
-
51  char *name;
-
52  uint8_t allocated;
-
53  size_t blocksize;
-
54  size_t size;
-
55  size_t offset;
-
56  size_t end;
-
57  uint8_t isstring;
-
58  void *buf;
-
59 };
-
60 
-
62 typedef struct _pcp_buffer Buffer;
-
63 
-
75 Buffer *buffer_new(size_t blocksize, char *name);
-
76 
-
86 Buffer *buffer_new_str(char *name);
-
87 
-
88 
-
155 Buffer *buffer_new_buf(char *name, void *data, size_t datasize);
-
156 
-
157 /* initialize buffer vars */
-
158 void buffer_init(Buffer *b, size_t blocksize, char *name);
-
159 
-
168 void buffer_free(Buffer *b);
-
169 
-
178 void buffer_clear(Buffer *b);
-
179 
-
187 void buffer_rewind(Buffer *b);
-
188 
-
203 void buffer_add(Buffer *b, const void *data, size_t len);
-
204 
-
217 void buffer_add_buf(Buffer *dst, Buffer *src);
-
218 
-
239 void buffer_add_str(Buffer *b, const char * fmt, ...);
-
240 
-
256 void buffer_add_hex(Buffer *b, void *data, size_t len);
-
257 
-
258 /* resize the buffer if necessary, used internally only */
-
259 void buffer_resize(Buffer *b, size_t len);
-
260 
-
270 int buffer_done(Buffer *b);
-
271 
-
303 size_t buffer_get_chunk(Buffer *b, void *buf, size_t len);
-
304 
-
319 unsigned char *buffer_get(Buffer *b);
-
320 
-
345 char *buffer_get_str(Buffer *b);
-
346 
-
381 unsigned char *buffer_get_remainder(Buffer *b);
-
382 
-
418 size_t buffer_extract(Buffer *b, void *buf, size_t offset, size_t len);
-
419 
-
424 void buffer_dump(const Buffer *b);
-
425 
-
430 void buffer_info(const Buffer *b);
-
431 
-
442 size_t buffer_size(const Buffer *b);
-
443 
-
472 size_t buffer_left(const Buffer *b);
-
473 
-
480 uint8_t buffer_get8(Buffer *b);
-
481 
-
488 uint16_t buffer_get16(Buffer *b);
-
489 
-
496 uint32_t buffer_get32(Buffer *b);
-
497 
-
504 uint64_t buffer_get64(Buffer *b);
-
505 
-
512 uint16_t buffer_get16na(Buffer *b);
-
513 
-
520 uint32_t buffer_get32na(Buffer *b);
-
521 
-
528 uint64_t buffer_get64na(Buffer *b);
-
529 
-
538 uint8_t buffer_last8(Buffer *b);
-
539 
-
548 uint16_t buffer_last16(Buffer *b);
-
549 
-
558 uint32_t buffer_last32(Buffer *b);
-
559 
-
568 uint64_t buffer_last64(Buffer *b);
-
569 
-
586 size_t buffer_fd_read(Buffer *b, FILE *in, size_t len);
-
587 
-
594 void buffer_add8(Buffer *b, uint8_t v);
-
595 
-
602 void buffer_add16(Buffer *b, uint16_t v);
-
603 
-
610 void buffer_add32(Buffer *b, uint32_t v);
-
611 
-
618 void buffer_add64(Buffer *b, uint64_t v);
-
619 
-
626 void buffer_add16be(Buffer *b, uint16_t v);
-
627 
-
634 void buffer_add32be(Buffer *b, uint32_t v);
-
635 
-
642 void buffer_add64be(Buffer *b, uint64_t v);
-
643 
-
644 
-
645 #endif // HAVE_PCP_BUFFER_H
-
646 
-
- - - - diff --git a/man/html/classes.html b/man/html/classes.html deleted file mode 100644 index 8afb588..0000000 --- a/man/html/classes.html +++ /dev/null @@ -1,66 +0,0 @@ - - - - - -libpcp: Class Index - - - - - - -
-
- - - - - - -
-
libpcp -  0.2.1 -
-
-
- - - - -
-
-
-
Class Index
-
-
- - - - - - -
  _  
-
_pcp_key_t   _pcp_rec_t   _vault_header_t   _vault_t   
_pcp_pubkey_t   _pcp_stream_t   _vault_item_header_t   
_pcp_buffer   
- -
- - - - diff --git a/man/html/closed.png b/man/html/closed.png deleted file mode 100644 index 98cc2c9..0000000 Binary files a/man/html/closed.png and /dev/null differ diff --git a/man/html/crypto_8h_source.html b/man/html/crypto_8h_source.html deleted file mode 100644 index 001062e..0000000 --- a/man/html/crypto_8h_source.html +++ /dev/null @@ -1,133 +0,0 @@ - - - - - -libpcp: crypto.h Source File - - - - - - -
-
- - - - - - -
-
libpcp -  0.2.1 -
-
-
- - - - - -
-
-
-
crypto.h
-
-
-
1 /*
-
2  This file is part of Pretty Curved Privacy (pcp1).
-
3 
-
4  Copyright (C) 2013 T.Linden.
-
5 
-
6  This program is free software: you can redistribute it and/or modify
-
7  it under the terms of the GNU General Public License as published by
-
8  the Free Software Foundation, either version 3 of the License, or
-
9  (at your option) any later version.
-
10 
-
11  This program is distributed in the hope that it will be useful,
-
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
-
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-
14  GNU General Public License for more details.
-
15 
-
16  You should have received a copy of the GNU General Public License
-
17  along with this program. If not, see <http://www.gnu.org/licenses/>.
-
18 
-
19  You can contact me by mail: <tlinden AT cpan DOT org>.
-
20 */
-
21 
-
22 
-
23 #ifndef _HAVE_PCP_CRYPTO_H
-
24 #define _HAVE_PCP_CRYPTO_H
-
25 
-
26 #include <sodium.h>
-
27 #include <string.h>
-
28 #include <stdio.h>
-
29 #include <sodium.h>
-
30 #include <stdlib.h>
-
31 
-
32 #include "defines.h"
-
33 #include "mem.h"
-
34 #include "key.h"
-
35 #include "keyhash.h"
-
36 #include "ed.h"
-
37 #include "pcpstream.h"
-
38 
-
118 size_t pcp_sodium_box(unsigned char **cipher,
-
119  unsigned char *cleartext,
-
120  size_t clearsize,
-
121  unsigned char *nonce,
-
122  unsigned char *secret,
-
123  unsigned char *pub);
-
124 
-
125 int pcp_sodium_verify_box(unsigned char **cleartext, unsigned char* message,
-
126  size_t messagesize, unsigned char *nonce,
-
127  unsigned char *secret, unsigned char *pub);
-
128 
-
149 unsigned char *pcp_box_encrypt(pcp_key_t *secret, pcp_pubkey_t *pub,
-
150  unsigned char *message, size_t messagesize,
-
151  size_t *csize);
-
152 
-
173 unsigned char *pcp_box_decrypt(pcp_key_t *secret, pcp_pubkey_t *pub,
-
174  unsigned char *cipher, size_t ciphersize,
-
175  size_t *dsize);
-
176 
-
177 
-
197 size_t pcp_encrypt_stream(Pcpstream *in, Pcpstream* out, pcp_key_t *s, pcp_pubkey_t *p, int signcrypt);
-
198 
-
220 size_t pcp_encrypt_stream_sym(Pcpstream *in, Pcpstream* out, unsigned char *symkey, int havehead, pcp_rec_t *recsign);
-
221 
-
222 
-
244 size_t pcp_decrypt_stream(Pcpstream *in, Pcpstream* out, pcp_key_t *s, unsigned char *symkey, int verify);
-
245 
-
246 
-
266 size_t pcp_decrypt_stream_sym(Pcpstream *in, Pcpstream* out, unsigned char *symkey, pcp_rec_t *recverify);
-
267 
-
268 pcp_rec_t *pcp_rec_new(unsigned char *cipher, size_t clen, pcp_key_t *secret, pcp_pubkey_t *pub);
-
269 void pcp_rec_free(pcp_rec_t *r);
-
270 
-
271 #endif /* _HAVE_PCP_CRYPTO_H */
-
272 
-
- - - - diff --git a/man/html/defines_8h_source.html b/man/html/defines_8h_source.html deleted file mode 100644 index 7ea147d..0000000 --- a/man/html/defines_8h_source.html +++ /dev/null @@ -1,175 +0,0 @@ - - - - - -libpcp: defines.h Source File - - - - - - -
-
- - - - - - -
-
libpcp -  0.2.1 -
-
-
- - - - - -
-
-
-
defines.h
-
-
-
1 /*
-
2  This file is part of Pretty Curved Privacy (pcp1).
-
3 
-
4  Copyright (C) 2013 T.Linden.
-
5 
-
6  This program is free software: you can redistribute it and/or modify
-
7  it under the terms of the GNU General Public License as published by
-
8  the Free Software Foundation, either version 3 of the License, or
-
9  (at your option) any later version.
-
10 
-
11  This program is distributed in the hope that it will be useful,
-
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
-
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-
14  GNU General Public License for more details.
-
15 
-
16  You should have received a copy of the GNU General Public License
-
17  along with this program. If not, see <http://www.gnu.org/licenses/>.
-
18 
-
19  You can contact me by mail: <tlinden AT cpan DOT org>.
-
20 */
-
21 
-
22 
-
23 #ifndef _DEFINES_H
-
24 #define _DEFINES_H
-
25 
-
26 
-
54 #include "config.h"
-
55 
-
56 typedef unsigned char byte; /* Single unsigned byte = 8 bits */
-
57 typedef unsigned short dbyte; /* Double byte = 16 bits */
-
58 typedef unsigned int qbyte; /* Quad byte = 32 bits */
-
59 
-
60 /* key stuff, deprecated. */
-
61 #define PCP_KEY_HEADER "----- BEGIN PCP SECRET KEY -----"
-
62 #define PCP_KEY_FOOTER "------ END PCP SECRET KEY ------"
-
63 
-
64 #define PCP_PUBKEY_HEADER "----- BEGIN PCP PUBLIC KEY -----"
-
65 #define PCP_PUBKEY_FOOTER "------ END PCP PUBLICKEY ------"
-
66 
-
67 #define PCP_ENFILE_HEADER "----- BEGIN PCP ENCRYPTED FILE -----"
-
68 #define PCP_ENFILE_FOOTER "------ END PCP ENCRYPTED FILE ------"
-
69 
-
70 #define PCP_ZFILE_HEADER "----- BEGIN Z85 ENCODED FILE -----"
-
71 #define PCP_ZFILE_FOOTER "------ END Z85 ENCODED FILE ------"
-
72 
-
73 #define PCP_SIG_HEADER "----- BEGIN ED25519 SIGNED MESSAGE -----"
-
74 #define PCP_SIG_START "----- BEGIN ED25519 SIGNATURE -----"
-
75 #define PCP_SIG_END "------ END ED25519 SIGNATURE ------"
-
76 #define PCP_SIGPREFIX "\nnacl-"
-
77 
-
78 #define PCP_ME "Pretty Curved Privacy"
-
79 
-
80 #define PCP_KEY_VERSION 6
-
81 #define PCP_KEY_PRIMITIVE "CURVE25519-ED25519-SALSA20-POLY1305"
-
82 
-
92 typedef enum _PCP_KEY_TYPES {
- - - - - -
98 } PCP_KEY_TYPES;
-
99 
-
103 /* save typing, dammit */
-
104 #define PCP_ENCRYPT_MAC crypto_secretbox_ZEROBYTES + crypto_secretbox_NONCEBYTES
-
105 
-
106 /* vault id */
-
107 #define PCP_VAULT_ID 14
-
108 #define PCP_VAULT_VERSION 2
-
109 
-
110 /* sigs */
-
111 #define PCP_SIG_VERSION 2
-
112 
-
113 /* crypto file format stuff */
-
114 /* enabled via config.h (configure --enable-cbc) */
-
115 #ifndef PCP_CBC
-
116  #define PCP_ASYM_CIPHER 5
-
117  #define PCP_SYM_CIPHER 23
-
118  #define PCP_BLOCK_SIZE 32 * 1024
-
119 #else
-
120 /* CBC mode, use smaller blocks */
-
121  #define PCP_ASYM_CIPHER 7
-
122  #define PCP_SYM_CIPHER 25
-
123  #define PCP_BLOCK_SIZE 1 * 1024
-
124 #endif
-
125 
-
126 #define PCP_CRYPTO_ADD (crypto_box_ZEROBYTES - crypto_box_BOXZEROBYTES)
-
127 #define PCP_BLOCK_SIZE_IN (PCP_BLOCK_SIZE) + PCP_CRYPTO_ADD + crypto_secretbox_NONCEBYTES
-
128 #define PCP_ASYM_RECIPIENT_SIZE crypto_secretbox_KEYBYTES + PCP_CRYPTO_ADD + crypto_secretbox_NONCEBYTES
-
129 
-
130 /* #define PCP_ASYM_ADD_SENDER_PUB */
-
131 
-
132 /* used for self encryption only */
-
133 #define PBP_COMPAT_SALT "qa~t](84z<1t<1oz:ik.@IRNyhG=8q(on9}4#!/_h#a7wqK{Nt$T?W>,mt8NqYq&6U<GB1$,<$j>,rSYI2GRDd:Bcm"
-
134 
-
135 #define PCP_RFC_CIPHER 0x21 /* curve25519+ed25519+poly1305+salsa20+blake2 */
-
136 
-
145 /* error handling */
-
146 
-
152 extern char *PCP_ERR;
-
153 
-
158 extern byte PCP_ERRSET;
-
159 
-
164 extern int PCP_EXIT;
-
165 
-
176 void fatal(const char * fmt, ...);
-
177 
-
183 void fatals_ifany();
-
184 
-
190 void fatals_reset();
-
191 
-
194 void fatals_done();
-
195 
-
196 #endif /* _DEFINES_H */
-
197 
-
- - - - diff --git a/man/html/dir_76e3dfa7802a76391b3a5cc4012b4dd7.html b/man/html/dir_76e3dfa7802a76391b3a5cc4012b4dd7.html deleted file mode 100644 index 4447785..0000000 --- a/man/html/dir_76e3dfa7802a76391b3a5cc4012b4dd7.html +++ /dev/null @@ -1,99 +0,0 @@ - - - - - -libpcp: pcp Directory Reference - - - - - - -
-
- - - - - - -
-
libpcp -  0.2.1 -
-
-
- - - - -
-
-
-
pcp Directory Reference
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

-Files

file  buffer.h [code]
 
file  crypto.h [code]
 
file  defines.h [code]
 
file  ed.h [code]
 
file  getpass.h [code]
 
file  key.h [code]
 
file  keyhash.h [code]
 
file  keysig.h [code]
 
file  mac.h [code]
 
file  mem.h [code]
 
file  mgmt.h [code]
 
file  pad.h [code]
 
file  pcpstream.h [code]
 
file  plist.h [code]
 
file  randomart.h [code]
 
file  scrypt.h [code]
 
file  util.h [code]
 
file  vault.h [code]
 
file  version.h [code]
 
file  z85.h [code]
 
-
- - - - diff --git a/man/html/dir_d44c64559bbebec7f509842c48db8b23.html b/man/html/dir_d44c64559bbebec7f509842c48db8b23.html deleted file mode 100644 index d1667d1..0000000 --- a/man/html/dir_d44c64559bbebec7f509842c48db8b23.html +++ /dev/null @@ -1,61 +0,0 @@ - - - - - -libpcp: include Directory Reference - - - - - - -
-
- - - - - - -
-
libpcp -  0.2.1 -
-
-
- - - - -
-
-
-
include Directory Reference
-
-
- - - - -

-Directories

directory  pcp
 
-
- - - - diff --git a/man/html/doxygen.css b/man/html/doxygen.css deleted file mode 100644 index 2642e8f..0000000 --- a/man/html/doxygen.css +++ /dev/null @@ -1,1172 +0,0 @@ -/* The standard CSS for doxygen */ - -body, table, div, p, dl { - font: 400 14px/19px Roboto,sans-serif; -} - -/* @group Heading Levels */ - -h1.groupheader { - font-size: 150%; -} - -.title { - font-size: 150%; - font-weight: bold; - margin: 10px 2px; -} - -h2.groupheader { - border-bottom: 1px solid #879ECB; - color: #354C7B; - font-size: 150%; - font-weight: normal; - margin-top: 1.75em; - padding-top: 8px; - padding-bottom: 4px; - width: 100%; -} - -h3.groupheader { - font-size: 100%; -} - -h1, h2, h3, h4, h5, h6 { - -webkit-transition: text-shadow 0.5s linear; - -moz-transition: text-shadow 0.5s linear; - -ms-transition: text-shadow 0.5s linear; - -o-transition: text-shadow 0.5s linear; - transition: text-shadow 0.5s linear; - margin-right: 15px; -} - -h1.glow, h2.glow, h3.glow, h4.glow, h5.glow, h6.glow { - text-shadow: 0 0 15px cyan; -} - -dt { - font-weight: bold; -} - -div.multicol { - -moz-column-gap: 1em; - -webkit-column-gap: 1em; - -moz-column-count: 3; - -webkit-column-count: 3; -} - -p.startli, p.startdd, p.starttd { - margin-top: 2px; -} - -p.endli { - margin-bottom: 0px; -} - -p.enddd { - margin-bottom: 4px; -} - -p.endtd { - margin-bottom: 2px; -} - -/* @end */ - -caption { - font-weight: bold; -} - -span.legend { - font-size: 70%; - text-align: center; -} - -h3.version { - font-size: 90%; - text-align: center; -} - -div.qindex, div.navtab{ - background-color: #EBEFF6; - border: 1px solid #A3B4D7; - text-align: center; -} - -div.qindex, div.navpath { - width: 100%; - line-height: 140%; -} - -div.navtab { - margin-right: 15px; -} - -/* @group Link Styling */ - -a { - color: #3D578C; - font-weight: normal; - text-decoration: none; -} - -.contents a:visited { - color: #4665A2; -} - -a:hover { - text-decoration: underline; -} - -a.qindex { - font-weight: bold; -} - -a.qindexHL { - font-weight: bold; - background-color: #9CAFD4; - color: #ffffff; - border: 1px double #869DCA; -} - -.contents a.qindexHL:visited { - color: #ffffff; -} - -a.el { - font-weight: bold; -} - -a.elRef { -} - -a.code, a.code:visited { - color: #4665A2; -} - -a.codeRef, a.codeRef:visited { - color: #4665A2; -} - -/* @end */ - -dl.el { - margin-left: -1cm; -} - -pre.fragment { - border: 1px solid #C4CFE5; - background-color: #FBFCFD; - padding: 4px 6px; - margin: 4px 8px 4px 2px; - overflow: auto; - word-wrap: break-word; - font-size: 9pt; - line-height: 125%; - font-family: monospace, fixed; - font-size: 105%; -} - -div.fragment { - padding: 4px; - margin: 4px; - background-color: #FBFCFD; - border: 1px solid #C4CFE5; -} - -div.line { - font-family: monospace, fixed; - font-size: 13px; - min-height: 13px; - line-height: 1.0; - text-wrap: unrestricted; - white-space: -moz-pre-wrap; /* Moz */ - white-space: -pre-wrap; /* Opera 4-6 */ - white-space: -o-pre-wrap; /* Opera 7 */ - white-space: pre-wrap; /* CSS3 */ - word-wrap: break-word; /* IE 5.5+ */ - text-indent: -53px; - padding-left: 53px; - padding-bottom: 0px; - margin: 0px; - -webkit-transition-property: background-color, box-shadow; - -webkit-transition-duration: 0.5s; - -moz-transition-property: background-color, box-shadow; - -moz-transition-duration: 0.5s; - -ms-transition-property: background-color, box-shadow; - -ms-transition-duration: 0.5s; - -o-transition-property: background-color, box-shadow; - -o-transition-duration: 0.5s; - transition-property: background-color, box-shadow; - transition-duration: 0.5s; -} - -div.line.glow { - background-color: cyan; - box-shadow: 0 0 10px cyan; -} - - -span.lineno { - padding-right: 4px; - text-align: right; - border-right: 2px solid #0F0; - background-color: #E8E8E8; - white-space: pre; -} -span.lineno a { - background-color: #D8D8D8; -} - -span.lineno a:hover { - background-color: #C8C8C8; -} - -div.ah { - background-color: black; - font-weight: bold; - color: #ffffff; - margin-bottom: 3px; - margin-top: 3px; - padding: 0.2em; - border: solid thin #333; - border-radius: 0.5em; - -webkit-border-radius: .5em; - -moz-border-radius: .5em; - box-shadow: 2px 2px 3px #999; - -webkit-box-shadow: 2px 2px 3px #999; - -moz-box-shadow: rgba(0, 0, 0, 0.15) 2px 2px 2px; - background-image: -webkit-gradient(linear, left top, left bottom, from(#eee), to(#000),color-stop(0.3, #444)); - background-image: -moz-linear-gradient(center top, #eee 0%, #444 40%, #000); -} - -div.groupHeader { - margin-left: 16px; - margin-top: 12px; - font-weight: bold; -} - -div.groupText { - margin-left: 16px; - font-style: italic; -} - -body { - background-color: white; - color: black; - margin: 0; -} - -div.contents { - margin-top: 10px; - margin-left: 12px; - margin-right: 8px; -} - -td.indexkey { - background-color: #EBEFF6; - font-weight: bold; - border: 1px solid #C4CFE5; - margin: 2px 0px 2px 0; - padding: 2px 10px; - white-space: nowrap; - vertical-align: top; -} - -td.indexvalue { - background-color: #EBEFF6; - border: 1px solid #C4CFE5; - padding: 2px 10px; - margin: 2px 0px; -} - -tr.memlist { - background-color: #EEF1F7; -} - -p.formulaDsp { - text-align: center; -} - -img.formulaDsp { - -} - -img.formulaInl { - vertical-align: middle; -} - -div.center { - text-align: center; - margin-top: 0px; - margin-bottom: 0px; - padding: 0px; -} - -div.center img { - border: 0px; -} - -address.footer { - text-align: right; - padding-right: 12px; -} - -img.footer { - border: 0px; - vertical-align: middle; -} - -/* @group Code Colorization */ - -span.keyword { - color: #008000 -} - -span.keywordtype { - color: #604020 -} - -span.keywordflow { - color: #e08000 -} - -span.comment { - color: #800000 -} - -span.preprocessor { - color: #806020 -} - -span.stringliteral { - color: #002080 -} - -span.charliteral { - color: #008080 -} - -span.vhdldigit { - color: #ff00ff -} - -span.vhdlchar { - color: #000000 -} - -span.vhdlkeyword { - color: #700070 -} - -span.vhdllogic { - color: #ff0000 -} - -blockquote { - background-color: #F7F8FB; - border-left: 2px solid #9CAFD4; - margin: 0 24px 0 4px; - padding: 0 12px 0 16px; -} - -/* @end */ - -/* -.search { - color: #003399; - font-weight: bold; -} - -form.search { - margin-bottom: 0px; - margin-top: 0px; -} - -input.search { - font-size: 75%; - color: #000080; - font-weight: normal; - background-color: #e8eef2; -} -*/ - -td.tiny { - font-size: 75%; -} - -.dirtab { - padding: 4px; - border-collapse: collapse; - border: 1px solid #A3B4D7; -} - -th.dirtab { - background: #EBEFF6; - font-weight: bold; -} - -hr { - height: 0px; - border: none; - border-top: 1px solid #4A6AAA; -} - -hr.footer { - height: 1px; -} - -/* @group Member Descriptions */ - -table.memberdecls { - border-spacing: 0px; - padding: 0px; -} - -.memberdecls td, .fieldtable tr { - -webkit-transition-property: background-color, box-shadow; - -webkit-transition-duration: 0.5s; - -moz-transition-property: background-color, box-shadow; - -moz-transition-duration: 0.5s; - -ms-transition-property: background-color, box-shadow; - -ms-transition-duration: 0.5s; - -o-transition-property: background-color, box-shadow; - -o-transition-duration: 0.5s; - transition-property: background-color, box-shadow; - transition-duration: 0.5s; -} - -.memberdecls td.glow, .fieldtable tr.glow { - background-color: cyan; - box-shadow: 0 0 15px cyan; -} - -.mdescLeft, .mdescRight, -.memItemLeft, .memItemRight, -.memTemplItemLeft, .memTemplItemRight, .memTemplParams { - background-color: #F9FAFC; - border: none; - margin: 4px; - padding: 1px 0 0 8px; -} - -.mdescLeft, .mdescRight { - padding: 0px 8px 4px 8px; - color: #555; -} - -.memSeparator { - border-bottom: 1px solid #DEE4F0; - line-height: 1px; - margin: 0px; - padding: 0px; -} - -.memItemLeft, .memTemplItemLeft { - white-space: nowrap; -} - -.memItemRight { - width: 100%; -} - -.memTemplParams { - color: #4665A2; - white-space: nowrap; - font-size: 80%; -} - -/* @end */ - -/* @group Member Details */ - -/* Styles for detailed member documentation */ - -.memtemplate { - font-size: 80%; - color: #4665A2; - font-weight: normal; - margin-left: 9px; -} - -.memnav { - background-color: #EBEFF6; - border: 1px solid #A3B4D7; - text-align: center; - margin: 2px; - margin-right: 15px; - padding: 2px; -} - -.mempage { - width: 100%; -} - -.memitem { - padding: 0; - margin-bottom: 10px; - margin-right: 5px; - -webkit-transition: box-shadow 0.5s linear; - -moz-transition: box-shadow 0.5s linear; - -ms-transition: box-shadow 0.5s linear; - -o-transition: box-shadow 0.5s linear; - transition: box-shadow 0.5s linear; - display: table !important; - width: 100%; -} - -.memitem.glow { - box-shadow: 0 0 15px cyan; -} - -.memname { - font-weight: bold; - margin-left: 6px; -} - -.memname td { - vertical-align: bottom; -} - -.memproto, dl.reflist dt { - border-top: 1px solid #A8B8D9; - border-left: 1px solid #A8B8D9; - border-right: 1px solid #A8B8D9; - padding: 6px 0px 6px 0px; - color: #253555; - font-weight: bold; - text-shadow: 0px 1px 1px rgba(255, 255, 255, 0.9); - background-image:url('nav_f.png'); - background-repeat:repeat-x; - background-color: #E2E8F2; - /* opera specific markup */ - box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); - border-top-right-radius: 4px; - border-top-left-radius: 4px; - /* firefox specific markup */ - -moz-box-shadow: rgba(0, 0, 0, 0.15) 5px 5px 5px; - -moz-border-radius-topright: 4px; - -moz-border-radius-topleft: 4px; - /* webkit specific markup */ - -webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); - -webkit-border-top-right-radius: 4px; - -webkit-border-top-left-radius: 4px; - -} - -.memdoc, dl.reflist dd { - border-bottom: 1px solid #A8B8D9; - border-left: 1px solid #A8B8D9; - border-right: 1px solid #A8B8D9; - padding: 6px 10px 2px 10px; - background-color: #FBFCFD; - border-top-width: 0; - background-image:url('nav_g.png'); - background-repeat:repeat-x; - background-color: #FFFFFF; - /* opera specific markup */ - border-bottom-left-radius: 4px; - border-bottom-right-radius: 4px; - box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); - /* firefox specific markup */ - -moz-border-radius-bottomleft: 4px; - -moz-border-radius-bottomright: 4px; - -moz-box-shadow: rgba(0, 0, 0, 0.15) 5px 5px 5px; - /* webkit specific markup */ - -webkit-border-bottom-left-radius: 4px; - -webkit-border-bottom-right-radius: 4px; - -webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); -} - -dl.reflist dt { - padding: 5px; -} - -dl.reflist dd { - margin: 0px 0px 10px 0px; - padding: 5px; -} - -.paramkey { - text-align: right; -} - -.paramtype { - white-space: nowrap; -} - -.paramname { - color: #602020; - white-space: nowrap; -} -.paramname em { - font-style: normal; -} -.paramname code { - line-height: 14px; -} - -.params, .retval, .exception, .tparams { - margin-left: 0px; - padding-left: 0px; -} - -.params .paramname, .retval .paramname { - font-weight: bold; - vertical-align: top; -} - -.params .paramtype { - font-style: italic; - vertical-align: top; -} - -.params .paramdir { - font-family: "courier new",courier,monospace; - vertical-align: top; -} - -table.mlabels { - border-spacing: 0px; -} - -td.mlabels-left { - width: 100%; - padding: 0px; -} - -td.mlabels-right { - vertical-align: bottom; - padding: 0px; - white-space: nowrap; -} - -span.mlabels { - margin-left: 8px; -} - -span.mlabel { - background-color: #728DC1; - border-top:1px solid #5373B4; - border-left:1px solid #5373B4; - border-right:1px solid #C4CFE5; - border-bottom:1px solid #C4CFE5; - text-shadow: none; - color: white; - margin-right: 4px; - padding: 2px 3px; - border-radius: 3px; - font-size: 7pt; - white-space: nowrap; - vertical-align: middle; -} - - - -/* @end */ - -/* these are for tree view when not used as main index */ - -div.directory { - margin: 10px 0px; - border-top: 1px solid #A8B8D9; - border-bottom: 1px solid #A8B8D9; - width: 100%; -} - -.directory table { - border-collapse:collapse; -} - -.directory td { - margin: 0px; - padding: 0px; - vertical-align: top; -} - -.directory td.entry { - white-space: nowrap; - padding-right: 6px; -} - -.directory td.entry a { - outline:none; -} - -.directory td.entry a img { - border: none; -} - -.directory td.desc { - width: 100%; - padding-left: 6px; - padding-right: 6px; - padding-top: 3px; - border-left: 1px solid rgba(0,0,0,0.05); -} - -.directory tr.even { - padding-left: 6px; - background-color: #F7F8FB; -} - -.directory img { - vertical-align: -30%; -} - -.directory .levels { - white-space: nowrap; - width: 100%; - text-align: right; - font-size: 9pt; -} - -.directory .levels span { - cursor: pointer; - padding-left: 2px; - padding-right: 2px; - color: #3D578C; -} - -div.dynheader { - margin-top: 8px; - -webkit-touch-callout: none; - -webkit-user-select: none; - -khtml-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; -} - -address { - font-style: normal; - color: #2A3D61; -} - -table.doxtable { - border-collapse:collapse; - margin-top: 4px; - margin-bottom: 4px; -} - -table.doxtable td, table.doxtable th { - border: 1px solid #2D4068; - padding: 3px 7px 2px; -} - -table.doxtable th { - background-color: #374F7F; - color: #FFFFFF; - font-size: 110%; - padding-bottom: 4px; - padding-top: 5px; -} - -table.fieldtable { - width: 100%; - margin-bottom: 10px; - border: 1px solid #A8B8D9; - border-spacing: 0px; - -moz-border-radius: 4px; - -webkit-border-radius: 4px; - border-radius: 4px; - -moz-box-shadow: rgba(0, 0, 0, 0.15) 2px 2px 2px; - -webkit-box-shadow: 2px 2px 2px rgba(0, 0, 0, 0.15); - box-shadow: 2px 2px 2px rgba(0, 0, 0, 0.15); -} - -.fieldtable td, .fieldtable th { - padding: 3px 7px 2px; -} - -.fieldtable td.fieldtype, .fieldtable td.fieldname { - white-space: nowrap; - border-right: 1px solid #A8B8D9; - border-bottom: 1px solid #A8B8D9; - vertical-align: top; -} - -.fieldtable td.fielddoc { - border-bottom: 1px solid #A8B8D9; - width: 100%; -} - -.fieldtable tr:last-child td { - border-bottom: none; -} - -.fieldtable th { - background-image:url('nav_f.png'); - background-repeat:repeat-x; - background-color: #E2E8F2; - font-size: 90%; - color: #253555; - padding-bottom: 4px; - padding-top: 5px; - text-align:left; - -moz-border-radius-topleft: 4px; - -moz-border-radius-topright: 4px; - -webkit-border-top-left-radius: 4px; - -webkit-border-top-right-radius: 4px; - border-top-left-radius: 4px; - border-top-right-radius: 4px; - border-bottom: 1px solid #A8B8D9; -} - - -.tabsearch { - top: 0px; - left: 10px; - height: 36px; - background-image: url('tab_b.png'); - z-index: 101; - overflow: hidden; - font-size: 13px; -} - -.navpath ul -{ - font-size: 11px; - background-image:url('tab_b.png'); - background-repeat:repeat-x; - background-position: 0 -5px; - height:30px; - line-height:30px; - color:#8AA0CC; - border:solid 1px #C2CDE4; - overflow:hidden; - margin:0px; - padding:0px; -} - -.navpath li -{ - list-style-type:none; - float:left; - padding-left:10px; - padding-right:15px; - background-image:url('bc_s.png'); - background-repeat:no-repeat; - background-position:right; - color:#364D7C; -} - -.navpath li.navelem a -{ - height:32px; - display:block; - text-decoration: none; - outline: none; - color: #283A5D; - font-family: 'Lucida Grande',Geneva,Helvetica,Arial,sans-serif; - text-shadow: 0px 1px 1px rgba(255, 255, 255, 0.9); - text-decoration: none; -} - -.navpath li.navelem a:hover -{ - color:#6884BD; -} - -.navpath li.footer -{ - list-style-type:none; - float:right; - padding-left:10px; - padding-right:15px; - background-image:none; - background-repeat:no-repeat; - background-position:right; - color:#364D7C; - font-size: 8pt; -} - - -div.summary -{ - float: right; - font-size: 8pt; - padding-right: 5px; - width: 50%; - text-align: right; -} - -div.summary a -{ - white-space: nowrap; -} - -div.ingroups -{ - font-size: 8pt; - width: 50%; - text-align: left; -} - -div.ingroups a -{ - white-space: nowrap; -} - -div.header -{ - background-image:url('nav_h.png'); - background-repeat:repeat-x; - background-color: #F9FAFC; - margin: 0px; - border-bottom: 1px solid #C4CFE5; -} - -div.headertitle -{ - padding: 5px 5px 5px 10px; -} - -dl -{ - padding: 0 0 0 10px; -} - -/* dl.note, dl.warning, dl.attention, dl.pre, dl.post, dl.invariant, dl.deprecated, dl.todo, dl.test, dl.bug */ -dl.section -{ - margin-left: 0px; - padding-left: 0px; -} - -dl.note -{ - margin-left:-7px; - padding-left: 3px; - border-left:4px solid; - border-color: #D0C000; -} - -dl.warning, dl.attention -{ - margin-left:-7px; - padding-left: 3px; - border-left:4px solid; - border-color: #FF0000; -} - -dl.pre, dl.post, dl.invariant -{ - margin-left:-7px; - padding-left: 3px; - border-left:4px solid; - border-color: #00D000; -} - -dl.deprecated -{ - margin-left:-7px; - padding-left: 3px; - border-left:4px solid; - border-color: #505050; -} - -dl.todo -{ - margin-left:-7px; - padding-left: 3px; - border-left:4px solid; - border-color: #00C0E0; -} - -dl.test -{ - margin-left:-7px; - padding-left: 3px; - border-left:4px solid; - border-color: #3030E0; -} - -dl.bug -{ - margin-left:-7px; - padding-left: 3px; - border-left:4px solid; - border-color: #C08050; -} - -dl.section dd { - margin-bottom: 6px; -} - - -#projectlogo -{ - text-align: center; - vertical-align: bottom; - border-collapse: separate; -} - -#projectlogo img -{ - border: 0px none; -} - -#projectname -{ - font: 300% Tahoma, Arial,sans-serif; - margin: 0px; - padding: 2px 0px; -} - -#projectbrief -{ - font: 120% Tahoma, Arial,sans-serif; - margin: 0px; - padding: 0px; -} - -#projectnumber -{ - font: 50% Tahoma, Arial,sans-serif; - margin: 0px; - padding: 0px; -} - -#titlearea -{ - padding: 0px; - margin: 0px; - width: 100%; - border-bottom: 1px solid #5373B4; -} - -.image -{ - text-align: center; -} - -.dotgraph -{ - text-align: center; -} - -.mscgraph -{ - text-align: center; -} - -.caption -{ - font-weight: bold; -} - -div.zoom -{ - border: 1px solid #90A5CE; -} - -dl.citelist { - margin-bottom:50px; -} - -dl.citelist dt { - color:#334975; - float:left; - font-weight:bold; - margin-right:10px; - padding:5px; -} - -dl.citelist dd { - margin:2px 0; - padding:5px 0; -} - -div.toc { - padding: 14px 25px; - background-color: #F4F6FA; - border: 1px solid #D8DFEE; - border-radius: 7px 7px 7px 7px; - float: right; - height: auto; - margin: 0 20px 10px 10px; - width: 200px; -} - -div.toc li { - background: url("bdwn.png") no-repeat scroll 0 5px transparent; - font: 10px/1.2 Verdana,DejaVu Sans,Geneva,sans-serif; - margin-top: 5px; - padding-left: 10px; - padding-top: 2px; -} - -div.toc h3 { - font: bold 12px/1.2 Arial,FreeSans,sans-serif; - color: #4665A2; - border-bottom: 0 none; - margin: 0; -} - -div.toc ul { - list-style: none outside none; - border: medium none; - padding: 0px; -} - -div.toc li.level1 { - margin-left: 0px; -} - -div.toc li.level2 { - margin-left: 15px; -} - -div.toc li.level3 { - margin-left: 30px; -} - -div.toc li.level4 { - margin-left: 45px; -} - -.inherit_header { - font-weight: bold; - color: gray; - cursor: pointer; - -webkit-touch-callout: none; - -webkit-user-select: none; - -khtml-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; -} - -.inherit_header td { - padding: 6px 0px 2px 5px; -} - -.inherit { - display: none; -} - -tr.heading h2 { - margin-top: 12px; - margin-bottom: 4px; -} - -@media print -{ - #top { display: none; } - #side-nav { display: none; } - #nav-path { display: none; } - body { overflow:visible; } - h1, h2, h3, h4, h5, h6 { page-break-after: avoid; } - .summary { display: none; } - .memitem { page-break-inside: avoid; } - #doc-content - { - margin-left:0 !important; - height:auto !important; - width:auto !important; - overflow:inherit; - display:inline; - } -} - diff --git a/man/html/doxygen.png b/man/html/doxygen.png deleted file mode 100644 index 3ff17d8..0000000 Binary files a/man/html/doxygen.png and /dev/null differ diff --git a/man/html/dynsections.js b/man/html/dynsections.js deleted file mode 100644 index 116542f..0000000 --- a/man/html/dynsections.js +++ /dev/null @@ -1,78 +0,0 @@ -function toggleVisibility(linkObj) -{ - var base = $(linkObj).attr('id'); - var summary = $('#'+base+'-summary'); - var content = $('#'+base+'-content'); - var trigger = $('#'+base+'-trigger'); - var src=$(trigger).attr('src'); - if (content.is(':visible')===true) { - content.hide(); - summary.show(); - $(linkObj).addClass('closed').removeClass('opened'); - $(trigger).attr('src',src.substring(0,src.length-8)+'closed.png'); - } else { - content.show(); - summary.hide(); - $(linkObj).removeClass('closed').addClass('opened'); - $(trigger).attr('src',src.substring(0,src.length-10)+'open.png'); - } - return false; -} - -function updateStripes() -{ - $('table.directory tr'). - removeClass('even').filter(':visible:even').addClass('even'); -} -function toggleLevel(level) -{ - $('table.directory tr').each(function(){ - var l = this.id.split('_').length-1; - var i = $('#img'+this.id.substring(3)); - var a = $('#arr'+this.id.substring(3)); - if (l - - - - -libpcp: ed.h Source File - - - - - - -
-
- - - - - - -
-
libpcp -  0.2.1 -
-
-
- - - - - -
-
-
-
ed.h
-
-
-
1 /*
-
2  This file is part of Pretty Curved Privacy (pcp1).
-
3 
-
4  Copyright (C) 2013-2014 T.v.Dein.
-
5 
-
6  This program is free software: you can redistribute it and/or modify
-
7  it under the terms of the GNU General Public License as published by
-
8  the Free Software Foundation, either version 3 of the License, or
-
9  (at your option) any later version.
-
10 
-
11  This program is distributed in the hope that it will be useful,
-
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
-
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-
14  GNU General Public License for more details.
-
15 
-
16  You should have received a copy of the GNU General Public License
-
17  along with this program. If not, see <http://www.gnu.org/licenses/>.
-
18 
-
19  You can contact me by mail: <tom AT vondein DOT org>.
-
20 */
-
21 
-
22 #ifndef _HAVE_PCP_ED_H
-
23 #define _HAVE_PCP_ED_H
-
24 
-
32 #include <sodium.h>
-
33 #include <string.h>
-
34 #include <stdio.h>
-
35 #include <time.h>
-
36 
-
37 #include "defines.h"
-
38 #include "platform.h"
-
39 #include "mem.h"
-
40 #include "key.h"
-
41 #include "keyhash.h"
-
42 #include "util.h"
-
43 #include "pcpstream.h"
-
44 
-
59 unsigned char *pcp_ed_sign(unsigned char *message, size_t messagesize, pcp_key_t *s);
-
60 unsigned char *pcp_ed_sign_key(unsigned char *message, size_t messagesize, pcp_key_t *s);
-
76 
-
92 unsigned char *pcp_ed_verify(unsigned char *signature, size_t siglen, pcp_pubkey_t *p);
-
93 
-
109 unsigned char *pcp_ed_verify_key(unsigned char *signature, size_t siglen, pcp_pubkey_t *p);
-
110 
-
128 size_t pcp_ed_sign_buffered(Pcpstream *in, Pcpstream *out, pcp_key_t *s, int z85);
-
129 
-
130 
- -
151 
- -
168 
- -
188 
-
189 #endif /* _HAVE_PCP_ED_H */
-
190 
-
- - - - diff --git a/man/html/files.html b/man/html/files.html deleted file mode 100644 index ab26c1b..0000000 --- a/man/html/files.html +++ /dev/null @@ -1,80 +0,0 @@ - - - - - -libpcp: File List - - - - - - -
-
- - - - - - -
-
libpcp -  0.2.1 -
-
-
- - - - -
-
-
-
File List
-
-
-
Here is a list of all documented files with brief descriptions:
- - - - - - - - - - - - - - - - - - - - - -
o*buffer.h
o*crypto.h
o*defines.h
o*ed.h
o*getpass.h
o*key.h
o*keyhash.h
o*keysig.h
o*mac.h
o*mem.h
o*mgmt.h
o*pad.h
o*pcpstream.h
o*plist.h
o*randomart.h
o*scrypt.h
o*util.h
o*vault.h
o*version.h
\*z85.h
-
-
- - - - diff --git a/man/html/ftv2blank.png b/man/html/ftv2blank.png deleted file mode 100644 index 63c605b..0000000 Binary files a/man/html/ftv2blank.png and /dev/null differ diff --git a/man/html/ftv2cl.png b/man/html/ftv2cl.png deleted file mode 100644 index 132f657..0000000 Binary files a/man/html/ftv2cl.png and /dev/null differ diff --git a/man/html/ftv2doc.png b/man/html/ftv2doc.png deleted file mode 100644 index 17edabf..0000000 Binary files a/man/html/ftv2doc.png and /dev/null differ diff --git a/man/html/ftv2folderclosed.png b/man/html/ftv2folderclosed.png deleted file mode 100644 index bb8ab35..0000000 Binary files a/man/html/ftv2folderclosed.png and /dev/null differ diff --git a/man/html/ftv2folderopen.png b/man/html/ftv2folderopen.png deleted file mode 100644 index d6c7f67..0000000 Binary files a/man/html/ftv2folderopen.png and /dev/null differ diff --git a/man/html/ftv2lastnode.png b/man/html/ftv2lastnode.png deleted file mode 100644 index 63c605b..0000000 Binary files a/man/html/ftv2lastnode.png and /dev/null differ diff --git a/man/html/ftv2link.png b/man/html/ftv2link.png deleted file mode 100644 index 17edabf..0000000 Binary files a/man/html/ftv2link.png and /dev/null differ diff --git a/man/html/ftv2mlastnode.png b/man/html/ftv2mlastnode.png deleted file mode 100644 index 0b63f6d..0000000 Binary files a/man/html/ftv2mlastnode.png and /dev/null differ diff --git a/man/html/ftv2mnode.png b/man/html/ftv2mnode.png deleted file mode 100644 index 0b63f6d..0000000 Binary files a/man/html/ftv2mnode.png and /dev/null differ diff --git a/man/html/ftv2mo.png b/man/html/ftv2mo.png deleted file mode 100644 index 4bfb80f..0000000 Binary files a/man/html/ftv2mo.png and /dev/null differ diff --git a/man/html/ftv2node.png b/man/html/ftv2node.png deleted file mode 100644 index 63c605b..0000000 Binary files a/man/html/ftv2node.png and /dev/null differ diff --git a/man/html/ftv2ns.png b/man/html/ftv2ns.png deleted file mode 100644 index 72e3d71..0000000 Binary files a/man/html/ftv2ns.png and /dev/null differ diff --git a/man/html/ftv2plastnode.png b/man/html/ftv2plastnode.png deleted file mode 100644 index c6ee22f..0000000 Binary files a/man/html/ftv2plastnode.png and /dev/null differ diff --git a/man/html/ftv2pnode.png b/man/html/ftv2pnode.png deleted file mode 100644 index c6ee22f..0000000 Binary files a/man/html/ftv2pnode.png and /dev/null differ diff --git a/man/html/ftv2splitbar.png b/man/html/ftv2splitbar.png deleted file mode 100644 index fe895f2..0000000 Binary files a/man/html/ftv2splitbar.png and /dev/null differ diff --git a/man/html/ftv2vertline.png b/man/html/ftv2vertline.png deleted file mode 100644 index 63c605b..0000000 Binary files a/man/html/ftv2vertline.png and /dev/null differ diff --git a/man/html/functions.html b/man/html/functions.html deleted file mode 100644 index c4351e2..0000000 --- a/man/html/functions.html +++ /dev/null @@ -1,274 +0,0 @@ - - - - - -libpcp: Class Members - - - - - - -
-
- - - - - - -
-
libpcp -  0.2.1 -
-
-
- - - - - - -
-
-
Here is a list of all documented class members with links to the class documentation for each member:
- -

- a -

- - -

- b -

- - -

- c -

- - -

- e -

- - -

- f -

- - -

- i -

- - -

- m -

- - -

- n -

- - -

- o -

- - -

- p -

- - -

- s -

- - -

- t -

- - -

- u -

- - -

- v -

-
- - - - diff --git a/man/html/functions_vars.html b/man/html/functions_vars.html deleted file mode 100644 index c897b50..0000000 --- a/man/html/functions_vars.html +++ /dev/null @@ -1,274 +0,0 @@ - - - - - -libpcp: Class Members - Variables - - - - - - -
-
- - - - - - -
-
libpcp -  0.2.1 -
-
-
- - - - - - -
-
-  - -

- a -

- - -

- b -

- - -

- c -

- - -

- e -

- - -

- f -

- - -

- i -

- - -

- m -

- - -

- n -

- - -

- o -

- - -

- p -

- - -

- s -

- - -

- t -

- - -

- u -

- - -

- v -

-
- - - - diff --git a/man/html/getpass_8h_source.html b/man/html/getpass_8h_source.html deleted file mode 100644 index 822c47a..0000000 --- a/man/html/getpass_8h_source.html +++ /dev/null @@ -1,82 +0,0 @@ - - - - - -libpcp: getpass.h Source File - - - - - - -
-
- - - - - - -
-
libpcp -  0.2.1 -
-
-
- - - - - -
-
-
-
getpass.h
-
-
-
1 #ifndef _HAVE_PCP_GETPASS
-
2 #define _HAVE_PCP_GETPASS
-
3 
-
4 /*
-
5  * (unportable) functions to turn on/off terminal echo
-
6  * using termios functions. might compile however on
-
7  * most unices, tested on FreeBSD only.
-
8  */
-
9 
-
10 
-
11 #include <unistd.h>
-
12 #include <stdio.h>
-
13 #include <stdlib.h>
-
14 #include <termios.h>
-
15 
-
16 
-
17 void pcp_echo_off();
-
18 void pcp_echo_on();
-
19 char *pcp_get_stdin();
-
20 char *pcp_get_passphrase(char *prompt);
-
21 
-
22 #endif /* _HAVE_PCP_GETPASS */
-
- - - - diff --git a/man/html/group__Buffer.html b/man/html/group__Buffer.html deleted file mode 100644 index d2f958b..0000000 --- a/man/html/group__Buffer.html +++ /dev/null @@ -1,1526 +0,0 @@ - - - - - -libpcp: BUFFER - - - - - - -
-
- - - - - - -
-
libpcp -  0.2.1 -
-
-
- - - -
-
- -
-
BUFFER
-
-
- -

Flexible buffer management, idea from openssh/buffer.c. -More...

- - - - - -

-Classes

struct  _pcp_buffer
 A flexible buffer object wich automatically resizes, if neccessary. More...
 
- - - - -

-Typedefs

typedef struct _pcp_buffer Buffer
 The name used everywhere.
 
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

-Functions

Bufferbuffer_new (size_t blocksize, char *name)
 Create a new buffer.
 
Bufferbuffer_new_str (char *name)
 Create a new string buffer.
 
Bufferbuffer_new_buf (char *name, void *data, size_t datasize)
 Create a new buffer from existing data.
 
void buffer_free (Buffer *b)
 Clears and frees the Buffer.
 
void buffer_clear (Buffer *b)
 Clears the Buffer.
 
void buffer_rewind (Buffer *b)
 Put read offset back to start.
 
void buffer_add (Buffer *b, const void *data, size_t len)
 Add data to the buffer.
 
void buffer_add_buf (Buffer *dst, Buffer *src)
 Add data to the buffer.
 
void buffer_add_str (Buffer *b, const char *fmt,...)
 Add a formated string to the buffer.
 
void buffer_add_hex (Buffer *b, void *data, size_t len)
 Add data as hex string to the buffer.
 
int buffer_done (Buffer *b)
 Tell if there are no more bytes to read.
 
size_t buffer_get_chunk (Buffer *b, void *buf, size_t len)
 Read some chunk of data from the Buffer.
 
unsigned char * buffer_get (Buffer *b)
 Read the whole Buffer content.
 
char * buffer_get_str (Buffer *b)
 Read the whole Buffer content as string.
 
unsigned char * buffer_get_remainder (Buffer *b)
 Read the remaining data after current read offset.
 
size_t buffer_extract (Buffer *b, void *buf, size_t offset, size_t len)
 Read some data inside the Buffer.
 
void buffer_dump (const Buffer *b)
 Dump the Buffer contents to stderr in hex form.
 
void buffer_info (const Buffer *b)
 Print Buffer counters to stderr.
 
size_t buffer_size (const Buffer *b)
 Tell how much data there is in the buffer available.
 
size_t buffer_left (const Buffer *b)
 Tell how much data is left to read in the Buffer.
 
uint8_t buffer_get8 (Buffer *b)
 Read 1 byte (8 bit) number from a Buffer.
 
uint16_t buffer_get16 (Buffer *b)
 Read 2 bytes (16 bit) number from a Buffer.
 
uint32_t buffer_get32 (Buffer *b)
 Read 4 byte (32 bit) number from a Buffer.
 
uint64_t buffer_get64 (Buffer *b)
 Read 8 byte (64 bit) from a Buffer.
 
uint16_t buffer_get16na (Buffer *b)
 Read 2 bytes (16 bit) number from a Buffer, converted to host endian.
 
uint32_t buffer_get32na (Buffer *b)
 Read 4 byte (32 bit) number from a Buffer, converted to host endian.
 
uint64_t buffer_get64na (Buffer *b)
 Read 8 byte (64 bit) from a Buffer, converted to host endian.
 
uint8_t buffer_last8 (Buffer *b)
 Read the last 1 byte (8 bit) number from a Buffer.
 
uint16_t buffer_last16 (Buffer *b)
 Read the last 2 byte (16 bit) number from a Buffer.
 
uint32_t buffer_last32 (Buffer *b)
 Read the last 4 byte (32 bit) number from a Buffer.
 
uint64_t buffer_last64 (Buffer *b)
 Read the last 8 byte (64 bit) number from a Buffer.
 
size_t buffer_fd_read (Buffer *b, FILE *in, size_t len)
 Read data from a file directly into a Buffer.
 
void buffer_add8 (Buffer *b, uint8_t v)
 Write a 1 byte (8 bit) number in binary form into the buffer.
 
void buffer_add16 (Buffer *b, uint16_t v)
 Write a 2 byte (16 bit) number in binary form into the buffer.
 
void buffer_add32 (Buffer *b, uint32_t v)
 Write a 4 byte (32 bit) number in binary form into the buffer.
 
void buffer_add64 (Buffer *b, uint64_t v)
 Write a 8 byte (64 bit) number in binary form into the buffer.
 
void buffer_add16be (Buffer *b, uint16_t v)
 Write a 2 byte (16 bit) number in binary form into the buffer, converted to big endian.
 
void buffer_add32be (Buffer *b, uint32_t v)
 Write a 4 byte (32 bit) number in binary form into the buffer, converted to big endian.
 
void buffer_add64be (Buffer *b, uint64_t v)
 Write a 8 byte (64 bit) number in binary form into the buffer, converted to big endian.
 
-

Detailed Description

-

Flexible buffer management, idea from openssh/buffer.c.

-

This class allows us to dissect buffers into parts at will whithout the hassle of boundary checking in each and every line. Therefore it is more secure, since this system wraps all this stuff from us, so in case we're attemt to overflow a buffer or the like, the buffer functions will catch this, warn us and die.

-

Typedef Documentation

- -
-
- - - - -
typedef struct _pcp_buffer Buffer
-
- -

The name used everywhere.

- -

Definition at line 62 of file buffer.h.

- -
-
-

Function Documentation

- -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
void buffer_add (Bufferb,
const void * data,
size_t len 
)
-
- -

Add data to the buffer.

-

Adds data of the size len to the buffer and resizes the buffer, if neccessary. The write position ('end' field) will be updated accordingly.

-

Data will be copied, you can free() the given pointer after copying..

-
Parameters
- - - - -
[in]bThe Buffer object.
[out]dataArbitrary data to add to the Buffer.
[in]lenThe size of the data to add in Bytes.
-
-
- -
-
- -
-
- - - - - - - - - - - - - - - - - - -
void buffer_add16 (Bufferb,
uint16_t v 
)
-
- -

Write a 2 byte (16 bit) number in binary form into the buffer.

-
Parameters
- - - -
[out]bThe Buffer object to write to.
[in]vThe uint16_t to write to the buffer.
-
-
- -
-
- -
-
- - - - - - - - - - - - - - - - - - -
void buffer_add16be (Bufferb,
uint16_t v 
)
-
- -

Write a 2 byte (16 bit) number in binary form into the buffer, converted to big endian.

-
Parameters
- - - -
[out]bThe Buffer object to write to.
[in]vThe uint16_t to write to the buffer.
-
-
- -
-
- -
-
- - - - - - - - - - - - - - - - - - -
void buffer_add32 (Bufferb,
uint32_t v 
)
-
- -

Write a 4 byte (32 bit) number in binary form into the buffer.

-
Parameters
- - - -
[out]bThe Buffer object to write to.
[in]vThe uint32_t to write to the buffer.
-
-
- -
-
- -
-
- - - - - - - - - - - - - - - - - - -
void buffer_add32be (Bufferb,
uint32_t v 
)
-
- -

Write a 4 byte (32 bit) number in binary form into the buffer, converted to big endian.

-
Parameters
- - - -
[out]bThe Buffer object to write to.
[in]vThe uint32_t to write to the buffer.
-
-
- -
-
- -
-
- - - - - - - - - - - - - - - - - - -
void buffer_add64 (Bufferb,
uint64_t v 
)
-
- -

Write a 8 byte (64 bit) number in binary form into the buffer.

-
Parameters
- - - -
[out]bThe Buffer object to write to.
[in]vThe uint64_t to write to the buffer.
-
-
- -
-
- -
-
- - - - - - - - - - - - - - - - - - -
void buffer_add64be (Bufferb,
uint64_t v 
)
-
- -

Write a 8 byte (64 bit) number in binary form into the buffer, converted to big endian.

-
Parameters
- - - -
[out]bThe Buffer object to write to.
[in]vThe uint64_t to write to the buffer.
-
-
- -
-
- -
-
- - - - - - - - - - - - - - - - - - -
void buffer_add8 (Bufferb,
uint8_t v 
)
-
- -

Write a 1 byte (8 bit) number in binary form into the buffer.

-
Parameters
- - - -
[out]bThe Buffer object to write to.
[in]vThe uint8_t to write to the buffer.
-
-
- -
-
- -
-
- - - - - - - - - - - - - - - - - - -
void buffer_add_buf (Bufferdst,
Buffersrc 
)
-
- -

Add data to the buffer.

-

Adds data from the given Buffer src to the buffer and resizes the buffer, if neccessary. The write position ('end' field) will be updated accordingly.

-

Data will be copied, you can buffer_free() the given src Buffer after the copying.

-
Parameters
- - - -
[out]dstThe destination Buffer object to copy data into.
[in]srcThe source Buffer object to copy data from.
-
-
- -
-
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
void buffer_add_hex (Bufferb,
void * data,
size_t len 
)
-
- -

Add data as hex string to the buffer.

-

Adds data of the size len to the buffer and resizes the buffer, if neccessary. The write position ('end' field) will be updated accordingly. Each byte will be put in its HEX form into the buffer (%02x).

-

Data will be copied, you can free() the given pointer after copying..

-
Parameters
- - - - -
[in]bThe Buffer object.
[in]dataArbitrary data to add as hex into the Buffer.
[in]lenThe size of the data to add in Bytes.
-
-
- -
-
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
void buffer_add_str (Bufferb,
const char * fmt,
 ... 
)
-
- -

Add a formated string to the buffer.

-

Use printf() like syntax to add a formatted string to the buffer. Refer to the documentation of printf() for details.

-

Data will be copied, you can free() the given format string and params after copying.

-

Example:

-
Buffer *x = buffer_new_str("test");
-
buffer_add_str(x, "There are %d elements left in %s\n", 4, "list");
-
Parameters
- - - - -
[in]bThe Buffer object.
[in]fmtThe printf() compatible format description.
[in]...A variable number of arguments for the format string.
-
-
- -
-
- -
-
- - - - - - - - -
void buffer_clear (Bufferb)
-
- -

Clears the Buffer.

-

This clears the buffer by filling it with zeroes and resetting all counters. Memory will not be free'd. Called from buffer_free() before free'ing memory.

-
Parameters
- - -
[in]bThe Buffer object.
-
-
- -
-
- -
-
- - - - - - - - -
int buffer_done (Bufferb)
-
- -

Tell if there are no more bytes to read.

-

This functions tells if the EOF of the buffer is reached during read operations (no more data to read left).

-
Parameters
- - -
[in]bThe Buffer object.
-
-
-
Returns
Returns 1 of EOF has been reached or 0 if there are more data left to read.
- -
-
- -
-
- - - - - - - - -
void buffer_dump (const Bufferb)
-
- -

Dump the Buffer contents to stderr in hex form.

-
Parameters
- - -
[in]bThe Buffer object to dump.
-
-
- -
-
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
size_t buffer_extract (Bufferb,
void * buf,
size_t offset,
size_t len 
)
-
- -

Read some data inside the Buffer.

-

Same as buffer_get() but fetch some data chunk from somewhere in the middle of the buffer.

-

The returned pointer has to be allocated by the caller to at least a size of len bytes.

-

The read offset will be left untouched by this function.

-

Example: suppose you've got a buffer with the following content:

-
AAAABBBBCCCC
-

Then:

-
[..]
-
unsigned char g[4];
-
buffer_extract(b, g, 4, 4); // => g now contains 'BBBB'
-
Parameters
- - - - - -
[in]bThe Buffer object to read from.
[out]bufThe buffer to copy data to.
[in]offsetWhere to start copying.
[in]lenHow mush data to copy.
-
-
-
Returns
Returns the size of bytes read. Returns 0 in case of an overflow, which can be catched with fatals_ifany().
- -
-
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
size_t buffer_fd_read (Bufferb,
FILE * in,
size_t len 
)
-
- -

Read data from a file directly into a Buffer.

-

This function reads in len bytes from the FILE stream 'in' into the Buffer. The file must already be opened by the caller.

-
Parameters
- - - - -
[in,out]bThe Buffer object to read from.
[in]inThe FILE stream to read from.
[in]lenThe number of bytes to read.
-
-
-
Returns
Returns the number of bytes read or 0 in case of an error or EOF. Use feof() and ferror() to check this afterwards, call fatals_ifany() in case of errors.
- -
-
- -
-
- - - - - - - - -
void buffer_free (Bufferb)
-
- -

Clears and frees the Buffer.

-

This clears the buffer by filling it with zeroes and frees any allocated memory, including the Buffer object itself. Use this function instead of directly calling free(Buffer).

-
Parameters
- - -
[in]bThe Buffer object.
-
-
- -
-
- -
-
- - - - - - - - -
unsigned char* buffer_get (Bufferb)
-
- -

Read the whole Buffer content.

-

This function returns the whole buffer contents as a pointer to the internal data member (Buffer->buf). The returned pointer is allocated and filled with data up to buffer_size(Buffer), however, the allocated memory might be more than size, in fact it will be a multitude of Buffer-blocksize.

-

Don't free() the pointer directly, use buffer_free() always.

-
Parameters
- - -
[in]bThe Buffer object to read from.
-
-
-
Returns
Pointer to the buffer data storage.
- -
-
- -
-
- - - - - - - - -
uint16_t buffer_get16 (Bufferb)
-
- -

Read 2 bytes (16 bit) number from a Buffer.

-
Parameters
- - -
[in]bThe Buffer object to read from.
-
-
-
Returns
a uint16_t.
- -
-
- -
-
- - - - - - - - -
uint16_t buffer_get16na (Bufferb)
-
- -

Read 2 bytes (16 bit) number from a Buffer, converted to host endian.

-
Parameters
- - -
[in]bThe Buffer object to read from.
-
-
-
Returns
a uint16_t.
- -
-
- -
-
- - - - - - - - -
uint32_t buffer_get32 (Bufferb)
-
- -

Read 4 byte (32 bit) number from a Buffer.

-
Parameters
- - -
[in]bThe Buffer object to read from.
-
-
-
Returns
a uint32_t.
- -
-
- -
-
- - - - - - - - -
uint32_t buffer_get32na (Bufferb)
-
- -

Read 4 byte (32 bit) number from a Buffer, converted to host endian.

-
Parameters
- - -
[in]bThe Buffer object to read from.
-
-
-
Returns
a uint32_t.
- -
-
- -
-
- - - - - - - - -
uint64_t buffer_get64 (Bufferb)
-
- -

Read 8 byte (64 bit) from a Buffer.

-
Parameters
- - -
[in]bThe Buffer object to read from.
-
-
-
Returns
a uint64_t.
- -
-
- -
-
- - - - - - - - -
uint64_t buffer_get64na (Bufferb)
-
- -

Read 8 byte (64 bit) from a Buffer, converted to host endian.

-
Parameters
- - -
[in]bThe Buffer object to read from.
-
-
-
Returns
a uint64_t.
- -
-
- -
-
- - - - - - - - -
uint8_t buffer_get8 (Bufferb)
-
- -

Read 1 byte (8 bit) number from a Buffer.

-
Parameters
- - -
[in]bThe Buffer object to read from.
-
-
-
Returns
a uint8_t.
- -
-
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
size_t buffer_get_chunk (Bufferb,
void * buf,
size_t len 
)
-
- -

Read some chunk of data from the Buffer.

-
Read some chunk of data from the Buffer, starting from current read
-offset til len.
-
-Example: suppose you've got a buffer with the following content:
-
-@code 
-AAAABBBBCCCC
-@endcode
-
-Then the following code would:
-
-@code 
-unsigned char g[4];
-buffer_get_chunk(b, g, 4);  // => g now contains 'AAAA' 
-buffer_get_chunk(b, g, 4);  // => g now contains 'BBBB' 
-buffer_get_chunk(b, g, 4);  // => g now contains 'CCCC' 
-@endcode
-
-In order to catch buffer overflow, check the return value, which will
-be 0 in case of errors. See also: fatals_ifany(), buffer_done() and buffer_left().
-
-\param[in] b The Buffer object to read from.
-
-\param[out] buf The destination pointer where the data will be copied to. This pointer
-

must be allocated by the caller properly and it must have at least a size of len.

-
\param[in] len The number of bytes to read from the Buffer.
-
-
- -
-
- - - - - - - - -
unsigned char* buffer_get_remainder (Bufferb)
-
- -

Read the remaining data after current read offset.

-

Fetch whatever is left in the buffer. This works like buffer_get() but instead doesn't return everything, but only the part of the buffer, which follows after the current read offset.

-

The returned pointer will be allocated by buffer_get_remainder() with a size of buffer_left(). It's up to the caller to free() the returned pointer later on.

-

Example: suppose you've got a buffer with the following content:

-
AAAABBBBCCCC
-

Then:

-
[..]
-
unsigned char g[4];
-
unsigned char *r = NULL;
-
buffer_get_chunk(b, g, 4); // => g now contains 'AAAA'
-
size_t rs = buffer_left(b); // => rs = 8
-
r = buffer_get_remainder(b); // => r now contains 'BBBBCCCC' and has a size of 8
-
memset(r, 0, rs); // zerofill r
-
free(r); // done with it
-
Parameters
- - -
[in]bThe Buffer object to read from.
-
-
-
Returns
Pointer to the remaining chunk of data (copy).
- -
-
- -
-
- - - - - - - - -
char* buffer_get_str (Bufferb)
-
- -

Read the whole Buffer content as string.

-

Access the Buffer content as string (char *).

-

The returned pointer is allocated and filled with data up to buffer_size(Buffer), however, the allocated memory might be more than size, in fact it will be a multitude of Buffer-blocksize.

-

The byte after buffer_size(Buffer) will be a \0.

-

Don't free() the pointer directly, use buffer_free() always.

-

Sample usage:

-
[..]
-
fprintf(stdout, "Our buffer content: %s\n", buffer_get_str(b));
-
Parameters
- - -
[in]bThe Buffer object to read from.
-
-
-
Returns
Pointer to the buffer data storage.
- -
-
- -
-
- - - - - - - - -
void buffer_info (const Bufferb)
-
- -

Print Buffer counters to stderr.

-
Parameters
- - -
[in]bThe Buffer object to print infos about.
-
-
- -
-
- -
-
- - - - - - - - -
uint16_t buffer_last16 (Bufferb)
-
- -

Read the last 2 byte (16 bit) number from a Buffer.

-

Doesn't increment offset.

-
Parameters
- - -
[in]bThe Buffer object to read from.
-
-
-
Returns
a uint16_t.
- -
-
- -
-
- - - - - - - - -
uint32_t buffer_last32 (Bufferb)
-
- -

Read the last 4 byte (32 bit) number from a Buffer.

-

Doesn't increment offset.

-
Parameters
- - -
[in]bThe Buffer object to read from.
-
-
-
Returns
a uint32_t.
- -
-
- -
-
- - - - - - - - -
uint64_t buffer_last64 (Bufferb)
-
- -

Read the last 8 byte (64 bit) number from a Buffer.

-

Doesn't increment offset.

-
Parameters
- - -
[in]bThe Buffer object to read from.
-
-
-
Returns
a uint64_t.
- -
-
- -
-
- - - - - - - - -
uint8_t buffer_last8 (Bufferb)
-
- -

Read the last 1 byte (8 bit) number from a Buffer.

-

Doesn't increment offset.

-
Parameters
- - -
[in]bThe Buffer object to read from.
-
-
-
Returns
a uint8_t.
- -
-
- -
-
- - - - - - - - -
size_t buffer_left (const Bufferb)
-
- -

Tell how much data is left to read in the Buffer.

-

Use this function to check if it's ok to read more bytes from to buffer to avoid buffer overflows.

-

Example: suppose you've got a buffer with the following content:

-
AAAABBBBCCCC
-

Then:

-
[..]
-
unsigned char g[4];
-
unsigned char x[16];
-
buffer_get_chunk(b, g, 4); // => g now contains 'BBBB'
-
if(buffer_left(b) >= 16) // => will return 8 and therefore fail
-
buffer_get_chunk(b, x, 16);
-
else
-
printf("not enough data"); // => will be printed
-
Parameters
- - -
[in]bThe Buffer object to get the size from.
-
-
-
Returns
The number of bytes left to read from the Buffer.
- -
-
- -
-
- - - - - - - - - - - - - - - - - - -
Buffer* buffer_new (size_t blocksize,
char * name 
)
-
- -

Create a new buffer.

-

Create a new buffer, initially alloc'd to blocksize and zero-filled.

-
Parameters
- - - -
[in]blocksizeInitial blocksize. The smaller the more often the buffer will be resized. Choose with care.
[in]nameA name for the Buffer. Just used for debugging purposes or in error messages.
-
-
-
Returns
Returns a new Buffer object.
- -
-
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
Buffer* buffer_new_buf (char * name,
void * data,
size_t datasize 
)
-
- -

Create a new buffer from existing data.

-

Create a new buffer, but don't allocate memory nor copy data. Instead the provided data pointer will be used as internal storage directly.

-

This kind of buffer can be used to put the Buffer API into use with existing data from other sources. In most cases you'll use it for reading. However, please be aware, that it can be used for writing as well and in this case the data pointer maybe resized (by calling realloc()).

-

When calling buffer_free() on this Buffer, the memory pointed to by the given data pointer will not be free'd and remains accessible. It's the responsibility of the caller to do so.

-

Example using mmap(2):

-
#include <stdio.h>
-
#include <pcp.h>
-
#include <sys/mman.h>
-
-
FILE *RFD;
-
size_t rs;
-
Buffer *rb;
-
byte *chunk;
-
void *r;
-
-
if((RFD = fopen("README", "rb")) == NULL) {
-
fprintf(stderr, "oops, could not open README!\n");
-
return 1;
-
}
-
-
fseek(RFD, 0, SEEK_END);
-
rs = ftell(RFD);
-
fseek(RFD, 0, SEEK_SET);
-
-
void *r = mmap(NULL, rs, PROT_READ, 0, fileno(RFD), 0);
-
-
*rb = buffer_new_buf("r", r, rs);
-
-
size_t blocksize = 36;
-
void *chunk = malloc(blocksize);
-
-
while(buffer_done(rb) != 1) {
-
if(buffer_left(rb) < blocksize)
-
blocksize = buffer_left(rb);
-
buffer_get_chunk(rb, chunk, blocksize);
-
_dump("chunk", chunk, blocksize); // or do something else with it
-
}
-
- -
-
munmap(r, rs);
-
fclose(RFD);
-
Parameters
- - - - -
[in]nameA name for the Buffer. Just used for debugging purposes or in error messages.
[in]dataThe data pointer to use by the buffer.
[in]datasizeThe size of the data.
-
-
-
Returns
Returns a new Buffer object.
- -
-
- -
-
- - - - - - - - -
Buffer* buffer_new_str (char * name)
-
- -

Create a new string buffer.

-

Create a new buffer, initially alloc'd to a blocksize of 32 bytes and zero-filled. The buffer will be a string buffer. See buffer_get_str().

-
Parameters
- - -
[in]nameA name for the Buffer. Just used for debugging purposes or in error messages.
-
-
-
Returns
Returns a new Buffer object.
- -
-
- -
-
- - - - - - - - -
void buffer_rewind (Bufferb)
-
- -

Put read offset back to start.

-

This function sets the read offset counter back to 0 (start of the buffer).

-
Parameters
- - -
[in]bThe Buffer object.
-
-
- -
-
- -
-
- - - - - - - - -
size_t buffer_size (const Bufferb)
-
- -

Tell how much data there is in the buffer available.

-

This function returns the number of bytes stored in the buffer so far. Please note, that the actual allocation might be bigger, because we always allocate memory blockwise.

-
Parameters
- - -
[in]bThe Buffer object to get the size from.
-
-
-
Returns
The number of bytes stored in the Buffer.
- -
-
-
- - - - diff --git a/man/html/group__CRYPTO.html b/man/html/group__CRYPTO.html deleted file mode 100644 index 2578d01..0000000 --- a/man/html/group__CRYPTO.html +++ /dev/null @@ -1,595 +0,0 @@ - - - - - -libpcp: CRYPTO - - - - - - -
-
- - - - - - -
-
libpcp -  0.2.1 -
-
-
- - - -
-
- -
-
CRYPTO
-
-
- -

Functions for symmetrical or asymmetrical encryption using NaCL. -More...

- - - - - - - - - - - - - - - - - - - - - - - - - - -

-Functions

unsigned char * pcp_box_encrypt (pcp_key_t *secret, pcp_pubkey_t *pub, unsigned char *message, size_t messagesize, size_t *csize)
 Asymmetrically encrypt a message.
 
unsigned char * pcp_box_decrypt (pcp_key_t *secret, pcp_pubkey_t *pub, unsigned char *cipher, size_t ciphersize, size_t *dsize)
 Asymmetrically decrypt a message.
 
size_t pcp_encrypt_stream (Pcpstream *in, Pcpstream *out, pcp_key_t *s, pcp_pubkey_t *p, int signcrypt)
 Asymmetrically encrypt a file or a buffer stream.
 
size_t pcp_encrypt_stream_sym (Pcpstream *in, Pcpstream *out, unsigned char *symkey, int havehead, pcp_rec_t *recsign)
 Symmetrically encrypt a file or a buffer stream.
 
size_t pcp_decrypt_stream (Pcpstream *in, Pcpstream *out, pcp_key_t *s, unsigned char *symkey, int verify)
 Asymmetrically decrypt a file or a buffer stream.
 
size_t pcp_decrypt_stream_sym (Pcpstream *in, Pcpstream *out, unsigned char *symkey, pcp_rec_t *recverify)
 Symmetrically decrypt a file or a buffer stream.
 
size_t pcp_sodium_mac (unsigned char **cipher, unsigned char *cleartext, size_t clearsize, unsigned char *nonce, unsigned char *key)
 Symmetrically encrypt a message.
 
int pcp_sodium_verify_mac (unsigned char **cleartext, unsigned char *message, size_t messagesize, unsigned char *nonce, unsigned char *key)
 Decrypt a symmetrically encrypted message.
 
-

Detailed Description

-

Functions for symmetrical or asymmetrical encryption using NaCL.

-

-Introduction

-

Encryption is done 32k blockwise using an ephemeral key.

-

If using asymmetrical encryption the ephemeral key is encrypted asymmetrically using Curve25519 for all recipients and added to the output.

-

If sign+crypt is requested, a hash of the clear content plus the recipient list will be made and signed. That signature will be encrypted using the ephemeral key as well and appended to the output.

-

For each encryption cycle (per block) a unique nonce will be used.

-

-Encrypted Output Format

-

Encrypted output will always written as binary files. No armoring supported yet. The encryption process works as this:

-
    -
  • generate a random symetric 32 byte key B<S>
  • -
  • encrypt it asymetrically for each recipient using a unique nonce (B<R>)
  • -
  • encrypt the input file 32k blockwise using the symetric key
  • -
-

Symmetric encryption works the very same with the recipient stuff left out.

-

Formal format description, asymmetric encrypted files:

-
     +---------------------------------------------------------+
-     | Field         Size      Description                     |
-     +-------------+--------+----------------------------------+
-     | Type        |      1 | Filetype, 5=ASYM, 23=SYM         |
-     +-------------|--------|----------------------------------+
-     | Len R       |      4 | Number of recipients         (*) |
-     +-------------|--------|----------------------------------+
-     | Recipients  |   R*72 | C(recipient)|C(recipient)... (*) |
-     +-------------|--------|----------------------------------+
-     | Encrypted   |      ~ | The actual encrypted data        |
-     +-------------|--------|----------------------------------+
-

The following will be Left out when doing symetric encryption.

-

Recipient field format:

-
    +---------------------------------------------------------+
-    | Field         Size      Description                     |
-    +-------------+--------+----------------------------------+
-    | Nonce       |     24 | Random Nonce, one per R          |
-    +-------------|--------|----------------------------------+
-    | Cipher      |     48 | S encrypted with PK or R         |
-    +-------------|--------|----------------------------------+
-

R is calculated using public key encryption using the senders secret key, the recipients public key and a random nonce.

-

Pseudocode:

-
R = foreach P: N | crypto_box(S, N, P, SK)
-
L = len(R)
-
T = 5
-
write (T | L | R)
-
foreach I: write (N | crypto_secret_box(I, N, S))
-

where P is the public key of a recipient, SK is the senders secret key, R is the recipient list, L is the number of recipients, T is the filetype header, I is a block of input with a size of 32k, N is a nonce (new per block) and S the symmetric key.

-

Function Documentation

- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
unsigned char* pcp_box_decrypt (pcp_key_tsecret,
pcp_pubkey_tpub,
unsigned char * cipher,
size_t ciphersize,
size_t * dsize 
)
-
- -

Asymmetrically decrypt a message.

-

This function is used internally and normally a user doesn't need to use it. However, from time to time there maybe the requirement to work with raw NaCL crypto_box() output. This function adds the neccessary padding and it uses PCP key structures.

-
Parameters
- - - - - - -
[in]secretThe secret key structure from the sender.
[in]pubThe public key structure from the recipient.
[in]cipherThe encrypted message.
[in]ciphersizeThe size in bytes of the encrypted message.
[out]dsizeA pointer which will be set to the size of the decrypted result if successful.
-
-
-
Returns
Returns an allocated unsigned char array of the size csize which contains the encrypted result. In case of an error, it returns NULL sets csize to 0. Use fatals_ifany() to check for errors.
- -
-
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
unsigned char* pcp_box_encrypt (pcp_key_tsecret,
pcp_pubkey_tpub,
unsigned char * message,
size_t messagesize,
size_t * csize 
)
-
- -

Asymmetrically encrypt a message.

-

This function is used internally and normally a user doesn't need to use it. However, from time to time there maybe the requirement to work with raw NaCL crypto_box() output. This function adds the neccessary padding and it uses PCP key structures.

-
Parameters
- - - - - - -
[in]secretThe secret key structure from the sender.
[in]pubThe public key structure from the recipient.
[in]messageThe clear unencrypted message.
[in]messagesizeThe size in bytes of the message.
[out]csizeA pointer which will be set to the size of the encrypted result if successful.
-
-
-
Returns
Returns an allocated unsigned char array of the size csize which contains the encrypted result. In case of an error, it returns NULL sets csize to 0. Use fatals_ifany() to check for errors.
- -
-
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
size_t pcp_decrypt_stream (Pcpstreamin,
Pcpstreamout,
pcp_key_ts,
unsigned char * symkey,
int verify 
)
-
- -

Asymmetrically decrypt a file or a buffer stream.

-

This function decrypts a stream 32k+16-blockwise for a number of recipients.

-

Calls pcp_decrypt_stream_sym() after assembling the encrypted recipient list.

-

FIXME: should return the pcp_rec_t structure upon successfull verification somehow.

-
Parameters
- - - - - - -
[in]inStream to read the data to decrypt from.
[out]outStream to write decrypted result to.
[in]sSecret key structure of the recipient.
[in]symkeyEphemeral key for symmetric decryption. Set to NULL if you call this function directly.
verifyFlag to indicate sign+crypt. If 1 it tries to verify a signature, otherwise not.
-
-
-
Returns
Returns the size of the output written to the output stream or 0 in case of errors.
- -
-
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
size_t pcp_decrypt_stream_sym (Pcpstreamin,
Pcpstreamout,
unsigned char * symkey,
pcp_rec_trecverify 
)
-
- -

Symmetrically decrypt a file or a buffer stream.

-

This function decrypts a stream 32k+16-blockwise using a given ephemeral key. Usually compute this key using the pcp_scrypt() function. If not called directly, the key have been extracted from the recipient list.

-

Uses crypto_secret_box_open() for each 32k+16-block with a random nonce for each.

-
Parameters
- - - - - -
[in]inStream to read the data to decrypt from.
[out]outStream to write decrypted result to.
[in]symkeyEphemeral key to use for decryption.
recverifyFlag to indicate sign+crypt. If 1 it tries to verify a signature, otherwise not.
-
-
-
Returns
Returns the size of the output written to the output stream or 0 in case of errors.
- -
-
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
size_t pcp_encrypt_stream (Pcpstreamin,
Pcpstreamout,
pcp_key_ts,
pcp_pubkey_tp,
int signcrypt 
)
-
- -

Asymmetrically encrypt a file or a buffer stream.

-

This function encrypts a stream 32k-blockwise for a number of recipients.

-

Calls pcp_encrypt_stream_sym() after assembling the encrypted recipient list.

-
Parameters
- - - - - - -
[in]inStream to read the data to encrypt from.
[out]outStream to write encrypted result to.
[in]sSecret key structure of the sender.
[in]pPublic key hash containing a list of the recipients.
signcryptFlag to indicate sign+crypt. If 1 it adds a signature, otherwise not.
-
-
-
Returns
Returns the size of the output written to the output stream or 0 in case of errors.
- -
-
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
size_t pcp_encrypt_stream_sym (Pcpstreamin,
Pcpstreamout,
unsigned char * symkey,
int havehead,
pcp_rec_trecsign 
)
-
- -

Symmetrically encrypt a file or a buffer stream.

-

This function encrypts a stream 32k-blockwise using a given ephemeral key. Usually compute this key using the pcp_scrypt() function.

-

Uses crypto_secret_box() for each 32k-block with a random nonce for each.

-
Parameters
- - - - - - -
[in]inStream to read the data to encrypt from.
[out]outStream to write encrypted result to.
[in]symkeyEphemeral key to use for encryption.
[in]haveheadFlag to indicate if the file header has already been written. Set to 0 if you call this function directly in order to do symmetrical encryption.
recsignRecipient list, set this to NULL if you call this function directly.
-
-
-
Returns
Returns the size of the output written to the output stream or 0 in case of errors.
- -
-
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
size_t pcp_sodium_mac (unsigned char ** cipher,
unsigned char * cleartext,
size_t clearsize,
unsigned char * nonce,
unsigned char * key 
)
-
- -

Symmetrically encrypt a message.

-

This function encrypts a message symmetrically using crypto_secretbox() using the given Curve25519 raw secret key and the nonce.

-

It allocates apropriate memory for the result, which will be stored in cipher.

-
Parameters
- - - - - - -
[out]cipherEncrypted result.
[in]cleartextClear message.
[in]clearsizeSize of message.
[in]nonceA random nonce (24 Bytes).
[in]keyA Curve25519 key (32 Bytes).
-
-
-
Returns
Returns the size of cipher.
- -
-
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
int pcp_sodium_verify_mac (unsigned char ** cleartext,
unsigned char * message,
size_t messagesize,
unsigned char * nonce,
unsigned char * key 
)
-
- -

Decrypt a symmetrically encrypted message.

-

This function decrypts a symmetrically encrypted message using crypto_secretbox_open() using the given Curve25519 raw secret key and the nonce.

-

It allocates apropriate memory for the result, which will be stored in cleartext.

-
Parameters
- - - - - - -
[out]cleartextThe decrypted result.
[in]messageThe encrypted message.
[in]messagesizeSize of message.
[in]nonceA random nonce (24 Bytes).
[in]keyA Curve25519 key (32 Bytes).
-
-
-
Returns
Returns 0 in case of success of -1 in case of an error. Check fatals_if_any().
- -
-
-
- - - - diff --git a/man/html/group__ED.html b/man/html/group__ED.html deleted file mode 100644 index 046c4d2..0000000 --- a/man/html/group__ED.html +++ /dev/null @@ -1,442 +0,0 @@ - - - - - -libpcp: SIGNING - - - - - - -
-
- - - - - - -
-
libpcp -  0.2.1 -
-
-
- - - -
-
- -
-
SIGNING
-
-
- -

ED25519 signature functions. -More...

- - - - - - - - - - - - - - - - - - - - - - - - - - -

-Functions

unsigned char * pcp_ed_sign (unsigned char *message, size_t messagesize, pcp_key_t *s)
 Sign a raw message.
 
unsigned char * pcp_ed_sign_key (unsigned char *message, size_t messagesize, pcp_key_t *s)
 Sign a raw message using s->mastersecret.
 
unsigned char * pcp_ed_verify (unsigned char *signature, size_t siglen, pcp_pubkey_t *p)
 Verify a signature.
 
unsigned char * pcp_ed_verify_key (unsigned char *signature, size_t siglen, pcp_pubkey_t *p)
 Verify a signature using the mastersecret.
 
size_t pcp_ed_sign_buffered (Pcpstream *in, Pcpstream *out, pcp_key_t *s, int z85)
 Sign a stream in 32k block mode.
 
pcp_pubkey_tpcp_ed_verify_buffered (Pcpstream *in, pcp_pubkey_t *p)
 Verify a signature from a stream in 32k block mode.
 
size_t pcp_ed_detachsign_buffered (Pcpstream *in, Pcpstream *out, pcp_key_t *s)
 Generate a detached signature from a stream in 32k block mode.
 
pcp_pubkey_tpcp_ed_detachverify_buffered (Pcpstream *in, Pcpstream *sigfd, pcp_pubkey_t *p)
 Verify a detached signature from a stream in 32k block mode.
 
-

Detailed Description

-

ED25519 signature functions.

-

Function Documentation

- -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
size_t pcp_ed_detachsign_buffered (Pcpstreamin,
Pcpstreamout,
pcp_key_ts 
)
-
- -

Generate a detached signature from a stream in 32k block mode.

-

This function reads blockwise from the stream in and generates a hash of the contents of the stream. It then signs that hash and writes the hash and the signature to the output stream out.

-
Parameters
- - - - -
[in]inStream to read from.
[out]outStream to write to.
[in]sPointer to secret key.
-
-
-
Returns
Returns the size of the detached signature written or 0 in case of errors. Check fatals_if_any().
- -
-
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
pcp_pubkey_t* pcp_ed_detachverify_buffered (Pcpstreamin,
Pcpstreamsigfd,
pcp_pubkey_tp 
)
-
- -

Verify a detached signature from a stream in 32k block mode.

-

This function reads blockwise from the stream in and generates a hash of the contents of the stream. It then reads the signature from the stream sigfd and verifies the signature from it using p->edpub and compares the signature hash with the hash it calculated from the signed content.

-
Parameters
- - - - -
[in]inStream to read from.
[in]sigfdStream containing the detached signature.
[in]pPointer to public key structure.
-
-
-
Returns
Returns a pointer to a public key which were used to verify the signature or NULL if an error occurred. Check fatals_if_any().
- -
-
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
unsigned char* pcp_ed_sign (unsigned char * message,
size_t messagesize,
pcp_key_ts 
)
-
- -

Sign a raw message.

-

Sign a message of messagesize using s->edsecret. This is just a convenience wrapper around crypto_sign().

-
Parameters
- - - - -
[in]messageThe message to sign.
[in]messagesizeSize of the message.
[in]sPointer to secret key structure.
-
-
-
Returns
Returns message+signature with size of messagesize + crypto_sign_BYTES, or NULL in case of an error.
- -
-
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
size_t pcp_ed_sign_buffered (Pcpstreamin,
Pcpstreamout,
pcp_key_ts,
int z85 
)
-
- -

Sign a stream in 32k block mode.

-

This function reads blockwise from the stream in and generates a hash of the contents of the stream. It outputs the stream to out, also blockwise and appends the signature afterwards, which consists of the hash+nacl-signature.

-
Parameters
- - - - - -
[in]inStream to read from.
[out]outStream to write to.
[in]sPointer to secret key.
[in]z85Flag which indicates if to create an armored signature or not. 1=armored, 0=raw.
-
-
-
Returns
Returns the number of bytes written to the output stream.
- -
-
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
unsigned char* pcp_ed_sign_key (unsigned char * message,
size_t messagesize,
pcp_key_ts 
)
-
- -

Sign a raw message using s->mastersecret.

-

The same as pcp_ed_sign() but uses the mastersecret for signing. Usually used for key signing only.

-
Parameters
- - - - -
[in]messageThe message to sign.
[in]messagesizeSize of the message.
[in]sPointer to secret key structure.
-
-
-
Returns
Returns message+signature with size of messagesize + crypto_sign_BYTES, or NULL in case of an error.
- -
-
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
unsigned char* pcp_ed_verify (unsigned char * signature,
size_t siglen,
pcp_pubkey_tp 
)
-
- -

Verify a signature.

-

Verify a signature of size siglen using p->edpub.

-

The signature must contain the message+nacl signature (with size crypto_sign_BYTES).

-
Parameters
- - - - -
[in]signatureMessage+signature.
[in]siglenSize of message+signature.
[in]pPointer to public key structure.
-
-
-
Returns
If the signature verifies return the raw message with the signature removed (size: siglen - crypto_sign_BYTES), returns NULL in case of errors. Check fatals_if_any().
- -
-
- -
-
- - - - - - - - - - - - - - - - - - -
pcp_pubkey_t* pcp_ed_verify_buffered (Pcpstreamin,
pcp_pubkey_tp 
)
-
- -

Verify a signature from a stream in 32k block mode.

-

This function reads blockwise from the stream in and generates a hash of the contents of the stream. While reading from the stream it extracts the appended signature (hash+sig). It then verifies the signature using p->edpub and compares the signature hash with the hash it calculated from the signed content.

-

The parameter p can be NULL. In this case the function loops through the global public key hash pcppubkey_hash to find a public key which is able to verify the signature.

-
Parameters
- - - -
[in]inStream to read from.
[in]pPointer to public key structure.
-
-
-
Returns
Returns a pointer to a public key which were used to verify the signature or NULL if an error occurred. Check fatals_if_any().
- -
-
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
unsigned char* pcp_ed_verify_key (unsigned char * signature,
size_t siglen,
pcp_pubkey_tp 
)
-
- -

Verify a signature using the mastersecret.

-

Verify a signature of size siglen using p->masterpub.

-

The signature must contain the message+nacl signature (with size crypto_sign_BYTES).

-
Parameters
- - - - -
[in]signatureMessage+signature.
[in]siglenSize of message+signature.
[in]pPointer to public key structure.
-
-
-
Returns
If the signature verifies return the raw message with the signature removed (size: siglen - crypto_sign_BYTES), returns NULL in case of errors. Check fatals_if_any().
- -
-
-
- - - - diff --git a/man/html/group__FATALS.html b/man/html/group__FATALS.html deleted file mode 100644 index b989bdb..0000000 --- a/man/html/group__FATALS.html +++ /dev/null @@ -1,221 +0,0 @@ - - - - - -libpcp: FATALS - - - - - - -
-
- - - - - - -
-
libpcp -  0.2.1 -
-
-
- - - -
-
- -
-
FATALS
-
-
- -

A couple of functions to catch errors and display them. -More...

- - - - - - - - - - - - - - -

-Functions

void fatal (const char *fmt,...)
 Set an error message.
 
void fatals_ifany ()
 Prints error messages to STDERR, if there are some.
 
void fatals_reset ()
 Reset the error variables.
 
void fatals_done ()
 Cleans up memory allocation of global error variables.
 
- - - - - - - - - - -

-Variables

char * PCP_ERR
 Global variable holding the last error message.
 
byte PCP_ERRSET
 Global variable indicating if an error occurred.
 
int PCP_EXIT
 Exitcode for the pcp commandline utility.
 
-

Detailed Description

-

A couple of functions to catch errors and display them.

-

Function Documentation

- -
-
- - - - - - - - - - - - - - - - - - -
void fatal (const char * fmt,
 ... 
)
-
- -

Set an error message.

-

This function gets a printf() like error message, which it stores in the global PCP_ERR variable and sets PCP_ERRSET to 1.

-
Parameters
- - - -
[in]fmtprintf() like format description.
[in]...format parameters, if any.
-
-
- -
-
- -
-
- - - - - - - -
void fatals_done ()
-
- -

Cleans up memory allocation of global error variables.

- -
-
- -
-
- - - - - - - -
void fatals_ifany ()
-
- -

Prints error messages to STDERR, if there are some.

-

FIXME: add something like this which returns the message.

- -
-
- -
-
- - - - - - - -
void fatals_reset ()
-
- -

Reset the error variables.

-

This can be used to ignore previous errors. Use with care.

- -
-
-

Variable Documentation

- -
-
- - - - -
PCP_ERR
-
- -

Global variable holding the last error message.

-

Can be retrieved with fatals_ifany().

- -
-
- -
-
- - - - -
PCP_ERRSET
-
- -

Global variable indicating if an error occurred.

- -
-
- -
-
- - - - -
PCP_EXIT
-
- -

Exitcode for the pcp commandline utility.

- -
-
-
- - - - diff --git a/man/html/group__KEYHASH.html b/man/html/group__KEYHASH.html deleted file mode 100644 index 81ef276..0000000 --- a/man/html/group__KEYHASH.html +++ /dev/null @@ -1,404 +0,0 @@ - - - - - -libpcp: KEYHASH - - - - - - -
-
- - - - - - -
-
libpcp -  0.2.1 -
-
-
- - - -
-
- -
-
KEYHASH
-
-
- -

Uthashes of secret and public key structures. -More...

- - - - - - - - -

-Macros

#define pcphash_iterate(key)
 Iterate over the list of secret keys.
 
#define pcphash_iteratepub(key)
 Iterate over the list of public keys.
 
- - - - - - - - - - - - - - - - - - - - - - - - - -

-Functions

void pcphash_init ()
 Initialize the global hashes.
 
void pcphash_del (void *key, int type)
 Delete an entry from a hash.
 
void pcphash_clean ()
 Frees the memory allocated by the hashes.
 
pcp_key_tpcphash_keyexists (char *id)
 Check if a secret key with a given key-id exists in the hash.
 
pcp_pubkey_tpcphash_pubkeyexists (char *id)
 Check if a publickey with a given key-id exists in the hash.
 
void pcphash_add (void *key, int type)
 Add a key structure to the hash list.
 
int pcphash_count ()
 Returns the number of secret keys in the hash.
 
int pcphash_countpub ()
 Returns the number of public keys in the hash.
 
- - - - - - - - - - -

-Variables

pcp_key_tpcpkey_hash
 Global hash for secret keys.
 
pcp_pubkey_tpcppubkey_hash
 Global hash for public keys.
 
pcp_keysig_t * pcpkeysig_hash
 Global hash for key signatures.
 
-

Detailed Description

-

Uthashes of secret and public key structures.

-

Libpcp uses the uthash system to maintain lists of keys. There's one hash per key type. The hash has the same type as the key structure itself, but is global.

-

Macro Definition Documentation

- -
-
- - - - - - - - -
#define pcphash_iterate( key)
-
-Value:
__k = NULL; \
-
HASH_ITER(hh, pcpkey_hash, key, __k)
-
-

Iterate over the list of secret keys.

-

Sample use:

-
pcp_key_t k = NULL;
- - -
}
-

Also, don't free() the keyhash or the temporary key pointer yourself. Use pcphash_clean() instead when done.

- -

Definition at line 64 of file keyhash.h.

- -
-
- -
-
- - - - - - - - -
#define pcphash_iteratepub( key)
-
-Value:
__p = NULL; \
-
HASH_ITER(hh, pcppubkey_hash, key, __p)
-
-

Iterate over the list of public keys.

-

Sample use:

-

Also, don't free() the keyhash or the temporary key pointer yourself. Use pcphash_clean() instead when done.

- -

Definition at line 83 of file keyhash.h.

- -
-
-

Function Documentation

- -
-
- - - - - - - - - - - - - - - - - - -
void pcphash_add (void * key,
int type 
)
-
- -

Add a key structure to the hash list.

-
Parameters
- - - -
[in]keyA pointer to the key structure to delete.
[in]typeAn integer specifying the key type to delete.
-
-
-
See Also
_PCP_KEY_TYPES.
- -
-
- -
-
- - - - - - - -
void pcphash_clean ()
-
- -

Frees the memory allocated by the hashes.

-

Clears and frees memory of all keys in the hash lists and the hashes themselfes.

- -
-
- -
-
- - - - - - - -
int pcphash_count ()
-
- -

Returns the number of secret keys in the hash.

-
Returns
Number of keys.
- -
-
- -
-
- - - - - - - -
int pcphash_countpub ()
-
- -

Returns the number of public keys in the hash.

-
Returns
Number of keys.
- -
-
- -
-
- - - - - - - - - - - - - - - - - - -
void pcphash_del (void * key,
int type 
)
-
- -

Delete an entry from a hash.

-
Parameters
- - - -
[in]keyA pointer to the key structure to delete.
[in]typeAn integer specifying the key type to delete.
-
-
-
See Also
_PCP_KEY_TYPES.
- -
-
- -
-
- - - - - - - -
void pcphash_init ()
-
- -

Initialize the global hashes.

- -
-
- -
-
- - - - - - - - -
pcp_key_t* pcphash_keyexists (char * id)
-
- -

Check if a secret key with a given key-id exists in the hash.

-
Parameters
- - -
[in]idA string with the key-id (max 17 chars incl 0).
-
-
-
Returns
Returns a pointer to the matching key or NULL if the id doesn't match.
- -
-
- -
-
- - - - - - - - -
pcp_pubkey_t* pcphash_pubkeyexists (char * id)
-
- -

Check if a publickey with a given key-id exists in the hash.

-
Parameters
- - -
[in]idA string with the key-id (max 17 chars incl 0).
-
-
-
Returns
Returns a pointer to the matching key or NULL if the id doesn't match.
- -
-
-

Variable Documentation

- -
-
- - - - -
pcp_key_t* pcpkey_hash
-
- -

Global hash for secret keys.

- -
-
- -
-
- - - - -
pcp_keysig_t* pcpkeysig_hash
-
- -

Global hash for key signatures.

- -
-
- -
-
- - - - -
pcp_pubkey_t* pcppubkey_hash
-
- -

Global hash for public keys.

- -
-
-
- - - - diff --git a/man/html/group__KEYS.html b/man/html/group__KEYS.html deleted file mode 100644 index 045ba46..0000000 --- a/man/html/group__KEYS.html +++ /dev/null @@ -1,710 +0,0 @@ - - - - - -libpcp: KEYS - - - - - - -
-
- - - - - - -
-
libpcp -  0.2.1 -
-
-
- - - -
-
- -
-
KEYS
-
-
- -

PCP public and secret key functions. -More...

- - - - - - - - - - - -

-Classes

struct  _pcp_key_t
 PCP private key structure. More...
 
struct  _pcp_pubkey_t
 PCP public key structure. More...
 
struct  _pcp_rec_t
 Encrypted recipient list. More...
 
- - - - - - - - - - -

-Typedefs

typedef struct _pcp_key_t pcp_key_t
 Typedef for secret keys.
 
typedef struct _pcp_pubkey_t pcp_pubkey_t
 Typedef for public keys.
 
typedef struct _pcp_rec_t pcp_rec_t
 Typedef for public keys.
 
- - - - -

-Enumerations

enum  _PCP_KEY_TYPES {
-  PCP_KEY_TYPE_MAINSECRET = 1, -PCP_KEY_TYPE_SECRET = 2, -PCP_KEY_TYPE_PUBLIC = 3, -PCP_KEYSIG_NATIVE = 4, -
-  PCP_KEYSIG_PBP = 5 -
- }
 Internal key types. More...
 
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

-Functions

pcp_key_tpcpkey_new ()
 Generate a new key structure.
 
char * pcppubkey_get_art (pcp_pubkey_t *k)
 Generate an ASCII art image of the public key.
 
char * pcpkey_get_art (pcp_key_t *k)
 Generate an ASCII art image of the public key part of a secret key.
 
pcp_key_tpcpkey_encrypt (pcp_key_t *key, char *passphrase)
 Encrypt a secret key structure.
 
pcp_key_tpcpkey_decrypt (pcp_key_t *key, char *passphrase)
 Decrypt a secret key structure.
 
pcp_pubkey_tpcpkey_pub_from_secret (pcp_key_t *key)
 Generate a public key structure from a given secret key structure.
 
char * pcp_getkeyid (pcp_key_t *k)
 Calculate a key-id from public key fields.
 
char * pcp_getpubkeyid (pcp_pubkey_t *k)
 Calculate a key-id from public key fields.
 
unsigned char * pcppubkey_getchecksum (pcp_pubkey_t *k)
 Calculate a checksum of a public key.
 
unsigned char * pcpkey_getchecksum (pcp_key_t *k)
 Calculate a checksum of a public key part of the given secret key.
 
pcp_key_tpcpkey_exists (char *id)
 Checks if a secret key structure is registered in the secret key hash.
 
pcp_pubkey_tpcppubkey_exists (char *id)
 Checks if a public key structure is registered in the public key hash.
 
unsigned char * pcp_gennonce ()
 Generate a nonce.
 
int pcp_sanitycheck_pub (pcp_pubkey_t *key)
 Make a sanity check of the given public key structure.
 
int pcp_sanitycheck_key (pcp_key_t *key)
 Make a sanity check of the given secret key structure.
 
void pcp_dumpkey (pcp_key_t *k)
 Dump a secret key structure to stderr.
 
void pcp_dumppubkey (pcp_pubkey_t *k)
 Dump a public key structure to stderr.
 
-

Detailed Description

-

PCP public and secret key functions.

-

Functions to generate PCP keypairs, de- and encrypt them and various related helpers.

-

Typedef Documentation

- -
-
- - - - -
typedef struct _pcp_key_t pcp_key_t
-
- -

Typedef for secret keys.

- -

Definition at line 113 of file key.h.

- -
-
- -
-
- - - - -
typedef struct _pcp_pubkey_t pcp_pubkey_t
-
- -

Typedef for public keys.

- -

Definition at line 140 of file key.h.

- -
-
- -
-
- - - - -
typedef struct _pcp_rec_t pcp_rec_t
-
- -

Typedef for public keys.

- -

Definition at line 174 of file key.h.

- -
-
-

Enumeration Type Documentation

- -
-
- - - - -
enum _PCP_KEY_TYPES
-
- -

Internal key types.

-
Enumerator:
- - - - - -
PCP_KEY_TYPE_MAINSECRET  -

1 - Primary secret

-
PCP_KEY_TYPE_SECRET  -

2 - Other secret

-
PCP_KEY_TYPE_PUBLIC  -

3 - Public

-
PCP_KEYSIG_NATIVE  -

4 - PCP native key signature

-
PCP_KEYSIG_PBP  -

5 - PBP key signature

-
-
-
- -

Definition at line 92 of file defines.h.

- -
-
-

Function Documentation

- -
-
- - - - - - - - -
void pcp_dumpkey (pcp_key_tk)
-
- -

Dump a secret key structure to stderr.

-
Parameters
- - -
[in]kSecret key to dump.
-
-
- -
-
- -
-
- - - - - - - - -
void pcp_dumppubkey (pcp_pubkey_tk)
-
- -

Dump a public key structure to stderr.

-
Parameters
- - -
[in]kPublic key to dump.
-
-
- -
-
- -
-
- - - - - - - -
unsigned char* pcp_gennonce ()
-
- -

Generate a nonce.

-

This function generates a 24 byte nonce used for cryptographic functions. It allocates the memory and the caller is responsible to clear and free() it after use.

-
Returns
Returns a pointer to a 24 byte unsigned char array.
- -
-
- -
-
- - - - - - - - -
char* pcp_getkeyid (pcp_key_tk)
-
- -

Calculate a key-id from public key fields.

-

This function calculates 2 JEN Hashes: one from the 'pub' field and one from the 'edpub' field. It the puts them together into a newly allocated char pointer of 17 bytes length as hex, terminated with a 0.

-

The key-id is supposed to be collision save, but there's no guarantee. However, it's used locally only, it wont be transmitted over the network and it's not part of any exported packet.

-
Parameters
- - -
[in]kThe secret key structure.
-
-
-
Returns
Returns a char pointer containing the key-id string.
- -
-
- -
-
- - - - - - - - -
char* pcp_getpubkeyid (pcp_pubkey_tk)
-
- -

Calculate a key-id from public key fields.

-

This does the same as pcp_getkeyid() but uses a pcp_pubkey_t as input.

-
Parameters
- - -
[in]kThe public key structure.
-
-
-
Returns
Returns a char pointer containing the key-id string.
- -
-
- -
-
- - - - - - - - -
int pcp_sanitycheck_key (pcp_key_tkey)
-
- -

Make a sanity check of the given secret key structure.

-
Parameters
- - -
[in]keyThe secret key structure.
-
-
-
Returns
Returns 1 if the sanity check succeeds, 0 otherwise. Use fatals_ifany() to check why.
- -
-
- -
-
- - - - - - - - -
int pcp_sanitycheck_pub (pcp_pubkey_tkey)
-
- -

Make a sanity check of the given public key structure.

-
Parameters
- - -
[in]keyThe public key structure.
-
-
-
Returns
Returns 1 if the sanity check succeeds, 0 otherwise. Use fatals_ifany() to check why.
- -
-
- -
-
- - - - - - - - - - - - - - - - - - -
pcp_key_t* pcpkey_decrypt (pcp_key_tkey,
char * passphrase 
)
-
- -

Decrypt a secret key structure.

-

The given passphrase will be used to calculate an encryption key using the scrypt() function.

-

The encryption key will be used to decrypt the 'encrypted' field of the structure. If it works, the result will be dissected and put into the correspondig secret key fields.

-

The data structure will be modified directly, no new memory will be allocated.

-

The caller is responsible to clear the passphrase right after use and free() it as soon as possible.

-
Parameters
- - - -
[in,out]keyThe secret key structure.
[in]passphraseThe passphrase used to decrypt the key.
-
-
-
Returns
Returns a pointer to the decrypted key structure or NULL in case of an error. Use fatals_ifany() to catch them.
- -
-
- -
-
- - - - - - - - - - - - - - - - - - -
pcp_key_t* pcpkey_encrypt (pcp_key_tkey,
char * passphrase 
)
-
- -

Encrypt a secret key structure.

-

The given passphrase will be used to calculate an encryption key using the scrypt() function.

-

The secret keys will be concatenated and encrypted, the result will be put into the 'encrypted' field. The first byte of each secret key field will be set to 0 to indicate the key is encrypted.

-

The data structure will be modified directly, no new memory will be allocated.

-

The caller is responsible to clear the passphrase right after use and free() it as soon as possible.

-
Parameters
- - - -
[in,out]keyThe secret key structure.
[in]passphraseThe passphrase used to encrypt the key.
-
-
-
Returns
Returns a pointer to the encrypted key structure or NULL in case of an error. Use fatals_ifany() to catch them.
- -
-
- -
-
- - - - - - - - -
pcp_key_t* pcpkey_exists (char * id)
-
- -

Checks if a secret key structure is registered in the secret key hash.

-

Returns a pointer to a pcp_key_t structure if there exists a secret key structure with the given id in the secret key hash.

-

FIXME: needs to be moved to keyhash.h.

-
Parameters
- - -
[in]idA null-terminated char pointer of 17 bytes containing a key-id.
-
-
-
Returns
Returns a pointer to a pcp_key_t struture or NULL if no key exists.
- -
-
- -
-
- - - - - - - - -
char* pcpkey_get_art (pcp_key_tk)
-
- -

Generate an ASCII art image of the public key part of a secret key.

-

see pcppubkey_get_art() for details.

-
Parameters
- - -
[in]kThe secret key structure.
-
-
-
Returns
Returns an allocated char pointer containing the ASCII art image. The caller is responsible to free() it.
- -
-
- -
-
- - - - - - - - -
unsigned char* pcpkey_getchecksum (pcp_key_tk)
-
- -

Calculate a checksum of a public key part of the given secret key.

-

See pcppubkey_getchecksum().

-
Parameters
- - -
[in]kThe secret key structure.
-
-
-
Returns
Returns a pointer to an 32 byte unsigned char.
- -
-
- -
-
- - - - - - - -
pcp_key_t* pcpkey_new ()
-
- -

Generate a new key structure.

-

Owner and mail field must be filled by the caller. Memory for the returned pointer will be allocated by the function.

-
Returns
Returns pointer to new pcp_key_t structure.
- -
-
- -
-
- - - - - - - - -
pcp_pubkey_t* pcpkey_pub_from_secret (pcp_key_tkey)
-
- -

Generate a public key structure from a given secret key structure.

-

This function extracts all required fields and fills a newly allocated pcp_pubkey_t structure.

-

The caller is responsible to clear and free() it after use.

-
Parameters
- - -
[in]keyThe secret key structure.
-
-
-
Returns
Returns a new pcp_pubkey_t structure.
- -
-
- -
-
- - - - - - - - -
pcp_pubkey_t* pcppubkey_exists (char * id)
-
- -

Checks if a public key structure is registered in the public key hash.

-

Returns a pointer to a pcp_pubkey_t structure if there exists a public key structure with the given id in the public key hash.

-

FIXME: needs to be moved to keyhash.h.

-
Parameters
- - -
[in]idA null-terminated char pointer of 17 bytes containing a key-id.
-
-
-
Returns
Returns a pointer to a pcp_pubkey_t struture or NULL if no key exists.
- -
-
- -
-
- - - - - - - - -
char* pcppubkey_get_art (pcp_pubkey_tk)
-
- -

Generate an ASCII art image of the public key.

-

This functions originally appeared in OpenSSH rev 1.70, comitted by Alexander von Gernler, published under the BSD license.

-

Human beings are bad at memorizing numbers, especially large numbers, but we are very good at recognizing images. This function calculates an ascii art image of a public key, which the user shall always see, when used. If the image changes, the user would immediately recognize the change, even unconsciously.

-

Sample random art image from the following public key:

-
c308455ed4cf0c140bf48bfb0d87c4999c66e823bbe74ff16e2a9adc8e770747
-
-
+----------------+
-
| .o.ooo. |
-
| o . o |
-
| . . = |
-
| . o + |
-
| . + |
-
| . |
-
| |
-
| |
-
+----------------+
-
Parameters
- - -
[in]kThe public key structure.
-
-
-
Returns
Returns an allocated char pointer containing the ASCII art image. The caller is responsible to free() it.
- -
-
- -
-
- - - - - - - - -
unsigned char* pcppubkey_getchecksum (pcp_pubkey_tk)
-
- -

Calculate a checksum of a public key.

-

This function calculates a 32 byte checksum of the encryption public key part of the given pcp_pubkey_t structure using crypto_hash_sha256.

-

The returned pointer will be allocated and it is the responsibility of the caller to free() ist after use.

-
Parameters
- - -
[in]kThe public key structure.
-
-
-
Returns
Returns a pointer to an 32 byte unsigned char.
- -
-
-
- - - - diff --git a/man/html/group__Pcpstream.html b/man/html/group__Pcpstream.html deleted file mode 100644 index 3911be7..0000000 --- a/man/html/group__Pcpstream.html +++ /dev/null @@ -1,540 +0,0 @@ - - - - - -libpcp: PCPSTREAMS - - - - - - -
-
- - - - - - -
-
libpcp -  0.2.1 -
-
-
- - - -
-
- -
-
PCPSTREAMS
-
-
- -

I/O wrapper for files or buffers. -More...

- - - - - -

-Classes

struct  _pcp_stream_t
 An I/O wrapper object backed by a file or a buffer. More...
 
- - - - -

-Typedefs

typedef struct _pcp_stream_t Pcpstream
 The name used everywhere.
 
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

-Functions

Pcpstreamps_new_file (FILE *backendfd)
 Create a new stream, backed with an open file.
 
Pcpstreamps_new_inbuffer (Buffer *b)
 Create a new input stream, backed with filled a buffer.
 
Pcpstreamps_new_outbuffer ()
 Create a new output stream, backed with a buffer.
 
size_t ps_read (Pcpstream *stream, void *buf, size_t readbytes)
 Read bytes into the given buffer from the current stream.
 
size_t ps_write (Pcpstream *stream, void *buf, size_t writebytes)
 Write bytes from the given buffer into the current stream.
 
size_t ps_print (Pcpstream *stream, const char *fmt,...)
 Write a formatted string to the stream.
 
size_t ps_tell (Pcpstream *stream)
 Tell the current read or write offset.
 
Bufferps_buffer (Pcpstream *stream)
 Access the Buffer backend pointer.
 
void ps_close (Pcpstream *stream)
 Close the stream and frees allocated memory.
 
int ps_end (Pcpstream *stream)
 Check if EOF have been reached.
 
int ps_err (Pcpstream *stream)
 Check if an error occurred during a read or write operation.
 
-

Detailed Description

-

I/O wrapper for files or buffers.

-

Simple wrapper around FILE streams or Buffers, depending how the user initialized them. The Pcpstream object behaves always the same and it doesn't matter how it's backed.

-

We use it in the lib, e.g. in the crypto routines. That way we can support blockwise crypto on buffers or files.

-

Streams are, just like iostreams in c++, either output or input mode.

-

Sample usage:

-
#include <stdio.h>
-
#include <stdlib.h>
-
#include <limits.h>
-
-
#include <pcp.h>
-
-
int main() {
-
/* create a file with "encrypted" data */
-
FILE *out, *in;
-
unsigned char clear[8] = "ABCDEFGH";
-
unsigned char key[8] = "IxD8Lq1K";
-
unsigned char crypt[8] = {0};
-
int blocks = 8;
-
int i = 0;
-
-
if((out = fopen("teststream.out", "wb+")) == NULL) {
-
fprintf(stderr, "oops, could not open file!\n");
-
return 1;
-
}
-
Pcpstream *pout = ps_new_file(out);
-
-
/* "encrypt" a couple of times into the file */
-
for(i=0; i<blocks; i++) {
-
memcpy(crypt, clear, 8);
-
_xorbuf(key, crypt, 8);
-
ps_write(pout, crypt, 8);
-
}
-
ps_close(pout);
-
fclose(out);
-
-
/* read it in again using an in and an out stream */
-
if((in = fopen("teststream.out", "rb")) == NULL) {
-
fprintf(stderr, "oops, could not open file!\n");
-
return 1;
-
}
-
Pcpstream *pin = ps_new_file(in);
-
-
/* we'll use this stream to put the "decrypted" data in.
-
note, that this could be a file as well. */
- -
-
/* read and "decrypt" */
-
for(i=0; i<blocks; i++) {
-
ps_read(pin, crypt, 8);
-
_xorbuf(key, crypt, 8);
-
ps_write(pclear, crypt, 8);
-
}
-
ps_close(pin);
-
fclose(in);
-
-
/* now extract the buffer from the output stream */
-
Buffer *result = ps_buffer(pclear);
-
-
/* and verify if it's "decrypted" (re-use crypt) */
-
for(i=0; i<blocks; i++) {
-
buffer_get_chunk(result, crypt, 8);
-
if(memcmp(crypt, clear, 8) != 0) {
-
fprintf(stderr, "Oops, block %d doesn't match\n", i);
-
goto error;
-
}
-
}
-
-
ps_close(pclear);
-
-
fprintf(stderr, "done\n");
-
-
return 0;
-
-
error:
-
ps_close(pclear);
-
return 1;
-
}
-

Typedef Documentation

- -
-
- - - - -
typedef struct _pcp_stream_t Pcpstream
-
- -

The name used everywhere.

- -

Definition at line 67 of file pcpstream.h.

- -
-
-

Function Documentation

- -
-
- - - - - - - - -
Buffer* ps_buffer (Pcpstreamstream)
-
- -

Access the Buffer backend pointer.

-

Use this function to access the underlying Buffer object of an output stream to access the contents written to it. Only usefull if the stream have been initialized with ps_new_outbuffer().

-
Parameters
- - -
[in]streamThe stream object.
-
-
-
Returns
Returns a pointer to the Buffer object.
- -
-
- -
-
- - - - - - - - -
void ps_close (Pcpstreamstream)
-
- -

Close the stream and frees allocated memory.

-

If the backend of the stream was a FILE stream, close it, unless it is stdin, stdout or stderr.

-

If the backend was a Buffer, clear and free it.

-
Parameters
- - -
[in]streamThe stream to close.
-
-
- -
-
- -
-
- - - - - - - - -
int ps_end (Pcpstreamstream)
-
- -

Check if EOF have been reached.

-

This function can be used to check if there are no more bytes to read. This will happen if we reach EOF with a FILE backed stream or buffer_done() with a Buffer backed stream.

-
Parameters
- - -
[in]streamThe stream object.
-
-
-
Returns
Returns 1 if we reached EOF, 0 otherwise
- -
-
- -
-
- - - - - - - - -
int ps_err (Pcpstreamstream)
-
- -

Check if an error occurred during a read or write operation.

-
Parameters
- - -
[in]streamThe stream object.
-
-
-
Returns
Returns 1 if there were any errors or 0 otherwise. Also check errno() and fatals_ifany().
- -
-
- -
-
- - - - - - - - -
Pcpstream* ps_new_file (FILE * backendfd)
-
- -

Create a new stream, backed with an open file.

-

The stream used for in- or output.

-
Parameters
- - -
[in]backendfdAn open FILE stream.
-
-
-
Returns
Returns a Pcpstream structure.
- -
-
- -
-
- - - - - - - - -
Pcpstream* ps_new_inbuffer (Bufferb)
-
- -

Create a new input stream, backed with filled a buffer.

-

This kind of stream can be used for reading only.

-
Parameters
- - -
[in]bA Buffer object filled with data.
-
-
-
Returns
Returns a Pcpstream structure.
- -
-
- -
-
- - - - - - - -
Pcpstream* ps_new_outbuffer ()
-
- -

Create a new output stream, backed with a buffer.

-

The buffer used to write data to will be allocated and filled by the class. You can retrieve it later.

-
Returns
Returns a Pcpstream structure.
- -
-
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
size_t ps_print (Pcpstreamstream,
const char * fmt,
 ... 
)
-
- -

Write a formatted string to the stream.

-

Use an printf() style format string to print something out to a stream.

-

Sets err in case of an error. See ps_err().

-
Parameters
- - - - -
[out]streamThe input stream to read from.
[in]fmtThe printf() compatible format description.
[in]...A variable number of arguments for the format string.
-
-
-
Returns
Returns the number of bytes written. in case of errors it returns 0.
- -
-
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
size_t ps_read (Pcpstreamstream,
void * buf,
size_t readbytes 
)
-
- -

Read bytes into the given buffer from the current stream.

-

This function reads 'readbytes' bytes from the stream into given buf. The buffer needs to be properly allocated by the caller in advance to have at least readbytes len.

-

Sets eof=1 if end of file or end of buffer has been reached.

-

Sets err=1 if an error occurred, fatals() maybe set, or errno.

-

See ps_end() and ps_err().

-
Parameters
- - - - -
[in]streamThe input stream to read from.
[out]bufThe buffer where to put read bytes.
[in]readbytesThe number of bytes to read.
-
-
-
Returns
Returns the bytes read, if there's nothing more to read, it returns 0.
- -
-
- -
-
- - - - - - - - -
size_t ps_tell (Pcpstreamstream)
-
- -

Tell the current read or write offset.

-

This function works like ftell() on a FILE stream or like Buffer->offset in the Buffer class.

-
Parameters
- - -
[in]streamThe input stream to read from.
-
-
-
Returns
Returns the the number of bytes read/written so far.
- -
-
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
size_t ps_write (Pcpstreamstream,
void * buf,
size_t writebytes 
)
-
- -

Write bytes from the given buffer into the current stream.

-

This function writes 'writebytes' bytes from the given buf into the stream

-

Sets err in case of an error. See ps_err().

-
Parameters
- - - - -
[out]streamThe input stream to write to.
[in]bufThe buffer containing data to put into the stream.
[in]writebytesThe number of bytes to write.
-
-
-
Returns
Returns the number of bytes written. in case of errors it returns 0.
- -
-
-
- - - - diff --git a/man/html/group__PubKeyExport.html b/man/html/group__PubKeyExport.html deleted file mode 100644 index d1da0c4..0000000 --- a/man/html/group__PubKeyExport.html +++ /dev/null @@ -1,310 +0,0 @@ - - - - - -libpcp: KEYEXPORT - - - - - - -
-
- - - - - - -
-
libpcp -  0.2.1 -
-
-
- - - -
-
- -
-
KEYEXPORT
-
-
- -

Functions to export and import keys in various formats. -More...

- - - - - - - - - - - - - - - - - - - - -

-Functions

Bufferpcp_export_rfc_pub (pcp_key_t *sk)
 RFC4880 alike public key export with some modifications.
 
Bufferpcp_export_pbp_pub (pcp_key_t *sk)
 Export a public key in PBP format.
 
Bufferpcp_export_yaml_pub (pcp_key_t *sk)
 Export a public key in yaml format.
 
Bufferpcp_export_perl_pub (pcp_key_t *sk)
 Export a public key in perl code format.
 
Bufferpcp_export_c_pub (pcp_key_t *sk)
 Export a public key in C code format.
 
Bufferpcp_export_secret (pcp_key_t *sk, char *passphrase)
 Export secret key.
 
-

Detailed Description

-

Functions to export and import keys in various formats.

-

Function Documentation

- -
-
- - - - - - - - -
Buffer* pcp_export_c_pub (pcp_key_tsk)
-
- -

Export a public key in C code format.

-

Export a public key in C code format.

-
Parameters
- - -
ska secret key structure of type pcp_key_t. The secret keys in there have to be already decrypted.
-
-
-
Returns
the function returns a Buffer object containing the binary blob containing a C code string.
- -
-
- -
-
- - - - - - - - -
Buffer* pcp_export_pbp_pub (pcp_key_tsk)
-
- -

Export a public key in PBP format.

-

Export a public key in the format described at https://github.com/stef/pbp/blob/master/doc/fileformats.txt

-
Parameters
- - -
ska secret key structure of type pcp_key_t. The secret keys in there have to be already decrypted.
-
-
-
Returns
the function returns a Buffer object containing the binary blob in the format described above.
- -
-
- -
-
- - - - - - - - -
Buffer* pcp_export_perl_pub (pcp_key_tsk)
-
- -

Export a public key in perl code format.

-

Export a public key in perl code format.

-
Parameters
- - -
ska secret key structure of type pcp_key_t. The secret keys in there have to be already decrypted.
-
-
-
Returns
the function returns a Buffer object containing the binary blob containing a perl code string (a hash definition).
- -
-
- -
-
- - - - - - - - -
Buffer* pcp_export_rfc_pub (pcp_key_tsk)
-
- -

RFC4880 alike public key export with some modifications.

-

RFC4880 alike public key export with the following modifications:

-
    -
  • Key material is native to us and not specified in the rfc for curve25519/ed25519. Therefore we're doing it like so: mp|sp|cp where mp = master keysigning public key (ed25519), 32 bytes sp = signing public key (ed25519), 32 bytes cp = encryption public key (curve25519), 32 bytes
  • -
-
    -
  • The various cipher (algorithm) id's are unspecified for our native ciphers. Therefore I created them, starting at 33 (afaik 22 is the last officially assigned one). Once those cipher numbers become official, I'll use them instead of my own.
  • -
-
    -
  • The exported public key packet contains a signature. We're filling out all required fields. A signature has a variable number of sig sub packets. We use only these types:
       2 = Signature Creation Time     (4 byte)
    -   3 = Signature Expiration Time   (4 byte)
    -   9 = Key Expiration Time         (4 bytes)
    -  20 = Notation Data               (4 byte flags, N bytes name+value)
    -  27 = Key Flags                   (1 byte, use 0x02, 0x08 and 0x80
    -
  • -
-
    -
  • We use 3 notation fields: "owner", which contains the owner name, if set "mail", which contains the emailaddress, if set "serial", which contains the 32bit serial number
  • -
-
    -
  • The actual signature field consists of the blake2 hash of (mp|sp|cp|keysig) followed by the nacl signature. However, we do not put an extra 16byte value of the hash, since the nacl signature already contains the full hash. So, an implementation could simply pull the fist 16 bytes of said hash to get the same result.
  • -
-
    -
  • The mp keypair will be used for signing. The recipient can verify the signature, since mp is included.
  • -
-
    -
  • While we put expiration dates for the key and the signature into the export as the rfc demands, we ignore them. Key expiring is not implemented in PCP yet.
  • -
-

So, a full pubkey export looks like this

-
   version
-   ctime
-   cipher
-   3 x raw keys            \
-   sigheader                > calc hash from this
-     sigsubs (header+data) /
-   hash
-   signature
-

We use big-endian always.

-

Unlike RC4880 public key exports, we're using Z85 encoding if armoring have been requested by the user. Armored output has a header and a footer line, however they are ignored by the parser and are therefore optional. Newlines, if present, are optional as well.

-

http://tools.ietf.org/html/rfc4880#section-5.2.3

-

The key sig blob will be saved in the Vault if we import a public key unaltered, so we can verify the signature at will anytime. When exporting a foreign public key, we will just put out that key sig blob to the export untouched.

-

Currently PCP only support self-signed public key exports.

-

We only support one key signature per key. However, it would be easily possible to support foreign keysigs as well in the future.

-
Parameters
- - -
ska secret key structure of type pcp_key_t. The secret keys in there have to be already decrypted.
-
-
-
Returns
the function returns a Buffer object containing the binary blob in the format described above.
- -
-
- -
-
- - - - - - - - - - - - - - - - - - -
Buffer* pcp_export_secret (pcp_key_tsk,
char * passphrase 
)
-
- -

Export secret key.

-

Export a secret key.

-

Secret key are exported in proprietary format.

-

The exported binary blob is symmetrically encrypted using the NACL function crypto_secret(). The passphrase will be used to derive an encryption key using the STAR function scrypt().

-

The binary data before encryption consists of:

-
    -
  • ED25519 master signing secret
  • -
  • Curve25519 encryption secret
  • -
  • ED25519 signing secret
  • -
  • ED25519 master signing public
  • -
  • Curve25519 encryption public
  • -
  • ED25519 signing public
  • -
  • Optional notations, currently supported are the 'owner' and 'mail' attributes. If an attribute is empty, the len field contains zero.
      -
    1. len(VAL) (2 byte uint)
    2. -
    3. VAL (string without trailing zero)
    4. -
    -
  • -
  • 8 byte creation time (epoch)
  • -
  • 4 byte key version
  • -
  • 4 byte serial number
  • -
-

The encrypted cipher will be prepended with the random nonce used to encrypt the data and looks after encryption as such:

-

Nonce | Cipher

-
Parameters
- - - -
ska secret key structure of type pcp_key_t. The secret keys in there have to be already decrypted.
passphrasethe passphrase to be used to encrypt the export, a null terminated char array.
-
-
-
Returns
the function returns a Buffer object containing the binary blob in the format described above.
- -
-
- -
-
- - - - - - - - -
Buffer* pcp_export_yaml_pub (pcp_key_tsk)
-
- -

Export a public key in yaml format.

-

Export a public key in yaml format.

-
Parameters
- - -
ska secret key structure of type pcp_key_t. The secret keys in there have to be already decrypted.
-
-
-
Returns
the function returns a Buffer object containing the binary blob containing a YAML string.
- -
-
-
- - - - diff --git a/man/html/group__UTILs.html b/man/html/group__UTILs.html deleted file mode 100644 index 03b3c43..0000000 --- a/man/html/group__UTILs.html +++ /dev/null @@ -1,239 +0,0 @@ - - - - - -libpcp: UTILS - - - - - - -
-
- - - - - - -
-
libpcp -  0.2.1 -
-
-
- - - -
-
- -
-
UTILS
-
-
- -

Various useful helper functions. -More...

- - - - - - - - - - - - - - -

-Functions

char * _lc (char *in)
 Convert a char array to lowercase.
 
size_t _findoffset (unsigned char *bin, size_t binlen, char *sigstart, size_t hlen)
 Find the offset of some offset marker in some arbitrary data.
 
void _xorbuf (unsigned char *iv, unsigned char *buf, size_t xlen)
 XOR an input buffer with another buffer.
 
void _dump (char *n, unsigned char *d, size_t s)
 Dump binary data as hex to stderr.
 
-

Detailed Description

-

Various useful helper functions.

-

Function Documentation

- -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
void _dump (char * n,
unsigned char * d,
size_t s 
)
-
- -

Dump binary data as hex to stderr.

-
Parameters
- - - - -
[in]nDescription, string.
[in]dData to print.
[in]sSize of d.
-
-
- -
-
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
size_t _findoffset (unsigned char * bin,
size_t binlen,
char * sigstart,
size_t hlen 
)
-
- -

Find the offset of some offset marker in some arbitrary data.

-

Sample input:

-
ABABABABnacl-98a7sd98a7das98d7
-

If you look for the offset of "nacl" within that data, the function will return 9, which is the position within the data where the marker starts.

-
Parameters
- - - - - -
[in]binAribrary data where to look for the marker.
[in]binlenThe size of the data.
[in]sigstartThe offset marker.
[in]hlenSize of the offset marker.
-
-
-
Returns
Returns the offset or -1 of the offset were not found.
- -
-
- -
-
- - - - - - - - -
char* _lc (char * in)
-
- -

Convert a char array to lowercase.

-

The supplied char array will be directly modified. Use a copy if you want to retain the original.

-
Parameters
- - -
[in,out]inThe char array to convert.
-
-
-
Returns
Returns the pointer to the char array.
- -
-
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
void _xorbuf (unsigned char * iv,
unsigned char * buf,
size_t xlen 
)
-
- -

XOR an input buffer with another buffer.

-

Both buffers have to have the same size. The input buffer will bei modified directly.

-
Parameters
- - - - -
[in]ivThe buffer to XOR with.
[in,out]bufThe buffer which will be XORed with 'iv'.
[in]xlenThe size of the buffers (they must have the same size).
-
-
- -
-
-
- - - - diff --git a/man/html/group__VAULT.html b/man/html/group__VAULT.html deleted file mode 100644 index cec2cda..0000000 --- a/man/html/group__VAULT.html +++ /dev/null @@ -1,368 +0,0 @@ - - - - - -libpcp: VAULT - - - - - - -
-
- - - - - - -
-
libpcp -  0.2.1 -
-
-
- - - -
-
- -
-
VAULT
-
-
- -

The vault file is used to store keys and key-signatures on disk. -More...

- - - - - - - - - - - -

-Classes

struct  _vault_t
 This structure represents a vault. More...
 
struct  _vault_header_t
 Defines the vault header. More...
 
struct  _vault_item_header_t
 An item header. More...
 
- - - - - - - - - - -

-Typedefs

typedef struct _vault_t vault_t
 Name of the struct.
 
typedef struct _vault_header_t vault_header_t
 Name of the struct.
 
typedef struct _vault_item_header_t vault_item_header_t
 Name of the struct.
 
- - - - - - - - - - - - - - - - -

-Functions

vault_tpcpvault_init (char *filename)
 Open a vault file.
 
int pcpvault_additem (vault_t *vault, void *item, size_t itemsize, uint8_t type)
 Add an item to the vault.
 
int pcpvault_addkey (vault_t *vault, void *item, uint8_t type)
 Add a key to the vault.
 
int pcpvault_close (vault_t *vault)
 Close a vault file.
 
int pcpvault_fetchall (vault_t *vault)
 Reads in the vault contents.
 
-

Detailed Description

-

The vault file is used to store keys and key-signatures on disk.

-

It works like a keyring.

-

-Vault File Format

-

The vault file contains all public and secret keys. It's a portable binary file.

-

The file starts with a header:

-
+-------------------------------------------+
-
| Field Size Description |
-
+-------------------------------------------+
-
| File ID | 1 | Vault Identifier 0xC4 |
-
+-------------------------------------------+
-
| Version | 4 | Big endian, version |
-
+-------------------------------------------+
-
| Checksum | 32 | SHA256 Checksum |
-
+-------------------------------------------+
-

The checksum is a checksum of all keys.

-

The header is followed by the keys. Each key is preceded by an item header which looks like this:

-
+--------------------------------------------+
-
| Field Size Description |
-
+--------------------------------------------+
-
| Type | 1 | Key type (S,P,M) |
-
+--------------------------------------------+
-
| Size | 4 | Big endian, keysize |
-
+--------------------------------------------+
-
| Version | 4 | Big endian, keyversion |
-
+--------------------------------------------+
-
| Checksum | 32 | SHA256 Key Checksum |
-
+--------------------------------------------+
-

Type can be one of:

-
    -
  • PCP_KEY_TYPE_MAINSECRET 0x01
  • -
  • PCP_KEY_TYPE_SECRET 0x02
  • -
  • PCP_KEY_TYPE_PUBLIC 0x03
  • -
-

The item header is followed by the actual key contents.

-

Typedef Documentation

- -
-
- - - - -
typedef struct _vault_header_t vault_header_t
-
- -

Name of the struct.

- -

Definition at line 119 of file vault.h.

- -
-
- -
-
- - - - -
typedef struct _vault_item_header_t vault_item_header_t
-
- -

Name of the struct.

- -

Definition at line 131 of file vault.h.

- -
-
- -
-
- - - - -
typedef struct _vault_t vault_t
-
- -

Name of the struct.

- -

Definition at line 108 of file vault.h.

- -
-
-

Function Documentation

- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
int pcpvault_additem (vault_tvault,
void * item,
size_t itemsize,
uint8_t type 
)
-
- -

Add an item to the vault.

-

Adds item with the size itemsize and type type to the vault. Generates the item header and the checksum of the item.

-

This function writes directly into the vault file. Use with care. To be safe, use pcpvault_addkey() instead.

-
Parameters
- - - - - -
[out]vaultThe vault object.
[in]itemThe item to write.
[in]itemsizeSize of the item.
[in]typeType of the item.
-
-
-
See Also
_PCP_KEY_TYPES.
-
Returns
Returns the number of bytes written or 0 in case of an error. Check fatals_if_any().
- -
-
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
int pcpvault_addkey (vault_tvault,
void * item,
uint8_t type 
)
-
- -

Add a key to the vault.

-

This function determines the size of the item to write based on the given type. It converts the internal structure to a binary blob and converty multibyte values to big endian.

-

It copies the given vault file to a temporary vault file, adds the item and if this went ok, copies the temporary file back to the original location. It then re-calculates the vault checksum and puts it into the vault header.

-
Parameters
- - - - -
[out]vaultThe vault object.
[in]itemThe item to write (a key or keysig)
[in]typeType of the item.
-
-
-
See Also
_PCP_KEY_TYPES.
-
Returns
Returns 0 on success or 1 in case of errors. Check fatals_if_any().
- -
-
- -
-
- - - - - - - - -
int pcpvault_close (vault_tvault)
-
- -

Close a vault file.

-

If the vault is in unsafed state, write everything to disk and close the vault. Before overwriting the current vault file a backup will be made. If anything fails during writing the backup file will be retained and the error message will contain the filename of the backup file, so that the user doesn't loose data.

-
Parameters
- - -
[out]vaultThe vault object.
-
-
-
Returns
Returns 0. Check fatals_if_any() anyway.
- -
-
- -
-
- - - - - - - - -
int pcpvault_fetchall (vault_tvault)
-
- -

Reads in the vault contents.

-

This function reads the open vault contents and puts them into the apropriate hashes.

-
See Also
KEYHASH.
-

Currently only known types can be read. If your're saving unknown types to the vault, an error will occur.

-
See Also
_PCP_KEY_TYPES.
-

Each item will be converted put into the aproprieate structure, multibyte values will be converted to host endianess. It also calculates the checksum of the vault contents and compares it with the one stored in the vault header. If it doesn't match an error will be thrown.

-
Parameters
- - -
[out]vaultThe vault object.
-
-
-
Returns
Returns 0 on success or -1 in case of errors. Check fatals_if_any().
- -
-
- -
-
- - - - - - - - -
vault_t* pcpvault_init (char * filename)
-
- -

Open a vault file.

-

If the file doesn't exist, it will be created.

-
Parameters
- - -
[in]filenameThe filename of the vault file.
-
-
-
Returns
Returns a vault object.
- -
-
-
- - - - diff --git a/man/html/group__Z85.html b/man/html/group__Z85.html deleted file mode 100644 index 2b7d20b..0000000 --- a/man/html/group__Z85.html +++ /dev/null @@ -1,308 +0,0 @@ - - - - - -libpcp: Z85 - - - - - - -
-
- - - - - - -
-
libpcp -  0.2.1 -
-
-
- - - -
-
- -
-
Z85
-
-
- -

Z85 Encoding functions. -More...

- - - - - - - - - - - - - - - - - - - - -

-Functions

unsigned char * pcp_padfour (unsigned char *src, size_t srclen, size_t *dstlen)
 Zero-pad some input data.
 
size_t pcp_unpadfour (unsigned char *src, size_t srclen)
 Unpad padded input data.
 
unsigned char * pcp_z85_decode (char *z85block, size_t *dstlen)
 Decode data from Z85 encoding.
 
char * pcp_z85_encode (unsigned char *raw, size_t srclen, size_t *dstlen)
 Encode data to Z85 encoding.
 
char * pcp_readz85file (FILE *infile)
 Read a Z85 encoded file.
 
char * pcp_readz85string (unsigned char *input, size_t bufsize)
 Read a Z85 encoded string.
 
-

Detailed Description

-

Z85 Encoding functions.

-

The Z85 encoding format is described here: ZeroMQ Spec.32. It's part of ZeroMQ. Z85 is based on ASCII85 with a couple of modifications (portability, readability etc).

-

To fulfil the requirements of the ZeroMQ Z85 functions, PCP does some additional preparations of raw input before actually doing the encoding, since the input for zmq_z85_encode() must be divisible by 4. Therefore we pad the input with zeroes and remove them after decoding.

-

Function Documentation

- -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
unsigned char* pcp_padfour (unsigned char * src,
size_t srclen,
size_t * dstlen 
)
-
- -

Zero-pad some input data.

-

This function allocates new memory for the returned data. It puts the original pointer into it and adds a number of zeros so that the result has a size divisable by 4.

-
Parameters
- - - - -
[in]srcUnpadded data.
[in]srclenSize of unpadded data.
[in]dstlenReturned size of padded data (pointer to int).
-
-
-
Returns
Returns a pointer to the padded data.
- -
-
- -
-
- - - - - - - - -
char* pcp_readz85file (FILE * infile)
-
- -

Read a Z85 encoded file.

-

Reads a file and returns the raw Z85 encoded string. It ignores newlines, comments and Headerstrings.

-
Parameters
- - -
[in]infileFILE stream to read from.
-
-
-
Returns
Raw Z85 encoded string with comments, headers and newlines removed.
- -
-
- -
-
- - - - - - - - - - - - - - - - - - -
char* pcp_readz85string (unsigned char * input,
size_t bufsize 
)
-
- -

Read a Z85 encoded string.

-

Parses the given input string and returns the raw Z85 encoded string. It ignores newlines, comments and Headerstrings.

-
Parameters
- - - -
[in]inputZ85 encoded string.
[in]bufsizeSize of the string.
-
-
-
Returns
Raw Z85 encoded string with comments, headers and newlines removed.
- -
-
- -
-
- - - - - - - - - - - - - - - - - - -
size_t pcp_unpadfour (unsigned char * src,
size_t srclen 
)
-
- -

Unpad padded input data.

-

It just calculates the size of the unpadded result (size - all trailing zeroes). Doesn't allocate any memory or modify anything.

-
Parameters
- - - -
[in]srcPadded data.
[in]srclenSize of padded data.
-
-
-
Returns
Returns the unpadded size of the data.
- -
-
- -
-
- - - - - - - - - - - - - - - - - - -
unsigned char* pcp_z85_decode (char * z85block,
size_t * dstlen 
)
-
- -

Decode data from Z85 encoding.

-

The input z85block may contain newlines which will be removed.

-
Parameters
- - - -
[in]z85blockThe Z85 encoded string.
[in]dstlenReturned size of decoded data (pointer to int).
-
-
-
Returns
Returns a newly allocated pointer to the decoded data. If decoding failed, returns NULL. Check fatals_if_any().
- -
-
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
char* pcp_z85_encode (unsigned char * raw,
size_t srclen,
size_t * dstlen 
)
-
- -

Encode data to Z85 encoding.

-

Beside Z85 encoding it also adds a newline everiy 72 characters.

-
Parameters
- - - - -
[in]rawPointer to raw data.
[in]srclenSize of the data.
[in]dstlenReturned size of encoded data (pointer to int).
-
-
-
Returns
Returns a string (char array) containing the Z85 encoded data.
- -
-
-
- - - - diff --git a/man/html/index.html b/man/html/index.html deleted file mode 100644 index 960e9c1..0000000 --- a/man/html/index.html +++ /dev/null @@ -1,130 +0,0 @@ - - - - - -libpcp: Main Page - - - - - - -
-
- - - - - - -
-
libpcp -  0.2.1 -
-
-
- - - -
-
-
-
libpcp Documentation
-
-
-

-Introduction

-

This is the API documentation of libpcp, the library behind Pretty Curved Privacy (pcp). The library can be used independently of pcp to manage keys and to encrypt or sign files or buffers.

-

For most actual crypto related things, libpcp uses libsodium, the portable NaCL library.

-

-Sample usage

-

Example use of the libpcp library:

-
#include <pcp.h>
-
-
int main() {
-
Buffer *inbuf;
-
pcp_key_t *alice, *bob;
-
pcp_pubkey_t *alicepub, *bobpub, *pubhash;
-
Pcpstream *clear_in, *crypt_out, *clear_out;
-
char message[] = "hello world";
-
-
/* generate the keypairs for both */
-
alice = pcpkey_new();
-
bob = pcpkey_new();
-
-
/* get the public parts of them */
-
alicepub = pcpkey_pub_from_secret(alice);
-
bobpub = pcpkey_pub_from_secret(bob);
-
-
/* put the clear text message into the stream */
-
inbuf = buffer_new(32, "a");
-
buffer_add_str(inbuf, message);
-
clear_in = ps_new_inbuffer(inbuf);
-
-
/* create the output stream as buffer */
-
crypt_out = ps_new_outbuffer();
-
-
/* prepare the pubkey recipient list (only 1 recipient: Bob) */
-
pubhash = NULL;
-
strncpy(bobpub->id, pcp_getpubkeyid(bobpub), 17);
-
HASH_ADD_STR( pubhash, id, bobpub);
-
-
/* actually encrypt the message, don't sign it
-
Alice is the sender, Bob is the recipient */
-
pcp_encrypt_stream(clear_in, crypt_out, alice, pubhash, 0);
-
-
/* now, print the encrypted result */
-
fprintf(stderr, "Alice encrypted %ld bytes for Bob:\n", strlen(message));
-
buffer_dump(ps_buffer(crypt_out));
-
-
/* ---- encryption don, now decrypt ---- */
-
-
/* prepare the output buffer stream */
-
clear_out = ps_new_outbuffer();
-
-
/* in order for the decryptor find the senders public key,
-
we need to put it into the global hash. this step can be
-
omitted when using a Vault. */
- -
HASH_ADD_STR( pcppubkey_hash , id, alicepub);
-
-
/* try to decrypt the message */
-
if(pcp_decrypt_stream(crypt_out, clear_out, bob, NULL, 0) == 0)
- -
else {
-
/* and finally print out the decrypted message */
-
fprintf(stderr, "Bob decrypted %ld bytes from Alice:\n", buffer_size(ps_buffer(crypt_out)));
-
printf("Decrypted message: %s\n", buffer_get_str(ps_buffer(clear_out)));
-
}
-
-
ps_close(clear_in);
-
ps_close(crypt_out);
-
ps_close(clear_out);
-
-
free(alice);
-
free(alicepub);
-
free(bob);
-
free(bobpub);
-
-
return 0;
-
}
-

To compile the example, use the following commands:

-
g++ -c sample.o `pkg-config --cflags libpcp1`
-
g++ sample.o `pkg-config --libs libpcp1` -o sample
-
- - - - diff --git a/man/html/jquery.js b/man/html/jquery.js deleted file mode 100644 index 63939e7..0000000 --- a/man/html/jquery.js +++ /dev/null @@ -1,8 +0,0 @@ -/*! jQuery v1.7.1 jquery.com | jquery.org/license */ -(function(a,b){function cy(a){return f.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}function cv(a){if(!ck[a]){var b=c.body,d=f("<"+a+">").appendTo(b),e=d.css("display");d.remove();if(e==="none"||e===""){cl||(cl=c.createElement("iframe"),cl.frameBorder=cl.width=cl.height=0),b.appendChild(cl);if(!cm||!cl.createElement)cm=(cl.contentWindow||cl.contentDocument).document,cm.write((c.compatMode==="CSS1Compat"?"":"")+""),cm.close();d=cm.createElement(a),cm.body.appendChild(d),e=f.css(d,"display"),b.removeChild(cl)}ck[a]=e}return ck[a]}function cu(a,b){var c={};f.each(cq.concat.apply([],cq.slice(0,b)),function(){c[this]=a});return c}function ct(){cr=b}function cs(){setTimeout(ct,0);return cr=f.now()}function cj(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function ci(){try{return new a.XMLHttpRequest}catch(b){}}function cc(a,c){a.dataFilter&&(c=a.dataFilter(c,a.dataType));var d=a.dataTypes,e={},g,h,i=d.length,j,k=d[0],l,m,n,o,p;for(g=1;g0){if(c!=="border")for(;g=0===c})}function S(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function K(){return!0}function J(){return!1}function n(a,b,c){var d=b+"defer",e=b+"queue",g=b+"mark",h=f._data(a,d);h&&(c==="queue"||!f._data(a,e))&&(c==="mark"||!f._data(a,g))&&setTimeout(function(){!f._data(a,e)&&!f._data(a,g)&&(f.removeData(a,d,!0),h.fire())},0)}function m(a){for(var b in a){if(b==="data"&&f.isEmptyObject(a[b]))continue;if(b!=="toJSON")return!1}return!0}function l(a,c,d){if(d===b&&a.nodeType===1){var e="data-"+c.replace(k,"-$1").toLowerCase();d=a.getAttribute(e);if(typeof d=="string"){try{d=d==="true"?!0:d==="false"?!1:d==="null"?null:f.isNumeric(d)?parseFloat(d):j.test(d)?f.parseJSON(d):d}catch(g){}f.data(a,c,d)}else d=b}return d}function h(a){var b=g[a]={},c,d;a=a.split(/\s+/);for(c=0,d=a.length;c)[^>]*$|#([\w\-]*)$)/,j=/\S/,k=/^\s+/,l=/\s+$/,m=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,n=/^[\],:{}\s]*$/,o=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,p=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,q=/(?:^|:|,)(?:\s*\[)+/g,r=/(webkit)[ \/]([\w.]+)/,s=/(opera)(?:.*version)?[ \/]([\w.]+)/,t=/(msie) ([\w.]+)/,u=/(mozilla)(?:.*? rv:([\w.]+))?/,v=/-([a-z]|[0-9])/ig,w=/^-ms-/,x=function(a,b){return(b+"").toUpperCase()},y=d.userAgent,z,A,B,C=Object.prototype.toString,D=Object.prototype.hasOwnProperty,E=Array.prototype.push,F=Array.prototype.slice,G=String.prototype.trim,H=Array.prototype.indexOf,I={};e.fn=e.prototype={constructor:e,init:function(a,d,f){var g,h,j,k;if(!a)return this;if(a.nodeType){this.context=this[0]=a,this.length=1;return this}if(a==="body"&&!d&&c.body){this.context=c,this[0]=c.body,this.selector=a,this.length=1;return this}if(typeof a=="string"){a.charAt(0)!=="<"||a.charAt(a.length-1)!==">"||a.length<3?g=i.exec(a):g=[null,a,null];if(g&&(g[1]||!d)){if(g[1]){d=d instanceof e?d[0]:d,k=d?d.ownerDocument||d:c,j=m.exec(a),j?e.isPlainObject(d)?(a=[c.createElement(j[1])],e.fn.attr.call(a,d,!0)):a=[k.createElement(j[1])]:(j=e.buildFragment([g[1]],[k]),a=(j.cacheable?e.clone(j.fragment):j.fragment).childNodes);return e.merge(this,a)}h=c.getElementById(g[2]);if(h&&h.parentNode){if(h.id!==g[2])return f.find(a);this.length=1,this[0]=h}this.context=c,this.selector=a;return this}return!d||d.jquery?(d||f).find(a):this.constructor(d).find(a)}if(e.isFunction(a))return f.ready(a);a.selector!==b&&(this.selector=a.selector,this.context=a.context);return e.makeArray(a,this)},selector:"",jquery:"1.7.1",length:0,size:function(){return this.length},toArray:function(){return F.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this[this.length+a]:this[a]},pushStack:function(a,b,c){var d=this.constructor();e.isArray(a)?E.apply(d,a):e.merge(d,a),d.prevObject=this,d.context=this.context,b==="find"?d.selector=this.selector+(this.selector?" ":"")+c:b&&(d.selector=this.selector+"."+b+"("+c+")");return d},each:function(a,b){return e.each(this,a,b)},ready:function(a){e.bindReady(),A.add(a);return this},eq:function(a){a=+a;return a===-1?this.slice(a):this.slice(a,a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(F.apply(this,arguments),"slice",F.call(arguments).join(","))},map:function(a){return this.pushStack(e.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:E,sort:[].sort,splice:[].splice},e.fn.init.prototype=e.fn,e.extend=e.fn.extend=function(){var a,c,d,f,g,h,i=arguments[0]||{},j=1,k=arguments.length,l=!1;typeof i=="boolean"&&(l=i,i=arguments[1]||{},j=2),typeof i!="object"&&!e.isFunction(i)&&(i={}),k===j&&(i=this,--j);for(;j0)return;A.fireWith(c,[e]),e.fn.trigger&&e(c).trigger("ready").off("ready")}},bindReady:function(){if(!A){A=e.Callbacks("once memory");if(c.readyState==="complete")return setTimeout(e.ready,1);if(c.addEventListener)c.addEventListener("DOMContentLoaded",B,!1),a.addEventListener("load",e.ready,!1);else if(c.attachEvent){c.attachEvent("onreadystatechange",B),a.attachEvent("onload",e.ready);var b=!1;try{b=a.frameElement==null}catch(d){}c.documentElement.doScroll&&b&&J()}}},isFunction:function(a){return e.type(a)==="function"},isArray:Array.isArray||function(a){return e.type(a)==="array"},isWindow:function(a){return a&&typeof a=="object"&&"setInterval"in a},isNumeric:function(a){return!isNaN(parseFloat(a))&&isFinite(a)},type:function(a){return a==null?String(a):I[C.call(a)]||"object"},isPlainObject:function(a){if(!a||e.type(a)!=="object"||a.nodeType||e.isWindow(a))return!1;try{if(a.constructor&&!D.call(a,"constructor")&&!D.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}var d;for(d in a);return d===b||D.call(a,d)},isEmptyObject:function(a){for(var b in a)return!1;return!0},error:function(a){throw new Error(a)},parseJSON:function(b){if(typeof b!="string"||!b)return null;b=e.trim(b);if(a.JSON&&a.JSON.parse)return a.JSON.parse(b);if(n.test(b.replace(o,"@").replace(p,"]").replace(q,"")))return(new Function("return "+b))();e.error("Invalid JSON: "+b)},parseXML:function(c){var d,f;try{a.DOMParser?(f=new DOMParser,d=f.parseFromString(c,"text/xml")):(d=new ActiveXObject("Microsoft.XMLDOM"),d.async="false",d.loadXML(c))}catch(g){d=b}(!d||!d.documentElement||d.getElementsByTagName("parsererror").length)&&e.error("Invalid XML: "+c);return d},noop:function(){},globalEval:function(b){b&&j.test(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(w,"ms-").replace(v,x)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,c,d){var f,g=0,h=a.length,i=h===b||e.isFunction(a);if(d){if(i){for(f in a)if(c.apply(a[f],d)===!1)break}else for(;g0&&a[0]&&a[j-1]||j===0||e.isArray(a));if(k)for(;i1?i.call(arguments,0):b,j.notifyWith(k,e)}}function l(a){return function(c){b[a]=arguments.length>1?i.call(arguments,0):c,--g||j.resolveWith(j,b)}}var b=i.call(arguments,0),c=0,d=b.length,e=Array(d),g=d,h=d,j=d<=1&&a&&f.isFunction(a.promise)?a:f.Deferred(),k=j.promise();if(d>1){for(;c
a",d=q.getElementsByTagName("*"),e=q.getElementsByTagName("a")[0];if(!d||!d.length||!e)return{};g=c.createElement("select"),h=g.appendChild(c.createElement("option")),i=q.getElementsByTagName("input")[0],b={leadingWhitespace:q.firstChild.nodeType===3,tbody:!q.getElementsByTagName("tbody").length,htmlSerialize:!!q.getElementsByTagName("link").length,style:/top/.test(e.getAttribute("style")),hrefNormalized:e.getAttribute("href")==="/a",opacity:/^0.55/.test(e.style.opacity),cssFloat:!!e.style.cssFloat,checkOn:i.value==="on",optSelected:h.selected,getSetAttribute:q.className!=="t",enctype:!!c.createElement("form").enctype,html5Clone:c.createElement("nav").cloneNode(!0).outerHTML!=="<:nav>",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0},i.checked=!0,b.noCloneChecked=i.cloneNode(!0).checked,g.disabled=!0,b.optDisabled=!h.disabled;try{delete q.test}catch(s){b.deleteExpando=!1}!q.addEventListener&&q.attachEvent&&q.fireEvent&&(q.attachEvent("onclick",function(){b.noCloneEvent=!1}),q.cloneNode(!0).fireEvent("onclick")),i=c.createElement("input"),i.value="t",i.setAttribute("type","radio"),b.radioValue=i.value==="t",i.setAttribute("checked","checked"),q.appendChild(i),k=c.createDocumentFragment(),k.appendChild(q.lastChild),b.checkClone=k.cloneNode(!0).cloneNode(!0).lastChild.checked,b.appendChecked=i.checked,k.removeChild(i),k.appendChild(q),q.innerHTML="",a.getComputedStyle&&(j=c.createElement("div"),j.style.width="0",j.style.marginRight="0",q.style.width="2px",q.appendChild(j),b.reliableMarginRight=(parseInt((a.getComputedStyle(j,null)||{marginRight:0}).marginRight,10)||0)===0);if(q.attachEvent)for(o in{submit:1,change:1,focusin:1})n="on"+o,p=n in q,p||(q.setAttribute(n,"return;"),p=typeof q[n]=="function"),b[o+"Bubbles"]=p;k.removeChild(q),k=g=h=j=q=i=null,f(function(){var a,d,e,g,h,i,j,k,m,n,o,r=c.getElementsByTagName("body")[0];!r||(j=1,k="position:absolute;top:0;left:0;width:1px;height:1px;margin:0;",m="visibility:hidden;border:0;",n="style='"+k+"border:5px solid #000;padding:0;'",o="
"+""+"
",a=c.createElement("div"),a.style.cssText=m+"width:0;height:0;position:static;top:0;margin-top:"+j+"px",r.insertBefore(a,r.firstChild),q=c.createElement("div"),a.appendChild(q),q.innerHTML="
t
",l=q.getElementsByTagName("td"),p=l[0].offsetHeight===0,l[0].style.display="",l[1].style.display="none",b.reliableHiddenOffsets=p&&l[0].offsetHeight===0,q.innerHTML="",q.style.width=q.style.paddingLeft="1px",f.boxModel=b.boxModel=q.offsetWidth===2,typeof q.style.zoom!="undefined"&&(q.style.display="inline",q.style.zoom=1,b.inlineBlockNeedsLayout=q.offsetWidth===2,q.style.display="",q.innerHTML="
",b.shrinkWrapBlocks=q.offsetWidth!==2),q.style.cssText=k+m,q.innerHTML=o,d=q.firstChild,e=d.firstChild,h=d.nextSibling.firstChild.firstChild,i={doesNotAddBorder:e.offsetTop!==5,doesAddBorderForTableAndCells:h.offsetTop===5},e.style.position="fixed",e.style.top="20px",i.fixedPosition=e.offsetTop===20||e.offsetTop===15,e.style.position=e.style.top="",d.style.overflow="hidden",d.style.position="relative",i.subtractsBorderForOverflowNotVisible=e.offsetTop===-5,i.doesNotIncludeMarginInBodyOffset=r.offsetTop!==j,r.removeChild(a),q=a=null,f.extend(b,i))});return b}();var j=/^(?:\{.*\}|\[.*\])$/,k=/([A-Z])/g;f.extend({cache:{},uuid:0,expando:"jQuery"+(f.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){a=a.nodeType?f.cache[a[f.expando]]:a[f.expando];return!!a&&!m(a)},data:function(a,c,d,e){if(!!f.acceptData(a)){var g,h,i,j=f.expando,k=typeof c=="string",l=a.nodeType,m=l?f.cache:a,n=l?a[j]:a[j]&&j,o=c==="events";if((!n||!m[n]||!o&&!e&&!m[n].data)&&k&&d===b)return;n||(l?a[j]=n=++f.uuid:n=j),m[n]||(m[n]={},l||(m[n].toJSON=f.noop));if(typeof c=="object"||typeof c=="function")e?m[n]=f.extend(m[n],c):m[n].data=f.extend(m[n].data,c);g=h=m[n],e||(h.data||(h.data={}),h=h.data),d!==b&&(h[f.camelCase(c)]=d);if(o&&!h[c])return g.events;k?(i=h[c],i==null&&(i=h[f.camelCase(c)])):i=h;return i}},removeData:function(a,b,c){if(!!f.acceptData(a)){var d,e,g,h=f.expando,i=a.nodeType,j=i?f.cache:a,k=i?a[h]:h;if(!j[k])return;if(b){d=c?j[k]:j[k].data;if(d){f.isArray(b)||(b in d?b=[b]:(b=f.camelCase(b),b in d?b=[b]:b=b.split(" ")));for(e=0,g=b.length;e-1)return!0;return!1},val:function(a){var c,d,e,g=this[0];{if(!!arguments.length){e=f.isFunction(a);return this.each(function(d){var g=f(this),h;if(this.nodeType===1){e?h=a.call(this,d,g.val()):h=a,h==null?h="":typeof h=="number"?h+="":f.isArray(h)&&(h=f.map(h,function(a){return a==null?"":a+""})),c=f.valHooks[this.nodeName.toLowerCase()]||f.valHooks[this.type];if(!c||!("set"in c)||c.set(this,h,"value")===b)this.value=h}})}if(g){c=f.valHooks[g.nodeName.toLowerCase()]||f.valHooks[g.type];if(c&&"get"in c&&(d=c.get(g,"value"))!==b)return d;d=g.value;return typeof d=="string"?d.replace(q,""):d==null?"":d}}}}),f.extend({valHooks:{option:{get:function(a){var b=a.attributes.value;return!b||b.specified?a.value:a.text}},select:{get:function(a){var b,c,d,e,g=a.selectedIndex,h=[],i=a.options,j=a.type==="select-one";if(g<0)return null;c=j?g:0,d=j?g+1:i.length;for(;c=0}),c.length||(a.selectedIndex=-1);return c}}},attrFn:{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0},attr:function(a,c,d,e){var g,h,i,j=a.nodeType;if(!!a&&j!==3&&j!==8&&j!==2){if(e&&c in f.attrFn)return f(a)[c](d);if(typeof a.getAttribute=="undefined")return f.prop(a,c,d);i=j!==1||!f.isXMLDoc(a),i&&(c=c.toLowerCase(),h=f.attrHooks[c]||(u.test(c)?x:w));if(d!==b){if(d===null){f.removeAttr(a,c);return}if(h&&"set"in h&&i&&(g=h.set(a,d,c))!==b)return g;a.setAttribute(c,""+d);return d}if(h&&"get"in h&&i&&(g=h.get(a,c))!==null)return g;g=a.getAttribute(c);return g===null?b:g}},removeAttr:function(a,b){var c,d,e,g,h=0;if(b&&a.nodeType===1){d=b.toLowerCase().split(p),g=d.length;for(;h=0}})});var z=/^(?:textarea|input|select)$/i,A=/^([^\.]*)?(?:\.(.+))?$/,B=/\bhover(\.\S+)?\b/,C=/^key/,D=/^(?:mouse|contextmenu)|click/,E=/^(?:focusinfocus|focusoutblur)$/,F=/^(\w*)(?:#([\w\-]+))?(?:\.([\w\-]+))?$/,G=function(a){var b=F.exec(a);b&&(b[1]=(b[1]||"").toLowerCase(),b[3]=b[3]&&new RegExp("(?:^|\\s)"+b[3]+"(?:\\s|$)"));return b},H=function(a,b){var c=a.attributes||{};return(!b[1]||a.nodeName.toLowerCase()===b[1])&&(!b[2]||(c.id||{}).value===b[2])&&(!b[3]||b[3].test((c["class"]||{}).value))},I=function(a){return f.event.special.hover?a:a.replace(B,"mouseenter$1 mouseleave$1")}; -f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3||a.nodeType===8||!c||!d||!(h=f._data(a)))){d.handler&&(p=d,d=p.handler),d.guid||(d.guid=f.guid++),j=h.events,j||(h.events=j={}),i=h.handle,i||(h.handle=i=function(a){return typeof f!="undefined"&&(!a||f.event.triggered!==a.type)?f.event.dispatch.apply(i.elem,arguments):b},i.elem=a),c=f.trim(I(c)).split(" ");for(k=0;k=0&&(h=h.slice(0,-1),k=!0),h.indexOf(".")>=0&&(i=h.split("."),h=i.shift(),i.sort());if((!e||f.event.customEvent[h])&&!f.event.global[h])return;c=typeof c=="object"?c[f.expando]?c:new f.Event(h,c):new f.Event(h),c.type=h,c.isTrigger=!0,c.exclusive=k,c.namespace=i.join("."),c.namespace_re=c.namespace?new RegExp("(^|\\.)"+i.join("\\.(?:.*\\.)?")+"(\\.|$)"):null,o=h.indexOf(":")<0?"on"+h:"";if(!e){j=f.cache;for(l in j)j[l].events&&j[l].events[h]&&f.event.trigger(c,d,j[l].handle.elem,!0);return}c.result=b,c.target||(c.target=e),d=d!=null?f.makeArray(d):[],d.unshift(c),p=f.event.special[h]||{};if(p.trigger&&p.trigger.apply(e,d)===!1)return;r=[[e,p.bindType||h]];if(!g&&!p.noBubble&&!f.isWindow(e)){s=p.delegateType||h,m=E.test(s+h)?e:e.parentNode,n=null;for(;m;m=m.parentNode)r.push([m,s]),n=m;n&&n===e.ownerDocument&&r.push([n.defaultView||n.parentWindow||a,s])}for(l=0;le&&i.push({elem:this,matches:d.slice(e)});for(j=0;j0?this.on(b,null,a,c):this.trigger(b)},f.attrFn&&(f.attrFn[b]=!0),C.test(b)&&(f.event.fixHooks[b]=f.event.keyHooks),D.test(b)&&(f.event.fixHooks[b]=f.event.mouseHooks)}),function(){function x(a,b,c,e,f,g){for(var h=0,i=e.length;h0){k=j;break}}j=j[a]}e[h]=k}}}function w(a,b,c,e,f,g){for(var h=0,i=e.length;h+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,d="sizcache"+(Math.random()+"").replace(".",""),e=0,g=Object.prototype.toString,h=!1,i=!0,j=/\\/g,k=/\r\n/g,l=/\W/;[0,0].sort(function(){i=!1;return 0});var m=function(b,d,e,f){e=e||[],d=d||c;var h=d;if(d.nodeType!==1&&d.nodeType!==9)return[];if(!b||typeof b!="string")return e;var i,j,k,l,n,q,r,t,u=!0,v=m.isXML(d),w=[],x=b;do{a.exec(""),i=a.exec(x);if(i){x=i[3],w.push(i[1]);if(i[2]){l=i[3];break}}}while(i);if(w.length>1&&p.exec(b))if(w.length===2&&o.relative[w[0]])j=y(w[0]+w[1],d,f);else{j=o.relative[w[0]]?[d]:m(w.shift(),d);while(w.length)b=w.shift(),o.relative[b]&&(b+=w.shift()),j=y(b,j,f)}else{!f&&w.length>1&&d.nodeType===9&&!v&&o.match.ID.test(w[0])&&!o.match.ID.test(w[w.length-1])&&(n=m.find(w.shift(),d,v),d=n.expr?m.filter(n.expr,n.set)[0]:n.set[0]);if(d){n=f?{expr:w.pop(),set:s(f)}:m.find(w.pop(),w.length===1&&(w[0]==="~"||w[0]==="+")&&d.parentNode?d.parentNode:d,v),j=n.expr?m.filter(n.expr,n.set):n.set,w.length>0?k=s(j):u=!1;while(w.length)q=w.pop(),r=q,o.relative[q]?r=w.pop():q="",r==null&&(r=d),o.relative[q](k,r,v)}else k=w=[]}k||(k=j),k||m.error(q||b);if(g.call(k)==="[object Array]")if(!u)e.push.apply(e,k);else if(d&&d.nodeType===1)for(t=0;k[t]!=null;t++)k[t]&&(k[t]===!0||k[t].nodeType===1&&m.contains(d,k[t]))&&e.push(j[t]);else for(t=0;k[t]!=null;t++)k[t]&&k[t].nodeType===1&&e.push(j[t]);else s(k,e);l&&(m(l,h,e,f),m.uniqueSort(e));return e};m.uniqueSort=function(a){if(u){h=i,a.sort(u);if(h)for(var b=1;b0},m.find=function(a,b,c){var d,e,f,g,h,i;if(!a)return[];for(e=0,f=o.order.length;e":function(a,b){var c,d=typeof b=="string",e=0,f=a.length;if(d&&!l.test(b)){b=b.toLowerCase();for(;e=0)?c||d.push(h):c&&(b[g]=!1));return!1},ID:function(a){return a[1].replace(j,"")},TAG:function(a,b){return a[1].replace(j,"").toLowerCase()},CHILD:function(a){if(a[1]==="nth"){a[2]||m.error(a[0]),a[2]=a[2].replace(/^\+|\s*/g,"");var b=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(a[2]==="even"&&"2n"||a[2]==="odd"&&"2n+1"||!/\D/.test(a[2])&&"0n+"+a[2]||a[2]);a[2]=b[1]+(b[2]||1)-0,a[3]=b[3]-0}else a[2]&&m.error(a[0]);a[0]=e++;return a},ATTR:function(a,b,c,d,e,f){var g=a[1]=a[1].replace(j,"");!f&&o.attrMap[g]&&(a[1]=o.attrMap[g]),a[4]=(a[4]||a[5]||"").replace(j,""),a[2]==="~="&&(a[4]=" "+a[4]+" ");return a},PSEUDO:function(b,c,d,e,f){if(b[1]==="not")if((a.exec(b[3])||"").length>1||/^\w/.test(b[3]))b[3]=m(b[3],null,null,c);else{var g=m.filter(b[3],c,d,!0^f);d||e.push.apply(e,g);return!1}else if(o.match.POS.test(b[0])||o.match.CHILD.test(b[0]))return!0;return b},POS:function(a){a.unshift(!0);return a}},filters:{enabled:function(a){return a.disabled===!1&&a.type!=="hidden"},disabled:function(a){return a.disabled===!0},checked:function(a){return a.checked===!0},selected:function(a){a.parentNode&&a.parentNode.selectedIndex;return a.selected===!0},parent:function(a){return!!a.firstChild},empty:function(a){return!a.firstChild},has:function(a,b,c){return!!m(c[3],a).length},header:function(a){return/h\d/i.test(a.nodeName)},text:function(a){var b=a.getAttribute("type"),c=a.type;return a.nodeName.toLowerCase()==="input"&&"text"===c&&(b===c||b===null)},radio:function(a){return a.nodeName.toLowerCase()==="input"&&"radio"===a.type},checkbox:function(a){return a.nodeName.toLowerCase()==="input"&&"checkbox"===a.type},file:function(a){return a.nodeName.toLowerCase()==="input"&&"file"===a.type},password:function(a){return a.nodeName.toLowerCase()==="input"&&"password"===a.type},submit:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"submit"===a.type},image:function(a){return a.nodeName.toLowerCase()==="input"&&"image"===a.type},reset:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"reset"===a.type},button:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&"button"===a.type||b==="button"},input:function(a){return/input|select|textarea|button/i.test(a.nodeName)},focus:function(a){return a===a.ownerDocument.activeElement}},setFilters:{first:function(a,b){return b===0},last:function(a,b,c,d){return b===d.length-1},even:function(a,b){return b%2===0},odd:function(a,b){return b%2===1},lt:function(a,b,c){return bc[3]-0},nth:function(a,b,c){return c[3]-0===b},eq:function(a,b,c){return c[3]-0===b}},filter:{PSEUDO:function(a,b,c,d){var e=b[1],f=o.filters[e];if(f)return f(a,c,b,d);if(e==="contains")return(a.textContent||a.innerText||n([a])||"").indexOf(b[3])>=0;if(e==="not"){var g=b[3];for(var h=0,i=g.length;h=0}},ID:function(a,b){return a.nodeType===1&&a.getAttribute("id")===b},TAG:function(a,b){return b==="*"&&a.nodeType===1||!!a.nodeName&&a.nodeName.toLowerCase()===b},CLASS:function(a,b){return(" "+(a.className||a.getAttribute("class"))+" ").indexOf(b)>-1},ATTR:function(a,b){var c=b[1],d=m.attr?m.attr(a,c):o.attrHandle[c]?o.attrHandle[c](a):a[c]!=null?a[c]:a.getAttribute(c),e=d+"",f=b[2],g=b[4];return d==null?f==="!=":!f&&m.attr?d!=null:f==="="?e===g:f==="*="?e.indexOf(g)>=0:f==="~="?(" "+e+" ").indexOf(g)>=0:g?f==="!="?e!==g:f==="^="?e.indexOf(g)===0:f==="$="?e.substr(e.length-g.length)===g:f==="|="?e===g||e.substr(0,g.length+1)===g+"-":!1:e&&d!==!1},POS:function(a,b,c,d){var e=b[2],f=o.setFilters[e];if(f)return f(a,c,b,d)}}},p=o.match.POS,q=function(a,b){return"\\"+(b-0+1)};for(var r in o.match)o.match[r]=new RegExp(o.match[r].source+/(?![^\[]*\])(?![^\(]*\))/.source),o.leftMatch[r]=new RegExp(/(^(?:.|\r|\n)*?)/.source+o.match[r].source.replace(/\\(\d+)/g,q));var s=function(a,b){a=Array.prototype.slice.call(a,0);if(b){b.push.apply(b,a);return b}return a};try{Array.prototype.slice.call(c.documentElement.childNodes,0)[0].nodeType}catch(t){s=function(a,b){var c=0,d=b||[];if(g.call(a)==="[object Array]")Array.prototype.push.apply(d,a);else if(typeof a.length=="number")for(var e=a.length;c",e.insertBefore(a,e.firstChild),c.getElementById(d)&&(o.find.ID=function(a,c,d){if(typeof c.getElementById!="undefined"&&!d){var e=c.getElementById(a[1]);return e?e.id===a[1]||typeof e.getAttributeNode!="undefined"&&e.getAttributeNode("id").nodeValue===a[1]?[e]:b:[]}},o.filter.ID=function(a,b){var c=typeof a.getAttributeNode!="undefined"&&a.getAttributeNode("id");return a.nodeType===1&&c&&c.nodeValue===b}),e.removeChild(a),e=a=null}(),function(){var a=c.createElement("div");a.appendChild(c.createComment("")),a.getElementsByTagName("*").length>0&&(o.find.TAG=function(a,b){var c=b.getElementsByTagName(a[1]);if(a[1]==="*"){var d=[];for(var e=0;c[e];e++)c[e].nodeType===1&&d.push(c[e]);c=d}return c}),a.innerHTML="",a.firstChild&&typeof a.firstChild.getAttribute!="undefined"&&a.firstChild.getAttribute("href")!=="#"&&(o.attrHandle.href=function(a){return a.getAttribute("href",2)}),a=null}(),c.querySelectorAll&&function(){var a=m,b=c.createElement("div"),d="__sizzle__";b.innerHTML="

";if(!b.querySelectorAll||b.querySelectorAll(".TEST").length!==0){m=function(b,e,f,g){e=e||c;if(!g&&!m.isXML(e)){var h=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b);if(h&&(e.nodeType===1||e.nodeType===9)){if(h[1])return s(e.getElementsByTagName(b),f);if(h[2]&&o.find.CLASS&&e.getElementsByClassName)return s(e.getElementsByClassName(h[2]),f)}if(e.nodeType===9){if(b==="body"&&e.body)return s([e.body],f);if(h&&h[3]){var i=e.getElementById(h[3]);if(!i||!i.parentNode)return s([],f);if(i.id===h[3])return s([i],f)}try{return s(e.querySelectorAll(b),f)}catch(j){}}else if(e.nodeType===1&&e.nodeName.toLowerCase()!=="object"){var k=e,l=e.getAttribute("id"),n=l||d,p=e.parentNode,q=/^\s*[+~]/.test(b);l?n=n.replace(/'/g,"\\$&"):e.setAttribute("id",n),q&&p&&(e=e.parentNode);try{if(!q||p)return s(e.querySelectorAll("[id='"+n+"'] "+b),f)}catch(r){}finally{l||k.removeAttribute("id")}}}return a(b,e,f,g)};for(var e in a)m[e]=a[e];b=null}}(),function(){var a=c.documentElement,b=a.matchesSelector||a.mozMatchesSelector||a.webkitMatchesSelector||a.msMatchesSelector;if(b){var d=!b.call(c.createElement("div"),"div"),e=!1;try{b.call(c.documentElement,"[test!='']:sizzle")}catch(f){e=!0}m.matchesSelector=function(a,c){c=c.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!m.isXML(a))try{if(e||!o.match.PSEUDO.test(c)&&!/!=/.test(c)){var f=b.call(a,c);if(f||!d||a.document&&a.document.nodeType!==11)return f}}catch(g){}return m(c,null,null,[a]).length>0}}}(),function(){var a=c.createElement("div");a.innerHTML="
";if(!!a.getElementsByClassName&&a.getElementsByClassName("e").length!==0){a.lastChild.className="e";if(a.getElementsByClassName("e").length===1)return;o.order.splice(1,0,"CLASS"),o.find.CLASS=function(a,b,c){if(typeof b.getElementsByClassName!="undefined"&&!c)return b.getElementsByClassName(a[1])},a=null}}(),c.documentElement.contains?m.contains=function(a,b){return a!==b&&(a.contains?a.contains(b):!0)}:c.documentElement.compareDocumentPosition?m.contains=function(a,b){return!!(a.compareDocumentPosition(b)&16)}:m.contains=function(){return!1},m.isXML=function(a){var b=(a?a.ownerDocument||a:0).documentElement;return b?b.nodeName!=="HTML":!1};var y=function(a,b,c){var d,e=[],f="",g=b.nodeType?[b]:b;while(d=o.match.PSEUDO.exec(a))f+=d[0],a=a.replace(o.match.PSEUDO,"");a=o.relative[a]?a+"*":a;for(var h=0,i=g.length;h0)for(h=g;h=0:f.filter(a,this).length>0:this.filter(a).length>0)},closest:function(a,b){var c=[],d,e,g=this[0];if(f.isArray(a)){var h=1;while(g&&g.ownerDocument&&g!==b){for(d=0;d-1:f.find.matchesSelector(g,a)){c.push(g);break}g=g.parentNode;if(!g||!g.ownerDocument||g===b||g.nodeType===11)break}}c=c.length>1?f.unique(c):c;return this.pushStack(c,"closest",a)},index:function(a){if(!a)return this[0]&&this[0].parentNode?this.prevAll().length:-1;if(typeof a=="string")return f.inArray(this[0],f(a));return f.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var c=typeof a=="string"?f(a,b):f.makeArray(a&&a.nodeType?[a]:a),d=f.merge(this.get(),c);return this.pushStack(S(c[0])||S(d[0])?d:f.unique(d))},andSelf:function(){return this.add(this.prevObject)}}),f.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return f.dir(a,"parentNode")},parentsUntil:function(a,b,c){return f.dir(a,"parentNode",c)},next:function(a){return f.nth(a,2,"nextSibling")},prev:function(a){return f.nth(a,2,"previousSibling")},nextAll:function(a){return f.dir(a,"nextSibling")},prevAll:function(a){return f.dir(a,"previousSibling")},nextUntil:function(a,b,c){return f.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return f.dir(a,"previousSibling",c)},siblings:function(a){return f.sibling(a.parentNode.firstChild,a)},children:function(a){return f.sibling(a.firstChild)},contents:function(a){return f.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:f.makeArray(a.childNodes)}},function(a,b){f.fn[a]=function(c,d){var e=f.map(this,b,c);L.test(a)||(d=c),d&&typeof d=="string"&&(e=f.filter(d,e)),e=this.length>1&&!R[a]?f.unique(e):e,(this.length>1||N.test(d))&&M.test(a)&&(e=e.reverse());return this.pushStack(e,a,P.call(arguments).join(","))}}),f.extend({filter:function(a,b,c){c&&(a=":not("+a+")");return b.length===1?f.find.matchesSelector(b[0],a)?[b[0]]:[]:f.find.matches(a,b)},dir:function(a,c,d){var e=[],g=a[c];while(g&&g.nodeType!==9&&(d===b||g.nodeType!==1||!f(g).is(d)))g.nodeType===1&&e.push(g),g=g[c];return e},nth:function(a,b,c,d){b=b||1;var e=0;for(;a;a=a[c])if(a.nodeType===1&&++e===b)break;return a},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling)a.nodeType===1&&a!==b&&c.push(a);return c}});var V="abbr|article|aside|audio|canvas|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",W=/ jQuery\d+="(?:\d+|null)"/g,X=/^\s+/,Y=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,Z=/<([\w:]+)/,$=/",""],legend:[1,"
","
"],thead:[1,"","
"],tr:[2,"","
"],td:[3,"","
"],col:[2,"","
"],area:[1,"",""],_default:[0,"",""]},bh=U(c);bg.optgroup=bg.option,bg.tbody=bg.tfoot=bg.colgroup=bg.caption=bg.thead,bg.th=bg.td,f.support.htmlSerialize||(bg._default=[1,"div
","
"]),f.fn.extend({text:function(a){if(f.isFunction(a))return this.each(function(b){var c=f(this);c.text(a.call(this,b,c.text()))});if(typeof a!="object"&&a!==b)return this.empty().append((this[0]&&this[0].ownerDocument||c).createTextNode(a));return f.text(this)},wrapAll:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapAll(a.call(this,b))});if(this[0]){var b=f(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&a.firstChild.nodeType===1)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapInner(a.call(this,b))});return this.each(function(){var b=f(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=f.isFunction(a);return this.each(function(c){f(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){f.nodeName(this,"body")||f(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=f.clean(arguments);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,f.clean(arguments));return a}},remove:function(a,b){for(var c=0,d;(d=this[c])!=null;c++)if(!a||f.filter(a,[d]).length)!b&&d.nodeType===1&&(f.cleanData(d.getElementsByTagName("*")), -f.cleanData([d])),d.parentNode&&d.parentNode.removeChild(d);return this},empty:function() -{for(var a=0,b;(b=this[a])!=null;a++){b.nodeType===1&&f.cleanData(b.getElementsByTagName("*"));while(b.firstChild)b.removeChild(b.firstChild)}return this},clone:function(a,b){a=a==null?!1:a,b=b==null?a:b;return this.map(function(){return f.clone(this,a,b)})},html:function(a){if(a===b)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(W,""):null;if(typeof a=="string"&&!ba.test(a)&&(f.support.leadingWhitespace||!X.test(a))&&!bg[(Z.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Y,"<$1>");try{for(var c=0,d=this.length;c1&&l0?this.clone(!0):this).get();f(e[h])[b](j),d=d.concat(j)}return this.pushStack(d,a,e.selector)}}),f.extend({clone:function(a,b,c){var d,e,g,h=f.support.html5Clone||!bc.test("<"+a.nodeName)?a.cloneNode(!0):bo(a);if((!f.support.noCloneEvent||!f.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!f.isXMLDoc(a)){bk(a,h),d=bl(a),e=bl(h);for(g=0;d[g];++g)e[g]&&bk(d[g],e[g])}if(b){bj(a,h);if(c){d=bl(a),e=bl(h);for(g=0;d[g];++g)bj(d[g],e[g])}}d=e=null;return h},clean:function(a,b,d,e){var g;b=b||c,typeof b.createElement=="undefined"&&(b=b.ownerDocument||b[0]&&b[0].ownerDocument||c);var h=[],i;for(var j=0,k;(k=a[j])!=null;j++){typeof k=="number"&&(k+="");if(!k)continue;if(typeof k=="string")if(!_.test(k))k=b.createTextNode(k);else{k=k.replace(Y,"<$1>");var l=(Z.exec(k)||["",""])[1].toLowerCase(),m=bg[l]||bg._default,n=m[0],o=b.createElement("div");b===c?bh.appendChild(o):U(b).appendChild(o),o.innerHTML=m[1]+k+m[2];while(n--)o=o.lastChild;if(!f.support.tbody){var p=$.test(k),q=l==="table"&&!p?o.firstChild&&o.firstChild.childNodes:m[1]===""&&!p?o.childNodes:[];for(i=q.length-1;i>=0;--i)f.nodeName(q[i],"tbody")&&!q[i].childNodes.length&&q[i].parentNode.removeChild(q[i])}!f.support.leadingWhitespace&&X.test(k)&&o.insertBefore(b.createTextNode(X.exec(k)[0]),o.firstChild),k=o.childNodes}var r;if(!f.support.appendChecked)if(k[0]&&typeof (r=k.length)=="number")for(i=0;i=0)return b+"px"}}}),f.support.opacity||(f.cssHooks.opacity={get:function(a,b){return br.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=f.isNumeric(b)?"alpha(opacity="+b*100+")":"",g=d&&d.filter||c.filter||"";c.zoom=1;if(b>=1&&f.trim(g.replace(bq,""))===""){c.removeAttribute("filter");if(d&&!d.filter)return}c.filter=bq.test(g)?g.replace(bq,e):g+" "+e}}),f(function(){f.support.reliableMarginRight||(f.cssHooks.marginRight={get:function(a,b){var c;f.swap(a,{display:"inline-block"},function(){b?c=bz(a,"margin-right","marginRight"):c=a.style.marginRight});return c}})}),c.defaultView&&c.defaultView.getComputedStyle&&(bA=function(a,b){var c,d,e;b=b.replace(bs,"-$1").toLowerCase(),(d=a.ownerDocument.defaultView)&&(e=d.getComputedStyle(a,null))&&(c=e.getPropertyValue(b),c===""&&!f.contains(a.ownerDocument.documentElement,a)&&(c=f.style(a,b)));return c}),c.documentElement.currentStyle&&(bB=function(a,b){var c,d,e,f=a.currentStyle&&a.currentStyle[b],g=a.style;f===null&&g&&(e=g[b])&&(f=e),!bt.test(f)&&bu.test(f)&&(c=g.left,d=a.runtimeStyle&&a.runtimeStyle.left,d&&(a.runtimeStyle.left=a.currentStyle.left),g.left=b==="fontSize"?"1em":f||0,f=g.pixelLeft+"px",g.left=c,d&&(a.runtimeStyle.left=d));return f===""?"auto":f}),bz=bA||bB,f.expr&&f.expr.filters&&(f.expr.filters.hidden=function(a){var b=a.offsetWidth,c=a.offsetHeight;return b===0&&c===0||!f.support.reliableHiddenOffsets&&(a.style&&a.style.display||f.css(a,"display"))==="none"},f.expr.filters.visible=function(a){return!f.expr.filters.hidden(a)});var bD=/%20/g,bE=/\[\]$/,bF=/\r?\n/g,bG=/#.*$/,bH=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,bI=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,bJ=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,bK=/^(?:GET|HEAD)$/,bL=/^\/\//,bM=/\?/,bN=/)<[^<]*)*<\/script>/gi,bO=/^(?:select|textarea)/i,bP=/\s+/,bQ=/([?&])_=[^&]*/,bR=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,bS=f.fn.load,bT={},bU={},bV,bW,bX=["*/"]+["*"];try{bV=e.href}catch(bY){bV=c.createElement("a"),bV.href="",bV=bV.href}bW=bR.exec(bV.toLowerCase())||[],f.fn.extend({load:function(a,c,d){if(typeof a!="string"&&bS)return bS.apply(this,arguments);if(!this.length)return this;var e=a.indexOf(" ");if(e>=0){var g=a.slice(e,a.length);a=a.slice(0,e)}var h="GET";c&&(f.isFunction(c)?(d=c,c=b):typeof c=="object"&&(c=f.param(c,f.ajaxSettings.traditional),h="POST"));var i=this;f.ajax({url:a,type:h,dataType:"html",data:c,complete:function(a,b,c){c=a.responseText,a.isResolved()&&(a.done(function(a){c=a}),i.html(g?f("
").append(c.replace(bN,"")).find(g):c)),d&&i.each(d,[c,b,a])}});return this},serialize:function(){return f.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?f.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||bO.test(this.nodeName)||bI.test(this.type))}).map(function(a,b){var c=f(this).val();return c==null?null:f.isArray(c)?f.map(c,function(a,c){return{name:b.name,value:a.replace(bF,"\r\n")}}):{name:b.name,value:c.replace(bF,"\r\n")}}).get()}}),f.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){f.fn[b]=function(a){return this.on(b,a)}}),f.each(["get","post"],function(a,c){f[c]=function(a,d,e,g){f.isFunction(d)&&(g=g||e,e=d,d=b);return f.ajax({type:c,url:a,data:d,success:e,dataType:g})}}),f.extend({getScript:function(a,c){return f.get(a,b,c,"script")},getJSON:function(a,b,c){return f.get(a,b,c,"json")},ajaxSetup:function(a,b){b?b_(a,f.ajaxSettings):(b=a,a=f.ajaxSettings),b_(a,b);return a},ajaxSettings:{url:bV,isLocal:bJ.test(bW[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":bX},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":f.parseJSON,"text xml":f.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:bZ(bT),ajaxTransport:bZ(bU),ajax:function(a,c){function w(a,c,l,m){if(s!==2){s=2,q&&clearTimeout(q),p=b,n=m||"",v.readyState=a>0?4:0;var o,r,u,w=c,x=l?cb(d,v,l):b,y,z;if(a>=200&&a<300||a===304){if(d.ifModified){if(y=v.getResponseHeader("Last-Modified"))f.lastModified[k]=y;if(z=v.getResponseHeader("Etag"))f.etag[k]=z}if(a===304)w="notmodified",o=!0;else try{r=cc(d,x),w="success",o=!0}catch(A){w="parsererror",u=A}}else{u=w;if(!w||a)w="error",a<0&&(a=0)}v.status=a,v.statusText=""+(c||w),o?h.resolveWith(e,[r,w,v]):h.rejectWith(e,[v,w,u]),v.statusCode(j),j=b,t&&g.trigger("ajax"+(o?"Success":"Error"),[v,d,o?r:u]),i.fireWith(e,[v,w]),t&&(g.trigger("ajaxComplete",[v,d]),--f.active||f.event.trigger("ajaxStop"))}}typeof a=="object"&&(c=a,a=b),c=c||{};var d=f.ajaxSetup({},c),e=d.context||d,g=e!==d&&(e.nodeType||e instanceof f)?f(e):f.event,h=f.Deferred(),i=f.Callbacks("once memory"),j=d.statusCode||{},k,l={},m={},n,o,p,q,r,s=0,t,u,v={readyState:0,setRequestHeader:function(a,b){if(!s){var c=a.toLowerCase();a=m[c]=m[c]||a,l[a]=b}return this},getAllResponseHeaders:function(){return s===2?n:null},getResponseHeader:function(a){var c;if(s===2){if(!o){o={};while(c=bH.exec(n))o[c[1].toLowerCase()]=c[2]}c=o[a.toLowerCase()]}return c===b?null:c},overrideMimeType:function(a){s||(d.mimeType=a);return this},abort:function(a){a=a||"abort",p&&p.abort(a),w(0,a);return this}};h.promise(v),v.success=v.done,v.error=v.fail,v.complete=i.add,v.statusCode=function(a){if(a){var b;if(s<2)for(b in a)j[b]=[j[b],a[b]];else b=a[v.status],v.then(b,b)}return this},d.url=((a||d.url)+"").replace(bG,"").replace(bL,bW[1]+"//"),d.dataTypes=f.trim(d.dataType||"*").toLowerCase().split(bP),d.crossDomain==null&&(r=bR.exec(d.url.toLowerCase()),d.crossDomain=!(!r||r[1]==bW[1]&&r[2]==bW[2]&&(r[3]||(r[1]==="http:"?80:443))==(bW[3]||(bW[1]==="http:"?80:443)))),d.data&&d.processData&&typeof d.data!="string"&&(d.data=f.param(d.data,d.traditional)),b$(bT,d,c,v);if(s===2)return!1;t=d.global,d.type=d.type.toUpperCase(),d.hasContent=!bK.test(d.type),t&&f.active++===0&&f.event.trigger("ajaxStart");if(!d.hasContent){d.data&&(d.url+=(bM.test(d.url)?"&":"?")+d.data,delete d.data),k=d.url;if(d.cache===!1){var x=f.now(),y=d.url.replace(bQ,"$1_="+x);d.url=y+(y===d.url?(bM.test(d.url)?"&":"?")+"_="+x:"")}}(d.data&&d.hasContent&&d.contentType!==!1||c.contentType)&&v.setRequestHeader("Content-Type",d.contentType),d.ifModified&&(k=k||d.url,f.lastModified[k]&&v.setRequestHeader("If-Modified-Since",f.lastModified[k]),f.etag[k]&&v.setRequestHeader("If-None-Match",f.etag[k])),v.setRequestHeader("Accept",d.dataTypes[0]&&d.accepts[d.dataTypes[0]]?d.accepts[d.dataTypes[0]]+(d.dataTypes[0]!=="*"?", "+bX+"; q=0.01":""):d.accepts["*"]);for(u in d.headers)v.setRequestHeader(u,d.headers[u]);if(d.beforeSend&&(d.beforeSend.call(e,v,d)===!1||s===2)){v.abort();return!1}for(u in{success:1,error:1,complete:1})v[u](d[u]);p=b$(bU,d,c,v);if(!p)w(-1,"No Transport");else{v.readyState=1,t&&g.trigger("ajaxSend",[v,d]),d.async&&d.timeout>0&&(q=setTimeout(function(){v.abort("timeout")},d.timeout));try{s=1,p.send(l,w)}catch(z){if(s<2)w(-1,z);else throw z}}return v},param:function(a,c){var d=[],e=function(a,b){b=f.isFunction(b)?b():b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};c===b&&(c=f.ajaxSettings.traditional);if(f.isArray(a)||a.jquery&&!f.isPlainObject(a))f.each(a,function(){e(this.name,this.value)});else for(var g in a)ca(g,a[g],c,e);return d.join("&").replace(bD,"+")}}),f.extend({active:0,lastModified:{},etag:{}});var cd=f.now(),ce=/(\=)\?(&|$)|\?\?/i;f.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return f.expando+"_"+cd++}}),f.ajaxPrefilter("json jsonp",function(b,c,d){var e=b.contentType==="application/x-www-form-urlencoded"&&typeof b.data=="string";if(b.dataTypes[0]==="jsonp"||b.jsonp!==!1&&(ce.test(b.url)||e&&ce.test(b.data))){var g,h=b.jsonpCallback=f.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,i=a[h],j=b.url,k=b.data,l="$1"+h+"$2";b.jsonp!==!1&&(j=j.replace(ce,l),b.url===j&&(e&&(k=k.replace(ce,l)),b.data===k&&(j+=(/\?/.test(j)?"&":"?")+b.jsonp+"="+h))),b.url=j,b.data=k,a[h]=function(a){g=[a]},d.always(function(){a[h]=i,g&&f.isFunction(i)&&a[h](g[0])}),b.converters["script json"]=function(){g||f.error(h+" was not called");return g[0]},b.dataTypes[0]="json";return"script"}}),f.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(a){f.globalEval(a);return a}}}),f.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),f.ajaxTransport("script",function(a){if(a.crossDomain){var d,e=c.head||c.getElementsByTagName("head")[0]||c.documentElement;return{send:function(f,g){d=c.createElement("script"),d.async="async",a.scriptCharset&&(d.charset=a.scriptCharset),d.src=a.url,d.onload=d.onreadystatechange=function(a,c){if(c||!d.readyState||/loaded|complete/.test(d.readyState))d.onload=d.onreadystatechange=null,e&&d.parentNode&&e.removeChild(d),d=b,c||g(200,"success")},e.insertBefore(d,e.firstChild)},abort:function(){d&&d.onload(0,1)}}}});var cf=a.ActiveXObject?function(){for(var a in ch)ch[a](0,1)}:!1,cg=0,ch;f.ajaxSettings.xhr=a.ActiveXObject?function(){return!this.isLocal&&ci()||cj()}:ci,function(a){f.extend(f.support,{ajax:!!a,cors:!!a&&"withCredentials"in a})}(f.ajaxSettings.xhr()),f.support.ajax&&f.ajaxTransport(function(c) -{if(!c.crossDomain||f.support.cors){var d;return{send:function(e,g){var h=c.xhr(),i,j;c.username?h.open(c.type,c.url,c.async,c.username,c.password):h.open(c.type,c.url,c.async);if(c.xhrFields)for(j in c.xhrFields)h[j]=c.xhrFields[j];c.mimeType&&h.overrideMimeType&&h.overrideMimeType(c.mimeType),!c.crossDomain&&!e["X-Requested-With"]&&(e["X-Requested-With"]="XMLHttpRequest");try{for(j in e)h.setRequestHeader(j,e[j])}catch(k){}h.send(c.hasContent&&c.data||null),d=function(a,e){var j,k,l,m,n;try{if(d&&(e||h.readyState===4)){d=b,i&&(h.onreadystatechange=f.noop,cf&&delete ch[i]);if(e)h.readyState!==4&&h.abort();else{j=h.status,l=h.getAllResponseHeaders(),m={},n=h.responseXML,n&&n.documentElement&&(m.xml=n),m.text=h.responseText;try{k=h.statusText}catch(o){k=""}!j&&c.isLocal&&!c.crossDomain?j=m.text?200:404:j===1223&&(j=204)}}}catch(p){e||g(-1,p)}m&&g(j,k,m,l)},!c.async||h.readyState===4?d():(i=++cg,cf&&(ch||(ch={},f(a).unload(cf)),ch[i]=d),h.onreadystatechange=d)},abort:function(){d&&d(0,1)}}}});var ck={},cl,cm,cn=/^(?:toggle|show|hide)$/,co=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,cp,cq=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]],cr;f.fn.extend({show:function(a,b,c){var d,e;if(a||a===0)return this.animate(cu("show",3),a,b,c);for(var g=0,h=this.length;g=i.duration+this.startTime){this.now=this.end,this.pos=this.state=1,this.update(),i.animatedProperties[this.prop]=!0;for(b in i.animatedProperties)i.animatedProperties[b]!==!0&&(g=!1);if(g){i.overflow!=null&&!f.support.shrinkWrapBlocks&&f.each(["","X","Y"],function(a,b){h.style["overflow"+b]=i.overflow[a]}),i.hide&&f(h).hide();if(i.hide||i.show)for(b in i.animatedProperties)f.style(h,b,i.orig[b]),f.removeData(h,"fxshow"+b,!0),f.removeData(h,"toggle"+b,!0);d=i.complete,d&&(i.complete=!1,d.call(h))}return!1}i.duration==Infinity?this.now=e:(c=e-this.startTime,this.state=c/i.duration,this.pos=f.easing[i.animatedProperties[this.prop]](this.state,c,0,1,i.duration),this.now=this.start+(this.end-this.start)*this.pos),this.update();return!0}},f.extend(f.fx,{tick:function(){var a,b=f.timers,c=0;for(;c-1,k={},l={},m,n;j?(l=e.position(),m=l.top,n=l.left):(m=parseFloat(h)||0,n=parseFloat(i)||0),f.isFunction(b)&&(b=b.call(a,c,g)),b.top!=null&&(k.top=b.top-g.top+m),b.left!=null&&(k.left=b.left-g.left+n),"using"in b?b.using.call(a,k):e.css(k)}},f.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),c=this.offset(),d=cx.test(b[0].nodeName)?{top:0,left:0}:b.offset();c.top-=parseFloat(f.css(a,"marginTop"))||0,c.left-=parseFloat(f.css(a,"marginLeft"))||0,d.top+=parseFloat(f.css(b[0],"borderTopWidth"))||0,d.left+=parseFloat(f.css(b[0],"borderLeftWidth"))||0;return{top:c.top-d.top,left:c.left-d.left}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||c.body;while(a&&!cx.test(a.nodeName)&&f.css(a,"position")==="static")a=a.offsetParent;return a})}}),f.each(["Left","Top"],function(a,c){var d="scroll"+c;f.fn[d]=function(c){var e,g;if(c===b){e=this[0];if(!e)return null;g=cy(e);return g?"pageXOffset"in g?g[a?"pageYOffset":"pageXOffset"]:f.support.boxModel&&g.document.documentElement[d]||g.document.body[d]:e[d]}return this.each(function(){g=cy(this),g?g.scrollTo(a?f(g).scrollLeft():c,a?c:f(g).scrollTop()):this[d]=c})}}),f.each(["Height","Width"],function(a,c){var d=c.toLowerCase();f.fn["inner"+c]=function(){var a=this[0];return a?a.style?parseFloat(f.css(a,d,"padding")):this[d]():null},f.fn["outer"+c]=function(a){var b=this[0];return b?b.style?parseFloat(f.css(b,d,a?"margin":"border")):this[d]():null},f.fn[d]=function(a){var e=this[0];if(!e)return a==null?null:this;if(f.isFunction(a))return this.each(function(b){var c=f(this);c[d](a.call(this,b,c[d]()))});if(f.isWindow(e)){var g=e.document.documentElement["client"+c],h=e.document.body;return e.document.compatMode==="CSS1Compat"&&g||h&&h["client"+c]||g}if(e.nodeType===9)return Math.max(e.documentElement["client"+c],e.body["scroll"+c],e.documentElement["scroll"+c],e.body["offset"+c],e.documentElement["offset"+c]);if(a===b){var i=f.css(e,d),j=parseFloat(i);return f.isNumeric(j)?j:i}return this.css(d,typeof a=="string"?a:a+"px")}}),a.jQuery=a.$=f,typeof define=="function"&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return f})})(window); diff --git a/man/html/key_8h_source.html b/man/html/key_8h_source.html deleted file mode 100644 index 3b62120..0000000 --- a/man/html/key_8h_source.html +++ /dev/null @@ -1,227 +0,0 @@ - - - - - -libpcp: key.h Source File - - - - - - -
-
-
- - - - - -
-
libpcp -  0.2.1 -
-
- - - - - - - -
-
-
key.h
-
-
-
1 /*
-
2  This file is part of Pretty Curved Privacy (pcp1).
-
3 
-
4  Copyright (C) 2013-2014 T.v.Dein.
-
5 
-
6  This program is free software: you can redistribute it and/or modify
-
7  it under the terms of the GNU General Public License as published by
-
8  the Free Software Foundation, either version 3 of the License, or
-
9  (at your option) any later version.
-
10 
-
11  This program is distributed in the hope that it will be useful,
-
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
-
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-
14  GNU General Public License for more details.
-
15 
-
16  You should have received a copy of the GNU General Public License
-
17  along with this program. If not, see <http://www.gnu.org/licenses/>.
-
18 
-
19  You can contact me by mail: <tom AT vondein DOT org>.
-
20 */
-
21 
-
22 
-
23 #ifndef _HAVE_PCP_KEYPAIR_H
-
24 #define _HAVE_PCP_KEYPAIR_H
-
25 
-
26 #include <sodium.h>
-
27 #include <string.h>
-
28 #include <stdio.h>
-
29 #include <time.h>
-
30 
-
31 #include "defines.h"
-
32 #include "platform.h"
-
33 #include "mem.h"
-
34 #include "mac.h"
-
35 #include "randomart.h"
-
36 #include "version.h"
-
37 #include "z85.h"
-
38 #include "uthash.h"
-
39 #include "jenhash.h"
-
40 #include "scrypt.h"
-
41 #include "keysig.h"
-
42 
-
43 
-
93 struct _pcp_key_t {
-
94  byte masterpub[32];
-
95  byte mastersecret[64];
-
96  byte pub[32];
-
97  byte secret[32];
-
98  byte edpub[32];
-
99  byte edsecret[64];
-
100  byte nonce[24];
-
101  byte encrypted[176];
-
102  char owner[255];
-
103  char mail[255];
-
104  char id[17];
-
105  uint8_t type;
-
106  uint64_t ctime;
-
107  uint32_t version;
-
108  uint32_t serial;
-
109  UT_hash_handle hh;
-
110 };
-
111 
-
113 typedef struct _pcp_key_t pcp_key_t;
-
114 
- -
123  byte masterpub[32];
-
124  byte sigpub[32];
-
125  byte pub[32];
-
126  byte edpub[32];
-
127  char owner[255];
-
128  char mail[255];
-
129  char id[17];
-
130  uint8_t type;
-
131  uint64_t ctime;
-
132  uint32_t version;
-
133  uint32_t serial;
-
134  uint8_t valid;
-
135  byte signature[crypto_generichash_BYTES_MAX + crypto_sign_BYTES];
-
136  UT_hash_handle hh;
-
137 };
-
138 
- -
141 
-
142 
-
143 /* the PBP public key format */
-
144 /* keys.mp+keys.cp+keys.sp+keys.name */
-
145 struct _pbp_pubkey_t {
-
146  byte sigpub[crypto_sign_PUBLICKEYBYTES];
-
147  byte edpub[crypto_sign_PUBLICKEYBYTES];
-
148  byte pub[crypto_box_PUBLICKEYBYTES];
-
149  char iso_ctime[32];
-
150  char iso_expire[32];
-
151  char name[1024];
-
152 };
-
153 
-
154 typedef struct _pbp_pubkey_t pbp_pubkey_t;
-
155 
-
166 struct _pcp_rec_t {
-
167  size_t ciphersize;
-
168  byte *cipher;
- - -
171 };
-
172 
-
174 typedef struct _pcp_rec_t pcp_rec_t;
-
175 
-
176 #define PCP_RAW_KEYSIZE sizeof(pcp_key_t) - sizeof(UT_hash_handle)
-
177 #define PCP_RAW_PUBKEYSIZE sizeof(pcp_pubkey_t) - sizeof(UT_hash_handle)
-
178 
-
179 
- -
189 
-
190 void pcp_keypairs(byte *msk, byte *mpk, byte *csk, byte *cpk, byte *esk, byte *epk);
-
191 
- -
228 
-
238 char *pcpkey_get_art(pcp_key_t *k);
-
239 
-
262 pcp_key_t *pcpkey_encrypt(pcp_key_t *key, char *passphrase);
-
263 
-
287 pcp_key_t *pcpkey_decrypt(pcp_key_t *key, char *passphrase);
-
288 
- -
301 
-
302 
-
319 char *pcp_getkeyid(pcp_key_t *k);
-
320 
-
321 
-
332 char *pcp_getpubkeyid(pcp_pubkey_t *k);
-
333 
-
347 unsigned char *pcppubkey_getchecksum(pcp_pubkey_t *k);
-
348 
-
357 unsigned char *pcpkey_getchecksum(pcp_key_t *k);
-
358 
-
359 
-
372 pcp_key_t *pcpkey_exists(char *id);
-
373 
-
386 pcp_pubkey_t *pcppubkey_exists(char *id);
-
387 
-
388 pcp_key_t * key2be(pcp_key_t *k);
-
389 pcp_key_t *key2native(pcp_key_t *k);
-
390 pcp_pubkey_t * pubkey2be(pcp_pubkey_t *k);
-
391 pcp_pubkey_t *pubkey2native(pcp_pubkey_t *k);
-
392 
-
401 unsigned char * pcp_gennonce();
-
402 
-
403 /* use scrypt() to create a key from a passphrase and a nonce
-
404  FIXME: use pure scrypt() instead.
-
405 */
-
406 unsigned char *pcp_derivekey(char *passphrase, unsigned char *nonce);
-
407 
-
408 /* FIXME: abandon and use Buffer instead */
-
409 void pcp_seckeyblob(void *blob, pcp_key_t *k);
-
410 void pcp_pubkeyblob(void *blob, pcp_pubkey_t *k);
-
411 void *pcp_keyblob(void *k, int type); /* allocates blob */
-
412 
- -
421 
- -
430 
-
435 void pcp_dumpkey(pcp_key_t *k);
-
436 
- -
442 
-
443 
-
444 #endif /* _HAVE_PCP_KEYPAIR_H */
-
445 
-
- - - - diff --git a/man/html/keyhash_8h_source.html b/man/html/keyhash_8h_source.html deleted file mode 100644 index 9cb09c2..0000000 --- a/man/html/keyhash_8h_source.html +++ /dev/null @@ -1,133 +0,0 @@ - - - - - -libpcp: keyhash.h Source File - - - - - - -
-
- - - - - - -
-
libpcp -  0.2.1 -
-
-
- - - - - -
-
-
-
keyhash.h
-
-
-
1 /*
-
2  This file is part of Pretty Curved Privacy (pcp1).
-
3 
-
4  Copyright (C) 2013 T.Linden.
-
5 
-
6  This program is free software: you can redistribute it and/or modify
-
7  it under the terms of the GNU General Public License as published by
-
8  the Free Software Foundation, either version 3 of the License, or
-
9  (at your option) any later version.
-
10 
-
11  This program is distributed in the hope that it will be useful,
-
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
-
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-
14  GNU General Public License for more details.
-
15 
-
16  You should have received a copy of the GNU General Public License
-
17  along with this program. If not, see <http://www.gnu.org/licenses/>.
-
18 
-
19  You can contact me by mail: <tlinden AT cpan DOT org>.
-
20 */
-
21 
-
22 #ifndef _HAVE_KEYHASH_H
-
23 #define _HAVE_KEYHASH_H
-
24 
-
35 #include "uthash.h"
-
36 #include "key.h"
-
37 
-
38 /* storage of keys in a global hash */
-
39 
-
41 extern pcp_key_t *pcpkey_hash;
-
42 
- -
45 
-
46 extern pcp_key_t *__k;
-
47 extern pcp_pubkey_t *__p;
-
48 
-
49 /* wrapper for HASH_ITER */
-
64 #define pcphash_iterate(key) \
-
65  __k = NULL; \
-
66  HASH_ITER(hh, pcpkey_hash, key, __k)
-
67 
-
68 
-
83 #define pcphash_iteratepub(key) \
-
84  __p = NULL; \
-
85  HASH_ITER(hh, pcppubkey_hash, key, __p)
-
86 
-
88 void pcphash_init();
-
89 
-
97 void pcphash_del(void *key, int type);
-
98 
-
105 void pcphash_clean();
-
106 
-
113 pcp_key_t *pcphash_keyexists(char *id);
-
114 
- -
122 
-
129 void pcphash_add(void *key, int type);
-
130 
-
135 int pcphash_count();
-
136 
-
141 int pcphash_countpub();
-
142 
-
144 extern pcp_keysig_t *pcpkeysig_hash;
-
145 extern pcp_keysig_t *__s;
-
146 
-
147 #define pcphash_iteratekeysig(key) \
-
148  __s = NULL; \
-
149  HASH_ITER(hh, pcpkeysig_hash, key, __s)
-
150 
-
151 pcp_keysig_t *pcphash_keysigexists(char *id);
-
152 
-
153 #endif /* _HAVE_KEYHASH_H */
-
154 
-
- - - - diff --git a/man/html/keysig_8h_source.html b/man/html/keysig_8h_source.html deleted file mode 100644 index 1e55467..0000000 --- a/man/html/keysig_8h_source.html +++ /dev/null @@ -1,119 +0,0 @@ - - - - - -libpcp: keysig.h Source File - - - - - - -
-
- - - - - - -
-
libpcp -  0.2.1 -
-
-
- - - - - -
-
-
-
keysig.h
-
-
-
1 /*
-
2  This file is part of Pretty Curved Privacy (pcp1).
-
3 
-
4  Copyright (C) 2013-2014 T.v.Dein.
-
5 
-
6  This program is free software: you can redistribute it and/or modify
-
7  it under the terms of the GNU General Public License as published by
-
8  the Free Software Foundation, either version 3 of the License, or
-
9  (at your option) any later version.
-
10 
-
11  This program is distributed in the hope that it will be useful,
-
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
-
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-
14  GNU General Public License for more details.
-
15 
-
16  You should have received a copy of the GNU General Public License
-
17  along with this program. If not, see <http://www.gnu.org/licenses/>.
-
18 
-
19  You can contact me by mail: <tom AT vondein DOT org>.
-
20 */
-
21 
-
22 
-
23 #ifndef _HAVE_PCP_KEYSIG_H
-
24 #define _HAVE_PCP_KEYSIG_H
-
25 
-
26 #include <string.h>
-
27 #include <stdio.h>
-
28 
-
29 #include "defines.h"
-
30 #include "platform.h"
-
31 #include "mem.h"
-
32 #include "buffer.h"
-
33 #include "key.h"
-
34 
-
35 #define PCP_RAW_KEYSIGSIZE sizeof(pcp_keysig_t) - sizeof(UT_hash_handle)
-
36 
-
37 /* holds a public key signature */
-
38 struct _pcp_keysig_t {
-
39  uint8_t type;
-
40  uint32_t size;
-
41  char belongs[17];
-
42  byte checksum[32];
-
43  byte *blob;
-
44  UT_hash_handle hh;
-
45 };
-
46 
-
47 typedef struct _pcp_keysig_t pcp_keysig_t;
-
48 
-
49 pcp_keysig_t *keysig2be(pcp_keysig_t *s);
-
50 pcp_keysig_t *keysig2native(pcp_keysig_t *s);
-
51 
-
52 /* put a keysig into a buffer, convert to big endian while at it */
-
53 Buffer *pcp_keysig2blob(pcp_keysig_t *s);
-
54 
-
55 /* fetch a keysig from a buffer, usually loaded from vault */
-
56 pcp_keysig_t *pcp_keysig_new(Buffer *blob);
-
57 
-
58 
-
59 #endif /* _HAVE_PCP_KEYSIG_H */
-
- - - - diff --git a/man/html/mac_8h_source.html b/man/html/mac_8h_source.html deleted file mode 100644 index 1c0cc76..0000000 --- a/man/html/mac_8h_source.html +++ /dev/null @@ -1,113 +0,0 @@ - - - - - -libpcp: mac.h Source File - - - - - - -
-
- - - - - - -
-
libpcp -  0.2.1 -
-
-
- - - - - -
-
-
-
mac.h
-
-
-
1 /*
-
2  This file is part of Pretty Curved Privacy (pcp1).
-
3 
-
4  Copyright (C) 2013 T.Linden.
-
5 
-
6  This program is free software: you can redistribute it and/or modify
-
7  it under the terms of the GNU General Public License as published by
-
8  the Free Software Foundation, either version 3 of the License, or
-
9  (at your option) any later version.
-
10 
-
11  This program is distributed in the hope that it will be useful,
-
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
-
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-
14  GNU General Public License for more details.
-
15 
-
16  You should have received a copy of the GNU General Public License
-
17  along with this program. If not, see <http://www.gnu.org/licenses/>.
-
18 
-
19  You can contact me by mail: <tlinden AT cpan DOT org>.
-
20 */
-
21 
-
22 
-
23 #ifndef _HAVE_PCP_MAC
-
24 #define _HAVE_PCP_MAC
-
25 
-
30 #include <strings.h>
-
31 #include <stdlib.h>
-
32 #include <errno.h>
-
33 #include <sodium.h>
-
34 #include "pad.h"
-
35 #include "mem.h"
-
36 
-
37 
-
38 /* how many times do we hash the passphrase */
-
39 #define HCYCLES 128000
-
40 
-
58 size_t pcp_sodium_mac(unsigned char **cipher,
-
59  unsigned char *cleartext,
-
60  size_t clearsize,
-
61  unsigned char *nonce,
-
62  unsigned char *key);
-
63 
-
82 int pcp_sodium_verify_mac(unsigned char **cleartext,
-
83  unsigned char* message,
-
84  size_t messagesize,
-
85  unsigned char *nonce,
-
86  unsigned char *key);
-
87 
-
88 
-
89 
-
90 
-
91 #endif /* _HAVE_PCP_MAC */
-
92 
-
- - - - diff --git a/man/html/mem_8h_source.html b/man/html/mem_8h_source.html deleted file mode 100644 index dbf1738..0000000 --- a/man/html/mem_8h_source.html +++ /dev/null @@ -1,107 +0,0 @@ - - - - - -libpcp: mem.h Source File - - - - - - -
-
- - - - - - -
-
libpcp -  0.2.1 -
-
-
- - - - - -
-
-
-
mem.h
-
-
-
1 /*
-
2  This file is part of Pretty Curved Privacy (pcp1).
-
3 
-
4  Copyright (C) 2013 T.Linden.
-
5 
-
6  This program is free software: you can redistribute it and/or modify
-
7  it under the terms of the GNU General Public License as published by
-
8  the Free Software Foundation, either version 3 of the License, or
-
9  (at your option) any later version.
-
10 
-
11  This program is distributed in the hope that it will be useful,
-
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
-
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-
14  GNU General Public License for more details.
-
15 
-
16  You should have received a copy of the GNU General Public License
-
17  along with this program. If not, see <http://www.gnu.org/licenses/>.
-
18 
-
19  You can contact me by mail: <tlinden AT cpan DOT org>.
-
20 */
-
21 
-
22 
-
23 #ifndef _HAVE_PCP_MEM
-
24 #define _HAVE_PCP_MEM
-
25 
-
26 #include <string.h>
-
27 #include <stdlib.h>
-
28 #include "platform.h"
-
29 
-
30 /* simple malloc() wrapper */
-
31 /* behaves like calloc(), which */
-
32 /* I don't have here. */
-
33 /* */
-
34 /* exits if there's no more memory */
-
35 /* available. */
-
36 void *ucmalloc(size_t s);
-
37 
-
38 /* the same but it fills the pointer with random values */
-
39 void *urmalloc(size_t s);
-
40 
-
41 /* resize a a pointer and fill the added remainder with zeroes */
-
42 void *ucrealloc(void *d, size_t oldlen, size_t newlen);
-
43 
-
44 /* clear and free */
-
45 void ucfree(void *d, size_t len);
-
46 
-
47 #endif /* _HAVE_PCP_MEM */
-
- - - - diff --git a/man/html/mgmt_8h_source.html b/man/html/mgmt_8h_source.html deleted file mode 100644 index 6d35f4e..0000000 --- a/man/html/mgmt_8h_source.html +++ /dev/null @@ -1,199 +0,0 @@ - - - - - -libpcp: mgmt.h Source File - - - - - - -
-
- - - - - - -
-
libpcp -  0.2.1 -
-
-
- - - - - -
-
-
-
mgmt.h
-
-
-
1 /*
-
2  This file is part of Pretty Curved Privacy (pcp1).
-
3 
-
4  Copyright (C) 2014 T.v.Dein.
-
5 
-
6  This program is free software: you can redistribute it and/or modify
-
7  it under the terms of the GNU General Public License as published by
-
8  the Free Software Foundation, either version 3 of the License, or
-
9  (at your option) any later version.
-
10 
-
11  This program is distributed in the hope that it will be useful,
-
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
-
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-
14  GNU General Public License for more details.
-
15 
-
16  You should have received a copy of the GNU General Public License
-
17  along with this program. If not, see <http://www.gnu.org/licenses/>.
-
18 
-
19  You can contact me by mail: <tom AT vondein DOT org>.
-
20 */
-
21 
-
22 /*
-
23  key management, namely import and export routines.
-
24  we're working with buffers only, no direct file i/o */
-
25 
-
26 #ifndef _HAVE_PCP_MGMT_H
-
27 #define _HAVE_PCP_MGMT_H
-
28 
-
29 #include <sodium.h>
-
30 #include <string.h>
-
31 #include <stdio.h>
-
32 #include <time.h>
-
33 
-
34 #include "defines.h"
-
35 #include "platform.h"
-
36 #include "mem.h"
-
37 #include "ed.h"
-
38 #include "key.h"
-
39 #include "keysig.h"
-
40 #include "buffer.h"
-
41 #include "scrypt.h"
-
42 
-
43 /* key management api, export, import, yaml and stuff */
-
44 
-
45 
-
55 /* various helper structs, used internally only */
-
56 struct _pcp_rfc_pubkey_header_t {
-
57  uint8_t version;
-
58  uint32_t ctime;
-
59  uint8_t cipher;
-
60 };
-
61 
-
62 struct _pcp_rfc_pubkey_0x21_t {
-
63  byte sig_ed25519_pub[crypto_sign_PUBLICKEYBYTES];
-
64  byte ed25519_pub[crypto_sign_PUBLICKEYBYTES];
-
65  byte curve25519_pub[crypto_box_PUBLICKEYBYTES];
-
66 };
-
67 
-
68 struct _pcp_rfc_pubkey_sigheader_0x21_t {
-
69  uint8_t version;
-
70  uint8_t type;
-
71  uint8_t pkcipher;
-
72  uint8_t hashcipher;
-
73  uint16_t numsubs;
-
74 };
-
75 
-
76 struct _pcp_rfc_pubkey_sigsub_0x21_t {
-
77  uint32_t size;
-
78  uint8_t type;
-
79 };
-
80 
-
81 typedef struct _pcp_rfc_pubkey_header_t rfc_pub_h;
-
82 typedef struct _pcp_rfc_pubkey_0x21_t rfc_pub_k;
-
83 typedef struct _pcp_rfc_pubkey_sigheader_0x21_t rfc_pub_sig_h;
-
84 typedef struct _pcp_rfc_pubkey_sigsub_0x21_t rfc_pub_sig_s;
-
85 
-
86 struct _pcp_ks_bundle_t {
-
87  pcp_pubkey_t *p;
-
88  pcp_keysig_t *s;
-
89 };
-
90 typedef struct _pcp_ks_bundle_t pcp_ks_bundle_t;
-
91 
-
92 #define EXP_PK_CIPHER 0x21
-
93 #define EXP_PK_CIPHER_NAME "CURVE25519-ED25519-POLY1305-SALSA20"
-
94 
-
95 #define EXP_HASH_CIPHER 0x22
-
96 #define EXP_HASH_NAME "BLAKE2"
-
97 
-
98 #define EXP_SIG_CIPHER 0x23
-
99 #define EXP_SIG_CIPHER_NAME "ED25519"
-
100 
-
101 #define EXP_SIG_VERSION 0x01
-
102 #define EXP_SIG_TYPE 0x1F /* self signed */
-
103 
-
104 /* sig sub notiation we support */
-
105 #define EXP_SIG_SUB_CTIME 2
-
106 #define EXP_SIG_SUB_SIGEXPIRE 3
-
107 #define EXP_SIG_SUB_KEYEXPIRE 9
-
108 #define EXP_SIG_SUB_NOTATION 20
-
109 #define EXP_SIG_SUB_KEYFLAGS 27
-
110 
-
111 /* in armored mode, we're using the usual head+foot */
-
112 #define EXP_PK_HEADER "-----BEGIN ED25519-CURVE29915 PUBLIC KEY-----"
-
113 #define EXP_PK_FOOTER "------END ED25519-CURVE29915 PUBLIC KEY------"
-
114 #define EXP_SK_HEADER "-----BEGIN ED25519-CURVE29915 PRIVATE KEY-----"
-
115 #define EXP_SK_FOOTER "------END ED25519-CURVE29915 PRIVATE KEY------"
-
116 
-
117 
-
118 /* pubkey export formats */
-
119 #define EXP_FORMAT_NATIVE 1
-
120 #define EXP_FORMAT_PBP 2
-
121 #define EXP_FORMAT_YAML 3
-
122 #define EXP_FORMAT_C 4
-
123 #define EXP_FORMAT_PY 5
-
124 #define EXP_FORMAT_PERL 6
-
125 
- -
212 
-
213 
- -
225 
- -
236 
- -
247 
- -
258 
-
299 Buffer *pcp_export_secret(pcp_key_t *sk, char *passphrase);
-
300 
-
301 pcp_ks_bundle_t *pcp_import_pub(unsigned char *raw, size_t rawsize);
-
302 pcp_ks_bundle_t *pcp_import_pub_rfc(Buffer *blob);
-
303 pcp_ks_bundle_t *pcp_import_pub_pbp(Buffer *blob);
-
304 
-
305 /* import secret key */
-
306 pcp_key_t *pcp_import_secret(unsigned char *raw, size_t rawsize, char *passphrase);
-
307 pcp_key_t *pcp_import_secret_native(Buffer *cipher, char *passphrase);
-
308 
-
309 #endif // _HAVE_PCP_MGMT_H
-
310 
-
- - - - diff --git a/man/html/modules.html b/man/html/modules.html deleted file mode 100644 index bea334e..0000000 --- a/man/html/modules.html +++ /dev/null @@ -1,66 +0,0 @@ - - - - - -libpcp: Modules - - - - - - -
-
- - - - - - -
-
libpcp -  0.2.1 -
-
-
- - - -
-
-
-
Modules
-
-
-
Here is a list of all modules:
- - - - - - - - - - - - -
oBUFFERFlexible buffer management, idea from openssh/buffer.c
oCRYPTOFunctions for symmetrical or asymmetrical encryption using NaCL
oFATALSA couple of functions to catch errors and display them
oSIGNINGED25519 signature functions
oKEYSPCP public and secret key functions
oKEYHASHUthashes of secret and public key structures
oKEYEXPORTFunctions to export and import keys in various formats
oPCPSTREAMSI/O wrapper for files or buffers
oUTILSVarious useful helper functions
oVAULTThe vault file is used to store keys and key-signatures on disk
\Z85Z85 Encoding functions
-
-
- - - - diff --git a/man/html/nav_f.png b/man/html/nav_f.png deleted file mode 100644 index 72a58a5..0000000 Binary files a/man/html/nav_f.png and /dev/null differ diff --git a/man/html/nav_g.png b/man/html/nav_g.png deleted file mode 100644 index 2093a23..0000000 Binary files a/man/html/nav_g.png and /dev/null differ diff --git a/man/html/nav_h.png b/man/html/nav_h.png deleted file mode 100644 index 33389b1..0000000 Binary files a/man/html/nav_h.png and /dev/null differ diff --git a/man/html/open.png b/man/html/open.png deleted file mode 100644 index 30f75c7..0000000 Binary files a/man/html/open.png and /dev/null differ diff --git a/man/html/pad_8h_source.html b/man/html/pad_8h_source.html deleted file mode 100644 index a9e08d2..0000000 --- a/man/html/pad_8h_source.html +++ /dev/null @@ -1,158 +0,0 @@ - - - - - -libpcp: pad.h Source File - - - - - - -
-
- - - - - - -
-
libpcp -  0.2.1 -
-
-
- - - - - -
-
-
-
pad.h
-
-
-
1 /*
-
2  This file is part of Pretty Curved Privacy (pcp1).
-
3 
-
4  Copyright (C) 2013 T.Linden.
-
5 
-
6  This program is free software: you can redistribute it and/or modify
-
7  it under the terms of the GNU General Public License as published by
-
8  the Free Software Foundation, either version 3 of the License, or
-
9  (at your option) any later version.
-
10 
-
11  This program is distributed in the hope that it will be useful,
-
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
-
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-
14  GNU General Public License for more details.
-
15 
-
16  You should have received a copy of the GNU General Public License
-
17  along with this program. If not, see <http://www.gnu.org/licenses/>.
-
18 
-
19  You can contact me by mail: <tlinden AT cpan DOT org>.
-
20 */
-
21 
-
22 
-
23 #ifndef _HAVE_PCP_ZPADDING
-
24 #define _HAVE_PCP_ZPADDING
-
25 
-
26 #include <stdio.h>
-
27 #include <string.h>
-
28 #include <stdlib.h>
-
29 #include <stdlib.h>
-
30 #include <limits.h>
-
31 
-
32 #include "mem.h"
-
33 
-
34 #ifdef DEBUG
-
35 #define ZPADCHAR 48
-
36 #else
-
37 #define ZPADCHAR 0
-
38 #endif
-
39 
-
40 /* prepends a binary stream with a number of */
-
41 /* \0's as required by the secret_box and */
-
42 /* secret_box_open functions of libsodium. */
-
43 /* */
-
44 /* parameters: */
-
45 /* */
-
46 /* padded: destination array (ref) */
-
47 /* unpadded: source array without padding */
-
48 /* padlen: length of padding */
-
49 /* unpadlen: length of source array */
-
50 /* */
-
51 /* turns "efa5" into "00000000efa5" with padlen 8 */
-
52 /* */
-
53 /* if DEBUG is set, destination will be padded with */
-
54 /* the character '0', NOT the integer 0. */
-
55 /* */
-
56 /* allocates memory for padded and it is up to the */
-
57 /* user to free it after use. */
-
58 /* */
-
59 /* sample call: */
-
60 /* */
-
61 /* char unpadded[] = {0xef, 0xa5}; */
-
62 /* unsigned char *padded; */
-
63 /* pcp_pad_prepend(&padded, unpadded, 8, 2); */
-
64 /* */
-
65 /* the result, padded, would be 10 bytes long, 8 */
-
66 /* bytes for the leading zeros and 2 for the content */
-
67 /* of the original unpadded. */
-
68 void pcp_pad_prepend(unsigned char **padded, unsigned char *unpadded,
-
69  size_t padlen, size_t unpadlen);
-
70 
-
71 /* removes zero's of a binary stream, which is */
-
72 /* the reverse of pcp_pad_prepend(). */
-
73 /* */
-
74 /* parameters: */
-
75 /* */
-
76 /* unpadded: destination array (ref), with padding removed */
-
77 /* padded: source array with padding */
-
78 /* padlen: length of padding */
-
79 /* unpadlen: length of source array */
-
80 /* */
-
81 /* turns "00000000efa5" into "efa5" with padlen 8 */
-
82 /* */
-
83 /* allocates memory for unpadded and it is up to the */
-
84 /* user to free it after use. */
-
85 /* */
-
86 /* sample call: */
-
87 /* */
-
88 /* char padded[] = {0x0, 0x0, 0x0, 0x0, 0xef, 0xa5}; */
-
89 /* unsigned char *unpadded; */
-
90 /* pcp_pad_remove(unpadded, padded, 4, 2); */
-
91 /* */
-
92 /* the result, unpadded would be 2 bytes long containing */
-
93 /* only the 2 bytes we want to have with zeros removed. */
-
94 void pcp_pad_remove(unsigned char **unpadded, unsigned char *padded,
-
95  size_t padlen, size_t unpadlen);
-
96 
-
97 
-
98 #endif /* _HAVE_PCP_ZPADDING */
-
- - - - diff --git a/man/html/pcpstream_8h_source.html b/man/html/pcpstream_8h_source.html deleted file mode 100644 index d1e19ef..0000000 --- a/man/html/pcpstream_8h_source.html +++ /dev/null @@ -1,131 +0,0 @@ - - - - - -libpcp: pcpstream.h Source File - - - - - - -
-
- - - - - - -
-
libpcp -  0.2.1 -
-
-
- - - - - -
-
-
-
pcpstream.h
-
-
-
1 /*
-
2  This file is part of Pretty Curved Privacy (pcp1).
-
3 
-
4  Copyright (C) 2013-2014 T.v.Dein.
-
5 
-
6  This program is free software: you can redistribute it and/or modify
-
7  it under the terms of the GNU General Public License as published by
-
8  the Free Software Foundation, either version 3 of the License, or
-
9  (at your option) any later version.
-
10 
-
11  This program is distributed in the hope that it will be useful,
-
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
-
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-
14  GNU General Public License for more details.
-
15 
-
16  You should have received a copy of the GNU General Public License
-
17  along with this program. If not, see <http://www.gnu.org/licenses/>.
-
18 
-
19  You can contact me by mail: <tom AT vondein DOT org>.
-
20 */
-
21 
-
22 #ifndef HAVE_PCP_PCPSTEAM_H
-
23 #define HAVE_PCP_PCPSTEAM_H
-
24 
-
25 #include <stdarg.h>
-
26 #include <stdio.h>
-
27 #include "mem.h"
-
28 #include "util.h"
-
29 #include "defines.h"
-
30 #include "buffer.h"
-
31 
-
58 struct _pcp_stream_t {
-
59  FILE *fd;
-
60  Buffer *b;
-
61  uint8_t is_buffer;
-
62  uint8_t eof;
-
63  uint8_t err;
-
64 };
-
65 
-
67 typedef struct _pcp_stream_t Pcpstream;
-
68 
-
69 /* initialize a new empty stream */
-
70 Pcpstream *ps_init(void);
-
71 
-
80 Pcpstream *ps_new_file(FILE *backendfd);
-
81 
- -
91 
- -
100 
-
101 
-
122 size_t ps_read(Pcpstream *stream, void *buf, size_t readbytes);
-
123 
-
139 size_t ps_write(Pcpstream *stream, void *buf, size_t writebytes);
-
140 
-
156 size_t ps_print(Pcpstream *stream, const char * fmt, ...);
-
157 
-
167 size_t ps_tell(Pcpstream *stream);
-
168 
-
180 Buffer *ps_buffer(Pcpstream *stream);
-
181 
-
191 void ps_close(Pcpstream *stream);
-
192 
-
204 int ps_end(Pcpstream *stream);
-
205 
-
212 int ps_err(Pcpstream *stream);
-
213 
-
214 
-
215 #endif // HAVE_PCP_PCPSTEAM_H
-
216 
-
217 
-
- - - - diff --git a/man/html/plist_8h_source.html b/man/html/plist_8h_source.html deleted file mode 100644 index 522d554..0000000 --- a/man/html/plist_8h_source.html +++ /dev/null @@ -1,136 +0,0 @@ - - - - - -libpcp: plist.h Source File - - - - - - -
-
- - - - - - -
-
libpcp -  0.2.1 -
-
-
- - - - - -
-
-
-
plist.h
-
-
-
1 /*
-
2  This file is part of Pretty Curved Privacy (pcp1).
-
3 
-
4  Copyright (C) 2013 T. von Dein.
-
5 
-
6  This program is free software: you can redistribute it and/or modify
-
7  it under the terms of the GNU General Public License as published by
-
8  the Free Software Foundation, either version 3 of the License, or
-
9  (at your option) any later version.
-
10 
-
11  This program is distributed in the hope that it will be useful,
-
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
-
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-
14  GNU General Public License for more details.
-
15 
-
16  You should have received a copy of the GNU General Public License
-
17  along with this program. If not, see <http://www.gnu.org/licenses/>.
-
18 
-
19  You can contact me by mail: <tlinden AT cpan DOT org>.
-
20 */
-
21 
-
22 /*
-
23  Simple linked list wrappers,
-
24  used for recipient- or keyid lists
-
25 */
-
26 
-
27 #ifndef _HAVE_PCP_PLIST_H
-
28 #define _HAVE_PCP_PLIST_H
-
29 
-
30 #include <stdlib.h>
-
31 #include <stdio.h>
-
32 
-
33 struct _plist_t {
-
34  char *value;
-
35  struct _plist_t *next;
-
36  struct _plist_t *first;
-
37 };
-
38 
-
39 typedef struct _plist_t plist_t;
-
40 
-
41 static inline void p_add(plist_t **lst, char *value) {
-
42  plist_t *newitem;
-
43  plist_t *iter = *lst;
-
44 
-
45  newitem = (plist_t *)malloc(sizeof(plist_t));
-
46  newitem->value = (char *)malloc(strlen(value) + 1);
-
47  strncpy(newitem->value, value, strlen(value) + 1);
-
48  newitem->next = NULL;
-
49 
-
50  if ( iter != NULL ) {
-
51  while (iter->next != NULL ) {
-
52  iter = iter->next;
-
53  }
-
54  newitem->first = iter->first;
-
55  iter->next = newitem;
-
56  }
-
57  else {
-
58  newitem->first = newitem;
-
59  *lst = newitem;
-
60  }
-
61 }
-
62 
-
63 static inline void p_clean(plist_t *lst) {
-
64  plist_t *iter = lst->first;
-
65  plist_t *tmp;
-
66 
-
67  while (iter != NULL) {
-
68  tmp = iter;
-
69  iter = iter->next;
-
70  free(tmp->value);
-
71  free(tmp);
-
72  }
-
73 
-
74 }
-
75 
-
76 #endif /* _HAVE_PCP_PLIST_H */
-
- - - - diff --git a/man/html/randomart_8h_source.html b/man/html/randomart_8h_source.html deleted file mode 100644 index d826564..0000000 --- a/man/html/randomart_8h_source.html +++ /dev/null @@ -1,114 +0,0 @@ - - - - - -libpcp: randomart.h Source File - - - - - - -
-
- - - - - - -
-
libpcp -  0.2.1 -
-
-
- - - - - -
-
-
-
randomart.h
-
-
-
1 /* $OpenBSD: key.c,v 1.70 2008/06/11 21:01:35 grunk Exp $ */
-
2 /*
-
3  * read_bignum():
-
4  * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
-
5  *
-
6  * As far as I am concerned, the code I have written for this software
-
7  * can be used freely for any purpose. Any derived versions of this
-
8  * software must be clearly marked as such, and if the derived work is
-
9  * incompatible with the protocol description in the RFC file, it must be
-
10  * called by a name other than "ssh" or "Secure Shell".
-
11  *
-
12  *
-
13  * Copyright (c) 2000, 2001 Markus Friedl. All rights reserved.
-
14  *
-
15  * Redistribution and use in source and binary forms, with or without
-
16  * modification, are permitted provided that the following conditions
-
17  * are met:
-
18  * 1. Redistributions of source code must retain the above copyright
-
19  * notice, this list of conditions and the following disclaimer.
-
20  * 2. Redistributions in binary form must reproduce the above copyright
-
21  * notice, this list of conditions and the following disclaimer in the
-
22  * documentation and/or other materials provided with the distribution.
-
23  *
-
24  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
-
25  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
-
26  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
-
27  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
-
28  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
-
29  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-
30  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-
31  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-
32  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-
33  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
34  */
-
35 
-
36 /* key_fingerprint_randomart comitted by Alexander von Gernler in rev 1.70 */
-
37 
-
38 #ifndef _HAVE_PCP_RANDOMART_H
-
39 #define _HAVE_PCP_RANDOMART_H
-
40 
-
41 #include "mem.h"
-
42 #include <string.h>
-
43 
-
44 /* from openssh key.c */
-
45 
-
46 #ifndef MAX
-
47 # define MAX(a,b) (((a)>(b))?(a):(b))
-
48 # define MIN(a,b) (((a)<(b))?(a):(b))
-
49 #endif
-
50 
-
51 
-
52 char *key_fingerprint_randomart(unsigned char *dgst_raw, unsigned int dgst_raw_len);
-
53 
-
54 #endif /* _HAVE_PCP_RANDOMART_H */
-
- - - - diff --git a/man/html/scrypt_8h_source.html b/man/html/scrypt_8h_source.html deleted file mode 100644 index 01f959d..0000000 --- a/man/html/scrypt_8h_source.html +++ /dev/null @@ -1,102 +0,0 @@ - - - - - -libpcp: scrypt.h Source File - - - - - - -
-
- - - - - - -
-
libpcp -  0.2.1 -
-
-
- - - - - -
-
-
-
scrypt.h
-
-
-
1 /*
-
2  This file is part of Pretty Curved Privacy (pcp1).
-
3 
-
4  Copyright (C) 2013 T.Linden.
-
5 
-
6  This program is free software: you can redistribute it and/or modify
-
7  it under the terms of the GNU General Public License as published by
-
8  the Free Software Foundation, either version 3 of the License, or
-
9  (at your option) any later version.
-
10 
-
11  This program is distributed in the hope that it will be useful,
-
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
-
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-
14  GNU General Public License for more details.
-
15 
-
16  You should have received a copy of the GNU General Public License
-
17  along with this program. If not, see <http://www.gnu.org/licenses/>.
-
18 
-
19  You can contact me by mail: <tlinden AT cpan DOT org>.
-
20 */
-
21 
-
22 
-
23 #ifndef _HAVE_PCP_SCRYPT_H
-
24 #define _HAVE_PCP_SCRYPT_H
-
25 
-
26 #include <sys/types.h>
-
27 #include <stdint.h>
-
28 #include <stdio.h>
-
29 #include <stdlib.h>
-
30 #include <string.h>
-
31 #include <errno.h>
-
32 
-
33 #include <sodium.h>
-
34 
-
35 #include "crypto_scrypt.h"
-
36 #include "mem.h"
-
37 #include "defines.h"
-
38 
-
39 unsigned char * pcp_scrypt(char *passwd, size_t passwdlen, unsigned char *nonce, size_t noncelen);
-
40 
-
41 #endif /* _HAVE_PCP_SCRYPT_H */
-
42 
-
- - - - diff --git a/man/html/struct__pcp__buffer-members.html b/man/html/struct__pcp__buffer-members.html deleted file mode 100644 index 281f978..0000000 --- a/man/html/struct__pcp__buffer-members.html +++ /dev/null @@ -1,68 +0,0 @@ - - - - - -libpcp: Member List - - - - - - -
-
- - - - - - -
-
libpcp -  0.2.1 -
-
-
- - - - -
-
-
-
_pcp_buffer Member List
-
-
- -

This is the complete list of members for _pcp_buffer, including all inherited members.

- - - - - - - - - -
allocated_pcp_buffer
blocksize_pcp_buffer
buf_pcp_buffer
end_pcp_buffer
isstring_pcp_buffer
name_pcp_buffer
offset_pcp_buffer
size_pcp_buffer
- - - - diff --git a/man/html/struct__pcp__buffer.html b/man/html/struct__pcp__buffer.html deleted file mode 100644 index c9086c8..0000000 --- a/man/html/struct__pcp__buffer.html +++ /dev/null @@ -1,230 +0,0 @@ - - - - - -libpcp: _pcp_buffer Struct Reference - - - - - - -
-
- - - - - - -
-
libpcp -  0.2.1 -
-
-
- - - - -
-
- -
-
_pcp_buffer Struct Reference
-
-
- -

A flexible buffer object wich automatically resizes, if neccessary. - More...

- -

#include <buffer.h>

- - - - - - - - - - - - - - - - - - - - - - - - - - -

-Public Attributes

char * name
 just for convenience in error messages and the like, so we know which buffer cause trouble
 
uint8_t allocated
 marks the buffer as allocated
 
size_t blocksize
 the blocksize to use when resizing, also used for initial malloc()
 
size_t size
 stores the current allocated size of the object
 
size_t offset
 current read position
 
size_t end
 current write position, data end.
 
uint8_t isstring
 treat as char array/string
 
void * buf
 the actual storage buffer
 
-

Detailed Description

-

A flexible buffer object wich automatically resizes, if neccessary.

- -

Definition at line 50 of file buffer.h.

-

Member Data Documentation

- -
-
- - - - -
uint8_t _pcp_buffer::allocated
-
- -

marks the buffer as allocated

- -

Definition at line 52 of file buffer.h.

- -
-
- -
-
- - - - -
size_t _pcp_buffer::blocksize
-
- -

the blocksize to use when resizing, also used for initial malloc()

- -

Definition at line 53 of file buffer.h.

- -
-
- -
-
- - - - -
void* _pcp_buffer::buf
-
- -

the actual storage buffer

- -

Definition at line 58 of file buffer.h.

- -
-
- -
-
- - - - -
size_t _pcp_buffer::end
-
- -

current write position, data end.

-

maybe less than size.

- -

Definition at line 56 of file buffer.h.

- -
-
- -
-
- - - - -
uint8_t _pcp_buffer::isstring
-
- -

treat as char array/string

- -

Definition at line 57 of file buffer.h.

- -
-
- -
-
- - - - -
char* _pcp_buffer::name
-
- -

just for convenience in error messages and the like, so we know which buffer cause trouble

- -

Definition at line 51 of file buffer.h.

- -
-
- -
-
- - - - -
size_t _pcp_buffer::offset
-
- -

current read position

- -

Definition at line 55 of file buffer.h.

- -
-
- -
-
- - - - -
size_t _pcp_buffer::size
-
- -

stores the current allocated size of the object

- -

Definition at line 54 of file buffer.h.

- -
-
-
The documentation for this struct was generated from the following file: -
- - - - diff --git a/man/html/struct__pcp__key__t-members.html b/man/html/struct__pcp__key__t-members.html deleted file mode 100644 index faeaaec..0000000 --- a/man/html/struct__pcp__key__t-members.html +++ /dev/null @@ -1,75 +0,0 @@ - - - - - -libpcp: Member List - - - - - - -
-
- - - - - - -
-
libpcp -  0.2.1 -
-
-
- - - - -
-
-
-
_pcp_key_t Member List
-
- - - - - diff --git a/man/html/struct__pcp__key__t.html b/man/html/struct__pcp__key__t.html deleted file mode 100644 index 96a08e3..0000000 --- a/man/html/struct__pcp__key__t.html +++ /dev/null @@ -1,373 +0,0 @@ - - - - - -libpcp: _pcp_key_t Struct Reference - - - - - - -
-
- - - - - - -
-
libpcp -  0.2.1 -
-
-
- - - - -
-
- -
-
_pcp_key_t Struct Reference
-
-
- -

PCP private key structure. - More...

- -

#include <key.h>

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

-Public Attributes

byte masterpub [32]
 ED25519 master public key signing key.
 
byte mastersecret [64]
 ED25519 master secret key signing key.
 
byte pub [32]
 Curve25519 encryption public key.
 
byte secret [32]
 Curve25519 encryption secret key.
 
byte edpub [32]
 ED25519 public signing key.
 
byte edsecret [64]
 ED25519 secret signing key.
 
byte nonce [24]
 random nonce used to encrypt secret keys
 
byte encrypted [176]
 concatenated and encrypted secret keys
 
char owner [255]
 the key owner, string
 
char mail [255]
 mail address of the owner, string
 
char id [17]
 key-id, used internally only, jenhash of public keys
 
uint8_t type
 key type: MASTER_SECRET or SECRET
 
uint64_t ctime
 creation time, epoch
 
uint32_t version
 key version
 
uint32_t serial
 serial number of the key, randomly generated
 
-

Detailed Description

-

PCP private key structure.

-

Most fields are self explanatory.

-

Some notes:

-

'encrypted' contains the encrypted secret keys (contatenated mastersecret, secret and edsecret). If it's set, the field 'secret' which contains the clear secret key will be zeroed with random values, the first byte will be 0. Same for the field 'edsecret'.

-

'nonce' contains the nonce required to decrypt the encrypted secret, if set.

-

'serial' is a random number.

-

'id' is a string containing the hex values of the CRC32 checksum of the public and secret key.

-

Upon creation everything will be filled with random bytes. String fields will contain a string followed by 0 followed by the rest of the pre-filled random bytes. To denote a string field as empty, the first byte will be set to 0.

-

There are dynamically calculated attributes as well:

-

'checksum' is a 256 bit SHA hash of the public key returned by pcpkey_getchecksum() or pcppubkey_getchecksum().

-

'random id' is a random art ascii image returned by pcppubkey_get_art() or pcpkey_get_art(), calculated from the public key.

-

If exported to a single file or printed, the structure will be encoded using Z85 encoding.

- -

Definition at line 93 of file key.h.

-

Member Data Documentation

- -
-
- - - - -
uint64_t _pcp_key_t::ctime
-
- -

creation time, epoch

- -

Definition at line 106 of file key.h.

- -
-
- -
-
- - - - -
byte _pcp_key_t::edpub[32]
-
- -

ED25519 public signing key.

- -

Definition at line 98 of file key.h.

- -
-
- -
-
- - - - -
byte _pcp_key_t::edsecret[64]
-
- -

ED25519 secret signing key.

- -

Definition at line 99 of file key.h.

- -
-
- -
-
- - - - -
byte _pcp_key_t::encrypted[176]
-
- -

concatenated and encrypted secret keys

- -

Definition at line 101 of file key.h.

- -
-
- -
-
- - - - -
char _pcp_key_t::id[17]
-
- -

key-id, used internally only, jenhash of public keys

- -

Definition at line 104 of file key.h.

- -
-
- -
-
- - - - -
char _pcp_key_t::mail[255]
-
- -

mail address of the owner, string

- -

Definition at line 103 of file key.h.

- -
-
- -
-
- - - - -
byte _pcp_key_t::masterpub[32]
-
- -

ED25519 master public key signing key.

- -

Definition at line 94 of file key.h.

- -
-
- -
-
- - - - -
byte _pcp_key_t::mastersecret[64]
-
- -

ED25519 master secret key signing key.

- -

Definition at line 95 of file key.h.

- -
-
- -
-
- - - - -
byte _pcp_key_t::nonce[24]
-
- -

random nonce used to encrypt secret keys

- -

Definition at line 100 of file key.h.

- -
-
- -
-
- - - - -
char _pcp_key_t::owner[255]
-
- -

the key owner, string

- -

Definition at line 102 of file key.h.

- -
-
- -
-
- - - - -
byte _pcp_key_t::pub[32]
-
- -

Curve25519 encryption public key.

- -

Definition at line 96 of file key.h.

- -
-
- -
-
- - - - -
byte _pcp_key_t::secret[32]
-
- -

Curve25519 encryption secret key.

- -

Definition at line 97 of file key.h.

- -
-
- -
-
- - - - -
uint32_t _pcp_key_t::serial
-
- -

serial number of the key, randomly generated

- -

Definition at line 108 of file key.h.

- -
-
- -
-
- - - - -
uint8_t _pcp_key_t::type
-
- -

key type: MASTER_SECRET or SECRET

- -

Definition at line 105 of file key.h.

- -
-
- -
-
- - - - -
uint32_t _pcp_key_t::version
-
- -

key version

- -

Definition at line 107 of file key.h.

- -
-
-
The documentation for this struct was generated from the following file: -
- - - - diff --git a/man/html/struct__pcp__pubkey__t-members.html b/man/html/struct__pcp__pubkey__t-members.html deleted file mode 100644 index 8b581f9..0000000 --- a/man/html/struct__pcp__pubkey__t-members.html +++ /dev/null @@ -1,73 +0,0 @@ - - - - - -libpcp: Member List - - - - - - -
-
- - - - - - -
-
libpcp -  0.2.1 -
-
-
- - - - -
-
-
-
_pcp_pubkey_t Member List
-
- - - - - diff --git a/man/html/struct__pcp__pubkey__t.html b/man/html/struct__pcp__pubkey__t.html deleted file mode 100644 index 53b002c..0000000 --- a/man/html/struct__pcp__pubkey__t.html +++ /dev/null @@ -1,325 +0,0 @@ - - - - - -libpcp: _pcp_pubkey_t Struct Reference - - - - - - -
-
- - - - - - -
-
libpcp -  0.2.1 -
-
-
- - - - -
-
- -
-
_pcp_pubkey_t Struct Reference
-
-
- -

PCP public key structure. - More...

- -

#include <key.h>

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

-Public Attributes

byte masterpub [32]
 ED25519 master public key signing key.
 
byte sigpub [32]
 ED25519 public signing key.
 
byte pub [32]
 Curve25519 encryption public key.
 
byte edpub [32]
 ED25519 public signing key (FIXME: huh? 2 of them???)
 
char owner [255]
 the key owner, string
 
char mail [255]
 mail address of the owner, string
 
char id [17]
 key-id, used internally only, jenhash of public keys
 
uint8_t type
 key type: MASTER_SECRET or SECRET
 
uint64_t ctime
 creation time, epoch
 
uint32_t version
 key version
 
uint32_t serial
 serial number of the key, randomly generated
 
uint8_t valid
 1 if import signature verified, 0 if not
 
byte signature [crypto_generichash_BYTES_MAX+crypto_sign_BYTES]
 raw binary blob of pubkey export signature
 
-

Detailed Description

-

PCP public key structure.

-

This structure contains a subset of the pcp_key_t structure without the secret and nonce fields.

- -

Definition at line 122 of file key.h.

-

Member Data Documentation

- -
-
- - - - -
uint64_t _pcp_pubkey_t::ctime
-
- -

creation time, epoch

- -

Definition at line 131 of file key.h.

- -
-
- -
-
- - - - -
byte _pcp_pubkey_t::edpub[32]
-
- -

ED25519 public signing key (FIXME: huh? 2 of them???)

- -

Definition at line 126 of file key.h.

- -
-
- -
-
- - - - -
char _pcp_pubkey_t::id[17]
-
- -

key-id, used internally only, jenhash of public keys

- -

Definition at line 129 of file key.h.

- -
-
- -
-
- - - - -
char _pcp_pubkey_t::mail[255]
-
- -

mail address of the owner, string

- -

Definition at line 128 of file key.h.

- -
-
- -
-
- - - - -
byte _pcp_pubkey_t::masterpub[32]
-
- -

ED25519 master public key signing key.

- -

Definition at line 123 of file key.h.

- -
-
- -
-
- - - - -
char _pcp_pubkey_t::owner[255]
-
- -

the key owner, string

- -

Definition at line 127 of file key.h.

- -
-
- -
-
- - - - -
byte _pcp_pubkey_t::pub[32]
-
- -

Curve25519 encryption public key.

- -

Definition at line 125 of file key.h.

- -
-
- -
-
- - - - -
uint32_t _pcp_pubkey_t::serial
-
- -

serial number of the key, randomly generated

- -

Definition at line 133 of file key.h.

- -
-
- -
-
- - - - -
byte _pcp_pubkey_t::signature[crypto_generichash_BYTES_MAX+crypto_sign_BYTES]
-
- -

raw binary blob of pubkey export signature

- -

Definition at line 135 of file key.h.

- -
-
- -
-
- - - - -
byte _pcp_pubkey_t::sigpub[32]
-
- -

ED25519 public signing key.

- -

Definition at line 124 of file key.h.

- -
-
- -
-
- - - - -
uint8_t _pcp_pubkey_t::type
-
- -

key type: MASTER_SECRET or SECRET

- -

Definition at line 130 of file key.h.

- -
-
- -
-
- - - - -
uint8_t _pcp_pubkey_t::valid
-
- -

1 if import signature verified, 0 if not

- -

Definition at line 134 of file key.h.

- -
-
- -
-
- - - - -
uint32_t _pcp_pubkey_t::version
-
- -

key version

- -

Definition at line 132 of file key.h.

- -
-
-
The documentation for this struct was generated from the following file: -
- - - - diff --git a/man/html/struct__pcp__rec__t-members.html b/man/html/struct__pcp__rec__t-members.html deleted file mode 100644 index 65e6db4..0000000 --- a/man/html/struct__pcp__rec__t-members.html +++ /dev/null @@ -1,64 +0,0 @@ - - - - - -libpcp: Member List - - - - - - -
-
- - - - - - -
-
libpcp -  0.2.1 -
-
-
- - - - -
-
-
-
_pcp_rec_t Member List
-
-
- -

This is the complete list of members for _pcp_rec_t, including all inherited members.

- - - - - -
cipher_pcp_rec_t
ciphersize_pcp_rec_t
pub_pcp_rec_t
secret_pcp_rec_t
- - - - diff --git a/man/html/struct__pcp__rec__t.html b/man/html/struct__pcp__rec__t.html deleted file mode 100644 index 0f4cd91..0000000 --- a/man/html/struct__pcp__rec__t.html +++ /dev/null @@ -1,155 +0,0 @@ - - - - - -libpcp: _pcp_rec_t Struct Reference - - - - - - -
-
- - - - - - -
-
libpcp -  0.2.1 -
-
-
- - - - -
-
- -
-
_pcp_rec_t Struct Reference
-
-
- -

Encrypted recipient list. - More...

- -

#include <key.h>

- - - - - - - - - - - - - - -

-Public Attributes

size_t ciphersize
 the size of the encrypted recipient list
 
byte * cipher
 contains the whole encrypted recipient list
 
pcp_key_tsecret
 the secret key of the recipient for signing
 
pcp_pubkey_tpub
 if verification were ok, contains the public key of the signer
 
-

Detailed Description

-

Encrypted recipient list.

-

Encrypted recipient list, required for crypt+sign contains the encrypted recipients and the secret key required for signing the message+recipients.

-

Used internally only.

- -

Definition at line 166 of file key.h.

-

Member Data Documentation

- -
-
- - - - -
byte* _pcp_rec_t::cipher
-
- -

contains the whole encrypted recipient list

- -

Definition at line 168 of file key.h.

- -
-
- -
-
- - - - -
size_t _pcp_rec_t::ciphersize
-
- -

the size of the encrypted recipient list

- -

Definition at line 167 of file key.h.

- -
-
- -
-
- - - - -
pcp_pubkey_t* _pcp_rec_t::pub
-
- -

if verification were ok, contains the public key of the signer

- -

Definition at line 170 of file key.h.

- -
-
- -
-
- - - - -
pcp_key_t* _pcp_rec_t::secret
-
- -

the secret key of the recipient for signing

- -

Definition at line 169 of file key.h.

- -
-
-
The documentation for this struct was generated from the following file: -
- - - - diff --git a/man/html/struct__pcp__stream__t-members.html b/man/html/struct__pcp__stream__t-members.html deleted file mode 100644 index f036c81..0000000 --- a/man/html/struct__pcp__stream__t-members.html +++ /dev/null @@ -1,65 +0,0 @@ - - - - - -libpcp: Member List - - - - - - -
-
- - - - - - -
-
libpcp -  0.2.1 -
-
-
- - - - -
-
-
-
_pcp_stream_t Member List
-
-
- -

This is the complete list of members for _pcp_stream_t, including all inherited members.

- - - - - - -
b_pcp_stream_t
eof_pcp_stream_t
err_pcp_stream_t
fd_pcp_stream_t
is_buffer_pcp_stream_t
- - - - diff --git a/man/html/struct__pcp__stream__t.html b/man/html/struct__pcp__stream__t.html deleted file mode 100644 index d3e473f..0000000 --- a/man/html/struct__pcp__stream__t.html +++ /dev/null @@ -1,172 +0,0 @@ - - - - - -libpcp: _pcp_stream_t Struct Reference - - - - - - -
-
- - - - - - -
-
libpcp -  0.2.1 -
-
-
- - - - -
-
- -
-
_pcp_stream_t Struct Reference
-
-
- -

An I/O wrapper object backed by a file or a buffer. - More...

- -

#include <pcpstream.h>

- - - - - - - - - - - - - - - - - -

-Public Attributes

FILE * fd
 The backend FILE stream.
 
Bufferb
 The backend Buffer object.
 
uint8_t is_buffer
 Set to 1 if the backend is a Buffer.
 
uint8_t eof
 Set to 1 if EOF reached.
 
uint8_t err
 Set to 1 if an error occured.
 
-

Detailed Description

-

An I/O wrapper object backed by a file or a buffer.

- -

Definition at line 58 of file pcpstream.h.

-

Member Data Documentation

- -
-
- - - - -
Buffer* _pcp_stream_t::b
-
- -

The backend Buffer object.

- -

Definition at line 60 of file pcpstream.h.

- -
-
- -
-
- - - - -
uint8_t _pcp_stream_t::eof
-
- -

Set to 1 if EOF reached.

- -

Definition at line 62 of file pcpstream.h.

- -
-
- -
-
- - - - -
uint8_t _pcp_stream_t::err
-
- -

Set to 1 if an error occured.

- -

Definition at line 63 of file pcpstream.h.

- -
-
- -
-
- - - - -
FILE* _pcp_stream_t::fd
-
- -

The backend FILE stream.

- -

Definition at line 59 of file pcpstream.h.

- -
-
- -
-
- - - - -
uint8_t _pcp_stream_t::is_buffer
-
- -

Set to 1 if the backend is a Buffer.

- -

Definition at line 61 of file pcpstream.h.

- -
-
-
The documentation for this struct was generated from the following file: -
- - - - diff --git a/man/html/struct__vault__header__t-members.html b/man/html/struct__vault__header__t-members.html deleted file mode 100644 index 9beb76d..0000000 --- a/man/html/struct__vault__header__t-members.html +++ /dev/null @@ -1,63 +0,0 @@ - - - - - -libpcp: Member List - - - - - - -
-
- - - - - - -
-
libpcp -  0.2.1 -
-
-
- - - - -
-
-
-
_vault_header_t Member List
-
-
- -

This is the complete list of members for _vault_header_t, including all inherited members.

- - - - -
checksum_vault_header_t
fileid_vault_header_t
version_vault_header_t
- - - - diff --git a/man/html/struct__vault__header__t.html b/man/html/struct__vault__header__t.html deleted file mode 100644 index 4ee8c91..0000000 --- a/man/html/struct__vault__header__t.html +++ /dev/null @@ -1,135 +0,0 @@ - - - - - -libpcp: _vault_header_t Struct Reference - - - - - - -
-
- - - - - - -
-
libpcp -  0.2.1 -
-
-
- - - - -
-
- -
-
_vault_header_t Struct Reference
-
-
- -

Defines the vault header. - More...

- -

#include <vault.h>

- - - - - - - - - - - -

-Public Attributes

uint8_t fileid
 File id, proprietary.
 
uint32_t version
 File version.
 
byte checksum [32]
 SHA256 checksum over the whole vault.
 
-

Detailed Description

-

Defines the vault header.

- -

Definition at line 112 of file vault.h.

-

Member Data Documentation

- -
-
- - - - -
byte _vault_header_t::checksum[32]
-
- -

SHA256 checksum over the whole vault.

- -

Definition at line 115 of file vault.h.

- -
-
- -
-
- - - - -
uint8_t _vault_header_t::fileid
-
- -

File id, proprietary.

-

Marks the vault as a vault

- -

Definition at line 113 of file vault.h.

- -
-
- -
-
- - - - -
uint32_t _vault_header_t::version
-
- -

File version.

- -

Definition at line 114 of file vault.h.

- -
-
-
The documentation for this struct was generated from the following file: -
- - - - diff --git a/man/html/struct__vault__item__header__t-members.html b/man/html/struct__vault__item__header__t-members.html deleted file mode 100644 index 3cfcedb..0000000 --- a/man/html/struct__vault__item__header__t-members.html +++ /dev/null @@ -1,64 +0,0 @@ - - - - - -libpcp: Member List - - - - - - -
-
- - - - - - -
-
libpcp -  0.2.1 -
-
-
- - - - -
-
-
-
_vault_item_header_t Member List
-
-
- -

This is the complete list of members for _vault_item_header_t, including all inherited members.

- - - - - -
checksum_vault_item_header_t
size_vault_item_header_t
type_vault_item_header_t
version_vault_item_header_t
- - - - diff --git a/man/html/struct__vault__item__header__t.html b/man/html/struct__vault__item__header__t.html deleted file mode 100644 index 397534a..0000000 --- a/man/html/struct__vault__item__header__t.html +++ /dev/null @@ -1,154 +0,0 @@ - - - - - -libpcp: _vault_item_header_t Struct Reference - - - - - - -
-
- - - - - - -
-
libpcp -  0.2.1 -
-
-
- - - - -
-
- -
-
_vault_item_header_t Struct Reference
-
-
- -

An item header. - More...

- -

#include <vault.h>

- - - - - - - - - - - - - - -

-Public Attributes

uint8_t type
 Item type (secret key, public, key, keysig,.
 
uint32_t size
 Size of the item.
 
uint32_t version
 Version of the item.
 
byte checksum [32]
 SHA256 checksum of the item.
 
-

Detailed Description

-

An item header.

- -

Definition at line 123 of file vault.h.

-

Member Data Documentation

- -
-
- - - - -
byte _vault_item_header_t::checksum[32]
-
- -

SHA256 checksum of the item.

- -

Definition at line 127 of file vault.h.

- -
-
- -
-
- - - - -
uint32_t _vault_item_header_t::size
-
- -

Size of the item.

- -

Definition at line 125 of file vault.h.

- -
-
- -
-
- - - - -
uint8_t _vault_item_header_t::type
-
- -

Item type (secret key, public, key, keysig,.

-
See Also
_PCP_KEY_TYPES
- -

Definition at line 124 of file vault.h.

- -
-
- -
-
- - - - -
uint32_t _vault_item_header_t::version
-
- -

Version of the item.

- -

Definition at line 126 of file vault.h.

- -
-
-
The documentation for this struct was generated from the following file: -
- - - - diff --git a/man/html/struct__vault__t-members.html b/man/html/struct__vault__t-members.html deleted file mode 100644 index 2d9aad9..0000000 --- a/man/html/struct__vault__t-members.html +++ /dev/null @@ -1,69 +0,0 @@ - - - - - -libpcp: Member List - - - - - - -
-
- - - - - - -
-
libpcp -  0.2.1 -
-
-
- - - - -
-
-
-
_vault_t Member List
-
-
- -

This is the complete list of members for _vault_t, including all inherited members.

- - - - - - - - - - -
checksum_vault_t
fd_vault_t
filename_vault_t
isnew_vault_t
mode_vault_t
modified_vault_t
size_vault_t
unsafed_vault_t
version_vault_t
- - - - diff --git a/man/html/struct__vault__t.html b/man/html/struct__vault__t.html deleted file mode 100644 index 2bdcbaf..0000000 --- a/man/html/struct__vault__t.html +++ /dev/null @@ -1,248 +0,0 @@ - - - - - -libpcp: _vault_t Struct Reference - - - - - - -
-
- - - - - - -
-
libpcp -  0.2.1 -
-
-
- - - - -
-
- -
-
_vault_t Struct Reference
-
-
- -

This structure represents a vault. - More...

- -

#include <vault.h>

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

-Public Attributes

char * filename
 The filename of the vault (full path)
 
FILE * fd
 Filehandle if opened.
 
uint8_t unsafed
 Flag to tell if the file needs to be written.
 
uint8_t isnew
 Flag to tell if the vault has been newly created.
 
uint32_t size
 Filesize.
 
time_t modified
 mtime
 
mode_t mode
 File mode.
 
uint32_t version
 Vault version.
 
byte checksum [32]
 SHA256 checksum over the whole vault.
 
-

Detailed Description

-

This structure represents a vault.

- -

Definition at line 95 of file vault.h.

-

Member Data Documentation

- -
-
- - - - -
byte _vault_t::checksum[32]
-
- -

SHA256 checksum over the whole vault.

- -

Definition at line 104 of file vault.h.

- -
-
- -
-
- - - - -
FILE* _vault_t::fd
-
- -

Filehandle if opened.

- -

Definition at line 97 of file vault.h.

- -
-
- -
-
- - - - -
char* _vault_t::filename
-
- -

The filename of the vault (full path)

- -

Definition at line 96 of file vault.h.

- -
-
- -
-
- - - - -
uint8_t _vault_t::isnew
-
- -

Flag to tell if the vault has been newly created.

- -

Definition at line 99 of file vault.h.

- -
-
- -
-
- - - - -
mode_t _vault_t::mode
-
- -

File mode.

- -

Definition at line 102 of file vault.h.

- -
-
- -
-
- - - - -
time_t _vault_t::modified
-
- -

mtime

- -

Definition at line 101 of file vault.h.

- -
-
- -
-
- - - - -
uint32_t _vault_t::size
-
- -

Filesize.

- -

Definition at line 100 of file vault.h.

- -
-
- -
-
- - - - -
uint8_t _vault_t::unsafed
-
- -

Flag to tell if the file needs to be written.

- -

Definition at line 98 of file vault.h.

- -
-
- -
-
- - - - -
uint32_t _vault_t::version
-
- -

Vault version.

- -

Definition at line 103 of file vault.h.

- -
-
-
The documentation for this struct was generated from the following file: -
- - - - diff --git a/man/html/sync_off.png b/man/html/sync_off.png deleted file mode 100644 index 3b443fc..0000000 Binary files a/man/html/sync_off.png and /dev/null differ diff --git a/man/html/sync_on.png b/man/html/sync_on.png deleted file mode 100644 index e08320f..0000000 Binary files a/man/html/sync_on.png and /dev/null differ diff --git a/man/html/tab_a.png b/man/html/tab_a.png deleted file mode 100644 index 3b725c4..0000000 Binary files a/man/html/tab_a.png and /dev/null differ diff --git a/man/html/tab_b.png b/man/html/tab_b.png deleted file mode 100644 index 5f6601a..0000000 Binary files a/man/html/tab_b.png and /dev/null differ diff --git a/man/html/tab_h.png b/man/html/tab_h.png deleted file mode 100644 index fd5cb70..0000000 Binary files a/man/html/tab_h.png and /dev/null differ diff --git a/man/html/tab_s.png b/man/html/tab_s.png deleted file mode 100644 index ab478c9..0000000 Binary files a/man/html/tab_s.png and /dev/null differ diff --git a/man/html/tabs.css b/man/html/tabs.css deleted file mode 100644 index 9cf578f..0000000 --- a/man/html/tabs.css +++ /dev/null @@ -1,60 +0,0 @@ -.tabs, .tabs2, .tabs3 { - background-image: url('tab_b.png'); - width: 100%; - z-index: 101; - font-size: 13px; - font-family: 'Lucida Grande',Geneva,Helvetica,Arial,sans-serif; -} - -.tabs2 { - font-size: 10px; -} -.tabs3 { - font-size: 9px; -} - -.tablist { - margin: 0; - padding: 0; - display: table; -} - -.tablist li { - float: left; - display: table-cell; - background-image: url('tab_b.png'); - line-height: 36px; - list-style: none; -} - -.tablist a { - display: block; - padding: 0 20px; - font-weight: bold; - background-image:url('tab_s.png'); - background-repeat:no-repeat; - background-position:right; - color: #283A5D; - text-shadow: 0px 1px 1px rgba(255, 255, 255, 0.9); - text-decoration: none; - outline: none; -} - -.tabs3 .tablist a { - padding: 0 10px; -} - -.tablist a:hover { - background-image: url('tab_h.png'); - background-repeat:repeat-x; - color: #fff; - text-shadow: 0px 1px 1px rgba(0, 0, 0, 1.0); - text-decoration: none; -} - -.tablist li.current a { - background-image: url('tab_a.png'); - background-repeat:repeat-x; - color: #fff; - text-shadow: 0px 1px 1px rgba(0, 0, 0, 1.0); -} diff --git a/man/html/util_8h_source.html b/man/html/util_8h_source.html deleted file mode 100644 index b4f36f2..0000000 --- a/man/html/util_8h_source.html +++ /dev/null @@ -1,106 +0,0 @@ - - - - - -libpcp: util.h Source File - - - - - - -
-
- - - - - - -
-
libpcp -  0.2.1 -
-
-
- - - - - -
-
-
-
util.h
-
-
-
1 /*
-
2  This file is part of Pretty Curved Privacy (pcp1).
-
3 
-
4  Copyright (C) 2013 T. von Dein.
-
5 
-
6  This program is free software: you can redistribute it and/or modify
-
7  it under the terms of the GNU General Public License as published by
-
8  the Free Software Foundation, either version 3 of the License, or
-
9  (at your option) any later version.
-
10 
-
11  This program is distributed in the hope that it will be useful,
-
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
-
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-
14  GNU General Public License for more details.
-
15 
-
16  You should have received a copy of the GNU General Public License
-
17  along with this program. If not, see <http://www.gnu.org/licenses/>.
-
18 
-
19  You can contact me by mail: <tlinden AT cpan DOT org>.
-
20 */
-
21 
-
22 
-
23 /* various helpers, too small to put into own c */
-
24 
-
25 #ifndef _HAVE_PCP_UTIL_H
-
26 #define _HAVE_PCP_UTIL_H
-
27 
-
34 #include <ctype.h>
-
35 #include <wctype.h>
-
36 #include <stdlib.h>
-
37 #include <string.h>
-
38 #include <stdio.h>
-
39 
-
40 
-
41 
-
42 
-
53 char *_lc(char *in);
-
54 
-
77 size_t _findoffset(unsigned char *bin, size_t binlen, char *sigstart, size_t hlen);
-
78 
-
90 void _xorbuf(unsigned char *iv, unsigned char *buf, size_t xlen);
-
91 
-
100 void _dump(char *n, unsigned char *d, size_t s);
-
101 
-
102 #endif /* _HAVE_PCP_UTIL_H */
-
103 
-
- - - - diff --git a/man/html/vault_8h_source.html b/man/html/vault_8h_source.html deleted file mode 100644 index 848b0b9..0000000 --- a/man/html/vault_8h_source.html +++ /dev/null @@ -1,179 +0,0 @@ - - - - - -libpcp: vault.h Source File - - - - - - -
-
- - - - - - -
-
libpcp -  0.2.1 -
-
-
- - - - - -
-
-
-
vault.h
-
-
-
1 /*
-
2  This file is part of Pretty Curved Privacy (pcp1).
-
3 
-
4  Copyright (C) 2013-2014 T.v.Dein.
-
5 
-
6  This program is free software: you can redistribute it and/or modify
-
7  it under the terms of the GNU General Public License as published by
-
8  the Free Software Foundation, either version 3 of the License, or
-
9  (at your option) any later version.
-
10 
-
11  This program is distributed in the hope that it will be useful,
-
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
-
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-
14  GNU General Public License for more details.
-
15 
-
16  You should have received a copy of the GNU General Public License
-
17  along with this program. If not, see <http://www.gnu.org/licenses/>.
-
18 
-
19  You can contact me by mail: <tom AT vondein DOT org>.
-
20 */
-
21 
-
22 
-
23 #ifndef _HAVE_PCP_VAULT
-
24 #define _HAVE_PCP_VAULT
-
25 
-
79 #include <sys/types.h>
-
80 #include <sys/stat.h>
-
81 #include <stdio.h>
-
82 #include <sodium.h>
-
83 #include <unistd.h>
-
84 
-
85 #include "defines.h"
-
86 #include "platform.h"
-
87 #include "mem.h"
-
88 #include "key.h"
-
89 #include "uthash.h"
-
90 #include "buffer.h"
-
91 #include "keysig.h"
-
92 
-
95 struct _vault_t {
-
96  char *filename;
-
97  FILE *fd;
-
98  uint8_t unsafed;
-
99  uint8_t isnew;
-
100  uint32_t size;
-
101  time_t modified;
-
102  mode_t mode;
-
103  uint32_t version;
-
104  byte checksum[32];
-
105 };
-
106 
-
108 typedef struct _vault_t vault_t;
-
109 
- -
113  uint8_t fileid;
-
114  uint32_t version;
-
115  byte checksum[32];
-
116 };
-
117 
- -
120 
- -
124  uint8_t type;
-
125  uint32_t size;
-
126  uint32_t version;
-
127  byte checksum[32];
-
128 };
-
129 
- -
132 
-
140 vault_t *pcpvault_init(char *filename);
-
141 
-
142 
-
143 /* Creates a new vault file. Called internally only.
-
144  If is_tmp If set to 1, create a temporary vault file.
-
145  */
-
146 vault_t *pcpvault_new(char *filename, int is_tmp);
-
147 
-
148 
-
149 /* Writes the initial vault header to the vault.
-
150  Called internally only. */
-
151 int pcpvault_create(vault_t *vault);
-
152 
-
153 
-
171 int pcpvault_additem(vault_t *vault, void *item, size_t itemsize, uint8_t type);
-
172 
-
173 
-
192 int pcpvault_addkey(vault_t *vault, void *item, uint8_t type);
-
193 
-
194 
-
209 int pcpvault_close(vault_t *vault);
-
210 
-
211 
-
230 int pcpvault_fetchall(vault_t *vault);
-
231 
-
232 
-
233 /* Write everything back to disk. */
-
234 int pcpvault_writeall(vault_t *vault);
-
235 
-
236 /* copy a vault to another file */
-
237 int pcpvault_copy(vault_t *tmp, vault_t *vault);
-
238 
-
239 /* delete a vault file */
-
240 void pcpvault_unlink(vault_t *tmp);
-
241 
-
242 /* calculate the vault checksum */
-
243 unsigned char *pcpvault_create_checksum(vault_t *vault);
-
244 
-
245 /* write the new checksum to the header of the current vault */
-
246 void pcpvault_update_checksum(vault_t *vault);
-
247 
-
248 /* bigendian converters */
-
249 vault_header_t * vh2be(vault_header_t *h);
-
250 vault_header_t * vh2native(vault_header_t *h);
- - -
253 
-
254 #endif /* _HAVE_PCP_VAULT */
-
255 
-
- - - - diff --git a/man/html/version_8h_source.html b/man/html/version_8h_source.html deleted file mode 100644 index 63673b9..0000000 --- a/man/html/version_8h_source.html +++ /dev/null @@ -1,97 +0,0 @@ - - - - - -libpcp: version.h Source File - - - - - - -
-
- - - - - - -
-
libpcp -  0.2.1 -
-
-
- - - - - -
-
-
-
version.h
-
-
-
1 /*
-
2  This file is part of Pretty Curved Privacy (pcp1).
-
3 
-
4  Copyright (C) 2013 T.Linden.
-
5 
-
6  This program is free software: you can redistribute it and/or modify
-
7  it under the terms of the GNU General Public License as published by
-
8  the Free Software Foundation, either version 3 of the License, or
-
9  (at your option) any later version.
-
10 
-
11  This program is distributed in the hope that it will be useful,
-
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
-
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-
14  GNU General Public License for more details.
-
15 
-
16  You should have received a copy of the GNU General Public License
-
17  along with this program. If not, see <http://www.gnu.org/licenses/>.
-
18 
-
19  You can contact me by mail: <tlinden AT cpan DOT org>.
-
20 */
-
21 
-
22 
-
23 #ifndef _HAVE_PCP_VERSION
-
24 #define _HAVE_PCP_VERSION
-
25 
-
26 #define PCP_VERSION_MAJOR 0
-
27 #define PCP_VERSION_MINOR 2
-
28 #define PCP_VERSION_PATCH 1
-
29 
-
30 #define PCP_MAKE_VERSION(major, minor, patch) \
-
31  ((major) * 10000 + (minor) * 100 + (patch))
-
32 #define PCP_VERSION \
-
33  PCP_MAKE_VERSION(PCP_VERSION_MAJOR, PCP_VERSION_MINOR, PCP_VERSION_PATCH)
-
34 
-
35 int pcp_version();
-
36 
-
37 #endif /* _HAVE_PCP_VERSION */
-
- - - - diff --git a/man/html/z85_8h_source.html b/man/html/z85_8h_source.html deleted file mode 100644 index 8d996ae..0000000 --- a/man/html/z85_8h_source.html +++ /dev/null @@ -1,109 +0,0 @@ - - - - - -libpcp: z85.h Source File - - - - - - -
-
- - - - - - -
-
libpcp -  0.2.1 -
-
-
- - - - - -
-
-
-
z85.h
-
-
-
1 /*
-
2  This file is part of Pretty Curved Privacy (pcp1).
-
3 
-
4  Copyright (C) 2013-2014 T.v.Dein.
-
5 
-
6  This program is free software: you can redistribute it and/or modify
-
7  it under the terms of the GNU General Public License as published by
-
8  the Free Software Foundation, either version 3 of the License, or
-
9  (at your option) any later version.
-
10 
-
11  This program is distributed in the hope that it will be useful,
-
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
-
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-
14  GNU General Public License for more details.
-
15 
-
16  You should have received a copy of the GNU General Public License
-
17  along with this program. If not, see <http://www.gnu.org/licenses/>.
-
18 
-
19  You can contact me by mail: <tom AT vondein DOT org>.
-
20 */
-
21 
-
22 
-
23 /* from https://github.com/tlinden/curve-keygen/ */
-
24 #ifndef _HAVE_PCP_Z85_H
-
25 
-
42 #include <ctype.h>
-
43 #include "defines.h"
-
44 #include "zmq_z85.h"
-
45 #include "mem.h"
-
46 #include "buffer.h"
-
47 
-
60 unsigned char *pcp_padfour(unsigned char *src, size_t srclen, size_t *dstlen);
-
61 
-
62 
-
73 size_t pcp_unpadfour(unsigned char *src, size_t srclen);
-
74 
-
86 unsigned char *pcp_z85_decode(char *z85block, size_t *dstlen);
-
87 
-
88 
-
99 char *pcp_z85_encode(unsigned char *raw, size_t srclen, size_t *dstlen);
-
100 
-
110 char *pcp_readz85file(FILE *infile);
-
111 
-
123 char *pcp_readz85string(unsigned char *input, size_t bufsize);
-
124 
-
125 size_t _buffer_is_binary(unsigned char *buf, size_t len);
-
126 
-
127 #endif /* _HAVE_PCP_Z85_H */
-
128 
-
- - - - diff --git a/tests/Makefile.am b/tests/Makefile.am index 4a00126..80bc842 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -20,7 +20,7 @@ # AM_CFLAGS = -I../include/pcp -I../src -I../libpcp/scrypt/crypto -Wall -g -check_PROGRAMS = col invalidkeys pwhashes gencheader statictest cpptest buffertest sample +check_PROGRAMS = col invalidkeys pwhashes gencheader statictest cpptest buffertest sample streamtest gencheader_LDADD = ../libpcp/.libs/libpcp1.a gencheader_SOURCES = gencheader.c @@ -34,7 +34,8 @@ buffertest_SOURCES = buffertest.c sample_LDADD = ../libpcp/.libs/libpcp1.a sample_SOURCES = sample.c - +streamtest_LDADD = ../libpcp/.libs/libpcp1.a +streamtest_SOURCES = streamtest.c col_LDADD = ../libpcp/.libs/libpcp1.a col_SOURCES = collisions.c ../src/compat_getopt.c diff --git a/tests/streamtest.c b/tests/streamtest.c index ff8a694..9d54306 100644 --- a/tests/streamtest.c +++ b/tests/streamtest.c @@ -9,8 +9,8 @@ int main() { FILE *out, *in; unsigned char clear[8] = "ABCDEFGH"; unsigned char key[8] = "IxD8Lq1K"; - unsigned char crypt[8] = {0}; - int blocks = 8; + unsigned char crypt[11] = {0}; + int blocks = 24; int i = 0; if((out = fopen("teststream.out", "wb+")) == NULL) { @@ -18,6 +18,7 @@ int main() { return 1; } Pcpstream *pout = ps_new_file(out); + ps_armor(pout); /* "encrypt" a couple of times into the file */ for(i=0; i