forked from wolfSSL/wolfssl
Bug fix for cache attack
This commit is contained in:
@ -446,12 +446,11 @@ INLINE static void fp_mul_comba_mulx(fp_int *A, fp_int *B, fp_int *C)
|
||||
pa = FP_SIZE-1;
|
||||
}
|
||||
|
||||
if (A == C || B == C) {
|
||||
/* Always take branch to use tmp variable. This avoids a cache attack for
|
||||
* determining if C equals A */
|
||||
if (1) {
|
||||
fp_init(&tmp);
|
||||
dst = &tmp;
|
||||
} else {
|
||||
fp_zero(C);
|
||||
dst = C;
|
||||
}
|
||||
|
||||
TFM_INTEL_MUL_COMBA(A, B, dst) ;
|
||||
|
Reference in New Issue
Block a user