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

Martin/5092 mutator seals #179

Merged
merged 9 commits into from
Dec 3, 2020

Conversation

arrivets
Copy link
Contributor

@arrivets arrivets commented Nov 25, 2020

This PR addresses issue 5092

Update Mutator sealExtend

  • Check that seals correspond to IncorporatedResults on the current fork

  • Create IsValidSeal stub which should check the cryptographic integrity of the
    seal and verify that it has collected enough approval signatures based on
    the chunk assignment derived from the IncorporatedResult

* Check that seals correspond to IncorporatedResults on the current fork

* Create IsValidSeal stub which should check the cryptographic integrity of the
  seal and verify that it has collected enough approval signatures based on
  the chunk assignment derived from the IncorporatedResult
@arrivets arrivets changed the base branch from feature/new-sealing-phase-2 to martin/chunk-based-sealing November 25, 2020 13:56
@arrivets arrivets changed the base branch from martin/chunk-based-sealing to feature/new-sealing-phase-2 November 25, 2020 13:56
@arrivets arrivets changed the base branch from feature/new-sealing-phase-2 to master November 25, 2020 14:28
@arrivets arrivets changed the base branch from master to feature/new-sealing-phase-2 November 25, 2020 14:29
Copy link
Member

@AlexHentschel AlexHentschel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a great PR; thanks Martin.
Very well documented and tested 👏 .

I only have a couple minor stylistic suggestions. It also would be great to add a few more test cases:

  • see my suggestion for extending TestExtendSealNoIncorporatedResult
  • Mutator rejects duplicated seals:
    • seal was already included in a parent block
    • two seals for the same block are included in the same payload

(In case there are already tests for some of the listed scenarios, my apologies. Feel free to just skip)

state/protocol/badger/mutator.go Outdated Show resolved Hide resolved
state/protocol/badger/mutator.go Outdated Show resolved Hide resolved
state/protocol/badger/mutator.go Outdated Show resolved Hide resolved
state/protocol/badger/mutator_test.go Outdated Show resolved Hide resolved
state/protocol/badger/mutator_test.go Show resolved Hide resolved
state/protocol/badger/mutator_test.go Show resolved Hide resolved
state/protocol/badger/mutator_test.go Show resolved Hide resolved
Copy link
Member

@jordanschalm jordanschalm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, nice work! 💯


// Collect execution results from receipts. We are visiting the blocks
// in ascending order, so if the lookup table already contains an entry
// for an execution result, we don't need top updated it.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// for an execution result, we don't need top updated it.
// for an execution result, we don't need to update it.

@@ -391,24 +391,29 @@ func TestExtendSealedBoundary(t *testing.T) {
require.NoError(t, err)
require.Equal(t, seal.FinalState, finalCommit, "original commit should be root commit")

// Create a first block on top of root
first := unittest.BlockWithParentFixture(root.Header)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since we have both receipts and blocks here with names first..., I'd suggest including the type in the names for both (eg. firstBlock or block1 and receipt1)

require.NoError(t, err)

err = state.Mutate().Extend(&second)
// Add a third block containg a seal for the first block
firstSeal := unittest.SealFixture(unittest.SealFromResult(&firstReceipt.ExecutionResult))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have variables seal and firstSeal - I'd suggest renaming to seal to rootSeal to disambiguate, especially for the assertions at the end of the test


// get the parent's block seal, which constitutes the beginning of the
// Get the latest seal in the fork that ends with block `ParentID`.
// This last sealed block in the fork constitutes the beginning of the
// sealing chain; if no seals are part of the payload, it will also be used
// for the candidate block, which remains at the same sealed state
last, err := m.state.seals.ByBlockID(header.ParentID)
if err != nil {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This assumes the parent seal must be found. Could we add a comment explaining why?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you mean, why it would be an unexpected internal error if we didn't find the latest seal in the fork?
I think the explanation would be

// Get the latest seal in the fork that ends with block `ParentID`.  The protocol state saves this 
// information for each block that has been successfully added the chain tree. Prior to entering this 
// method, we check in `headerExtend` that the candidate block's header is a valid extension of 
// the chain. Reaching this payload check here implies that `headerExtend` passed successfully, 
// i.e. the parent must already be part of the chain tree. Therefore, _not_ finding the latest sealed block
// in the fork up to the parent constitutes a fatal internal error. 

Does that sound like a convincing argument?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for each block that has been successfully added the chain tree

worth noting that this is true even for blocks that don't themselves contain any seals

Copy link
Member

@zhangchiqing zhangchiqing Dec 1, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the explanation would be

Yeah, thanks for the explanation. I wonder if makes sense to make such dependency more explicit by taking the seal from the input:

lastSealedUpToParentBlock, err := headerExtend(block)
err := sealExtend(block, lastSealedUpToParentBlock)

This way, headerExtend must be called before sealExtend, otherwise there is no lastSealedUpToParentBlock.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am a big proponent of making conceptual dependencies explicit in the code. Thanks for the suggestion Leo.
+1

Copy link
Member

@AlexHentschel AlexHentschel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for cleaning up sealExtend; the code is much more readable now.
Great work!


// get the parent's block seal, which constitutes the beginning of the
// Get the latest seal in the fork that ends with block `ParentID`.
// This last sealed block in the fork constitutes the beginning of the
// sealing chain; if no seals are part of the payload, it will also be used
// for the candidate block, which remains at the same sealed state
last, err := m.state.seals.ByBlockID(header.ParentID)
if err != nil {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for each block that has been successfully added the chain tree

worth noting that this is true even for blocks that don't themselves contain any seals

Comment on lines 406 to 409
// sealExtend checks the compliance of the payload seals and returns the last
// valid seal on the fork. Payload seals should form a valid chain on top of the
// last seal, and should only correspond to blocks and execution results
// incorporated on the current fork.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// sealExtend checks the compliance of the payload seals and returns the last
// valid seal on the fork. Payload seals should form a valid chain on top of the
// last seal, and should only correspond to blocks and execution results
// incorporated on the current fork.
// sealExtend checks the compliance of the payload seals and returns the last
// valid seal on the fork up to and including `candidate`. Payload seals should form a valid chain on top of the
// last seal as of the parent of `candidate`, and should only correspond to blocks and execution results
// incorporated on the current fork.

state/protocol/badger/mutator.go Show resolved Hide resolved
utils/unittest/epoch_builder.go Show resolved Hide resolved
* add lastSealUpToParent parameter to make the dependency on checking the
  existance of this seal explicit in the code

* add comment about implicit validation of the sub-graph check
Copy link
Member

@AlexHentschel AlexHentschel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. The Mutator is very clean now :-)
From my perspective, the PR is ready to be merged without any further modifications.

Comment on lines 25 to 30
func NewMutator(state *State) *Mutator {
return &Mutator{
state: state,
}
}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we still need the constructor? We now have the

// MutatorFactory is an interface that is used to build Mutator instance
// it is used to inject different implementations for badger.State.
type MutatorFactory interface {
Create(state *State) protocol.Mutator
}

Suggested change
func NewMutator(state *State) *Mutator {
return &Mutator{
state: state,
}
}

I think the implementation is also not setting the required filed validator

type Mutator struct {
state *State
validator module.ReceiptValidator
}

@arrivets arrivets merged commit e92bbbd into feature/new-sealing-phase-2 Dec 3, 2020
@arrivets arrivets deleted the martin/5092-mutator-seals branch December 3, 2020 10:41
huitseeker added a commit to huitseeker/flow-go that referenced this pull request Jun 16, 2021
The diff contains:
- a lot of changes that concern parts of the library we don't use (other curves a la BN, BLS24-X, BLS12-383 ...), integer protocols (ETRS), field extension machinery ...
- otherwise irrelevant changes, e.g. CI/CD
- some memory bug fixing

[Full Changeset](https://github.com/relic-toolkit/relic/compare/7a9bba7f..9206ae5)

**Fixed bugs:**

- Unexpected failure of ep2\_mul\[\_lwnaf\] above the prime group order [\onflow#64](relic-toolkit/relic#64)

**Closed issues:**

- Other way to construct towered extension fields [\onflow#203](relic-toolkit/relic#203)
- blake2.h:101:5: error: size of array element is not a multiple of its alignment [\onflow#202](relic-toolkit/relic#202)
- ECIES 160bit [\onflow#201](relic-toolkit/relic#201)
- Compilation with "ARITH gmp" fails [\onflow#200](relic-toolkit/relic#200)
- Support for armv8-a ? [\onflow#198](relic-toolkit/relic#198)
- Function name bn\_init conflicts with OpenSSL when used in tandem [\onflow#196](relic-toolkit/relic#196)
- 16-bit MSP430 [\onflow#193](relic-toolkit/relic#193)
- Modular exponentiation returns 1 if exponent is 0 and modulo is 1 [\onflow#185](relic-toolkit/relic#185)
- Compilation of RELIC with bls12-446 and bls12-455 fails [\onflow#182](relic-toolkit/relic#182)
- test\_bn fails with BLS12-381 preset [\onflow#181](relic-toolkit/relic#181)
- \[BUG\] undefined reference to `bench_init', `bench\_clean' [\onflow#180](relic-toolkit/relic#180)
- Tests FTBFS because of missing symbol in header [\onflow#179](relic-toolkit/relic#179)
- Builds are broken [\onflow#178](relic-toolkit/relic#178)
- compile error  inlining failed in call to always\_inline ‘\_mm\_alignr\_epi8’ on unbantu20.04 gcc9 [\onflow#177](relic-toolkit/relic#177)
- bn\_write\_str buffer overflow [\onflow#176](relic-toolkit/relic#176)
- ECDSA verify succeeds when it should fail [\onflow#175](relic-toolkit/relic#175)
- ec\_mul\_gen hangs with curve SECG\_K256 [\onflow#174](relic-toolkit/relic#174)
- Wrong square root computation [\onflow#173](relic-toolkit/relic#173)
- Out-of-bounds read via bn\_sqr\_basic [\onflow#172](relic-toolkit/relic#172)
- OSS-Fuzz integration [\onflow#171](relic-toolkit/relic#171)
- Building Relic with Curve NIST\_P256 throws FATAL ERROR in relic\_fp\_prime.c:120 [\onflow#170](relic-toolkit/relic#170)
- Compressing \(packing\) a point to binary array does not comply with X9.62 standard [\onflow#169](relic-toolkit/relic#169)
-  ‘ctx\_t’ {aka ‘struct \_ctx\_t’} has no member named ‘total’ [\onflow#168](relic-toolkit/relic#168)
- relic does not work with C++ [\onflow#167](relic-toolkit/relic#167)
- Memory leak in ep2\_curve\_init/clean with ALLOC=DYNAMIC [\onflow#166](relic-toolkit/relic#166)
- \*\_is\_valid\(\) functions produce false negative for not normalized points [\onflow#147](relic-toolkit/relic#147)
- Bench and Test doesnt build [\onflow#122](relic-toolkit/relic#122)

**Merged pull requests:**

- Add pairing delegation protocols [\onflow#199](relic-toolkit/relic#199) ([dfaranha](https://github.com/dfaranha))
- Fix support for Win64/MSVC targets. [\onflow#197](relic-toolkit/relic#197) ([dfaranha](https://github.com/dfaranha))
- Simplify generator getting for Gt. [\onflow#194](relic-toolkit/relic#194) ([luozejiaqun](https://github.com/luozejiaqun))
- cmake: Always use user defined CFLAGS, not only for release builds [\onflow#187](relic-toolkit/relic#187) ([xdustinface](https://github.com/xdustinface))
- Fix MinGW build [\onflow#186](relic-toolkit/relic#186) ([xdustinface](https://github.com/xdustinface))
- Remove debug printf in bn\_mxp\_slide [\onflow#184](relic-toolkit/relic#184) ([guidovranken](https://github.com/guidovranken))
- Remove ALLOC = STACK to simplify memory allocation. [\onflow#183](relic-toolkit/relic#183) ([dfaranha](https://github.com/dfaranha))
- Update relic\_alloc.h [\onflow#165](relic-toolkit/relic#165) ([aguycalled](https://github.com/aguycalled))
- Add correct support for FreeBSD and NetBSD [\onflow#164](relic-toolkit/relic#164) ([hoffmang9](https://github.com/hoffmang9))
huitseeker added a commit to huitseeker/flow-go that referenced this pull request Jul 12, 2021
The diff contains:
- a lot of changes that concern parts of the library we don't use (other curves a la BN, BLS24-X, BLS12-383 ...), integer protocols (ETRS), field extension machinery ...
- otherwise irrelevant changes, e.g. CI/CD
- some memory bug fixing

[Full Changeset](https://github.com/relic-toolkit/relic/compare/7a9bba7f..9206ae5)

**Fixed bugs:**

- Unexpected failure of ep2\_mul\[\_lwnaf\] above the prime group order [\onflow#64](relic-toolkit/relic#64)

**Closed issues:**

- Other way to construct towered extension fields [\onflow#203](relic-toolkit/relic#203)
- blake2.h:101:5: error: size of array element is not a multiple of its alignment [\onflow#202](relic-toolkit/relic#202)
- ECIES 160bit [\onflow#201](relic-toolkit/relic#201)
- Compilation with "ARITH gmp" fails [\onflow#200](relic-toolkit/relic#200)
- Support for armv8-a ? [\onflow#198](relic-toolkit/relic#198)
- Function name bn\_init conflicts with OpenSSL when used in tandem [\onflow#196](relic-toolkit/relic#196)
- 16-bit MSP430 [\onflow#193](relic-toolkit/relic#193)
- Modular exponentiation returns 1 if exponent is 0 and modulo is 1 [\onflow#185](relic-toolkit/relic#185)
- Compilation of RELIC with bls12-446 and bls12-455 fails [\onflow#182](relic-toolkit/relic#182)
- test\_bn fails with BLS12-381 preset [\onflow#181](relic-toolkit/relic#181)
- \[BUG\] undefined reference to `bench_init', `bench\_clean' [\onflow#180](relic-toolkit/relic#180)
- Tests FTBFS because of missing symbol in header [\onflow#179](relic-toolkit/relic#179)
- Builds are broken [\onflow#178](relic-toolkit/relic#178)
- compile error  inlining failed in call to always\_inline ‘\_mm\_alignr\_epi8’ on unbantu20.04 gcc9 [\onflow#177](relic-toolkit/relic#177)
- bn\_write\_str buffer overflow [\onflow#176](relic-toolkit/relic#176)
- ECDSA verify succeeds when it should fail [\onflow#175](relic-toolkit/relic#175)
- ec\_mul\_gen hangs with curve SECG\_K256 [\onflow#174](relic-toolkit/relic#174)
- Wrong square root computation [\onflow#173](relic-toolkit/relic#173)
- Out-of-bounds read via bn\_sqr\_basic [\onflow#172](relic-toolkit/relic#172)
- OSS-Fuzz integration [\onflow#171](relic-toolkit/relic#171)
- Building Relic with Curve NIST\_P256 throws FATAL ERROR in relic\_fp\_prime.c:120 [\onflow#170](relic-toolkit/relic#170)
- Compressing \(packing\) a point to binary array does not comply with X9.62 standard [\onflow#169](relic-toolkit/relic#169)
-  ‘ctx\_t’ {aka ‘struct \_ctx\_t’} has no member named ‘total’ [\onflow#168](relic-toolkit/relic#168)
- relic does not work with C++ [\onflow#167](relic-toolkit/relic#167)
- Memory leak in ep2\_curve\_init/clean with ALLOC=DYNAMIC [\onflow#166](relic-toolkit/relic#166)
- \*\_is\_valid\(\) functions produce false negative for not normalized points [\onflow#147](relic-toolkit/relic#147)
- Bench and Test doesnt build [\onflow#122](relic-toolkit/relic#122)

**Merged pull requests:**

- Add pairing delegation protocols [\onflow#199](relic-toolkit/relic#199) ([dfaranha](https://github.com/dfaranha))
- Fix support for Win64/MSVC targets. [\onflow#197](relic-toolkit/relic#197) ([dfaranha](https://github.com/dfaranha))
- Simplify generator getting for Gt. [\onflow#194](relic-toolkit/relic#194) ([luozejiaqun](https://github.com/luozejiaqun))
- cmake: Always use user defined CFLAGS, not only for release builds [\onflow#187](relic-toolkit/relic#187) ([xdustinface](https://github.com/xdustinface))
- Fix MinGW build [\onflow#186](relic-toolkit/relic#186) ([xdustinface](https://github.com/xdustinface))
- Remove debug printf in bn\_mxp\_slide [\onflow#184](relic-toolkit/relic#184) ([guidovranken](https://github.com/guidovranken))
- Remove ALLOC = STACK to simplify memory allocation. [\onflow#183](relic-toolkit/relic#183) ([dfaranha](https://github.com/dfaranha))
- Update relic\_alloc.h [\onflow#165](relic-toolkit/relic#165) ([aguycalled](https://github.com/aguycalled))
- Add correct support for FreeBSD and NetBSD [\onflow#164](relic-toolkit/relic#164) ([hoffmang9](https://github.com/hoffmang9))
huitseeker added a commit to huitseeker/flow-go that referenced this pull request Jul 12, 2021
The diff contains:
- a lot of changes that concern parts of the library we don't use (other curves a la BN, BLS24-X, BLS12-383 ...), integer protocols (ETRS), field extension machinery ...
- otherwise irrelevant changes, e.g. CI/CD
- some memory bug fixing

[Full Changeset](https://github.com/relic-toolkit/relic/compare/7a9bba7f..9206ae5)

**Fixed bugs:**

- Unexpected failure of ep2\_mul\[\_lwnaf\] above the prime group order [\onflow#64](relic-toolkit/relic#64)

**Closed issues:**

- Other way to construct towered extension fields [\onflow#203](relic-toolkit/relic#203)
- blake2.h:101:5: error: size of array element is not a multiple of its alignment [\onflow#202](relic-toolkit/relic#202)
- ECIES 160bit [\onflow#201](relic-toolkit/relic#201)
- Compilation with "ARITH gmp" fails [\onflow#200](relic-toolkit/relic#200)
- Support for armv8-a ? [\onflow#198](relic-toolkit/relic#198)
- Function name bn\_init conflicts with OpenSSL when used in tandem [\onflow#196](relic-toolkit/relic#196)
- 16-bit MSP430 [\onflow#193](relic-toolkit/relic#193)
- Modular exponentiation returns 1 if exponent is 0 and modulo is 1 [\onflow#185](relic-toolkit/relic#185)
- Compilation of RELIC with bls12-446 and bls12-455 fails [\onflow#182](relic-toolkit/relic#182)
- test\_bn fails with BLS12-381 preset [\onflow#181](relic-toolkit/relic#181)
- \[BUG\] undefined reference to `bench_init', `bench\_clean' [\onflow#180](relic-toolkit/relic#180)
- Tests FTBFS because of missing symbol in header [\onflow#179](relic-toolkit/relic#179)
- Builds are broken [\onflow#178](relic-toolkit/relic#178)
- compile error  inlining failed in call to always\_inline ‘\_mm\_alignr\_epi8’ on unbantu20.04 gcc9 [\onflow#177](relic-toolkit/relic#177)
- bn\_write\_str buffer overflow [\onflow#176](relic-toolkit/relic#176)
- ECDSA verify succeeds when it should fail [\onflow#175](relic-toolkit/relic#175)
- ec\_mul\_gen hangs with curve SECG\_K256 [\onflow#174](relic-toolkit/relic#174)
- Wrong square root computation [\onflow#173](relic-toolkit/relic#173)
- Out-of-bounds read via bn\_sqr\_basic [\onflow#172](relic-toolkit/relic#172)
- OSS-Fuzz integration [\onflow#171](relic-toolkit/relic#171)
- Building Relic with Curve NIST\_P256 throws FATAL ERROR in relic\_fp\_prime.c:120 [\onflow#170](relic-toolkit/relic#170)
- Compressing \(packing\) a point to binary array does not comply with X9.62 standard [\onflow#169](relic-toolkit/relic#169)
-  ‘ctx\_t’ {aka ‘struct \_ctx\_t’} has no member named ‘total’ [\onflow#168](relic-toolkit/relic#168)
- relic does not work with C++ [\onflow#167](relic-toolkit/relic#167)
- Memory leak in ep2\_curve\_init/clean with ALLOC=DYNAMIC [\onflow#166](relic-toolkit/relic#166)
- \*\_is\_valid\(\) functions produce false negative for not normalized points [\onflow#147](relic-toolkit/relic#147)
- Bench and Test doesnt build [\onflow#122](relic-toolkit/relic#122)

**Merged pull requests:**

- Add pairing delegation protocols [\onflow#199](relic-toolkit/relic#199) ([dfaranha](https://github.com/dfaranha))
- Fix support for Win64/MSVC targets. [\onflow#197](relic-toolkit/relic#197) ([dfaranha](https://github.com/dfaranha))
- Simplify generator getting for Gt. [\onflow#194](relic-toolkit/relic#194) ([luozejiaqun](https://github.com/luozejiaqun))
- cmake: Always use user defined CFLAGS, not only for release builds [\onflow#187](relic-toolkit/relic#187) ([xdustinface](https://github.com/xdustinface))
- Fix MinGW build [\onflow#186](relic-toolkit/relic#186) ([xdustinface](https://github.com/xdustinface))
- Remove debug printf in bn\_mxp\_slide [\onflow#184](relic-toolkit/relic#184) ([guidovranken](https://github.com/guidovranken))
- Remove ALLOC = STACK to simplify memory allocation. [\onflow#183](relic-toolkit/relic#183) ([dfaranha](https://github.com/dfaranha))
- Update relic\_alloc.h [\onflow#165](relic-toolkit/relic#165) ([aguycalled](https://github.com/aguycalled))
- Add correct support for FreeBSD and NetBSD [\onflow#164](relic-toolkit/relic#164) ([hoffmang9](https://github.com/hoffmang9))
huitseeker added a commit to huitseeker/flow-go that referenced this pull request Jul 13, 2021
The diff contains:
- a lot of changes that concern parts of the library we don't use (other curves a la BN, BLS24-X, BLS12-383 ...), integer protocols (ETRS), field extension machinery ...
- otherwise irrelevant changes, e.g. CI/CD
- some memory bug fixing

[Full Changeset](https://github.com/relic-toolkit/relic/compare/7a9bba7f..9206ae5)

**Fixed bugs:**

- Unexpected failure of ep2\_mul\[\_lwnaf\] above the prime group order [\onflow#64](relic-toolkit/relic#64)

**Closed issues:**

- Other way to construct towered extension fields [\onflow#203](relic-toolkit/relic#203)
- blake2.h:101:5: error: size of array element is not a multiple of its alignment [\onflow#202](relic-toolkit/relic#202)
- ECIES 160bit [\onflow#201](relic-toolkit/relic#201)
- Compilation with "ARITH gmp" fails [\onflow#200](relic-toolkit/relic#200)
- Support for armv8-a ? [\onflow#198](relic-toolkit/relic#198)
- Function name bn\_init conflicts with OpenSSL when used in tandem [\onflow#196](relic-toolkit/relic#196)
- 16-bit MSP430 [\onflow#193](relic-toolkit/relic#193)
- Modular exponentiation returns 1 if exponent is 0 and modulo is 1 [\onflow#185](relic-toolkit/relic#185)
- Compilation of RELIC with bls12-446 and bls12-455 fails [\onflow#182](relic-toolkit/relic#182)
- test\_bn fails with BLS12-381 preset [\onflow#181](relic-toolkit/relic#181)
- \[BUG\] undefined reference to `bench_init', `bench\_clean' [\onflow#180](relic-toolkit/relic#180)
- Tests FTBFS because of missing symbol in header [\onflow#179](relic-toolkit/relic#179)
- Builds are broken [\onflow#178](relic-toolkit/relic#178)
- compile error  inlining failed in call to always\_inline ‘\_mm\_alignr\_epi8’ on unbantu20.04 gcc9 [\onflow#177](relic-toolkit/relic#177)
- bn\_write\_str buffer overflow [\onflow#176](relic-toolkit/relic#176)
- ECDSA verify succeeds when it should fail [\onflow#175](relic-toolkit/relic#175)
- ec\_mul\_gen hangs with curve SECG\_K256 [\onflow#174](relic-toolkit/relic#174)
- Wrong square root computation [\onflow#173](relic-toolkit/relic#173)
- Out-of-bounds read via bn\_sqr\_basic [\onflow#172](relic-toolkit/relic#172)
- OSS-Fuzz integration [\onflow#171](relic-toolkit/relic#171)
- Building Relic with Curve NIST\_P256 throws FATAL ERROR in relic\_fp\_prime.c:120 [\onflow#170](relic-toolkit/relic#170)
- Compressing \(packing\) a point to binary array does not comply with X9.62 standard [\onflow#169](relic-toolkit/relic#169)
-  ‘ctx\_t’ {aka ‘struct \_ctx\_t’} has no member named ‘total’ [\onflow#168](relic-toolkit/relic#168)
- relic does not work with C++ [\onflow#167](relic-toolkit/relic#167)
- Memory leak in ep2\_curve\_init/clean with ALLOC=DYNAMIC [\onflow#166](relic-toolkit/relic#166)
- \*\_is\_valid\(\) functions produce false negative for not normalized points [\onflow#147](relic-toolkit/relic#147)
- Bench and Test doesnt build [\onflow#122](relic-toolkit/relic#122)

**Merged pull requests:**

- Add pairing delegation protocols [\onflow#199](relic-toolkit/relic#199) ([dfaranha](https://github.com/dfaranha))
- Fix support for Win64/MSVC targets. [\onflow#197](relic-toolkit/relic#197) ([dfaranha](https://github.com/dfaranha))
- Simplify generator getting for Gt. [\onflow#194](relic-toolkit/relic#194) ([luozejiaqun](https://github.com/luozejiaqun))
- cmake: Always use user defined CFLAGS, not only for release builds [\onflow#187](relic-toolkit/relic#187) ([xdustinface](https://github.com/xdustinface))
- Fix MinGW build [\onflow#186](relic-toolkit/relic#186) ([xdustinface](https://github.com/xdustinface))
- Remove debug printf in bn\_mxp\_slide [\onflow#184](relic-toolkit/relic#184) ([guidovranken](https://github.com/guidovranken))
- Remove ALLOC = STACK to simplify memory allocation. [\onflow#183](relic-toolkit/relic#183) ([dfaranha](https://github.com/dfaranha))
- Update relic\_alloc.h [\onflow#165](relic-toolkit/relic#165) ([aguycalled](https://github.com/aguycalled))
- Add correct support for FreeBSD and NetBSD [\onflow#164](relic-toolkit/relic#164) ([hoffmang9](https://github.com/hoffmang9))
huitseeker added a commit to huitseeker/flow-go that referenced this pull request Jul 13, 2021
The diff contains:
- a lot of changes that concern parts of the library we don't use (other curves a la BN, BLS24-X, BLS12-383 ...), integer protocols (ETRS), field extension machinery ...
- otherwise irrelevant changes, e.g. CI/CD
- some memory bug fixing

[Full Changeset](https://github.com/relic-toolkit/relic/compare/7a9bba7f..9206ae5)

**Fixed bugs:**

- Unexpected failure of ep2\_mul\[\_lwnaf\] above the prime group order [\onflow#64](relic-toolkit/relic#64)

**Closed issues:**

- Other way to construct towered extension fields [\onflow#203](relic-toolkit/relic#203)
- blake2.h:101:5: error: size of array element is not a multiple of its alignment [\onflow#202](relic-toolkit/relic#202)
- ECIES 160bit [\onflow#201](relic-toolkit/relic#201)
- Compilation with "ARITH gmp" fails [\onflow#200](relic-toolkit/relic#200)
- Support for armv8-a ? [\onflow#198](relic-toolkit/relic#198)
- Function name bn\_init conflicts with OpenSSL when used in tandem [\onflow#196](relic-toolkit/relic#196)
- 16-bit MSP430 [\onflow#193](relic-toolkit/relic#193)
- Modular exponentiation returns 1 if exponent is 0 and modulo is 1 [\onflow#185](relic-toolkit/relic#185)
- Compilation of RELIC with bls12-446 and bls12-455 fails [\onflow#182](relic-toolkit/relic#182)
- test\_bn fails with BLS12-381 preset [\onflow#181](relic-toolkit/relic#181)
- \[BUG\] undefined reference to `bench_init', `bench\_clean' [\onflow#180](relic-toolkit/relic#180)
- Tests FTBFS because of missing symbol in header [\onflow#179](relic-toolkit/relic#179)
- Builds are broken [\onflow#178](relic-toolkit/relic#178)
- compile error  inlining failed in call to always\_inline ‘\_mm\_alignr\_epi8’ on unbantu20.04 gcc9 [\onflow#177](relic-toolkit/relic#177)
- bn\_write\_str buffer overflow [\onflow#176](relic-toolkit/relic#176)
- ECDSA verify succeeds when it should fail [\onflow#175](relic-toolkit/relic#175)
- ec\_mul\_gen hangs with curve SECG\_K256 [\onflow#174](relic-toolkit/relic#174)
- Wrong square root computation [\onflow#173](relic-toolkit/relic#173)
- Out-of-bounds read via bn\_sqr\_basic [\onflow#172](relic-toolkit/relic#172)
- OSS-Fuzz integration [\onflow#171](relic-toolkit/relic#171)
- Building Relic with Curve NIST\_P256 throws FATAL ERROR in relic\_fp\_prime.c:120 [\onflow#170](relic-toolkit/relic#170)
- Compressing \(packing\) a point to binary array does not comply with X9.62 standard [\onflow#169](relic-toolkit/relic#169)
-  ‘ctx\_t’ {aka ‘struct \_ctx\_t’} has no member named ‘total’ [\onflow#168](relic-toolkit/relic#168)
- relic does not work with C++ [\onflow#167](relic-toolkit/relic#167)
- Memory leak in ep2\_curve\_init/clean with ALLOC=DYNAMIC [\onflow#166](relic-toolkit/relic#166)
- \*\_is\_valid\(\) functions produce false negative for not normalized points [\onflow#147](relic-toolkit/relic#147)
- Bench and Test doesnt build [\onflow#122](relic-toolkit/relic#122)

**Merged pull requests:**

- Add pairing delegation protocols [\onflow#199](relic-toolkit/relic#199) ([dfaranha](https://github.com/dfaranha))
- Fix support for Win64/MSVC targets. [\onflow#197](relic-toolkit/relic#197) ([dfaranha](https://github.com/dfaranha))
- Simplify generator getting for Gt. [\onflow#194](relic-toolkit/relic#194) ([luozejiaqun](https://github.com/luozejiaqun))
- cmake: Always use user defined CFLAGS, not only for release builds [\onflow#187](relic-toolkit/relic#187) ([xdustinface](https://github.com/xdustinface))
- Fix MinGW build [\onflow#186](relic-toolkit/relic#186) ([xdustinface](https://github.com/xdustinface))
- Remove debug printf in bn\_mxp\_slide [\onflow#184](relic-toolkit/relic#184) ([guidovranken](https://github.com/guidovranken))
- Remove ALLOC = STACK to simplify memory allocation. [\onflow#183](relic-toolkit/relic#183) ([dfaranha](https://github.com/dfaranha))
- Update relic\_alloc.h [\onflow#165](relic-toolkit/relic#165) ([aguycalled](https://github.com/aguycalled))
- Add correct support for FreeBSD and NetBSD [\onflow#164](relic-toolkit/relic#164) ([hoffmang9](https://github.com/hoffmang9))
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

Successfully merging this pull request may close these issues.

None yet

4 participants