forked from breadwallet/breadwallet-core
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBRCryptoCoder.h
More file actions
59 lines (46 loc) · 1.45 KB
/
BRCryptoCoder.h
File metadata and controls
59 lines (46 loc) · 1.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
//
// BRCryptoCoder.h
// BRCore
//
// Created by Michael Carrara on 9/23/19.
// Copyright © 2019 Breadwinner AG. All rights reserved.
//
// See the LICENSE file at the project root for license information.
// See the CONTRIBUTORS file at the project root for a list of contributors.
#ifndef BRCryptoCoder_h
#define BRCryptoCoder_h
#include "BRCryptoBase.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef enum {
CRYPTO_CODER_HEX,
CRYPTO_CODER_BASE58,
CRYPTO_CODER_BASE58CHECK
} BRCryptoCoderType;
typedef struct BRCryptoCoderRecord *BRCryptoCoder;
extern BRCryptoCoder
cryptoCoderCreate(BRCryptoCoderType type);
extern size_t
cryptoCoderEncodeLength (BRCryptoCoder coder,
const uint8_t *src,
size_t srcLen);
extern BRCryptoBoolean
cryptoCoderEncode (BRCryptoCoder coder,
char *dst,
size_t dstLen,
const uint8_t *src,
size_t srcLen);
extern size_t
cryptoCoderDecodeLength (BRCryptoCoder coder,
const char *src);
extern BRCryptoBoolean
cryptoCoderDecode (BRCryptoCoder coder,
uint8_t *dst,
size_t dstLen,
const char *src);
DECLARE_CRYPTO_GIVE_TAKE (BRCryptoCoder, cryptoCoder);
#ifdef __cplusplus
}
#endif
#endif /* BRCryptoCoder_h */