From 729ee64431748d898a2a53baa8f8e17f2925e16e Mon Sep 17 00:00:00 2001 From: Jack Lloyd Date: Wed, 6 Sep 2017 13:30:30 -0400 Subject: Add support for computing SM2 ZA field to FFI This is a contribution from Ribose Inc. --- src/tests/test_ffi.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/tests/test_ffi.cpp') diff --git a/src/tests/test_ffi.cpp b/src/tests/test_ffi.cpp index 41fa3a044..4a8e7b317 100644 --- a/src/tests/test_ffi.cpp +++ b/src/tests/test_ffi.cpp @@ -1408,6 +1408,10 @@ class FFI_Unit_Tests : public Test TEST_FFI_OK(botan_privkey_export_pubkey, (&pub, priv)); ffi_test_pubkey_export(result, pub, priv, rng); + uint8_t za[32]; + size_t sizeof_za = sizeof(za); + TEST_FFI_OK(botan_pubkey_sm2_compute_za, (za, &sizeof_za, "Ident", "SM3", pub)); + // Check key load functions botan_mp_t private_scalar, public_x, public_y; botan_mp_init(&private_scalar); @@ -1495,6 +1499,10 @@ class FFI_Unit_Tests : public Test TEST_FFI_OK(botan_privkey_export_pubkey, (&pub, priv)); ffi_test_pubkey_export(result, pub, priv, rng); + uint8_t za[32]; + size_t sizeof_za = sizeof(za); + TEST_FFI_OK(botan_pubkey_sm2_compute_za, (za, &sizeof_za, "Ident", "SM3", pub)); + // Check key load functions botan_mp_t private_scalar, public_x, public_y; botan_mp_init(&private_scalar); -- cgit v1.2.3