e0fde75fc63100234052e635c3a78ad7473a35bc
[u/mdw/catacomb] / ec-raw.h
1 /* -*-c-*-
2 *
3 * $Id: ec-raw.h,v 1.1 2004/04/04 19:04:11 mdw Exp $
4 *
5 * Raw formatting of elliptic curve points
6 *
7 * (c) 2004 Straylight/Edgeware
8 */
9
10 /*----- Licensing notice --------------------------------------------------*
11 *
12 * This file is part of Catacomb.
13 *
14 * Catacomb is free software; you can redistribute it and/or modify
15 * it under the terms of the GNU Library General Public License as
16 * published by the Free Software Foundation; either version 2 of the
17 * License, or (at your option) any later version.
18 *
19 * Catacomb is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU Library General Public License for more details.
23 *
24 * You should have received a copy of the GNU Library General Public
25 * License along with Catacomb; if not, write to the Free
26 * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
27 * MA 02111-1307, USA.
28 */
29
30 /*----- Revision history --------------------------------------------------*
31 *
32 * $Log: ec-raw.h,v $
33 * Revision 1.1 2004/04/04 19:04:11 mdw
34 * Raw I/O of elliptic curve points and group elements.
35 *
36 */
37
38 #ifndef CATACOMB_EC_RAW_H
39 #define CATACOMB_EC_RAW_H
40
41 #ifdef __cplusplus
42 extern "C" {
43 #endif
44
45 /*----- Header files ------------------------------------------------------*/
46
47 #ifndef CATACOMB_BUF_H
48 # include "buf.h"
49 #endif
50
51 #ifndef CATACOMB_EC_H
52 # include "ec.h"
53 #endif
54
55 /*----- Data formatting ---------------------------------------------------*/
56
57 /* --- @ec_putraw@ --- *
58 *
59 * Arguments: @ec_curve *c@ = elliptic curve
60 * @buf *b@ = pointer to a buffer
61 * @const ec *p@ = an elliptic curve point
62 *
63 * Returns: Zero on success, nonzero on failure.
64 *
65 * Use: Puts an elliptic curve point to the given buffer using the
66 * standard uncompressed format described in P1383 and SEC1.
67 * We don't do point compression.
68 */
69
70 extern int ec_putraw(ec_curve */*c*/, buf */*b*/, const ec */*p*/);
71
72 /* --- @ec_getraw@ --- *
73 *
74 * Arguments: @ec_curve *c@ = elliptic curve
75 * @buf *b@ = pointer to a buffer
76 * @ec *d@ = an elliptic curve point
77 *
78 * Returns: Zero on success, nonzero on failure.
79 *
80 * Use: Reads an elliptic curve point from the given buffer using the
81 * standard uncompressed format described in P1383 and SEC1.
82 * We don't do point compression.
83 */
84
85 extern int ec_getraw(ec_curve */*c*/, buf */*b*/, ec */*d*/);
86
87 /*----- That's all, folks -------------------------------------------------*/
88
89 #ifdef __cplusplus
90 }
91 #endif
92
93 #endif