1234567891011121314151617181920212223242526272829 |
- #include "Openssl_crypto.h"
- class ECDSASignatureBox : public ECDHKeypair {
- public:
- void get_keypair(uint8_t* output_keypair);
- uint32_t sign(uint8_t* signature_data, uint32_t signature_data_length, uint8_t* signature)
- {
- return compute_ecdsa_signature(signature_data, signature_data_length, private_key, signature);
- }
- void get_keypair(uint8_t* output_keypair)
- {
- // TODO: What happens if the ECDH keypair's generate keypair hasnt been set.
- uint32_t counter;
- for(counter=0; counter<ECDH_PRIVATE_KEY_SIZE; counter++)
- *(output_keypair + counter) = *(private_key + counter);
- for(counter=0; counter<ECDH_PUBLIC_KEY_SIZE; counter++)
- *(output_keypair + counter) = *(public_key + counter);
- }
- void set_keypair(uint8_t* input_keypair)
- {
- uint32_t counter;
- for(counter=0; counter<ECDH_PRIVATE_KEY_SIZE; counter++)
- *(private_key + counter) = *(input_keypair + counter);
- for(counter=0; counter<ECDH_PUBLIC_KEY_SIZE; counter++)
- *(public_key + counter) = *(input_keypair + counter);
- }
- }
|