+/* --- @rsa_privdestroy@ --- *
+ *
+ * Arguments: @rsa_privctx *rd@ = pointer to an RSA decryption context
+ *
+ * Returns: ---
+ *
+ * Use: Destroys an RSA decryption context.
+ */
+
+extern void rsa_privdestroy(rsa_privctx */*rd*/);
+
+/* --- @rsa_privop@ --- *
+ *
+ * Arguments: @rsa_privctx *rd@ = pointer to RSA private key context
+ * @mp *d@ = destination
+ * @mp *c@ = input message
+ *
+ * Returns: The transformed output message.
+ *
+ * Use: Performs an RSA private key operation. This function takes
+ * advantage of knowledge of the key factors in order to speed
+ * up decryption. It also blinds the ciphertext prior to
+ * decryption and unblinds it afterwards to thwart timing
+ * attacks.
+ */
+
+extern mp *rsa_privop(rsa_privctx */*rd*/, mp */*d*/, mp */*c*/);
+
+/* --- @rsa_qprivop@ --- *
+ *
+ * Arguments: @rsa_priv *rp@ = pointer to RSA parameters
+ * @mp *d@ = destination
+ * @mp *c@ = input message
+ * @grand *r@ = pointer to random number source for blinding
+ *
+ * Returns: Correctly transformed output message
+ *
+ * Use: Performs an RSA private key operation, very carefully.
+ */
+
+extern mp *rsa_qprivop(rsa_priv */*rp*/, mp */*d*/, mp */*c*/, grand */*r*/);
+
+/* --- @rsa_sign@ --- *
+ *
+ * Arguments: @rsa_privctx *rp@ = pointer to an RSA private key context
+ * @const void *m@ = pointer to input message
+ * @size_t sz@ = size of input message
+ * @dstr *d@ = pointer to output string
+ * @rsa_encodeproc e@ = encoding procedure
+ * @void *earg@ = argument pointer for encoding procedure
+ *
+ * Returns: The length of the output string if successful, negative on
+ * failure.
+ *
+ * Use: Computes an RSA digital signature.
+ */
+
+extern int rsa_sign(rsa_privctx */*rp*/, const void */*m*/, size_t /*sz*/,
+ dstr */*d*/, rsa_encodeproc /*e*/, void */*earg*/);
+
+/* --- @rsa_decrypt@ --- *
+ *
+ * Arguments: @rsa_privctx *rp@ = pointer to an RSA private key context
+ * @const void *m@ = pointer to input message
+ * @size_t sz@ = size of input message
+ * @dstr *d@ = pointer to output string
+ * @rsa_decodeproc e@ = decoding procedure
+ * @void *earg@ = argument pointer for decoding procedure
+ *
+ * Returns: The length of the output string if successful, negative on
+ * failure.
+ *
+ * Use: Does RSA signature verification.
+ */
+
+extern int rsa_decrypt(rsa_privctx */*rp*/, const void */*m*/, size_t /*sz*/,
+ dstr */*d*/, rsa_decodeproc /*e*/, void */*earg*/);
+
+/*----- RSA public key operations -----------------------------------------*/
+
+/* --- @rsa_pubcreate@ --- *
+ *
+ * Arguments: @rsa_pubctx *rd@ = pointer to an RSA public key context
+ * @rsa_pub *rp@ = pointer to RSA public key
+ *
+ * Returns: ---
+ *
+ * Use: Initializes an RSA public-key context.
+ */
+
+extern void rsa_pubcreate(rsa_pubctx */*rd*/, rsa_pub */*rp*/);
+
+/* --- @rsa_pubdestroy@ --- *
+ *
+ * Arguments: @rsa_pubctx *rd@ = pointer to an RSA public key context
+ *
+ * Returns: ---
+ *
+ * Use: Destroys an RSA public-key context.
+ */
+
+extern void rsa_pubdestroy(rsa_pubctx */*rd*/);
+
+/* --- @rsa_pubop@ --- *
+ *
+ * Arguments: @rsa_pubctx *rd@ = pointer to an RSA public key context
+ * @mp *d@ = destination
+ * @mp *p@ = input message
+ *
+ * Returns: The transformed output message.
+ *
+ * Use: Performs an RSA public key operation.
+ */
+
+extern mp *rsa_pubop(rsa_pubctx */*rd*/, mp */*d*/, mp */*p*/);
+
+/* --- @rsa_qpubop@ --- *
+ *
+ * Arguments: @rsa_pub *rp@ = pointer to RSA parameters
+ * @mp *d@ = destination
+ * @mp *p@ = input message
+ *
+ * Returns: Correctly transformed output message.
+ *
+ * Use: Performs an RSA public key operation.
+ */
+
+extern mp *rsa_qpubop(rsa_pub */*rp*/, mp */*d*/, mp */*c*/);
+
+/* --- @rsa_encrypt@ --- *
+ *
+ * Arguments: @rsa_pubctx *rp@ = pointer to an RSA public key context
+ * @const void *m@ = pointer to input message
+ * @size_t sz@ = size of input message
+ * @dstr *d@ = pointer to output string
+ * @rsa_encodeproc e@ = encoding procedure
+ * @void *earg@ = argument pointer for encoding procedure
+ *
+ * Returns: The length of the output string if successful, negative on
+ * failure.
+ *
+ * Use: Does RSA encryption.
+ */
+
+extern int rsa_encrypt(rsa_pubctx */*rp*/, const void */*m*/, size_t /*sz*/,
+ dstr */*d*/, rsa_encodeproc /*e*/, void */*earg*/);
+
+/* --- @rsa_verify@ --- *
+ *
+ * Arguments: @rsa_pubctx *rp@ = pointer to an RSA public key contxt
+ * @const void *m@ = pointer to input message
+ * @size_t sz@ = size of input message
+ * @dstr *d@ = pointer to output string
+ * @rsa_decodeproc e@ = decoding procedure
+ * @void *earg@ = argument pointer for decoding procedure
+ *
+ * Returns: The length of the output string if successful, negative on
+ * failure.
+ *
+ * Use: Does RSA signature verification.
+ */
+
+extern int rsa_verify(rsa_pubctx */*rp*/, const void */*m*/, size_t /*sz*/,
+ dstr */*d*/, rsa_decodeproc /*e*/, void */*earg*/);
+
+/*----- Miscellaneous operations ------------------------------------------*/