// Copyright 2022 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

//go:build go1.20

package curve25519

import 

func x25519( *[32]byte, ,  []byte) ([]byte, error) {
	 := ecdh.X25519()
	,  := .NewPublicKey()
	if  != nil {
		return nil, 
	}
	,  := .NewPrivateKey()
	if  != nil {
		return nil, 
	}
	,  := .ECDH()
	if  != nil {
		return nil, 
	}
	copy([:], )
	return [:], nil
}

func scalarMult(, ,  *[32]byte) {
	if ,  := x25519(, [:], [:]);  != nil {
		// The only error condition for x25519 when the inputs are 32 bytes long
		// is if the output would have been the all-zero value.
		for  := range  {
			[] = 0
		}
	}
}

func scalarBaseMult(,  *[32]byte) {
	 := ecdh.X25519()
	,  := .NewPrivateKey([:])
	if  != nil {
		panic("curve25519: internal error: scalarBaseMult was not 32 bytes")
	}
	copy([:], .PublicKey().Bytes())
}