modelSHA1
Model that verifies the SHA1 encryption C function
Extends from Modelica.Icons.Example (Icon for runnable examples).
Information
This validation function tests the C implementation of the SHA1 encryption for the following strings:
-
"abc" -
""(an empty string) -
"abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq" -
"1.23e+4" -
"a"repeated 509 times.
If the encrypted strings are identical to the expected (known) encryption
results, the cmpAll boolean variable will be true.
Parameters
| Type | Name | Default | Description |
|---|---|---|---|
| String | strIn1 | "abc" | First test string |
| String | strIn2 | "" | Second test string |
| String | strIn3 | "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq" | Third test string |
| String | strIn4 | "1.23e+4" | Fourth test string |
| String | strIn5 | Modelica.Utilities.Strings.repeat(509, string = "a") | Fifth test string |
| String | strEx1 | "a9993e364706816aba3e25717850c26c9cd0d89d" | Encryption result of first string |
| String | strEx2 | "da39a3ee5e6b4b0d3255bfef95601890afd80709" | Encryption result of second string |
| String | strEx3 | "84983e441c3bd26ebaae4aa1f95129e5e54670f1" | Encryption result of third string |
| String | strEx4 | "bdd220adb45b392f17915af70ed8a006c382b983" | Encryption result of fourth string |
| String | strEx5 | "edff7a135c2e06d4c8084e61b4516c901bd5fcd0" | Encryption result of fifth string |
Components
| Type | Name | Default | Description |
|---|---|---|---|
| Boolean | cmp1 | ||
| Boolean | cmp2 | ||
| Boolean | cmp3 | ||
| Boolean | cmp4 | ||
| Boolean | cmp5 | ||
| Boolean | cmpAll |
Revisions
-
January 13, 2019, by Michael Wetter:
Reduced string length for issue 1081. -
May 30, 2018, by Alex Laferrière:
First implementation.