field_generic.go raw

   1  //go:build !amd64 && !js && !wasm && !tinygo && !wasm32
   2  
   3  package p256k1
   4  
   5  // hasFieldAsm returns true if field assembly is available.
   6  // On non-amd64 platforms, assembly is not available.
   7  func hasFieldAsm() bool {
   8  	return false
   9  }
  10  
  11  // hasFieldAsmBMI2 returns true if BMI2+ADX optimized field assembly is available.
  12  // On non-amd64 platforms, this is always false.
  13  func hasFieldAsmBMI2() bool {
  14  	return false
  15  }
  16  
  17  // fieldMulAsm is a stub for non-amd64 platforms.
  18  // It should never be called since hasFieldAsm() returns false.
  19  func fieldMulAsm(r, a, b *FieldElement) {
  20  	panic("field assembly not available on this platform")
  21  }
  22  
  23  // fieldSqrAsm is a stub for non-amd64 platforms.
  24  // It should never be called since hasFieldAsm() returns false.
  25  func fieldSqrAsm(r, a *FieldElement) {
  26  	panic("field assembly not available on this platform")
  27  }
  28  
  29  // fieldMulAsmBMI2 is a stub for non-amd64 platforms.
  30  // It should never be called since hasFieldAsmBMI2() returns false.
  31  func fieldMulAsmBMI2(r, a, b *FieldElement) {
  32  	panic("field BMI2 assembly not available on this platform")
  33  }
  34  
  35  // fieldSqrAsmBMI2 is a stub for non-amd64 platforms.
  36  // It should never be called since hasFieldAsmBMI2() returns false.
  37  func fieldSqrAsmBMI2(r, a *FieldElement) {
  38  	panic("field BMI2 assembly not available on this platform")
  39  }
  40