]> git.sesse.net Git - vlc/blobdiff - modules/demux/mp4/drms.c
Digest => DigestMD5
[vlc] / modules / demux / mp4 / drms.c
index 625c2ce28e842a1fc7f700f00e12cee36173c53d..711eb3d33739c69b5b7dbf3094d9dd33aa2f503b 100644 (file)
@@ -32,6 +32,7 @@
 
 #ifdef __VLC__
 #   include <vlc/vlc.h>
+#   include "vlc_md5.h"
 #   include "libmp4.h"
 #else
 #   include "drmsvl.h"
@@ -88,6 +89,9 @@ struct aes_s
     uint32_t pp_dec_keys[ AES_KEY_COUNT + 1 ][ 4 ];
 };
 
+#ifdef __VLC__
+# define Digest DigestMD5
+#else
 /*****************************************************************************
  * md5_s: MD5 message structure
  *****************************************************************************
@@ -100,6 +104,7 @@ struct md5_s
     uint32_t p_digest[4]; /* The MD5 digest */
     uint32_t p_data[16];  /* Buffer to cache non-aligned writes */
 };
+#endif
 
 /*****************************************************************************
  * shuffle_s: shuffle structure
@@ -140,10 +145,12 @@ struct drms_s
 static void InitAES       ( struct aes_s *, uint32_t * );
 static void DecryptAES    ( struct aes_s *, uint32_t *, const uint32_t * );
 
+#ifndef __VLC__
 static void InitMD5       ( struct md5_s * );
 static void AddMD5        ( struct md5_s *, const uint8_t *, uint32_t );
 static void EndMD5        ( struct md5_s * );
 static void Digest        ( struct md5_s *, uint32_t * );
+#endif
 
 static void InitShuffle   ( struct shuffle_s *, uint32_t *, uint32_t );
 static void DoShuffle     ( struct shuffle_s *, uint32_t *, uint32_t );
@@ -487,6 +494,7 @@ static void DecryptAES( struct aes_s *p_aes,
     }
 }
 
+#ifndef __VLC__
 /*****************************************************************************
  * InitMD5: initialise an MD5 message
  *****************************************************************************
@@ -673,6 +681,7 @@ static void Digest( struct md5_s *p_md5, uint32_t *p_input )
     p_md5->p_digest[ 2 ] += c;
     p_md5->p_digest[ 3 ] += d;
 }
+#endif
 
 /*****************************************************************************
  * InitShuffle: initialise a shuffle structure