aboutsummaryrefslogtreecommitdiff
path: root/guests/fibonacci/src/lib.rs
blob: 42e0630530c898bcd5d3e31eb8aa93dd4ce8f540 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#![cfg_attr(feature = "no_std", no_std)]

#[guests_macro::proving_entrypoint]
pub fn main(n: u8, fN: u64) -> bool {
    let mut f0 = 0;
    let mut f1 = 1;

    for _ in 0..n {
        let fN = f0 + f1;
        f0 = f1;
        f1 = fN;
    }

    f0 == fN
}