mirror of
https://github.com/ProvableHQ/leo.git
synced 2024-12-25 11:12:48 +03:00
fix circuit function struct in core module
This commit is contained in:
parent
efe734afaf
commit
1b1cfd015d
@ -61,72 +61,69 @@ impl CoreCircuit for Blake2sCircuit {
|
||||
fn ast(circuit_name: Identifier, span: Span) -> Circuit {
|
||||
Circuit {
|
||||
circuit_name,
|
||||
members: vec![CircuitMember::CircuitFunction(
|
||||
true, // static function
|
||||
Function {
|
||||
identifier: Identifier {
|
||||
name: "hash".to_owned(),
|
||||
members: vec![CircuitMember::CircuitFunction(Function {
|
||||
identifier: Identifier {
|
||||
name: "hash".to_owned(),
|
||||
span: span.clone(),
|
||||
},
|
||||
input: vec![
|
||||
FunctionInput::Variable(FunctionInputVariable {
|
||||
identifier: Identifier {
|
||||
name: "seed".to_owned(),
|
||||
span: span.clone(),
|
||||
},
|
||||
mutable: false,
|
||||
type_: Type::Array(
|
||||
Box::new(Type::IntegerType(IntegerType::U8)),
|
||||
ArrayDimensions(vec![PositiveNumber {
|
||||
value: 32usize.to_string(),
|
||||
span: span.clone(),
|
||||
}]),
|
||||
),
|
||||
span: span.clone(),
|
||||
},
|
||||
input: vec![
|
||||
FunctionInput::Variable(FunctionInputVariable {
|
||||
identifier: Identifier {
|
||||
}),
|
||||
FunctionInput::Variable(FunctionInputVariable {
|
||||
identifier: Identifier {
|
||||
name: "message".to_owned(),
|
||||
span: span.clone(),
|
||||
},
|
||||
mutable: false,
|
||||
type_: Type::Array(
|
||||
Box::new(Type::IntegerType(IntegerType::U8)),
|
||||
ArrayDimensions(vec![PositiveNumber {
|
||||
value: 32usize.to_string(),
|
||||
span: span.clone(),
|
||||
}]),
|
||||
),
|
||||
span: span.clone(),
|
||||
}),
|
||||
],
|
||||
output: Some(Type::Array(
|
||||
Box::new(Type::IntegerType(IntegerType::U8)),
|
||||
ArrayDimensions(vec![PositiveNumber {
|
||||
value: 32usize.to_string(),
|
||||
span: span.clone(),
|
||||
}]),
|
||||
)),
|
||||
statements: vec![Statement::Return(
|
||||
Expression::CoreFunctionCall(
|
||||
Self::name(),
|
||||
vec![
|
||||
Expression::Identifier(Identifier {
|
||||
name: "seed".to_owned(),
|
||||
span: span.clone(),
|
||||
},
|
||||
mutable: false,
|
||||
type_: Type::Array(
|
||||
Box::new(Type::IntegerType(IntegerType::U8)),
|
||||
ArrayDimensions(vec![PositiveNumber {
|
||||
value: 32usize.to_string(),
|
||||
span: span.clone(),
|
||||
}]),
|
||||
),
|
||||
span: span.clone(),
|
||||
}),
|
||||
FunctionInput::Variable(FunctionInputVariable {
|
||||
identifier: Identifier {
|
||||
}),
|
||||
Expression::Identifier(Identifier {
|
||||
name: "message".to_owned(),
|
||||
span: span.clone(),
|
||||
},
|
||||
mutable: false,
|
||||
type_: Type::Array(
|
||||
Box::new(Type::IntegerType(IntegerType::U8)),
|
||||
ArrayDimensions(vec![PositiveNumber {
|
||||
value: 32usize.to_string(),
|
||||
span: span.clone(),
|
||||
}]),
|
||||
),
|
||||
span: span.clone(),
|
||||
}),
|
||||
],
|
||||
output: Some(Type::Array(
|
||||
Box::new(Type::IntegerType(IntegerType::U8)),
|
||||
ArrayDimensions(vec![PositiveNumber {
|
||||
value: 32usize.to_string(),
|
||||
span: span.clone(),
|
||||
}]),
|
||||
)),
|
||||
statements: vec![Statement::Return(
|
||||
Expression::CoreFunctionCall(
|
||||
Self::name(),
|
||||
vec![
|
||||
Expression::Identifier(Identifier {
|
||||
name: "seed".to_owned(),
|
||||
span: span.clone(),
|
||||
}),
|
||||
Expression::Identifier(Identifier {
|
||||
name: "message".to_owned(),
|
||||
span: span.clone(),
|
||||
}),
|
||||
],
|
||||
span.clone(),
|
||||
),
|
||||
}),
|
||||
],
|
||||
span.clone(),
|
||||
)],
|
||||
span,
|
||||
},
|
||||
)],
|
||||
),
|
||||
span.clone(),
|
||||
)],
|
||||
span,
|
||||
})],
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user