From 17b77485fa4ea8ecbf472e2d1daa15007ff93705 Mon Sep 17 00:00:00 2001 From: Erwin Nindl Date: Fri, 13 Jul 2007 16:05:16 +0000 Subject: * removed srtp directory * install libsrtp under /usr/local/lib * cleaned up Makefile --- cypher.cpp | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) (limited to 'cypher.cpp') diff --git a/cypher.cpp b/cypher.cpp index 909b229..03688f2 100644 --- a/cypher.cpp +++ b/cypher.cpp @@ -29,13 +29,14 @@ */ #include +#include #include "datatypes.h" #include "cypher.h" extern "C" { -#include "srtp/crypto/include/cipher.h" +#include "srtp/crypto/include/crypto_kernel.h" } void Cypher::cypher(Buffer& buf) @@ -62,9 +63,30 @@ Buffer NullCypher::getBitStream(u_int32_t length) return buf; } +void AesIcmCypher::cypher(Buffer& buf) +{ +} + Buffer AesIcmCypher::getBitStream(u_int32_t length) { Buffer buf(length); + extern cipher_type_t aes_icm; + err_status_t status; + cipher_t* cipher = NULL; + const uint8_t key = 0x42; + uint8_t idx[16] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x12, 0x34 + }; + + + status = cipher_type_alloc(&aes_icm, &cipher, sizeof(key)); + status = cipher_init(cipher, &key, direction_encrypt); + + status = cipher_set_iv(cipher, idx); + + status = cipher_output(cipher, buf, length); + status = cipher_dealloc(cipher); return buf; } -- cgit v1.2.3