Skip to content

Commit

Permalink
Update Changelog
Browse files Browse the repository at this point in the history
  • Loading branch information
naure committed Jun 15, 2020
1 parent 66910ea commit 87dd67b
Show file tree
Hide file tree
Showing 5 changed files with 54 additions and 39 deletions.
18 changes: 16 additions & 2 deletions Changelog.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,21 @@
# Version v1.2.2, 2020-06, gadgetlib

Interface definition:
- Added fields for different data types in `KeyValue`.

C++:
- Added a library and CLI to call gadgets from gadgetlib TinyRAM (see `cpp/gadgetlib.cpp`).

# Version v1.2.1, 2020-06, libsnark prover

C++:
- Added a CLI to setup/prove/verify using libsnark (see `cpp/backend.cpp`).

# Version 1.2.0, 2020-06, Arithmetic circuits

Interface definition:
- Added constraint_type to support for both R1CS and arithmetic circuits.
- *(breaking)* Position of the field `ConstraintSystem.info` (unused afaik.).
- Added `ConstraintSystem.constraint_type` to support for both R1CS and arithmetic circuits.

Rust:
- *(breaking)* New field `ConstraintSystemOwned.constraint_type`
Expand All @@ -12,8 +25,9 @@ Rust:
# Version 1.1.0, 2020-06, Simplifications

Interface definition:
- *(breaking)* Renamed R1CSContraints to ConstraintSystem.
- *(breaking)* Moved r1cs_generation and witness_generation from Circuit to Command.
- *(breaking)* The position of Circuit `field_maximum` and `configuration` changed (unused afaik.).
- Renamed R1CSContraints to ConstraintSystem.
- Added a dedicated Command message type to help with interoperable execution.
- Added an example file in binary and JSON.

Expand Down
1 change: 1 addition & 0 deletions cpp/gadgetlib.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ make_configuration(FlatBufferBuilder &builder, vector<pair<string, string>> keyv
config.emplace_back(
CreateKeyValue(builder,
builder.CreateString(kv->first),
0,
builder.CreateString(kv->second)));
}
return builder.CreateVector(config);
Expand Down
46 changes: 23 additions & 23 deletions cpp/zkinterface_generated.h
Original file line number Diff line number Diff line change
Expand Up @@ -989,8 +989,8 @@ flatbuffers::Offset<Variables> CreateVariables(flatbuffers::FlatBufferBuilder &_
struct KeyValueT : public flatbuffers::NativeTable {
typedef KeyValue TableType;
std::string key;
std::string text;
std::vector<uint8_t> data;
std::string text;
int64_t number;
KeyValueT()
: number(0) {
Expand All @@ -1000,8 +1000,8 @@ struct KeyValueT : public flatbuffers::NativeTable {
inline bool operator==(const KeyValueT &lhs, const KeyValueT &rhs) {
return
(lhs.key == rhs.key) &&
(lhs.text == rhs.text) &&
(lhs.data == rhs.data) &&
(lhs.text == rhs.text) &&
(lhs.number == rhs.number);
}

Expand All @@ -1018,8 +1018,8 @@ struct KeyValue FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
typedef KeyValueBuilder Builder;
enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE {
VT_KEY = 4,
VT_TEXT = 6,
VT_DATA = 8,
VT_DATA = 6,
VT_TEXT = 8,
VT_NUMBER = 10
};
const flatbuffers::String *key() const {
Expand All @@ -1028,18 +1028,18 @@ struct KeyValue FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
flatbuffers::String *mutable_key() {
return GetPointer<flatbuffers::String *>(VT_KEY);
}
const flatbuffers::String *text() const {
return GetPointer<const flatbuffers::String *>(VT_TEXT);
}
flatbuffers::String *mutable_text() {
return GetPointer<flatbuffers::String *>(VT_TEXT);
}
const flatbuffers::Vector<uint8_t> *data() const {
return GetPointer<const flatbuffers::Vector<uint8_t> *>(VT_DATA);
}
flatbuffers::Vector<uint8_t> *mutable_data() {
return GetPointer<flatbuffers::Vector<uint8_t> *>(VT_DATA);
}
const flatbuffers::String *text() const {
return GetPointer<const flatbuffers::String *>(VT_TEXT);
}
flatbuffers::String *mutable_text() {
return GetPointer<flatbuffers::String *>(VT_TEXT);
}
int64_t number() const {
return GetField<int64_t>(VT_NUMBER, 0);
}
Expand All @@ -1050,10 +1050,10 @@ struct KeyValue FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
return VerifyTableStart(verifier) &&
VerifyOffset(verifier, VT_KEY) &&
verifier.VerifyString(key()) &&
VerifyOffset(verifier, VT_TEXT) &&
verifier.VerifyString(text()) &&
VerifyOffset(verifier, VT_DATA) &&
verifier.VerifyVector(data()) &&
VerifyOffset(verifier, VT_TEXT) &&
verifier.VerifyString(text()) &&
VerifyField<int64_t>(verifier, VT_NUMBER) &&
verifier.EndTable();
}
Expand All @@ -1069,12 +1069,12 @@ struct KeyValueBuilder {
void add_key(flatbuffers::Offset<flatbuffers::String> key) {
fbb_.AddOffset(KeyValue::VT_KEY, key);
}
void add_text(flatbuffers::Offset<flatbuffers::String> text) {
fbb_.AddOffset(KeyValue::VT_TEXT, text);
}
void add_data(flatbuffers::Offset<flatbuffers::Vector<uint8_t>> data) {
fbb_.AddOffset(KeyValue::VT_DATA, data);
}
void add_text(flatbuffers::Offset<flatbuffers::String> text) {
fbb_.AddOffset(KeyValue::VT_TEXT, text);
}
void add_number(int64_t number) {
fbb_.AddElement<int64_t>(KeyValue::VT_NUMBER, number, 0);
}
Expand All @@ -1093,31 +1093,31 @@ struct KeyValueBuilder {
inline flatbuffers::Offset<KeyValue> CreateKeyValue(
flatbuffers::FlatBufferBuilder &_fbb,
flatbuffers::Offset<flatbuffers::String> key = 0,
flatbuffers::Offset<flatbuffers::String> text = 0,
flatbuffers::Offset<flatbuffers::Vector<uint8_t>> data = 0,
flatbuffers::Offset<flatbuffers::String> text = 0,
int64_t number = 0) {
KeyValueBuilder builder_(_fbb);
builder_.add_number(number);
builder_.add_data(data);
builder_.add_text(text);
builder_.add_data(data);
builder_.add_key(key);
return builder_.Finish();
}

inline flatbuffers::Offset<KeyValue> CreateKeyValueDirect(
flatbuffers::FlatBufferBuilder &_fbb,
const char *key = nullptr,
const char *text = nullptr,
const std::vector<uint8_t> *data = nullptr,
const char *text = nullptr,
int64_t number = 0) {
auto key__ = key ? _fbb.CreateString(key) : 0;
auto text__ = text ? _fbb.CreateString(text) : 0;
auto data__ = data ? _fbb.CreateVector<uint8_t>(*data) : 0;
auto text__ = text ? _fbb.CreateString(text) : 0;
return zkinterface::CreateKeyValue(
_fbb,
key__,
text__,
data__,
text__,
number);
}

Expand Down Expand Up @@ -1430,8 +1430,8 @@ inline void KeyValue::UnPackTo(KeyValueT *_o, const flatbuffers::resolver_functi
(void)_o;
(void)_resolver;
{ auto _e = key(); if (_e) _o->key = _e->str(); }
{ auto _e = text(); if (_e) _o->text = _e->str(); }
{ auto _e = data(); if (_e) { _o->data.resize(_e->size()); for (flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { _o->data[_i] = _e->Get(_i); } } }
{ auto _e = text(); if (_e) _o->text = _e->str(); }
{ auto _e = number(); _o->number = _e; }
}

Expand All @@ -1444,14 +1444,14 @@ inline flatbuffers::Offset<KeyValue> CreateKeyValue(flatbuffers::FlatBufferBuild
(void)_o;
struct _VectorArgs { flatbuffers::FlatBufferBuilder *__fbb; const KeyValueT* __o; const flatbuffers::rehasher_function_t *__rehasher; } _va = { &_fbb, _o, _rehasher}; (void)_va;
auto _key = _o->key.empty() ? 0 : _fbb.CreateString(_o->key);
auto _text = _o->text.empty() ? 0 : _fbb.CreateString(_o->text);
auto _data = _o->data.size() ? _fbb.CreateVector(_o->data) : 0;
auto _text = _o->text.empty() ? 0 : _fbb.CreateString(_o->text);
auto _number = _o->number;
return zkinterface::CreateKeyValue(
_fbb,
_key,
_text,
_data,
_text,
_number);
}

Expand Down
26 changes: 13 additions & 13 deletions rust/src/zkinterface_generated.rs
Original file line number Diff line number Diff line change
Expand Up @@ -853,48 +853,48 @@ impl<'a> KeyValue<'a> {
args: &'args KeyValueArgs<'args>) -> flatbuffers::WIPOffset<KeyValue<'bldr>> {
let mut builder = KeyValueBuilder::new(_fbb);
builder.add_number(args.number);
if let Some(x) = args.data { builder.add_data(x); }
if let Some(x) = args.text { builder.add_text(x); }
if let Some(x) = args.data { builder.add_data(x); }
if let Some(x) = args.key { builder.add_key(x); }
builder.finish()
}

pub const VT_KEY: flatbuffers::VOffsetT = 4;
pub const VT_TEXT: flatbuffers::VOffsetT = 6;
pub const VT_DATA: flatbuffers::VOffsetT = 8;
pub const VT_DATA: flatbuffers::VOffsetT = 6;
pub const VT_TEXT: flatbuffers::VOffsetT = 8;
pub const VT_NUMBER: flatbuffers::VOffsetT = 10;

#[inline]
pub fn key(&self) -> Option<&'a str> {
self._tab.get::<flatbuffers::ForwardsUOffset<&str>>(KeyValue::VT_KEY, None)
}
#[inline]
pub fn text(&self) -> Option<&'a str> {
self._tab.get::<flatbuffers::ForwardsUOffset<&str>>(KeyValue::VT_TEXT, None)
}
#[inline]
pub fn data(&self) -> Option<&'a [u8]> {
self._tab.get::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'a, u8>>>(KeyValue::VT_DATA, None).map(|v| v.safe_slice())
}
#[inline]
pub fn text(&self) -> Option<&'a str> {
self._tab.get::<flatbuffers::ForwardsUOffset<&str>>(KeyValue::VT_TEXT, None)
}
#[inline]
pub fn number(&self) -> i64 {
self._tab.get::<i64>(KeyValue::VT_NUMBER, Some(0)).unwrap()
}
}

pub struct KeyValueArgs<'a> {
pub key: Option<flatbuffers::WIPOffset<&'a str>>,
pub text: Option<flatbuffers::WIPOffset<&'a str>>,
pub data: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a , u8>>>,
pub text: Option<flatbuffers::WIPOffset<&'a str>>,
pub number: i64,
}
impl<'a> Default for KeyValueArgs<'a> {
#[inline]
fn default() -> Self {
KeyValueArgs {
key: None,
text: None,
data: None,
text: None,
number: 0,
}
}
Expand All @@ -909,14 +909,14 @@ impl<'a: 'b, 'b> KeyValueBuilder<'a, 'b> {
self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(KeyValue::VT_KEY, key);
}
#[inline]
pub fn add_text(&mut self, text: flatbuffers::WIPOffset<&'b str>) {
self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(KeyValue::VT_TEXT, text);
}
#[inline]
pub fn add_data(&mut self, data: flatbuffers::WIPOffset<flatbuffers::Vector<'b , u8>>) {
self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(KeyValue::VT_DATA, data);
}
#[inline]
pub fn add_text(&mut self, text: flatbuffers::WIPOffset<&'b str>) {
self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(KeyValue::VT_TEXT, text);
}
#[inline]
pub fn add_number(&mut self, number: i64) {
self.fbb_.push_slot::<i64>(KeyValue::VT_NUMBER, number, 0);
}
Expand Down
2 changes: 1 addition & 1 deletion zkinterface.fbs
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,8 @@ table Variables {
table KeyValue {
key :string;
// The value goes into one the following:
text :string;
data :[ubyte];
text :string;
number :int64;
}

Expand Down

0 comments on commit 87dd67b

Please sign in to comment.