diff options
author | Jack Lloyd <[email protected]> | 2017-09-06 13:30:30 -0400 |
---|---|---|
committer | Jack Lloyd <[email protected]> | 2017-09-06 13:31:12 -0400 |
commit | 729ee64431748d898a2a53baa8f8e17f2925e16e (patch) | |
tree | 6cb50725d51f1d1ac6fb0bd4730a7ab6cfd084df /src/tests/test_ffi.cpp | |
parent | 5a2db384a328dde3d5059fcdc2ebc1ff9a6039a7 (diff) |
Add support for computing SM2 ZA field to FFI
This is a contribution from Ribose Inc.
Diffstat (limited to 'src/tests/test_ffi.cpp')
-rw-r--r-- | src/tests/test_ffi.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
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); |