]> git.sesse.net Git - vlc/blobdiff - libs/srtp/test-aes.c
Leverage libgcrypt CounTeR mode implementation to simplify our code
[vlc] / libs / srtp / test-aes.c
index 986bd0b2735df4dda42c6349611beaf8b1fd8ed4..4892ba2351fcd1b45113014bda38d356f47ba796 100644 (file)
@@ -63,7 +63,7 @@ static void test_derivation (void)
     printf (" master salt: ");
     printhex (salt, sizeof (salt));
 
-    if (gcry_cipher_open (&prf, GCRY_CIPHER_AES, GCRY_CIPHER_MODE_ECB, 0)
+    if (gcry_cipher_open (&prf, GCRY_CIPHER_AES, GCRY_CIPHER_MODE_CTR, 0)
      || gcry_cipher_setkey (prf, key, sizeof (key)))
         fatal ("Internal PRF error");
 
@@ -117,7 +117,7 @@ static void test_keystream (void)
     if (gcry_cipher_setkey (hd, key, sizeof (key)))
         fatal ("Cipher key error");
 
-    if (rtp_encrypt (hd, 0, 0, 0, salt, buf, 0xff020))
+    if (rtp_crypt (hd, 0, 0, 0, salt, buf, 0xff020))
         fatal ("Encryption failure");
     gcry_cipher_close (hd);