--- /dev/null
+/* -*-c-*-
+ *
+ * $Id: pkcs1.h,v 1.1 2000/07/01 11:17:38 mdw Exp $
+ *
+ * PKCS#1 1.5 packing
+ *
+ * (c) 2000 Straylight/Edgeware
+ */
+
+/*----- Licensing notice --------------------------------------------------*
+ *
+ * This file is part of Catacomb.
+ *
+ * Catacomb is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Library General Public License as
+ * published by the Free Software Foundation; either version 2 of the
+ * License, or (at your option) any later version.
+ *
+ * Catacomb is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with Catacomb; if not, write to the Free
+ * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
+ * MA 02111-1307, USA.
+ */
+
+/*----- Revision history --------------------------------------------------*
+ *
+ * $Log: pkcs1.h,v $
+ * Revision 1.1 2000/07/01 11:17:38 mdw
+ * New support for PKCS#1 message encoding.
+ *
+ */
+
+#ifndef CATACOMB_PKCS1_H
+#define CATACOMB_PKCS1_H
+
+#ifdef __cplusplus
+ extern "C" {
+#endif
+
+/*----- Header files ------------------------------------------------------*/
+
+#include <mLib/bits.h>
+#include <mLib/dstr.h>
+
+#ifndef CATACOMB_GRAND_H
+# include "grand.h"
+#endif
+
+/*----- Data structures ---------------------------------------------------*/
+
+typedef struct pkcs1 {
+ grand *r; /* Random number source */
+ const void *ep; /* Encoding parameters block */
+ size_t epsz; /* Size of the parameter block */
+} pkcs1;
+
+/*----- Functions provided ------------------------------------------------*/
+
+/* --- @pkcs1_cryptencode@ --- *
+ *
+ * Arguments: @const void *msg@ = pointer to message data
+ * @size_t msz@ = size of message data
+ * @void *buf@ = pointer to output buffer
+ * @size_t sz@ = size of the output buffer
+ * @void *p@ = pointer to PKCS1 parameter block
+ *
+ * Returns: Zero if all went well, negative on failure.
+ *
+ * Use: Implements the operation @EME-PKCS1-V1_5-ENCODE@, as defined
+ * in PKCS#1 v. 2.0 (RFC2437).
+ */
+
+extern int pkcs1_cryptencode(const void */*msg*/, size_t /*msz*/,
+ void */*buf*/, size_t /*sz*/, void */*p*/);
+
+/* --- @pkcs1_cryptdecode@ --- *
+ *
+ * Arguments: @const void *buf@ = pointer to encoded buffer)
+ * @size_t sz@ = size of the encoded buffer
+ * @dstr *d@ = pointer to destination string
+ * @void *p@ = pointer to PKCS1 parameter block
+ *
+ * Returns: The length of the output string if successful, negative on
+ * failure.
+ *
+ * Use: Implements the operation @EME-PKCS1-V1_5-DECODE@, as defined
+ * in PKCS#1 v. 2.0 (RFC2437).
+ */
+
+extern int pkcs1_cryptdecode(const void */*buf*/, size_t /*sz*/,
+ dstr */*d*/, void */*p*/);
+
+/* --- @pkcs1_sigencode@ --- *
+ *
+ * Arguments: @const void *msg@ = pointer to message data
+ * @size_t msz@ = size of message data
+ * @void *buf@ = pointer to output buffer
+ * @size_t sz@ = size of the output buffer
+ * @void *p@ = pointer to PKCS1 parameter block
+ *
+ * Returns: Zero if all went well, negative on failure.
+ *
+ * Use: Implements the operation @EMSA-PKCS1-V1_5-ENCODE@, as defined
+ * in PKCS#1 v. 2.0 (RFC2437).
+ */
+
+extern int pkcs1_sigencode(const void */*msg*/, size_t /*msz*/,
+ void */*buf*/, size_t /*sz*/, void */*p*/);
+
+/* --- @pkcs1_sigdecode@ --- *
+ *
+ * Arguments: @const void *buf@ = pointer to encoded buffer
+ * @size_t sz@ = size of the encoded buffer
+ * @dstr *d@ = pointer to destination string
+ * @void *p@ = pointer to PKCS1 parameter block
+ *
+ * Returns: The length of the output string if successful, negative on
+ * failure.
+ *
+ * Use: Implements the operation @EMSA-PKCS1-V1_5-DECODE@, as defined
+ * in PKCS#1 v. 2.0 (RFC2437).
+ */
+
+extern int pkcs1_sigdecode(const void */*buf*/, size_t /*sz*/,
+ dstr */*d*/, void */*p*/);
+
+/*----- That's all, folks -------------------------------------------------*/
+
+#ifdef __cplusplus
+ }
+#endif
+
+#endif