Sector Key - "original" replica
Not sure when the cache paths are needed but I will figure it out.
EncodeInto(newReplicaPath, newCachePath, sectorKeyPath, sectorKeyCachePath, stagedDataPath, pieces []abi.PieceInfo, CommSectorKey) NewCommR, NewCommD
Encodes the stagedData
into sectorKey
and writes it to newReplicaPath
by generating CommD from PieceInfos and running the encoding process. Returns the new CommR
newReplica[i] = sectorKey[i] + data[i] * rand(i)
NewCommR = Comm(newReplica)
This is the core workflow of the protocol.
DecodeFrom(outDataPath, replicaPath, sectorKeyPath, sectorKeyCache, CommD, CommR, CommSectorKey)
Runs decoding process by generating encoding randomness from CommD and CommR and writing the result into outDataPath
.
data[i] = (replica[i] - sectorKey[i]) * (rand(i)^-1)
This will be probably used very little but still useful.
(TODO API call for generating sector key).
RemoveData[different name](sectorKeyPath, sectorKeyCache, replicaPath, replicaCachePath, dataPath, CommD, CommR, CommSectorKey)
Removes encoded data and produces SectorKey
sectorKey[i] = replica[i] - data[i] * rand(i)