I would not call `restrict` here as in the unlikely event that the keys are modified they will not be valid and the error may not become immediately obvious. Instead I would go for `toRestricted`, i.e.

```haskell
        ...
        public  <- toRestricted <$> SB.packCString cstr1
        private <- toRestricted <$> SB.packCString cstr2
        maybe (fail errmsg) return ((,) <$> public <*> private)
  where
    errmsg = "curveKeyPair: invalid key-lengths produced"
```

Okay?