/* main-base64-test.c */
/*
This file is part of the ARM-Crypto-Lib.
Copyright (C) 2008, 2009 Daniel Otte (daniel.otte@rub.de)
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see .
*/
/*
* base64 test-suit
*
*/
#include
#include
#include
#include "config.h"
#include "cli.h"
#include "dump.h"
#include "uart_lowlevel.h"
#include "sysclock.h"
#include "hw_gptm.h"
#include "noekeon.h"
#include "noekeon_prng.h"
#include "base64_enc.h"
#include "base64_dec.h"
#include "string-extras.h"
#include "cli.h"
#include "performance_test.h"
void uart0_putc(char byte){
uart_putc(UART_0, byte);
}
char uart0_getc(void){
return uart_getc(UART_0);
}
char* algo_name = "Base64";
/*****************************************************************************
* additional validation-functions *
*****************************************************************************/
#define TESTLENGTH 4096
void testrun_stdtest_base64(void){
uint8_t fail=0;
unsigned l,i;
int sl;
char str[32];
uint8_t bin_buffer[TESTLENGTH];
char b64_buffer[TESTLENGTH*4/3+10];
uint8_t bin_buffer2[TESTLENGTH];
random_seed(bin_buffer);
for(l=0; l