~timkross/cjdns/cjdns

« back to all changes in this revision

Viewing changes to crypto/seccure/serialize.h

  • Committer: cjdelisle
  • Date: 2011-02-16 23:03:00 UTC
  • Revision ID: git-v1:d475c9c10adc25590bea5e7dc5383b32f66d5eb8
First commit for cjdns.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 *  seccure  -  Copyright 2009 B. Poettering
 
3
 *
 
4
 *  This program is free software; you can redistribute it and/or
 
5
 *  modify it under the terms of the GNU General Public License as
 
6
 *  published by the Free Software Foundation; either version 2 of the
 
7
 *  License, or (at your option) any later version.
 
8
 *
 
9
 *  This program is distributed in the hope that it will be useful,
 
10
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 
11
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
12
 *  General Public License for more details.
 
13
 *
 
14
 *  You should have received a copy of the GNU General Public License
 
15
 *  along with this program; if not, write to the Free Software
 
16
 *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
 
17
 *  02111-1307 USA
 
18
 */
 
19
 
 
20
/* 
 
21
 *   SECCURE Elliptic Curve Crypto Utility for Reliable Encryption
 
22
 *
 
23
 *              http://point-at-infinity.org/seccure/
 
24
 *
 
25
 *
 
26
 * seccure implements a selection of asymmetric algorithms based on  
 
27
 * elliptic curve cryptography (ECC). See the manpage or the project's  
 
28
 * homepage for further details.
 
29
 *
 
30
 * This code links against the GNU gcrypt library "libgcrypt" (which
 
31
 * is part of the GnuPG project). Use the included Makefile to build
 
32
 * the binary.
 
33
 * 
 
34
 * Report bugs to: seccure AT point-at-infinity.org
 
35
 *
 
36
 */
 
37
 
 
38
#ifndef INC_SERIALIZE_H
 
39
#define INC_SERIALIZE_H
 
40
 
 
41
#include <gcrypt.h>
 
42
#include "curves.h"
 
43
 
 
44
#define COMPACT_DIGITS_COUNT 90
 
45
extern const char compact_digits[];
 
46
 
 
47
#define BASE36_DIGIT_COUNT 36
 
48
extern const char base36_digits[];
 
49
 
 
50
int get_serialization_len(const gcry_mpi_t x, enum disp_format df);
 
51
void serialize_mpi(char *outbuf, int outlen, enum disp_format df, 
 
52
                   const gcry_mpi_t x);
 
53
int deserialize_mpi(gcry_mpi_t *x, enum disp_format ds, const char *buf, 
 
54
                    int inlen);
 
55
 
 
56
#endif /* INC_SERIALIZE_H */