Comments (7)
No. Does it differ between different private keys?
from noble-ed25519.
It differs with identical priv/pub keys, message
from noble-ed25519.
If you could provide a key/message pair, I will investigate this.
from noble-ed25519.
Key = [ 232, 153, 76, 227, 11, 132, 39, 134, 89, 190, 9, 20, 251, 142, 65, 240, 252, 233, 70, 28, 233, 56, 14, 173, 81, 44, 139, 150, 139, 39, 200, 79, 88, 142, 42, 150, 88, 187, 51, 210, 155, 30, 26, 116, 229, 17, 165, 115, 112, 160, 123, 184, 142, 69, 194, 128, 197, 8, 92, 208, 49, 92, 178, 25, ]
Message = [ 110, 123, 209, 66, 178, 255, 153, 11, 45, 235, 189, 244, 42, 9, 152, 192, 181, 183, 40, 140, 216, 194, 141, 222, 128, 251, 237, 133, 207, 198, 131, 71, 242, 117, 246, 186, 189, 138, 117, 253, 31, 141, 117, 17, 179, 138, 224, 131 ]
from noble-ed25519.
your key is 64 bytes. ed25519 private keys are 32 bytes.
let sc = SecretKey::from_bytes(&Key[0..32]).unwrap();
let pubkey = PublicKey::from(&sc);
println!("SC {:?}", sc);
println!("SC/pub {:?}", hex::encode(pubkey.to_bytes()));
let kp = Keypair { public: pubkey, secret: sc };
// Returns
// 98FC99FD2869EFC7AA0743801620B8BD40DAA6DD798A8985BD43AE151E4C7C1A2937808FC199A76708FA046E06206F82B776EB4E05A426CB8F8B4ED4FB4AEC0F
// Same as noble code:
// const privateKey = new Uint8Array(Key).slice(0, 32);
// const pub = await ed.getPublicKey(privateKey);
// console.log('PUB', Buffer.from(pub).toString('hex'));
// const signature = await ed.sign(new Uint8Array(Message), privateKey);
// console.log('SIG', signature, Buffer.from(signature).toString('hex'));
println!("SIG {:?}", kp.sign(&Message));
from noble-ed25519.
your key is 64 bytes
The first 32 bytes is the secret key and the second 32 is the public key. Very standard in crypto (as in cryptocurrency)
from noble-ed25519.
See my code -- the outputs match
from noble-ed25519.
Related Issues (20)
- Can you please release fixes
- The package ( @noble/ed25519 ) is throwing some math errors in production works fine in local HOT 2
- Compatibility with libsodium generated keys HOT 1
- Wrong signature with version > 1.60
- Deno import error HOT 5
- Can someone help me with the getSharedSecret function? HOT 1
- 64byte (extended) ed25519 private keys HOT 6
- ed.utils.hexToBytes not mentioned in README HOT 1
- synchronous `getSharedSecret()`
- What are your sources for the algorithm? HOT 5
- making API consistent
- replacement for getSharedSecret HOT 6
- v2 throws error in FF when bundled with parcel HOT 2
- Jest gives an error: "SyntaxError: Unexpected token export" HOT 2
- How to create hybrid NPM package for Node.js and bundlers? HOT 3
- Error: crypto.getRandomValues must be defined HOT 5
- React Native compatibility issue HOT 7
- const err = (m = '') => { throw new Error(m); }; // error helper, messes-up stack trace HOT 2
- Random PRNG - how secure is it? HOT 4
- Can not make it generate or verify the signature HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from noble-ed25519.