return GNUTLS_E_CRYPTO_ALREADY_REGISTERED;
}
-/*-
- * gnutls_crypto_cipher_register:
- * @priority: is the priority of the cipher interface
- * @s: is a structure holding new interface's data
- *
- * This function will register a cipher interface to be used by
- * gnutls. Any interface registered will override the included engine
- * and by convention kernel implemented interfaces should have
- * priority of 90 and CPU-assisted of 80. The interface with the lowest priority will be used
- * by gnutls.
- *
- * This function should be called before gnutls_global_init().
- *
- * For simplicity you can use the convenience
- * gnutls_crypto_cipher_register() macro.
- *
- * Returns: %GNUTLS_E_SUCCESS on success, otherwise a negative error code.
- *
- * Since: 2.6.0
- -*/
-int
-gnutls_crypto_cipher_register(int priority,
- const gnutls_crypto_cipher_st * s)
-{
- if (crypto_cipher_prio > priority) {
- memcpy(&_gnutls_cipher_ops, s, sizeof(*s));
- crypto_cipher_prio = priority;
- return 0;
- }
-
- return GNUTLS_E_CRYPTO_ALREADY_REGISTERED;
-}
-
-/*-
- * gnutls_crypto_mac_register:
- * @priority: is the priority of the mac interface
- * @s: is a structure holding new interface's data
- *
- * This function will register a mac interface to be used by
- * gnutls. Any interface registered will override the included engine
- * and by convention kernel implemented interfaces should have
- * priority of 90 and CPU-assisted of 80. The interface with the lowest priority will be used
- * by gnutls.
- *
- * This function should be called before gnutls_global_init().
- *
- * For simplicity you can use the convenience
- * gnutls_crypto_digest_register() macro.
- *
- * Returns: %GNUTLS_E_SUCCESS on success, otherwise a negative error code.
- *
- * Since: 2.6.0
- -*/
-int
-gnutls_crypto_mac_register(int priority, const gnutls_crypto_mac_st * s)
-{
- if (crypto_mac_prio > priority) {
- memcpy(&_gnutls_mac_ops, s, sizeof(*s));
- crypto_mac_prio = priority;
- return 0;
- }
-
- return GNUTLS_E_CRYPTO_ALREADY_REGISTERED;
-}
-
-/*-
- * gnutls_crypto_digest_register:
- * @priority: is the priority of the digest interface
- * @s: is a structure holding new interface's data
- *
- * This function will register a digest interface to be used by
- * gnutls. Any interface registered will override the included engine
- * and by convention kernel implemented interfaces should have
- * priority of 90 and CPU-assisted of 80. The interface with the lowest priority will be used
- * by gnutls.
- *
- * This function should be called before gnutls_global_init().
- *
- * For simplicity you can use the convenience
- * gnutls_crypto_digest_register() macro.
- *
- * Returns: %GNUTLS_E_SUCCESS on success, otherwise a negative error code.
- *
- * Since: 2.6.0
- -*/
-int
-gnutls_crypto_digest_register(int priority,
- const gnutls_crypto_digest_st * s)
-{
- if (crypto_digest_prio > priority) {
- memcpy(&_gnutls_digest_ops, s, sizeof(*s));
- crypto_digest_prio = priority;
- return 0;
- }
-
- return GNUTLS_E_CRYPTO_ALREADY_REGISTERED;
-}
gnutls_crypto_single_digest_st *
s);
-int gnutls_crypto_cipher_register(int priority,
- const gnutls_crypto_cipher_st * s);
-int gnutls_crypto_mac_register(int priority,
- const gnutls_crypto_mac_st * s);
-int gnutls_crypto_digest_register(int priority,
- const gnutls_crypto_digest_st * s);
-
int gnutls_crypto_rnd_register(int priority,
const gnutls_crypto_rnd_st * s);
int gnutls_crypto_pk_register(int priority, const gnutls_crypto_pk_st * s);