Skip to content

Commit

Permalink
Identity Matrix exploit
Browse files Browse the repository at this point in the history
  • Loading branch information
Baunsgaard committed Feb 3, 2025
1 parent 24e6da7 commit 71b6c22
Showing 1 changed file with 24 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -601,6 +601,30 @@ public void leftMMIdentityPreAggregateDense(MatrixBlock that, MatrixBlock ret, i

@Override
public void rightDecompressingMult(MatrixBlock right, MatrixBlock ret, int rl, int ru, int nRows, int crl, int cru) {
if(_dict instanceof IdentityDictionary)
identityRightDecompressingMult(right, ret, rl, ru, crl, cru);
else
defaultRightDecompressingMult(right, ret, rl, ru, crl, cru);
}

private void identityRightDecompressingMult(MatrixBlock right, MatrixBlock ret, int rl, int ru, int crl, int cru) {
final double[] b = right.getDenseBlockValues();
final double[] c = ret.getDenseBlockValues();
final int jd = right.getNumColumns();
final int vLen = 8;
final int lenJ = cru - crl;
final int end = cru - (lenJ % vLen);
for(int i = rl; i < ru; i++) {
int k = _data.getIndex(i);
final int offOut = i * jd + crl;
final double aa = 1;
final int k_right = _colIndexes.get(k);
vectMM(aa, b, c, end, jd, crl, cru, offOut, k_right, vLen);

}
}

private void defaultRightDecompressingMult(MatrixBlock right, MatrixBlock ret, int rl, int ru, int crl, int cru) {
final double[] a = _dict.getValues();
final double[] b = right.getDenseBlockValues();
final double[] c = ret.getDenseBlockValues();
Expand Down Expand Up @@ -930,8 +954,6 @@ protected void denseSelection(MatrixBlock selection, P[] points, MatrixBlock ret
}
}



private void leftMMIdentityPreAggregateDenseSingleRow(double[] values, int pos, double[] values2, int pos2, int cl,
int cu) {
IdentityDictionary a = (IdentityDictionary) _dict;
Expand Down

0 comments on commit 71b6c22

Please sign in to comment.