|
#include <iostream> |
|
#include <iomanip> |
|
#include <cmath> |
|
#include <cstdlib> |
|
#include <ctime> |
|
|
|
#include "stc_ml_c.h" |
|
#include "stc_interface.h" |
|
|
|
|
|
uint h = 10; |
|
|
|
int stc_hide(uint cover_length, int* cover, float* costs, |
|
uint message_length, u8* message, int* stego) { |
|
|
|
const uint n = cover_length; |
|
uint m = message_length; |
|
|
|
|
|
|
|
uint trials = 10; |
|
|
|
|
|
unsigned int* num_msg_bits = new unsigned int[2]; |
|
float dist = stc_pm1_pls_embed(n, cover, costs, m, message, h, 2147483647, stego, num_msg_bits, trials, 0); |
|
|
|
delete[] num_msg_bits; |
|
|
|
return 0; |
|
} |
|
|
|
|
|
int stc_unhide(uint stego_length, int* stego, |
|
uint message_length, u8* message) { |
|
|
|
unsigned int* num_msg_bits = new unsigned int[2]; |
|
num_msg_bits[1] = (uint) (message_length/2); |
|
num_msg_bits[0] = message_length-num_msg_bits[1]; |
|
|
|
|
|
|
|
|
|
stc_ml_extract(stego_length, stego, 2, num_msg_bits, h, message); |
|
|
|
return 0; |
|
} |
|
|
|
|
|
|