Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SCT: wrong handling of while loops #887

Closed
vbgl opened this issue Sep 3, 2024 · 1 comment · Fixed by #888
Closed

SCT: wrong handling of while loops #887

vbgl opened this issue Sep 3, 2024 · 1 comment · Fixed by #888
Assignees

Comments

@vbgl
Copy link
Member

vbgl commented Sep 3, 2024

The following program is secure but the S-CT checker rejects in with an incorrect argument.

bug_887.jazz", line 8 (32-35):
speculative constant type checker: the variable msf is not known to be a msf, only ∅ are

fn test(reg u64 msf x) {
  while {
    msf = #init_msf();
  } (x != 0) {
    msf = #update_msf(x != 0, msf);
    x = 0;
  }
  msf = #update_msf(! (x != 0), msf);
}

Based on a report by Santiago (@sarranz).

@vbgl vbgl self-assigned this Sep 3, 2024
@vbgl vbgl changed the title SCT: wrong handling of MSF in while loops SCT: wrong handling of ~MSF in~ while loops Sep 4, 2024
@vbgl vbgl changed the title SCT: wrong handling of ~MSF in~ while loops SCT: wrong handling of while loops Sep 4, 2024
@vbgl
Copy link
Member Author

vbgl commented Sep 4, 2024

In fact, it is not only the MSF that is wrongly handled. The following program is accepted by the SCT checker (but fortunately rejected by the CT checker).

fn test_venv(#secret reg u64 s) {
  reg u64 i r;
  r = 0;
  i = 0;
  while {
    r = s;
  } (i < 10) {
    r = 0;
    i += 1;
  }
  [r] = 0;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant