Skip to content

Commit

Permalink
Merge pull request filecoin-project#5393 from filecoin-project/feat-r…
Browse files Browse the repository at this point in the history
…efactor-bls

refactor: switch to filecoin-ffi bls api for bls signatures
  • Loading branch information
magik6k authored and bibibong committed Feb 21, 2021
1 parent 66eb016 commit 1c26694
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/sigs/bls/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,10 @@ func (blsSigner) GenPrivateFromSeed(seed []byte) ([]byte, error) {
return nil, fmt.Errorf("bls signature seed not byte(32)")
}
// Note private keys seem to be serialized little-endian!
pk := blst.KeyGen(seed[:32]).ToLEndian()
return pk, nil
var ikm [32]byte
copy(ikm[:], seed[:32])
sk := ffi.PrivateKeyGenerateWithSeed(ikm)
return sk[:], nil
}

func (blsSigner) ToPublic(priv []byte) ([]byte, error) {
Expand Down

0 comments on commit 1c26694

Please sign in to comment.