| 1 | package Crypt::Rijndael::PP::Debug; | ||||||||||
| 2 | |||||||||||
| 3 | 19 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 19 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | |||||||||||
| 6 | 19 | ▶ | use Exporter 'import'; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 7 | 19 | our @EXPORT_OK = qw( generate_printable_state ); | |||||||||
| 8 | |||||||||||
| 9 | 19 | our $VERSION = '0.3.0'; # VERSION | |||||||||
| 10 | # ABSTRACT: Debugging and Formatting Methods | ||||||||||
| 11 | |||||||||||
| 12 | 25 | ▶ | sub generate_printable_state { | ||||||||
|
Subroutine
generate_printable_state: called CC=3 SCAR=11.0
Pod
undocumented
| |||||||||||
| 13 | 25 | my $state = shift; | |||||||||
| 14 | |||||||||||
| 15 | 25 | my $state_as_string = ""; | |||||||||
| 16 | |||||||||||
| 17 | 25 | ▶ | for( my $row_index = 0; $row_index < 4; $row_index++ ) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 18 | 100 | ▶ | for( my $column_index = 0; $column_index < 4; $column_index++ ) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 19 | 400 | my $state_byte = unpack("H2", $state->[$row_index][$column_index] ); | |||||||||
| 20 | 400 | $state_as_string .= $state_byte . " "; | |||||||||
| 21 | } | ||||||||||
| 22 | |||||||||||
| 23 | 100 | chop $state_as_string; | |||||||||
| 24 | 100 | $state_as_string .= "\n"; | |||||||||
| 25 | } | ||||||||||
| 26 | |||||||||||
| 27 | 25 | chop $state_as_string; | |||||||||
| 28 | |||||||||||
| 29 | 25 | return $state_as_string; | |||||||||
| 30 | } | ||||||||||
| 31 | |||||||||||
| 32 | 19 | 1; | |||||||||