Skip to content

Commit 5d9c346

Browse files
committed
Update
Signed-off-by: Vlad Gheorghiu <vsoftco@gmail.com>
1 parent 63ef6fe commit 5d9c346

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

examples/rand/rand.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import (
77
"runtime"
88

99
"github.com/open-quantum-safe/liboqs-go/oqs"
10-
oqsrand "github.com/open-quantum-safe/liboqs-go/oqs/rand" // RNG support
10+
"github.com/open-quantum-safe/liboqs-go/oqs/rand" // RNG support
1111
)
1212

1313
// CustomRNG provides a (trivial) custom random number generator; the memory is
@@ -22,20 +22,20 @@ func CustomRNG(randomArray []byte, bytesToRead int) {
2222
func main() {
2323
fmt.Println("liboqs version: " + oqs.LiboqsVersion())
2424

25-
if err := oqsrand.RandomBytesSwitchAlgorithm("system"); err != nil {
25+
if err := rand.RandomBytesSwitchAlgorithm("system"); err != nil {
2626
log.Fatal(err)
2727
}
28-
fmt.Printf("%18s% X\n", "System (default): ", oqsrand.RandomBytes(32))
29-
if err := oqsrand.RandomBytesCustomAlgorithm(CustomRNG); err != nil {
28+
fmt.Printf("%18s% X\n", "System (default): ", rand.RandomBytes(32))
29+
if err := rand.RandomBytesCustomAlgorithm(CustomRNG); err != nil {
3030
log.Fatal(err)
3131
}
32-
fmt.Printf("%-18s% X\n", "Custom RNG: ", oqsrand.RandomBytes(32))
32+
fmt.Printf("%-18s% X\n", "Custom RNG: ", rand.RandomBytes(32))
3333

3434
// We do not yet support OpenSSL under Windows
3535
if runtime.GOOS != "windows" {
36-
if err := oqsrand.RandomBytesSwitchAlgorithm("OpenSSL"); err != nil {
36+
if err := rand.RandomBytesSwitchAlgorithm("OpenSSL"); err != nil {
3737
log.Fatal(err)
3838
}
39-
fmt.Printf("%-18s% X\n", "OpenSSL: ", oqsrand.RandomBytes(32))
39+
fmt.Printf("%-18s% X\n", "OpenSSL: ", rand.RandomBytes(32))
4040
}
4141
}

0 commit comments

Comments
 (0)