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

Type Checker Regression on Primitive/Keyless/Hash/SHA.cry #559

Closed
WeeknightMVP opened this issue Jan 9, 2019 · 10 comments
Closed

Type Checker Regression on Primitive/Keyless/Hash/SHA.cry #559

WeeknightMVP opened this issue Jan 9, 2019 · 10 comments

Comments

@WeeknightMVP
Copy link

cryptol-specs> cryptol Primitive/Keyless/Hash/SHA.cry
┏━╸┏━┓╻ ╻┏━┓╺┳╸┏━┓╻  
┃  ┣┳┛┗┳┛┣━┛ ┃ ┃ ┃┃  
┗━╸╹┗╸ ╹ ╹   ╹ ┗━┛┗━╸
version 2.6.1 (f96e1e4)

Loading module Cryptol
Loading module Primitive::Keyless::Hash::SHA
[error] at Primitive/Keyless/Hash/SHA.cry:74:3--74:40:
  Failed to validate user-specified signature.
    in the definition of 'Primitive::Keyless::Hash::SHA::pad', at Primitive/Keyless/Hash/SHA.cry:74:3--74:6,
    we need to show that
      for any type Primitive::Keyless::Hash::SHA::j,
                   Primitive::Keyless::Hash::SHA::w, L
      assuming
        • fin Primitive::Keyless::Hash::SHA::j
        • Primitive::Keyless::Hash::SHA::j >= 17
        • fin Primitive::Keyless::Hash::SHA::w
        • Primitive::Keyless::Hash::SHA::w >= 1
        • 2 * Primitive::Keyless::Hash::SHA::w >= width L
      the following constraints hold:
      • Primitive::Keyless::Hash::SHA::num_blocks L *
        Primitive::Keyless::Hash::SHA::block_size >= 1 +
                                                     (L + 2 * Primitive::Keyless::Hash::SHA::w)
          arising from
          matching types
          at Primitive/Keyless/Hash/SHA.cry:74:11--74:40
@yav
Copy link
Member

yav commented Jan 9, 2019

Is it possible to have a look at the code that lead to this error somewhere?

@brianhuffman
Copy link
Contributor

@brianhuffman
Copy link
Contributor

With d8b1a7a, GaloisInc/cryptol-specs@e27ea10, and z3 version 4.6.0, everything works for me:

┏━╸┏━┓╻ ╻┏━┓╺┳╸┏━┓╻
┃  ┣┳┛┗┳┛┣━┛ ┃ ┃ ┃┃
┗━╸╹┗╸ ╹ ╹   ╹ ┗━┛┗━╸
version 2.6.1 (f96e1e4)

Loading module Cryptol
Loading module Primitive::Keyless::Hash::SHA
Primitive::Keyless::Hash::SHA (parameterized) >

@yav
Copy link
Member

yav commented Jan 9, 2019

I have Z3 4.7.1 and it appears to work on my build too. Which version are you using?

@WeeknightMVP
Copy link
Author

> z3 -version
Z3 version 4.8.3 - 64 bit

@WeeknightMVP
Copy link
Author

WeeknightMVP commented Jan 9, 2019

This also works on my build if I use Z3 4.7.1.

> z3 -version
Z3 version 4.7.1 - 64 bit
> cryptol Primitive/Keyless/Hash/SHA.cry 
┏━╸┏━┓╻ ╻┏━┓╺┳╸┏━┓╻  
┃  ┣┳┛┗┳┛┣━┛ ┃ ┃ ┃┃  
┗━╸╹┗╸ ╹ ╹   ╹ ┗━┛┗━╸
version 2.6.1 (f96e1e4)

Loading module Cryptol
Loading module Primitive::Keyless::Hash::SHA
Primitive::Keyless::Hash::SHA (parameterized) > 

@brianhuffman
Copy link
Contributor

I tested a few different z3 releases: It works with 4.8.1, but fails with 4.8.3.

@yav
Copy link
Member

yav commented Jan 17, 2019

This seems to be an issue with z3, which is being tracked here:

Z3Prover/z3#2079

@weaversa
Copy link
Collaborator

weaversa commented Jun 3, 2019

This works again with the z3 released yesterday.

@weaversa weaversa closed this as completed Jun 3, 2019
@WeeknightMVP
Copy link
Author

FYSA -- Primitive::Keyless::Hash::SHA stalls with Z3 4.8.9 but works again with Z3 4.8.10.

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

No branches or pull requests

4 participants