Team Fortress 2 Source Code as on 22/4/2020
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

72 lines
3.0 KiB

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