~ubuntu-branches/debian/squeeze/pycryptopp/squeeze

« back to all changes in this revision

Viewing changes to cryptopp/TestVectors/Readme.txt

  • Committer: Bazaar Package Importer
  • Author(s): Zooko O'Whielacronx
  • Date: 2009-06-22 22:20:50 UTC
  • Revision ID: james.westby@ubuntu.com-20090622222050-hbqmn50dt2kvoz5o
Tags: upstream-0.5.14
ImportĀ upstreamĀ versionĀ 0.5.14

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
Test Data Format
 
2
 
 
3
A test data file is an ASCII text file composed of sections separated by 
 
4
blank lines. Each section is stand-alone and independent of other 
 
5
sections that may be in the same file, and contains one or more tests.
 
6
 
 
7
A section is composed of a sequence of fields. Each field is one or more 
 
8
lines composed of a field name, followed by a colon (":"), followed by a 
 
9
field body. All but the last line of a field must end with a backslash 
 
10
("\"). If any line contains a hash mark ("#"), the hash mark and 
 
11
everything after it on the same line is not considered part of the field 
 
12
body.
 
13
 
 
14
Each section must contain fields named AlgorithmType, Name, Source, and 
 
15
Test. The presence and semantics of other fields depend on the algorithm 
 
16
being tested and the tests to be run. 
 
17
 
 
18
Each section may contain more than one test and therefore more than one 
 
19
field named Test. In that case the order of the fields is significant. A 
 
20
test should always use the last field with any given name that occurs 
 
21
before the Test field.
 
22
 
 
23
Data Types
 
24
 
 
25
int - small integer (less than 2^32) in decimal representation
 
26
string - human readable string
 
27
encoded string - can be one of the following
 
28
        - quoted string: "message" means "message" without the quotes 
 
29
          or terminating '\0'
 
30
        - hex encoded string: 0x74657374 or 74657374 means "test"
 
31
        - repeated string: r100 "message" to repeat "message" 100 times, or 
 
32
          r256 0x0011 to repeat 0x0011 256 times
 
33
 
 
34
Field Types
 
35
 
 
36
AlgorithmType - string, for example "Signature", "AsymmetricCipher", 
 
37
"SymmetricCipher", "MAC", "MessageDigest", or "KeyFactory"
 
38
Name - string, an algorithm name from SCAN
 
39
Test - string, identifies the test to run
 
40
Source - string, text explaining where the test data came from
 
41
Comment - string, other comments about the test data
 
42
KeyFormat - string, specifies the key format. "Component" here means 
 
43
each component of the key or key pair is specified separately as a name, 
 
44
value pair, with the names depending on the algorithm being tested. 
 
45
Otherwise the value names "Key", or "PublicKey" and "PrivateKey" are 
 
46
used.
 
47
Key - encoded string
 
48
PublicKey - encoded string
 
49
PrivateKey - encoded string
 
50
Message - encoded string, message to be signed or verified
 
51
Signature - encoded string, signature to be verified or compared 
 
52
with
 
53
Plaintext - encoded string
 
54
Ciphertext - encoded string
 
55
Digest - encoded string
 
56
TruncatedSize - int, size of truncated digest in bytes
 
57
Seek - int, seek location for random access ciphers
 
58
(more to come here)
 
59
 
 
60
Possible Tests
 
61
 
 
62
KeyPairValidAndConsistent - public and private keys are both valid and 
 
63
consistent with each other
 
64
PublicKeyInvalid - public key validation should not pass
 
65
PrivateKeyInvalid - private key validation should not pass
 
66
Verify - signature/digest/MAC verification should pass
 
67
VerifyTruncated - truncated digest/MAC verification should pass
 
68
NotVerify - signature/digest/MAC verification should not pass
 
69
DeterministicSign - sign message using given seed, and the resulting 
 
70
signature should be equal to the given signature
 
71
DecryptMatch - ciphertext decrypts to plaintext
 
72
(more to come here)