crypto.h 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. // /*
  2. // * This file is part of the Trezor project, https://trezor.io/
  3. // *
  4. // * Copyright (C) 2014 Pavol Rusnak <stick@satoshilabs.com>
  5. // *
  6. // * This library is free software: you can redistribute it and/or modify
  7. // * it under the terms of the GNU Lesser General Public License as published by
  8. // * the Free Software Foundation, either version 3 of the License, or
  9. // * (at your option) any later version.
  10. // *
  11. // * This library is distributed in the hope that it will be useful,
  12. // * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. // * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. // * GNU Lesser General Public License for more details.
  15. // *
  16. // * You should have received a copy of the GNU Lesser General Public License
  17. // * along with this library. If not, see <http://www.gnu.org/licenses/>.
  18. // */
  19. // #ifndef __CRYPTO_H__
  20. // #define __CRYPTO_H__
  21. // #include "../crypto/bip32.h"
  22. // #include "../crypto/ecdsa.h"
  23. // #include <pb.h>
  24. // #include "../crypto/sha2.h"
  25. // #include <stdbool.h>
  26. // #include <stdint.h>
  27. // #include <stdlib.h>
  28. // #include "coins.h"
  29. // #include "../crypto/hasher.h"
  30. // // #include "messages-bitcoin.pb.h"
  31. // // #include "messages-crypto.pb.h"
  32. // #define BITCOIN_ONLY 1
  33. // #define PATH_HARDENED 0x80000000
  34. // #define PATH_UNHARDEN_MASK 0x7fffffff
  35. // #define PATH_MAX_ACCOUNT 100
  36. // #define PATH_MAX_CHANGE 1
  37. // #define PATH_MAX_ADDRESS_INDEX 1000000
  38. // #define PATH_SLIP25_PURPOSE (PATH_HARDENED | 10025)
  39. // #define ser_length_size(len) ((len) < 253 ? 1 : (len) < 0x10000 ? 3 : 5)
  40. // uint32_t ser_length(uint32_t len, uint8_t *out);
  41. // uint32_t ser_length_hash(Hasher *hasher, uint32_t len);
  42. // int sshMessageSign(HDNode *node, const uint8_t *message, size_t message_len,
  43. // uint8_t *signature);
  44. // int gpgMessageSign(HDNode *node, const uint8_t *message, size_t message_len,
  45. // uint8_t *signature);
  46. // int signifyMessageSign(HDNode *node, const uint8_t *message, size_t message_len,
  47. // uint8_t *signature);
  48. // int cryptoMessageSign(const CoinInfo *coin, HDNode *node,
  49. // InputScriptType script_type, bool no_script_type,
  50. // const uint8_t *message, size_t message_len,
  51. // uint8_t *signature);
  52. // int cryptoMessageVerify(const CoinInfo *coin, const uint8_t *message,
  53. // size_t message_len, const char *address,
  54. // const uint8_t *signature);
  55. // const HDNode *cryptoMultisigPubkey(const CoinInfo *coin,
  56. // const MultisigRedeemScriptType *multisig,
  57. // uint32_t index);
  58. // uint32_t cryptoMultisigPubkeyCount(const MultisigRedeemScriptType *multisig);
  59. // int cryptoMultisigPubkeyIndex(const CoinInfo *coin,
  60. // const MultisigRedeemScriptType *multisig,
  61. // const uint8_t *pubkey);
  62. // int cryptoMultisigFingerprint(const MultisigRedeemScriptType *multisig,
  63. // uint8_t *hash);
  64. // int cryptoIdentityFingerprint(const IdentityType *identity, uint8_t *hash);
  65. // bool coin_path_check(const CoinInfo *coin, InputScriptType script_type,
  66. // uint32_t address_n_count, const uint32_t *address_n,
  67. // bool has_multisig, bool full_check);
  68. // #endif