Test the OCB-AES reference implementation
This tests cryptographic primitives implemented by others. It uses the same interfaces and indeed the same compiled object code as the Mosh client and server. It does not particularly test any code written for the Mosh project.
This commit is contained in:
committed by
Keith Winstein
parent
fe34cb3809
commit
d1c4b0a5d7
@@ -0,0 +1,34 @@
|
||||
/*
|
||||
Mosh: the mobile shell
|
||||
Copyright 2012 Keith Winstein
|
||||
|
||||
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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#include "test_utils.h"
|
||||
|
||||
void hexdump( const void *buf, size_t len, const char *name ) {
|
||||
const unsigned char *data = (const unsigned char *) buf;
|
||||
printf( DUMP_NAME_FMT, name );
|
||||
for ( size_t i = 0; i < len; i++ ) {
|
||||
printf( "%02x", data[ i ] );
|
||||
}
|
||||
printf( "\n" );
|
||||
}
|
||||
|
||||
void hexdump( const Crypto::AlignedBuffer &buf, const char *name ) {
|
||||
hexdump( buf.data(), buf.len(), name );
|
||||
}
|
||||
Reference in New Issue
Block a user