]> git.ipfire.org Git - thirdparty/openssl.git/blame - test/recipes/30-test_evp_data/evppkey_sm2.txt
Update copyright year
[thirdparty/openssl.git] / test / recipes / 30-test_evp_data / evppkey_sm2.txt
CommitLineData
5ccada09 1#
3c2bdd7d 2# Copyright 2001-2021 The OpenSSL Project Authors. All Rights Reserved.
5ccada09
SL
3#
4# Licensed under the Apache License 2.0 (the "License"). You may not use
5# this file except in compliance with the License. You can obtain a copy
6# in the file LICENSE in the source distribution or at
7# https://www.openssl.org/source/license.html
8
9# Tests start with one of these keywords
10# Cipher Decrypt Derive Digest Encoding KDF MAC PBE
11# PrivPubKeyPair Sign Verify VerifyRecover
12# and continue until a blank line. Lines starting with a pound sign are ignored.
13
14
15# Public key algorithm tests
16
17# Private keys used for PKEY operations.
18
19Title = SM2 tests
20
21PrivateKey=SM2_key1
22-----BEGIN PRIVATE KEY-----
23MIGHAgEAMBMGByqGSM49AgEGCCqBHM9VAYItBG0wawIBAQQg0JFWczAXva2An9m7
242MaT9gIwWTFptvlKrxyO4TjMmbWhRANCAAQ5OirZ4n5DrKqrhaGdO4VZHhRAYVcX
25Wt3Te/d/8Mr57Tf886i09VwDhSMmH8pmNq/mp6+ioUgqYG9cs6GLLioe
26-----END PRIVATE KEY-----
27
28Verify = SM2_key1
29Ctrl = digest:SM3
30Input = D7AD397F6FFA5D4F7F11E7217F241607DC30618C236D2C09C1B9EA8FDADEE2E8
31Output = 3046022100AB1DB64DE7C40EDBDE6651C9B8EBDB804673DB836E5D5C7FE15DCF9ED2725037022100EBA714451FF69B0BB930B379E192E7CD5FA6E3C41C7FBD8303B799AB54A54621
32
33Verify = SM2_key1
34Ctrl = digest:SM3
35Input = B1139602C6ECC9E15E2F3F9C635A1AFE737058BC15387479C1EA0D0B3D90E9E5
36Output = 3045022100E6E0414EBD3A656C35602AF14AB20287DBF30D57AF75C49A188ED4B42391F22402202F54F277C606F4605E1CE9514947FFDDF94C67A539804A4ED17F852288BDBE2E
37
38Verify = SM2_key1
39Ctrl = digest:SHA512
40Input = 40AA1B203C9D8EE150B21C3C7CDA8261492E5420C5F2B9F7380700E094C303B48E62F319C1DA0E32EB40D113C5F1749CC61AEB499167890AB82F2CC9BB706971
41Output = 3046022100AE018933B9BA041784380069F2DDF609694DCD299FDBF23D09F4B711FBC103EC0221008440BB1A48C132DE4FB91BE9F43B958142FDD29FB9DABE01B17514023A2F638C
42
b9689452
RL
43Availablein = default
44Decrypt = SM2_key1
45Input = 30818A0220466BE2EF5C11782EC77864A0055417F407A5AFC11D653C6BCE69E417BB1D05B6022062B572E21FF0DDF5C726BD3F9FF2EAE56E6294713A607E9B9525628965F62CC804203C1B5713B5DB2728EB7BF775E44F4689FC32668BDC564F52EA45B09E8DF2A5F40422084A9D0CC2997092B7D3C404FCE95956EB604D732B2307A8E5B8900ED6608CA5B197
46Output = "The floofy bunnies hop at midnight"
47
48# This is the same as above, but with explicit digest control
5ccada09
SL
49Availablein = default
50Decrypt = SM2_key1
51Ctrl = digest:SM3
52Input = 30818A0220466BE2EF5C11782EC77864A0055417F407A5AFC11D653C6BCE69E417BB1D05B6022062B572E21FF0DDF5C726BD3F9FF2EAE56E6294713A607E9B9525628965F62CC804203C1B5713B5DB2728EB7BF775E44F4689FC32668BDC564F52EA45B09E8DF2A5F40422084A9D0CC2997092B7D3C404FCE95956EB604D732B2307A8E5B8900ED6608CA5B197
53Output = "The floofy bunnies hop at midnight"
54
55# This is a "fake" test as it does only verify that the SM2 EVP_PKEY interface
56# is capable of creating a signature without failing, but it does not say
57# anything about the generated signature being valid, nor does it test the
58# correct implementation of the cryptosystem.
59Sign = SM2_key1
60Ctrl = digest:SM3
61Input = D7AD397F6FFA5D4F7F11E7217F241607DC30618C236D2C09C1B9EA8FDADEE2E8
62Output = 3045022100f11bf36e75bb304f094fb42a4ca22377d0cc768637c5011cd59fb9ed4b130c98022035545ffe2c2efb3abee4fee661468946d886004fae8ea5311593e48f7fe21b91
63Result = KEYOP_MISMATCH
bf5b37ce
TM
64
65Title = SM2 key generation tests
66
67KeyGen = SM2
68KeyName = SM2_genkey1
69
70KeyGen = SM2
71Ctrl = group:sm2
72KeyName = SM2_genkey2