]> git.sesse.net Git - vlc/blobdiff - libs/srtp/srtp.h
Remove my old email address
[vlc] / libs / srtp / srtp.h
index d51427cdbab672a82bf12ec47e5dca994e17aa9d..b58b9d6889ca6edfae7cd586c71232c900602006 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Secure RTP with libgcrypt
- * Copyright (C) 2007  Rémi Denis-Courmont <rdenis # simphalempin , com>
+ * Copyright (C) 2007  Rémi Denis-Courmont
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -24,26 +24,57 @@ typedef struct srtp_session_t srtp_session_t;
 
 enum
 {
-       SRTP_UNENCRYPTED=0x1, // do not encrypt SRTP packets
-       SRTCP_UNENCRYPTED=0x2, // do not encrypt SRTCP packets
-       SRTP_NULL_CIPHER=0x3, // use NULL cipher (encrypt nothing)
-       SRTP_UNAUTHENTICATED=0x4, // do not authenticated SRTP packets
-       SRTP_FLAGS_MASK=0x7
+    SRTP_UNENCRYPTED=0x1,   // do not encrypt SRTP packets
+    SRTCP_UNENCRYPTED=0x2,  // do not encrypt SRTCP packets
+    SRTP_UNAUTHENTICATED=0x4, // authenticate only SRTCP packets
+
+    SRTP_RCC_MODE1=0x10,    // use Roll-over-Counter Carry mode 1
+    SRTP_RCC_MODE2=0x20,    // use Roll-over-Counter Carry mode 2
+    SRTP_RCC_MODE3=0x30,    // use Roll-over-Counter Carry mode 3 (insecure)
+
+    SRTP_FLAGS_MASK=0x38
+};
+
+/* SRTP encryption algorithms (ciphers); same values as MIKEY */
+enum
+{
+    SRTP_ENCR_NULL=0,
+    SRTP_ENCR_AES_CM=1,
+    SRTP_ENCR_AES_F8=2 // not implemented
+};
+
+/* SRTP authenticaton algorithms; same values as MIKEY */
+enum
+{
+    SRTP_AUTH_NULL=0,
+    SRTP_AUTH_HMAC_SHA1=1
 };
 
+/* SRTP pseudo random function; same values as MIKEY */
+enum
+{
+    SRTP_PRF_AES_CM=0
+};
 
 # ifdef __cplusplus
 extern "C" {
 # endif
 
-srtp_session_t *srtp_create (const char *name, unsigned flags, unsigned kdr,
-                             uint16_t winsize);
+srtp_session_t *srtp_create (int encr, int auth, unsigned tag_len, int prf,
+                             unsigned flags);
 void srtp_destroy (srtp_session_t *s);
-int srtp_send (srtp_session_t *s, uint8_t *buf, size_t *lenp, size_t maxsize);
-int srtp_recv (srtp_session_t *s, uint8_t *buf, size_t *lenp);
 
 int srtp_setkey (srtp_session_t *s, const void *key, size_t keylen,
                  const void *salt, size_t saltlen);
+int srtp_setkeystring (srtp_session_t *s, const char *key, const char *salt);
+
+void srtp_setrcc_rate (srtp_session_t *s, uint16_t rate);
+
+int srtp_send (srtp_session_t *s, uint8_t *buf, size_t *lenp, size_t maxsize);
+int srtp_recv (srtp_session_t *s, uint8_t *buf, size_t *lenp);
+int srtcp_send (srtp_session_t *s, uint8_t *buf, size_t *lenp, size_t maxsiz);
+int srtcp_recv (srtp_session_t *s, uint8_t *buf, size_t *lenp);
+
 # ifdef __cplusplus
 }
 # endif