| u8* output, |
u8* output, |
| u32 msglen ) |
u32 msglen ) |
| { |
{ |
| u8 remsize, i; |
u8 remsize; |
| u8 remainder[ ECRYPT_BLOCKLENGTH ]; |
u8 remainder[ ECRYPT_BLOCKLENGTH ]; |
| |
|
| ECRYPT_process_blocks( action, ctx, input, output, ( msglen / ECRYPT_BLOCKLENGTH ) ); |
ECRYPT_process_blocks( action, ctx, input, output, ( msglen / ECRYPT_BLOCKLENGTH ) ); |
| |
|
| if( (remsize = ( msglen % ECRYPT_BLOCKLENGTH )) ) |
if( (remsize = ( msglen % ECRYPT_BLOCKLENGTH )) ) |
| { |
{ |
| |
u32 i; |
| |
|
| ECRYPT_keystream_blocks( ctx, remainder, 1 ); |
ECRYPT_keystream_blocks( ctx, remainder, 1 ); |
| for( i = ( msglen - remsize ); i < msglen; i++ ) |
for( i = ( msglen - remsize ); i < msglen; i++ ) |
| output[ i ] = input[ i ] ^ remainder[ i - ( msglen - remsize ) ]; |
output[ i ] = input[ i ] ^ remainder[ i - ( msglen - remsize ) ]; |