public static void DecoderValidTest() { Rs256Decoder decoder = new Rs256Decoder( 16, 11, 0x13 ); byte[] message = { 12, 12, 3, 3, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1 }; byte[] cleanMessage = { 12, 12, 3, 3, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1 }; decoder.Decode( message ); ArrayHelpers.CheckArrayEquals( message, cleanMessage ); }
public RS256Test( int size, int dataBytes, int poly, Stopwatch watch ) { this.size = size; this.watch = watch; checkBytes = size - 1 - dataBytes; maxCorruption = checkBytes / 2; message = new byte[size - 1]; cleanMessage = new byte[size - 1]; rand = new Random(); encoder = new Rs256Encoder( size, dataBytes, poly ); decoder = new Rs256Decoder( size, dataBytes, poly ); }