File tree 2 files changed +24
-22
lines changed
2 files changed +24
-22
lines changed Original file line number Diff line number Diff line change 11
11
12
12
#include <stdlib.h>
13
13
#include <stdint.h>
14
- #include <stdio.h>
15
14
#include <limits.h>
16
15
17
16
#define STR_ (x ) #x
18
17
#define STR (x ) STR_(x)
19
18
#define DEBUG_CONFIG_MSG (x ) "DEBUG_CONFIG: " x
20
19
#define DEBUG_CONFIG_DEF (x ) DEBUG_CONFIG_MSG(#x "=" STR(x))
21
20
22
- /* Debug helper for printing arrays of unsigned char. */
23
- #define PRINT_BUF (buf , len ) do { \
24
- printf("%s[%lu] = ", #buf, (unsigned long)len); \
25
- print_buf_plain(buf, len); \
26
- } while(0)
27
-
28
- static void print_buf_plain (const unsigned char * buf , size_t len ) {
29
- size_t i ;
30
- printf ("{" );
31
- for (i = 0 ; i < len ; i ++ ) {
32
- if (i % 8 == 0 ) {
33
- printf ("\n " );
34
- } else {
35
- printf (" " );
36
- }
37
- printf ("0x%02X," , buf [i ]);
38
- }
39
- printf ("\n}\n" );
40
- }
41
-
42
21
# if (!defined(__STDC_VERSION__ ) || (__STDC_VERSION__ < 199901L ) )
43
22
# if SECP256K1_GNUC_PREREQ (2 ,7 )
44
23
# define SECP256K1_INLINE __inline__
Original file line number Diff line number Diff line change 1
- 148,152c148,150
1
+ 14d13
2
+ < #include <stdio.h>
3
+ 22,41d20
4
+ < /* Debug helper for printing arrays of unsigned char. */
5
+ < #define PRINT_BUF(buf, len) do { \
6
+ < printf("%s[%lu] = ", #buf, (unsigned long)len); \
7
+ < print_buf_plain(buf, len); \
8
+ < } while(0)
9
+ <
10
+ < static void print_buf_plain(const unsigned char *buf, size_t len) {
11
+ < size_t i;
12
+ < printf("{");
13
+ < for (i = 0; i < len; i++) {
14
+ < if (i % 8 == 0) {
15
+ < printf("\n ");
16
+ < } else {
17
+ < printf(" ");
18
+ < }
19
+ < printf("0x%02X,", buf[i]);
20
+ < }
21
+ < printf("\n}\n");
22
+ < }
23
+ <
24
+ 148,152c127,129
2
25
< void *ret = malloc(size);
3
26
< if (ret == NULL) {
4
27
< secp256k1_callback_call(cb, "Out of memory");
You can’t perform that action at this time.
0 commit comments