use flags instead of states on sodium_secret_layer