Commit graph

16 commits

Author SHA1 Message Date
Nicolas Di Prima
3e32159caf Merge pull request from GHSA-wr2p-64gm-8x2c
This allowed users to create invalid Ed25519 Extended Secret Keys
with potentially cryptographically weak ECDSA Signatures.

However we still allow to have an _unsafe_ version to construct
a `SecretKeyExtended` from bytes without performing checks.
This is in order to allow a compatibility path without breaking
codes too much.

allow the direct conversion from XPrv from ed25519_bip32 crates to pallas-crypto's SecretKeyExtended without performing the bit tweaks check

While it is unsafe to call the SecretKeyExtended::from_bytes_unchecked
(unsafe in the cryptographic sense, not in the rust memory management
sense) we know this is going to be okay because the XPrv was already
safely created.

We previously removed the direct conversion of byte arrays into SecretKeyExtended

This has been replaced with a `TryFrom` and a `from_bytes() -> Result<Self>` function.
This allows us to perform the recovery of the wrapped private keys
without losing the security of performing the checks of the validity
of the Ed25519 Extended structure.

This should be safe to use and shouldn't make incompatibilities
because the Xprv was already checked for bit tweaks previously
in the flow.

add unsafe functions to leak the content of the SecretKey or SecretKeyExtended

Remove the From implementation to convert Secret Keys into Bytes

Instead prefer the explicit unsafe functions to leak the content of the keys

temporarily remove the public access of the as_bytes function

this is to prevent leaking the bytes of the private keys.
2024-06-01 07:32:32 -03:00
Santiago Carmuega
f5263378b8 feat(crypto): add Blake2b hasher for 20-bytes digests (#416) 2024-03-03 16:38:28 -03:00
Santiago Carmuega
cc671d2480 feat: generate genesis utxos from genesis file (#59)
Co-authored-by: rvcas <x@rvcas.dev>
Co-authored-by: jmhrpr <harper.jme@gmail.com>
2023-10-04 06:45:59 -03:00
Pi Lanningham
9adfe442a0 Return the remote socket address when accepting a connection (#227)
feat!: Return the socket address when accepting a connection

BREAKING CHANGE: The signature for Bearer.accept_tcp now returns the bearer, and the address that connected.

This can, for example, be used to implement allow and deny lists for accepting or rejecting incoming connections.

* Return the remote address from accept_unix

* cargo fmt

* Fix comment formatting
2023-02-09 21:58:08 -05:00
cameron1024
e08c1489be feat: Allow creation of secret key from bytes (#224) 2023-02-09 17:44:37 -03:00
Pi Lanningham
f9263a0eba feat: Add constants for known miniprotocols
* Add constants for known miniprotocols

Now consumers of the crate don't have to memorize what channel number means what

* Add myself to the crate authors
2023-02-05 06:13:55 -05:00
Santiago Carmuega
d7a414c3af chore: Fix lint issues (#222) 2023-02-02 21:07:14 -03:00
Harper
e3d9d8f9a3 fix: Stop double CBOR encoding of Plutus script used for hashing (#188) 2022-09-12 16:47:20 -03:00
Santiago Carmuega
9845fc4040 feat(primitives): Enable serde of ledger structs (#169) 2022-08-12 19:43:56 -03:00
Santiago Carmuega
3260abcb98 chore(deps): Upgrade to minicbor 0.17 (breaking changes) (#109) 2022-06-02 09:49:55 -03:00
Smaug
a5df52cc15 fix(primitives): Fix native scripts policy id (add missing tag) (#94) 2022-04-27 08:07:28 -03:00
Rinor Hoxha
6f2d117f9d build(deps): minicbor-0.14, minicbor-derive-0.9.0, fix build (#63) 2022-02-28 12:01:39 -03:00
Rinor Hoxha
e38217f2ec build(deps): update cryptoxide requirement from 0.3.6 to 0.4.1 (#36) 2022-01-31 11:51:34 -03:00
Nicolas Di Prima
b4a530cc95 add Ed25519 and Ed25519Extended asymmetric keys 2022-01-22 10:33:14 +00:00
Nicolas Di Prima
350b8eeacb feat: make use of the pallas_crypto::Hash type (#25) 2022-01-20 12:11:04 -03:00
Nicolas Di Prima
57d6791096 Move the cryptographic hash to newly created pallas-crypto 2022-01-17 23:16:13 +00:00