goc25519sm_noasm.go 1013 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. // Copyright 2021 Jeffrey H. Johnson <trnsz@pobox.com>.
  2. // Copyright 2021 Gridfinity, LLC.
  3. // Copyright 2020 The Go Authors.
  4. //
  5. // All rights reserved.
  6. //
  7. // Use of this source code is governed by the BSD-style
  8. // license that can be found in the LICENSE file.
  9. //go:build !amd64 || !gc || purego
  10. // +build !amd64 !gc purego
  11. package goc25519sm
  12. import (
  13. "fmt"
  14. )
  15. // OldScalarMult -> noasm
  16. func oldScalarMult(
  17. dst,
  18. scalar,
  19. base *[X25519Size]byte,
  20. ) error {
  21. var err error
  22. OldScalarMultGeneric(
  23. dst,
  24. scalar,
  25. base,
  26. )
  27. /* if err != nil {
  28. return fmt.Errorf(
  29. "\ngoc25519sm.oldScalarMult.OldScalarMultGeneric FAILURE:\n dst=%v\n scalar=%v\n base=%v\n %v",
  30. dst,
  31. scalar,
  32. base,
  33. err,
  34. )
  35. } */ // Intended for future use
  36. err = oldScalarMultVerify(
  37. dst,
  38. scalar,
  39. base,
  40. )
  41. if err != nil {
  42. return fmt.Errorf(
  43. "\ngoc25519sm.oldScalarMult.OldScalarMultGeneric.oldScalarMultVerify FAILURE:\n dst=%v\n scalar=%v\n base=%v\n %v",
  44. *dst,
  45. *scalar,
  46. *base,
  47. err,
  48. )
  49. }
  50. return nil
  51. }