Functional Weave
Code in Rust

crypto.sha1@1.0.0

vectors.json

4,699 bytes · view raw

[
  {"name": "FIPS 180-4 example: the empty message", "args": [[]], "expect": [218, 57, 163, 238, 94, 107, 75, 13, 50, 85, 191, 239, 149, 96, 24, 144, 175, 216, 7, 9]},
  {"name": "FIPS 180-4 / RFC 3174 example: \"abc\", one block", "args": [[97, 98, 99]], "expect": [169, 153, 62, 54, 71, 6, 129, 106, 186, 62, 37, 113, 120, 80, 194, 108, 156, 208, 216, 157]},
  {"name": "FIPS 180-4 / RFC 3174 example: the 448-bit message, whose padding needs a second block", "args": [[97, 98, 99, 100, 98, 99, 100, 101, 99, 100, 101, 102, 100, 101, 102, 103, 101, 102, 103, 104, 102, 103, 104, 105, 103, 104, 105, 106, 104, 105, 106, 107, 105, 106, 107, 108, 106, 107, 108, 109, 107, 108, 109, 110, 108, 109, 110, 111, 109, 110, 111, 112, 110, 111, 112, 113]], "expect": [132, 152, 62, 68, 28, 59, 210, 110, 186, 174, 74, 161, 249, 81, 41, 229, 229, 70, 112, 241]},
  {"name": "FIPS 180-4 example: the 896-bit message", "args": [[97, 98, 99, 100, 101, 102, 103, 104, 98, 99, 100, 101, 102, 103, 104, 105, 99, 100, 101, 102, 103, 104, 105, 106, 100, 101, 102, 103, 104, 105, 106, 107, 101, 102, 103, 104, 105, 106, 107, 108, 102, 103, 104, 105, 106, 107, 108, 109, 103, 104, 105, 106, 107, 108, 109, 110, 104, 105, 106, 107, 108, 109, 110, 111, 105, 106, 107, 108, 109, 110, 111, 112, 106, 107, 108, 109, 110, 111, 112, 113, 107, 108, 109, 110, 111, 112, 113, 114, 108, 109, 110, 111, 112, 113, 114, 115, 109, 110, 111, 112, 113, 114, 115, 116, 110, 111, 112, 113, 114, 115, 116, 117]], "expect": [164, 155, 36, 70, 160, 44, 100, 91, 244, 25, 249, 149, 182, 112, 145, 37, 58, 4, 162, 89]},
  {"name": "the pangram", "args": [[84, 104, 101, 32, 113, 117, 105, 99, 107, 32, 98, 114, 111, 119, 110, 32, 102, 111, 120, 32, 106, 117, 109, 112, 115, 32, 111, 118, 101, 114, 32, 116, 104, 101, 32, 108, 97, 122, 121, 32, 100, 111, 103]], "expect": [47, 212, 225, 198, 122, 45, 40, 252, 237, 132, 158, 225, 187, 118, 231, 57, 27, 147, 235, 18]},
  {"name": "55 bytes, the most that fits one block with its padding (hashlib as the reference)", "args": [[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54]], "expect": [138, 226, 212, 103, 41, 207, 230, 143, 249, 39, 175, 94, 236, 156, 125, 27, 102, 214, 90, 194]},
  {"name": "56 bytes, one too many for one block (hashlib as the reference)", "args": [[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55]], "expect": [99, 110, 46, 198, 152, 218, 201, 3, 73, 142, 100, 139, 210, 243, 175, 100, 29, 60, 136, 203]},
  {"name": "64 bytes, exactly one block of message (hashlib as the reference)", "args": [[200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 0, 0, 0, 0, 0, 0, 0, 0]], "expect": [79, 3, 62, 108, 83, 25, 114, 168, 192, 155, 51, 136, 12, 43, 1, 16, 64, 33, 196, 56]},
  {"name": "119 bytes, the most that fits two blocks (hashlib as the reference)", "args": [[0, 7, 14, 21, 28, 35, 42, 49, 56, 63, 70, 77, 84, 91, 98, 105, 112, 119, 126, 133, 140, 147, 154, 161, 168, 175, 182, 189, 196, 203, 210, 217, 224, 231, 238, 245, 252, 3, 10, 17, 24, 31, 38, 45, 52, 59, 66, 73, 80, 87, 94, 101, 108, 115, 122, 129, 136, 143, 150, 157, 164, 171, 178, 185, 192, 199, 206, 213, 220, 227, 234, 241, 248, 255, 6, 13, 20, 27, 34, 41, 48, 55, 62, 69, 76, 83, 90, 97, 104, 111, 118, 125, 132, 139, 146, 153, 160, 167, 174, 181, 188, 195, 202, 209, 216, 223, 230, 237, 244, 251, 2, 9, 16, 23, 30, 37, 44, 51, 58]], "expect": [180, 164, 230, 144, 96, 208, 177, 231, 232, 235, 191, 112, 65, 164, 33, 28, 99, 67, 139, 87]},
  {"name": "a single zero byte is not the empty message", "args": [[0]], "expect": [91, 169, 60, 157, 176, 207, 249, 63, 82, 181, 33, 215, 66, 14, 67, 246, 237, 162, 120, 79]},
  {"name": "256 is not a byte", "args": [[1, 256]], "expectError": "bytes must be a list of integers from 0 to 255"},
  {"name": "a fraction is not a byte", "args": [[1.5]], "expectError": "bytes must be a list of integers from 0 to 255"},
  {"name": "a negative value is not a byte", "args": [[-1]], "expectError": "bytes must be a list of integers from 0 to 255"},
  {"name": "a character is not a byte: encode text with encoding.utf8 first", "args": [["a"]], "expectError": "bytes must be a list of integers from 0 to 255"}
]