Skip to content

Commit

Permalink
Merge pull request #8 from hexanova/rustler_init
Browse files Browse the repository at this point in the history
  • Loading branch information
ShreyanJain9 authored Feb 4, 2024
2 parents 96ba73c + e2dfc25 commit 58e63ec
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions native/hexpds_k256/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,8 @@ mod atoms {
}

#[rustler::nif]
fn create_public_key(env: Env, private_key: String) -> Term {
let private_key_bytes = match hex::decode(&private_key) {
Ok(bytes) => bytes,
Err(e) => return (atoms::error(), format!("Failed to decode hex string: {}", e)).encode(env),
};
fn create_public_key(env: Env, private_key: Binary) -> Term {
let private_key_bytes = private_key_binary.as_slice();

let secret_key = match SecretKey::from_be_bytes(&private_key_bytes) {
Ok(key) => key,
Expand Down

0 comments on commit 58e63ec

Please sign in to comment.