From b14ce58df7ef6b2d925e9a02a2fc4ec75127c123 Mon Sep 17 00:00:00 2001 From: Pavol Rusnak Date: Fri, 8 Nov 2013 12:44:11 +0100 Subject: [PATCH] rename xprv struct to XprvNode --- bip32.c | 4 ++-- bip32.h | 6 +++--- tests.c | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/bip32.c b/bip32.c index a636d1e7e4..554b101d7d 100644 --- a/bip32.c +++ b/bip32.c @@ -5,7 +5,7 @@ #include "ecdsa.h" #include "bip32.h" -void xprv_from_seed(uint8_t *seed, int seed_len, xprv *out) +void xprv_from_seed(uint8_t *seed, int seed_len, XprvNode *out) { out->version = 0x0488ADE4; // main-net out->depth = 0; @@ -18,7 +18,7 @@ void xprv_from_seed(uint8_t *seed, int seed_len, xprv *out) ecdsa_get_address(out->public_key, 0, out->address); } -void xprv_descent(xprv *inout, uint32_t i) +void xprv_descent(XprvNode *inout, uint32_t i) { uint8_t data[1 + 32 + 4]; bignum256 a, b; diff --git a/bip32.h b/bip32.h index a413575f38..417ac8ef63 100644 --- a/bip32.h +++ b/bip32.h @@ -12,12 +12,12 @@ typedef struct { uint8_t chain_code[32]; // form a continuous 64 byte block uint8_t public_key[33]; char address[35]; -} xprv; +} XprvNode; -void xprv_from_seed(uint8_t *seed, int seed_len, xprv *out); +void xprv_from_seed(uint8_t *seed, int seed_len, XprvNode *out); #define xprv_descent_prime(X, I) xprv_descent((X), ((I) | 0x80000000)) -void xprv_descent(xprv *inout, uint32_t i); +void xprv_descent(XprvNode *inout, uint32_t i); #endif diff --git a/tests.c b/tests.c index 7df7603b99..0343879119 100644 --- a/tests.c +++ b/tests.c @@ -74,7 +74,7 @@ char *tohex(const uint8_t *bin, size_t l) // test vector 1 from https://en.bitcoin.it/wiki/BIP_0032_TestVectors START_TEST(test_bip32_vector_1) { - xprv node; + XprvNode node; // init m xprv_from_seed(fromhex("000102030405060708090a0b0c0d0e0f"), 16, &node); @@ -126,7 +126,7 @@ END_TEST // test vector 2 from https://en.bitcoin.it/wiki/BIP_0032_TestVectors START_TEST(test_bip32_vector_2) { - xprv node; + XprvNode node; // init m xprv_from_seed(fromhex("fffcf9f6f3f0edeae7e4e1dedbd8d5d2cfccc9c6c3c0bdbab7b4b1aeaba8a5a29f9c999693908d8a8784817e7b7875726f6c696663605d5a5754514e4b484542"), 64, &node);