| Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/coreutils/src/src/blake2/b2sum.c |
| Switch to Source code | Preprocessed file |
| Line | Source | Count | ||||||
|---|---|---|---|---|---|---|---|---|
| 1 | - | |||||||
| 2 | - | |||||||
| 3 | - | |||||||
| 4 | - | |||||||
| 5 | int blake2b_stream( FILE *stream, void *resstream, size_t outbytes ) | - | ||||||
| 6 | { | - | ||||||
| 7 | int ret = -1; | - | ||||||
| 8 | size_t sum, n; | - | ||||||
| 9 | blake2b_state S[1]; | - | ||||||
| 10 | static const size_t buffer_length = 32768; | - | ||||||
| 11 | uint8_t *buffer = ( uint8_t * )malloc( buffer_length ); | - | ||||||
| 12 | - | |||||||
| 13 | if( !buffer
never executed: -1;return -1;never executed: return -1; | 0-38 | ||||||
| 14 | - | |||||||
| 15 | blake2b_init( S, outbytes ); | - | ||||||
| 16 | - | |||||||
| 17 | while( 1 ) | - | ||||||
| 18 | { | - | ||||||
| 19 | sum = 0; | - | ||||||
| 20 | - | |||||||
| 21 | while( 1 ) | - | ||||||
| 22 | { | - | ||||||
| 23 | n = fread( buffer + sum, 1, buffer_length - sum, stream ); | - | ||||||
| 24 | sum += n; | - | ||||||
| 25 | - | |||||||
| 26 | if( buffer_length == sum
| 0-38 | ||||||
| 27 | break; never executed: break; | 0 | ||||||
| 28 | - | |||||||
| 29 | if( 0 == n
| 6-32 | ||||||
| 30 | { | - | ||||||
| 31 | if( ferror( stream )
| 0-6 | ||||||
| 32 | goto never executed: cleanup_buffer;goto cleanup_buffer;never executed: goto cleanup_buffer; | 0 | ||||||
| 33 | - | |||||||
| 34 | goto executed 6 times by 1 test: final_process;goto final_process;Executed by:
executed 6 times by 1 test: goto final_process;Executed by:
| 6 | ||||||
| 35 | } | - | ||||||
| 36 | - | |||||||
| 37 | if( feof( stream )
| 0-32 | ||||||
| 38 | goto executed 32 times by 1 test: final_process;goto final_process;Executed by:
executed 32 times by 1 test: goto final_process;Executed by:
| 32 | ||||||
| 39 | } never executed: end of block | 0 | ||||||
| 40 | - | |||||||
| 41 | blake2b_update( S, buffer, buffer_length ); | - | ||||||
| 42 | } never executed: end of block | 0 | ||||||
| 43 | - | |||||||
| 44 | final_process: code before this statement never executed: ;final_process: | 0 | ||||||
| 45 | - | |||||||
| 46 | if( sum > 0
executed 32 times by 1 test: blake2b_update( S, buffer, sum );Executed by:
| 6-32 | ||||||
| 47 | - | |||||||
| 48 | blake2b_final( S, resstream, outbytes ); | - | ||||||
| 49 | ret = 0; | - | ||||||
| 50 | cleanup_buffer: code before this statement executed 38 times by 1 test: cleanup_buffer:Executed by:
| 38 | ||||||
| 51 | free( buffer ); | - | ||||||
| 52 | return executed 38 times by 1 test: ret;return ret;Executed by:
executed 38 times by 1 test: return ret;Executed by:
| 38 | ||||||
| 53 | } | - | ||||||
| Switch to Source code | Preprocessed file |