Improvement: Use Twofish approach for test vectors
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Python-Crypto |
New
|
Undecided
|
Unassigned |
Bug Description
It would be nice if ciphers (or even other complex primitives, like hashes) had test vectors generated as described by Niels Ferguson here:
http://
===
Notation:
b # bytes in a plaintext or ciphertext block
k # bytes in a key
E(K,P) Block cipher encryption function, K = key, P = plaintext
D(K,P) Block cipher decryption function, K = key, C = ciphertext
Test algorithm:
S = a string of k+b zero bytes.
repeat 1000 times:
n = length(S)
K = S[n-k..n-1] the last k bytes of S
P = S[n-k-b..n-k-1] the b bytes just before K
append E(K,E(K,P)) to S
The last b bytes of S are the test vector value.
===
description: | updated |