Skip to content

Commit

Permalink
[Document] typo fix
Browse files Browse the repository at this point in the history
Now beyond SHA256, SHA3_256 is also supported HashingAlgorithm
BlockHashingDataStructure --> BlockDataHashingStructure

Signed-off-by: DavidLiu <david.yx.liu@oracle.com>
  • Loading branch information
DavidLiu authored and denyeart committed Aug 28, 2021
1 parent 6ec8d72 commit aa76c70
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 18 deletions.
10 changes: 5 additions & 5 deletions bccsp/opts.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ const (
// an error will be returned.
ECDSA = "ECDSA"

// ECDSA Elliptic Curve Digital Signature Algorithm over P-256 curve
// ECDSAP256 Elliptic Curve Digital Signature Algorithm over P-256 curve
ECDSAP256 = "ECDSAP256"

// ECDSA Elliptic Curve Digital Signature Algorithm over P-384 curve
// ECDSAP384 Elliptic Curve Digital Signature Algorithm over P-384 curve
ECDSAP384 = "ECDSAP384"

// ECDSAReRand ECDSA key re-randomization
Expand All @@ -26,11 +26,11 @@ const (
// Each BCCSP may or may not support default security level. If not supported than
// an error will be returned.
AES = "AES"
// AES Advanced Encryption Standard at 128 bit security level
// AES128 Advanced Encryption Standard at 128 bit security level
AES128 = "AES128"
// AES Advanced Encryption Standard at 192 bit security level
// AES192 Advanced Encryption Standard at 192 bit security level
AES192 = "AES192"
// AES Advanced Encryption Standard at 256 bit security level
// AES256 Advanced Encryption Standard at 256 bit security level
AES256 = "AES256"

// HMAC keyed-hash message authentication code
Expand Down
6 changes: 3 additions & 3 deletions common/channelconfig/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ type ApplicationCapabilities interface {
// - new chaincode lifecycle, as described in FAB-11237
V1_3Validation() bool

// StorePvtDataOfInvalidTx() returns true if the peer needs to store the pvtData of
// StorePvtDataOfInvalidTx returns true if the peer needs to store the pvtData of
// invalid transactions (as introduced in v142).
StorePvtDataOfInvalidTx() bool

Expand Down Expand Up @@ -246,8 +246,8 @@ type Resources interface {
// and whether the Orderer config exists
OrdererConfig() (Orderer, bool)

// ConsortiumsConfig() returns the config.Consortiums for the channel
// and whether the consortiums config exists
// ConsortiumsConfig returns the config.Consortiums for the channel
// and whether the consortiums' config exists
ConsortiumsConfig() (Consortiums, bool)

// ApplicationConfig returns the configtxapplication.SharedConfig for the channel
Expand Down
12 changes: 6 additions & 6 deletions common/channelconfig/channel.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const (
// OrdererAddressesKey is the cb.ConfigItem type key name for the OrdererAddresses message
OrdererAddressesKey = "OrdererAddresses"

// GroupKey is the name of the channel group
// ChannelGroupKey is the name of the channel group
ChannelGroupKey = "Channel"

// CapabilitiesKey is the name of the key which refers to capabilities, it appears at the channel,
Expand Down Expand Up @@ -86,21 +86,21 @@ func NewChannelConfig(channelGroup *cb.ConfigGroup, bccsp bccsp.BCCSP) (*Channel
return nil, errors.Wrap(err, "failed to deserialize values")
}

capabilities := cc.Capabilities()
channelCapabilities := cc.Capabilities()

if err := cc.Validate(capabilities); err != nil {
if err := cc.Validate(channelCapabilities); err != nil {
return nil, err
}

mspConfigHandler := NewMSPConfigHandler(capabilities.MSPVersion(), bccsp)
mspConfigHandler := NewMSPConfigHandler(channelCapabilities.MSPVersion(), bccsp)

var err error
for groupName, group := range channelGroup.Groups {
switch groupName {
case ApplicationGroupKey:
cc.appConfig, err = NewApplicationConfig(group, mspConfigHandler)
case OrdererGroupKey:
cc.ordererConfig, err = NewOrdererConfig(group, mspConfigHandler, capabilities)
cc.ordererConfig, err = NewOrdererConfig(group, mspConfigHandler, channelCapabilities)
case ConsortiumsGroupKey:
cc.consortiumsConfig, err = NewConsortiumsConfig(group, mspConfigHandler)
default:
Expand Down Expand Up @@ -143,7 +143,7 @@ func (cc *ChannelConfig) HashingAlgorithm() func(input []byte) []byte {
return cc.hashingAlgorithm
}

// BlockDataHashingStructure returns the width to use when forming the block data hashing structure
// BlockDataHashingStructureWidth returns the width to use when forming the block data hashing structure
func (cc *ChannelConfig) BlockDataHashingStructureWidth() uint32 {
return cc.protos.BlockDataHashingStructure.Width
}
Expand Down
4 changes: 2 additions & 2 deletions common/channelconfig/channel_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,13 @@ func TestHashingAlgorithm(t *testing.T) {
require.Error(t, cc.validateHashingAlgorithm(), "Bad hashing algorithm supplied")

cc = &ChannelConfig{protos: &ChannelProtos{HashingAlgorithm: &cb.HashingAlgorithm{Name: bccsp.SHA256}}}
require.NoError(t, cc.validateHashingAlgorithm(), "Allowed hashing algorith SHA256 supplied")
require.NoError(t, cc.validateHashingAlgorithm(), "Allowed hashing algorithm SHA256 supplied")

require.Equal(t, reflect.ValueOf(util.ComputeSHA256).Pointer(), reflect.ValueOf(cc.HashingAlgorithm()).Pointer(),
"Unexpected hashing algorithm returned")

cc = &ChannelConfig{protos: &ChannelProtos{HashingAlgorithm: &cb.HashingAlgorithm{Name: bccsp.SHA3_256}}}
require.NoError(t, cc.validateHashingAlgorithm(), "Allowed hashing algorith SHA3_256 supplied")
require.NoError(t, cc.validateHashingAlgorithm(), "Allowed hashing algorithm SHA3_256 supplied")

require.Equal(t, reflect.ValueOf(util.ComputeSHA3256).Pointer(), reflect.ValueOf(cc.HashingAlgorithm()).Pointer(),
"Unexpected hashing algorithm returned")
Expand Down
2 changes: 1 addition & 1 deletion common/channelconfig/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ func ConsortiumValue(name string) *StandardConfigValue {
}
}

// HashingAlgorithm returns the only currently valid hashing algorithm.
// HashingAlgorithmValue returns the default hashing algorithm.
// It is a value for the /Channel group.
func HashingAlgorithmValue() *StandardConfigValue {
return &StandardConfigValue{
Expand Down
2 changes: 1 addition & 1 deletion docs/source/configtx.rst
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ with different names.

Values: map<string, *ConfigValue> {
"HashingAlgorithm":common.HashingAlgorithm,
"BlockHashingDataStructure":common.BlockDataHashingStructure,
"BlockDataHashingStructure":common.BlockDataHashingStructure,
"Consortium":common.Consortium,
"OrdererAddresses":common.OrdererAddresses,
},
Expand Down

0 comments on commit aa76c70

Please sign in to comment.