src/lib/crypto.c
crypto_digest_t crypto_digest_stream_type(int stream)
{
   switch (stream) {
   case STREAM_MD5_DIGEST:
      return CRYPTO_DIGEST_MD5;
   case STREAM_SHA1_DIGEST:
      return CRYPTO_DIGEST_SHA1;
   case STREAM_SHA256_DIGEST:
      return CRYPTO_DIGEST_SHA256;
   case STREAM_SHA512_DIGEST:
      return CRYPTO_DIGEST_SHA512;
   default:
      return CRYPTO_DIGEST_NONE;
   }
}
/*
 * Given a stream type, returns the associated
 * crypto_digest_t value.
 */
Given a stream type, returns the associated
crypto_digest_t value.
Given a stream type returns the associated crypto_digest_t value .
crypto_digest_t crypto_digest_stream_type(int stream)
{
   switch (stream) {
   case STREAM_MD5_DIGEST:
      return CRYPTO_DIGEST_MD5;
   case STREAM_SHA1_DIGEST:
      return CRYPTO_DIGEST_SHA1;
   case STREAM_SHA256_DIGEST:
      return CRYPTO_DIGEST_SHA256;
   case STREAM_SHA512_DIGEST:
      return CRYPTO_DIGEST_SHA512;
   default:
      return CRYPTO_DIGEST_NONE;
   }
}
crypto_digest_t crypto_digest_stream_type ( int stream ) { switch ( stream ) { case STREAM_MD5_DIGEST : return CRYPTO_DIGEST_MD5 ; case STREAM_SHA1_DIGEST : return CRYPTO_DIGEST_SHA1 ; case STREAM_SHA256_DIGEST : return CRYPTO_DIGEST_SHA256 ; case STREAM_SHA512_DIGEST : return CRYPTO_DIGEST_SHA512 ; default : return CRYPTO_DIGEST_NONE ; } }
Given a stream type, returns the associated
 crypto_digest_t value.
Given a stream type returns the associated crypto_digest_t value .