INNER CODE UNIT · Go

TestEMACWithPadding

emmansun/gmsm · cbcmac/cbcmac_test.go:106

func TestEMACWithPadding(t *testing.T) {
	// Test vectors from GB/T 15821.1-2020 Appendix B.
	cases := []struct {
		key1           []byte
		key2           []byte
		src            []byte
		tag            []byte
		newPaddingFunc padding.NewPaddingFunc
	}{
		{
			[]byte{0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef, 0xfe, 0xdc, 0xba, 0x98, 0x76, 0x54, 0x32, 0x10},
			[]byte{0x41, 0x49, 0xd2, 0xad, 0xed, 0x94, 0x56, 0x68, 0x1e, 0xc8, 0xb5, 0x11, 0xd9, 0xe7, 0xee, 0x04},
			nil,
			[]byte{0x2c, 0xf6, 0xed, 0xf6, 0x3c, 0xce, 0x14, 0x44, 0x89, 0xea, 0xdd, 0xf0, 0x7b, 0x49, 0x38, 0xdb},
			padding.NewISO9797M2Padding,
		},
		{
			[]byte{0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef, 0xfe, 0xdc, 0xba, 0x98, 0x76, 0x54, 0x32, 0x10},

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…