#include #include #include #include using namespace Botan; int main() { Pipe p; for(u32bit j = 0; j != 10000000; j++) { if(j % (1024*1024) == 0) printf("%d\n", j); p.start_msg(); for(u32bit k = 0; k != 4; k++) p.write(get_byte(k, j)); p.end_msg(); SecureVector m = p.read_all(Pipe::LAST_MESSAGE); if(m.size() != 4) printf("Bad size %d at %d\n", m.size(), j); for(u32bit k = 0; k != 4; k++) if(m[k] != get_byte(k, j)) printf("Bad output for %d, byte %d: %02X != %02X", j, k, m[k], get_byte(k, j)); } printf("done\n"); pause(); }