libgocryptfs/internal/cryptocore/cryptocore_go1.4_test.go

21 lines
371 B
Go
Raw Normal View History

2016-05-04 22:10:06 +02:00
// +build !go1.5
// = go 1.4 or lower
package cryptocore
import (
"testing"
)
2016-09-20 21:58:04 +02:00
// Native Go crypto with 128-bit IVs is only supported on Go 1.5 and up,
// this should panic.
2016-05-04 22:10:06 +02:00
func TestCryptoCoreNewGo14(t *testing.T) {
defer func() {
if r := recover(); r == nil {
t.Errorf("The code did not panic")
}
}()
key := make([]byte, 32)
2016-09-20 21:58:04 +02:00
New(key, BackendGoGCM, 128)
2016-05-04 22:10:06 +02:00
}