Index: include/libroar/crypto.h
===================================================================
--- include/libroar/crypto.h	(revision 4454)
+++ include/libroar/crypto.h	(revision 4454)
@@ -0,0 +1,45 @@
+//crypto.h:
+
+/*
+ *      Copyright (C) Philipp 'ph3-der-loewe' Schafft - 2010
+ *
+ *  This file is part of libroar a part of RoarAudio,
+ *  a cross-platform sound system for both, home and professional use.
+ *  See README for details.
+ *
+ *  This file is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License version 3
+ *  as published by the Free Software Foundation.
+ *
+ *  libroar 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 General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this software; see the file COPYING.  If not, write to
+ *  the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+ *  Boston, MA 02110-1301, USA.
+ *
+ *  NOTE for everyone want's to change something and send patches:
+ *  read README and HACKING! There a addition information on
+ *  the license of this document you need to read before you send
+ *  any patches.
+ *
+ *  NOTE for uses of non-GPL (LGPL,...) software using libesd, libartsc
+ *  or libpulse*:
+ *  The libs libroaresd, libroararts and libroarpulse link this lib
+ *  and are therefore GPL. Because of this it may be illigal to use
+ *  them with any software that uses libesd, libartsc or libpulse*.
+ */
+
+#ifndef _LIBROARCRYPTO_H_
+#define _LIBROARCRYPTO_H_
+
+#include "libroar.h"
+
+int roar_crypto_init (void);
+
+#endif
+
+//ll
Index: include/libroar/libroar.h
===================================================================
--- include/libroar/libroar.h	(revision 4446)
+++ include/libroar/libroar.h	(revision 4454)
@@ -119,4 +119,5 @@
 #include "stack.h"
 #include "buffer.h"
+#include "crypto.h"
 #include "random.h"
 #include "hash.h"
Index: libroar/Makefile
===================================================================
--- libroar/Makefile	(revision 4446)
+++ libroar/Makefile	(revision 4454)
@@ -8,5 +8,5 @@
 VIO_BRIDGE=vio_bio.o vio_stdio.o
 VIO=$(VIO_META) $(VIO_BRIDGE) vio_cmd.o vio_magic.o vio_pipe.o vio_socket.o vio_winsock.o vio_stack.o vio_jumbo.o vio_proto.o vio_dstr.o vio_tantalos.o vio_rtp.o vio_buffer.o vio_buffer_store.o
-CRYPTO=random.o hash.o
+CRYPTO=crypto.o random.o hash.o
 OBJS=libroar.o config.o debug.o error.o basic.o stream.o client.o simple.o auth.o socket.o ctl.o buffer.o meta.o file.o acl.o cdrom.o pinentry.o sshaskpass.o $(VIO) stack.o slp.o nnode.o roardl.o roarx11.o beep.o proto.o env.o keyval.o vs.o ltm.o notify.o notify_proxy.o asyncctl.o enumdev.o serverinfo.o $(CRYPTO)
 
Index: libroar/crypto.c
===================================================================
--- libroar/crypto.c	(revision 4454)
+++ libroar/crypto.c	(revision 4454)
@@ -0,0 +1,48 @@
+//crypto.c:
+
+/*
+ *      Copyright (C) Philipp 'ph3-der-loewe' Schafft - 2010
+ *
+ *  This file is part of libroar a part of RoarAudio,
+ *  a cross-platform sound system for both, home and professional use.
+ *  See README for details.
+ *
+ *  This file is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License version 3
+ *  as published by the Free Software Foundation.
+ *
+ *  libroar 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 General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this software; see the file COPYING.  If not, write to
+ *  the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+ *  Boston, MA 02110-1301, USA.
+ *
+ *  NOTE for everyone want's to change something and send patches:
+ *  read README and HACKING! There a addition information on
+ *  the license of this document you need to read before you send
+ *  any patches.
+ *
+ *  NOTE for uses of non-GPL (LGPL,...) software using libesd, libartsc
+ *  or libpulse*:
+ *  The libs libroaresd, libroararts and libroarpulse link this lib
+ *  and are therefore GPL. Because of this it may be illigal to use
+ *  them with any software that uses libesd, libartsc or libpulse*.
+ */
+
+#include "libroar.h"
+
+int roar_crypto_init (void) {
+ static int inited = 0;
+
+ if ( inited )
+  return 0;
+
+ inited = 1;
+ return 0;
+}
+
+//ll
Index: libroar/hash.c
===================================================================
--- libroar/hash.c	(revision 4453)
+++ libroar/hash.c	(revision 4454)
@@ -135,4 +135,6 @@
 
 int          roar_ht_is_supported(const int    ht) {
+ roar_crypto_init();
+
 #ifdef ROAR_HAVE_LIBGCRYPT
  if ( roar_ht2gcrypt_tested(ht) == -1 )
@@ -146,4 +148,6 @@
 
 int roar_hash_buffer(void * digest, const void * data, size_t datalen, int algo) {
+ roar_crypto_init();
+
  return roar_hash_salted_buffer(digest, data, datalen, algo, NULL, 0);
 }
@@ -152,4 +156,6 @@
 static inline int roar_hash_salted_buffer_gcrypt(void * digest, const void * data, size_t datalen, int algo, const void * salt, size_t saltlen) {
  gcry_md_hd_t hdl;
+
+ roar_crypto_init();
 
  algo = roar_ht2gcrypt_tested(algo);
Index: libroar/random.c
===================================================================
--- libroar/random.c	(revision 4447)
+++ libroar/random.c	(revision 4454)
@@ -47,4 +47,5 @@
 
  // add stuff here needed to bring up random source.
+ roar_crypto_init();
 
  inited = 1;
