hashsum.c: Return nonzero from `checkhash' on errors.
[u/mdw/catacomb] / ec-raw.h
1 /* -*-c-*-
2 *
3 * $Id: ec-raw.h,v 1.2 2004/04/08 01:36:15 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 #ifndef CATACOMB_EC_RAW_H
31 #define CATACOMB_EC_RAW_H
32
33 #ifdef __cplusplus
34 extern "C" {
35 #endif
36
37 /*----- Header files ------------------------------------------------------*/
38
39 #ifndef CATACOMB_BUF_H
40 # include "buf.h"
41 #endif
42
43 #ifndef CATACOMB_EC_H
44 # include "ec.h"
45 #endif
46
47 /*----- Data formatting ---------------------------------------------------*/
48
49 /* --- @ec_putraw@ --- *
50 *
51 * Arguments: @ec_curve *c@ = elliptic curve
52 * @buf *b@ = pointer to a buffer
53 * @const ec *p@ = an elliptic curve point
54 *
55 * Returns: Zero on success, nonzero on failure.
56 *
57 * Use: Puts an elliptic curve point to the given buffer using the
58 * standard uncompressed format described in P1383 and SEC1.
59 * We don't do point compression.
60 */
61
62 extern int ec_putraw(ec_curve */*c*/, buf */*b*/, const ec */*p*/);
63
64 /* --- @ec_getraw@ --- *
65 *
66 * Arguments: @ec_curve *c@ = elliptic curve
67 * @buf *b@ = pointer to a buffer
68 * @ec *d@ = an elliptic curve point
69 *
70 * Returns: Zero on success, nonzero on failure.
71 *
72 * Use: Reads an elliptic curve point from the given buffer using the
73 * standard uncompressed format described in P1383 and SEC1.
74 * We don't do point compression.
75 */
76
77 extern int ec_getraw(ec_curve */*c*/, buf */*b*/, ec */*d*/);
78
79 /*----- That's all, folks -------------------------------------------------*/
80
81 #ifdef __cplusplus
82 }
83 #endif
84
85 #endif