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

Low sensitivity doesn't transfer when converting string to []byte #831

Open
henriman opened this issue Jan 30, 2025 · 0 comments
Open

Low sensitivity doesn't transfer when converting string to []byte #831

henriman opened this issue Jan 30, 2025 · 0 comments
Labels

Comments

@henriman
Copy link

henriman commented Jan 30, 2025

I am working on verifying SIF for the VerifiedSCION router (using hyperGobra) with @jcp19.

When converting a low string s to a byte slice ([]byte(s)), the resulting slice is not considered low.

Consider the following two examples. For both test00 and test01, neither postcondition can be established.

ensures low(res)
ensures acc(res) && forall i int :: { res[i] } 0 <= i && i < len(res) ==> low(res[i])
func test00() (res []byte) {
    res := []byte("test")
}

requires low(s)
ensures low(res)
ensures acc(res) && forall i int :: { res[i] } 0 <= i && i < len(res) ==> low(res[i])
func test01(s string) (res []byte) {
    res := []byte(s)
}

It seems that the Viper encoding does not relate the contents of the byte slice to the given string.

@henriman henriman changed the title Low sensitivity doesn't transfer when converting string to byte slice Low sensitivity doesn't transfer when converting string to []byte Jan 30, 2025
@jcp19 jcp19 added the SIF label Feb 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants