1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-11-27 01:48:17 +00:00

Merge pull request #16 from dllaurence/prototypes

Prototypes
This commit is contained in:
Pavol Rusnak 2015-01-24 20:33:23 +01:00
commit 5ce27a1e1a
3 changed files with 13 additions and 0 deletions

View File

@ -25,8 +25,14 @@
#define __BASE58_H__ #define __BASE58_H__
#include <stdint.h> #include <stdint.h>
#include <stdbool.h>
int base58_encode_check(const uint8_t *data, int len, char *str, int strsize); int base58_encode_check(const uint8_t *data, int len, char *str, int strsize);
int base58_decode_check(const char *str, uint8_t *data, int datalen); int base58_decode_check(const char *str, uint8_t *data, int datalen);
// Private
bool b58tobin(void *bin, size_t *binszp, const char *b58);
int b58check(const void *bin, size_t binsz, const char *base58str);
bool b58enc(char *b58, size_t *b58sz, const void *data, size_t binsz);
#endif #endif

View File

@ -55,4 +55,7 @@ void hdnode_serialize_private(const HDNode *node, char *str, int strsize);
int hdnode_deserialize(const char *str, HDNode *node); int hdnode_deserialize(const char *str, HDNode *node);
// Private
void hdnode_serialize(const HDNode *node, uint32_t version, char use_public, char *str, int strsize);
#endif #endif

View File

@ -56,4 +56,8 @@ int ecdsa_verify_double(const uint8_t *pub_key, const uint8_t *sig, const uint8_
int ecdsa_verify_digest(const uint8_t *pub_key, const uint8_t *sig, const uint8_t *digest); int ecdsa_verify_digest(const uint8_t *pub_key, const uint8_t *sig, const uint8_t *digest);
int ecdsa_sig_to_der(const uint8_t *sig, uint8_t *der); int ecdsa_sig_to_der(const uint8_t *sig, uint8_t *der);
// Private
int generate_k_rfc6979(bignum256 *secret, const uint8_t *priv_key, const uint8_t *hash);
int generate_k_random(bignum256 *k);
#endif #endif