mirror of
https://github.com/shadps4-emu/ext-cryptopp.git
synced 2024-11-27 11:50:29 +00:00
*** empty log message ***
This commit is contained in:
parent
50c0dc2277
commit
4cbd2ef39e
@ -20,7 +20,18 @@ field named Test. In that case the order of the fields is significant. A
|
||||
test should always use the last field with any given name that occurs
|
||||
before the Test field.
|
||||
|
||||
Format and Semantics of Fields
|
||||
Data Types
|
||||
|
||||
int - small integer (less than 2^32) in decimal representation
|
||||
string - human readable string
|
||||
encoded string - can be one of the following
|
||||
- quoted string: "message" means "message" without the quotes
|
||||
or terminating '\0'
|
||||
- hex encoded string: 0x74657374 or 74657374 means "test"
|
||||
- repeated string: r100 "message" to repeat "message" 100 times, or
|
||||
r256 0x0011 to repeat 0x0011 256 times
|
||||
|
||||
Field Types
|
||||
|
||||
AlgorithmType - string, for example "Signature", "AsymmetricCipher",
|
||||
"SymmetricCipher", "MAC", "MessageDigest", or "KeyFactory"
|
||||
@ -33,14 +44,16 @@ each component of the key or key pair is specified separately as a name,
|
||||
value pair, with the names depending on the algorithm being tested.
|
||||
Otherwise the value names "Key", or "PublicKey" and "PrivateKey" are
|
||||
used.
|
||||
Key - hex encoded string
|
||||
PublicKey - hex encoded string
|
||||
PrivateKey - hex encoded string
|
||||
Message - hex encoded string, message to be signed or verified
|
||||
Signature - hex encoded string, signature to be verified or compared
|
||||
Key - encoded string
|
||||
PublicKey - encoded string
|
||||
PrivateKey - encoded string
|
||||
Message - encoded string, message to be signed or verified
|
||||
Signature - encoded string, signature to be verified or compared
|
||||
with
|
||||
Plaintext - hex encoded string
|
||||
Ciphertext - hex encoded string
|
||||
Plaintext - encoded string
|
||||
Ciphertext - encoded string
|
||||
Digest - encoded string
|
||||
TruncatedSize - int, size of truncated digest in bytes
|
||||
(more to come here)
|
||||
|
||||
Possible Tests
|
||||
@ -49,8 +62,9 @@ KeyPairValidAndConsistent - public and private keys are both valid and
|
||||
consistent with each other
|
||||
PublicKeyInvalid - public key validation should not pass
|
||||
PrivateKeyInvalid - private key validation should not pass
|
||||
Verify - signature verification should pass
|
||||
NotVerify - signature verification should not pass
|
||||
Verify - signature/digest/MAC verification should pass
|
||||
VerifyTruncated - truncated digest/MAC verification should pass
|
||||
NotVerify - signature/digest/MAC verification should not pass
|
||||
DeterministicSign - sign message using given seed, and the resulting
|
||||
signature should be equal to the given signature
|
||||
DecryptMatch - ciphertext decrypts to plaintext
|
||||
|
@ -21,7 +21,7 @@ PublicKey: \
|
||||
3193A0B70567E6FD76E9FAC4F67BB47DACD356D0C8015261E068DDF8C34C0CAFCF3FA775577FEB02\
|
||||
0120
|
||||
Test: KeyPairValidAndConsistent
|
||||
Message: 74657374 # "test"
|
||||
Message: "test"
|
||||
Signature: \
|
||||
A3E32065DEDAE7EC05C1BFCD25797D99CDD5739D9DF3A4AA9AA45AC8233D0D37FEBC763FF184F659\
|
||||
14914F0C341BAE9A5C2E2E38087877CBDC3C7EA034445B0F67D9352A79471A523771DB1267C1B6C6\
|
||||
@ -29,7 +29,7 @@ Signature: \
|
||||
7402370EED0A06ADF41565B8E1D145AE3919B4FF5DF1457BE0FE72ED11928F61414F0200F2766F7C\
|
||||
79A2E552205D975EFE39AE2110FB35F480814113DDE85FCA1E4FF89BB268FB28
|
||||
Test: Verify
|
||||
Message: 74657375
|
||||
Message: "test1"
|
||||
Test: NotVerify
|
||||
|
||||
AlgorithmType: Signature
|
||||
|
125
TestVectors/hmac.txt
Normal file
125
TestVectors/hmac.txt
Normal file
@ -0,0 +1,125 @@
|
||||
AlgorithmType: MAC
|
||||
Name: HMAC(MD5)
|
||||
Source: RFC 2202
|
||||
Comment: Test Case 1
|
||||
Key: 0x0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b
|
||||
Message: "Hi There"
|
||||
Digest: 0x9294727a3638bb1c13f48ef8158bfc9d
|
||||
Test: Verify
|
||||
Comment: Test Case 2
|
||||
Key: "Jefe"
|
||||
Message: "what do ya want for nothing?"
|
||||
Digest: 0x750c783e6ab0b503eaa86e310a5db738
|
||||
Test: Verify
|
||||
Comment: Test Case 3
|
||||
Key: 0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
|
||||
Message: r50 0xdd
|
||||
Digest: 0x56be34521d144c88dbb8c733f0e8b3f6
|
||||
Test: Verify
|
||||
Comment: Test Case 4
|
||||
Key: 0x0102030405060708090a0b0c0d0e0f10111213141516171819
|
||||
Message: r50 0xcd
|
||||
Digest: 0x697eaf0aca3a3aea3a75164746ffaa79
|
||||
Test: Verify
|
||||
Comment: Test Case 5
|
||||
Key: 0x0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c
|
||||
Message: "Test With Truncation"
|
||||
Digest: 0x56461ef2342edc00f9bab995690efd4c
|
||||
Test: Verify
|
||||
Digest: 0x56461ef2342edc00f9bab995
|
||||
TruncatedSize: 12
|
||||
Test: VerifyTruncated
|
||||
Comment: Test Case 6
|
||||
Key: r80 0xaa
|
||||
Message: "Test Using Larger Than Block-Size Key - Hash Key First"
|
||||
Digest: 0x6b1ab7fe4bd7bf8f0b62e6ce61b9d0cd
|
||||
Test: Verify
|
||||
Comment: Test Case 7
|
||||
Key: r80 0xaa
|
||||
Message: "Test Using Larger Than Block-Size Key and Larger Than One Block-Size Data"
|
||||
Digest: 0x6f630fad67cda0ee1fb1f562db3aa53e
|
||||
Test: Verify
|
||||
|
||||
AlgorithmType: MAC
|
||||
Name: HMAC(SHA-1)
|
||||
Source: RFC 2202
|
||||
Comment: Test Case 1
|
||||
Key: 0x0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b
|
||||
Message: "Hi There"
|
||||
Digest: 0xb617318655057264e28bc0b6fb378c8ef146be00
|
||||
Test: Verify
|
||||
Comment: Test Case 2
|
||||
Key: "Jefe"
|
||||
Message: "what do ya want for nothing?"
|
||||
Digest: 0xeffcdf6ae5eb2fa2d27416d5f184df9c259a7c79
|
||||
Test: Verify
|
||||
Comment: Test Case 3
|
||||
Key: 0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
|
||||
Message: r50 0xdd
|
||||
Digest: 0x125d7342b9ac11cd91a39af48aa17b4f63f175d3
|
||||
Test: Verify
|
||||
Comment: Test Case 4
|
||||
Key: 0x0102030405060708090a0b0c0d0e0f10111213141516171819
|
||||
Message: r50 0xcd
|
||||
Digest: 0x4c9007f4026250c6bc8414f9bf50c86c2d7235da
|
||||
Test: Verify
|
||||
Comment: Test Case 5
|
||||
Key: 0x0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c
|
||||
Message: "Test With Truncation"
|
||||
Digest: 0x4c1a03424b55e07fe7f27be1d58bb9324a9a5a04
|
||||
Test: Verify
|
||||
Digest: 0x4c1a03424b55e07fe7f27be1
|
||||
TruncatedSize: 12
|
||||
Test: VerifyTruncated
|
||||
Comment: Test Case 6
|
||||
Key: r80 0xaa
|
||||
Message: "Test Using Larger Than Block-Size Key - Hash Key First"
|
||||
Digest: 0xaa4ae5e15272d00e95705637ce8a3b55ed402112
|
||||
Test: Verify
|
||||
Comment: Test Case 7
|
||||
Key: r80 0xaa
|
||||
Message: "Test Using Larger Than Block-Size Key and Larger Than One Block-Size Data"
|
||||
Digest: 0xe8e99d0f45237d786d6bbaa7965c7808bbff1a91
|
||||
Test: Verify
|
||||
|
||||
AlgorithmType: MAC
|
||||
Name: HMAC(RIPEMD-160)
|
||||
Source: RFC 2286
|
||||
Comment: Test Case 1
|
||||
Key: 0x0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b
|
||||
Message: "Hi There"
|
||||
Digest: 0x24cb4bd67d20fc1a5d2ed7732dcc39377f0a5668
|
||||
Test: Verify
|
||||
Comment: Test Case 2
|
||||
Key: "Jefe"
|
||||
Message: "what do ya want for nothing?"
|
||||
Digest: 0xdda6c0213a485a9e24f4742064a7f033b43c4069
|
||||
Test: Verify
|
||||
Comment: Test Case 3
|
||||
Key: 0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
|
||||
Message: r50 0xdd
|
||||
Digest: 0xb0b105360de759960ab4f35298e116e295d8e7c1
|
||||
Test: Verify
|
||||
Comment: Test Case 4
|
||||
Key: 0x0102030405060708090a0b0c0d0e0f10111213141516171819
|
||||
Message: r50 0xcd
|
||||
Digest: 0xd5ca862f4d21d5e610e18b4cf1beb97a4365ecf4
|
||||
Test: Verify
|
||||
Comment: Test Case 5
|
||||
Key: 0x0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c
|
||||
Message: "Test With Truncation"
|
||||
Digest: 0x7619693978f91d90539ae786500ff3d8e0518e39
|
||||
Test: Verify
|
||||
Digest: 0x7619693978f91d90539ae786
|
||||
TruncatedSize: 12
|
||||
Test: VerifyTruncated
|
||||
Comment: Test Case 6
|
||||
Key: r80 0xaa
|
||||
Message: "Test Using Larger Than Block-Size Key - Hash Key First"
|
||||
Digest: 0x6466ca07ac5eac29e1bd523e5ada7605b791fd8b
|
||||
Test: Verify
|
||||
Comment: Test Case 7
|
||||
Key: r80 0xaa
|
||||
Message: "Test Using Larger Than Block-Size Key and Larger Than One Block-Size Data"
|
||||
Digest: 0x69ea60798d71616cce5fd0871e23754cd75d5a0a
|
||||
Test: Verify
|
38
TestVectors/sha.txt
Normal file
38
TestVectors/sha.txt
Normal file
@ -0,0 +1,38 @@
|
||||
AlgorithmType: MessageDigest
|
||||
Name: SHA-1
|
||||
Message: "abc"
|
||||
Digest: A9993E364706816ABA3E25717850C26C9CD0D89D
|
||||
Test: Verify
|
||||
Message: "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq"
|
||||
Digest: 84983E441C3BD26EBAAE4AA1F95129E5E54670F1
|
||||
Test: Verify
|
||||
Message: r15625 "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
||||
Digest: 34AA973CD4C4DAA4F61EEB2BDBAD27316534016F
|
||||
Test: Verify
|
||||
|
||||
AlgorithmType: MessageDigest
|
||||
Name: SHA-256
|
||||
Message: "abc"
|
||||
Digest: ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad
|
||||
Test: Verify
|
||||
Message: "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq"
|
||||
Digest: 248d6a61d20638b8e5c026930c3e6039a33ce45964ff2167f6ecedd419db06c1
|
||||
Test: Verify
|
||||
|
||||
AlgorithmType: MessageDigest
|
||||
Name: SHA-384
|
||||
Message: "abc"
|
||||
Digest: cb00753f45a35e8bb5a03d699ac65007272c32ab0eded1631a8b605a43ff5bed8086072ba1e7cc2358baeca134c825a7
|
||||
Test: Verify
|
||||
Message: "abcdefghbcdefghicdefghijdefghijkefghijklfghijklmghijklmnhijklmnoijklmnopjklmnopqklmnopqrlmnopqrsmnopqrstnopqrstu"
|
||||
Digest: 09330c33f71147e83d192fc782cd1b4753111b173b3b05d22fa08086e3b0f712fcc7c71a557e2db966c3e9fa91746039
|
||||
Test: Verify
|
||||
|
||||
AlgorithmType: MessageDigest
|
||||
Name: SHA-512
|
||||
Message: "abc"
|
||||
Digest: ddaf35a193617abacc417349ae20413112e6fa4e89a97ea20a9eeee64b55d39a2192992a274fc1a836ba3c23a3feebbd454d4423643ce80e2a9ac94fa54ca49f
|
||||
Test: Verify
|
||||
Message: "abcdefghbcdefghicdefghijdefghijkefghijklfghijklmghijklmnhijklmnoijklmnopjklmnopqklmnopqrlmnopqrsmnopqrstnopqrstu"
|
||||
Digest: 8e959b75dae313da8cf4f72814fc143f8f7779c6eb9f7fa17299aeadb6889018501d289e4900f7e4331b99dec4b5433ac7d329eeb6dd26545e96e55b874be909
|
||||
Test: Verify
|
Loading…
Reference in New Issue
Block a user