Skip to content

Print consecutive spaces faster#1940

Merged
drwetter merged 1 commit intotestssl:3.1devfrom
dcooper16:print_spaces_faster
Jul 30, 2021
Merged

Print consecutive spaces faster#1940
drwetter merged 1 commit intotestssl:3.1devfrom
dcooper16:print_spaces_faster

Conversation

@dcooper16
Copy link
Copy Markdown
Collaborator

This PR adds a new function, print_n_spaces(), which prints a sequence of (up to 80) space characters.

This new function is used to replace a few places in testssl.sh in which a sequence of space characters is printed by calling
out " " in a loop. The new function is much faster than the current code, so it will make testssl.sh run slightly faster.

This commit adds a new function, print_n_spaces(), which prints a sequence of (up to 80) space characters.

This new function is used to replace a few places in testssl.sh in which a sequence of space characters is printed by calling 'out " "' in a loop. The new function is much faster than the current code, so it will make testssl.sh run slightly faster.
@drwetter drwetter merged commit 70d40b4 into testssl:3.1dev Jul 30, 2021
@drwetter
Copy link
Copy Markdown
Collaborator

Thanks, David!

@dcooper16 dcooper16 deleted the print_spaces_faster branch August 2, 2021 15:16
dcooper16 pushed a commit to dcooper16/testssl.sh that referenced this pull request Nov 7, 2022
This commit simplifies the adding of padding data in a few places. Rather than adding one or two bytes at a time in a "for" loop, all of the padding is added in one step by extracting it from a long padding string. (The one exception is in run_robot(), where a "for" loop is used to add additional padding in case in which the RSA modulus is longer than the pre-defined padding string.)

Extracting the padding from a long string is faster than using a "for" loop and it makes the debugging file a little cleaner.

The idea is the same as PR testssl#1940.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants