]> Repositorios git - scryer-prolog.git/commit
ENHANCED: Use crrl for Ed25519 signing and signature verification.
authorMarkus Triska <[email protected]>
Tue, 26 Dec 2023 06:24:18 +0000 (07:24 +0100)
committerMarkus Triska <[email protected]>
Tue, 26 Dec 2023 06:33:44 +0000 (07:33 +0100)
commit47ec5eb6c618a5b97b83a34341c7e0d1f241a9f7
tree7f45c1fd368e72403c1c5095ac9e94e4ec7d88f9
parent799035c69254da8e98cd90de3a828807eb6cdb75
ENHANCED: Use crrl for Ed25519 signing and signature verification.

The main motivation for this change is the introduction of the newly
available predicate ed25519_seed_keypair/2, allowing to generate a key
pair from a given seed. In this way, a key pair can be dynamically
generated from (for example) a password, using crypto_password_hash/3
in combination with crypto_data_hkdf/4 to generate the seed. The
advantage of this method is that the private key need not be stored at
all anywhere.

It is not possible to add a corresponding feature to ring, since it is
closed as "not planned": https://github.com/briansmith/ring/issues/1003

I also used this opportunity to move more of the logic to Prolog. We
now have total control of the key pair representation, and I also
changed the representation to conform to the PKCS#8 v2 standard,
something that only later ring versions do, while still being
backwards compatible with tools that produce a wrong representation
including earlier ring versions.

Another great advantage we get from this change is that the Ed25519
predicates now also run on the 32-bit and WASM versions of Scryer.
build/instructions_template.rs
src/lib/crypto.pl
src/machine/dispatch.rs
src/machine/system_calls.rs