aboutsummaryrefslogtreecommitdiffstats
path: root/src/tests/data
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2017-09-10 12:12:47 -0400
committerJack Lloyd <[email protected]>2017-09-10 12:12:47 -0400
commit903e92b8e7995d0fee605ce2e5d203f1cacae5d3 (patch)
tree10bf9889f805938c67a43d94bc1f9d6c18939692 /src/tests/data
parent12e567da157057938505eb0cb0a0876644ae5380 (diff)
Change SM2 encryption to match updated standard.
Unfortunately it seems the SM2 format changed between 2010 and 2012, now the ciphertext is C1 || C3 || C2. Unfortunate no matter how you slice it, but at least it's easy to convert from one form to another.
Diffstat (limited to 'src/tests/data')
-rw-r--r--src/tests/data/pubkey/sm2_enc.vec3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/tests/data/pubkey/sm2_enc.vec b/src/tests/data/pubkey/sm2_enc.vec
index f878a11a2..120eab583 100644
--- a/src/tests/data/pubkey/sm2_enc.vec
+++ b/src/tests/data/pubkey/sm2_enc.vec
@@ -1,4 +1,5 @@
# Example from draft-shen-sm2-ecdsa-02
+# Corrected to use (C1||C3||C2) - the draft is wrong!
P = 0x8542D69E4C044F18E8B92435BF6FF7DE457283915C45517D722EDB8B08F1DFC3
A = 0x787968B4FA32C3FD2417842E73BBFEFF2F3C848B6831D7E0EC65228B3937E498
@@ -11,4 +12,4 @@ Cofactor = 1
Msg = 656E6372797074696F6E207374616E64617264
x = 0x1649AB77A00637BD5E2EFE283FBF353534AA7F7CB89463F208DDBC2920BB0DA0
Nonce = 4C62EEFD6ECFC2B95B92FD6C3D9575148AFA17425546D49018E5388D49DD7B4F
-Ciphertext = 04245C26FB68B1DDDDB12C4B6BF9F2B6D5FE60A383B0D18D1C4144ABF17F6252E776CB9264C2A7E88E52B19903FDC47378F605E36811F5C07423A24B84400F01B8650053A89B41C418B0C3AAD00D886C002864679C3D7360C30156FAB7C80A0276712DA9D8094A634B766D3A285E07480653426D
+Ciphertext = 04245C26FB68B1DDDDB12C4B6BF9F2B6D5FE60A383B0D18D1C4144ABF17F6252E776CB9264C2A7E88E52B19903FDC47378F605E36811F5C07423A24B84400F01B89C3D7360C30156FAB7C80A0276712DA9D8094A634B766D3A285E07480653426D650053A89B41C418B0C3AAD00D886C00286467