Skip to content

Commit

Permalink
add required byte length to documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Alesfatalis committed May 4, 2024
1 parent 4d69b00 commit ee53561
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions bindings/ergo-lib-c-core/src/ext_pub_key.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ pub type ExtPubKeyPtr = *mut ExtPubKey;
pub type ConstExtPubKeyPtr = *const ExtPubKey;

/// Create ExtPubKey from public key bytes, chain code and derivation path
/// public_key_bytes needs to be the length of PubKeyBytes::LEN (33 bytes)
/// chain_code needs to be the length of ChainCode::LEN (32 bytes)
pub unsafe fn ext_pub_key_new(
public_key_bytes: *const u8,
chain_code: *const u8,
Expand Down
2 changes: 2 additions & 0 deletions bindings/ergo-lib-c-core/src/ext_secret_key.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ pub type ExtSecretKeyPtr = *mut ExtSecretKey;
pub type ConstExtSecretKeyPtr = *const ExtSecretKey;

/// Create ExtSecretKey from secret key bytes, chain code and derivation path
/// secret_key_bytes needs to be the length of SecretKeyBytes::LEN (32 bytes)
/// chain_code needs to be the length of ChainCode::LEN (32 bytes)
pub unsafe fn ext_secret_key_new(
secret_key_bytes: *const u8,
chain_code: *const u8,
Expand Down
2 changes: 2 additions & 0 deletions bindings/ergo-lib-c/src/ext_pub_key.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ use ergo_lib_c_core::ext_pub_key::{
use ergo_lib_c_core::Error;

/// Create ExtPubKey from public key bytes, chain code and derivation path
/// public_key_bytes needs to be the length of PubKeyBytes::LEN (33 bytes)
/// chain_code_ptr needs to be the length of ChainCode::LEN (32 bytes)
#[no_mangle]
pub unsafe extern "C" fn ergo_lib_ext_pub_key_new(
public_key_bytes: *const u8,
Expand Down
2 changes: 2 additions & 0 deletions bindings/ergo-lib-c/src/ext_secret_key.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ use ergo_lib_c_core::{
use crate::{delete_ptr, ErrorPtr};

/// Create ExtSecretKey from secret key bytes, chain code and derivation path
/// secret_key_bytes_ptr needs to be the length of SecretKeyBytes::LEN (32 bytes)
/// chain_code_ptr needs to be the length of ChainCode::LEN (32 bytes)
#[no_mangle]
pub unsafe extern "C" fn ergo_lib_ext_secret_key_new(
secret_key_bytes_ptr: *const u8,
Expand Down

0 comments on commit ee53561

Please sign in to comment.