Pluggable Group as easily reviewed first step to @noble support
@cloudflare has currently limited attentional bandwidth to comfortably switch out sjcl for (more performant/secure/maintained) @noble/{curves,hashes} and needs time for a review process. There were some concerns about swapping out the Group implementation wholesale, so this attempts as a logical first step to restructure the code to allow plugging in multiple implementations.
Add indirection
The current code makes direct uses of the implementation classes Group/Elt/Scalar everywhere directly. We extract interface for the instances and constructors and place in src/groupTypes.ts.
The Oprf class, already home to many constants and a getGroup(suiteId) is endowed with a getter/setter for a Group property, of type GroupCons.
Set a default Group
Scjl Group will be configured by default. This, of course, would mean bundling (i.e. webpack) sjcl even where it's not used/needed, but at least it's pluggable!
Pluggable Group as easily reviewed first step to @noble support
@cloudflare has currently limited attentional bandwidth to comfortably switch out sjcl for (more performant/secure/maintained) @noble/{curves,hashes} and needs time for a review process. There were some concerns about swapping out the Group implementation wholesale, so this attempts as a logical first step to restructure the code to allow plugging in multiple implementations.
Add indirection
The current code makes direct uses of the implementation classes
Group
/Elt
/Scalar
everywhere directly. We extract interface for the instances and constructors and place insrc/groupTypes.ts
.The Oprf class, already home to many constants and a
getGroup(suiteId)
is endowed with a getter/setter for a Group property, of typeGroupCons
.Set a default Group
Scjl Group will be configured by default. This, of course, would mean bundling (i.e. webpack) sjcl even where it's not used/needed, but at least it's pluggable!