1
0
mirror of https://github.com/henrydcase/nobs.git synced 2024-11-26 00:51:22 +00:00
This commit is contained in:
Henry Case 2018-06-23 16:48:54 +01:00
parent 8cf7cfdc8d
commit 4b06c1b314
5 changed files with 876 additions and 799 deletions

View File

@ -53,7 +53,7 @@ func r2(
} }
func sm3e(W0 uint32, W7 uint32, W13 uint32, W3 uint32, W10 uint32) uint32 { func sm3e(W0 uint32, W7 uint32, W13 uint32, W3 uint32, W10 uint32) uint32 {
return p1(W0 ^ W7 ^ rotl32(15, W13)) ^ rotl32(7, W3) ^ W10 return p1(W0^W7^rotl32(15, W13)) ^ rotl32(7, W3) ^ W10
} }
func loadBe32(x []byte) uint32 { func loadBe32(x []byte) uint32 {
@ -61,21 +61,21 @@ func loadBe32(x []byte) uint32 {
} }
func store64Be(val []byte, x uint64) { func store64Be(val []byte, x uint64) {
val[0] = byte(x>>56) val[0] = byte(x >> 56)
val[1] = byte(x>>48) val[1] = byte(x >> 48)
val[2] = byte(x>>40) val[2] = byte(x >> 40)
val[3] = byte(x>>32) val[3] = byte(x >> 32)
val[4] = byte(x>>24) val[4] = byte(x >> 24)
val[5] = byte(x>>16) val[5] = byte(x >> 16)
val[6] = byte(x>>8 ) val[6] = byte(x >> 8)
val[7] = byte(x>>0 ) val[7] = byte(x >> 0)
} }
func store32Be(val []byte, x uint32) { func store32Be(val []byte, x uint32) {
val[0] = byte(x>>24) val[0] = byte(x >> 24)
val[1] = byte(x>>16) val[1] = byte(x >> 16)
val[2] = byte(x>>8 ) val[2] = byte(x >> 8)
val[3] = byte(x>>0 ) val[3] = byte(x >> 0)
} }
func (d *digest) compress(input []byte, blocks int) { func (d *digest) compress(input []byte, blocks int) {
@ -243,4 +243,3 @@ func (d *digest) compress(input []byte, blocks int) {
H = d.h[7] H = d.h[7]
} }
} }

View File

@ -61,7 +61,7 @@ func (d *digest) Write(input []byte) (nn int, err error) {
idx := int(d.len & uint64((d.BlockSize() - 1))) idx := int(d.len & uint64((d.BlockSize() - 1)))
d.len += uint64(len(input)) d.len += uint64(len(input))
if len(input) + idx < d.BlockSize() { if len(input)+idx < d.BlockSize() {
copy(d.b[idx:], input) copy(d.b[idx:], input)
return return
} }
@ -87,19 +87,23 @@ func (d *digest) Sum(in []byte) []byte {
dc.Write(in) dc.Write(in)
idx := int(dc.len & uint64(dc.BlockSize() - 1)) idx := int(dc.len & uint64(dc.BlockSize()-1))
for i:=idx+1; i<len(dc.b); i++ {dc.b[i] = 0} for i := idx + 1; i < len(dc.b); i++ {
dc.b[i] = 0
}
dc.b[idx] = 0x80 dc.b[idx] = 0x80
if idx >= 56 { if idx >= 56 {
dc.compress(dc.b[:], 1) dc.compress(dc.b[:], 1)
for i:=range (dc.b) {dc.b[i] = 0} for i := range dc.b {
dc.b[i] = 0
}
} }
// add total bits // add total bits
store64Be(dc.b[56:], dc.len * 8) store64Be(dc.b[56:], dc.len*8)
dc.compress(dc.b[:], 1) dc.compress(dc.b[:], 1)
for i:=0; i<Size/4; i++ { for i := 0; i < Size/4; i++ {
store32Be(output[4*i:], dc.h[i]) store32Be(output[4*i:], dc.h[i])
} }
return output[:] return output[:]

View File

@ -352,7 +352,7 @@ func TestSM3OfficialVectors(t *testing.T) {
}, },
} }
for i:=range vectors { for i := range vectors {
do_hash(t, i, vectors[i].in[:], vectors[i].out) do_hash(t, i, vectors[i].in[:], vectors[i].out)
} }
} }
@ -365,137 +365,137 @@ func TestSM3Sizes(t *testing.T) {
* and they do depend on correctness of "SM3 tiny" implementation * and they do depend on correctness of "SM3 tiny" implementation
*/ */
kat := [][32]byte{ kat := [][32]byte{
{ 0x1a, 0xb2, 0x1d, 0x83, 0x55, 0xcf, 0xa1, 0x7f, 0x8e, 0x61, 0x19, 0x48, 0x31, 0xe8, 0x1a, 0x8f, {0x1a, 0xb2, 0x1d, 0x83, 0x55, 0xcf, 0xa1, 0x7f, 0x8e, 0x61, 0x19, 0x48, 0x31, 0xe8, 0x1a, 0x8f,
0x22, 0xbe, 0xc8, 0xc7, 0x28, 0xf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c, 0x90, 0xdd, 0x9a, 0xc1,
0x64, 0xc4, 0x14, 0x2c, 0xcf, 0x63, 0xca, 0x18, 0x9a, 0x8f, 0x64, 0x5e, 0xc9, 0x6f, 0xf8, 0xde }, 0x64, 0xc4, 0x14, 0x2c, 0xcf, 0x63, 0xca, 0x18, 0x9a, 0x8f, 0x64, 0x5e, 0xc9, 0x6f, 0xf8, 0xde},
{ 0xaf, 0xcc, 0x87, 0x0f, 0xa2, 0x0c, 0x50, 0x79, 0x95, 0x49, 0x97, 0x94, 0x37, 0x1e, 0x8c, 0x25, {0xaf, 0xcc, 0x87, 0x0f, 0xa2, 0x0c, 0x50, 0x79, 0x95, 0x49, 0x97, 0x94, 0x37, 0x1e, 0x8c, 0x25,
0xe3, 0xa7, 0x31, 0x0f, 0xa7, 0x22, 0x00, 0xc1, 0x09, 0x37, 0x99, 0x73, 0xae, 0x23, 0x68, 0x45 }, 0xe3, 0xa7, 0x31, 0x0f, 0xa7, 0x22, 0x00, 0xc1, 0x09, 0x37, 0x99, 0x73, 0xae, 0x23, 0x68, 0x45},
{ 0x04, 0x71, 0x33, 0x17, 0xea, 0x89, 0x4e, 0x89, 0x0d, 0x27, 0xfb, 0x1c, 0xf0, 0x80, 0x0e, 0xad, {0x04, 0x71, 0x33, 0x17, 0xea, 0x89, 0x4e, 0x89, 0x0d, 0x27, 0xfb, 0x1c, 0xf0, 0x80, 0x0e, 0xad,
0x81, 0x83, 0xf6, 0x47, 0xfd, 0x2f, 0xd3, 0x11, 0x2d, 0x15, 0x1f, 0x8a, 0xc2, 0x69, 0x61, 0x7c }, 0x81, 0x83, 0xf6, 0x47, 0xfd, 0x2f, 0xd3, 0x11, 0x2d, 0x15, 0x1f, 0x8a, 0xc2, 0x69, 0x61, 0x7c},
{ 0x40, 0x7b, 0x8b, 0x70, 0x20, 0x99, 0x35, 0x66, 0xd8, 0x15, 0x36, 0x31, 0xa6, 0x7c, 0xe5, 0x83, {0x40, 0x7b, 0x8b, 0x70, 0x20, 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2, 0x7b, 0x97, 0x1f, {0x52, 0x41, 0xdc, 0x10, 0xcb, 0x3c, 0x70, 0x0e, 0x46, 0x44, 0x69, 0x43, 0xd2, 0x7b, 0x97, 0x1f,
0xef, 0xa7, 0xe8, 0x81, 0x15, 0xf8, 0x66, 0xd6, 0xf8, 0x3d, 0x50, 0x2f, 0xf1, 0xbc, 0x06, 0xc2 }, 0xef, 0xa7, 0xe8, 0x81, 0x15, 0xf8, 0x66, 0xd6, 0xf8, 0x3d, 0x50, 0x2f, 0xf1, 0xbc, 0x06, 0xc2},
} }
for i:=range kat { for i := range kat {
in := make([]byte, i) in := make([]byte, i)
do_hash(t, i, in[:], kat[i]) do_hash(t, i, in[:], kat[i])
} }

53
rand/ctr_drbg.go Normal file
View File

@ -0,0 +1,53 @@
import rand
import (
"crypto/aes"
"crypto/cipher"
)
// Constants below correspond to AES-256, which is currently
// the only block cipher supported.
const {
Blocklen = 16
Keylen = 32
}
type CtrDrbg struct {
v uint
keylen uint // OZAPTF: is it needed?
counter uint
strength uint
resistance bool
}
func (c *CtrDrbg) update(data []byte) {
}
func New() *CtrDrbg {
c = new(CtrDrbg)
c.key = make([]byte, 0, Keylen)
c.v = make([]byte, 0, Blocklen)
// Security strength for AES-256 as per SP800-57, 5.6.1
c.strength = 256
return c
}
func (c *CtrDrbg) Init(entropy []byte, personalization []byte, strength uint) bool {
if len(entropy) < (c.strength/8) {
return nil
}
// does enropyt needs to have some minimal length?
seed := make([]byte, 0, c.strength / 8)
c.update(seed)
c.counter = 1
return c
}
func (c *CtrDrbg) Update() {}
func (c *CtrDrbg) Read(b []byte) (n int, err error) {
}

21
rand/ctr_drbg_test.go Normal file
View File

@ -0,0 +1,21 @@
import rand
import (
"testing"
"fmt"
"io"
"os"
"crypto/aes"
"crypto/cipher"
)
func TestNominal(t* testing.T) {
block, err := aes.NewCipher(key)
if err != nil {
panic(err)
}
stream := cipher.NewCTR(block, iv)
stream.XORKeyStream(pt, ct)
}