Esempio n. 1
0
BOOL WipeBuffer (WipeAlgorithmId algorithm, byte randChars[TC_WIPE_RAND_CHAR_COUNT], int pass, byte *buffer, size_t size)
{
	switch (algorithm)
	{
	case TC_WIPE_1_RAND:
	case TC_WIPE_256:
		return Wipe1PseudoRandom (pass, buffer, size);

	case TC_WIPE_3_DOD_5220:
		return Wipe3Dod5220 (pass, buffer, size);

	case TC_WIPE_7_DOD_5220:
		return Wipe7Dod5220 (pass, randChars, buffer, size);

	case TC_WIPE_35_GUTMANN:
		return Wipe35Gutmann (pass, buffer, size);

	/* we will never reach here because all calls to WipeBuffer are preceeded
	 * by a call to GetWipePassCount that already checks the same algorithm
	 * parameters and in case of unsupported value an error is returned before
	 * calling WipeBuffer
	 */
   /*
	default:
		TC_THROW_FATAL_EXCEPTION;*/
	}

	return FALSE;	// Prevent compiler warnings
}
Esempio n. 2
0
BOOL WipeBuffer (WipeAlgorithmId algorithm, byte randChars[TC_WIPE_RAND_CHAR_COUNT], int pass, byte *buffer, size_t size)
{
	switch (algorithm)
	{
	case TC_WIPE_1_RAND:
		return Wipe1PseudoRandom (pass, buffer, size);

	case TC_WIPE_3_DOD_5220:
		return Wipe3Dod5220 (pass, buffer, size);

	case TC_WIPE_7_DOD_5220:
		return Wipe7Dod5220 (pass, randChars, buffer, size);

	case TC_WIPE_35_GUTMANN:
		return Wipe35Gutmann (pass, buffer, size);

	default:
		TC_THROW_FATAL_EXCEPTION;
	}

	return FALSE;	// Prevent compiler warnings
}