Changeset View
Changeset View
Standalone View
Standalone View
src/secp256k1/src/modules/ecdh/tests_impl.h
/********************************************************************** | /********************************************************************** | ||||
* Copyright (c) 2015 Andrew Poelstra * | * Copyright (c) 2015 Andrew Poelstra * | ||||
* Distributed under the MIT software license, see the accompanying * | * Distributed under the MIT software license, see the accompanying * | ||||
* file COPYING or http://www.opensource.org/licenses/mit-license.php.* | * file COPYING or http://www.opensource.org/licenses/mit-license.php.* | ||||
**********************************************************************/ | **********************************************************************/ | ||||
#ifndef _SECP256K1_MODULE_ECDH_TESTS_ | #ifndef SECP256K1_MODULE_ECDH_TESTS_H | ||||
#define _SECP256K1_MODULE_ECDH_TESTS_ | #define SECP256K1_MODULE_ECDH_TESTS_H | ||||
void test_ecdh_api(void) { | void test_ecdh_api(void) { | ||||
/* Setup context that just counts errors */ | /* Setup context that just counts errors */ | ||||
secp256k1_context *tctx = secp256k1_context_create(SECP256K1_CONTEXT_SIGN); | secp256k1_context *tctx = secp256k1_context_create(SECP256K1_CONTEXT_SIGN); | ||||
secp256k1_pubkey point; | secp256k1_pubkey point; | ||||
unsigned char res[32]; | unsigned char res[32]; | ||||
unsigned char s_one[32] = { 0 }; | unsigned char s_one[32] = { 0 }; | ||||
int32_t ecount = 0; | int32_t ecount = 0; | ||||
▲ Show 20 Lines • Show All 80 Lines • ▼ Show 20 Lines | |||||
} | } | ||||
void run_ecdh_tests(void) { | void run_ecdh_tests(void) { | ||||
test_ecdh_api(); | test_ecdh_api(); | ||||
test_ecdh_generator_basepoint(); | test_ecdh_generator_basepoint(); | ||||
test_bad_scalar(); | test_bad_scalar(); | ||||
} | } | ||||
#endif | #endif /* SECP256K1_MODULE_ECDH_TESTS_H */ |