(self, constructor, md_len, in_len)
| 891 | ) |
| 892 | |
| 893 | def blake2_rfc7693(self, constructor, md_len, in_len): |
| 894 | def selftest_seq(length, seed): |
| 895 | mask = (1<<32)-1 |
| 896 | a = (0xDEAD4BAD * seed) & mask |
| 897 | b = 1 |
| 898 | out = bytearray(length) |
| 899 | for i in range(length): |
| 900 | t = (a + b) & mask |
| 901 | a, b = b, t |
| 902 | out[i] = (t >> 24) & 0xFF |
| 903 | return out |
| 904 | outer = constructor(digest_size=32) |
| 905 | for outlen in md_len: |
| 906 | for inlen in in_len: |
| 907 | indata = selftest_seq(inlen, inlen) |
| 908 | key = selftest_seq(outlen, outlen) |
| 909 | unkeyed = constructor(indata, digest_size=outlen) |
| 910 | outer.update(unkeyed.digest()) |
| 911 | keyed = constructor(indata, key=key, digest_size=outlen) |
| 912 | outer.update(keyed.digest()) |
| 913 | return outer.hexdigest() |
| 914 | |
| 915 | @requires_blake2 |
| 916 | def test_blake2b(self): |
no test coverage detected