Browse Source
Perturb is a bit stretched for this, permute is better. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>ppa-0.6.1
Rusty Russell
10 years ago
5 changed files with 35 additions and 35 deletions
@ -0,0 +1,25 @@ |
|||
#ifndef LIGHTNING_PERMUTE_TX_H |
|||
#define LIGHTNING_PERMUTE_TX_H |
|||
#include "bitcoin_tx.h" |
|||
|
|||
/* Given the two seeds, permute the transaction inputs.
|
|||
* map[0] is set to the new index of input 0, etc. |
|||
*/ |
|||
void permute_inputs(uint64_t seed1, uint64_t seed2, |
|||
size_t transaction_num, |
|||
struct bitcoin_tx_input *inputs, |
|||
size_t num_inputs, |
|||
size_t *map); |
|||
|
|||
void permute_outputs(uint64_t seed1, uint64_t seed2, |
|||
size_t transaction_num, |
|||
struct bitcoin_tx_output *outputs, |
|||
size_t num_outputs, |
|||
size_t *map); |
|||
|
|||
enum permute_style { |
|||
PERMUTE_INPUT_STYLE = 0, |
|||
PERMUTE_OUTPUT_STYLE = 1 |
|||
}; |
|||
|
|||
#endif /* LIGHTNING_PERMUTE_TX_H */ |
@ -1,25 +0,0 @@ |
|||
#ifndef LIGHTNING_PERTURB_H |
|||
#define LIGHTNING_PERTURB_H |
|||
#include "bitcoin_tx.h" |
|||
|
|||
/* Given the two seeds, perturb the transaction inputs.
|
|||
* map[0] is set to the new index of input 0, etc. |
|||
*/ |
|||
void perturb_inputs(uint64_t seed1, uint64_t seed2, |
|||
size_t transaction_num, |
|||
struct bitcoin_tx_input *inputs, |
|||
size_t num_inputs, |
|||
size_t *map); |
|||
|
|||
void perturb_outputs(uint64_t seed1, uint64_t seed2, |
|||
size_t transaction_num, |
|||
struct bitcoin_tx_output *outputs, |
|||
size_t num_outputs, |
|||
size_t *map); |
|||
|
|||
enum perturb_style { |
|||
PERTURB_INPUT_STYLE = 0, |
|||
PERTURB_OUTPUT_STYLE = 1 |
|||
}; |
|||
|
|||
#endif /* LIGHTNING_PERTURB_H */ |
Loading…
Reference in new issue