enso-org / enso

Hybrid visual and textual functional programming.
https://enso.org
Apache License 2.0
7.34k stars 320 forks source link

Replace SHA3-224 algorithm in `text-buffer` by SHA1 #8662

Open Akirathan opened 8 months ago

Akirathan commented 8 months ago

In text-buffer, SHA3-224 is used for calculating the checksum of a text content - https://github.com/enso-org/enso/blob/689c8f7c3c9bb745d8d65e35384a22f084fd2160/lib/scala/text-buffer/src/main/scala/org/enso/text/Sha3_224VersionCalculator.scala#L11

According to the original author, @4e6, there is no reason to use specifically SHA3-224, so we can just use the simpler SHA-1.

Note that this change also requires modifications to some gui parts.

Related to:

hubertp commented 8 months ago

A duplicate of https://github.com/enso-org/enso/issues/6691 I think.

4e6 commented 8 months ago

I think the scope is different. This one only implies the change of hashing algorithm in the text/applyEdit request.

4e6 commented 8 months ago

Also @Akirathan, if the goal is just to remove the bouncycastle dependency, can the version calclulator use the same logic with the MessageDigest from the standard library as FileSystem does? Without changing the algo https://github.com/enso-org/enso/blob/689c8f7c3c9bb745d8d65e35384a22f084fd2160/engine/language-server/src/main/scala/org/enso/languageserver/filemanager/FileSystem.scala#L234-L248

4e6 commented 8 months ago

Ok, I see, you already did it in #8664

Akirathan commented 8 months ago

Ok, I see, you already did it in #8664

Yes. Removing the org.bouncycastle dependency is a related, but different task. And it is done in #8664.

hubertp commented 8 months ago

I think the scope is different. This one only implies the change of hashing algorithm in the text/applyEdit request.

Fine, but there is a problem (at least currently) when we have to support both, old and new, GUI. They can't use different algorithms. I would say this would have to wait until old GUI is completely dropped and still will be an incompatible change.

JaroslavTulach commented 8 months ago

this would have to wait until old GUI is completely dropped

Or we can fix the old GUI to use SHA-1. I assume downgrading the algorithm is going to be easy.

jdunkerley commented 8 months ago

On hold until GUI1 is retired then we will switch to SHA1 in GUI2.