Expose XOFs like SHAKE128 and SHAKE256
Maintainer antworten meist innerhalb von 1 Tag
Bewertung
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Anfängerfreundlichkeit
- 48/100
- Issue-Typ
- Feature
- Klarheit
- Größtenteils klar
- Aktivitätsstatus
- Ruhig
- Bereich
- cryptography
Rechercherichtung
Beginne damit, die Verarbeitung von OpenSSL::Digest rund um EVP_MD_CTX_size und die digest-Methode nachzuverfolgen, und prüfe anschließend, wie EVP_DigestSqueeze in die vorgeschlagene API passen könnte. Bestätige das gewünschte Verhalten für SHAKE128 und SHAKE256, einschließlich digest(length); als erledigt gilt die Aufgabe, wenn Ausgaben variabler Länge funktionieren, ohne Digests fester Länge zu beeinträchtigen, und durch Tests abgedeckt sind.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
SHAKE is a XOF from the Keccak family of algorithms. Loosely, you can consider them a digest. The thing that sets them apart though is that they have no fixed output size, instead callers indicate "How much data do you want from it?" The 128 and 256 are secure strengths, not output sizes like SHA-2-256.
Even though SHAKE is an EVP-MD, the ruby/openssl project assumes that all digests have a fixed length output.
digest = OpenSSL::Digest.new("SHAKE256") # Works
digest << "hello world" # Works
digest.digest # Fail: ArgumentError: negative string size (or size too big)
Largely because the gem is attempting to ask the EVP_MD how big the digest is using EVP_MD_CTX_size, which returns -1, which is where the ArgumentError comes from.
A small suggestion would be to recognize that when EVP_MD_CTX_size return -1, a length must be supplied to digest
digest = OpenSSL::Digest.new("SHAKE256")
digest << "hello world"
digest.digest(64)
This will allow using the SHAKE XOF.
As a further property of XOFs is "squeeze", exposed by OpenSSL's EVP_DigestSqueeze.
One could imagine doing something like
digest = OpenSSL::Digest.new("SHAKE256")
digest << "hello world"
digest.squeeze(32) + digest.squeeze(32) # Equivalent to digest(64)
Squeeze allows someone to "read" from the XOF in pieces, instead of reading it all out at at once with digest.
Why is this useful?
SHAKE-256 is used to compute the message representative, or mu, when using ML-DSA in external mu. Ruby's ML-DSA does support signing mu instead of the message, but the lack of SHAKE makes it difficult to compute mu. For example, using a made-up mu:
key = OpenSSL::PKey.generate_key("ML-DSA-65")
mu = "\x00" * 64 # This should actually be computed with SHAKE-256
signature = key.sign(nil, mu, "mu" => "1")
Because SHAKE-256 can absorb very large amounts of data, it works like signing a hash with combined with external mu. This is how you can sign very large amounts of data, like a file, without putting the whole file in memory.
This is distinct, and different than HashML-DSA which has largely failed to gain traction in many other standards, and instead recommend using external-mu.
For the purposes of external mu, the digest.squeeze functionality is not needed with EVP_DigestSqueeze, but having some means digest(64) is needed.
I will offer my time to contribute the work, however I would like to better understand what the maintainers would want this to look like before getting started.
- Vorherrschende Sprache
- C
- Sterne
- 276
- Forks
- 204
- Ø Merge
- 1 T. 7 Std.
- Gemergte PRs (30 T.)
- 9
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Keine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus ruby/openssl
-
Add OpenSSL::SSL::SSLContext#client_hello_cb= (binding for SSL_CTX_set_client_hello_cb())Evtl. vergeben @kou hat das vor 10 Tagen übernommen. Offen
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 53/100
ruby/openssl#1125 · 3 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 55/100
ruby/openssl#1118 · 5 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 35/100
ruby/openssl#1075 · 4 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
-
Unchecked *_set_* callsEvtl. vergeben @ndossche hat das vor 177 Tagen übernommen. Offen
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 35/100
ruby/openssl#1038 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 Ein halber Tag Anfängerfreundlichkeit 45/100
ruby/openssl#975 · 3 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
Ähnliche Issues
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 76/100
polhenarejos/pico-fido#302 ·
-
开发板墙缺少 ESP32_S31_MOSAICOOffen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 67/100
espressif/esp-vision#16 · 1 Kommentar ·
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 74/100
libsdl-org/SDL#16577 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 66/100
Maintainer antworten meist innerhalb von 1 Tag
-
halt_error adds a trailing newline for non-string input, contrary to the manualEvtl. vergeben @Huang-404-Q hat das heute übernommen. Offen
Schwierigkeit 1/5 1-3 Stunden Anfängerfreundlichkeit 88/100
Maintainer antworten meist innerhalb von 2 Tagen